summaryrefslogtreecommitdiffstats
path: root/deluge/ui/gtkui
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2012-09-27 23:44:38 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2012-11-22 23:38:27 +0000
commit582c6735d0387d599daba4811cd9da90a7e01dc0 (patch)
tree8f0a33253b6830e9a5763ad5c85ac0469b572cd5 /deluge/ui/gtkui
parent5d43c2ac944f318874470a3beda951174faa01e1 (diff)
downloaddeluge-582c6735d0.tar.gz
deluge-582c6735d0.tar.bz2
deluge-582c6735d0.zip
Fix #2100 : Add option not to bring main window to front when adding torrents through ipcinterface
Diffstat (limited to 'deluge/ui/gtkui')
-rw-r--r--deluge/ui/gtkui/glade/preferences_dialog.glade13
-rw-r--r--deluge/ui/gtkui/gtkui.py1
-rw-r--r--deluge/ui/gtkui/ipcinterface.py3
-rw-r--r--deluge/ui/gtkui/preferences.py4
4 files changed, 20 insertions, 1 deletions
diff --git a/deluge/ui/gtkui/glade/preferences_dialog.glade b/deluge/ui/gtkui/glade/preferences_dialog.glade
index 9fd34fa71..b2189d409 100644
--- a/deluge/ui/gtkui/glade/preferences_dialog.glade
+++ b/deluge/ui/gtkui/glade/preferences_dialog.glade
@@ -1900,6 +1900,19 @@ Disabled</property>
<property name="position">0</property>
</packing>
</child>
+ <child>
+ <widget class="GtkCheckButton" id="chk_focus_main_window_on_add">
+ <property name="label" translatable="yes">Focus window when adding torrent</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
</child>
</widget>
diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py
index dea68fdfe..ba859d6b6 100644
--- a/deluge/ui/gtkui/gtkui.py
+++ b/deluge/ui/gtkui/gtkui.py
@@ -166,6 +166,7 @@ DEFAULT_PREFS = {
"sidebar_show_trackers": True,
"sidebar_position": 170,
"show_rate_in_title": False,
+ "focus_main_window_on_add": True,
"createtorrent.trackers": []
}
diff --git a/deluge/ui/gtkui/ipcinterface.py b/deluge/ui/gtkui/ipcinterface.py
index 610b4fcb5..4a8915047 100644
--- a/deluge/ui/gtkui/ipcinterface.py
+++ b/deluge/ui/gtkui/ipcinterface.py
@@ -58,7 +58,8 @@ import twisted.internet.error
class IPCProtocolServer(Protocol):
def dataReceived(self, data):
data = rencode.loads(data)
- component.get("MainWindow").present()
+ if not data or config["focus_main_window_on_add"]:
+ component.get("MainWindow").present()
process_args(data)
class IPCProtocolClient(Protocol):
diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py
index a76261aed..712cbd62d 100644
--- a/deluge/ui/gtkui/preferences.py
+++ b/deluge/ui/gtkui/preferences.py
@@ -479,6 +479,8 @@ class Preferences(component.Component):
self.gtkui_config["classic_mode"])
self.glade.get_widget("chk_show_rate_in_title").set_active(
self.gtkui_config["show_rate_in_title"])
+ self.glade.get_widget("chk_focus_main_window_on_add").set_active(
+ self.gtkui_config["focus_main_window_on_add"])
## Other tab ##
self.glade.get_widget("chk_show_new_releases").set_active(
@@ -651,6 +653,8 @@ class Preferences(component.Component):
self.glade.get_widget("chk_classic_mode").get_active()
new_gtkui_config["show_rate_in_title"] = \
self.glade.get_widget("chk_show_rate_in_title").get_active()
+ new_gtkui_config["focus_main_window_on_add"] = \
+ self.glade.get_widget("chk_focus_main_window_on_add").get_active()
## Other tab ##
new_gtkui_config["show_new_releases"] = \