mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-23 17:50:07 +01:00
* Auto-hide nearly everything if no type is selected.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1934 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
66e2f92407
commit
75dfd0f18c
4 changed files with 33 additions and 6 deletions
|
|
@ -393,6 +393,10 @@ impl_hide_and_show (NetworkManagerVpnUIImpl *impl)
|
|||
{
|
||||
GtkWidget *serial_options = NULL;
|
||||
GtkWidget *gprs_options = NULL;
|
||||
GtkWidget *auth_options = NULL;
|
||||
GtkWidget *comp_enc_options = NULL;
|
||||
GtkWidget *routing_options = NULL;
|
||||
GtkWidget *ppp_options = NULL;
|
||||
GtkWidget *bluetooth_front = NULL;
|
||||
GtkWidget *pptp_front = NULL;
|
||||
GtkWidget *dialup_front = NULL;
|
||||
|
|
@ -404,10 +408,11 @@ impl_hide_and_show (NetworkManagerVpnUIImpl *impl)
|
|||
|
||||
combo = GTK_COMBO_BOX(glade_xml_get_widget(impl->xml, "ppp-connection-type"));
|
||||
if (combo==NULL) return;
|
||||
variant_name=gtk_combo_box_get_active_text(combo);
|
||||
if (variant_name==NULL) return;
|
||||
|
||||
// ppp_options = glade_xml_get_widget(impl->xml, "ppp-options");
|
||||
ppp_options = glade_xml_get_widget(impl->xml, "ppp-options");
|
||||
auth_options = glade_xml_get_widget(impl->xml, "auth-options");
|
||||
comp_enc_options = glade_xml_get_widget(impl->xml, "comp-enc-options");
|
||||
routing_options = glade_xml_get_widget(impl->xml, "routing-options");
|
||||
gprs_options = glade_xml_get_widget(impl->xml, "gprs-options");
|
||||
serial_options = glade_xml_get_widget(impl->xml, "serial-options");
|
||||
bluetooth_front = glade_xml_get_widget(impl->xml, "bluetooth-front");
|
||||
|
|
@ -419,15 +424,34 @@ impl_hide_and_show (NetworkManagerVpnUIImpl *impl)
|
|||
if (dialup_front) gtk_widget_hide(dialup_front);
|
||||
if (gprs_options) gtk_widget_hide(gprs_options);
|
||||
if (serial_options) gtk_widget_hide(serial_options);
|
||||
if (ppp_options) gtk_widget_hide(ppp_options);
|
||||
if (auth_options) gtk_widget_hide(auth_options);
|
||||
if (comp_enc_options) gtk_widget_hide(comp_enc_options);
|
||||
if (routing_options) gtk_widget_hide(routing_options);
|
||||
|
||||
variant_name=gtk_combo_box_get_active_text(combo);
|
||||
if (variant_name==NULL) return;
|
||||
|
||||
if (strcmp(variant_name,"pptp")==0) {
|
||||
if (pptp_front) gtk_widget_show(pptp_front);
|
||||
if (pptp_front) gtk_widget_show(pptp_front);
|
||||
if (ppp_options) gtk_widget_show(ppp_options);
|
||||
if (auth_options) gtk_widget_show(auth_options);
|
||||
if (comp_enc_options) gtk_widget_show(comp_enc_options);
|
||||
if (routing_options) gtk_widget_show(routing_options);
|
||||
} else if (strcmp(variant_name,"dialup")==0) {
|
||||
if (dialup_front) gtk_widget_show(dialup_front);
|
||||
if (serial_options) gtk_widget_show(serial_options);
|
||||
if (ppp_options) gtk_widget_show(ppp_options);
|
||||
if (auth_options) gtk_widget_show(auth_options);
|
||||
if (comp_enc_options) gtk_widget_show(comp_enc_options);
|
||||
if (routing_options) gtk_widget_show(routing_options);
|
||||
} else if (strcmp(variant_name,"btgprs")==0) {
|
||||
if (bluetooth_front) gtk_widget_show(bluetooth_front);
|
||||
if (gprs_options) gtk_widget_show(gprs_options);
|
||||
if (serial_options) gtk_widget_show(serial_options);
|
||||
if (ppp_options) gtk_widget_show(ppp_options);
|
||||
if (auth_options) gtk_widget_show(auth_options);
|
||||
if (comp_enc_options) gtk_widget_show(comp_enc_options);
|
||||
if (routing_options) gtk_widget_show(routing_options);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ impl_clear_widget (NetworkManagerVpnUIImpl *impl)
|
|||
g_return_if_fail(impl!=NULL);
|
||||
|
||||
if (impl->connection_name_opt!=NULL) vpnui_opt_set(impl->connection_name_opt,"");
|
||||
if (impl->variant_combo!=NULL) gtk_combo_box_set_active(impl->variant_combo,-1);
|
||||
if (impl->defaults!=NULL)
|
||||
for (item=impl->config_options; item != NULL; item = g_slist_next(item))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -183,6 +183,7 @@ void vpnui_opt_set(VpnUIConfigOption *opt, const char *value)
|
|||
return;
|
||||
}
|
||||
}
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(opt->widget),-1);
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,6 +80,8 @@ vpnui_variant_byname (NetworkManagerVpnUIImpl *impl, const char *name)
|
|||
GSList *item;
|
||||
VpnUIVariant *variant;
|
||||
|
||||
if (name==NULL) return NULL;
|
||||
|
||||
for (item=impl->variants; item != NULL; item = g_slist_next(item))
|
||||
{
|
||||
variant = (VpnUIVariant *)item->data;
|
||||
|
|
@ -113,10 +115,9 @@ vpnui_variant_select_byname (NetworkManagerVpnUIImpl *impl, const char *name)
|
|||
VpnUIVariant *variant;
|
||||
|
||||
g_return_if_fail(impl != NULL);
|
||||
g_return_if_fail(name != NULL);
|
||||
|
||||
variant = vpnui_variant_byname(impl,name);
|
||||
g_return_if_fail(variant != NULL);
|
||||
if (variant == NULL) return;
|
||||
vpnui_variant_select(variant);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue