=?UTF-8?B?W1BBVENIXSBtdWx0aXBsZSByZW1vdGVzIGFuZCByZW1vdGUtcmFuZG9tIGlu?= =?UTF-8?B?IG9wZW52cG4=?=



Hello!
I've made a patch to support subj. in NM. Multiple hosts just separated by commas and/or spaces in gateway_entry. I think it's still suitable for including into the project, though may be the "NM way" is to use GtkTree and other forms for each new host.
wbr.
P.S.
i've sent similar mail 14.12.2011, but w/o PATCH keyword, so it seems unnoticed.
diff -ur NetworkManager-openvpn-0.9.3.995.orig/po/ru.po NetworkManager-openvpn-0.9.3.995/po/ru.po
--- NetworkManager-openvpn-0.9.3.995.orig/po/ru.po	2012-02-11 02:30:14.000000000 +0400
+++ NetworkManager-openvpn-0.9.3.995/po/ru.po	2012-03-16 03:39:40.631655853 +0400
@@ -356,6 +356,9 @@
 msgid "_Gateway:"
 msgstr "_Шлюз:"
 
+msgid "_Randomize remote hosts"
+msgstr "_Случайный шлюз"
+
 #: ../src/nm-openvpn-service.c:192
 #, c-format
 msgid "invalid address '%s'"
Только в NetworkManager-openvpn-0.9.3.995/po: ru.po.orig
diff -ur NetworkManager-openvpn-0.9.3.995.orig/properties/nm-openvpn.c NetworkManager-openvpn-0.9.3.995/properties/nm-openvpn.c
--- NetworkManager-openvpn-0.9.3.995.orig/properties/nm-openvpn.c	2012-02-11 02:30:14.000000000 +0400
+++ NetworkManager-openvpn-0.9.3.995/properties/nm-openvpn.c	2012-03-16 03:39:40.634655850 +0400
@@ -290,6 +290,15 @@
 	}
 	g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (stuff_changed_cb), self);
 
+	widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "remoterandom_checkbutton"));
+	g_return_val_if_fail (widget != NULL, FALSE);
+	if (s_vpn) {
+		value = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_REMOTE_RANDOM);
+		if (value && !strcmp (value, "yes"))
+			gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
+	}
+	g_signal_connect (G_OBJECT (widget), "toggled", G_CALLBACK (stuff_changed_cb), self);
+
 	widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "auth_combo"));
 	g_return_val_if_fail (widget != NULL, FALSE);
 	gtk_size_group_add_widget (priv->group, widget);
@@ -435,6 +444,11 @@
 	if (str && strlen (str))
 		nm_setting_vpn_add_data_item (s_vpn, NM_OPENVPN_KEY_REMOTE, str);
 
