Reverted the preferences state saving because it was silly.

Did some touch-ups on the Preferences dialog.
This commit is contained in:
Andrew Resch 2007-06-12 23:23:05 +00:00
parent 56d61f1570
commit 43ea807a9b
3 changed files with 134 additions and 119 deletions

View File

@ -7,6 +7,8 @@
<property name="border_width">5</property>
<property name="title" translatable="yes">Deluge Preferences</property>
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
<property name="default_height">550</property>
<property name="destroy_with_parent">True</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="skip_taskbar_hint">True</property>
<property name="skip_pager_hint">True</property>
@ -105,6 +107,7 @@
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">2</property>
</packing>
</child>
@ -208,6 +211,7 @@
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">2</property>
<property name="position">2</property>
</packing>
@ -305,100 +309,16 @@
<property name="bottom_padding">2</property>
<property name="left_padding">12</property>
<child>
<widget class="GtkVBox" id="vbox13">
<widget class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="n_rows">4</property>
<property name="n_columns">2</property>
<child>
<widget class="GtkHBox" id="hbox7">
<widget class="GtkAlignment" id="alignment18">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<child>
<widget class="GtkLabel" id="label54">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Connections:</property>
</widget>
</child>
<child>
<widget class="GtkSpinButton" id="spin_num_download">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip" translatable="yes">The maximum number of connections allowed. Set -1 for unlimited.</property>
<property name="adjustment">-1 -1 1000 1 10 10</property>
<property name="climb_rate">1</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
<child>
<widget class="GtkHBox" id="hbox8">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<child>
<widget class="GtkLabel" id="label53">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Upload Slots:</property>
</widget>
</child>
<child>
<widget class="GtkSpinButton" id="spin_num_upload">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip" translatable="yes">The maximum number of upload slots. Set -1 for unlimited.</property>
<property name="adjustment">-1 -1 1000 1 10 10</property>
<property name="climb_rate">1</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox9">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<child>
<widget class="GtkLabel" id="label52">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Download Rate (KB/s):</property>
</widget>
</child>
<child>
<widget class="GtkSpinButton" id="spin_max_download">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip" translatable="yes">The maximum download rate for all torrents. Set -1 for unlimited.</property>
<property name="adjustment">-1 -1 9000 1 10 10</property>
<property name="climb_rate">1</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox13">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="right_padding">10</property>
<child>
<widget class="GtkLabel" id="label55">
<property name="visible">True</property>
@ -406,23 +326,133 @@
<property name="label" translatable="yes">Maximum Upload Rate (KB/s):</property>
</widget>
</child>
</widget>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment14">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="right_padding">10</property>
<child>
<widget class="GtkSpinButton" id="spin_max_upload">
<widget class="GtkLabel" id="label52">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip" translatable="yes">The maximum upload rate for all torrents. Set -1 for unlimited.</property>
<property name="adjustment">-1 -1 9000 1 10 10</property>
<property name="climb_rate">1</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Download Rate (KB/s):</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">3</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment5">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="right_padding">10</property>
<child>
<widget class="GtkLabel" id="label53">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Upload Slots:</property>
</widget>
</child>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment4">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="right_padding">10</property>
<child>
<widget class="GtkLabel" id="label54">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Maximum Connections:</property>
</widget>
</child>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_num_download">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip" translatable="yes">The maximum number of connections allowed. Set -1 for unlimited.</property>
<property name="xalign">1</property>
<property name="adjustment">-1 -1 1000 1 10 10</property>
<property name="climb_rate">1</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_num_upload">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip" translatable="yes">The maximum number of upload slots. Set -1 for unlimited.</property>
<property name="xalign">1</property>
<property name="adjustment">-1 -1 1000 1 10 10</property>
<property name="climb_rate">1</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_max_download">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip" translatable="yes">The maximum download rate for all torrents. Set -1 for unlimited.</property>
<property name="xalign">1</property>
<property name="adjustment">-1 -1 9000 1 10 10</property>
<property name="climb_rate">1</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spin_max_upload">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip" translatable="yes">The maximum upload rate for all torrents. Set -1 for unlimited.</property>
<property name="xalign">1</property>
<property name="adjustment">-1 -1 9000 1 10 10</property>
<property name="climb_rate">1</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
</widget>
@ -442,6 +472,8 @@
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">2</property>
<property name="position">4</property>
</packing>
</child>

View File

@ -43,7 +43,6 @@ class PreferencesDlg:
'tray_toggle': self.tray_toggle,
'on_btn_testport_clicked': self.TestPort,
})
self.dialog.connect("configure-event", self.window_configure_event)
self.parent = parent
self.preferences = preferences
@ -78,11 +77,6 @@ class PreferencesDlg:
self.glade.get_widget("spin_dht").set_value(self.preferences.get("dht_connections", int, default=80))
self.glade.get_widget("spin_gui").set_value(self.preferences.get("gui_update_interval", float, default=1.0))
# Load geometry settings for window
self.dialog.resize(self.preferences.get("pref_window_width"), self.preferences.get("pref_window_height"))
if self.preferences.get("pref_window_x_pos") > 0 or self.preferences.get("pref_window_y_pos") > 0:
self.dialog.move(self.preferences.get("pref_window_x_pos"), self.preferences.get("pref_window_y_pos"))
except KeyError:
pass
# Now, show the dialog
@ -126,13 +120,6 @@ class PreferencesDlg:
else:
self.glade.get_widget("chk_min_on_close").set_sensitive(False)
def window_configure_event(self, widget, event):
self.preferences.set("pref_window_x_pos", event.x)
self.preferences.set("pref_window_y_pos", event.y)
self.preferences.set("pref_window_width", event.width)
self.preferences.set("pref_window_height", event.height)
class PluginDlg:
def __init__(self, parent, plugins):

View File

@ -63,10 +63,6 @@ DEFAULT_PREFS = {
"max_upload_rate_bps" : -1.0,
"max_uploads" : 2,
"pref_rc4" : True,
"pref_window_height" : 550,
"pref_window_width" : 1,
"pref_window_x_pos" : -1,
"pref_window_y_pos" : -1,
"queue_seeds_to_bottom" : False,
"show_dl" : True,
"show_eta" : True,