[ontv] Moved AboutDialog to .ui file



commit b1b9e6718c2691af25b0867cd2d364465d68b1fd
Author: Olof Kindgren <olki src gnome org>
Date:   Wed Dec 23 19:23:44 2009 +0100

    Moved AboutDialog to .ui file
    
    This simplifies the code a little bit and kills the dependency on libgnomeui

 data/ontv.ui    |   37 +++++++++++++++++++++++++++++++++++++
 ontv/applet.py  |   11 ++++++++---
 ontv/dialogs.py |   23 -----------------------
 3 files changed, 45 insertions(+), 26 deletions(-)
---
diff --git a/data/ontv.ui b/data/ontv.ui
index 5ec2fc9..64f455f 100644
--- a/data/ontv.ui
+++ b/data/ontv.ui
@@ -1124,4 +1124,41 @@
       <action-widget response="0">channel_okbutton</action-widget>
     </action-widgets>
   </object>
+  <object class="GtkAboutDialog" id="about_dialog">
+    <property name="border_width">5</property>
+    <property name="type_hint">normal</property>
+    <property name="has_separator">False</property>
+    <property name="copyright" translatable="yes">Copyright (C) 2004-2008 Johan Svedberg</property>
+    <property name="comments" translatable="yes">OnTV is a GNOME Applet for monitoring TV programs.</property>
+    <property name="website">http://live.gnome.org/OnTV</property>
+    <property name="license">GNU General Public License version 2</property>
+    <property name="authors">Johan Svedberg &lt;johan svedberg com&gt;
+Olof Kindgren &lt;olki src gnome org&gt;</property>
+    <property name="translator_credits" translatable="yes">translator-credits</property>
+    <property name="artists">Josef Vyb&#xED;ral &lt;cornelius vybiral info&gt;
+Andreas Nilsson &lt;nisses mail home se&gt;
+Ville P&#xE4;tsi &lt;drc gnu org&gt;</property>
+    <property name="logo_icon_name">ontv</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox5">
+        <property name="visible">True</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child>
+          <placeholder/>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area5">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
 </interface>
diff --git a/ontv/applet.py b/ontv/applet.py
index a06d4c6..1fb87ff 100644
--- a/ontv/applet.py
+++ b/ontv/applet.py
@@ -27,7 +27,7 @@ import gnomeapplet
 import gui
 from assistant import XMLTVAssistant
 from config import Configuration
-from dialogs import PreferencesDialog, SearchDialog, AboutDialog
+from dialogs import PreferencesDialog, SearchDialog
 from key_binder import KeyBinder
 from reminders import Reminders
 from window import ProgramWindow
@@ -96,8 +96,13 @@ class OnTVApplet(object):
         self.xmltvfile.download()
 
     def __run_ad(self, uicomponent=None, verb=None):
-        self.ad = AboutDialog()
-        self.ad.run()
+        builder = gtk.Builder()
+        builder.add_from_file(gui.ui_file)
+        ad = builder.get_object("about_dialog")
+        ad.set_name(NAME)
+        ad.set_version(VERSION)
+        ad.connect("response", lambda d, r: d.destroy())
+        ad.show()
 
     def run(self):
         if self.configure or self.config.grabber_command == '':
diff --git a/ontv/dialogs.py b/ontv/dialogs.py
index d154342..570e3fd 100644
--- a/ontv/dialogs.py
+++ b/ontv/dialogs.py
@@ -26,7 +26,6 @@ import gtk
 import gconf
 import gobject
 import pango
-import gnome.ui
 
 import config
 import gui
@@ -40,28 +39,6 @@ COL_PIXBUF = 1
 COL_ISDIR  = 2
 COL_TITLE  = 3
 
-class AboutDialog(gtk.AboutDialog):
-    def __init__(self):
-        gtk.AboutDialog.__init__(self)
-        gtk.about_dialog_set_email_hook(self.__url_hook, "mailto:";)
-        gtk.about_dialog_set_url_hook(self.__url_hook, "")
-
-        self.set_logo_icon_name("ontv")
-        self.set_name(NAME)
-        self.set_version(VERSION)
-        self.set_copyright("Copyright (C) 2004-2008 Johan Svedberg")
-        self.set_website("http://live.gnome.org/OnTV";)
-        self.set_comments(_("OnTV is a GNOME Applet for monitoring TV programs."))
-        self.set_authors(["Johan Svedberg <johan svedberg com>"])
-        self.set_translator_credits(_("translator-credits"))
-        self.set_license("GNU General Public License version 2")
-        self.set_artists(["Josef Vybíral <cornelius vybiral info>", "Andreas Nilsson <nisses mail home se>", "Ville Pätsi <drc gnu org>"])
-
-        self.connect("response", lambda self, *args: self.destroy())
-
-    def __url_hook(self, widget, url, scheme):
-        gnome.ui.url_show_on_screen(scheme + url, widget.get_screen())
-
 class ChannelDialog:
     def __init__(self, channel, pd):
         self.channel = channel



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