[gnome-control-center] network: add the manual proxy port spin buttons



commit 77e70598d96a9591496f314c35f25b5f6dfe2da3
Author: Richard Hughes <richard hughsie com>
Date:   Tue Dec 14 13:10:53 2010 +0000

    network: add the manual proxy port spin buttons

 panels/network/cc-network-panel.c |   39 +++++++++++++----
 panels/network/network.ui         |   84 +++++++++++++++++++++++++++++++++----
 2 files changed, 106 insertions(+), 17 deletions(-)
---
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index 578eb13..15029dc 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -619,7 +619,7 @@ panel_add_devices_columns (CcNetworkPanel *panel, GtkTreeView *treeview)
 
 	/* image */
 	renderer = gtk_cell_renderer_pixbuf_new ();
-	g_object_set (renderer, "stock-size", GTK_ICON_SIZE_DIALOG, NULL);
+	g_object_set (renderer, "stock-size", GTK_ICON_SIZE_DND, NULL);
 	column = gtk_tree_view_column_new_with_attributes ("", renderer,
 							   "icon-name", PANEL_COLUMN_ICON,
 							   NULL);
@@ -907,6 +907,7 @@ cc_network_panel_init (CcNetworkPanel *panel)
 	GSettings *settings_tmp;
 	GtkTreePath *path;
 	GtkTreeSelection *selection;
+	GtkAdjustment *adjustment;
 	GtkWidget *widget;
 
 	panel->priv = NETWORK_PANEL_PRIVATE (panel);
@@ -961,36 +962,56 @@ cc_network_panel_init (CcNetworkPanel *panel)
 	/* bind the proxy values */
 	settings_tmp = g_settings_new ("org.gnome.system.proxy.http");
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder,
-						     "label_proxy_http"));
+						     "entry_proxy_http"));
 	g_settings_bind (settings_tmp, "host",
-			 widget, "label",
+			 widget, "text",
+			 G_SETTINGS_BIND_DEFAULT);
+	adjustment = GTK_ADJUSTMENT (gtk_builder_get_object (panel->priv->builder,
+							     "adjustment_proxy_port_http"));
+	g_settings_bind (settings_tmp, "port",
+			 adjustment, "value",
 			 G_SETTINGS_BIND_DEFAULT);
 	g_object_unref (settings_tmp);
 
 	/* bind the proxy values */
 	settings_tmp = g_settings_new ("org.gnome.system.proxy.https");
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder,
-						     "label_proxy_https"));
+						     "entry_proxy_https"));
 	g_settings_bind (settings_tmp, "host",
-			 widget, "label",
+			 widget, "text",
+			 G_SETTINGS_BIND_DEFAULT);
+	adjustment = GTK_ADJUSTMENT (gtk_builder_get_object (panel->priv->builder,
+							     "adjustment_proxy_port_https"));
+	g_settings_bind (settings_tmp, "port",
+			 adjustment, "value",
 			 G_SETTINGS_BIND_DEFAULT);
 	g_object_unref (settings_tmp);
 
 	/* bind the proxy values */
 	settings_tmp = g_settings_new ("org.gnome.system.proxy.ftp");
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder,
-						     "label_proxy_ftp"));
+						     "entry_proxy_ftp"));
 	g_settings_bind (settings_tmp, "host",
-			 widget, "label",
+			 widget, "text",
+			 G_SETTINGS_BIND_DEFAULT);
+	adjustment = GTK_ADJUSTMENT (gtk_builder_get_object (panel->priv->builder,
+							     "adjustment_proxy_port_ftp"));
+	g_settings_bind (settings_tmp, "port",
+			 adjustment, "value",
 			 G_SETTINGS_BIND_DEFAULT);
 	g_object_unref (settings_tmp);
 
 	/* bind the proxy values */
 	settings_tmp = g_settings_new ("org.gnome.system.proxy.socks");
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder,
-						     "label_proxy_socks"));
+						     "entry_proxy_socks"));
 	g_settings_bind (settings_tmp, "host",
-			 widget, "label",
+			 widget, "text",
+			 G_SETTINGS_BIND_DEFAULT);
+	adjustment = GTK_ADJUSTMENT (gtk_builder_get_object (panel->priv->builder,
+							     "adjustment_proxy_port_socks"));
+	g_settings_bind (settings_tmp, "port",
+			 adjustment, "value",
 			 G_SETTINGS_BIND_DEFAULT);
 	g_object_unref (settings_tmp);
 
