Re: [evolution-patches] #53433 : Slider not changing the timeout value....



On Wed, 2004-03-31 at 09:22 -0500, JP Rosevear wrote:
> On Tue, 2004-03-30 at 21:31, Chris Toshok wrote:
> > patch looks fine to me..  just a few minor quibbles.
> > 
> > this block could be axed entirely, as the blank line should stay and the
> > top change is just addition of space at the end of the line:
> > 
> > @@ -449,10 +457,9 @@
> >  						 GTK_MESSAGE_ERROR,
> >  						 GTK_BUTTONS_OK,
> >  						 _("Could not perform query on Root DSE"));
> > -		g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
> > +		g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);		
> >  		gtk_widget_show (dialog);
> >  	}
> > -
> >  	return ldap_error;
> >  }
> > 
> > 
> > Also, this patch just fixes the UI - there are remaining issues in
> > getting the timeout to be used in the backend.
> > 
> > go ahead and commit with the above diff removed, and thanks for the
> > patch :)
> 
> I don't think he has commit privileges.

yeah, true.. :)

attached is the new diff.

> 
> -JP
> -- 
> JP Rosevear <jpr ximian com>
> Ximian, Inc.
> 



-- 

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/ChangeLog,v
retrieving revision 1.1615
diff -u -r1.1615 ChangeLog
--- ChangeLog	18 Mar 2004 00:59:11 -0000	1.1615
+++ ChangeLog	28 Mar 2004 09:18:43 -0000
@@ -1,3 +1,15 @@
+2004-03-28  Hari Prasad Nadig  <hp ndeepak info>
+
+	Fixes #53433.
+	
+	* gui/component/addressbook-config.c (searching_tab_check): added the tab check for search tab.
+	(dialog_to_source): added timeout to be saved. 
+	(source_to_dialog): just a piece to retrieve timeout from source.
+	(addressbook_root_dse_query): few necessary changes.
+	(do_ldap_root_dse_query): again few changes that were required.
+
+	* gui/component/ldap-config.glade : set right the Hscale to display the selected value.
+
 2004-03-17  Hans Petter Jansson  <hpj ximian com>
 
 	Fixes #53625.
Index: addressbook-config.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/component/addressbook-config.c,v
retrieving revision 1.69
diff -u -r1.69 addressbook-config.c
--- addressbook-config.c	4 Mar 2004 06:03:38 -0000	1.69
+++ addressbook-config.c	28 Mar 2004 08:53:56 -0000
@@ -244,6 +244,11 @@
 		str = g_strdup_printf ("%d", gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dialog->limit_spinbutton)));
 		e_source_set_property (source, "limit", str);
 		g_free (str);
+
+		str = g_strdup_printf ("%f", gtk_adjustment_get_value (GTK_RANGE(dialog->timeout_scale)->adjustment));
+		e_source_set_property (source, "timeout", str);
+		g_free (str);
+
 		e_source_set_property (source, "ssl", ldap_unparse_ssl (dialog->ssl));
 		e_source_set_property (source, "auth", ldap_unparse_auth (dialog->auth));
 		str = g_strdup_printf ("%s:%s/%s?" /* trigraph prevention */ "?%s",
@@ -334,7 +339,10 @@
 	gtk_spin_button_set_value ( GTK_SPIN_BUTTON (dialog->limit_spinbutton),
 				    g_strtod ( source && e_source_get_property (source, "limit") ?
 					       e_source_get_property (source, "limit") : "100", NULL));
-	
+	gtk_adjustment_set_value (GTK_RANGE(dialog->timeout_scale)->adjustment,
+				    g_strtod ( source && e_source_get_property (source, "timeout") ?
+					       e_source_get_property (source, "timeout") : "3", NULL));
+
 	dialog->auth = source && e_source_get_property (source, "auth") ?
 		ldap_parse_auth (e_source_get_property (source, "auth")) : ADDRESSBOOK_LDAP_AUTH_NONE;
 	dialog->ssl = source && e_source_get_property (source, "ssl") ?
@@ -429,13 +437,13 @@
 }
 
 static int
