<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
- <object class="GtkDialog" id="merge_properties_dialog">
- <property name="visible">True</property>
- <property name="title" translatable="yes">dialog1</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <object class="GtkVBox" id="dialog-vbox1">
+ <object class="GtkWindow" id="window1">
+ <child>
+ <object class="GtkVBox" id="merge_properties_vbox">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkVBox" id="merge_properties_vbox">
+ <object class="GtkFrame" id="frame1">
<property name="visible">True</property>
- <property name="spacing">6</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <object class="GtkFrame" id="frame1">
+ <object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="left_padding">12</property>
<child>
- <object class="GtkAlignment" id="alignment1">
+ <object class="GtkTable" id="table1">
<property name="visible">True</property>
- <property name="left_padding">12</property>
+ <property name="border_width">12</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
<child>
- <object class="GtkTable" id="table1">
+ <object class="GtkLabel" id="label3">
<property name="visible">True</property>
- <property name="border_width">12</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">6</property>
- <property name="row_spacing">6</property>
- <child>
- <object class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Format:</property>
- </object>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="type_combo">
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="location_vbox">
- <property name="visible">True</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <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="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Format:</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="type_combo">
+ <property name="visible">True</property>
+ <property name="focus_on_click">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="location_vbox">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Location:</property>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
+ <placeholder/>
</child>
</object>
+ <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="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Location:</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
</child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>Source</b></property>
- <property name="use_markup">True</property>
</object>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
</child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Source</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame2">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <object class="GtkFrame" id="frame2">
+ <object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
+ <property name="left_padding">12</property>
<child>
- <object class="GtkAlignment" id="alignment2">
+ <object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
- <property name="left_padding">12</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="width_request">500</property>
+ <property name="height_request">350</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="treeview">
+ <property name="visible">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
- <object class="GtkVBox" id="vbox3">
+ <object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
- <property name="spacing">6</property>
+ <property name="border_width">6</property>
+ <property name="spacing">12</property>
<child>
- <object class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="width_request">500</property>
- <property name="height_request">350</property>
+ <object class="GtkButton" id="select_all_button">
+ <property name="label" translatable="yes">Select all</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="border_width">6</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">in</property>
- <child>
- <object class="GtkTreeView" id="treeview">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </object>
- </child>
+ <property name="can_focus">False</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="focus_on_click">False</property>
</object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox1">
+ <object class="GtkButton" id="unselect_all_button">
+ <property name="label" translatable="yes">Unselect all</property>
<property name="visible">True</property>
- <property name="border_width">6</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkButton" id="select_all_button">
- <property name="label" translatable="yes">Select all</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="unselect_all_button">
- <property name="label" translatable="yes">Unselect all</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="can_focus">False</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="focus_on_click">False</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
</child>
- <child type="label">
- <object class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>Record selection/preview</b></property>
- <property name="use_markup">True</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <object class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="cancelbutton1">
- <property name="label">gtk-cancel</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>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
</child>
- <child>
- <object class="GtkButton" id="okbutton1">
- <property name="label">gtk-ok</property>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
<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>
+ <property name="label" translatable="yes"><b>Record selection/preview</b></property>
+ <property name="use_markup">True</property>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
</child>
- <action-widgets>
- <action-widget response="-6">cancelbutton1</action-widget>
- <action-widget response="-5">okbutton1</action-widget>
- </action-widgets>
</object>
</interface>
GtkWidget *select_all_button;
GtkWidget *unselect_all_button;
+ GtkWidget *ok_button;
+
gchar *saved_src;
};
G_DEFINE_TYPE (glMergePropertiesDialog, gl_merge_properties_dialog, GTK_TYPE_DIALOG);
+/*****************************************************************************/
+/* Class Init Function. */
+/*****************************************************************************/
static void
gl_merge_properties_dialog_class_init (glMergePropertiesDialogClass *class)
{
}
+/*****************************************************************************/
+/* Object Instance Init Function. */
+/*****************************************************************************/
static void
gl_merge_properties_dialog_init (glMergePropertiesDialog *dialog)
{
+ GtkBuilder *builder;
+ static gchar *object_ids[] = { "merge_properties_vbox", NULL };
+ GError *error = NULL;
+ GtkWidget *vbox;
+
gl_debug (DEBUG_MERGE, "START");
dialog->priv = g_new0 (glMergePropertiesDialogPrivate, 1);
- gtk_container_set_border_width (GTK_CONTAINER(dialog), GL_HIG_PAD2);
+ gtk_container_set_border_width (GTK_CONTAINER(dialog), GL_HIG_PAD1);
gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE);
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
+ gtk_dialog_add_button (GTK_DIALOG (dialog),
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+ dialog->priv->ok_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
+ GTK_STOCK_OK, GTK_RESPONSE_OK);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
- g_signal_connect(G_OBJECT (dialog), "response",
- G_CALLBACK (response_cb), NULL);
+ builder = gtk_builder_new ();
+ gtk_builder_add_objects_from_file (builder,
+ GLABELS_BUILDER_DIR "merge-properties-dialog.builder",
+ object_ids,
+ &error);
+ if (error) {
+ g_critical ("%s\n\ngLabels may not be installed correctly!", error->message);
+ g_error_free (error);
+ return;
+ }
+
+ gl_util_get_builder_widgets (builder,
+ "merge_properties_vbox", &vbox,
+ "type_combo", &dialog->priv->type_combo,
+ "location_vbox", &dialog->priv->location_vbox,
+ "treeview", &dialog->priv->treeview,
+ "select_all_button", &dialog->priv->select_all_button,
+ "unselect_all_button", &dialog->priv->unselect_all_button,
+ NULL);
+
+ gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox);
+ dialog->priv->builder = builder;
+
+ gl_util_combo_box_add_text_model (GTK_COMBO_BOX (dialog->priv->type_combo));
gl_debug (DEBUG_MERGE, "END");
}
+/*****************************************************************************/
+/* Finalize Function. */
+/*****************************************************************************/
static void
gl_merge_properties_dialog_finalize (GObject *object)
{
glLabel *label,
GtkWindow *window)
{
- GtkBuilder *builder;
- static gchar *object_ids[] = { "merge_properties_vbox", NULL };
- GError *error = NULL;
gchar *description;
glMergeSrcType src_type;
gchar *src;
gchar *name, *title;
GList *texts;
- GtkWidget *vbox;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
GtkTreeSelection *selection;
gtk_window_set_destroy_with_parent (GTK_WINDOW(dialog), TRUE);
}
- builder = gtk_builder_new ();
- gtk_builder_add_objects_from_file (builder,
- GLABELS_BUILDER_DIR "merge-properties-dialog.builder",
- object_ids,
- &error);
- if (error) {
- g_critical ("%s\n\ngLabels may not be installed correctly!", error->message);
- g_error_free (error);
- return;
- }
-
- gl_util_get_builder_widgets (builder,
- "merge_properties_vbox", &vbox,
- "type_combo", &dialog->priv->type_combo,
- "location_vbox", &dialog->priv->location_vbox,
- "treeview", &dialog->priv->treeview,
- "select_all_button", &dialog->priv->select_all_button,
- "unselect_all_button", &dialog->priv->unselect_all_button,
- NULL);
-
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox);
- dialog->priv->builder = builder;
-
- gl_util_combo_box_add_text_model (GTK_COMBO_BOX (dialog->priv->type_combo));
-
dialog->priv->label = label;
dialog->priv->merge = gl_label_get_merge (dialog->priv->label);
GTK_FILE_CHOOSER_ACTION_OPEN);
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog->priv->src_entry),
src);
+ gtk_file_chooser_button_set_focus_on_click (GTK_FILE_CHOOSER_BUTTON (dialog->priv->src_entry),
+ FALSE);
g_signal_connect (G_OBJECT (dialog->priv->src_entry),
"selection-changed",
G_CALLBACK (src_changed_cb), dialog);
"active", SELECT_COLUMN,
"visible", IS_RECORD_COLUMN,
NULL);
- gtk_tree_view_column_set_clickable (column, TRUE);
gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->priv->treeview), column);
renderer = gtk_cell_renderer_text_new ();
g_object_set (G_OBJECT (renderer), "yalign", 0.0, NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+ gtk_widget_grab_focus (dialog->priv->ok_button);
+ gtk_widget_grab_default (dialog->priv->ok_button);
+
+ g_signal_connect(G_OBJECT (dialog), "response",
+ G_CALLBACK (response_cb), NULL);
+
gl_debug (DEBUG_MERGE, "END");
}
dialog->priv->src_entry =
gtk_file_chooser_button_new (_("Select merge-database source"),
GTK_FILE_CHOOSER_ACTION_OPEN);
+ gtk_file_chooser_button_set_focus_on_click (GTK_FILE_CHOOSER_BUTTON (dialog->priv->src_entry),
+ FALSE);
if (dialog->priv->saved_src != NULL) {
gl_debug (DEBUG_MERGE, "Setting src = \"%s\"", dialog->priv->saved_src);
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog->priv->src_entry),