diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-12-04 21:39:16 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-12-04 21:39:16 +0200 |
commit | 82e9eed2f9362313f5e8e46c6fc7088500a79c1d (patch) | |
tree | dc1ef082ae57aa8ae0069bbf525e7965fbd66f56 /src/ui/sidebarwidget.c | |
parent | 9a4032bbba8846d1f5c92b4c39743dc6884f06ec (diff) |
SidebarWidget: Confirmation dialogs vs. which sidebar
Identify the owner of the dialog using the normal widget "ptr:" argument.
Diffstat (limited to 'src/ui/sidebarwidget.c')
-rw-r--r-- | src/ui/sidebarwidget.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 0c17995e..e6144744 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c | |||
@@ -826,7 +826,9 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
826 | cstr_String(&feedBookmark->title)), | 826 | cstr_String(&feedBookmark->title)), |
827 | (const char *[]){ "Cancel", | 827 | (const char *[]){ "Cancel", |
828 | uiTextCaution_ColorEscape "Unsubscribe" }, | 828 | uiTextCaution_ColorEscape "Unsubscribe" }, |
829 | (const char *[]){ "cancel", "feed.entry.unsubscribe arg:1" }, /* FIXME: which sidebar */ | 829 | (const char *[]){ |
830 | "cancel", | ||
831 | format_CStr("!feed.entry.unsubscribe arg:1 ptr:%p", d) }, | ||
830 | 2); | 832 | 2); |
831 | } | 833 | } |
832 | return iTrue; | 834 | return iTrue; |
@@ -895,21 +897,21 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
895 | else if (isCommand_Widget(w, ev, "ident.delete")) { | 897 | else if (isCommand_Widget(w, ev, "ident.delete")) { |
896 | iSidebarItem *item = d->contextItem; | 898 | iSidebarItem *item = d->contextItem; |
897 | if (argLabel_Command(cmd, "confirm")) { | 899 | if (argLabel_Command(cmd, "confirm")) { |
898 | makeQuestion_Widget(uiTextCaution_ColorEscape "DELETE IDENTITY", | 900 | makeQuestion_Widget( |
899 | format_CStr("Do you really want to delete the identity\n" | 901 | uiTextCaution_ColorEscape "DELETE IDENTITY", |
900 | uiTextAction_ColorEscape "%s\n" | 902 | format_CStr( |
901 | uiText_ColorEscape | 903 | "Do you really want to delete the identity\n" uiTextAction_ColorEscape |
902 | "including its certificate and private key files?", | 904 | "%s\n" uiText_ColorEscape |
903 | cstr_String(&item->label)), | 905 | "including its certificate and private key files?", |
904 | (const char *[]){ "Cancel", | 906 | cstr_String(&item->label)), |
905 | uiTextCaution_ColorEscape | 907 | (const char *[]){ "Cancel", |
906 | "Delete Identity and Files" }, | 908 | uiTextCaution_ColorEscape "Delete Identity and Files" }, |
907 | (const char *[]){ "cancel", "ident.delete confirm:0" }, /* FIXME: which sidebar */ | 909 | (const char *[]){ "cancel", format_CStr("!ident.delete confirm:0 ptr:%p", d) }, |
908 | 2); | 910 | 2); |
909 | return iTrue; | 911 | return iTrue; |
910 | } | 912 | } |
911 | deleteIdentity_GmCerts(certs_App(), hoverIdentity_SidebarWidget_(d)); | 913 | deleteIdentity_GmCerts(certs_App(), hoverIdentity_SidebarWidget_(d)); |
912 | updateItems_SidebarWidget_(d); | 914 | postCommand_App("idents.changed"); |
913 | return iTrue; | 915 | return iTrue; |
914 | } | 916 | } |
915 | else if (isCommand_Widget(w, ev, "history.delete")) { | 917 | else if (isCommand_Widget(w, ev, "history.delete")) { |