[Gnucash-changes] Fix items from Volker Englisch's review of the setup druid.

David Hampton hampton at cvs.gnucash.org
Wed Oct 26 02:41:11 EDT 2005


Log Message:
-----------
Fix items from Volker Englisch's review of the setup druid.  The
initial window now sets the "Setup" button as the default button.
Update the druid to fix problems with the tab focus.  Add some
clarifying text on how to restart gconf.  Update the script to restart
gconf for the user.

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash:
        ChangeLog
    gnucash/src/bin:
        update-gnucash-gconf.in
    gnucash/src/gnome-utils:
        druid-gconf-setup.c
        druid-gconf-setup.glade

Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1487.2.353
retrieving revision 1.1487.2.354
diff -LChangeLog -LChangeLog -u -r1.1487.2.353 -r1.1487.2.354
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,13 @@
+2005-10-26  David Hampton  <hampton at employees.org>
+
+	* src/bin/update-gnucash-gconf.in:
+	* src/gnome-utils/druid-gconf-setup.c:
+	* src/gnome-utils/druid-gconf-setup.glade: Fix items from Volker
+	Englisch's review of the setup druid.  The initial window now sets
+	the "Setup" button as the default button.  Update the druid to fix
+	problems with the tab focus.  Add some clarifying text on how to
+	restart gconf.  Update the script to restart gconf for the user.
+
 2005-10-25  David Hampton  <hampton at employees.org>
 
 	* src/business/business-gnome/gnc-plugin-business.c:
Index: update-gnucash-gconf.in
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/bin/Attic/update-gnucash-gconf.in,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -Lsrc/bin/update-gnucash-gconf.in -Lsrc/bin/update-gnucash-gconf.in -u -r1.1.2.1 -r1.1.2.2
--- src/bin/update-gnucash-gconf.in
+++ src/bin/update-gnucash-gconf.in
@@ -6,3 +6,4 @@
 for file in *.schemas; do
   gconftool-2 --config-source=xml::${HOME}/.gconf --install-schema-file $file;
 done
+gconftool-2 --shutdown
Index: druid-gconf-setup.glade
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/Attic/druid-gconf-setup.glade,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -Lsrc/gnome-utils/druid-gconf-setup.glade -Lsrc/gnome-utils/druid-gconf-setup.glade -u -r1.1.2.3 -r1.1.2.4
--- src/gnome-utils/druid-gconf-setup.glade
+++ src/gnome-utils/druid-gconf-setup.glade
@@ -134,6 +134,7 @@
 	      <property name="can_default">True</property>
 	      <property name="has_default">True</property>
 	      <property name="can_focus">True</property>
+	      <property name="has_focus">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
 	      <property name="focus_on_click">True</property>
 	      <property name="response_id">-3</property>
@@ -323,7 +324,7 @@
 		  <child>
 		    <widget class="GtkScrolledWindow" id="scrolledwindow1">
 		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
+		      <property name="sensitive">False</property>
 		      <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
 		      <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
 		      <property name="shadow_type">GTK_SHADOW_NONE</property>
@@ -405,9 +406,9 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkScrolledWindow" id="scrolledwindow3">
+		    <widget class="GtkScrolledWindow" id="scrolledwindow2">
 		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
+		      <property name="sensitive">False</property>
 		      <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
 		      <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
 		      <property name="shadow_type">GTK_SHADOW_NONE</property>
@@ -444,9 +445,9 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkScrolledWindow" id="scrolledwindow4">
+		    <widget class="GtkScrolledWindow" id="scrolledwindow3">
 		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
+		      <property name="sensitive">False</property>
 		      <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
 		      <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
 		      <property name="shadow_type">GTK_SHADOW_NONE</property>
@@ -468,7 +469,7 @@
 			  <property name="left_margin">0</property>
 			  <property name="right_margin">0</property>
 			  <property name="indent">0</property>
-			  <property name="text" translatable="yes">This method will install the Gnucash default settings and descriptions into the .gconf directory within your home directory.  The disadvantage to this method is that an update to GnuCash will not update your local settings to add in new keys.</property>
+			  <property name="text" translatable="yes">This method will install the Gnucash default settings and descriptions into the .gconf directory within your home directory.  The disadvantage to this method is that future updates to GnuCash will not update your local settings to add in new keys.</property>
 			</widget>
 		      </child>
 		    </widget>
@@ -496,7 +497,7 @@
       <child>
 	<widget class="GnomeDruidPageStandard" id="update_page">
 	  <property name="visible">True</property>
-	  <property name="title" translatable="yes">Update Path</property>
+	  <property name="title" translatable="yes">Update search path</property>
 	  <property name="contents_background">#e6e6e6e6e6e6</property>
 	  <signal name="next" handler="druid_gconf_update_page_next" last_modification_time="Thu, 14 Jul 2005 04:55:39 GMT"/>
 	  <signal name="prepare" handler="druid_gconf_update_page_prepare" last_modification_time="Thu, 14 Jul 2005 04:55:32 GMT"/>
