Followup of #937 to provide an error message in the UI when opening any URL in the browser on Windows failed. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1079
-- Commit Summary --
* Win32: Add UI error message if an URL could not be opened
-- File Changes --
M src/win32.c (2)
-- Patch Links --
https://github.com/geany/geany/pull/1079.patch https://github.com/geany/geany/pull/1079.diff
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1079
@@ -799,7 +799,7 @@ void win32_open_browser(const gchar *uri) if (ret <= 32) { gchar *err = g_win32_error_message(GetLastError());
/* TODO add a GUI warning that opening an URI failed */
ui_set_statusbar(TRUE, _("Opening URI \"%s\" failed: %s"), uri, err);
wouldn't we generally write *Failed to open URI "%s": %s*?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1079/files/e62c06fa432c546f50b2109a7f253...
If a statusbar info is enough, sure.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1079#issuecomment-227027406
If a statusbar info is enough, sure.
Sure, if we don't want anyone to notice it :wink:
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1079#issuecomment-227027508
@eht16 pushed 1 commit.
82ace1f Reword error message
--- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/1079/files/e62c06fa432c546f50b2109a7f253...
@@ -799,7 +799,7 @@ void win32_open_browser(const gchar *uri) if (ret <= 32) { gchar *err = g_win32_error_message(GetLastError());
/* TODO add a GUI warning that opening an URI failed */
ui_set_statusbar(TRUE, _("Opening URI \"%s\" failed: %s"), uri, err);
True. Fixed.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1079/files/e62c06fa432c546f50b2109a7f253...
Really? I thought a statusbar info and an item in the Status messages window would be enough. Do you suggest adding a message box?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1079#issuecomment-227027733
Should be ok as is.
I'm not suggesting it as part of this PR, but we should work out a protocol for making more use of the infobar for this sort of thing.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1079#issuecomment-227027983
I think the infobar isn't appropriate here because we cannot say where opening an URI was triggered from. It might be the About dialog, a Help menu item or another place which is not related to the current document.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1079#issuecomment-227028188
LGBI
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1079#issuecomment-227028528
@eht16 thats what I meant by deciding a protocol, low level routines like this one should pass the information back to the caller so they can display it in a manner appropriate to the operation being performed.
Since the low level routines don't know where they are called from, they can't handle it themselves and one size does not fit all.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1079#issuecomment-227028594
Got it, I'd wish we could just throw an exception and catch it where appropriate. But we are in C :(.
Anyway, I'll squash the two commits and merge this PR tomorrow.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1079#issuecomment-227028853
I'd wish we could just throw an exception and catch it where appropriate
We could use GLib errors and bubble them up and handle them where appropriate, but that's rather a whole other discussion :)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1079#issuecomment-227031133
Got it, I'd wish we could just throw an exception and catch it where appropriate. But we are in C :(.
Not like C can't do anything like it, nor than an uncaught exception will do wonder :)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1079#issuecomment-227031258
Merged #1079.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1079#event-698230320
github-comments@lists.geany.org