From: Jim Evins Date: Fri, 27 Dec 2002 16:55:18 +0000 (+0000) Subject: "New" dialog is now modal. X-Git-Tag: glabels-2_3_0~663 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b4cafe8f16b8cd51af2f50dafd69ac19fa5f844b;p=glabels "New" dialog is now modal. 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 --- diff --git a/glabels2/src/file.c b/glabels2/src/file.c index d5b7e1b8..6f68aee0 100644 --- a/glabels2/src/file.c +++ b/glabels2/src/file.c @@ -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 */ diff --git a/glabels2/src/print-dialog.c b/glabels2/src/print-dialog.c index 9e761133..e4d76d10 100644 --- a/glabels2/src/print-dialog.c +++ b/glabels2/src/print-dialog.c @@ -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); } /*---------------------------------------------------------------------------*/