@@ -518,9 +519,9 @@
 		  <property name="column_spacing">0</property>
 
 		  <child>
-		    <widget class="GtkScrolledWindow" id="scrolledwindow5">
+		    <widget class="GtkScrolledWindow" id="scrolledwindow4">
 		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
+		      <property name="sensitive">False</property>
 		      <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
 		      <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
 		      <property name="shadow_type">GTK_SHADOW_NONE</property>
@@ -655,7 +656,7 @@
 		      <child>
 			<widget class="GtkScrolledWindow" id="scrolledwindow7">
 			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
+			  <property name="sensitive">False</property>
 			  <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
 			  <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
 			  <property name="shadow_type">GTK_SHADOW_NONE</property>
@@ -687,6 +688,43 @@
 			  <property name="fill">True</property>
 			</packing>
 		      </child>
+
+		      <child>
+			<widget class="GtkScrolledWindow" id="scrolledwindow6">
+			  <property name="visible">True</property>
+			  <property name="sensitive">False</property>
+			  <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+			  <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
+			  <property name="shadow_type">GTK_SHADOW_NONE</property>
+			  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+			  <child>
+			    <widget class="GtkTextView" id="textview6">
+			      <property name="visible">True</property>
+			      <property name="sensitive">False</property>
+			      <property name="editable">False</property>
+			      <property name="overwrite">False</property>
+			      <property name="accepts_tab">False</property>
+			      <property name="justification">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap_mode">GTK_WRAP_NONE</property>
+			      <property name="cursor_visible">False</property>
+			      <property name="pixels_above_lines">0</property>
+			      <property name="pixels_below_lines">0</property>
+			      <property name="pixels_inside_wrap">0</property>
+			      <property name="left_margin">0</property>
+			      <property name="right_margin">0</property>
+			      <property name="indent">0</property>
+			      <property name="text" translatable="yes">You will then need to restart the gconf backend with the
+command 'gconftool-2 --shutdown'.</property>
+			    </widget>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
 		    </widget>
 		    <packing>
 		      <property name="left_attach">0</property>
@@ -737,7 +775,7 @@
       <child>
 	<widget class="GnomeDruidPageStandard" id="install_page">
 	  <property name="visible">True</property>
-	  <property name="title" translatable="yes">Install Locally</property>
+	  <property name="title" translatable="yes">Install into home directory</property>
 	  <property name="contents_background">#e6e6e6e6e6e6</property>
 	  <signal name="back" handler="druid_gconf_install_page_back" last_modification_time="Thu, 14 Jul 2005 04:55:25 GMT"/>
 	  <signal name="prepare" handler="druid_gconf_install_page_prepare" last_modification_time="Thu, 14 Jul 2005 04:55:19 GMT"/>
@@ -760,9 +798,9 @@
 		  <property name="column_spacing">0</property>
 
 		  <child>
-		    <widget class="GtkScrolledWindow" id="scrolledwindow9">
+		    <widget class="GtkScrolledWindow" id="scrolledwindow5">
 		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
+		      <property name="sensitive">False</property>
 		      <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
 		      <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
 		      <property name="shadow_type">GTK_SHADOW_NONE</property>
@@ -895,9 +933,9 @@
 		      </child>
 
 		      <child>
-			<widget class="GtkScrolledWindow" id="scrolledwindow12">
+			<widget class="GtkScrolledWindow" id="scrolledwindow8">
 			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
+			  <property name="sensitive">False</property>
 			  <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
 			  <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
 			  <property name="shadow_type">GTK_SHADOW_NONE</property>
@@ -906,7 +944,7 @@
 			  <child>
 			    <widget class="GtkTextView" id="install_text">
 			      <property name="visible">True</property>
-			      <property name="editable">True</property>
+			      <property name="editable">False</property>
 			      <property name="overwrite">False</property>
 			      <property name="accepts_tab">False</property>
 			      <property name="justification">GTK_JUSTIFY_LEFT</property>
@@ -918,7 +956,7 @@
 			      <property name="left_margin">0</property>
 			      <property name="right_margin">0</property>
 			      <property name="indent">0</property>
-			      <property name="text" translatable="yes">update-gnucash-gconf
+			      <property name="text">Script name will go here.
 </property>
 			    </widget>
 			  </child>
@@ -981,15 +1019,7 @@
 	  <property name="visible">True</property>
 	  <property name="position">GNOME_EDGE_FINISH</property>
 	  <property name="title" translatable="yes">Finish changes</property>
-	  <property name="text" translatable="yes">One of four stanzas:
-
-When you click Apply, Gnucash will modify your ~/.gconf.path file and restart the gconf backend.
-
-When you click Apply, Gnucash will install the configuration data into your local ~/.gconf file and restart the gconf backend.  If you have not already done so, you can click the Back button and copy the necessary text from the dialog.&quot;;
-
-You have chosen to correct the problem by yourself.  When you click Apply, Gnucash will exit.  Please correct the problem and restart the gconf backend before restarting Gnucash.
-
-You have already corrected the problem.  When you click Apply, Gnucash will restart the gconf backend and continue loading.</property>
+	  <property name="text">Gnucash will fill this in based upon the previous choices.</property>
 	  <signal name="prepare" handler="druid_gconf_finish_page_prepare" last_modification_time="Thu, 14 Jul 2005 04:54:49 GMT"/>
 	  <signal name="back" handler="druid_gconf_finish_page_back" last_modification_time="Thu, 14 Jul 2005 04:54:55 GMT"/>
 	  <signal name="finish" handler="druid_gconf_finish_page_finish" last_modification_time="Thu, 14 Jul 2005 04:55:11 GMT"/>
Index: druid-gconf-setup.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/Attic/druid-gconf-setup.c,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -Lsrc/gnome-utils/druid-gconf-setup.c -Lsrc/gnome-utils/druid-gconf-setup.c -u -r1.1.2.5 -r1.1.2.6
--- src/gnome-utils/druid-gconf-setup.c
+++ src/gnome-utils/druid-gconf-setup.c
@@ -57,6 +57,8 @@
 #define HOW_UPDATE		1
 #define HOW_INSTALL		2
 
+#define SCRIPT_NAME "update-gnucash-gconf"
+
 #define PATH_STRING1 "xml:readwrite:$(HOME)/.gconf\n"
 #define PATH_STRING2 "xml:readonly:%s\n"
 
@@ -185,8 +187,7 @@
 static gboolean
 druid_gconf_install_keys (GError **error)
 {
-  return g_spawn_command_line_sync("update-gnucash-gconf", NULL, NULL,
-				     NULL, error);
+  return g_spawn_command_line_sync(SCRIPT_NAME, NULL, NULL, NULL, error);
 }
 
 /********************
@@ -237,17 +238,6 @@
 				 GnomeDruid *druid,
 				 gpointer user_data)
 {
-  GtkWidget *textview;
-
-  textview = gnc_glade_lookup_widget(GTK_WIDGET(druidpage), "textview1");
-  gtk_widget_modify_base(textview, GTK_STATE_INSENSITIVE,
-			 &GNOME_DRUID_PAGE_STANDARD(druidpage)->contents_background);
-  textview = gnc_glade_lookup_widget(GTK_WIDGET(druidpage), "textview2");
-  gtk_widget_modify_base(textview, GTK_STATE_INSENSITIVE,
-			 &GNOME_DRUID_PAGE_STANDARD(druidpage)->contents_background);
-  textview = gnc_glade_lookup_widget(GTK_WIDGET(druidpage), "textview3");
-  gtk_widget_modify_base(textview, GTK_STATE_INSENSITIVE,
-			 &GNOME_DRUID_PAGE_STANDARD(druidpage)->contents_background);
 }
 
 
@@ -296,11 +286,6 @@
   GtkWidget *textview;
   gchar *msg;
 
-  /* The text views don't have the right background color for some reason. */
-  textview = gnc_glade_lookup_widget(GTK_WIDGET(druidpage), "textview4");
-  gtk_widget_modify_base(textview, GTK_STATE_INSENSITIVE,
-			 &GNOME_DRUID_PAGE_STANDARD(druidpage)->contents_background);
-
   textview = gnc_glade_lookup_widget(GTK_WIDGET(druidpage), "update_text");
   textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview));
   msg = g_strdup_printf(PATH_STRING1 PATH_STRING2, GNC_GCONF_DIR);
@@ -347,11 +332,12 @@
 				  GnomeDruid *druid,
 				  gpointer user_data)
 {
+  GtkTextBuffer *textbuffer;
   GtkWidget *textview;
 
-  textview = gnc_glade_lookup_widget(GTK_WIDGET(druidpage), "textview5");
-  gtk_widget_modify_base(textview, GTK_STATE_INSENSITIVE,
-			 &GNOME_DRUID_PAGE_STANDARD(druidpage)->contents_background);
+  textview = gnc_glade_lookup_widget(GTK_WIDGET(druidpage), "install_text");
+  textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview));
+  gtk_text_buffer_set_text(textbuffer, SCRIPT_NAME, -1);
 }
 
 
