diff --git a/deluge/ui/gtk3/dialogs.py b/deluge/ui/gtk3/dialogs.py
index f310ce53a..21709723f 100644
--- a/deluge/ui/gtk3/dialogs.py
+++ b/deluge/ui/gtk3/dialogs.py
@@ -29,7 +29,7 @@ class BaseDialog(Gtk.Dialog):
"""
:param header: str, the header portion of the dialog
:param text: str, the text body of the dialog
- :param icon: gtk Stock ID, a stock id for the gtk icon to display
+ :param icon: icon name from icon theme or icon filename.
:param buttons: tuple, of gtk stock ids and responses
:param parent: gtkWindow, the parent window, if None it will default to the
MainWindow
@@ -51,15 +51,13 @@ class BaseDialog(Gtk.Dialog):
self.set_default_size(200, 100)
hbox = Gtk.HBox(spacing=5)
image = Gtk.Image()
- if not Gtk.stock_lookup(icon) and (
- icon.endswith('.svg') or icon.endswith('.png')
- ):
+ if icon.endswith('.svg') or icon.endswith('.png'):
# Hack for Windows since it doesn't support svg
if icon.endswith('.svg') and windows_check():
icon = icon.rpartition('.svg')[0] + '16.png'
- image.set_from_pixbuf(get_pixbuf_at_size(icon, 32))
+ image.set_from_pixbuf(get_pixbuf_at_size(icon, Gtk.IconSize.DIALOG))
else:
- image.set_from_stock(icon, Gtk.IconSize.DIALOG)
+ image.set_from_icon_name(icon, Gtk.IconSize.DIALOG)
image.set_alignment(0.5, 0.0)
hbox.pack_start(image, False, False, 0)
vbox = Gtk.VBox(spacing=5)
diff --git a/deluge/ui/gtk3/files_tab.py b/deluge/ui/gtk3/files_tab.py
index 40adf62c4..216e5a7c1 100644
--- a/deluge/ui/gtk3/files_tab.py
+++ b/deluge/ui/gtk3/files_tab.py
@@ -13,7 +13,7 @@ import logging
import os.path
import six.moves.cPickle as pickle
-from gi.repository import Gtk
+from gi.repository import Gio, Gtk
from gi.repository.Gdk import DragAction, ModifierType, keyval_name
from gi.repository.GObject import TYPE_UINT64
@@ -34,12 +34,14 @@ from .torrentview_data_funcs import cell_data_size
log = logging.getLogger(__name__)
CELL_PRIORITY_ICONS = {
- 'Ignore': Gtk.STOCK_NO,
- 'Low': Gtk.STOCK_GO_DOWN,
- 'Normal': Gtk.STOCK_OK,
- 'High': Gtk.STOCK_GO_UP,
+ 'Ignore': 'action-unavailable-symbolic',
+ 'Low': 'go-down-symbolic',
+ 'Normal': 'go-next-symbolic',
+ 'High': 'go-up-symbolic',
}
+G_ICON_DIRECTORY = Gio.content_type_get_icon('inode/directory')
+
def cell_priority(column, cell, model, row, data):
if model.get_value(row, 5) == -1:
@@ -53,10 +55,10 @@ def cell_priority(column, cell, model, row, data):
def cell_priority_icon(column, cell, model, row, data):
if model.get_value(row, 5) == -1:
# This is a folder, so lets just set it blank for now
- cell.set_property('stock-id', None)
+ cell.set_property('icon-name', None)
return
priority = model.get_value(row, data)
- cell.set_property('stock-id', CELL_PRIORITY_ICONS[FILE_PRIORITY[priority]])
+ cell.set_property('icon-name', CELL_PRIORITY_ICONS[FILE_PRIORITY[priority]])
def cell_filename(column, cell, model, row, data):
@@ -79,7 +81,7 @@ class FilesTab(Tab):
self.listview = self.main_builder.get_object('files_listview')
# filename, size, progress string, progress value, priority, file index, icon id
- self.treestore = Gtk.TreeStore(str, TYPE_UINT64, str, float, int, int, str)
+ self.treestore = Gtk.TreeStore(str, TYPE_UINT64, str, float, int, int, Gio.Icon)
self.treestore.set_sort_column_id(0, Gtk.SortType.ASCENDING)
# We need to store the row that's being edited to prevent updating it until
@@ -91,7 +93,7 @@ class FilesTab(Tab):
column = Gtk.TreeViewColumn(self.filename_column_name)
render = Gtk.CellRendererPixbuf()
column.pack_start(render, False)
- column.add_attribute(render, 'stock-id', 6)
+ column.add_attribute(render, 'gicon', 6)
render = Gtk.CellRendererText()
render.set_property('editable', True)
render.connect('edited', self._on_filename_edited)
@@ -123,6 +125,7 @@ class FilesTab(Tab):
# Progress column
column = Gtk.TreeViewColumn(_('Progress'))
render = Gtk.CellRendererProgress()
+ render.set_padding(0, 1)
column.pack_start(render, True)
column.set_cell_data_func(render, cell_progress, (2, 3))
column.set_sort_column_id(3)
@@ -361,15 +364,19 @@ class FilesTab(Tab):
for key, value in split_files.items():
if key.endswith('/'):
chunk_iter = self.treestore.append(
- parent_iter, [key, 0, '', 0, 0, -1, Gtk.STOCK_DIRECTORY]
+ parent_iter, [key, 0, '', 0, 0, -1, G_ICON_DIRECTORY]
)
chunk_size = self.add_files(chunk_iter, value)
self.treestore.set(chunk_iter, 1, chunk_size)
chunk_size_total += chunk_size
else:
+ mime_type, uncertain = Gio.content_type_guess(key, None)
+ if not uncertain and mime_type:
+ mime_icon = Gio.content_type_get_icon(mime_type)
+ else:
+ mime_icon = Gio.content_type_get_icon('text/plain')
self.treestore.append(
- parent_iter,
- [key, value[1]['size'], '', 0, 0, value[0], Gtk.STOCK_FILE],
+ parent_iter, [key, value[1]['size'], '', 0, 0, value[0], mime_icon]
)
chunk_size_total += value[1]['size']
return chunk_size_total
@@ -653,15 +660,7 @@ class FilesTab(Tab):
p_itr = self.get_iter_at_path('/'.join(parent_path[:i]) + '/')
p_itr = self.treestore.append(
p_itr,
- [
- parent_path[i] + '/',
- 0,
- '',
- 0,
- 0,
- -1,
- Gtk.STOCK_DIRECTORY,
- ],
+ [parent_path[i] + '/', 0, '', 0, 0, -1, G_ICON_DIRECTORY],
)
p_itr = self.get_iter_at_path('/'.join(parent_path) + '/')
old_name_itr = self.get_iter_at_path(old_name)
@@ -681,7 +680,7 @@ class FilesTab(Tab):
parent_iter = None
for f in new_folders:
parent_iter = self.treestore.append(
- parent_iter, [f + '/', 0, '', 0, 0, -1, Gtk.STOCK_DIRECTORY]
+ parent_iter, [f + '/', 0, '', 0, 0, -1, G_ICON_DIRECTORY]
)
child = self.get_iter_at_path(old_name)
self.treestore.append(
@@ -790,7 +789,7 @@ class FilesTab(Tab):
if new_split:
for ns in new_split[:-1]:
parent = self.treestore.append(
- parent, [ns + '/', 0, '', 0, 0, -1, Gtk.STOCK_DIRECTORY]
+ parent, [ns + '/', 0, '', 0, 0, -1, G_ICON_DIRECTORY]
)
self.treestore[old_folder_iter][0] = new_split[-1] + '/'
diff --git a/deluge/ui/gtk3/glade/add_torrent_dialog.infohash.ui b/deluge/ui/gtk3/glade/add_torrent_dialog.infohash.ui
index 2663b08a9..2391bff0b 100644
--- a/deluge/ui/gtk3/glade/add_torrent_dialog.infohash.ui
+++ b/deluge/ui/gtk3/glade/add_torrent_dialog.infohash.ui
@@ -78,7 +78,7 @@
False
diff --git a/deluge/ui/gtk3/glade/add_torrent_dialog.ui b/deluge/ui/gtk3/glade/add_torrent_dialog.ui
index 66ce8c16b..c401a85f4 100644
--- a/deluge/ui/gtk3/glade/add_torrent_dialog.ui
+++ b/deluge/ui/gtk3/glade/add_torrent_dialog.ui
@@ -145,7 +145,7 @@
@@ -191,7 +191,7 @@
@@ -237,7 +237,7 @@
@@ -283,7 +283,7 @@
False
@@ -425,7 +425,7 @@
True
@@ -878,7 +878,8 @@ used sparingly.
False
@@ -929,7 +930,7 @@ used sparingly.
False
@@ -982,7 +983,7 @@ used sparingly.
True
diff --git a/deluge/ui/gtk3/glade/add_torrent_dialog.url.ui b/deluge/ui/gtk3/glade/add_torrent_dialog.url.ui
index 55139d8eb..7c7cfbbd6 100644
--- a/deluge/ui/gtk3/glade/add_torrent_dialog.url.ui
+++ b/deluge/ui/gtk3/glade/add_torrent_dialog.url.ui
@@ -78,7 +78,7 @@
False
diff --git a/deluge/ui/gtk3/glade/main_window.tabs.menu_file.ui b/deluge/ui/gtk3/glade/main_window.tabs.menu_file.ui
index 64e6d8bbb..e4534e5be 100644
--- a/deluge/ui/gtk3/glade/main_window.tabs.menu_file.ui
+++ b/deluge/ui/gtk3/glade/main_window.tabs.menu_file.ui
@@ -5,53 +5,65 @@
+
+
@@ -139,11 +168,12 @@
@@ -164,14 +194,15 @@
False
@@ -180,9 +211,10 @@
True
False
True
+ connection-image
False
-
+
@@ -265,8 +297,8 @@
False
_Find ...
True
-
+
@@ -345,8 +377,8 @@
Frequently Asked Questions
True
False
-
+
@@ -356,6 +388,7 @@
False
True
False
+ True
@@ -367,11 +400,12 @@
@@ -391,6 +425,7 @@
@@ -431,11 +465,10 @@
False
Filter torrents by name.
This will filter torrents for the current selection on the sidebar.
- _Filter
- True
- gtk-find
-
+ Filter
+ system-search-symbolic
+
False
@@ -459,8 +492,7 @@ This will filter torrents for the current selection on the sidebar.
True
Pause the selected torrents
Pause
- True
- gtk-media-pause
+ media-playback-pause-symbolic
@@ -476,7 +508,7 @@ This will filter torrents for the current selection on the sidebar.
True
Resume the selected torrents
Resume
- gtk-media-play
+ media-playback-start-symbolic
@@ -501,7 +533,7 @@ This will filter torrents for the current selection on the sidebar.
True
Queue Torrent Up
Queue Up
- gtk-go-up
+ go-up-symbolic
@@ -517,7 +549,7 @@ This will filter torrents for the current selection on the sidebar.
True
Queue Torrent Down
Queue Down
- gtk-go-down
+ go-down-symbolic
@@ -541,8 +573,7 @@ This will filter torrents for the current selection on the sidebar.
True
Preferences
Preferences
- True
- gtk-preferences
+ preferences-system-symbolic
@@ -557,7 +588,7 @@ This will filter torrents for the current selection on the sidebar.
True
Connection Manager
Connection Manager
- gtk-network
+ preferences-system-network-symbolic
@@ -619,7 +650,7 @@ This will filter torrents for the current selection on the sidebar.
True
False
gtk-close
- 2
+ 2
diff --git a/deluge/ui/gtk3/glade/path_combo_chooser.ui b/deluge/ui/gtk3/glade/path_combo_chooser.ui
index 27acc934d..f79685d26 100644
--- a/deluge/ui/gtk3/glade/path_combo_chooser.ui
+++ b/deluge/ui/gtk3/glade/path_combo_chooser.ui
@@ -539,7 +539,7 @@
True
False
- gtk-open
+ folder-open-symbolic
False
@@ -968,7 +968,7 @@
True
False
- gtk-properties
+ document-properties-symbolic
diff --git a/deluge/ui/gtk3/glade/torrent_menu.options.ui b/deluge/ui/gtk3/glade/torrent_menu.options.ui
index abb9c3af1..df34445d5 100644
--- a/deluge/ui/gtk3/glade/torrent_menu.options.ui
+++ b/deluge/ui/gtk3/glade/torrent_menu.options.ui
@@ -5,23 +5,23 @@
True
False
- gtk-missing-image
+ deluge-downloading
True
False
- gtk-network
+ network-transmit-receive-symbolic
1
True
False
- gtk-missing-image
+ deluge-seeding
True
False
- gtk-sort-ascending
+ view-sort-descending-symbolic
1