GNOME Bugzilla – Bug 745152
Prevent multiple about dialogs from opening
Last modified: 2015-02-27 10:35:11 UTC
Clicking 'About' multiple times in the application menu creates multiple about dialogs. In C, one would have used gtk_show_about_dialog. However, since it is a variadic function, and hence unsuitable for bindings, we might have to replicate it.
Or, even better, we can wrap gtk_show_about_dialog in src/lib/gd-utils and pass the pointer to the parent window to the wrapper.
Created attachment 297875 [details] [review] about dialog: prevent to open more than one about dialog attempt to fix it, doesn't work yet
Created attachment 297905 [details] [review] about dialog: prevent to open more than one about dialog
Review of attachment 297905 [details] [review]: Thanks for the nice patch, Alessandro. A few minor issues below. ::: src/lib/gd-utils.c @@ +389,3 @@ + +void +gd_show_about_dialog (GtkWindow *parent, Nitpick. Extra whitespace between GtkWindow and *parent. @@ +409,3 @@ + if(!is_books) + { + program_name = _("Documents"); Since this file now has translatable strings, you need to add src/lib/gd-utils.c to po/POTFILES.in. ::: src/lib/gd-utils.h @@ +49,3 @@ gint page); +void gd_show_about_dialog (GtkWindow *parent, Ditto. ::: src/mainWindow.js @@ +23,3 @@ const Gdk = imports.gi.Gdk; const GLib = imports.gi.GLib; const Gtk = imports.gi.Gtk; Also remove this line because we are not using it anymore: const Config = imports.config;
Created attachment 297959 [details] [review] mainWindow: Prevent multiple about dialogs from opening
Review of attachment 297959 [details] [review]: Perfect. Thanks, Alessandro.