Convert Account Filter By dialog to gtkbuilder format

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20668 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2011-05-21 19:37:00 +00:00
parent 4b9d425f11
commit e70b735a7c
3 changed files with 10 additions and 228 deletions

View File

@ -1960,6 +1960,7 @@ account_filter_dialog_create(AccountFilterDialog *fd, GncPluginPage *page)
GtkTreeView *view; GtkTreeView *view;
GtkCellRenderer *renderer; GtkCellRenderer *renderer;
GladeXML *xml; GladeXML *xml;
GtkBuilder *builder;
gchar *title; gchar *title;
ENTER("(fd %p, page %p)", fd, page); ENTER("(fd %p, page %p)", fd, page);
@ -1972,8 +1973,9 @@ account_filter_dialog_create(AccountFilterDialog *fd, GncPluginPage *page)
} }
/* Create the dialog */ /* Create the dialog */
xml = gnc_glade_xml_new ("account.glade", "Filter By"); builder = gtk_builder_new();
dialog = glade_xml_get_widget (xml, "Filter By"); gnc_builder_add_from_file (builder, "account.glade", "Filter By");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Filter By"));
fd->dialog = dialog; fd->dialog = dialog;
gtk_window_set_transient_for(GTK_WINDOW(dialog), gtk_window_set_transient_for(GTK_WINDOW(dialog),
GTK_WINDOW(GNC_PLUGIN_PAGE(page)->window)); GTK_WINDOW(GNC_PLUGIN_PAGE(page)->window));
@ -1989,15 +1991,15 @@ account_filter_dialog_create(AccountFilterDialog *fd, GncPluginPage *page)
fd->original_show_zero_total = fd->show_zero_total; fd->original_show_zero_total = fd->show_zero_total;
/* Update the dialog widgets for the current state */ /* Update the dialog widgets for the current state */
button = glade_xml_get_widget (xml, "show_hidden"); button = GTK_WIDGET(gtk_builder_get_object (builder, "show_hidden"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
fd->show_hidden); fd->show_hidden);
button = glade_xml_get_widget (xml, "show_zero"); button = GTK_WIDGET(gtk_builder_get_object (builder, "show_zero"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
fd->show_zero_total); fd->show_zero_total);
/* Set up the tree view and model */ /* Set up the tree view and model */
view = GTK_TREE_VIEW(glade_xml_get_widget (xml, FILTER_TREE_VIEW)); view = GTK_TREE_VIEW(gtk_builder_get_object (builder, FILTER_TREE_VIEW));
fd->model = gnc_tree_model_account_types_filter_using_mask fd->model = gnc_tree_model_account_types_filter_using_mask
(~(1 << ACCT_TYPE_ROOT)); (~(1 << ACCT_TYPE_ROOT));
@ -2020,8 +2022,8 @@ account_filter_dialog_create(AccountFilterDialog *fd, GncPluginPage *page)
"text", GNC_TREE_MODEL_ACCOUNT_TYPES_COL_NAME, NULL); "text", GNC_TREE_MODEL_ACCOUNT_TYPES_COL_NAME, NULL);
/* Wire up the rest of the callbacks */ /* Wire up the rest of the callbacks */
glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func, gtk_builder_connect_signals(builder, fd);
fd); g_object_unref(G_OBJECT(builder));
/* Show it */ /* Show it */
gtk_widget_show_all(dialog); gtk_widget_show_all(dialog);

View File

@ -2,227 +2,6 @@
<glade-interface> <glade-interface>
<!-- interface-requires gtk+ 2.10 --> <!-- interface-requires gtk+ 2.10 -->
<!-- interface-naming-policy toplevel-contextual --> <!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkDialog" id="Filter By">
<property name="visible">True</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Filter By...</property>
<property name="type_hint">dialog</property>
<signal name="response" handler="gppat_filter_response_cb"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox13">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<widget class="GtkNotebook" id="notebook1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">6</property>
<child>
<widget class="GtkTable" id="table10">
<property name="visible">True</property>
<property name="border_width">6</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="column_spacing">6</property>
<property name="row_spacing">6</property>
<child>
<widget class="GtkTreeView" id="types_tree_view">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<property name="rules_hint">True</property>
</widget>
<packing>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<widget class="GtkVButtonBox" id="vbuttonbox1">
<property name="visible">True</property>
<property name="layout_style">spread</property>
<child>
<widget class="GtkButton" id="select_all">
<property name="label" translatable="yes">_Select All</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="use_underline">True</property>
<signal name="clicked" handler="gppat_filter_select_all_cb"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="clear_all">
<property name="label" translatable="yes">C_lear All</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="use_underline">True</property>
<signal name="clicked" handler="gppat_filter_clear_all_cb"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="default_types">
<property name="label" translatable="yes">_Default</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="use_underline">True</property>
<signal name="clicked" handler="gppat_filter_select_default_cb"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label8477430">
<property name="visible">True</property>
<property name="label" translatable="yes">Account Type</property>
</widget>
<packing>
<property name="tab_fill">False</property>
<property name="type">tab</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox129">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<widget class="GtkCheckButton" id="show_hidden">
<property name="label" translatable="yes">Show _hidden accounts</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="gppat_filter_show_hidden_toggled_cb"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="show_zero">
<property name="label" translatable="yes">Show _zero total accounts</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Hide accounts which have a zero total value.</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="gppat_filter_show_zero_toggled_cb"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="Balance">
<property name="visible">True</property>
<property name="label" translatable="yes">Other</property>
</widget>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
<property name="type">tab</property>
</packing>
</child>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area13">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="cancelbutton1">
<property name="label">gtk-cancel</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="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">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="okbutton1">
<property name="label">gtk-ok</property>
<property name="response_id">-5</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="use_stock">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</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>
<widget class="GtkDialog" id="Renumber Accounts"> <widget class="GtkDialog" id="Renumber Accounts">
<property name="visible">True</property> <property name="visible">True</property>
<property name="border_width">6</property> <property name="border_width">6</property>

View File

@ -1311,6 +1311,7 @@
<child> <child>
<object class="GtkVButtonBox" id="vbuttonbox1"> <object class="GtkVButtonBox" id="vbuttonbox1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="layout_style">spread</property> <property name="layout_style">spread</property>
<child> <child>
<object class="GtkButton" id="select_all"> <object class="GtkButton" id="select_all">