From eb7845d41f78d54939006c67edb663992c35c5f6 Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Thu, 29 May 2008 12:04:47 -0400 Subject: Rework the exn save UI to be a notebook instead of one large table. This decreases the widget load we were seeing from having so much crammed into one single page. --- gui.py | 53 ++--- ui/exnSave.glade | 652 ++++++++++++++++++++++++++++++------------------------- 2 files changed, 388 insertions(+), 317 deletions(-) diff --git a/gui.py b/gui.py index 96c33a957..456d427ad 100755 --- a/gui.py +++ b/gui.py @@ -42,6 +42,7 @@ import gobject import gettext from language import expandLangs from constants import * +from product import * from network import hasActiveNetDev import xutils import imputil @@ -739,22 +740,16 @@ class SaveExceptionWindow: self.scpHostEntry = exnxml.get_widget("scpHostEntry") self.scpDestEntry = exnxml.get_widget("scpDestEntry") - self.diskButton = exnxml.get_widget("diskButton") + self.notebook = exnxml.get_widget("destNotebook") + self.destCombo = exnxml.get_widget("destCombo") + self.diskCombo = exnxml.get_widget("diskCombo") - self.bugzillaButton = exnxml.get_widget("bugzillaButton") - self.bugzillaBox = exnxml.get_widget("bugzillaHBox") - self.scpButton = exnxml.get_widget("scpButton") - self.scpBox = exnxml.get_widget("scpHBox") - self.localButton = exnxml.get_widget("localButton") self.localChooser = exnxml.get_widget("localChooser") self.win = exnxml.get_widget("saveDialog") - self.diskButton.connect("toggled", self.radio_changed) - self.bugzillaButton.connect("toggled", self.radio_changed) - self.localButton.connect("toggled", self.radio_changed) - self.scpButton.connect("toggled", self.radio_changed) + self.destCombo.connect("changed", self.combo_changed) - self.bugzillaButton.set_label(self.bugzillaButton.get_label() % product.bugUrl) + self.destCombo.insert_text(2, _("Bugzilla (%s)") % bugUrl) cell = gtk.CellRendererText() self.diskCombo.pack_start(cell, True) @@ -767,7 +762,10 @@ class SaveExceptionWindow: if flags.livecdInstall: exnxml.get_widget("diskBox").hide() exnxml.get_widget("localBox").show() - self.localButton.set_active(True) + self.destCombo.remove_text(0) + self.destCombo.set_active(0) + self.notebook.remove_page(0) + self.notebook.set_current_page(0) elif len(dests) > 0: for d in dests: iter = store.append(None) @@ -775,21 +773,24 @@ class SaveExceptionWindow: self.diskCombo.set_model(store) self.diskCombo.set_active(0) + self.diskCombo.set_sensitive(True) + + self.destCombo.remove_text(1) + self.destCombo.set_active(0) + self.notebook.remove_page(1) + self.notebook.set_current_page(0) else: - self.diskButton.set_sensitive(False) - self.bugzillaButton.set_active(True) - self.diskCombo.set_sensitive(False) - self.bugzillaBox.set_sensitive(True) + self.destCombo.remove_text(1) + self.destCombo.set_active(1) + self.notebook.remove_page(1) + self.notebook.set_current_page(1) addFrame(self.win) self.win.show() self.window = self.win - def radio_changed(self, args): - self.diskCombo.set_sensitive(self.diskButton.get_active()) - self.bugzillaBox.set_sensitive(self.bugzillaButton.get_active()) - self.localChooser.set_sensitive(self.localButton.get_active()) - self.scpBox.set_sensitive(self.scpButton.get_active()) + def combo_changed(self, args): + self.notebook.set_current_page(self.destCombo.get_active()) def getrc(self): if self.rc == gtk.RESPONSE_OK: @@ -809,8 +810,8 @@ class SaveExceptionWindow: elif self.saveToRemote(): return map(lambda e: e.get_text(), [self.scpNameEntry, self.scpPasswordEntry, - self.hostEntry, - self.destEntry]) + self.scpHostEntry, + self.scpDestEntry]) else: return map(lambda e: e.get_text(), [self.bugzillaNameEntry, self.bugzillaPasswordEntry, @@ -823,13 +824,13 @@ class SaveExceptionWindow: self.rc = self.window.run () def saveToDisk(self): - return self.diskButton.get_active() + return self.destCombo.get_active() == 0 def saveToLocal(self): - return self.localButton.get_active() + return self.destCombo.get_active() == 0 def saveToRemote(self): - return self.scpButton.get_active() + return self.destCombo.get_active() == 2 class MessageWindow: def getrc (self): diff --git a/ui/exnSave.glade b/ui/exnSave.glade index 216e82f01..76a435826 100644 --- a/ui/exnSave.glade +++ b/ui/exnSave.glade @@ -74,7 +74,7 @@ True - Your traceback can either be saved to a local disk or to a bug tracking system. + Please choose a destination for saving your traceback. False False GTK_JUSTIFY_LEFT @@ -97,253 +97,203 @@ - + True - False - 0 + Local disk +Local disk +Remote server (scp) + False + True + + + 0 + False + True + + - - - True - True - Save to local _disk - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - + + + True + False + False + GTK_POS_TOP + False + False - + True 0.5 - 0.5 + 0.10000000149 1 - 1 + 0 0 0 - 10 + 0 0 True + False False True - 0 - True - True + False + True - - - 0 - True - True - - - - - - False - 0 - + True - True - Save to local _disk - True - GTK_RELIEF_NORMAL - True - False - False - True - diskButton + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 - 0 - False - False + tab - + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False 0.5 0.5 - 1 - 1 - 0 - 0 - 10 - 0 - - - - True - Select A File - GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER - True - False - False - -1 - - + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 - 0 - True - True + tab - - - 3 - True - True - - - - - True - False - 0 + + + True + Select A File + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER + True + False + False + -1 + + + False + True + + - + True - True - Send to _bugzilla (%s) - True - GTK_RELIEF_NORMAL - True - False - False - True - diskButton + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 - 0 - False - False + tab - + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False 0.5 0.5 - 1 - 1 - 0 - 0 - 10 - 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 - + + 5 True - False - False - 0 + True + 5 - - 5 + True - True - 5 - - - - True - _User name - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - True - - - - - - True - _Password - True - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - True - - - - - - True - Bug _description - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - + _User name + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -353,68 +303,99 @@ - - 5 + True - True - 5 - - - - True - True - True - True - 0 - - True - - False - - - 0 - True - True - - - - - - True - True - True - False - 0 - - True - - False - - - 0 - True - True - - - - - - True - True - True - True - 0 - - True - - False - - - 0 - False - False - - + _Password + True + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + True + + + + + + True + Bug _description + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + False + True + + + + + + 5 + True + True + 5 + + + + True + True + True + True + 0 + + True + + False + + + 0 + True + True + + + + + + True + True + True + False + 0 + + True + + False 0 @@ -422,51 +403,91 @@ True + + + + True + True + True + True + 0 + + True + + False + + + 0 + False + False + + + + 0 + True + True + - 0 - True - True + False + True - - - 0 - True - True - - - - - True - False - 0 + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + - + + + + + True - True - Send to _remote server (scp) - True - GTK_RELIEF_NORMAL - True - False - False - True - diskButton + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 - 0 - False - False + tab - + True False 0 @@ -487,7 +508,7 @@ GTK_JUSTIFY_LEFT False False - 0.5 + 0 0.5 0 0 @@ -512,7 +533,7 @@ GTK_JUSTIFY_LEFT False False - 0.5 + 0 0.5 0 0 @@ -537,7 +558,7 @@ GTK_JUSTIFY_LEFT False False - 0.5 + 0 0.5 0 0 @@ -562,7 +583,7 @@ GTK_JUSTIFY_LEFT False False - 0.5 + 0 0.5 0 0 @@ -616,7 +637,7 @@ True True True - True + False 0 True @@ -676,16 +697,65 @@ - 0 - True - True + False + True + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab 0 - True - True + False + False -- cgit