mirror of
https://github.com/gryf/wicd.git
synced 2025-12-22 05:48:03 +01:00
Don't store useless variables inside configfiles
This commit is contained in:
15
gtk/gui.py
15
gtk/gui.py
@@ -151,16 +151,10 @@ class appGui(object):
|
||||
self.wTree = gtk.Builder()
|
||||
self.wTree.add_from_file(gladefile)
|
||||
self.window = self.wTree.get_object("window1")
|
||||
size = daemon.ReadWindowSize("main")
|
||||
width = size[0]
|
||||
height = size[1]
|
||||
if width > -1 and height > -1:
|
||||
self.window.resize(int(width), int(height))
|
||||
else:
|
||||
width = int(gtk.gdk.screen_width() / 2)
|
||||
if width > 530:
|
||||
width = 530
|
||||
self.window.resize(width, int(gtk.gdk.screen_height() / 1.7))
|
||||
width = int(gtk.gdk.screen_width() / 2)
|
||||
if width > 530:
|
||||
width = 530
|
||||
self.window.resize(width, int(gtk.gdk.screen_height() / 1.7))
|
||||
|
||||
dic = { "refresh_clicked" : self.refresh_clicked,
|
||||
"quit_clicked" : self.exit,
|
||||
@@ -772,7 +766,6 @@ class appGui(object):
|
||||
'org.wicd.daemon')
|
||||
[width, height] = self.window.get_size()
|
||||
try:
|
||||
daemon.WriteWindowSize(width, height, "main")
|
||||
daemon.SetGUIOpen(False)
|
||||
except DBusException:
|
||||
pass
|
||||
|
||||
@@ -68,7 +68,6 @@ class AdvancedSettingsDialog(gtk.Dialog):
|
||||
self.set_default_size()
|
||||
|
||||
self.connect('show', lambda *a, **k: self.set_default_size())
|
||||
self.connect('hide', lambda *a, **k: self.write_size())
|
||||
|
||||
# Set up the Advanced Settings Dialog.
|
||||
self.txt_ip = LabelEntry(language['ip'])
|
||||
@@ -141,17 +140,13 @@ class AdvancedSettingsDialog(gtk.Dialog):
|
||||
|
||||
|
||||
def set_default_size(self):
|
||||
width, height = daemon.ReadWindowSize('netprop')
|
||||
if width > -1 and height > -1:
|
||||
self.resize(int(width), int(height))
|
||||
width, height = self.get_size()
|
||||
s_height = gtk.gdk.screen_height()
|
||||
if s_height < 768:
|
||||
height = s_height * .75
|
||||
else:
|
||||
width, height = self.get_size()
|
||||
s_height = gtk.gdk.screen_height()
|
||||
if s_height < 768:
|
||||
height = s_height * .75
|
||||
else:
|
||||
height = 600
|
||||
self.resize(int(width), int(height))
|
||||
height = 600
|
||||
self.resize(int(width), int(height))
|
||||
|
||||
def set_defaults(self, widget=None, event=None):
|
||||
""" Put some default values into entries to help the user out. """
|
||||
@@ -247,10 +242,6 @@ class AdvancedSettingsDialog(gtk.Dialog):
|
||||
self.destroy()
|
||||
del self
|
||||
|
||||
def write_size(self):
|
||||
w, h = self.get_size()
|
||||
daemon.WriteWindowSize(w, h, 'netprop')
|
||||
|
||||
def save_settings(self):
|
||||
""" Save settings common to wired and wireless settings dialogs. """
|
||||
if self.chkbox_static_ip.get_active():
|
||||
|
||||
15
gtk/prefs.py
15
gtk/prefs.py
@@ -248,7 +248,6 @@ class PreferencesDialog(object):
|
||||
daemon.SetSudoApp(sudo_tool)
|
||||
|
||||
[width, height] = self.dialog.get_size()
|
||||
daemon.WriteWindowSize(width, height, "pref")
|
||||
|
||||
not_path = os.path.join(USER_SETTINGS_DIR, 'USE_NOTIFICATIONS')
|
||||
if self.notificationscheckbox.get_active():
|
||||
@@ -316,16 +315,10 @@ class PreferencesDialog(object):
|
||||
self.dialog.set_title(language['preferences'])
|
||||
if os.path.exists(os.path.join(wpath.images, "wicd.png")):
|
||||
self.dialog.set_icon_from_file(os.path.join(wpath.images, "wicd.png"))
|
||||
size = daemon.ReadWindowSize("pref")
|
||||
width = size[0]
|
||||
height = size[1]
|
||||
if width > -1 and height > -1:
|
||||
self.dialog.resize(int(width), int(height))
|
||||
else:
|
||||
width = int(gtk.gdk.screen_width() / 2.4)
|
||||
if width > 450:
|
||||
width = 450
|
||||
self.dialog.resize(width, int(gtk.gdk.screen_height() / 2))
|
||||
width = int(gtk.gdk.screen_width() / 2.4)
|
||||
if width > 450:
|
||||
width = 450
|
||||
self.dialog.resize(width, int(gtk.gdk.screen_height() / 2))
|
||||
|
||||
self.wiredcheckbox = setup_label("pref_always_check",
|
||||
'wired_always_on')
|
||||
|
||||
Reference in New Issue
Block a user