1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-20 12:58:07 +01:00

* Fixed indentation errors and syntax errors

* Fixed wicd.py so it starts properly
* Hid the status bar in gui.py when it is displayed via the tray icon
This commit is contained in:
compwiz18
2007-12-17 15:20:02 +00:00
parent 6d708846d9
commit dee28b818c
4 changed files with 34 additions and 13 deletions

View File

@@ -528,12 +528,13 @@ class ConnectionWizard(dbus.service.Object):
def GetWirelessProperty(self,networkid,property): def GetWirelessProperty(self,networkid,property):
''' Retrieves wireless property from the network specified ''' ''' Retrieves wireless property from the network specified '''
value = self.LastScan[networkid].get(property) value = self.LastScan[networkid].get(property)
if self.debug_mode == 1:
print 'returned wireless network',networkid,'property',property,'of value',value
try: try:
value = value.encode('utf-8') value = value.encode('utf-8')
except: except:
pass pass
if self.debug_mode == 1:
#return type instead of value for security
print 'returned wireless network',networkid,'property',property,'of type',type(value)
return value return value
#end function GetWirelessProperty #end function GetWirelessProperty

View File

@@ -139,7 +139,7 @@
<property name="border_width">4</property> <property name="border_width">4</property>
<child> <child>
<widget class="GtkProgressBar" id="progressbar"> <widget class="GtkProgressBar" id="progressbar">
<property name="visible">True</property> <property name="visible">False</property>
<property name="tooltip" translatable="yes">Connecting...</property> <property name="tooltip" translatable="yes">Connecting...</property>
<property name="activity_mode">True</property> <property name="activity_mode">True</property>
<property name="text" translatable="yes">Connecting...</property> <property name="text" translatable="yes">Connecting...</property>

20
gui.py
View File

@@ -103,7 +103,7 @@ _ = lang.gettext
#but it works and makes it easy for me :) #but it works and makes it easy for me :)
########## ##########
# translations are done at # translations are done at
# http://wicd.sourceforge.net/wiki/doku.php?id=translations # http://wicd.net/translator
# please translate if you can! # please translate if you can!
########## ##########
language = {} language = {}
@@ -896,7 +896,8 @@ class appGui:
self.windowname = "gtkbench" self.windowname = "gtkbench"
self.wTree = gtk.glade.XML(gladefile) self.wTree = gtk.glade.XML(gladefile)
dic = { "on_vpn_connection" : self.on_vpn_connection, dic = { # "on_vpn_connection" : self.on_vpn_connection,
# I don't see a function that matches this...
"refresh_clicked" : self.refresh_networks, "refresh_clicked" : self.refresh_networks,
"quit_clicked" : self.exit, "quit_clicked" : self.exit,
"disconnect_clicked" : self.disconnect_wireless, "disconnect_clicked" : self.disconnect_wireless,
@@ -914,7 +915,11 @@ class appGui:
# I don't know how to translate a menu entry. # I don't know how to translate a menu entry.
# More specifically, I don't know how to set a menu entry's text # More specifically, I don't know how to set a menu entry's text
# self.wTree.get_widget("connect_button").modify_text(language['_network']) # self.wTree.get_widget("connect_button").modify_text(language['_network'])
self.wTree.get_widget("progressbar").set_text(language['connecting'])
probar = self.wTree.get_widget("progressbar")
probar.set_text(language['connecting'])
# self.entry.set_visibility(False)
# probar.set_visiblity(False)
self.window = self.wTree.get_widget("window1") self.window = self.wTree.get_widget("window1")
self.network_list = self.wTree.get_widget("network_list_vbox") self.network_list = self.wTree.get_widget("network_list_vbox")
@@ -922,6 +927,8 @@ class appGui:
self.status_bar = self.wTree.get_widget("statusbar") self.status_bar = self.wTree.get_widget("statusbar")
self.refresh_networks(fresh=False) self.refresh_networks(fresh=False)
self.status_area.hide_all()
self.statusID = None self.statusID = None
self.vpn_connection_pipe = None self.vpn_connection_pipe = None
@@ -1343,4 +1350,11 @@ class appGui:
def show_win(self): def show_win(self):
self.window.show_all() self.window.show_all()
# hide the status bar, as it might be confusing if it
# pops up randomly :)
self.status_area.hide_all()
self.is_visible = True self.is_visible = True
if __name__ == '__main__':
app = appGui()
gtk.main()

View File

@@ -100,6 +100,7 @@ language['connecting'] = _('Connecting...')
class TrayIcon(): class TrayIcon():
def __init__(self, use_tray): def __init__(self, use_tray):
print 'Use tray:',use_tray
if USE_EGG: if USE_EGG:
self.tr = self.DapperTrayIconGUI(use_tray) self.tr = self.DapperTrayIconGUI(use_tray)
else: else:
@@ -146,6 +147,7 @@ class TrayIcon():
# Check for a wireless connection # Check for a wireless connection
elif cur_iface == wifi_iface: elif cur_iface == wifi_iface:
cur_net_id = wireless.GetCurrentNetworkID() cur_net_id = wireless.GetCurrentNetworkID()
lock = ''
if wireless.GetWirelessProperty(cur_net_id, "encryption"): if wireless.GetWirelessProperty(cur_net_id, "encryption"):
lock = "-lock" lock = "-lock"
strength = wireless.GetPrintableSignalStrength() strength = wireless.GetPrintableSignalStrength()
@@ -353,6 +355,7 @@ def main(argv):
argv -- The arguments passed to the script. argv -- The arguments passed to the script.
""" """
print 'Loading...'
use_tray = True use_tray = True
try: try:
@@ -373,6 +376,8 @@ def main(argv):
#sys.stderr = log #sys.stderr = log
#sys.stdout = log #sys.stdout = log
print 'Done initalizing, starting...'
# Set up the tray icon GUI and backend # Set up the tray icon GUI and backend
tray_icon = TrayIcon(use_tray) tray_icon = TrayIcon(use_tray)
@@ -392,5 +397,6 @@ def main(argv):
mainloop.run() mainloop.run()
print 'Here.'
if __name__ == '__main__': if __name__ == '__main__':
main(sys.argv) main(sys.argv)