Add About dialog to aoview.
authorKeith Packard <keithp@keithp.com>
Mon, 18 May 2009 06:05:23 +0000 (23:05 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 18 May 2009 06:05:23 +0000 (23:05 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
aoview/Makefile
aoview/aoview.glade
aoview/aoview_main.c

index 253a160ed89dd40158313a269cd3336f0bdb950b..8f9c08df1e355730155936b7b79b561cb1cfe8a5 100644 (file)
@@ -1,7 +1,8 @@
+VERSION=$(shell git describe)
 MODULES=gtk+-2.0 libglade-2.0 gconf-2.0
 INCLUDES=$(shell pkg-config --cflags $(MODULES)) -I..
 WARN= -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing
-CFLAGS=$(INCLUDES) -O0 -g $(WARN)
+CFLAGS=$(INCLUDES) -O0 -g $(WARN) -DAOVIEW_VERSION='"$(VERSION)"'
 LIBS=$(shell pkg-config --libs $(MODULES)) -lm
 
 SRC = \
index 925804727e35ba06e94adae3bed7683aef32bb62..74485ec5626340f28d384e983d511506e0169ccb 100644 (file)
                         <property name="visible">True</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
+                        <signal name="activate" handler="gtk_widget_show" object="about_dialog" after="yes"/>
                       </widget>
                     </child>
                   </widget>
       </widget>
     </child>
   </widget>
+  <widget class="GtkAboutDialog" id="about_dialog">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">About AoView</property>
+    <property name="resizable">False</property>
+    <property name="type_hint">normal</property>
+    <property name="transient_for">aoview</property>
+    <property name="has_separator">False</property>
+    <property name="program_name">AoView</property>
+    <property name="copyright" translatable="yes">Copyright &#xA9; 2009 Keith Packard</property>
+    <property name="comments" translatable="yes">AltOS data capture and display.</property>
+    <property name="website">http://altusmetrum.org</property>
+    <property name="license" translatable="yes">AoView 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; version 2 of the License.
+
+AoView 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 AoView; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</property>
+    <property name="authors">Keith Packard &lt;keithp@keithp.com&gt;</property>
+    <property name="wrap_license">True</property>
+    <signal name="close" handler="gtk_widget_hide" object="about_dialog" after="yes"/>
+    <signal name="response" handler="gtk_widget_hide" object="about_dialog" after="yes"/>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox7">
+        <property name="visible">True</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area7">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
 </glade-interface>
index 9e32e6398c49174f8708586426aa01c3ccef0173..e2164e05ec166037ad5b534e48fabaab47532b37 100644 (file)
@@ -32,6 +32,7 @@ int main(int argc, char **argv)
        GladeXML *xml = NULL;
        GtkWidget *mainwindow;
        char *device = NULL;
+       GtkAboutDialog *about_dialog;
 
        static struct option long_options[] = {
                { "device", 1, 0, 'd'},
@@ -62,9 +63,15 @@ int main(int argc, char **argv)
 
        /* Hook up the close button. */
        mainwindow = glade_xml_get_widget(xml, "aoview");
+       assert(mainwindow);
+
        g_signal_connect (G_OBJECT(mainwindow), "destroy",
            G_CALLBACK(destroy_event), NULL);
 
+       about_dialog = GTK_ABOUT_DIALOG(glade_xml_get_widget(xml, "about_dialog"));
+       assert(about_dialog);
+       gtk_about_dialog_set_version(about_dialog, AOVIEW_VERSION);
+
        aoview_dev_dialog_init(xml);
 
        aoview_state_init(xml);