Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 May 2007 23:02:24 GMT
From:      Ivan Voras <ivoras@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 120435 for review
Message-ID:  <200705262302.l4QN2ODE026744@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=120435

Change 120435 by ivoras@ivoras_finstall on 2007/05/26 23:02:14

	- Add window icon decoration (bobblehead)
	- Add "Help" dialog and corresponding infrastructure

Affected files ...

.. //depot/projects/soc2007/ivoras_finstall/installer/basewin.py#2 edit
.. //depot/projects/soc2007/ivoras_finstall/installer/finstall.py#7 edit
.. //depot/projects/soc2007/ivoras_finstall/installer/glade/helpdialog.glade#1 add
.. //depot/projects/soc2007/ivoras_finstall/installer/glade/mainwin.glade#6 edit
.. //depot/projects/soc2007/ivoras_finstall/installer/glade/ndisks.glade#2 edit
.. //depot/projects/soc2007/ivoras_finstall/installer/help/generic.txt#1 add
.. //depot/projects/soc2007/ivoras_finstall/installer/helpdialog.py#1 add

Differences ...

==== //depot/projects/soc2007/ivoras_finstall/installer/basewin.py#2 (text+ko) ====

@@ -1,3 +1,4 @@
+import os.path
 from types import MethodType
 import gtk, gtk.gdk, gtk.glade
 
@@ -38,10 +39,11 @@
 		return dict
 
 
-	def _load_label(self, file_name):
+	def _load_label(self, label, file_name, dir="text"):
 		"""Returns the content of a text/* file with formatting replacements
 		so it looks decent when Pango renders it"""
-		return file("text/%s" % file_name).read().replace("\n", " ").replace("<br>", "\n").replace("\n ", "\n")
+		label.set_text(file("%s/%s" % (dir, file_name)).read().replace("\n", " ").replace("<br>", "\n").replace("\n ", "\n"))
+		label.set_use_markup(True)
 
 
 	def _clear_container(self, cont):

==== //depot/projects/soc2007/ivoras_finstall/installer/finstall.py#7 (text+ko) ====

@@ -3,6 +3,7 @@
 import gtk, gtk.gdk, gtk.glade
 
 from basewin import BaseWin
+from helpdialog import HelpDialog
 
 class MainWin(BaseWin):
 
@@ -100,10 +101,14 @@
 		self._load_tile_nr(self.step_current)
 
 
+	def on_button_help_clicked(self, obj):
+		help = HelpDialog(self.step_track[self.step_current]["tile"])
+		help.window.show()
+	
+
 	# Handlers for "intro" tile
 	def intro_on_load(self):
-		self["label2"].set_text(self._load_label("intro.txt"))
-		self["label2"].set_use_markup(True)
+		self._load_label(self["label2"], "intro.txt")
 		return True
 
 
@@ -119,8 +124,7 @@
 
 	# Handlers for "ndisks"
 	def ndisks_on_load(self):
-		self["label2"].set_text(self._load_label("ndisks.txt"))
-		self["label2"].set_use_markup(True)
+		self._load_label(self["label2"], "ndisks.txt")
 		return True
 
 

==== //depot/projects/soc2007/ivoras_finstall/installer/glade/mainwin.glade#6 (text+ko) ====

@@ -11,6 +11,7 @@
     <property name="window_position">GTK_WIN_POS_CENTER</property>
     <property name="default_width">750</property>
     <property name="default_height">450</property>
+    <property name="icon">logo.png</property>
     <signal name="delete_event" handler="on_mainwin_delete_event"/>
     <child>
       <widget class="GtkHBox" id="hbox1">

==== //depot/projects/soc2007/ivoras_finstall/installer/glade/ndisks.glade#2 (text+ko) ====

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.2.0 on Thu May 17 16:45:42 2007 by ivoras@beastie.home.net-->
+<!--Generated with glade3 3.2.0 on Sat May 19 12:02:23 2007 by ivoras@beastie.home.net-->
 <glade-interface>
   <widget class="GtkWindow" id="window1">
     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -47,9 +47,11 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="border_width">2</property>
                 <property name="headers_clickable">True</property>
               </widget>
               <packing>
+                <property name="padding">6</property>
                 <property name="position">2</property>
               </packing>
             </child>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705262302.l4QN2ODE026744>