mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-06-16 17:58:26 +02:00
* Add hiding of tabs... Still doesn't work on entry.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1924 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
e1620a9946
commit
fa6790c2da
5 changed files with 98 additions and 31 deletions
|
|
@ -230,14 +230,13 @@
|
|||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="on-main-menu">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Show on connection on menu</property>
|
||||
<property name="label" translatable="yes">Requires existing network connection</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="active">True</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
|
|
@ -705,14 +704,14 @@
|
|||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox31">
|
||||
<widget class="GtkVBox" id="gprs-options">
|
||||
<property name="border_width">10</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="gprs-options">
|
||||
<widget class="GtkVBox" id="gprs-options-vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">4</property>
|
||||
|
|
@ -957,14 +956,14 @@
|
|||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox36">
|
||||
<widget class="GtkVBox" id="auth-options">
|
||||
<property name="border_width">10</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="auth-options">
|
||||
<widget class="GtkVBox" id="auth-options-vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
|
@ -991,7 +990,7 @@
|
|||
<property name="column_spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="ppp-auth">
|
||||
<widget class="GtkCheckButton" id="ppp-auth-peer">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">When this check box is cleared the "noauth" option is passed to pppd.</property>
|
||||
<property name="can_focus">True</property>
|
||||
|
|
@ -1124,14 +1123,14 @@
|
|||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox35">
|
||||
<widget class="GtkVBox" id="comp-enc-options">
|
||||
<property name="border_width">10</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="comp-enc-options">
|
||||
<widget class="GtkVBox" id="comp-enc-options-vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
|
@ -1408,14 +1407,14 @@
|
|||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox32">
|
||||
<widget class="GtkVBox" id="ppp-options">
|
||||
<property name="border_width">10</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="ppp-options">
|
||||
<widget class="GtkVBox" id="ppp-options-vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">6</property>
|
||||
|
|
@ -2132,14 +2131,14 @@
|
|||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox33">
|
||||
<widget class="GtkVBox" id="serial-options">
|
||||
<property name="border_width">10</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="serial-options">
|
||||
<widget class="GtkVBox" id="serial-options-vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">4</property>
|
||||
|
|
@ -2264,14 +2263,14 @@
|
|||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox34">
|
||||
<widget class="GtkVBox" id="routing-options">
|
||||
<property name="border_width">10</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="routing-options">
|
||||
<widget class="GtkVBox" id="routing-options-vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">4</property>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
#define BUILD_BLUETOOTH
|
||||
|
||||
#define VPNUI_DISPLAY_NAME _("Tunnel via pppd")
|
||||
#define VPNUI_DISPLAY_NAME _("pppd tunnel (PPTP, BTGPRS, Dialup)")
|
||||
#define VPNUI_SERVICE_NAME "org.freedesktop.NetworkManager.ppp_starter"
|
||||
#define VPNUI_BASIC_DEFAULTS "connection-name='';" \
|
||||
"ppp-debug=no;" \
|
||||
|
|
@ -50,9 +50,9 @@
|
|||
"usepeerdns-overtunnel=yes;" \
|
||||
"ppp-lock=yes;" \
|
||||
"ppp-auth-peer=no;" \
|
||||
"refuse-eap=no;" \
|
||||
"refuse-chap=no;" \
|
||||
"refuse-mschap=no;" \
|
||||
"ppp-refuse-eap=no;" \
|
||||
"ppp-refuse-chap=no;" \
|
||||
"ppp-refuse-mschap=no;" \
|
||||
"lcp-echo-failure=10;" \
|
||||
"lcp-echo-interval=10;" \
|
||||
"use-routes=no;" \
|
||||
|
|
@ -85,8 +85,8 @@
|
|||
"compress-mppc=no;" \
|
||||
"compress-bsd=no;" \
|
||||
"compress-deflate=no;" \
|
||||
"mru=1400;" \
|
||||
"mtu=1400;"
|
||||
"mru=1416;" \
|
||||
"mtu=1416;"
|
||||
#define VPNUI_DIALUP_DEFAULTS "phone-number=THIS DOESN'T DO ANYTHING;" \
|
||||
"ppp-crtscts=yes;" \
|
||||
"ppp-modem=yes;" \
|
||||
|
|
@ -103,6 +103,7 @@
|
|||
#endif
|
||||
|
||||
void impl_setup (NetworkManagerVpnUIImpl *impl);
|
||||
void impl_hide_and_show (NetworkManagerVpnUIImpl *impl);
|
||||
void use_routes_toggled (GtkToggleButton *togglebutton, gpointer user_data);
|
||||
void editable_changed (GtkEditable *editable, gpointer user_data);
|
||||
void variant_changed (GtkComboBox *combo, gpointer user_data);
|
||||
|
|
@ -292,11 +293,13 @@ impl_setup (NetworkManagerVpnUIImpl *impl)
|
|||
"routes" , VPN_UI_OPTTYPE_STRING ,
|
||||
"routes", "X-NM-Routes", _("Specific networks available"),
|
||||
GTK_SIGNAL_FUNC(&editable_changed), &vld_routes_if_sens, impl );
|
||||
impl->routes_opt = opt;
|
||||
|
||||
opt = vpnui_opt_new(
|
||||
"use-routes" , VPN_UI_OPTTYPE_YESNO ,
|
||||
"use-routes", "Use-Routes", _("Limit to specific networks"),
|
||||
GTK_SIGNAL_FUNC(&use_routes_toggled), NULL, impl );
|
||||
impl->routes_toggle_opt = opt;
|
||||
|
||||
variant = vpnui_variant_new( "pptp","Windows VPN (PPTP)",
|
||||
VPNUI_BASIC_DEFAULTS VPNUI_PPTP_DEFAULTS,
|
||||
|
|
@ -328,7 +331,7 @@ impl_setup (NetworkManagerVpnUIImpl *impl)
|
|||
|
||||
// Attach an import_button
|
||||
impl->w_import_button = GTK_BUTTON (glade_xml_get_widget (impl->xml,
|
||||
"import-button"));
|
||||
"import-config-button"));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -372,6 +375,8 @@ variant_changed (GtkComboBox *combo, gpointer user_data)
|
|||
|
||||
vpnui_variant_select_byname(impl,variant_name);
|
||||
|
||||
impl_hide_and_show(impl);
|
||||
|
||||
// vpnui_expand_reset_all(impl);
|
||||
|
||||
if (impl->callback != NULL) {
|
||||
|
|
@ -383,3 +388,46 @@ variant_changed (GtkComboBox *combo, gpointer user_data)
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
impl_hide_and_show (NetworkManagerVpnUIImpl *impl)
|
||||
{
|
||||
GtkWidget *serial_options = NULL;
|
||||
GtkWidget *gprs_options = NULL;
|
||||
GtkWidget *bluetooth_front = NULL;
|
||||
GtkWidget *pptp_front = NULL;
|
||||
GtkWidget *dialup_front = NULL;
|
||||
GtkComboBox *combo = NULL;
|
||||
char *variant_name;
|
||||
|
||||
if (impl==NULL) return;
|
||||
if (impl->xml==NULL) return;
|
||||
|
||||
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");
|
||||
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");
|
||||
dialup_front = glade_xml_get_widget(impl->xml, "dialup-front");
|
||||
pptp_front = glade_xml_get_widget(impl->xml, "pptp-front");
|
||||
|
||||
if (pptp_front) gtk_widget_hide(pptp_front);
|
||||
if (bluetooth_front) gtk_widget_hide(bluetooth_front);
|
||||
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 (strcmp(variant_name,"pptp")==0) {
|
||||
if (pptp_front) gtk_widget_show(pptp_front);
|
||||
} else if (strcmp(variant_name,"dialup")==0) {
|
||||
if (dialup_front) gtk_widget_show(dialup_front);
|
||||
if (serial_options) gtk_widget_show(serial_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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
extern const char *GLADE_FILE;
|
||||
extern const char *GLADE_WIDGET;
|
||||
extern void impl_setup (NetworkManagerVpnUIImpl *impl);
|
||||
extern void impl_hide_and_show (NetworkManagerVpnUIImpl *impl);
|
||||
|
||||
static void
|
||||
impl_set_validity_changed_callback (NetworkManagerVpnUI *self,
|
||||
|
|
@ -38,14 +39,15 @@ impl_clear_widget (NetworkManagerVpnUIImpl *impl)
|
|||
|
||||
g_return_if_fail(impl!=NULL);
|
||||
|
||||
vpnui_opt_set(impl->connection_name_opt,"");
|
||||
if (impl->connection_name_opt!=NULL) vpnui_opt_set(impl->connection_name_opt,"");
|
||||
if (impl->defaults!=NULL)
|
||||
for (item=impl->config_options; item != NULL; item = g_slist_next(item))
|
||||
{
|
||||
vpnui_opt_set_default((VpnUIConfigOption *)item->data, impl->defaults);
|
||||
}
|
||||
|
||||
vpnui_expand_reset_all(impl);
|
||||
// vpnui_expand_reset_all(impl);
|
||||
impl_hide_and_show(impl);
|
||||
}
|
||||
|
||||
static const char *
|
||||
|
|
@ -97,12 +99,13 @@ impl_get_widget (NetworkManagerVpnUI *self, GSList *properties, GSList *routes,
|
|||
}
|
||||
str = g_string_free (route_str, FALSE);
|
||||
|
||||
vpnui_opt_set(impl->routes_opt,str);
|
||||
vpnui_opt_set(impl->routes_toggle_opt,"yes");
|
||||
if(impl->routes_opt!=NULL) vpnui_opt_set(impl->routes_opt,str);
|
||||
if(impl->routes_toggle_opt!=NULL) vpnui_opt_set(impl->routes_toggle_opt,"yes");
|
||||
g_free (str);
|
||||
}
|
||||
|
||||
vpnui_expand_reset_all(impl);
|
||||
// vpnui_expand_reset_all(impl);
|
||||
impl_hide_and_show(impl);
|
||||
|
||||
return impl->widget;
|
||||
}
|
||||
|
|
@ -275,6 +278,8 @@ import_from_file (NetworkManagerVpnUIImpl *impl, const char *path)
|
|||
|
||||
g_free (basename);
|
||||
|
||||
impl_hide_and_show(impl);
|
||||
|
||||
return file_is_good;
|
||||
|
||||
// if (!file_is_good) {
|
||||
|
|
@ -292,6 +297,15 @@ import_from_file (NetworkManagerVpnUIImpl *impl, const char *path)
|
|||
// }
|
||||
}
|
||||
|
||||
static void
|
||||
show_widget (GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
g_warning("Widget show event");
|
||||
|
||||
impl_hide_and_show((NetworkManagerVpnUIImpl *) user_data);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
import_button_clicked (GtkButton *button, gpointer user_data)
|
||||
{
|
||||
|
|
@ -385,8 +399,8 @@ export_to_file (NetworkManagerVpnUIImpl *impl, const char *path,
|
|||
}
|
||||
str = g_string_free (route_str, FALSE);
|
||||
|
||||
vpnui_opt_set(impl->routes_opt,str);
|
||||
vpnui_opt_set(impl->routes_toggle_opt,"yes");
|
||||
if (impl->routes_opt!=NULL) vpnui_opt_set(impl->routes_opt,str);
|
||||
if (impl->routes_toggle_opt!=NULL) vpnui_opt_set(impl->routes_toggle_opt,"yes");
|
||||
g_free (str);
|
||||
}
|
||||
|
||||
|
|
@ -515,6 +529,9 @@ impl_get_object (void)
|
|||
"clicked", GTK_SIGNAL_FUNC (import_button_clicked), impl);
|
||||
}
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (impl->widget),
|
||||
"show", GTK_SIGNAL_FUNC (show_widget), impl);
|
||||
|
||||
/* make the widget reusable */
|
||||
gtk_signal_connect (GTK_OBJECT (impl->widget), "delete-event",
|
||||
GTK_SIGNAL_FUNC (gtk_widget_hide_on_delete), NULL);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#define NM_VPN_API_SUBJECT_TO_CHANGE
|
||||
#include <NetworkManager/nm-vpn-ui-interface.h>
|
||||
|
||||
|
||||
struct impl_config
|
||||
{
|
||||
const char *display_name;
|
||||
|
|
@ -21,10 +22,13 @@ struct impl_config
|
|||
typedef struct _VpnUIConfigOption VpnUIConfigOption;
|
||||
typedef struct _NetworkManagerVpnUIImpl NetworkManagerVpnUIImpl;
|
||||
|
||||
typedef void (*VpnUIHideShowCallback) (NetworkManagerVpnUIImpl *self);
|
||||
|
||||
struct _NetworkManagerVpnUIImpl {
|
||||
NetworkManagerVpnUI parent;
|
||||
|
||||
NetworkManagerVpnUIDialogValidityCallback callback;
|
||||
VpnUIHideShowCallback do_hide_and_show;
|
||||
gpointer callback_user_data;
|
||||
|
||||
GladeXML *xml;
|
||||
|
|
|
|||
|
|
@ -104,7 +104,6 @@ vpnui_variant_select (VpnUIVariant *variant)
|
|||
for (item=impl->config_options; item != NULL; item = g_slist_next(item)) {
|
||||
vpnui_opt_set_default((VpnUIConfigOption *)item->data, impl->defaults);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue