r20778 - gnucash/trunk/src/gnome - Convert commodities dialog to gtkbuilder format

Geert Janssens gjanssens at code.gnucash.org
Mon Jun 20 17:34:23 EDT 2011


Author: gjanssens
Date: 2011-06-20 17:34:22 -0400 (Mon, 20 Jun 2011)
New Revision: 20778
Trac: http://svn.gnucash.org/trac/changeset/20778

Removed:
   gnucash/trunk/src/gnome/glade/commodities.glade
Modified:
   gnucash/trunk/src/gnome/dialog-commodities.c
   gnucash/trunk/src/gnome/glade/Makefile.am
Log:
Convert commodities dialog to gtkbuilder format

Modified: gnucash/trunk/src/gnome/dialog-commodities.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-commodities.c	2011-06-20 18:55:17 UTC (rev 20777)
+++ gnucash/trunk/src/gnome/dialog-commodities.c	2011-06-20 21:34:22 UTC (rev 20778)
@@ -308,34 +308,33 @@
 static void
 gnc_commodities_dialog_create (GtkWidget * parent, CommoditiesDialog *cd)
 {
-    GtkWidget *dialog;
     GtkWidget *button;
     GtkWidget *scrolled_window;
-    GladeXML *xml;
+    GtkBuilder *builder;
     GtkTreeView *view;
     GtkTreeSelection *selection;
 
-    xml = gnc_glade_xml_new ("commodities.glade", "Securities Dialog");
-    dialog = glade_xml_get_widget (xml, "Securities Dialog");
+    builder = gtk_builder_new();
+    gnc_builder_add_from_file (builder, "commodities.glade", "Securities Dialog");
 
-    cd->dialog = dialog;
+    cd->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Securities Dialog"));
     cd->session = gnc_get_current_session();
     cd->book = qof_session_get_book(cd->session);
     cd->show_currencies = gnc_gconf_get_bool(GCONF_SECTION, "include_iso", NULL);
 
-    glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, cd);
+    gtk_builder_connect_signals(builder, cd);
 
     /* parent */
     if (parent != NULL)
-        gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
+        gtk_window_set_transient_for (GTK_WINDOW (cd->dialog), GTK_WINDOW (parent));
 
     /* buttons */
-    cd->remove_button = glade_xml_get_widget (xml, "remove_button");
-    cd->edit_button = glade_xml_get_widget (xml, "edit_button");
+    cd->remove_button = GTK_WIDGET(gtk_builder_get_object (builder, "remove_button"));
+    cd->edit_button = GTK_WIDGET(gtk_builder_get_object (builder, "edit_button"));
 
     /* commodity tree */
 
-    scrolled_window = glade_xml_get_widget (xml, "commodity_list_window");
+    scrolled_window = GTK_WIDGET(gtk_builder_get_object (builder, "commodity_list_window"));
     view = gnc_tree_view_commodity_new(cd->book,
                                        "gconf-section", GCONF_SECTION,
                                        "show-column-menu", TRUE,
@@ -355,9 +354,10 @@
                       G_CALLBACK (row_activated_cb), cd);
 
     /* Show currency button */
-    button = glade_xml_get_widget (xml, "show_currencies_button");
+    button = GTK_WIDGET(gtk_builder_get_object (builder, "show_currencies_button"));
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), cd->show_currencies);
 
+    g_object_unref(G_OBJECT(builder));
     gnc_restore_window_size (GCONF_SECTION, GTK_WINDOW(cd->dialog));
 }
 

Modified: gnucash/trunk/src/gnome/glade/Makefile.am
===================================================================
--- gnucash/trunk/src/gnome/glade/Makefile.am	2011-06-20 18:55:17 UTC (rev 20777)
+++ gnucash/trunk/src/gnome/glade/Makefile.am	2011-06-20 21:34:22 UTC (rev 20778)
@@ -1,7 +1,6 @@
 gladedir = $(GNC_GLADE_DIR)
 glade_DATA = \
 	budget.glade \
-	commodities.glade \
 	fincalc.glade \
 	lots.glade \
 	newuser.glade \

Deleted: gnucash/trunk/src/gnome/glade/commodities.glade
===================================================================
--- gnucash/trunk/src/gnome/glade/commodities.glade	2011-06-20 18:55:17 UTC (rev 20777)
+++ gnucash/trunk/src/gnome/glade/commodities.glade	2011-06-20 21:34:22 UTC (rev 20778)
@@ -1,218 +0,0 @@
-<?xml version="1.0"?>
-<glade-interface>
-  <!-- interface-requires gtk+ 2.10 -->
-  <!-- interface-naming-policy toplevel-contextual -->
-  <widget class="GtkDialog" id="Securities Dialog">
-    <property name="title" translatable="yes">Securities</property>
-    <property name="default_width">400</property>
-    <property name="default_height">400</property>
-    <property name="type_hint">normal</property>
-    <signal name="destroy" handler="gnc_commodities_window_destroy_cb"/>
-    <signal name="response" handler="gnc_commodities_dialog_response"/>
-    <child internal-child="vbox">
-      <widget class="GtkVBox" id="vbox127">
-        <property name="visible">True</property>
-        <property name="orientation">vertical</property>
-        <child>
-          <widget class="GtkVBox" id="commodities_vbox">
-            <property name="visible">True</property>
-            <property name="border_width">12</property>
-            <property name="orientation">vertical</property>
-            <property name="spacing">6</property>
-            <child>
-              <widget class="GtkLabel" id="label1">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes"><b>Securities</b></property>
-                <property name="use_markup">True</property>
-                <property name="use_underline">True</property>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkHBox" id="hbox1">
-                <property name="visible">True</property>
-                <property name="spacing">6</property>
-                <child>
-                  <widget class="GtkLabel" id="label2">
-                    <property name="visible">True</property>
-                    <property name="label">    </property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkVBox" id="vbox128">
-                    <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <widget class="GtkScrolledWindow" id="commodity_list_window">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="hscrollbar_policy">automatic</property>
-                        <property name="vscrollbar_policy">automatic</property>
-                        <property name="shadow_type">in</property>
-                        <child>
-                          <placeholder/>
-                        </child>
-                      </widget>
-                      <packing>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkCheckButton" id="show_currencies_button">
-                        <property name="label" translatable="yes">Show National Currencies</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="border_width">3</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <signal name="toggled" handler="gnc_commodities_show_currencies_toggled"/>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-              </widget>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </widget>
-          <packing>
-            <property name="position">2</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <widget class="GtkHButtonBox" id="hbuttonbox6">
-            <property name="visible">True</property>
-            <property name="layout_style">end</property>
-            <child>
-              <widget class="GtkButton" id="add_button">
-                <property name="label">gtk-add</property>
-                <property name="response_id">1</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="tooltip" translatable="yes">Add a new commodity.</property>
-                <property name="use_stock">True</property>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkButton" id="remove_button">
-                <property name="label">gtk-remove</property>
-                <property name="response_id">2</property>
-                <property name="visible">True</property>
-                <property name="sensitive">False</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="tooltip" translatable="yes">Remove the current commodity.</property>
-                <property name="use_stock">True</property>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkButton" id="edit_button">
-                <property name="response_id">3</property>
-                <property name="visible">True</property>
-                <property name="sensitive">False</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <child>
-                  <widget class="GtkAlignment" id="alignment1">
-                    <property name="visible">True</property>
-                    <property name="xscale">0</property>
-                    <property name="yscale">0</property>
-                    <child>
-                      <widget class="GtkHBox" id="hbox2">
-                        <property name="visible">True</property>
-                        <property name="spacing">2</property>
-                        <child>
-                          <widget class="GtkImage" id="image1">
-                            <property name="visible">True</property>
-                            <property name="stock">gtk-properties</property>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <widget class="GtkLabel" id="label3">
-                            <property name="visible">True</property>
-                            <property name="label" translatable="yes">Edit</property>
-                            <property name="use_underline">True</property>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                      </widget>
-                    </child>
-                  </widget>
-                </child>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">2</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkButton" id="close_button">
-                <property name="label">gtk-close</property>
-                <property name="response_id">-6</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_stock">True</property>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">3</property>
-              </packing>
-            </child>
-          </widget>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-      </widget>
-    </child>
-  </widget>
-</glade-interface>



More information about the gnucash-changes mailing list