Moved the MainWindow to GtkBuilder.

This probably broke some behaviour because converting and splitting from libglade to GtkBuilder is not as perfect as it should be. What I noticed was fixed.
Also, GtkBuilder only allow calling `connect_signals()` once. Some code had to change to handle this and a "handlers proxy class" was created to keep the behaviour we had, ie, connect signals from where it was needed. Then I monkey patch the main windows GtkBuilder to not allow anyone to connect signals through it since it would break behaviour. Connecting signals to the main window builder instance is now done like `component.get("MainWindow").connect_signals()`. The best solution will probably break the main window ui into the needed parts in order to not have to monkey patch main windows builder.
Plugin's trying to get the main windows `main_glade` are now broken, on purpose, ie, the code they have needs to change since the calls to the builder are not the same as the calls to libglade. The plugins we ship with deluge will be fix as soon as possible.
This commit is contained in:
Pedro Algarvio 2011-07-07 20:41:44 +01:00
parent 4234311050
commit f87ed6d5a6
31 changed files with 2020 additions and 2002 deletions

View File

@ -44,7 +44,6 @@ import common
class AboutDialog:
def __init__(self):
# Get the glade file for the about dialog
def url_hook(dialog, url):
deluge.common.open_url_in_browser(url)
gtk.about_dialog_set_url_hook(url_hook)

View File

@ -40,10 +40,8 @@ import os
import pygtk
pygtk.require('2.0')
import gtk
import gtk.glade
import logging
from deluge.ui.client import client
import deluge.component as component
import deluge.common

View File

