From b243b009bb094c06ca9d60e81cf4700e48dc2947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sat, 24 Oct 2009 00:10:31 +0200 Subject: Adding revison info to version output. As the revision is no longer encoded in the version, it needs to be printed whereever it is useful. This commit adds it to the 'About' window and to the exception infos. --- portato/gui/exception_handling.py | 5 ++++- portato/gui/templates/AboutWindow.ui | 33 +++++++++++++++++++++++++++++++++ portato/gui/windows/about.py | 8 +++++++- 3 files changed, 44 insertions(+), 2 deletions(-) (limited to 'portato/gui') diff --git a/portato/gui/exception_handling.py b/portato/gui/exception_handling.py index c973e6b..0ec1e9a 100644 --- a/portato/gui/exception_handling.py +++ b/portato/gui/exception_handling.py @@ -97,10 +97,13 @@ def convert (version): return ".".join(map(str, version)) def get_version_infos(): - from ..constants import VERSION + from ..constants import VERSION, REVISION from ..backend import system from ..db import _TYPE as db_type + if REVISION: + VERSION = "%s (git: %s)" % (VERSION, REVISION) + return "\n".join(( "Portato version: %s" % VERSION, "System: %s" % " ".join(get_runsystem()), diff --git a/portato/gui/templates/AboutWindow.ui b/portato/gui/templates/AboutWindow.ui index ce612b3..ec3ed7e 100644 --- a/portato/gui/templates/AboutWindow.ui +++ b/portato/gui/templates/AboutWindow.ui @@ -39,6 +39,39 @@ Turkish - Gürkan 'seqizz' Gür GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical 2 + + + True + True + 5 + + + True + <b>Git revision:</b> + True + + + False + 0 + + + + + True + 0 + label + True + True + + + 1 + + + + + 2 + + diff --git a/portato/gui/windows/about.py b/portato/gui/windows/about.py index 937ed8b..6c6fec5 100644 --- a/portato/gui/windows/about.py +++ b/portato/gui/windows/about.py @@ -15,7 +15,7 @@ from __future__ import absolute_import import gtk from .basic import AbstractDialog -from ...constants import VERSION, APP_ICON +from ...constants import VERSION, REVISION, APP_ICON class AboutWindow (AbstractDialog): """A window showing the "about"-informations.""" @@ -30,5 +30,11 @@ class AboutWindow (AbstractDialog): self.window.set_version(VERSION) self.window.set_logo(img.get_pixbuf()) + if REVISION: + gitlabel = self.tree.get_widget("gitLabel") + gitlabel.set_label(REVISION) + else: + self.tree.get_widget("gitHB").hide() + self.window.show_all() -- cgit v1.2.3