From: Jim Evins Date: Wed, 23 Sep 2009 01:56:53 +0000 (+0000) Subject: 2009-09-22 Jim Evins X-Git-Tag: glabels-2_3_0~184 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b837823b737bdc2dd87ccc7d16e48d8079ed04e4;p=glabels 2009-09-22 Jim Evins * po/POTFILES.in: Include all (src/*.[ch]) source files. * data/builder/merge-properties-dialog.builder: * src/merge-properties-dialog.c: (gl_merge_properties_dialog_init), (gl_merge_properties_dialog_construct), (type_changed_cb): - OK button now has default focus. - Some formatting cleanup. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@894 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index bda4f565..67458b4a 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,13 @@ +2009-09-22 Jim Evins + + * po/POTFILES.in: + Include all (src/*.[ch]) source files. + * data/builder/merge-properties-dialog.builder: + * src/merge-properties-dialog.c: (gl_merge_properties_dialog_init), + (gl_merge_properties_dialog_construct), (type_changed_cb): + - OK button now has default focus. + - Some formatting cleanup. + 2009-09-21 Jim Evins * po/POTFILES.in: diff --git a/glabels2/data/builder/merge-properties-dialog.builder b/glabels2/data/builder/merge-properties-dialog.builder index 40338989..18ae33dd 100644 --- a/glabels2/data/builder/merge-properties-dialog.builder +++ b/glabels2/data/builder/merge-properties-dialog.builder @@ -2,241 +2,190 @@ - - True - dialog1 - dialog - - + + + True + vertical + 6 - + True - 6 + 0 + none - + True - 0 - none + 12 - + True - 12 + 12 + 2 + 2 + 6 + 6 - + True - 12 - 2 - 2 - 6 - 6 - - - True - 0 - Format: - - - GTK_FILL - - - - - - True - - - 1 - 2 - GTK_FILL - - - - - True - - - - - - 1 - 2 - 1 - 2 - GTK_FILL - GTK_FILL - - + 0 + Format: + + + GTK_FILL + + + + + + True + False + + + 1 + 2 + GTK_FILL + + + + + True + vertical - - True - 0 - Location: - - - 1 - 2 - GTK_FILL - - + + + 1 + 2 + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + 0 + Location: + + + 1 + 2 + GTK_FILL + + - - - - - True - <b>Source</b> - True - - False - 0 - + + + True + <b>Source</b> + True + + + + + False + 0 + + + + + True + 0 + none - + True - 0 - none + 12 - + True - 12 + vertical + 6 + + + 500 + 350 + True + False + 6 + automatic + automatic + in + + + True + + + + + 0 + + - + True - 6 + 6 + 12 - - 500 - 350 + + Select all True - True - 6 - automatic - automatic - in - - - True - True - - + False + False + True + False + False + False 0 - + + Unselect all True - 6 - 12 - - - Select all - True - True - False - True - - - False - False - 0 - - - - - Unselect all - True - True - False - True - - - False - False - 1 - - + False + False + True + False False + False 1 + + False + 1 + - - - True - <b>Record selection/preview</b> - True - - - - - 1 - - - - - 2 - - - - - True - end - - - gtk-cancel - True - True - True - False - True - - False - False - 0 - - - - gtk-ok + + True - True - True - False - True + <b>Record selection/preview</b> + True - - False - False - 1 - - False - end - 0 + 1 - - cancelbutton1 - okbutton1 - diff --git a/glabels2/po/POTFILES.in b/glabels2/po/POTFILES.in index adfdd1d0..0638c379 100644 --- a/glabels2/po/POTFILES.in +++ b/glabels2/po/POTFILES.in @@ -1,118 +1,41 @@ # List of source files containing translatable strings. -src/glabels.c -src/glabels-batch.c -src/window.c -src/window.h -src/stock.c -src/stock.h -src/ui.h -src/ui.c -src/ui-property-bar.h -src/ui-property-bar.c -src/ui-sidebar.h -src/ui-sidebar.c -src/ui-util.h -src/ui-util.c -src/ui-commands.h -src/ui-commands.c -src/file.h -src/file.c -src/recent.h -src/recent.c -src/prefs.c -src/prefs.h -src/prefs-model.c -src/prefs-model.h -src/prefs-dialog.c -src/prefs-dialog.h -src/hig.h -src/view.c -src/view.h -src/view-object.c -src/view-object.h -src/view-box.c -src/view-box.h -src/view-ellipse.c -src/view-ellipse.h -src/view-line.c -src/view-line.h -src/view-image.c -src/view-image.h -src/view-text.c -src/view-text.h -src/view-barcode.c -src/view-barcode.h -src/object-editor.c -src/object-editor.h -src/object-editor-private.h -src/object-editor-bc-page.c -src/object-editor-data-page.c -src/object-editor-edit-page.c -src/object-editor-fill-page.c -src/object-editor-image-page.c -src/object-editor-line-page.c -src/object-editor-lsize-page.c -src/object-editor-position-page.c -src/object-editor-size-page.c -src/object-editor-text-page.c -src/object-editor-shadow-page.c -src/merge-properties-dialog.c -src/merge-properties-dialog.h -src/print.c -src/print.h -src/print-op.c -src/template-designer.c -src/template-designer.h src/bc.c -src/bc.h src/bc-gnubarcode.c src/bc-gnubarcode.h +src/bc.h +src/bc-iec16022.c +src/bc-iec16022.h +src/bc-iec18004.c +src/bc-iec18004.h src/bc-postnet.c src/bc-postnet.h -src/label.c -src/label.h -src/label-object.c -src/label-object.h -src/label-text.c -src/label-text.h -src/label-box.c -src/label-box.h -src/label-line.c -src/label-line.h -src/label-ellipse.c -src/label-ellipse.h -src/label-image.c -src/label-image.h -src/label-barcode.c -src/label-barcode.h -src/xml-label.c -src/xml-label.h -src/xml-label-04.c -src/xml-label-04.h -src/pixbuf-cache.c -src/pixbuf-cache.h -src/merge.c -src/merge.h -src/merge-init.c -src/merge-init.h -src/merge-text.c -src/merge-text.h -src/merge-evolution.c -src/text-node.c -src/text-node.h -src/color-combo.c -src/color-combo.h +src/cairo-ellipse-path.c +src/cairo-ellipse-path.h +src/cairo-label-path.c +src/cairo-label-path.h +src/cairo-markup-path.c +src/cairo-markup-path.h +src/color.c src/color-combo-button.c src/color-combo-button.h -src/color-combo-menu.c -src/color-combo-menu.h +src/color-combo.c src/color-combo-color-menu-item.c src/color-combo-color-menu-item.h +src/color-combo.h src/color-combo-history.c src/color-combo-history.h +src/color-combo-menu.c +src/color-combo-menu.h +src/color.h src/color-swatch.c src/color-swatch.h +src/critical-error-handler.c +src/critical-error-handler.h +src/debug.c +src/debug.h +src/file.c +src/file.h src/font-combo.c src/font-combo.h src/font-combo-menu.c @@ -123,20 +46,129 @@ src/font-sample.c src/font-sample.h src/font-util.c src/font-util.h -src/wdgt-media-select.c -src/wdgt-media-select.h +src/glabels-batch.c +src/glabels.c +src/hig.h +src/label-barcode.c +src/label-barcode.h +src/label-box.c +src/label-box.h +src/label.c +src/label-ellipse.c +src/label-ellipse.h +src/label.h +src/label-image.c +src/label-image.h +src/label-line.c +src/label-line.h +src/label-object.c +src/label-object.h +src/label-text.c +src/label-text.h +src/marshal.c +src/marshal.h +src/merge.c +src/merge-evolution.c +src/merge-evolution.h +src/merge.h +src/merge-init.c +src/merge-init.h +src/merge-properties-dialog.c +src/merge-properties-dialog.h +src/merge-text.c +src/merge-text.h +src/merge-vcard.c +src/merge-vcard.h +src/mini-label-preview.c +src/mini-label-preview.h src/mini-preview.c src/mini-preview.h -src/wdgt-chain-button.c -src/wdgt-chain-button.h +src/mini-preview-pixbuf.c +src/mini-preview-pixbuf-cache.c +src/mini-preview-pixbuf-cache.h +src/mini-preview-pixbuf.h +src/new-label-dialog.c +src/new-label-dialog.h +src/object-editor-bc-page.c +src/object-editor.c +src/object-editor-data-page.c +src/object-editor-edit-page.c +src/object-editor-fill-page.c +src/object-editor.h +src/object-editor-image-page.c +src/object-editor-line-page.c +src/object-editor-lsize-page.c +src/object-editor-position-page.c +src/object-editor-private.h +src/object-editor-shadow-page.c +src/object-editor-size-page.c +src/object-editor-text-page.c +src/pixbuf-cache.c +src/pixbuf-cache.h +src/prefs.c +src/prefs-dialog.c +src/prefs-dialog.h +src/prefs.h +src/prefs-model.c +src/prefs-model.h +src/print.c +src/print.h +src/print-op.c +src/print-op-dialog.c +src/print-op-dialog.h +src/print-op.h +src/recent.c +src/recent.h +src/rotate-label-button.c +src/rotate-label-button.h +src/stock.c +src/stock.h +src/template-designer.c +src/template-designer.h +src/text-node.c +src/text-node.h +src/ui.c +src/ui-commands.c +src/ui-commands.h +src/ui.h +src/ui-property-bar.c +src/ui-property-bar.h +src/ui-sidebar.c +src/ui-sidebar.h +src/ui-util.c +src/ui-util.h src/util.c src/util.h -src/color.c -src/color.h -src/debug.c -src/debug.h -src/critical-error-handler.c +src/view-barcode.c +src/view-barcode.h +src/view-box.c +src/view-box.h +src/view.c +src/view-ellipse.c +src/view-ellipse.h +src/view.h +src/view-image.c +src/view-image.h +src/view-line.c +src/view-line.h +src/view-object.c +src/view-object.h +src/view-text.c +src/view-text.h src/warning-handler.c +src/warning-handler.h +src/wdgt-chain-button.c +src/wdgt-chain-button.h +src/wdgt-media-select.c +src/wdgt-media-select.h +src/wdgt-merge-menu.c +src/wdgt-merge-menu.h +src/window.c +src/window.h +src/xml-label-04.c +src/xml-label-04.h +src/xml-label.c +src/xml-label.h libglabels/category.c libglabels/category.h diff --git a/glabels2/src/merge-properties-dialog.c b/glabels2/src/merge-properties-dialog.c index 4632d919..909b9d27 100644 --- a/glabels2/src/merge-properties-dialog.c +++ b/glabels2/src/merge-properties-dialog.c @@ -55,6 +55,8 @@ struct _glMergePropertiesDialogPrivate { GtkWidget *select_all_button; GtkWidget *unselect_all_button; + GtkWidget *ok_button; + gchar *saved_src; }; @@ -117,6 +119,9 @@ static void unselect_all_button_clicked_cb (GtkWidget G_DEFINE_TYPE (glMergePropertiesDialog, gl_merge_properties_dialog, GTK_TYPE_DIALOG); +/*****************************************************************************/ +/* Class Init Function. */ +/*****************************************************************************/ static void gl_merge_properties_dialog_class_init (glMergePropertiesDialogClass *class) { @@ -130,31 +135,64 @@ 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) { @@ -209,15 +247,11 @@ gl_merge_properties_dialog_construct (glMergePropertiesDialog *dialog, 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; @@ -232,31 +266,6 @@ gl_merge_properties_dialog_construct (glMergePropertiesDialog *dialog, 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); @@ -296,6 +305,8 @@ gl_merge_properties_dialog_construct (glMergePropertiesDialog *dialog, 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); @@ -331,7 +342,6 @@ gl_merge_properties_dialog_construct (glMergePropertiesDialog *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); @@ -363,6 +373,12 @@ gl_merge_properties_dialog_construct (glMergePropertiesDialog *dialog, 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"); } @@ -403,6 +419,8 @@ type_changed_cb (GtkWidget *widget, 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),