summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 9fd34fa..b2189d4 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 dea68fd..ba859d6 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 610b4fc..4a89150 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 a76261a..712cbd6 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"] = \