From 69fe67d6af53007bb4fd3cfa01f4a3a3daadd670 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Wed, 1 Apr 2009 19:01:00 -0400 Subject: [PATCH] Generic updates and a bugfix. curses/README,curses/TODO: Cleaned up and updated respectively curses/curses_misc.py: added a get_caption() method to MaskingEdit curses/netentry_curses.py: Actually made the error dialogs work instead of crashing the program. curses/wicd-curses.py: Changed some capitalization in the help. --- curses/README | 4 ++-- curses/TODO | 3 +-- curses/curses_misc.py | 2 ++ curses/netentry_curses.py | 9 +++++---- curses/wicd-curses.py | 4 ++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/curses/README b/curses/README index ecd25c3..29b21c1 100644 --- a/curses/README +++ b/curses/README @@ -32,8 +32,8 @@ F2 : Rename selected wired network profile (from the wired ComboBox) O : Raise ad-hoc network dialog IN DIALOGS (Meta usually is "Alt"): -ESC or Q: Quit dialog without saving information (if present) -Meta+[/]: Change tabs Left/Right (if tabs present) +ESC or Q or q: Quit dialog without saving information (if present) +Meta+[ / Meta+]: Change tabs Left/Right (if tabs present) Meta+Enter : Quit dialog and save information FAQ (WIP): diff --git a/curses/TODO b/curses/TODO index 9861ba4..fb7502c 100644 --- a/curses/TODO +++ b/curses/TODO @@ -1,6 +1,5 @@ Things to do (in no particular order): -* Implement a keyhandler function for the overall frame - * Make keystrokes customizable +* Make keystrokes customizable (Probably not going to happen) * Make color schemes customizable * Perform a mass code cleanup diff --git a/curses/curses_misc.py b/curses/curses_misc.py index d213b72..22b5b12 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -128,6 +128,8 @@ class MaskingEdit(urwid.Edit): self.mask_char = mask_char self.__super.__init__(caption,edit_text,multiline,align,wrap,allow_tab,edit_pos,layout) + def get_caption(self): + return self.caption def get_mask_mode(self): return self.mask_mode def set_mask_mode(self,mode): diff --git a/curses/netentry_curses.py b/curses/netentry_curses.py index 4e6bf29..3abf5d7 100644 --- a/curses/netentry_curses.py +++ b/curses/netentry_curses.py @@ -208,10 +208,11 @@ class WiredSettingsDialog(AdvancedSettingsDialog): ######################################## class WirelessSettingsDialog(AdvancedSettingsDialog): - def __init__(self,networkID): + def __init__(self,networkID,parent): global wireless, daemon AdvancedSettingsDialog.__init__(self) self.networkid = networkID + self.parent = parent global_settings_t = language['global_settings'] encryption_t = language['use_encryption'] autoconnect_t = language['automatic_connect'] @@ -307,9 +308,9 @@ class WirelessSettingsDialog(AdvancedSettingsDialog): for entry_info in encrypt_info.itervalues(): if entry_info[0].get_edit_text() == "" \ and entry_info[1] == 'required': - error(self.ui, self.overlay,"%s (%s)" \ + error(self.ui, self.parent,"%s (%s)" \ % (language['encrypt_info_missing'], - entry_info[0].get_captionabel() ) + entry_info[0].get_caption()[0:-2] ) ) return False @@ -319,7 +320,7 @@ class WirelessSettingsDialog(AdvancedSettingsDialog): elif not self.encryption_chkbox.get_state() and \ wireless.GetWirelessProperty(self.networkid, "encryption"): # Encrypt checkbox is off, but the network needs it. - error(self.ui, self.overlay, language['enable_encryption']) + error(self.ui, self.parent, language['enable_encryption']) return False else: self.set_net_prop("enctype", "None") diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index b2b0251..c4e8274 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -197,7 +197,7 @@ def about_dialog(body): # Modeled after htop's help def help_dialog(body): - textT = urwid.Text(('header','Wicd-curses help'),'right') + textT = urwid.Text(('header','wicd-curses help'),'right') textSH = urwid.Text(['This is ',('blue','wicd-curses-'+CURSES_REVNO),' using wicd ',unicode(daemon.Hello()),'\n']) textH = urwid.Text([ @@ -849,7 +849,7 @@ class appGUI(): else: # wireless list only other option wid,pos = self.thePile.get_focus().get_focus() - self.diag = WirelessSettingsDialog(pos) + self.diag = WirelessSettingsDialog(pos,self.frame) self.diag.ready_widgets(ui,self.frame) self.frame.set_body(self.diag) # Guess what! I actually need to put this here, else I'll have