+	/* Remote random */
+	widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "remoterandom_checkbutton"));
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
+		nm_setting_vpn_add_data_item (s_vpn, NM_OPENVPN_KEY_REMOTE_RANDOM, g_strdup ("yes"));
+
 	auth_type = get_auth_type (priv->builder);
 	if (auth_type) {
 		nm_setting_vpn_add_data_item (s_vpn, NM_OPENVPN_KEY_CONNECTION_TYPE, auth_type);
diff -ur NetworkManager-openvpn-0.9.3.995.orig/properties/nm-openvpn-dialog.ui NetworkManager-openvpn-0.9.3.995/properties/nm-openvpn-dialog.ui
--- NetworkManager-openvpn-0.9.3.995.orig/properties/nm-openvpn-dialog.ui	2012-02-11 02:30:14.000000000 +0400
+++ NetworkManager-openvpn-0.9.3.995/properties/nm-openvpn-dialog.ui	2012-03-16 03:39:40.633655851 +0400
@@ -1108,6 +1108,30 @@
             <property name="position">1</property>
           </packing>
         </child>
+        <child>
+          <object class="GtkAlignment" id="alignment30">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="left_padding">12</property>
+            <child>
+              <object class="GtkCheckButton" id="remoterandom_checkbutton">
+                <property name="label" translatable="yes">_Randomize remote hosts</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_underline">True</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
       </object>
       <packing>
         <property name="expand">False</property>
Только в NetworkManager-openvpn-0.9.3.995/properties: nm-openvpn-dialog.ui.orig
diff -ur NetworkManager-openvpn-0.9.3.995.orig/src/nm-openvpn-service.c NetworkManager-openvpn-0.9.3.995/src/nm-openvpn-service.c
--- NetworkManager-openvpn-0.9.3.995.orig/src/nm-openvpn-service.c	2012-02-11 02:30:14.000000000 +0400
+++ NetworkManager-openvpn-0.9.3.995/src/nm-openvpn-service.c	2012-03-16 03:39:40.630655854 +0400
@@ -111,6 +111,7 @@
 	{ NM_OPENVPN_KEY_PROXY_RETRY,          G_TYPE_BOOLEAN, 0, 0, FALSE },
 	{ NM_OPENVPN_KEY_HTTP_PROXY_USERNAME,  G_TYPE_STRING, 0, 0, FALSE },
 	{ NM_OPENVPN_KEY_REMOTE,               G_TYPE_STRING, 0, 0, FALSE },
+	{ NM_OPENVPN_KEY_REMOTE_RANDOM,        G_TYPE_BOOLEAN, 0, 0, FALSE },
 	{ NM_OPENVPN_KEY_REMOTE_IP,            G_TYPE_STRING, 0, 0, TRUE },
 	{ NM_OPENVPN_KEY_RENEG_SECONDS,        G_TYPE_INT, 0, G_MAXINT, FALSE },
 	{ NM_OPENVPN_KEY_STATIC_KEY,           G_TYPE_STRING, 0, 0, FALSE },
@@ -775,10 +776,20 @@
 
 	tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_REMOTE);
 	if (tmp && strlen (tmp)) {
-		add_openvpn_arg (args, "--remote");
-		add_openvpn_arg (args, tmp);
+		char *tok;
+		while ((tok = strsep((char**)&tmp, " ,")) != NULL) {
+			if (strlen(tok)) {
+				add_openvpn_arg (args, "--remote");
+				add_openvpn_arg (args, tok);
+			}
+		}
 	}
 
+	/* Remote random */
+	tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_REMOTE_RANDOM);
+	if (tmp && !strcmp (tmp, "yes"))
+		add_openvpn_arg (args, "--remote-random");
+
 	tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_PROXY_TYPE);
 	tmp2 = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_PROXY_SERVER);
 	tmp3 = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_PROXY_PORT);
Только в NetworkManager-openvpn-0.9.3.995/src: nm-openvpn-service.c.orig
diff -ur NetworkManager-openvpn-0.9.3.995.orig/src/nm-openvpn-service.h NetworkManager-openvpn-0.9.3.995/src/nm-openvpn-service.h
--- NetworkManager-openvpn-0.9.3.995.orig/src/nm-openvpn-service.h	2011-06-03 02:57:47.000000000 +0400
+++ NetworkManager-openvpn-0.9.3.995/src/nm-openvpn-service.h	2012-03-16 03:39:40.630655854 +0400
@@ -56,6 +56,7 @@
 #define NM_OPENVPN_KEY_PROXY_RETRY "proxy-retry"
 #define NM_OPENVPN_KEY_HTTP_PROXY_USERNAME "http-proxy-username"
 #define NM_OPENVPN_KEY_REMOTE "remote"
+#define NM_OPENVPN_KEY_REMOTE_RANDOM "remote-random"
 #define NM_OPENVPN_KEY_REMOTE_IP "remote-ip"
 #define NM_OPENVPN_KEY_STATIC_KEY "static-key"
 #define NM_OPENVPN_KEY_STATIC_KEY_DIRECTION "static-key-direction"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]