mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-27 02:20:32 +00:00
Revert "[GTKUI] Add MainWindow.get_window() and replace window attr usage"
Made a mistake with types of window, get_window actually refers to GdkWindow rather than GtkWindow... The use of self.window.window is confusing and is still deprecated in Gtk3 so will fix that in following commit. This reverts commit ccfe6b3c80e054893ae6a626c46be5e3024d8a45.
This commit is contained in:
parent
6ac296118d
commit
b8135617ae
@ -148,7 +148,7 @@ class AddTorrentDialog(component.Component):
|
||||
|
||||
def _show(self, focus=False):
|
||||
if component.get('MainWindow').is_on_active_workspace():
|
||||
self.dialog.set_transient_for(component.get('MainWindow').get_window())
|
||||
self.dialog.set_transient_for(component.get('MainWindow').window)
|
||||
else:
|
||||
self.dialog.set_transient_for(None)
|
||||
|
||||
@ -166,7 +166,7 @@ class AddTorrentDialog(component.Component):
|
||||
self.previous_selected_torrent = None
|
||||
self.torrent_liststore.clear()
|
||||
self.files_treestore.clear()
|
||||
self.dialog.set_transient_for(component.get('MainWindow').get_window())
|
||||
self.dialog.set_transient_for(component.get('MainWindow').window)
|
||||
return None
|
||||
|
||||
def update_core_config(self, show=False, focus=False):
|
||||
|
@ -129,7 +129,7 @@ class ConnectionManager(component.Component):
|
||||
|
||||
# Setup the ConnectionManager dialog
|
||||
self.connection_manager = self.builder.get_object('connection_manager')
|
||||
self.connection_manager.set_transient_for(component.get('MainWindow').get_window())
|
||||
self.connection_manager.set_transient_for(component.get('MainWindow').window)
|
||||
|
||||
self.connection_manager.set_icon(get_deluge_icon())
|
||||
|
||||
|
@ -54,7 +54,7 @@ class CreateTorrentDialog(object):
|
||||
self.config = ConfigManager('gtkui.conf')
|
||||
|
||||
self.dialog = self.builder.get_object('create_torrent_dialog')
|
||||
self.dialog.set_transient_for(component.get('MainWindow').get_window())
|
||||
self.dialog.set_transient_for(component.get('MainWindow').window)
|
||||
|
||||
self.builder.connect_signals({
|
||||
'on_button_file_clicked': self._on_button_file_clicked,
|
||||
@ -351,7 +351,7 @@ class CreateTorrentDialog(object):
|
||||
add_to_session).addCallback(hide_progress)
|
||||
|
||||
# Setup progress dialog
|
||||
self.builder.get_object('progress_dialog').set_transient_for(component.get('MainWindow').get_window())
|
||||
self.builder.get_object('progress_dialog').set_transient_for(component.get('MainWindow').window)
|
||||
self.builder.get_object('progress_dialog').show_all()
|
||||
|
||||
self.dialog.destroy()
|
||||
|
@ -32,7 +32,7 @@ class BaseDialog(gtk.Dialog):
|
||||
"""
|
||||
super(BaseDialog, self).__init__(
|
||||
title=header,
|
||||
parent=parent if parent else component.get('MainWindow').get_window(),
|
||||
parent=parent if parent else component.get('MainWindow').window,
|
||||
flags=gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_NO_SEPARATOR,
|
||||
buttons=buttons)
|
||||
|
||||
|
@ -99,7 +99,7 @@ class FilterTreeView(component.Component):
|
||||
self.treeview.connect('button-press-event', self.on_button_press_event)
|
||||
|
||||
# colors using current theme.
|
||||
style = component.get('MainWindow').get_window().get_style()
|
||||
style = component.get('MainWindow').window.get_style()
|
||||
self.colour_background = style.bg[gtk.STATE_NORMAL]
|
||||
self.colour_foreground = style.fg[gtk.STATE_NORMAL]
|
||||
|
||||
|
@ -263,7 +263,7 @@ class GtkUI(object):
|
||||
# The gtk modal dialogs (e.g. Preferences) can prevent the application
|
||||
# quitting, so force exiting by destroying MainWindow. Must be done here
|
||||
# to avoid hanging when quitting with SIGINT (CTRL-C).
|
||||
self.mainwindow.get_window().destroy()
|
||||
self.mainwindow.window.destroy()
|
||||
|
||||
reactor.stop()
|
||||
|
||||
|
@ -191,9 +191,6 @@ class MainWindow(component.Component):
|
||||
"""Returns a reference to the main window GTK builder object."""
|
||||
return self.main_builder
|
||||
|
||||
def get_window(self):
|
||||
return self.window
|
||||
|
||||
def quit(self, shutdown=False, restart=False):
|
||||
"""Quits the GtkUI application.
|
||||
|
||||
@ -324,7 +321,7 @@ class MainWindow(component.Component):
|
||||
"""
|
||||
if wnck:
|
||||
self.screen.force_update()
|
||||
win = wnck.window_get(self.get_window().xid)
|
||||
win = wnck.window_get(self.window.window.xid)
|
||||
if win:
|
||||
active_wksp = win.get_screen().get_active_workspace()
|
||||
if active_wksp:
|
||||
|
@ -285,7 +285,7 @@ class MenuBar(component.Component):
|
||||
from deluge.ui.gtkui.edittrackersdialog import EditTrackersDialog
|
||||
dialog = EditTrackersDialog(
|
||||
component.get('TorrentView').get_selected_torrent(),
|
||||
self.mainwindow.get_window())
|
||||
self.mainwindow.window)
|
||||
dialog.run()
|
||||
|
||||
def on_menuitem_remove_activate(self, data=None):
|
||||
@ -326,7 +326,7 @@ class MenuBar(component.Component):
|
||||
# Keep it referenced:
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=546802
|
||||
self.move_storage_dialog = builder.get_object('move_storage_dialog')
|
||||
self.move_storage_dialog.set_transient_for(self.mainwindow.get_window())
|
||||
self.move_storage_dialog.set_transient_for(self.mainwindow.window)
|
||||
self.move_storage_dialog_hbox = builder.get_object('hbox_entry')
|
||||
self.move_storage_path_chooser = PathChooser('move_completed_paths_list')
|
||||
self.move_storage_dialog_hbox.add(self.move_storage_path_chooser)
|
||||
@ -554,7 +554,7 @@ class MenuBar(component.Component):
|
||||
ErrorDialog(
|
||||
_('Ownership Change Error'),
|
||||
_('There was an error while trying changing ownership.'),
|
||||
self.mainwindow.get_window(), details=failure.value.logable()
|
||||
self.mainwindow.window, details=failure.value.logable()
|
||||
).run()
|
||||
client.core.set_owner(
|
||||
update_torrents, username).addErrback(failed_change_owner)
|
||||
|
@ -25,7 +25,7 @@ def accel_meta(item, group, key):
|
||||
def menubar_osx(gtkui, osxapp):
|
||||
main_builder = gtkui.mainwindow.get_builder()
|
||||
menubar = main_builder.get_object('menubar')
|
||||
group = accel_groups_from_object(gtkui.mainwindow.get_window())[0]
|
||||
group = accel_groups_from_object(gtkui.mainwindow.window)[0]
|
||||
|
||||
config = ConfigManager('gtkui.conf')
|
||||
|
||||
|
@ -50,7 +50,7 @@ class Preferences(component.Component):
|
||||
self.builder.add_from_file(deluge.common.resource_filename(
|
||||
'deluge.ui.gtkui', os.path.join('glade', 'preferences_dialog.ui')))
|
||||
self.pref_dialog = self.builder.get_object('pref_dialog')
|
||||
self.pref_dialog.set_transient_for(component.get('MainWindow').get_window())
|
||||
self.pref_dialog.set_transient_for(component.get('MainWindow').window)
|
||||
self.pref_dialog.set_icon(get_deluge_icon())
|
||||
self.treeview = self.builder.get_object('treeview')
|
||||
self.notebook = self.builder.get_object('notebook')
|
||||
|
@ -52,7 +52,7 @@ class QueuedTorrents(component.Component):
|
||||
self.treeview.set_tooltip_column(1)
|
||||
|
||||
def run(self):
|
||||
self.dialog.set_transient_for(component.get('MainWindow').get_window())
|
||||
self.dialog.set_transient_for(component.get('MainWindow').window)
|
||||
self.dialog.show()
|
||||
|
||||
def start(self):
|
||||
|
@ -44,7 +44,7 @@ class RemoveTorrentDialog(object):
|
||||
'deluge.ui.gtkui', os.path.join('glade', 'remove_torrent_dialog.ui')))
|
||||
|
||||
self.__dialog = self.builder.get_object('remove_torrent_dialog')
|
||||
self.__dialog.set_transient_for(component.get('MainWindow').get_window())
|
||||
self.__dialog.set_transient_for(component.get('MainWindow').window)
|
||||
|
||||
self.builder.connect_signals({
|
||||
'on_delete_files_toggled': self.on_delete_files_toggled
|
||||
|
@ -91,8 +91,8 @@ class SystemTray(component.Component):
|
||||
self.indicator.set_menu(self.tray_menu)
|
||||
|
||||
# Make sure the status of the Show Window MenuItem is correct
|
||||
self._sig_win_hide = self.mainwindow.get_window().connect('hide', self._on_window_hide)
|
||||
self._sig_win_show = self.mainwindow.get_window().connect('show', self._on_window_show)
|
||||
self._sig_win_hide = self.mainwindow.window.connect('hide', self._on_window_hide)
|
||||
self._sig_win_show = self.mainwindow.window.connect('show', self._on_window_show)
|
||||
if self.mainwindow.visible():
|
||||
self.builder.get_object('menuitem_show_deluge').set_active(True)
|
||||
else:
|
||||
@ -262,8 +262,8 @@ class SystemTray(component.Component):
|
||||
app_ind_conf = self.config['enable_appindicator']
|
||||
if appindicator and app_ind_conf:
|
||||
if hasattr(self, '_sig_win_hide'):
|
||||
self.mainwindow.get_window().disconnect(self._sig_win_hide)
|
||||
self.mainwindow.get_window().disconnect(self._sig_win_show)
|
||||
self.mainwindow.window.disconnect(self._sig_win_hide)
|
||||
self.mainwindow.window.disconnect(self._sig_win_show)
|
||||
log.debug('Disabling the application indicator..')
|
||||
|
||||
self.indicator.set_status(appindicator.STATUS_PASSIVE)
|
||||
|
@ -75,5 +75,5 @@ class TrackersTab(Tab):
|
||||
torrent_id = component.get('TorrentView').get_selected_torrent()
|
||||
if torrent_id:
|
||||
from deluge.ui.gtkui.edittrackersdialog import EditTrackersDialog
|
||||
dialog = EditTrackersDialog(torrent_id, component.get('MainWindow').get_window())
|
||||
dialog = EditTrackersDialog(torrent_id, component.get('MainWindow').window)
|
||||
dialog.run()
|
||||
|
Loading…
x
Reference in New Issue
Block a user