change 'classic mode' checkbox for standalone/thinclient radio buttons

This commit is contained in:
Calum Lind 2013-05-15 13:51:06 +01:00
parent 105e4c0555
commit 879cf1b53c
2 changed files with 119 additions and 95 deletions

View File

@ -2,59 +2,6 @@
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkAdjustment" id="adjustment_cache_size">
<property name="upper">999999</property>
<property name="value">100</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_outgoing_port_max">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_outgoing_port_min">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_port_max">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_port_min">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_proxy_port_dht">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_proxy_port_peer">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_proxy_port_tracker">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_proxy_port_web_seed">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_cache_expiry">
<property name="lower">1</property>
<property name="upper">32000</property>
<property name="value">60</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_share_ratio">
<property name="lower">0.5</property>
<property name="upper">100</property>
@ -75,6 +22,19 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_cache_expiry">
<property name="lower">1</property>
<property name="upper">32000</property>
<property name="value">60</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_cache_size">
<property name="upper">999999</property>
<property name="value">100</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_daemon_port">
<property name="upper">65535</property>
<property name="step_increment">1</property>
@ -146,6 +106,46 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_outgoing_port_max">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_outgoing_port_min">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_port_max">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_port_min">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_proxy_port_dht">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_proxy_port_peer">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_proxy_port_tracker">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_proxy_port_web_seed">
<property name="upper">65535</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_spin_seed_time_limit">
<property name="lower">-1</property>
<property name="upper">9999</property>
@ -2341,36 +2341,57 @@ Requires a Hex value.</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame9">
<object class="GtkFrame" id="frame_client_mode">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment12">
<object class="GtkHBox" id="hbox_client_mode">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">2</property>
<property name="bottom_padding">2</property>
<property name="left_padding">12</property>
<child>
<object class="GtkCheckButton" id="chk_classic_mode">
<property name="label" translatable="yes">Enable</property>
<object class="GtkRadioButton" id="radio_classic">
<property name="label" translatable="yes">Standalone</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Classic Mode will hide most of the daemon functionality and will make Deluge appear to be a single application. Use this if you do not want to take advantage of running Deluge as a daemon. You need to restart Deluge for this setting to take effect.</property>
<property name="tooltip_text" translatable="yes">The classic self-contained application</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="radio_thinclient">
<property name="label" translatable="yes">Thin Client</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Switch to thinclient mode, enabling connection to a Deluge daemon</property>
<property name="draw_indicator">True</property>
<property name="group">radio_classic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">7</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label26">
<object class="GtkLabel" id="label_client_mode">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Classic Mode</property>
<property name="label" translatable="yes">Application Mode</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@ -2432,35 +2453,6 @@ Requires a Hex value.</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="piecesbar_toggle">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Besides being experimental, using the pieces bar
will increase the bandwidth used between client
and daemon(does not apply in classic mode).
Use at your own risk if you wish to help us debug
this new feature.</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_piecesbar_toggle_toggled" swapped="no"/>
<child>
<object class="GtkLabel" id="label62">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Show a pieces bar in the torrent's
status tab (&lt;b&gt;EXPERIMENTAL!!!&lt;/b&gt;)</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkExpander" id="piecebar_colors_expander">
<property name="can_focus">True</property>
@ -2697,6 +2689,35 @@ status tab (&lt;b&gt;EXPERIMENTAL!!!&lt;/b&gt;)</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="piecesbar_toggle">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Besides being experimental, using the pieces bar
will increase the bandwidth used between client
and daemon(does not apply in classic mode).
Use at your own risk if you wish to help us debug
this new feature.</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_piecesbar_toggle_toggled" swapped="no"/>
<child>
<object class="GtkLabel" id="label62">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Show a pieces bar in the torrent's
status tab (&lt;b&gt;EXPERIMENTAL!!!&lt;/b&gt;)</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</object>

View File

@ -556,8 +556,10 @@ class Preferences(component.Component):
self.gtkui_config["enable_appindicator"])
self.builder.get_object("chk_lock_tray").set_active(
self.gtkui_config["lock_tray"])
self.builder.get_object("chk_classic_mode").set_active(
self.builder.get_object("radio_classic").set_active(
self.gtkui_config["classic_mode"])
self.builder.get_object("radio_thinclient").set_active(
not self.gtkui_config["classic_mode"])
self.builder.get_object("chk_show_rate_in_title").set_active(
self.gtkui_config["show_rate_in_title"])
self.builder.get_object("chk_focus_main_window_on_add").set_active(
@ -745,7 +747,7 @@ class Preferences(component.Component):
if passhex != "c07eb5a8c0dc7bb81c217b67f11c3b7a5e95ffd7":
new_gtkui_config["tray_password"] = passhex
new_gtkui_in_classic_mode = self.builder.get_object("chk_classic_mode").get_active()
new_gtkui_in_classic_mode = self.builder.get_object("radio_classic").get_active()
new_gtkui_config["classic_mode"] = new_gtkui_in_classic_mode
new_gtkui_config["show_rate_in_title"] = \
@ -852,10 +854,11 @@ class Preferences(component.Component):
if response == gtk.RESPONSE_NO:
# Set each changed config value in the core
self.gtkui_config["classic_mode"] = True
self.builder.get_object("chk_classic_mode").set_active(True)
self.builder.get_object("radio_classic").set_active(True)
else:
client.disconnect()
component.stop()
self.builder.get_object("radio_thinclient").set_active(True)
dialog = dialogs.YesNoDialog(
_("Attention"),
_("Your current session will be stopped. Continue?")