@ -135,7 +135,7 @@ class ConnectionManager(component.Component):
Show the ConnectionManager dialog.
"""
self.config = self.__load_config()
# Get the glade file for the connection manager
# Get the gtk builder file for the connection manager
self.builder = gtk.Builder()
# The main dialog
self.builder.add_from_file(deluge.common.resource_filename(
@ -514,7 +514,7 @@ class ConnectionManager(component.Component):
if self.running:
# When connected to a client, and then trying to connect to another,
# this component will be stopped(while the connect deferred is
# runing), so, self.connection_manager will be deleted.
# running), so, self.connection_manager will be deleted.
# If that's not the case, close the dialog.
self.connection_manager.response(gtk.RESPONSE_OK)
component.start()
@ -755,3 +755,10 @@ class ConnectionManager(component.Component):
config["hosts"][idx][4] = localclient_password
return config
# # These handlers are defined on the GTK builder file but they were not used on this code.
# # Let's just stop the RuntimeWarning's until we find out if we really needed these handlers.
# def __dummy_gtkbuilder_handler(self, *a, **k): pass
# on_chk_donotshow_toggled = __dummy_gtkbuilder_handler
# on_chk_autostart_toggled = __dummy_gtkbuilder_handler
# on_chk_autoconnect_toggled = __dummy_gtkbuilder_handler

View File

@ -33,12 +33,8 @@
#
#
import gtk
import gtk.glade
import logging
from deluge.ui.client import client
import deluge.component as component
from deluge.common import fsize, is_url
from deluge.ui.gtkui.torrentdetails import Tab
@ -49,24 +45,24 @@ class DetailsTab(Tab):
def __init__(self):
Tab.__init__(self)
# Get the labels we need to update.
# widgetname, modifier function, status keys
glade = component.get("MainWindow").main_glade
# widget name, modifier function, status keys
builder = component.get("MainWindow").get_builder()
self._name = "Details"
self._child_widget = glade.get_widget("details_tab")
self._tab_label = glade.get_widget("details_tab_label")
self._child_widget = builder.get_object("details_tab")
self._tab_label = builder.get_object("details_tab_label")
self.label_widgets = [
(glade.get_widget("summary_name"), None, ("name",)),
(glade.get_widget("summary_total_size"), fsize, ("total_size",)),
(glade.get_widget("summary_num_files"), str, ("num_files",)),
(glade.get_widget("summary_tracker"), None, ("tracker",)),
(glade.get_widget("summary_torrent_path"), None, ("save_path",)),
(glade.get_widget("summary_message"), str, ("message",)),
(glade.get_widget("summary_hash"), str, ("hash",)),
(glade.get_widget("summary_comments"), str, ("comment",)),
(glade.get_widget("summary_owner"), str, ("owner",)),
(glade.get_widget("summary_shared"), str, ("shared",))
(builder.get_object("summary_name"), None, ("name",)),
(builder.get_object("summary_total_size"), fsize, ("total_size",)),
(builder.get_object("summary_num_files"), str, ("num_files",)),
(builder.get_object("summary_tracker"), None, ("tracker",)),
(builder.get_object("summary_torrent_path"), None, ("save_path",)),
(builder.get_object("summary_message"), str, ("message",)),
(builder.get_object("summary_hash"), str, ("hash",)),
(builder.get_object("summary_comments"), str, ("comment",)),
(builder.get_object("summary_owner"), str, ("owner",)),
(builder.get_object("summary_shared"), str, ("shared",))
]
def update(self):

View File

@ -36,16 +36,13 @@
import gtk
import gtk.gdk
import gtk.glade
import gobject
import gettext
import os.path
import cPickle
import logging
from deluge.ui.gtkui.torrentdetails import Tab
from deluge.ui.client import client
from deluge.configmanager import ConfigManager
import deluge.configmanager
import deluge.component as component
import deluge.common
@ -107,13 +104,13 @@ def cell_progress(column, cell, model, row, data):
class FilesTab(Tab):
def __init__(self):
Tab.__init__(self)
glade = component.get("MainWindow").get_glade()
builder = component.get("MainWindow").get_builder()
self._name = "Files"
self._child_widget = glade.get_widget("files_tab")
self._tab_label = glade.get_widget("files_tab_label")
self._child_widget = builder.get_object("files_tab")
self._tab_label = builder.get_object("files_tab_label")
self.listview = glade.get_widget("files_listview")
self.listview = builder.get_object("files_listview")
# filename, size, progress string, progress value, priority, file index, icon id
self.treestore = gtk.TreeStore(str, gobject.TYPE_UINT64, str, float, int, int, str)
@ -190,18 +187,18 @@ class FilesTab(Tab):
self.listview.get_selection().set_mode(gtk.SELECTION_MULTIPLE)
self.file_menu = glade.get_widget("menu_file_tab")
self.file_menu = builder.get_object("menu_file_tab")
self.file_menu_priority_items = [
glade.get_widget("menuitem_donotdownload"),
glade.get_widget("menuitem_normal"),
glade.get_widget("menuitem_high"),
glade.get_widget("menuitem_highest"),
glade.get_widget("menuitem_priority_sep")
builder.get_object("menuitem_donotdownload"),
builder.get_object("menuitem_normal"),
builder.get_object("menuitem_high"),
builder.get_object("menuitem_highest"),
builder.get_object("menuitem_priority_sep")
]
self.localhost_widgets = [
glade.get_widget("menuitem_open_file"),
glade.get_widget("menuitem3")
builder.get_object("menuitem_open_file"),
builder.get_object("menuitem3")
]
self.listview.connect("row-activated", self._on_row_activated)
@ -217,7 +214,7 @@ class FilesTab(Tab):
self.listview.connect("drag_data_get", self._on_drag_data_get_data)
self.listview.connect("drag_data_received", self._on_drag_data_received_data)
glade.signal_autoconnect({
component.get("MainWindow").connect_signals({
"on_menuitem_open_file_activate": self._on_menuitem_open_file_activate,
"on_menuitem_donotdownload_activate": self._on_menuitem_donotdownload_activate,
"on_menuitem_normal_activate": self._on_menuitem_normal_activate,

View File

@ -96,9 +96,9 @@ class FilterTreeView(component.Component):
def __init__(self):
component.Component.__init__(self, "FilterTreeView", interval=2)
self.window = component.get("MainWindow")
glade = self.window.main_glade
self.hpaned = glade.get_widget("hpaned")
self.scrolled = glade.get_widget("scrolledwindow_sidebar")
main_builder = self.window.get_builder()
self.hpaned = main_builder.get_object("main_window_hpaned")
self.scrolled = main_builder.get_object("scrolledwindow_sidebar")
self.sidebar = component.get("SideBar")
self.config = ConfigManager("gtkui.conf")
self.tracker_icons = component.get("TrackerIcons")

View File

@ -290,7 +290,6 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_chk_autoconnect_toggled" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@ -307,7 +306,6 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_chk_autostart_toggled" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@ -324,7 +322,6 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_chk_donotshow_toggled" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>

View File

@ -33,7 +33,6 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_button_cancel_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@ -50,7 +49,6 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_button_ok_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>

View File

@ -0,0 +1,234 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="move_storage_dialog">
<property name="can_focus">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="border_width">5</property>
<property name="title" translatable="yes">Remove Torrent?</property>
<property name="resizable">False</property>
<property name="window_position">center-on-parent</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox7">
<property name="visible">True</property>
<property name="can_focus">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="spacing">2</property>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area7">
<property name="visible">True</property>
<property name="can_focus">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="layout_style">center</property>
<child>
<object class="GtkButton" id="button_cancel">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">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="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button_ok">
<property name="label" translatable="yes">Remove Selected Torrent</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">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="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="can_focus">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="spacing">5</property>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="can_focus">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="spacing">10</property>
<child>
<object class="GtkImage" id="image7">
<property name="visible">True</property>
<property name="can_focus">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="stock">gtk-dialog-warning</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_title">
<property name="visible">True</property>
<property name="can_focus">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="label" translatable="yes">&lt;big&gt;&lt;b&gt;Are you sure you want to remove the selected torrent?&lt;/b&gt;&lt;/big&gt;</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHSeparator" id="hseparator1">
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment6">
<property name="visible">True</property>
<property name="can_focus">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="left_padding">15</property>
<child>
<object class="GtkHBox" id="hbox_torrentfile">
<property name="can_focus">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="spacing">5</property>
<child>
<object class="GtkImage" id="image8">
<property name="visible">True</property>
<property name="can_focus">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="stock">gtk-dialog-warning</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_torrentfile_warning">
<property name="visible">True</property>
<property name="can_focus">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="xalign">0</property>
<property name="label" translatable="yes">&lt;i&gt;The associated .torrent will be deleted!&lt;/i&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment7">
<property name="visible">True</property>
<property name="can_focus">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="left_padding">15</property>
<child>
<object class="GtkHBox" id="hbox_data">
<property name="can_focus">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="spacing">5</property>
<child>
<object class="GtkImage" id="image9">
<property name="visible">True</property>
<property name="can_focus">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="stock">gtk-dialog-warning</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_data_warning">
<property name="visible">True</property>
<property name="can_focus">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="xalign">0</property>
<property name="label" translatable="yes">&lt;i&gt;The downloaded data will be deleted!&lt;/i&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="0">button_cancel</action-widget>
<action-widget response="0">button_ok</action-widget>
</action-widgets>
</object>
</interface>

View File

@ -0,0 +1,246 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="new_release_dialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">New Release</property>
<property name="window_position">center-on-parent</property>
<property name="icon_name">deluge</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button_close_new_release">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button_goto_downloads">
<property name="label" translatable="yes">_Goto Website</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">10</property>
<property name="spacing">5</property>
<child>
<object class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkImage" id="image_new_release">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label23">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;&lt;big&gt;New Release Available!&lt;/big&gt;&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHSeparator" id="hseparator2">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment11">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">5</property>
<child>
<object class="GtkTable" id="table2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="column_spacing">10</property>
<property name="row_spacing">2</property>
<child>
<object class="GtkLabel" id="label_available_version">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<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"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_available_version_text">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;i&gt;Available Version:&lt;/i&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_client_version">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_client_version_text">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;i&gt;Current Version:&lt;/i&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_server_version_text">
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;i&gt;Server Version&lt;/i&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_server_version">
<property name="can_focus">False</property>
</object>
<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"></property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">5</property>
<child>
<object class="GtkCheckButton" id="chk_do_not_show_new_release">
<property name="label" translatable="yes">Do not show this dialog in the future</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="0">button_close_new_release</action-widget>
<action-widget response="0">button_goto_downloads</action-widget>
</action-widgets>
</object>
</interface>

View File

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-zoom-fit</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-no</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-yes</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-go-up</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-goto-top</property>
<property name="icon-size">1</property>
</object>
<object class="GtkMenu" id="menu_file_tab">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem" id="menuitem_open_file">
<property name="label">gtk-open</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<property name="accel_group">accelgroup1</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="menuitem3">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_expand_all">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="image">image1</property>
<property name="use_stock">False</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="menuitem_priority_sep">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_donotdownload">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="image">image2</property>
<property name="use_stock">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_normal">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="image">image3</property>
<property name="use_stock">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_high">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="image">image4</property>
<property name="use_stock">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_highest">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="image">image5</property>
<property name="use_stock">False</property>
</object>
</child>
</object>
</interface>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-add</property>
<property name="icon-size">1</property>
</object>
<object class="GtkMenu" id="menu_peer_tab">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem" id="menuitem4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="image">image1</property>
<property name="use_stock">False</property>
</object>
</child>
</object>
</interface>

View File

@ -0,0 +1,802 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkAccelGroup" id="accelgroup1"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">-1</property>
<property name="upper">999999</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment2">
<property name="lower">-1</property>
<property name="upper">99999</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment3">
<property name="lower">-1</property>
<property name="upper">999999</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment4">
<property name="lower">-1</property>
<property name="upper">999999</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment5">
<property name="upper">99999</property>
<property name="value">2</property>
<property name="step_increment">0.10000000000000001</property>
<property name="page_increment">10</property>
</object>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-add</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-no</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-yes</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-go-up</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-goto-top</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-zoom-fit</property>
<property name="icon-size">1</property>
</object>
<object class="GtkWindow" id="main_window">
<property name="can_focus">False</property>
<property name="title">Deluge</property>
<accel-groups>
<group name="accelgroup1"/>
</accel-groups>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<object class="GtkMenuBar" id="menubar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkMenuItem" id="menu_file">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">_File</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="menuitem1_menu1">
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem" id="menuitem_addtorrent">
<property name="label" translatable="yes">_Add Torrent</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">False</property>
<accelerator key="O" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<signal name="activate" handler="on_menuitem_addtorrent_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_createtorrent">
<property name="label" translatable="yes">_Create Torrent</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">False</property>
<accelerator key="N" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<signal name="activate" handler="on_menuitem_createtorrent_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="separatormenuitem">
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_quitdaemon">
<property name="label" translatable="yes">Quit &amp; _Shutdown Daemon</property>
<property name="can_focus">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="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">False</property>
<accelerator key="Q" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
<signal name="activate" handler="on_menuitem_quitdaemon_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="separatormenuitem12">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_quit">
<property name="label">gtk-quit</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<property name="accel_group">accelgroup1</property>
<signal name="activate" handler="on_menuitem_quit_activate" swapped="no"/>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menu_edit">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">_Edit</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="menu1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem" id="menuitem_preferences">
<property name="label">gtk-preferences</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<property name="accel_group">accelgroup1</property>
<accelerator key="P" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<signal name="activate" handler="on_menuitem_preferences_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_connectionmanager">
<property name="label" translatable="yes">_Connection Manager</property>
<property name="visible">True</property>
<property name="can_focus">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="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">False</property>
<accelerator key="M" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<signal name="activate" handler="on_menuitem_connectionmanager_activate" swapped="no"/>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menu_torrent">
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">_Torrent</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menu_view">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">_View</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="menu2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCheckMenuItem" id="menuitem_toolbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">_Toolbar</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="toggled" handler="on_menuitem_toolbar_toggled" swapped="no"/>
</object>
</child>
<child>
<object class="GtkCheckMenuItem" id="menuitem_sidebar">
<property name="visible">True</property>
<property name="can_focus">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="use_action_appearance">False</property>
<property name="label" translatable="yes">_Sidebar</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="toggled" handler="on_menuitem_sidebar_toggled" swapped="no"/>
</object>
</child>
<child>
<object class="GtkCheckMenuItem" id="menuitem_statusbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Status_bar</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="toggled" handler="on_menuitem_statusbar_toggled" swapped="no"/>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="menuitem1">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menu_tabs">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">T_abs</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menu_columns">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">_Columns</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="find_menuitem">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">_Find ...</property>
<property name="use_underline">True</property>
<accelerator key="f" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<signal name="activate" handler="on_search_filter_toggle" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menu_Sidebar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">S_idebar</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="menu3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<child>
<object class="GtkCheckMenuItem" id="sidebar_show_zero">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Show _Zero Hits</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="toggled" handler="on_menuitem_sidebar_zero_toggled" swapped="no"/>
</object>
</child>
<child>
<object class="GtkCheckMenuItem" id="sidebar_show_trackers">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Show _Trackers</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="toggled" handler="on_menuitem_sidebar_trackers_toggled" swapped="no"/>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menu_help">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">_Help</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="menuitem2_menu1">
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem" id="menuitem_homepage">
<property name="label" translatable="yes">_Homepage</property>
<property name="visible">True</property>
<property name="can_focus">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="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">False</property>
<signal name="activate" handler="on_menuitem_homepage_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_faq">
<property name="label" translatable="yes">_FAQ</property>
<property name="visible">True</property>
<property name="can_focus">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="tooltip_text" translatable="yes">Frequently Asked Questions</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">False</property>
<accelerator key="F1" signal="activate"/>
<signal name="activate" handler="on_menuitem_faq_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_community">
<property name="label" translatable="yes">_Community</property>
<property name="visible">True</property>
<property name="can_focus">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="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">False</property>
<signal name="activate" handler="on_menuitem_community_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="separatormenuitem56">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_about">
<property name="label">gtk-about</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<property name="accel_group">accelgroup1</property>
<signal name="activate" handler="on_menuitem_about_activate" swapped="no"/>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkToolbar" id="toolbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkToolButton" id="toolbutton_add">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Add torrent</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Add Torrent</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-add</property>
<signal name="clicked" handler="on_toolbutton_add_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="toolbutton_remove">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Remove torrent</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Remove Torrent</property>
<property name="stock_id">gtk-remove</property>
<signal name="clicked" handler="on_toolbutton_remove_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="toolbutton_filter">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Filter torrents by name.
This will filter torrents for the current selection on the sidebar.</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">_Filter</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-find</property>
<accelerator key="f" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
<signal name="clicked" handler="on_search_filter_toggle" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkSeparatorToolItem" id="separatortoolitem1">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="toolbutton_pause">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Pause the selected torrents</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Pause</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-media-pause</property>
<signal name="clicked" handler="on_toolbutton_pause_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="toolbutton_resume">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">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="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Resume the selected torrents</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Resume</property>
<property name="stock_id">gtk-media-play</property>
<signal name="clicked" handler="on_toolbutton_resume_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkSeparatorToolItem" id="separatortoolitem2">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="toolbutton_queue_up">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">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="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Queue Torrent Up</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Queue Up</property>
<property name="stock_id">gtk-go-up</property>
<signal name="clicked" handler="on_toolbutton_queue_up_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="toolbutton_queue_down">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">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="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Queue Torrent Down</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Queue Down</property>
<property name="stock_id">gtk-go-down</property>
<signal name="clicked" handler="on_toolbutton_queue_down_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkSeparatorToolItem" id="toolbutton1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</object>
<packing>
<property name="expand">False</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="toolbutton_preferences">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Preferences</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Preferences</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-preferences</property>
<signal name="clicked" handler="on_toolbutton_preferences_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="toolbutton_connectionmanager">
<property name="visible">True</property>
<property name="can_focus">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="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Connection Manager</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Connection Manager</property>
<property name="stock_id">gtk-network</property>
<signal name="clicked" handler="on_toolbutton_connectionmanager_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="can_focus">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="top_padding">2</property>
<child>
<object class="GtkVPaned" id="vpaned">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkHPaned" id="main_window_hpaned">
<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>
<child>
<object class="GtkNotebook" id="sidebar_notebook">
<property name="can_focus">True</property>
<property name="scrollable">True</property>
</object>
<packing>
<property name="resize">False</property>
<property name="shrink">True</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkHBox" id="search_box">
<property name="can_focus">False</property>
<child>
<object class="GtkButton" id="close_search_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Close</property>
<property name="use_action_appearance">False</property>
<property name="relief">none</property>
<signal name="clicked" handler="on_close_search_button_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="close_search_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-close</property>
<property name="icon-size">2</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Filter:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">1</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="search_torrents_entry">
<property name="width_request">350</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Filter torrents by name.
This will filter torrents for the current selection on the sidebar.</property>
<property name="invisible_char">•</property>
<property name="truncate_multiline">True</property>
<property name="invisible_char_set">True</property>
<property name="caps_lock_warning">False</property>
<property name="secondary_icon_stock">gtk-clear</property>
<property name="primary_icon_activatable">True</property>
<property name="secondary_icon_activatable">True</property>
<property name="primary_icon_sensitive">False</property>
<property name="secondary_icon_sensitive">True</property>
<property name="secondary_icon_tooltip_text" translatable="yes">Clear the search</property>
<property name="secondary_icon_tooltip_markup" translatable="yes">Clear the search</property>
<signal name="changed" handler="on_search_torrents_entry_changed" swapped="no"/>
<signal name="icon-press" handler="on_search_torrents_entry_icon_press" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">1</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="search_torrents_match">
<property name="label" translatable="yes">_Match Case</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_search_torrents_match_toggled" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">1</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">out</property>
<child>
<object class="GtkTreeView" id="torrent_view">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="rules_hint">True</property>
<property name="enable_search">False</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="resize">True</property>
<property name="shrink">True</property>
</packing>
</child>
</object>
<packing>
<property name="resize">True</property>
<property name="shrink">False</property>
</packing>
</child>
<child>
<object class="GtkNotebook" id="torrent_info">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show_border">False</property>
</object>
<packing>
<property name="resize">False</property>
<property name="shrink">False</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkStatusbar" id="statusbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
</object>
</child>
</object>
</interface>

View File

@ -5,64 +5,58 @@
<object class="GtkImage" id="download-limit-image">
<property name="visible">True</property>
<property name="can_focus">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="stock">gtk-missing-image</property>
</object>
<object class="GtkImage" id="menu-item-image16">
<object class="GtkImage" id="max-connections-image">
<property name="visible">True</property>
<property name="can_focus">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="stock">gtk-network</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="menu-item-image17">
<property name="visible">True</property>
<property name="can_focus">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="stock">gtk-sort-ascending</property>
<property name="icon-size">1</property>
</object>
<object class="GtkMenu" id="options_torrent_menu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<object class="GtkImageMenuItem" id="menuitem_down_speed">
<property name="label" translatable="yes">_Download Speed Limit</property>
<property name="visible">True</property>
<property name="can_focus">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="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="image">download-limit-image</property>
<property name="use_stock">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_up_speed">
<property name="label" translatable="yes">_Upload Speed Limit</property>
<property name="visible">True</property>
<property name="can_focus">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="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="image">upload-limit-image</property>
<property name="use_stock">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_max_connections">
<property name="label" translatable="yes">_Connection Limit</property>
<property name="visible">True</property>
<property name="can_focus">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="use_action_appearance">False</property>
<property name="image">menu-item-image16</property>
<property name="use_underline">True</property>
<property name="image">max-connections-image</property>
<property name="use_stock">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="menuitem_upload_slots">
<property name="label" translatable="yes">Upload _Slot Limit</property>
<property name="visible">True</property>
<property name="can_focus">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="use_action_appearance">False</property>
<property name="image">menu-item-image17</property>
<property name="use_underline">True</property>
<property name="image">upload-slots-image</property>
<property name="use_stock">False</property>
</object>
</child>
@ -71,19 +65,29 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">_Auto Managed</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="menuitem_change_owner">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">_Change Ownership</property>
<property name="use_underline">True</property>
</object>
</child>
</object>
<object class="GtkImage" id="upload-limit-image">
<property name="visible">True</property>
<property name="can_focus">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="stock">gtk-missing-image</property>
</object>
<object class="GtkImage" id="upload-slots-image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-sort-ascending</property>
<property name="icon-size">1</property>
</object>
</interface>

View File

@ -15,7 +15,7 @@
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<property name="accel_group">accelgroup1</property>
<signal name="activate" handler="on_menuitem_queue_top_activate" swapped="no"/>
</object>
</child>
<child>
@ -27,7 +27,7 @@
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<property name="accel_group">accelgroup1</property>
<signal name="activate" handler="on_menuitem_queue_up_activate" swapped="no"/>
</object>
</child>
<child>
@ -39,7 +39,7 @@
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<property name="accel_group">accelgroup1</property>
<signal name="activate" handler="on_menuitem_queue_down_activate" swapped="no"/>
</object>
</child>
<child>
@ -51,7 +51,7 @@
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<property name="accel_group">accelgroup1</property>
<signal name="activate" handler="on_menuitem_queue_bottom_activate" swapped="no"/>
</object>
</child>
</object>

View File

@ -3,11 +3,11 @@
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkAccelGroup" id="accelgroup1"/>
<object class="GtkImage" id="download-limit-image">
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">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="stock">gtk-missing-image</property>
<property name="stock">gtk-preferences</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="menu-item-image12">
<property name="visible">True</property>
@ -28,27 +28,6 @@
<property name="stock">gtk-media-pause</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="menu-item-image16">
<property name="visible">True</property>
<property name="can_focus">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="stock">gtk-network</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="menu-item-image17">
<property name="visible">True</property>
<property name="can_focus">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="stock">gtk-sort-ascending</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="menu-item-image18">
<property name="visible">True</property>
<property name="can_focus">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="stock">gtk-preferences</property>
<property name="icon-size">1</property>
</object>
<object class="GtkImage" id="menu-item-image19">
<property name="visible">True</property>
<property name="can_focus">False</property>
@ -154,7 +133,7 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="image">menu-item-image18</property>
<property name="image">image1</property>
<property name="use_stock">False</property>
</object>
</child>
@ -260,10 +239,4 @@
</object>
</child>
</object>
<object class="GtkImage" id="upload-limit-image">
<property name="visible">True</property>
<property name="can_focus">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="stock">gtk-missing-image</property>
</object>
</interface>

View File

@ -319,16 +319,12 @@ Please see the details below for more information."), details=traceback.format_e
def update_connection_manager():
if not self.connectionmanager.running:
return
self.connectionmanager.glade.get_widget(
"button_refresh"
).emit("clicked")
self.connectionmanager.builder.get_object("button_refresh").emit("clicked")
def close_connection_manager():
if not self.connectionmanager.running:
return
self.connectionmanager.glade.get_widget(
"button_close"
).emit("clicked")
self.connectionmanager.builder.get_object("button_close").emit("clicked")
for host_config in self.connectionmanager.config["hosts"]:
hostid, host, port, user, passwd = host_config

View File

@ -34,13 +34,12 @@
#
import copy
import os.path
import pygtk
pygtk.require('2.0')
import gtk
import gtk.glade
import logging
from urlparse import urlparse
import urllib
from deluge.ui.client import client
@ -54,20 +53,74 @@ import common
log = logging.getLogger(__name__)
class _GtkBuilderSignalsHolder(object):
def connect_signals(self, mapping_or_class):
if isinstance(mapping_or_class, dict):
for name, handler in mapping_or_class.iteritems():
if hasattr(self, name):
raise RuntimeError(
"A handler for signal %r has already been registered: %s" %
(name, getattr(self, name))
)
setattr(self, name, handler)
else:
for name in dir(mapping_or_class):
if not name.startswith('on_'):
continue
if hasattr(self, name):
raise RuntimeError("A handler for signal %r has already been registered: %s" %
(name, getattr(self, name)))
setattr(self, name, getattr(mapping_or_class, name))
class MainWindow(component.Component):
def __init__(self):
component.Component.__init__(self, "MainWindow", interval=2)
self.config = ConfigManager("gtkui.conf")
# Get the glade file for the main window
self.main_glade = gtk.glade.XML(deluge.common.resource_filename(
"deluge.ui.gtkui", os.path.join("glade", "main_window.glade"))
self.gtk_builder_signals_holder = _GtkBuilderSignalsHolder()
self.main_builder = gtk.Builder()
# Patch this GtkBuilder to avoid connecting signals from elsewhere
#
# Think about splitting up the main window gtkbuilder file into the necessary parts
# in order not to have to monkey patch GtkBuilder. Those parts would then need to
# be added to the main window "by hand".
self.main_builder.prev_connect_signals = copy.deepcopy(self.main_builder.connect_signals)
def patched_connect_signals(*a, **k):
raise RuntimeError("In order to connect signals to this GtkBuilder instance please use "
"'component.get(\"MainWindow\").connect_signals()'")
self.main_builder.connect_signals = patched_connect_signals
# Get the gtk builder file for the main window
self.main_builder.add_from_file(deluge.common.resource_filename(
"deluge.ui.gtkui", os.path.join("glade", "main_window.ui"))
)
# The new release dialog
self.main_builder.add_from_file(deluge.common.resource_filename(
"deluge.ui.gtkui", os.path.join("glade", "main_window.new_release.ui"))
)
# The move storage dialog
self.main_builder.add_from_file(deluge.common.resource_filename(
"deluge.ui.gtkui", os.path.join("glade", "main_window.move_storage.ui"))
)
# The tabs
self.main_builder.add_from_file(deluge.common.resource_filename(
"deluge.ui.gtkui", os.path.join("glade", "main_window.tabs.ui"))
)
# The tabs file menu
self.main_builder.add_from_file(deluge.common.resource_filename(
"deluge.ui.gtkui", os.path.join("glade", "main_window.tabs.menu_file.ui"))
)
# The tabs peer menu
self.main_builder.add_from_file(deluge.common.resource_filename(
"deluge.ui.gtkui", os.path.join("glade", "main_window.tabs.menu_peer.ui"))
)
self.window = self.main_glade.get_widget("main_window")
self.window = self.main_builder.get_object("main_window")
self.window.set_icon(common.get_deluge_icon())
self.vpaned = self.main_glade.get_widget("vpaned")
self.vpaned = self.main_builder.get_object("vpaned")
self.initial_vpaned_position = self.config["window_pane_position"]
# Load the window state
@ -77,8 +130,7 @@ class MainWindow(component.Component):
# UI when it is minimized.
self.is_minimized = False
self.window.drag_dest_set(gtk.DEST_DEFAULT_ALL, [('text/uri-list', 0,
80)], gtk.gdk.ACTION_COPY)
self.window.drag_dest_set(gtk.DEST_DEFAULT_ALL, [('text/uri-list', 0, 80)], gtk.gdk.ACTION_COPY)
# Connect events
self.window.connect("window-state-event", self.on_window_state_event)
@ -93,11 +145,15 @@ class MainWindow(component.Component):
client.register_event_handler("NewVersionAvailableEvent", self.on_newversionavailable_event)
client.register_event_handler("TorrentFinishedEvent", self.on_torrentfinished_event)
def connect_signals(self, mapping_or_class):
self.gtk_builder_signals_holder.connect_signals(mapping_or_class)
def first_show(self):
if not(self.config["start_in_tray"] and \
self.config["enable_system_tray"]) and not \
self.window.get_property("visible"):
log.debug("Showing window")
self.main_builder.prev_connect_signals(self.gtk_builder_signals_holder)
self.show()
while gtk.events_pending():
gtk.main_iteration(False)
@ -149,9 +205,9 @@ class MainWindow(component.Component):
"""Returns True if window is visible, False if not."""
return self.window.get_property("visible")
def get_glade(self):
"""Returns a reference to the main window glade object."""
return self.main_glade
def get_builder(self):
"""Returns a reference to the main window GTK builder object."""
return self.main_builder
def quit(self, shutdown=False):
"""