@@ -413,47 +399,60 @@
 				 gpointer user_data)
 {
   gint who, how;
-  const gchar *text;
+  gchar *text;
   const gchar *pgm_path =
-    "When you click Appply, Gnucash will modify your ~/.gconf.path file "
-    "and restart the gconf backend.";
+    _("When you click Appply, Gnucash will modify your ~/.gconf.path file "
+      "and restart the gconf backend.");
   const gchar *pgm_install =
-    "When you click Appply, Gnucash will install the gconf data into your "
-    "local ~/.gconf file and restart the gconf backend.";
-  const gchar *user_does =
-    "You have chosen to correct the problem by yourself.  When you click "
-    "Apply, Gnucash will exit.  Please correct the problem and restart "
-    "the gconf backend before restarting Gnucash.  If you have not already "
-    "done so, you can click the Back button and copy the necessary text "
-    "from the dialog.";
+    _("When you click Appply, Gnucash will install the gconf data into your "
+      "local ~/.gconf file and restart the gconf backend.  The %s script "
+      "must be found in your search path for this to work correctly.");
+  const gchar *user_path =
+    _("You have chosen to correct the problem by yourself.  When you click "
+      "Apply, Gnucash will exit.  Please correct the problem and restart "
+      "the gconf backend with the command 'gconftool-2 --shutdown' before "
+      "restarting Gnucash.  If you have not already done so, you can click "
+      "the Back button and copy the necessary text from the dialog.");
+  const gchar *user_install =
+    _("You have chosen to correct the problem by yourself.  When you "
+      "click Apply, Gnucash will exit.  Please run the %s script which "
+      "will install the configuration data and restart the gconf backend.");
   const gchar *user_did =
-    "You have already corrected the problem.  When you click Apply, Gnucash "
-    "will continue loading.";
+    _("You have already corrected the problem and restarted the gconf "
+      "backend with the command 'gconftool-2 --shutdown'.  When you click "
+      "Apply, Gnucash will continue loading.");
 
   who = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(druid), WHO_DOES));
   switch (who) {
     case WHO_ALREADY_DONE:
-      text = user_did;
+      gnome_druid_page_edge_set_text(GNOME_DRUID_PAGE_EDGE(druidpage),
+				     user_did);
       break;
 
     case WHO_USER:
-      text = user_does;
+      how = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(druid), HOW));
+      if (how == HOW_INSTALL) {
+	text = g_strdup_printf(user_install, SCRIPT_NAME);
+	gnome_druid_page_edge_set_text(GNOME_DRUID_PAGE_EDGE(druidpage), text);
+	g_free(text);
+      } else {
+	gnome_druid_page_edge_set_text(GNOME_DRUID_PAGE_EDGE(druidpage),
+				       user_path);
+      }
       break;
 
     default:
       how = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(druid), HOW));
-      switch(how) {
-      case HOW_INSTALL:
-	text = pgm_install;
-	break;
-
-      default:
-	text = pgm_path;
-	break;
+      if (how == HOW_INSTALL) {
+	text = g_strdup_printf(pgm_install, SCRIPT_NAME);
+	gnome_druid_page_edge_set_text(GNOME_DRUID_PAGE_EDGE(druidpage), text);
+	g_free(text);
+      } else {
+	gnome_druid_page_edge_set_text(GNOME_DRUID_PAGE_EDGE(druidpage),
+				       pgm_path);
       }
+      break;
   }
-
-  gnome_druid_page_edge_set_text(GNOME_DRUID_PAGE_EDGE(druidpage), text);
 }
 
 
@@ -531,6 +530,30 @@
  * Druid Creation
  ********************/
 
+static void
+druid_gconf_fix_textview_color (GtkWidget *window)
+{
+  GdkColor *color;
+  GtkWidget *widget;
+  gint i;
+  const gchar *names[] = {
+    "textview1",
+    "textview2",
+    "textview3",
+    "textview4",
+    "textview5",
+    "textview6",
+    NULL
+  };
+
+  widget = gnc_glade_lookup_widget(window, "choose_page");
+  color = &GNOME_DRUID_PAGE_STANDARD(widget)->contents_background;
+
+  for (i = 0; names[i]; i++) {
+    widget = gnc_glade_lookup_widget(widget, names[i]);
+    gtk_widget_modify_base(widget, GTK_STATE_INSENSITIVE, color);
+  }
+}
 
 /** This function build and presents the druid that presents the user
  *  with the two methods of making the gconf schemas visible, and
@@ -550,6 +573,7 @@
   xml = gnc_glade_xml_new ("druid-gconf-setup.glade", "GConf Install Druid");
   glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, NULL);
   window = glade_xml_get_widget (xml, "GConf Install Druid");
+  druid_gconf_fix_textview_color(window);
   gtk_widget_show_all(window);
 
   /* This won't return until the dialog is finished */


More information about the gnucash-changes mailing list