After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 745152 - Prevent multiple about dialogs from opening
Prevent multiple about dialogs from opening
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
3.14.x
Other All
: Normal normal
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-02-25 10:00 UTC by Debarshi Ray
Modified: 2015-02-27 10:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
about dialog: prevent to open more than one about dialog (5.21 KB, patch)
2015-02-25 13:57 UTC, Alessandro Bono
none Details | Review
about dialog: prevent to open more than one about dialog (5.00 KB, patch)
2015-02-25 17:16 UTC, Alessandro Bono
needs-work Details | Review
mainWindow: Prevent multiple about dialogs from opening (5.58 KB, patch)
2015-02-26 10:53 UTC, Alessandro Bono
committed Details | Review

Description Debarshi Ray 2015-02-25 10:00:20 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.
Comment 1 Debarshi Ray 2015-02-25 10:21:28 UTC
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.
Comment 2 Alessandro Bono 2015-02-25 13:57:18 UTC
Created attachment 297875 [details] [review]
about dialog: prevent to open more than one about dialog

attempt to fix it, doesn't work yet
Comment 3 Alessandro Bono 2015-02-25 17:16:15 UTC
Created attachment 297905 [details] [review]
about dialog: prevent to open more than one about dialog
Comment 4 Debarshi Ray 2015-02-26 09:43:51 UTC
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;
Comment 5 Alessandro Bono 2015-02-26 10:53:43 UTC
Created attachment 297959 [details] [review]
mainWindow: Prevent multiple about dialogs from opening
Comment 6 Debarshi Ray 2015-02-27 10:34:56 UTC
Review of attachment 297959 [details] [review]:

Perfect. Thanks, Alessandro.