Skip to content

Commit e934ed5

Browse files
fix notification strings
1 parent e72f12f commit e934ed5

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

data/be.alexandervanhee.gradia.metainfo.xml.in.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
<li>Redesigned the Annotation section in the sidebar.</li>
4848
<li>Added options to automatically copy or overwrite screenshot files on quit.</li>
4949
<li>Improved the design of the provider picker screens.</li>
50+
<li>Added constrained drawing via shift for tools like square and arrow..</li>
5051
</ul>
5152
</description>
5253
</release>

gradia/ui/image_exporters.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,20 @@
3131

3232
class SystemNotifier:
3333
@staticmethod
34-
def send_notification(title: str, body: str = "", icon: str = "edit-copy-symbolic", folder_path: str = None):
34+
def send_notification(
35+
title: str,
36+
body: str = "",
37+
icon: str = "edit-copy-symbolic",
38+
folder_path: str = None
39+
):
3540
app = Gio.Application.get_default()
3641
notification = Gio.Notification.new(title)
3742
notification.set_icon(Gio.ThemedIcon(name=icon))
3843
if body:
3944
notification.set_body(body)
40-
app.send_notification(None, notification)
45+
46+
notification_id = "screenshot-notification"
47+
app.send_notification(notification_id, notification)
4148

4249
class BaseImageExporter:
4350
"""Base class for image export handlers"""
@@ -171,9 +178,9 @@ def _on_dialog_response(self, dialog, response_id, suggested_format):
171178
try:
172179
self._save_image(save_path, format_type)
173180
self.window.show_close_confirmation = False
174-
self.window._show_notification(_("Export Failed"))
175-
except Exception as e:
176181
self.window._show_notification(_("Image saved successfully"))
182+
except Exception as e:
183+
self.window._show_notification(_("Export Failed"))
177184
logger.error(f"Failed to save image: {e}")
178185

179186
dialog.destroy()
@@ -428,16 +435,12 @@ def _finish_close_operation(self, results: dict, callback: callable):
428435

429436
save_folder = results.get('save_folder')
430437

431-
if saved and copied:
432-
message = _("Screenshot updated and copied to clipboard")
433-
elif saved:
434-
message = _("Screenshot updated")
435-
elif copied:
436-
message = _("Image copied to clipboard")
437-
else:
438-
message = None
439-
if message:
440-
SystemNotifier.send_notification(_("Close Operation Successful"), message, folder_path=save_folder)
438+
if copied:
439+
title = _("Image Copied")
440+
body = _("You can now paste it from the clipboard.")
441+
icon = "edit-copy-symbolic"
442+
443+
SystemNotifier.send_notification(title, body, icon, folder_path=save_folder)
441444
self.window.show_close_confirmation = False
442445

443446
if callback:

0 commit comments

Comments
 (0)