diff --git a/deluge/ui/gtkui/addtorrentdialog.py b/deluge/ui/gtkui/addtorrentdialog.py index a108b1e6a..bd7db2f1a 100644 --- a/deluge/ui/gtkui/addtorrentdialog.py +++ b/deluge/ui/gtkui/addtorrentdialog.py @@ -352,7 +352,9 @@ class AddTorrentDialog(component.Component): _file, _file['path'], idx, _file.get('download', True), split_files ) self.add_files(None, split_files) - self.listview_files.expand_row(b'0', False) + # FIXME add back expand_row + # self.listview_files.expand_row(b'0', False) + self.listview_files.expand_all() def prepare_file(self, _file, file_name, file_num, download, files_storage): first_slash_index = file_name.find(os.path.sep) @@ -1043,7 +1045,9 @@ class AddTorrentDialog(component.Component): # We need to re-expand the view because it might contracted # if we change the root iter - self.listview_files.expand_row(b'0', False) + # FIXME add back expand_row + # self.listview_files.expand_row('0', False) + self.listview_files.expand_all() else: # This was a simple folder rename without any splits, so just # change the path for itr diff --git a/deluge/ui/gtkui/files_tab.py b/deluge/ui/gtkui/files_tab.py index bfa9c8c46..91a0b480c 100644 --- a/deluge/ui/gtkui/files_tab.py +++ b/deluge/ui/gtkui/files_tab.py @@ -379,7 +379,8 @@ class FilesTab(Tab): def update_files(self): with listview_replace_treestore(self.listview): self.prepare_file_store(self.files_list[self.torrent_id]) - self.listview.expand_row(b'0', False) + # FIXME + # self.listview.expand_row(b'0', False) def get_selected_files(self): """Returns a list of file indexes that are selected.""" @@ -414,7 +415,8 @@ class FilesTab(Tab): def update_folder_percentages(self): """Go through the tree and update the folder complete percentages.""" - root = self.treestore.get_iter_root() + # FIXME Why changed? Was: self.treestore.get_iter_root() + root = self.treestore.get_iter_first() if root is None or self.treestore[root][5] != -1: return diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index d3bafe4d9..660e915ad 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -190,8 +190,11 @@ class GtkUI(object): self.queuedtorrents = QueuedTorrents() self.ipcinterface = IPCInterface(args.torrents) - # Initialize gdk threading - threads_init() + # FIXME: Verify that removing gdk threading has no adverse effects. + # There are the two commits [64a94ec] [1f3e930] that added gdk threading + # and my thinking is there is no need for the code anymore. + # Since PyGObject 3.10.2, calling GObject.threads_init() this is no longer needed. + # threads_init() # We make sure that the UI components start once we get a core URI client.set_disconnect_callback(self.__on_disconnect) diff --git a/deluge/ui/gtkui/listview.py b/deluge/ui/gtkui/listview.py index 39b390275..ba182a735 100644 --- a/deluge/ui/gtkui/listview.py +++ b/deluge/ui/gtkui/listview.py @@ -18,6 +18,7 @@ from gtk.gdk import Event # pylint: disable=ungrouped-imports from deluge.common import decode_bytes from deluge.ui.gtkui.common import load_pickled_state_file, save_pickled_state_file +# FIXME: ? signal_new( 'button-press-event', gtk.TreeViewColumn, SIGNAL_RUN_LAST, TYPE_NONE, (Event,) ) @@ -41,6 +42,12 @@ class ListViewColumnState: # pylint: disable=old-style-class self.sort_order = sort_order +# FIXME: Why is this needed? +class TreeModel(GObject.Object, Gtk.TreeModel): + def __init__(self, filter): + Gtk.TreeModel.__init__(self, filter) + + class ListView(object): """ListView is used to make custom GtkTreeViews. It supports the adding and removing of columns, creating a menu for a column toggle list and @@ -220,7 +227,11 @@ class ListView(object): self.last_sort_order = {} def record_position(model, path, _iter, data): - self.last_sort_order[model[_iter][self.unique_column_id]] = path[0] + # FIXME: TypeError: 'TreePath' object does not support indexing + # Verify (old code: ` = path[0]`) + self.last_sort_order[model[_iter][self.unique_column_id]] = int( + str(model.get_path(iter)) + ) model.foreach(record_position, None) @@ -575,6 +586,7 @@ class ListView(object): column.set_min_width(20) column.set_reorderable(True) column.set_visible(not hidden) + # FIXME: Check for errors with button press, related new signal column.connect('button-press-event', self.on_treeview_header_right_clicked) if tooltip: diff --git a/deluge/ui/gtkui/mainwindow.py b/deluge/ui/gtkui/mainwindow.py index 1d3668979..b967f7262 100644 --- a/deluge/ui/gtkui/mainwindow.py +++ b/deluge/ui/gtkui/mainwindow.py @@ -76,9 +76,8 @@ class MainWindow(component.Component): # Think about splitting up mainwindow gtkbuilder file into the necessary parts # to avoid GtkBuilder monkey patch. Those parts would then need adding to mainwindow 'by hand'. self.gtk_builder_signals_holder = _GtkBuilderSignalsHolder() - self.main_builder.prev_connect_signals = copy.deepcopy( - self.main_builder.connect_signals - ) + # FIXME: The deepcopy has been removed: copy.deepcopy(self.main_builder.connect_signals) + self.main_builder.prev_connect_signals = self.main_builder.connect_signals def patched_connect_signals(*a, **k): raise RuntimeError( diff --git a/deluge/ui/gtkui/path_combo_chooser.py b/deluge/ui/gtkui/path_combo_chooser.py index 7d5c46ffd..bdcaa0654 100755 --- a/deluge/ui/gtkui/path_combo_chooser.py +++ b/deluge/ui/gtkui/path_combo_chooser.py @@ -12,9 +12,11 @@ from __future__ import division, print_function, unicode_literals import os -import gtk -from gobject import SIGNAL_RUN_FIRST, TYPE_NONE, GObject, type_register -from gtk import gdk, keysyms # pylint: disable=ungrouped-imports +# FIXME: use this as fallback to get_introspection_module? +from gi.importer import modules + +# from gi.module import get_introspection_module +from gi.repository import Gdk, GObject, Gtk import deluge.component as component from deluge.common import resource_filename diff --git a/deluge/ui/gtkui/systemtray.py b/deluge/ui/gtkui/systemtray.py index f54300304..2f3453d49 100644 --- a/deluge/ui/gtkui/systemtray.py +++ b/deluge/ui/gtkui/systemtray.py @@ -357,9 +357,8 @@ class SystemTray(component.Component): if windows_check() or osx_check(): popup_function = None button = 0 - self.tray_menu.popup( - None, None, popup_function, button, activate_time, status_icon - ) + # FIXME why was status_icon removed?? + self.tray_menu.popup(None, None, None, popup_function, button, activate_time) def on_menuitem_show_deluge_activate(self, menuitem): log.debug('on_menuitem_show_deluge_activate') diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py index 05f246a77..f008d0fc4 100644 --- a/deluge/ui/gtkui/torrentview.py +++ b/deluge/ui/gtkui/torrentview.py @@ -660,6 +660,7 @@ class TorrentView(ListView, component.Component): to_update = [] for i, status_field in fields_to_update: row_value = status[torrent_id][status_field] + # FIXME: Seeing UnicodeWarning?? if row[i] != row_value: to_update.append(i) to_update.append(row_value)