View File

@ -51,36 +51,37 @@ from deluge.configmanager import ConfigManager
log = logging.getLogger(__name__)
class MenuBar(component.Component):
def __init__(self):
log.debug("MenuBar init..")
component.Component.__init__(self, "MenuBar")
self.window = component.get("MainWindow")
self.main_builder = self.window.get_builder()
self.config = ConfigManager("gtkui.conf")
self.builder = gtk.Builder()
# Get the torrent menu from the glade file
# Get the torrent menu from the gtk builder file
self.builder.add_from_file(deluge.common.resource_filename(
"deluge.ui.gtkui", os.path.join("glade", "torrent_menu.ui")
))
# Get the torrent options menu from the glade file
# Get the torrent options menu from the gtk builder file
self.builder.add_from_file(deluge.common.resource_filename(
"deluge.ui.gtkui", os.path.join("glade", "torrent_menu.options.ui")
))
# Get the torrent queue menu from the glade file
# Get the torrent queue menu from the gtk builder file
self.builder.add_from_file(deluge.common.resource_filename(
"deluge.ui.gtkui", os.path.join("glade", "torrent_menu.queue.ui")
))
self.builder.get_object("menuitem_queue").set_submenu(
self.builder.get_object("queue_torrent_menu"))
# Attach queue torrent menu
torrent_queue_menu = self.builder.get_object("queue_torrent_menu")
self.builder.get_object("menuitem_queue").set_submenu(torrent_queue_menu)
# Attach options torrent menu
self.builder.get_object("menuitem_options").set_submenu(
self.builder.get_object("options_torrent_menu"))
self.builder.get_object("download-limit-image").set_from_file(
deluge.common.get_pixmap("downloading16.png"))
self.builder.get_object("upload-limit-image").set_from_file(
deluge.common.get_pixmap("seeding16.png"))
torrent_options_menu = self.builder.get_object("options_torrent_menu")
self.builder.get_object("menuitem_options").set_submenu(torrent_options_menu)
self.builder.get_object("download-limit-image").set_from_file(deluge.common.get_pixmap("downloading16.png"))
self.builder.get_object("upload-limit-image").set_from_file(deluge.common.get_pixmap("seeding16.png"))
for menuitem in ("menuitem_down_speed", "menuitem_up_speed",
"menuitem_max_connections", "menuitem_upload_slots"):
@ -107,40 +108,30 @@ class MenuBar(component.Component):
self.builder.get_object("menuitem_auto_managed").set_submenu(submenu)
self.torrentmenu = self.builder.get_object("torrent_menu")
self.menu_torrent = self.window.main_glade.get_widget("menu_torrent")
self.menu_torrent = self.main_builder.get_object("menu_torrent")
# Attach the torrent_menu to the Torrent file menu
self.menu_torrent.set_submenu(self.torrentmenu)
# Make sure the view menuitems are showing the correct active state
self.window.main_glade.get_widget("menuitem_toolbar").set_active(
self.config["show_toolbar"])
self.window.main_glade.get_widget("menuitem_sidebar").set_active(
self.config["show_sidebar"])
self.window.main_glade.get_widget("menuitem_statusbar").set_active(
self.config["show_statusbar"])
self.window.main_glade.get_widget("sidebar_show_zero").set_active(
self.config["sidebar_show_zero"])
self.window.main_glade.get_widget("sidebar_show_trackers").set_active(
self.config["sidebar_show_trackers"])
self.main_builder.get_object("menuitem_toolbar").set_active(self.config["show_toolbar"])
self.main_builder.get_object("menuitem_sidebar").set_active(self.config["show_sidebar"])
self.main_builder.get_object("menuitem_statusbar").set_active(self.config["show_statusbar"])
self.main_builder.get_object("sidebar_show_zero").set_active(self.config["sidebar_show_zero"])
self.main_builder.get_object("sidebar_show_trackers").set_active(self.config["sidebar_show_trackers"])
### Connect Signals ###
self.window.main_glade.signal_autoconnect({
### Connect main window Signals ###
component.get("MainWindow").connect_signals({
## File Menu
"on_menuitem_addtorrent_activate": \
self.on_menuitem_addtorrent_activate,
"on_menuitem_createtorrent_activate": \
self.on_menuitem_createtorrent_activate,
"on_menuitem_quitdaemon_activate": \
self.on_menuitem_quitdaemon_activate,
"on_menuitem_addtorrent_activate": self.on_menuitem_addtorrent_activate,
"on_menuitem_createtorrent_activate": self.on_menuitem_createtorrent_activate,
"on_menuitem_quitdaemon_activate": self.on_menuitem_quitdaemon_activate,
"on_menuitem_quit_activate": self.on_menuitem_quit_activate,
## Edit Menu
"on_menuitem_preferences_activate": \
self.on_menuitem_preferences_activate,
"on_menuitem_connectionmanager_activate": \
self.on_menuitem_connectionmanager_activate,
"on_menuitem_preferences_activate": self.on_menuitem_preferences_activate,
"on_menuitem_connectionmanager_activate": self.on_menuitem_connectionmanager_activate,
## View Menu
"on_menuitem_toolbar_toggled": self.on_menuitem_toolbar_toggled,
@ -150,23 +141,20 @@ class MenuBar(component.Component):
## Help Menu
"on_menuitem_homepage_activate": self.on_menuitem_homepage_activate,
"on_menuitem_faq_activate": self.on_menuitem_faq_activate,
"on_menuitem_community_activate": \
self.on_menuitem_community_activate,
"on_menuitem_community_activate": self.on_menuitem_community_activate,
"on_menuitem_about_activate": self.on_menuitem_about_activate,
"on_menuitem_sidebar_zero_toggled":self.on_menuitem_sidebar_zero_toggled,
"on_menuitem_sidebar_trackers_toggled":self.on_menuitem_sidebar_trackers_toggled
})
# Connect menubar signals
self.builder.connect_signals({
## Torrent Menu
"on_menuitem_pause_activate": self.on_menuitem_pause_activate,
"on_menuitem_resume_activate": self.on_menuitem_resume_activate,
"on_menuitem_updatetracker_activate": \
self.on_menuitem_updatetracker_activate,
"on_menuitem_edittrackers_activate": \
self.on_menuitem_edittrackers_activate,
"on_menuitem_remove_activate": \
self.on_menuitem_remove_activate,
"on_menuitem_updatetracker_activate": self.on_menuitem_updatetracker_activate,
"on_menuitem_edittrackers_activate": self.on_menuitem_edittrackers_activate,
"on_menuitem_remove_activate": self.on_menuitem_remove_activate,
"on_menuitem_recheck_activate": self.on_menuitem_recheck_activate,
"on_menuitem_open_folder_activate": self.on_menuitem_open_folder_activate,
"on_menuitem_move_activate": self.on_menuitem_move_activate,
@ -189,7 +177,7 @@ class MenuBar(component.Component):
def start(self):
for widget in self.change_sensitivity:
self.window.main_glade.get_widget(widget).set_sensitive(True)
self.main_builder.get_object(widget).set_sensitive(True)
# Hide the Open Folder menuitem and separator if not connected to a
# localhost.
@ -206,8 +194,8 @@ class MenuBar(component.Component):
self.builder.get_object(widget).set_no_show_all(False)
if not self.config["classic_mode"]:
self.window.main_glade.get_widget("separatormenuitem").show()
self.window.main_glade.get_widget("menuitem_quitdaemon").show()
self.main_builder.get_object("separatormenuitem").show()
self.main_builder.get_object("menuitem_quitdaemon").show()
# Show the Torrent menu because we're connected to a host
self.menu_torrent.show()
@ -222,13 +210,13 @@ class MenuBar(component.Component):
log.debug("MenuBar stopping")
for widget in self.change_sensitivity:
self.window.main_glade.get_widget(widget).set_sensitive(False)
self.main_builder.get_object(widget).set_sensitive(False)
# Hide the Torrent menu
self.menu_torrent.hide()
self.window.main_glade.get_widget("separatormenuitem").hide()
self.window.main_glade.get_widget("menuitem_quitdaemon").hide()
self.main_builder.get_object("separatormenuitem").hide()
self.main_builder.get_object("menuitem_quitdaemon").hide()
def update_menu(self):
selected = component.get('TorrentView').get_selected_torrents()
@ -392,6 +380,7 @@ class MenuBar(component.Component):
self.move_storage_dialog.show()
def on_menuitem_queue_top_activate(self, value):
print 1234567, '\n\n\n'
log.debug("on_menuitem_queue_top_activate")
client.core.queue_top(component.get("TorrentView").get_selected_torrents())
@ -512,7 +501,7 @@ class MenuBar(component.Component):
attr = "show"
for item in items:
getattr(self.window.main_glade.get_widget(item), attr)()
getattr(self.main_builder.get_object(item), attr)()
def _on_known_accounts(self, known_accounts):
known_accounts_to_log = []
@ -584,4 +573,3 @@ class MenuBar(component.Component):
).run()
client.core.set_torrents_owner(
update_torrents, username).addErrback(failed_change_owner)

View File

@ -45,31 +45,31 @@ class NewReleaseDialog:
def show(self, available_version):
self.config = ConfigManager("gtkui.conf")
glade = component.get("MainWindow").main_glade
self.dialog = glade.get_widget("new_release_dialog")
builder = component.get("MainWindow").get_builder()
self.dialog = builder.get_object("new_release_dialog")
# Set the version labels
if deluge.common.windows_check() or deluge.common.osx_check():
glade.get_widget("image_new_release").set_from_file(
builder.get_object("image_new_release").set_from_file(
deluge.common.get_pixmap("deluge16.png"))
else:
glade.get_widget("image_new_release").set_from_icon_name("deluge", 4)
glade.get_widget("label_available_version").set_text(available_version)
glade.get_widget("label_client_version").set_text(
builder.get_object("image_new_release").set_from_icon_name("deluge", 4)
builder.get_object("label_available_version").set_text(available_version)
builder.get_object("label_client_version").set_text(
deluge.common.get_version())
self.chk_not_show_dialog = glade.get_widget("chk_do_not_show_new_release")
glade.get_widget("button_goto_downloads").connect(
self.chk_not_show_dialog = builder.get_object("chk_do_not_show_new_release")
builder.get_object("button_goto_downloads").connect(
"clicked", self._on_button_goto_downloads)
glade.get_widget("button_close_new_release").connect(
builder.get_object("button_close_new_release").connect(
"clicked", self._on_button_close_new_release)
if client.connected():
def on_info(version):
glade.get_widget("label_server_version").set_text(version)
glade.get_widget("label_server_version").show()
glade.get_widget("label_server_version_text").show()
builder.get_object("label_server_version").set_text(version)
builder.get_object("label_server_version").show()
builder.get_object("label_server_version_text").show()
if not client.is_classicmode():
glade.get_widget("label_client_version_text").set_label(_("<i>Client Version</i>"))
builder.get_object("label_client_version_text").set_label(_("<i>Client Version</i>"))
client.daemon.info().addCallback(on_info)
self.dialog.show()

View File

@ -41,33 +41,33 @@ from deluge.ui.gtkui.torrentdetails import Tab
class OptionsTab(Tab):
def __init__(self):
Tab.__init__(self)
glade = component.get("MainWindow").get_glade()
builder = component.get("MainWindow").get_builder()
self._name = "Options"
self._child_widget = glade.get_widget("options_tab")
self._tab_label = glade.get_widget("options_tab_label")
self._child_widget = builder.get_object("options_tab")
self._tab_label = builder.get_object("options_tab_label")
self.spin_max_download = glade.get_widget("spin_max_download")
self.spin_max_upload = glade.get_widget("spin_max_upload")
self.spin_max_connections = glade.get_widget("spin_max_connections")
self.spin_max_upload_slots = glade.get_widget("spin_max_upload_slots")
self.chk_private = glade.get_widget("chk_private")
self.chk_prioritize_first_last = glade.get_widget("chk_prioritize_first_last")
self.chk_sequential_download = glade.get_widget("chk_sequential_download")
self.chk_auto_managed = glade.get_widget("chk_auto_managed")
self.chk_stop_at_ratio = glade.get_widget("chk_stop_at_ratio")
self.chk_remove_at_ratio = glade.get_widget("chk_remove_at_ratio")
self.spin_stop_ratio = glade.get_widget("spin_stop_ratio")
self.chk_move_completed = glade.get_widget("chk_move_completed")
self.filechooser_move_completed = glade.get_widget("filechooser_move_completed")
self.entry_move_completed = glade.get_widget("entry_move_completed")
self.chk_shared = glade.get_widget("chk_shared")
self.button_apply = glade.get_widget("button_apply")
self.spin_max_download = builder.get_object("spin_max_download")
self.spin_max_upload = builder.get_object("spin_max_upload")
self.spin_max_connections = builder.get_object("spin_max_connections")
self.spin_max_upload_slots = builder.get_object("spin_max_upload_slots")
self.chk_private = builder.get_object("chk_private")
self.chk_prioritize_first_last = builder.get_object("chk_prioritize_first_last")
self.chk_sequential_download = builder.get_object("chk_sequential_download")
self.chk_auto_managed = builder.get_object("chk_auto_managed")
self.chk_stop_at_ratio = builder.get_object("chk_stop_at_ratio")
self.chk_remove_at_ratio = builder.get_object("chk_remove_at_ratio")
self.spin_stop_ratio = builder.get_object("spin_stop_ratio")
self.chk_move_completed = builder.get_object("chk_move_completed")
self.filechooser_move_completed = builder.get_object("filechooser_move_completed")
self.entry_move_completed = builder.get_object("entry_move_completed")
self.chk_shared = builder.get_object("chk_shared")
self.button_apply = builder.get_object("button_apply")
self.prev_torrent_id = None
self.prev_status = None
glade.signal_autoconnect({
component.get("MainWindow").connect_signals({
"on_button_apply_clicked": self._on_button_apply_clicked,
"on_button_edit_trackers_clicked": self._on_button_edit_trackers_clicked,
"on_chk_move_completed_toggled": self._on_chk_move_completed_toggled,

View File

@ -33,17 +33,13 @@
#
#
import os
import gtk
import gtk.glade
import logging
import os.path
import cPickle
from itertools import izip
from deluge.ui.client import client
from deluge.configmanager import ConfigManager
import deluge.configmanager
import deluge.component as component
import deluge.common
@ -61,17 +57,17 @@ def cell_data_progress(column, cell, model, row, data):
class PeersTab(Tab):
def __init__(self):
Tab.__init__(self)
glade = component.get("MainWindow").get_glade()
builder = component.get("MainWindow").get_builder()
self._name = "Peers"
self._child_widget = glade.get_widget("peers_tab")
self._tab_label = glade.get_widget("peers_tab_label")
self.peer_menu = glade.get_widget("menu_peer_tab")
glade.signal_autoconnect({
self._child_widget = builder.get_object("peers_tab")
self._tab_label = builder.get_object("peers_tab_label")
self.peer_menu = builder.get_object("menu_peer_tab")
component.get("MainWindow").connect_signals({
"on_menuitem_add_peer_activate": self._on_menuitem_add_peer_activate,
})
})
self.listview = glade.get_widget("peers_listview")
self.listview = builder.get_object("peers_listview")
self.listview.props.has_tooltip = True
self.listview.connect("button-press-event", self._on_button_press_event)
self.listview.connect("query-tooltip", self._on_query_tooltip)

View File

@ -38,7 +38,6 @@ import os
import pygtk
pygtk.require('2.0')
import gtk
import gtk.glade
import logging
import deluge.component as component

View File

@ -36,7 +36,6 @@
import gtk
import gtk.glade
import logging
import deluge.component as component
@ -53,9 +52,9 @@ class SideBar(component.Component):
def __init__(self):
component.Component.__init__(self, "SideBar")
self.window = component.get("MainWindow")
glade = self.window.main_glade
self.notebook = glade.get_widget("sidebar_notebook")
self.hpaned = glade.get_widget("hpaned")
builder = self.window.get_builder()
self.notebook = builder.get_object("sidebar_notebook")
self.hpaned = builder.get_object("main_window_hpaned")
self.config = ConfigManager("gtkui.conf")
#self.hpaned_position = self.hpaned.get_position()

View File

@ -34,12 +34,8 @@
#
#
import gtk
import gtk.glade
import logging
from deluge.ui.client import client
import deluge.component as component
import deluge.common
from deluge.configmanager import ConfigManager
@ -80,12 +76,12 @@ class StatusTab(Tab):
Tab.__init__(self)
# Get the labels we need to update.
# widget name, modifier function, status keys
self.glade = glade = component.get("MainWindow").main_glade
self.progressbar = component.get("MainWindow").main_glade.get_widget("progressbar")
self.builder = builder = component.get("MainWindow").get_builder()
self.progressbar = builder.get_object("progressbar")
self._name = "Status"
self._child_widget = glade.get_widget("status_tab")
self._tab_label = glade.get_widget("status_tab_label")
self._child_widget = builder.get_object("status_tab")
self._tab_label = builder.get_object("status_tab_label")
self.config = ConfigManager("gtkui.conf")
self.config.register_set_function(
"show_piecesbar",
@ -93,25 +89,25 @@ class StatusTab(Tab):
apply_now=True
)
self.label_widgets = [
(glade.get_widget("summary_pieces"), fpeer_size_second, ("num_pieces", "piece_length")),
(glade.get_widget("summary_availability"), fratio, ("distributed_copies",)),
(glade.get_widget("summary_total_downloaded"), fpeer_sized, ("all_time_download", "total_payload_download")),
(glade.get_widget("summary_total_uploaded"), fpeer_sized, ("total_uploaded", "total_payload_upload")),
(glade.get_widget("summary_download_speed"), fspeed, ("download_payload_rate", "max_download_speed")),
(glade.get_widget("summary_upload_speed"), fspeed, ("upload_payload_rate", "max_upload_speed")),
(glade.get_widget("summary_seeders"), deluge.common.fpeer, ("num_seeds", "total_seeds")),
(glade.get_widget("summary_peers"), deluge.common.fpeer, ("num_peers", "total_peers")),
(glade.get_widget("summary_eta"), deluge.common.ftime, ("eta",)),
(glade.get_widget("summary_share_ratio"), fratio, ("ratio",)),
(glade.get_widget("summary_tracker_status"), None, ("tracker_status",)),
(glade.get_widget("summary_next_announce"), deluge.common.ftime, ("next_announce",)),
(glade.get_widget("summary_active_time"), deluge.common.ftime, ("active_time",)),
(glade.get_widget("summary_seed_time"), deluge.common.ftime, ("seeding_time",)),
(glade.get_widget("summary_seed_rank"), str, ("seed_rank",)),
(glade.get_widget("summary_auto_managed"), str, ("is_auto_managed",)),
(glade.get_widget("progressbar"), fpcnt, ("progress",)),
(glade.get_widget("summary_date_added"), deluge.common.fdate, ("time_added",)),
(glade.get_widget("summary_last_seen_complete"), fdate_or_never, ("last_seen_complete",)),
(builder.get_object("summary_pieces"), fpeer_size_second, ("num_pieces", "piece_length")),
(builder.get_object("summary_availability"), fratio, ("distributed_copies",)),
(builder.get_object("summary_total_downloaded"), fpeer_sized, ("all_time_download", "total_payload_download")),
(builder.get_object("summary_total_uploaded"), fpeer_sized, ("total_uploaded", "total_payload_upload")),
(builder.get_object("summary_download_speed"), fspeed, ("download_payload_rate", "max_download_speed")),
(builder.get_object("summary_upload_speed"), fspeed, ("upload_payload_rate", "max_upload_speed")),
(builder.get_object("summary_seeders"), deluge.common.fpeer, ("num_seeds", "total_seeds")),
(builder.get_object("summary_peers"), deluge.common.fpeer, ("num_peers", "total_peers")),
(builder.get_object("summary_eta"), deluge.common.ftime, ("eta",)),
(builder.get_object("summary_share_ratio"), fratio, ("ratio",)),
(builder.get_object("summary_tracker_status"), None, ("tracker_status",)),
(builder.get_object("summary_next_announce"), deluge.common.ftime, ("next_announce",)),
(builder.get_object("summary_active_time"), deluge.common.ftime, ("active_time",)),
(builder.get_object("summary_seed_time"), deluge.common.ftime, ("seeding_time",)),
(builder.get_object("summary_seed_rank"), str, ("seed_rank",)),
(builder.get_object("summary_auto_managed"), str, ("is_auto_managed",)),
(builder.get_object("progressbar"), fpcnt, ("progress",)),
(builder.get_object("summary_date_added"), deluge.common.fdate, ("time_added",)),
(builder.get_object("summary_last_seen_complete"), fdate_or_never, ("last_seen_complete",)),
]
def update(self):
@ -191,7 +187,7 @@ class StatusTab(Tab):
else:
if show:
self.piecesbar = PiecesBar()
self.glade.get_widget("status_progress_vbox").pack_start(
self.builder.get_object("status_progress_vbox").pack_start(
self.piecesbar, False, False, 5
)
self.progressbar.hide()

View File

@ -113,7 +113,7 @@ class StatusBar(component.Component):
def __init__(self):
component.Component.__init__(self, "StatusBar", interval=3)
self.window = component.get("MainWindow")
self.statusbar = self.window.main_glade.get_widget("statusbar")
self.statusbar = self.window.get_builder().get_object("statusbar")
self.config = ConfigManager("gtkui.conf")
# Status variables that are updated via callback

View File

@ -68,12 +68,10 @@ class SystemTray(component.Component):
"separatormenuitem3",
"separatormenuitem4"
]
self.config.register_set_function("enable_system_tray",
self.on_enable_system_tray_set)
self.config.register_set_function("enable_system_tray", self.on_enable_system_tray_set)
# bit of a hack to prevent function from doing something on startup
self.__enabled_set_once = False
self.config.register_set_function("enable_appindicator",
self.on_enable_appindicator_set)
self.config.register_set_function("enable_appindicator", self.on_enable_appindicator_set)
self.max_download_speed = -1.0
self.download_rate = 0.0
@ -93,17 +91,12 @@ class SystemTray(component.Component):
)
self.builder.connect_signals({
"on_menuitem_show_deluge_activate": \
self.on_menuitem_show_deluge_activate,
"on_menuitem_add_torrent_activate": \
self.on_menuitem_add_torrent_activate,
"on_menuitem_pause_all_activate": \
self.on_menuitem_pause_all_activate,
"on_menuitem_resume_all_activate": \
self.on_menuitem_resume_all_activate,
"on_menuitem_show_deluge_activate": self.on_menuitem_show_deluge_activate,
"on_menuitem_add_torrent_activate": self.on_menuitem_add_torrent_activate,
"on_menuitem_pause_all_activate": self.on_menuitem_pause_all_activate,
"on_menuitem_resume_all_activate": self.on_menuitem_resume_all_activate,
"on_menuitem_quit_activate": self.on_menuitem_quit_activate,
"on_menuitem_quitdaemon_activate": \
self.on_menuitem_quitdaemon_activate
"on_menuitem_quitdaemon_activate": self.on_menuitem_quitdaemon_activate
})
self.tray_menu = self.builder.get_object("tray_menu")
@ -129,8 +122,7 @@ class SystemTray(component.Component):
else:
log.debug("Enabling the system tray icon..")
if deluge.common.windows_check() or deluge.common.osx_check():
self.tray = gtk.status_icon_new_from_pixbuf(
common.get_logo(32))
self.tray = gtk.status_icon_new_from_pixbuf(common.get_logo(32))
else:
try:
self.tray = gtk.status_icon_new_from_icon_name("deluge")

View File

@ -37,7 +37,6 @@
import pygtk
pygtk.require('2.0')
import gtk
import gtk.glade
import gobject
import logging
@ -53,18 +52,16 @@ class ToolBar(component.Component):
component.Component.__init__(self, "ToolBar")
log.debug("ToolBar Init..")
self.window = component.get("MainWindow")
self.toolbar = self.window.main_glade.get_widget("toolbar")
self.toolbar = self.window.get_builder().get_object("toolbar")
self.config = ConfigManager("gtkui.conf")
### Connect Signals ###
self.window.main_glade.signal_autoconnect({
### Connect main window Signals ###
self.window.connect_signals({
"on_toolbutton_add_clicked": self.on_toolbutton_add_clicked,
"on_toolbutton_remove_clicked": self.on_toolbutton_remove_clicked,
"on_toolbutton_pause_clicked": self.on_toolbutton_pause_clicked,
"on_toolbutton_resume_clicked": self.on_toolbutton_resume_clicked,
"on_toolbutton_preferences_clicked": \
self.on_toolbutton_preferences_clicked,
"on_toolbutton_connectionmanager_clicked": \
self.on_toolbutton_connectionmanager_clicked,
"on_toolbutton_preferences_clicked": self.on_toolbutton_preferences_clicked,
"on_toolbutton_connectionmanager_clicked": self.on_toolbutton_connectionmanager_clicked,
"on_toolbutton_queue_up_clicked": self.on_toolbutton_queue_up_clicked,
"on_toolbutton_queue_down_clicked": self.on_toolbutton_queue_down_clicked
})
@ -86,14 +83,14 @@ class ToolBar(component.Component):
def start(self):
if not self.config["classic_mode"]:
self.window.main_glade.get_widget("toolbutton_connectionmanager").show()
self.window.get_builder().get_object("toolbutton_connectionmanager").show()
for widget in self.change_sensitivity:
self.window.main_glade.get_widget(widget).set_sensitive(True)
self.window.get_builder().get_object(widget).set_sensitive(True)
def stop(self):
for widget in self.change_sensitivity:
self.window.main_glade.get_widget(widget).set_sensitive(False)
self.window.get_builder().get_object(widget).set_sensitive(False)
def visible(self, visible):
if visible:
@ -185,7 +182,7 @@ class ToolBar(component.Component):
component.get("MenuBar").on_menuitem_queue_down_activate(data)
def _on_classic_mode(self, key, value):
w = self.window.main_glade.get_widget("toolbutton_connectionmanager")
w = self.window.get_builder().get_object("toolbutton_connectionmanager")
if value:
w.hide()
else:

View File

@ -37,7 +37,6 @@
"""The torrent details component shows info about the selected torrent."""
import gtk
import gtk.glade
import os
import os.path
import cPickle
@ -78,12 +77,12 @@ class TorrentDetails(component.Component):
def __init__(self):
component.Component.__init__(self, "TorrentDetails", interval=2)
self.window = component.get("MainWindow")
glade = self.window.main_glade
builder = self.window.get_builder()
self.notebook = glade.get_widget("torrent_info")
self.notebook = builder.get_object("torrent_info")
# This is the menu item we'll attach the tabs checklist menu to
self.menu_tabs = glade.get_widget("menu_tabs")
self.menu_tabs = builder.get_object("menu_tabs")
self.notebook.connect("switch-page", self._on_switch_page)

View File

@ -39,38 +39,28 @@
import pygtk
pygtk.require('2.0')
import gtk
import gtk.glade
import gettext
import gobject
import logging
import warnings
from urlparse import urlparse
from twisted.internet import reactor
import listview
import deluge.common
import deluge.component as component
from deluge.ui.client import client
import listview
from deluge.ui.tracker_icons import TrackerIcons
from removetorrentdialog import RemoveTorrentDialog
log = logging.getLogger(__name__)
# Status icons.. Create them from file only once to avoid constantly
# re-creating them.
icon_downloading = gtk.gdk.pixbuf_new_from_file(
deluge.common.get_pixmap("downloading16.png"))
icon_seeding = gtk.gdk.pixbuf_new_from_file(
deluge.common.get_pixmap("seeding16.png"))
icon_inactive = gtk.gdk.pixbuf_new_from_file(
deluge.common.get_pixmap("inactive16.png"))
icon_alert = gtk.gdk.pixbuf_new_from_file(
deluge.common.get_pixmap("alert16.png"))
icon_queued = gtk.gdk.pixbuf_new_from_file(
deluge.common.get_pixmap("queued16.png"))
icon_checking = gtk.gdk.pixbuf_new_from_file(
deluge.common.get_pixmap("checking16.png"))
icon_downloading = gtk.gdk.pixbuf_new_from_file(deluge.common.get_pixmap("downloading16.png"))
icon_seeding = gtk.gdk.pixbuf_new_from_file(deluge.common.get_pixmap("seeding16.png"))
icon_inactive = gtk.gdk.pixbuf_new_from_file(deluge.common.get_pixmap("inactive16.png"))
icon_alert = gtk.gdk.pixbuf_new_from_file(deluge.common.get_pixmap("alert16.png"))
icon_queued = gtk.gdk.pixbuf_new_from_file(deluge.common.get_pixmap("queued16.png"))
icon_checking = gtk.gdk.pixbuf_new_from_file(deluge.common.get_pixmap("checking16.png"))
# Holds the info for which status icon to display based on state
ICON_STATE = {
@ -192,11 +182,11 @@ class SearchBox(object):
self.visible = False
self.search_pending = self.prefiltered = None
self.search_box = self.window.main_glade.get_widget("search_box")
self.search_torrents_entry = self.window.main_glade.get_widget("search_torrents_entry")
self.close_search_button = self.window.main_glade.get_widget("close_search_button")
self.match_search_button = self.window.main_glade.get_widget("search_torrents_match")
self.window.main_glade.signal_autoconnect(self)
self.search_box = self.window.main_builder.get_object("search_box")
self.search_torrents_entry = self.window.main_builder.get_object("search_torrents_entry")
self.close_search_button = self.window.main_builder.get_object("close_search_button")
self.match_search_button = self.window.main_builder.get_object("search_torrents_match")
self.window.connect_signals(self)
def show(self):
self.visible = True
@ -319,9 +309,7 @@ class TorrentView(listview.ListView, component.Component):
component.Component.__init__(self, "TorrentView", interval=2, depend=["SessionProxy"])
self.window = component.get("MainWindow")
# Call the ListView constructor
listview.ListView.__init__(self,
self.window.main_glade.get_widget("torrent_view"),
"torrentview.state")
listview.ListView.__init__(self, self.window.main_builder.get_object("torrent_view"), "torrentview.state")
log.debug("TorrentView Init..")
# If we have gotten the state yet
@ -333,11 +321,8 @@ class TorrentView(listview.ListView, component.Component):
# We keep a copy of the previous status to compare for changes
self.prev_status = {}
# Register the columns menu with the listview so it gets updated
# accordingly.
self.register_checklist_menu(
self.window.main_glade.get_widget("menu_columns")
)
# Register the columns menu with the listview so it gets updated accordingly.
self.register_checklist_menu(self.window.main_builder.get_object("menu_columns"))
# Add the columns to the listview
self.add_text_column("torrent_id", hidden=True)