]> git.sur5r.net Git - glabels/commitdiff
"New" dialog is now modal.
authorJim Evins <evins@snaught.com>
Fri, 27 Dec 2002 16:55:18 +0000 (16:55 +0000)
committerJim Evins <evins@snaught.com>
Fri, 27 Dec 2002 16:55:18 +0000 (16:55 +0000)
Added short name to titles of "print" and "save as" dialogs.

git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@224 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/src/file.c
glabels2/src/print-dialog.c

index d5b7e1b8ea77dcfe623d4ea7ee274ebed299ab65..6f68aee04b5c15a9256e230e67e19150aa703f16 100644 (file)
@@ -81,7 +81,7 @@ gl_file_new (GtkWindow *window)
 
        dlg = gl_hig_dialog_new_with_buttons (_("New Label or Card"),
                                              window,
-                                             GTK_DIALOG_DESTROY_WITH_PARENT,
+                                             GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
                                              GTK_STOCK_OK, GTK_RESPONSE_OK,
                                              GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                                              NULL);
@@ -501,14 +501,18 @@ gl_file_save_as (glLabel   *label,
        GtkFileSelection *fsel;
        gboolean          saved_flag = FALSE;
        gboolean          destroy_flag = FALSE;
+       gchar            *name, *title;
 
        gl_debug (DEBUG_FILE, "START");
 
-       g_return_val_if_fail (label != NULL, FALSE);
-       g_return_val_if_fail (window != NULL, FALSE);
+       g_return_val_if_fail (label && GL_IS_LABEL(label), FALSE);
+       g_return_val_if_fail (window && GTK_IS_WINDOW(window), FALSE);
 
+       name = gl_label_get_short_name (label);
+       title = g_strdup_printf (_("Save \"%s\" as"), name);
+       g_free (name);
 
-       fsel = GTK_FILE_SELECTION (gtk_file_selection_new (_("Save label as")));
+       fsel = GTK_FILE_SELECTION (gtk_file_selection_new (title));
        gtk_window_set_modal (GTK_WINDOW (fsel), TRUE);
        gtk_window_set_transient_for (GTK_WINDOW (fsel), window);
 
@@ -545,6 +549,8 @@ gl_file_save_as (glLabel   *label,
                gtk_widget_destroy (GTK_WIDGET (fsel));
        }
 
+       g_free (title);
+
        gl_debug (DEBUG_FILE, "END");
 
        /* Return flag as set by one of the above callbacks, TRUE = saved */
index 9e761133cbd435a72e75a7f5f3f038789ff7f64e..e4d76d109db0b35f70b59ecc41d6c2d3b253d197 100644 (file)
@@ -87,12 +87,17 @@ gl_print_dialog (glLabel *label, BonoboWindow *win)
 {
        GtkWidget *dlg;
        GtkWidget *pp_button, *notebook, *page;
+       gchar     *name, *title;
 
-       g_return_if_fail (label != NULL);
-       g_return_if_fail (win != NULL);
+       g_return_if_fail (label && GL_IS_LABEL(label));
+       g_return_if_fail (win && BONOBO_IS_WINDOW(win));
+
+       name = gl_label_get_short_name (label);
+       title = g_strdup_printf ("%s \"%s\"", _("Print"), name);
+       g_free (name);
 
        /* ----- Contstruct basic print dialog with notebook ----- */
-       dlg = gl_hig_dialog_new_with_buttons (_("Print"), GTK_WINDOW(win),
+       dlg = gl_hig_dialog_new_with_buttons (title, GTK_WINDOW(win),
                                           GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
                                           GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                                           GTK_STOCK_PRINT, GNOME_PRINT_DIALOG_RESPONSE_PRINT,
@@ -123,6 +128,8 @@ gl_print_dialog (glLabel *label, BonoboWindow *win)
                          G_CALLBACK (print_response), label);
 
        gtk_widget_show_all (GTK_WIDGET (dlg));
+
+       g_free (title);
 }
 
 /*---------------------------------------------------------------------------*/