[easytag/wip/application-window: 70/108] Refactor about dialog handling



commit 735d7902ca057084a51d8a2dc8b08ac53e894f2a
Author: David King <amigadave amigadave com>
Date:   Tue Aug 5 16:51:54 2014 +0100

    Refactor about dialog handling
    
    Fetch the parent from EtApplication.

 src/about.c       |    5 +++--
 src/about.h       |   44 +++++++++++++++++++++-----------------------
 src/application.c |    6 +++++-
 3 files changed, 29 insertions(+), 26 deletions(-)
---
diff --git a/src/about.c b/src/about.c
index 69fe5e1..76f5ca8 100644
--- a/src/about.c
+++ b/src/about.c
@@ -26,7 +26,8 @@
 #include "about.h"
 #include "easytag.h"
 
-void Show_About_Window (void)
+void
+et_show_about_dialog (GtkWindow *parent)
 {
     static const gchar * const artists[] =
     {
@@ -93,7 +94,7 @@ void Show_About_Window (void)
         translators = NULL;
     }
 
-    gtk_show_about_dialog (GTK_WINDOW (MainWindow),
+    gtk_show_about_dialog (parent,
                            "artists", artists,
                            "authors", authors,
                            "comments", _("View and edit tags in audio files"),
diff --git a/src/about.h b/src/about.h
index d89d157..97b4be2 100644
--- a/src/about.h
+++ b/src/about.h
@@ -1,33 +1,31 @@
-/* about.h - 2000/05/05 */
-/*
- *  EasyTAG - Tag editor for MP3 and Ogg Vorbis files
- *  Copyright (C) 2000-2003  Jerome Couderc <easytag gmail com>
+/* EasyTAG - Tag editor for audio files
+ * Copyright (C) 2014  David King <amigadave amigadave com>
+ * Copyright (C) 2000-2003  Jerome Couderc <easytag gmail com>
  *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
+#ifndef ET_ABOUT_H_
+#define ET_ABOUT_H_
 
-#ifndef __ABOUT_H__
-#define __ABOUT_H__
+#include <gtk/gtk.h>
 
+G_BEGIN_DECLS
 
-/**************
- * Prototypes *
- **************/
+void et_show_about_dialog (GtkWindow *parent);
 
-void Show_About_Window (void);
+G_END_DECLS
 
-
-#endif /* __ABOUT_H__ */
+#endif /* ET_ABOUT_H_ */
diff --git a/src/application.c b/src/application.c
index 0ca3711..8e7cc01 100644
--- a/src/application.c
+++ b/src/application.c
@@ -72,7 +72,11 @@ on_about (GSimpleAction *action,
           GVariant *parameter,
           gpointer user_data)
 {
-    Show_About_Window ();
+    GList *windows;
+
+    windows = gtk_application_get_windows (GTK_APPLICATION (user_data));
+
+    et_show_about_dialog (windows->data);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]