diff --git a/panels/network/network.ui b/panels/network/network.ui
index 1856830..ff285a8 100644
--- a/panels/network/network.ui
+++ b/panels/network/network.ui
@@ -1071,9 +1071,10 @@
                                       </packing>
                                     </child>
                                     <child>
-                                      <object class="GtkLabel" id="label_proxy_http">
+                                      <object class="GtkEntry" id="entry_proxy_http">
                                         <property name="visible">True</property>
-                                        <property name="label">dave.lan</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">â??</property>
                                       </object>
                                       <packing>
                                         <property name="expand">False</property>
@@ -1081,6 +1082,17 @@
                                         <property name="position">1</property>
                                       </packing>
                                     </child>
+                                    <child>
+                                      <object class="GtkSpinButton" id="spinbutton_proxy_http">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">â??</property>
+                                        <property name="adjustment">adjustment_proxy_port_http</property>
+                                      </object>
+                                      <packing>
+                                        <property name="position">2</property>
+                                      </packing>
+                                    </child>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
@@ -1115,9 +1127,10 @@
                                       </packing>
                                     </child>
                                     <child>
-                                      <object class="GtkLabel" id="label_proxy_https">
+                                      <object class="GtkEntry" id="entry_proxy_https">
                                         <property name="visible">True</property>
-                                        <property name="label">dave.lan</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">â??</property>
                                       </object>
                                       <packing>
                                         <property name="expand">False</property>
@@ -1125,6 +1138,17 @@
                                         <property name="position">1</property>
                                       </packing>
                                     </child>
+                                    <child>
+                                      <object class="GtkSpinButton" id="spinbutton_proxy_https">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">â??</property>
+                                        <property name="adjustment">adjustment_proxy_port_https</property>
+                                      </object>
+                                      <packing>
+                                        <property name="position">2</property>
+                                      </packing>
+                                    </child>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
@@ -1159,9 +1183,10 @@
                                       </packing>
                                     </child>
                                     <child>
-                                      <object class="GtkLabel" id="label_proxy_ftp">
+                                      <object class="GtkEntry" id="entry_proxy_ftp">
                                         <property name="visible">True</property>
-                                        <property name="label">dave.lan</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">â??</property>
                                       </object>
                                       <packing>
                                         <property name="expand">False</property>
@@ -1169,6 +1194,17 @@
                                         <property name="position">1</property>
                                       </packing>
                                     </child>
+                                    <child>
+                                      <object class="GtkSpinButton" id="spinbutton_proxy_ftp">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">â??</property>
+                                        <property name="adjustment">adjustment_proxy_port_ftp</property>
+                                      </object>
+                                      <packing>
+                                        <property name="position">2</property>
+                                      </packing>
+                                    </child>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
@@ -1203,9 +1239,10 @@
                                       </packing>
                                     </child>
                                     <child>
-                                      <object class="GtkLabel" id="label_proxy_socks">
+                                      <object class="GtkEntry" id="entry_proxy_socks">
                                         <property name="visible">True</property>
-                                        <property name="label">dave.lan</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">â??</property>
                                       </object>
                                       <packing>
                                         <property name="expand">False</property>
@@ -1213,6 +1250,17 @@
                                         <property name="position">1</property>
                                       </packing>
                                     </child>
+                                    <child>
+                                      <object class="GtkSpinButton" id="spinbutton_proxy_socks">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">â??</property>
+                                        <property name="adjustment">adjustment_proxy_port_socks</property>
+                                      </object>
+                                      <packing>
+                                        <property name="position">2</property>
+                                      </packing>
+                                    </child>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
@@ -1410,4 +1458,24 @@
       </row>
     </data>
   </object>
+  <object class="GtkAdjustment" id="adjustment_proxy_port_http">
+    <property name="lower">0</property>
+    <property name="upper">65535</property>
+    <property name="step_increment">1</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment_proxy_port_https">
+    <property name="lower">0</property>
+    <property name="upper">65535</property>
+    <property name="step_increment">1</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment_proxy_port_ftp">
+    <property name="lower">0</property>
+    <property name="upper">65535</property>
+    <property name="step_increment">1</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment_proxy_port_socks">
+    <property name="lower">0</property>
+    <property name="upper">65535</property>
+    <property name="step_increment">1</property>
+  </object>
 </interface>



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