[passepartout] Finished the GtkAboutDialog transition



commit c89d544d805a32ded43bf450a80e3df46da0c887
Author: Sven Herzberg <sven imendio com>
Date:   Tue Mar 20 11:00:47 2007 +0100

    Finished the GtkAboutDialog transition
---
 src/pptout/Makefile.am    |    8 +++++---
 src/pptout/aboutdialog.cc |   17 +----------------
 src/pptout/authors.h      |   31 +++++++++++++++++++++++++++++++
 3 files changed, 37 insertions(+), 19 deletions(-)

diff --git a/src/pptout/Makefile.am b/src/pptout/Makefile.am
index cd94e46..7bdb737 100644
--- a/src/pptout/Makefile.am
+++ b/src/pptout/Makefile.am
@@ -6,6 +6,7 @@ bin_PROGRAMS = passepartout
 
 dist_noinst_HEADERS=\
 	aboutdialog.h \
+	authors.h \
 	config.h \
 	icons.h \
 	preferencesdialog.h \
@@ -60,8 +61,9 @@ passepartout-builddate.$(OBJEXT): \
 
 # build a string out of the contents of AUTHORS
 authors.cc: $(top_srcdir)/AUTHORS Makefile
-	awk 'BEGIN {print "const char *authors ="}'\
-	'{print "\"" $$0 "\\n\""}'\
-	'END {print ";"}' $< > $@
+	awk 'BEGIN {print "#include \"authors.h\"\n#include <glib/gtypes.h>\n\nstatic const char *real_authors[] = {"}'\
+	'{print "\t\"" $$0"\","}'\
+	'END {print "\tNULL\n};\n\ngchar const** authors = real_authors;\n"}' \
+	    $< > $@
 
 CLEANFILES=$(BUILT_SOURCES)
diff --git a/src/pptout/aboutdialog.cc b/src/pptout/aboutdialog.cc
index 740a901..67decc3 100644
--- a/src/pptout/aboutdialog.cc
+++ b/src/pptout/aboutdialog.cc
@@ -13,6 +13,7 @@
 #include <gtkmm/stock.h>
 #include <gtkmm/notebook.h>
 #include <gtkmm/scrolledwindow.h>
+#include "authors.h"
 #include "icons/logo.h"
 
 AboutDialog *AboutDialog::_instance = 0;
@@ -21,9 +22,6 @@ extern const char *builddate;
 // The date this program was linked.
 // Defined in builddate.cc.
 
-// The contents of the AUTHORS file as a string in authors.cc
-extern const char *authors;
-
 namespace {
   const std::string mail_address = "passepartout stacken kth se";
 
@@ -39,11 +37,6 @@ AboutDialog::AboutDialog()
 //  : DialogWrap("About")
 {
 {
-  gchar const* authors[] = {
-	  "Frederik Arnerup",
-	  "Rasmus Kaj",
-	  NULL
-  };
   // FIXME: the size looks fishy
   set_logo (Gdk::Pixbuf::create_from_inline(69624, logo));
   set_name (_("Passepartout"));
@@ -58,14 +51,6 @@ AboutDialog::AboutDialog()
 }
   set_resizable(false);
 
-  // Credits
-  Gtk::ScrolledWindow *scroller = manage(new Gtk::ScrolledWindow());
-  scroller->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
-  Gtk::Label *label = manage(new Gtk::Label(Glib::ustring("\n") + authors));
-  scroller->add(*label);
-  label->set_selectable();
-
-  get_vbox()->pack_start(*scroller);
   show_all_children();
 }
 
diff --git a/src/pptout/authors.h b/src/pptout/authors.h
new file mode 100644
index 0000000..438e27d
--- /dev/null
+++ b/src/pptout/authors.h
@@ -0,0 +1,31 @@
+/* This file is part of passepartout
+ *
+ * AUTHORS
+ *     Sven Herzberg  <herzi gnome-de org>
+ *
+ * Copyright (C) 2007  Sven Herzberg
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+#ifndef AUTHORS_H
+#define AUTHORS_H
+
+#include <glib/gtypes.h>
+
+extern gchar const **authors;
+
+#endif /* !AUTHORS_H */



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