-addressbook_root_dse_query (GtkWindow *window, LDAP *ldap, char **attrs, LDAPMessage **resp)
+addressbook_root_dse_query (AddressbookSourceDialog *dialog, GtkWindow *window, LDAP *ldap,
+char **attrs, LDAPMessage **resp)
 {
 	int ldap_error;
 	struct timeval timeout;
 
-	/* 3 second timeout */
-	timeout.tv_sec = 3;
+	timeout.tv_sec = (gint) gtk_adjustment_get_value (GTK_RANGE(dialog->timeout_scale)->adjustment);
 	timeout.tv_usec = 0;
 
 	ldap_error = ldap_search_ext_s (ldap,
@@ -743,7 +750,7 @@
 }
 
 static gboolean
-do_ldap_root_dse_query (GtkWidget *dialog, ETableModel *model, ESource *source, char ***rvalues)
+do_ldap_root_dse_query (AddressbookSourceDialog *sdialog, GtkWidget *dialog, ETableModel *model, ESource *source, char ***rvalues)
 {
 	LDAP *ldap;
 	char *attrs[2];
@@ -762,7 +769,7 @@
 	attrs[0] = "namingContexts";
 	attrs[1] = NULL;
 
-	ldap_error = addressbook_root_dse_query (GTK_WINDOW (dialog), ldap, attrs, &resp);
+	ldap_error = addressbook_root_dse_query (sdialog, GTK_WINDOW (dialog), ldap, attrs, &resp);
 
 	if (ldap_error != LDAP_SUCCESS)
 		goto fail;
@@ -827,7 +834,7 @@
 
 	search_base_selection_model_changed (selection_model, dialog);
 
-	if (do_ldap_root_dse_query (dialog, model, source, &values)) {
+	if (do_ldap_root_dse_query (sdialog, dialog, model, source, &values)) {
 		id = gtk_dialog_run (GTK_DIALOG (dialog));

 		gtk_widget_hide (dialog);
@@ -910,6 +917,19 @@
 			  G_CALLBACK(query_for_supported_bases), dialog);
 }
 
+static gboolean
+searching_tab_check (AddressbookSourceDialog *dialog)
+{
+	gboolean valid = TRUE;
+	gdouble timeout = 3;
+
+	timeout = gtk_adjustment_get_value (GTK_RANGE(dialog->timeout_scale)->adjustment);
+
+	if(!timeout)
+		return FALSE;
+	return valid;
+}
+
 static void
 druid_searching_page_prepare (GnomeDruidPage *dpage, GtkWidget *gdruid, AddressbookSourceDialog *dialog)
 {
@@ -1124,11 +1144,9 @@
 		valid = general_tab_check (dialog);
 	if (valid)
 		valid = connecting_tab_check (dialog);
-#if 0
 	if (valid)
 		valid = searching_tab_check (dialog);
 #endif
-#endif
 
 	gtk_widget_set_sensitive (dialog->ok_button, valid);
 }
@@ -1208,8 +1226,7 @@
 	attrs[0] = "objectClasses";
 	attrs[1] = NULL;
 
-	/* 3 second timeout */
-	timeout.tv_sec = 3;
+	timeout.tv_sec = (gint) gtk_adjustment_get_value (GTK_RANGE(sdialog->timeout_scale)->adjustment);
 	timeout.tv_usec = 0;
 
 	ldap_error = ldap_search_ext_s (ldap, schema_dn, LDAP_SCOPE_BASE,
Index: ldap-config.glade
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/component/ldap-config.glade,v
retrieving revision 1.20
diff -u -r1.20 ldap-config.glade
--- ldap-config.glade	12 Feb 2004 19:11:29 -0000	1.20
+++ ldap-config.glade	28 Mar 2004 09:07:54 -0000
@@ -2284,8 +2284,8 @@
 		    <widget class="GtkHScale" id="timeout-scale">
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
-		      <property name="draw_value">False</property>
-		      <property name="value_pos">GTK_POS_LEFT</property>
+		      <property name="draw_value">True</property>
+		      <property name="value_pos">GTK_POS_BOTTOM</property>
 		      <property name="digits">0</property>
 		      <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
 		      <property name="inverted">False</property>
@@ -2310,48 +2310,6 @@
 		      <property name="xalign">0</property>
 		      <property name="yalign">0.5</property>
 		      <property name="xpad">3</property>
-		      <property name="ypad">0</property>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">False</property>
-		      <property name="fill">False</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkLabel" id="label460">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Selected:</property>
-		      <property name="use_underline">False</property>
-		      <property name="use_markup">False</property>
-		      <property name="justify">GTK_JUSTIFY_CENTER</property>
-		      <property name="wrap">False</property>
-		      <property name="selectable">False</property>
-		      <property name="xalign">1</property>
-		      <property name="yalign">0.5</property>
-		      <property name="xpad">0</property>
-		      <property name="ypad">0</property>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">False</property>
-		      <property name="fill">False</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkLabel" id="label461">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">2:30</property>
-		      <property name="use_underline">False</property>
-		      <property name="use_markup">False</property>
-		      <property name="justify">GTK_JUSTIFY_CENTER</property>
-		      <property name="wrap">False</property>
-		      <property name="selectable">False</property>
-		      <property name="xalign">0.5</property>
-		      <property name="yalign">0.5</property>
-		      <property name="xpad">0</property>
 		      <property name="ypad">0</property>
 		    </widget>
 		    <packing>


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