[d-feet/pygi] Add about dialog



commit cfccac127866e489ac267be46a7520204cce0800
Author: Thomas Bechtold <thomasbechtold jpberlin de>
Date:   Mon Sep 17 21:43:43 2012 +0200

    Add about dialog

 dfeet/DFeetApp.py |    9 ++++++-
 ui/mainwindow.ui  |   66 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+), 1 deletions(-)
---
diff --git a/dfeet/DFeetApp.py b/dfeet/DFeetApp.py
index 04cff60..d8faef4 100644
--- a/dfeet/DFeetApp.py
+++ b/dfeet/DFeetApp.py
@@ -47,6 +47,7 @@ class DFeetApp:
             'action_sessionbus_connect_activate_cb': self.__sessionbus_connect_cb,
             'action_otherbus_connect_activate_cb': self.__otherbus_connect_cb,
             'action_close_activate_cb': self.__close_cb,
+            'action_about_activate_cb': self.__action_about_activate_cb,
             }
 
         settings = Settings.get_instance()
@@ -60,7 +61,7 @@ class DFeetApp:
         self.notebook = ui.get_widget('display_notebook')
         self.notebook.show_all()
         self.notebook_page_widget = ui.get_widget('box_notebook_page')
-
+        self.about_dialog = ui.get_widget('aboutdialog')
         #create bus history list and load entries from settings
         self.__bus_history = []
         for bus in settings.general['addbus_list']:
@@ -115,6 +116,12 @@ class DFeetApp:
                     print "can not connect to '%s': %s" % (address, str(e))
         dialog.destroy()
 
+    def __action_about_activate_cb(self, action):
+        """ show the about dialog """
+        self.about_dialog.set_visible(True)
+        self.about_dialog.run()
+        self.about_dialog.set_visible(False)
+
 
     def __notebook_append_page(self, widget, text):
         """ add a page to the notebook """
diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui
index fdef12d..41f91f0 100644
--- a/ui/mainwindow.ui
+++ b/ui/mainwindow.ui
@@ -35,6 +35,49 @@
       </object>
     </child>
   </object>
+  <object class="GtkActionGroup" id="actiongroup_help">
+    <child>
+      <object class="GtkAction" id="action_about">
+        <property name="label" translatable="yes">About</property>
+        <property name="stock_id">gtk-about</property>
+        <signal name="activate" handler="action_about_activate_cb" swapped="no"/>
+      </object>
+    </child>
+  </object>
+  <object class="GtkAboutDialog" id="aboutdialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">About d-feet</property>
+    <property name="window_position">mouse</property>
+    <property name="icon">dfeet-icon.png</property>
+    <property name="type_hint">normal</property>
+    <property name="program_name">d-feet</property>
+    <property name="website">https://live.gnome.org/DFeet/</property>
+    <property name="logo">dfeet-icon.png</property>
+    <property name="license_type">gpl-2-0</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="aboutdialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="aboutdialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+      </object>
+    </child>
+  </object>
   <object class="GtkWindow" id="appwindow1">
     <property name="width_request">300</property>
     <property name="height_request">200</property>
@@ -49,6 +92,7 @@
         <property name="can_focus">False</property>
         <child>
           <object class="GtkMenuBar" id="menubar1">
+            <property name="visible">True</property>
             <property name="can_focus">False</property>
             <child>
               <object class="GtkMenuItem" id="menuitem_file">
@@ -102,6 +146,28 @@
                 </child>
               </object>
             </child>
+            <child>
+              <object class="GtkMenuItem" id="menuitem_help">
+                <property name="use_action_appearance">False</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Help</property>
+                <property name="use_underline">True</property>
+                <child type="submenu">
+                  <object class="GtkMenu" id="menu2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <child>
+                      <object class="GtkMenuItem" id="menuitem_about">
+                        <property name="related_action">action_about</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
           </object>
           <packing>
             <property name="expand">False</property>



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