Skip to content

Commit a28f194

Browse files
authored
Merge pull request #203 from oscfdezdz/deprecated
Remove deprecated STOCK constants
2 parents 47a02d7 + f858c38 commit a28f194

14 files changed

+98
-122
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
- Replace `_` by `-` in the action names to be compatible with GTK action names (@MightyCreak)
1717
- The About dialog is now transient for the main window (@oscfdezdz)
18+
- Remove deprecated STOCK constants and use more modern, symbolic icons (@oscfdezdz)
1819

1920
### Fixed
2021

data/diffuse.gresource.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<gresources>
3+
<gresource prefix="/io/github/mightycreak/Diffuse/icons/scalable/actions">
4+
<file preprocess="xml-stripblanks" alias="new-2way-merge-symbolic.svg">icons/hicolor/scalable/actions/new-2way-merge-symbolic.svg</file>
5+
<file preprocess="xml-stripblanks" alias="new-3way-merge-symbolic.svg">icons/hicolor/scalable/actions/new-3way-merge-symbolic.svg</file>
6+
<file preprocess="xml-stripblanks" alias="copy-selection-left-symbolic.svg">icons/hicolor/scalable/actions/copy-selection-left-symbolic.svg</file>
7+
<file preprocess="xml-stripblanks" alias="copy-selection-right-symbolic.svg">icons/hicolor/scalable/actions/copy-selection-right-symbolic.svg</file>
8+
<file preprocess="xml-stripblanks" alias="copy-left-into-selection-symbolic.svg">icons/hicolor/scalable/actions/copy-left-into-selection-symbolic.svg</file>
9+
<file preprocess="xml-stripblanks" alias="copy-right-into-selection-symbolic.svg">icons/hicolor/scalable/actions/copy-right-into-selection-symbolic.svg</file>
10+
</gresource>
11+
</gresources>
Lines changed: 2 additions & 0 deletions
Loading
Lines changed: 2 additions & 0 deletions
Loading
Lines changed: 2 additions & 0 deletions
Loading
Lines changed: 2 additions & 0 deletions
Loading
Lines changed: 2 additions & 0 deletions
Loading
Lines changed: 2 additions & 0 deletions
Loading

data/meson.build

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
2+
gnome = import('gnome')
3+
4+
gnome.compile_resources(meson.project_name(),
5+
meson.project_name() + '.gresource.xml',
6+
gresource_bundle: true,
7+
install: true,
8+
install_dir: pkgdatadir,
9+
)
210

311
if build_machine.system() == 'linux'
412
desktop_file = i18n.merge_file(

src/diffuse/dialogs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def _current_folder_changed_cb(widget):
7777

7878
def __init__(self, title, parent, prefs, action, accept, rev=False):
7979
Gtk.FileChooserDialog.__init__(self, title=title, transient_for=parent, action=action)
80-
self.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
80+
self.add_button(_('_Cancel'), Gtk.ResponseType.CANCEL)
8181
self.add_button(accept, Gtk.ResponseType.OK)
8282
self.prefs = prefs
8383
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0, border_width=5)
@@ -120,8 +120,8 @@ def get_filename(self) -> str:
120120
class NumericDialog(Gtk.Dialog):
121121
def __init__(self, parent, title, text, val, lower, upper, step=1, page=0):
122122
Gtk.Dialog.__init__(self, title=title, transient_for=parent, destroy_with_parent=True)
123-
self.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT)
124-
self.add_button(Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT)
123+
self.add_button(_('_Cancel'), Gtk.ResponseType.REJECT)
124+
self.add_button(_('_OK'), Gtk.ResponseType.ACCEPT)
125125

126126
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
127127
vbox.set_border_width(10)
@@ -164,8 +164,8 @@ def __init__(self, parent, pattern=None, history=None):
164164
title=_('Find...'),
165165
transient_for=parent,
166166
destroy_with_parent=True)
167-
self.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT)
168-
self.add_button(Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT)
167+
self.add_button(_('_Cancel'), Gtk.ResponseType.REJECT)
168+
self.add_button(_('_OK'), Gtk.ResponseType.ACCEPT)
169169

170170
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
171171
vbox.set_border_width(10)

0 commit comments

Comments
 (0)