From owner-p4-projects@FreeBSD.ORG Sat May 19 20:52:52 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F189216A41F; Sat, 19 May 2007 20:52:51 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A4C6516A46E for ; Sat, 19 May 2007 20:52:51 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 93FAE13C44B for ; Sat, 19 May 2007 20:52:51 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l4JKqpSW076901 for ; Sat, 19 May 2007 20:52:51 GMT (envelope-from ivoras@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l4JKqpPa076892 for perforce@freebsd.org; Sat, 19 May 2007 20:52:51 GMT (envelope-from ivoras@FreeBSD.org) Date: Sat, 19 May 2007 20:52:51 GMT Message-Id: <200705192052.l4JKqpPa076892@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ivoras@FreeBSD.org using -f From: Ivan Voras To: Perforce Change Reviews Cc: Subject: PERFORCE change 120077 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2007 20:52:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=120077 Change 120077 by ivoras@ivoras_beastie on 2007/05/19 20:51:54 * Separate basic window UI support in a separate class (BaseWin) * Add "Help" button to MainWin Affected files ... .. //depot/projects/soc2007/ivoras_finstall/installer/basewin.py#1 add .. //depot/projects/soc2007/ivoras_finstall/installer/finstall.py#6 edit .. //depot/projects/soc2007/ivoras_finstall/installer/glade/mainwin.glade#5 edit Differences ... ==== //depot/projects/soc2007/ivoras_finstall/installer/finstall.py#6 (text+ko) ==== @@ -2,8 +2,9 @@ from types import MethodType import gtk, gtk.gdk, gtk.glade +from basewin import BaseWin -class MainWin: +class MainWin(BaseWin): # Configured tracks Steps_Novice = [ @@ -13,10 +14,8 @@ def __init__(self): + BaseWin.__init__(self, "mainwin") self.tile_xml = None # will be used for tiles - self.xml = gtk.glade.XML("glade/mainwin.glade") - self.window = self.xml.get_widget("mainwin") - self.xml.signal_autoconnect(self._get_event_handlers(None)) self["img_logo"].set_from_file("img/logo.jpg") # img_logo stretches the window vertically, so calling window.set_position() has no affect self._center_window(self.window) @@ -39,41 +38,6 @@ return self.xml.get_widget(key) - def _center_window(self, window): - """Centers window on screen """ - ws = window.get_size() - window.move((gtk.gdk.screen_width() - ws[0]) / 2, (gtk.gdk.screen_height() - ws[1]) / 2) - - - def _get_event_handlers(self, prefix): - """Returns a dictionary of form {'on_method' : self.on_method} for all - methods of self begining with "on_". This is useful for binding signal - handlers.""" - dict = {} - if prefix != None: - prefix2 = "%s_on_" % prefix - else: - prefix2 = "on_" - for name in dir(self): - if not name.startswith(prefix2): - continue - attr = getattr(self, name) - if isinstance(attr, MethodType): - dict[name[len(prefix2)-3:]] = attr - return dict - - - def _load_label(self, file_name): - """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("
", "\n").replace("\n ", "\n") - - - def _clear_container(self, cont): - for child in cont.get_children(): - cont.remove(child) - - def _load_tile(self, tile_name): """Loads a tile by it's name and integrates it in the wizard window""" self._clear_container(self.xml.get_widget("vbox_container")) @@ -145,7 +109,7 @@ def intro_on_next(self): if self["radio_novice"].get_active(): - pass # The default track is already Novice + pass # The default track is Novice elif self["radio_standard"].get_active(): print "standard" elif self["radio_expert"].get_active(): ==== //depot/projects/soc2007/ivoras_finstall/installer/glade/mainwin.glade#5 (text+ko) ==== @@ -33,6 +33,7 @@ 530 + 420 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 3 @@ -159,6 +160,17 @@ True + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + gtk-help + True + + + + True True @@ -166,6 +178,9 @@ gtk-cancel True + + 1 + @@ -177,7 +192,7 @@ - 1 + 2 @@ -190,7 +205,7 @@ - 2 + 3