diff options
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -2033,6 +2033,7 @@ static void resetFonts_App_(iApp *d) { | |||
2033 | iBool handleCommand_App(const char *cmd) { | 2033 | iBool handleCommand_App(const char *cmd) { |
2034 | iApp *d = &app_; | 2034 | iApp *d = &app_; |
2035 | const iBool isFrozen = !d->window || d->window->isDrawFrozen; | 2035 | const iBool isFrozen = !d->window || d->window->isDrawFrozen; |
2036 | /* TODO: Maybe break this up a little bit? There's a very long list of ifs here. */ | ||
2036 | if (equal_Command(cmd, "config.error")) { | 2037 | if (equal_Command(cmd, "config.error")) { |
2037 | makeSimpleMessage_Widget(uiTextCaution_ColorEscape "CONFIG ERROR", | 2038 | makeSimpleMessage_Widget(uiTextCaution_ColorEscape "CONFIG ERROR", |
2038 | format_CStr("Error in config file: %s\n" | 2039 | format_CStr("Error in config file: %s\n" |
@@ -2764,6 +2765,25 @@ iBool handleCommand_App(const char *cmd) { | |||
2764 | makeFeedSettings_Widget(findUrl_Bookmarks(d->bookmarks, url)); | 2765 | makeFeedSettings_Widget(findUrl_Bookmarks(d->bookmarks, url)); |
2765 | return iTrue; | 2766 | return iTrue; |
2766 | } | 2767 | } |
2768 | else if (equal_Command(cmd, "bookmarks.addfolder")) { | ||
2769 | if (suffixPtr_Command(cmd, "value")) { | ||
2770 | add_Bookmarks(d->bookmarks, NULL, collect_String(suffix_Command(cmd, "value")), NULL, 0); | ||
2771 | postCommand_App("bookmarks.changed"); | ||
2772 | } | ||
2773 | else { | ||
2774 | iWidget *dlg = makeValueInput_Widget(get_Root()->widget, | ||
2775 | collectNewCStr_String(cstr_Lang("dlg.addfolder.defaulttitle")), | ||
2776 | uiHeading_ColorEscape "${heading.addfolder}", "${dlg.addfolder.prompt}", | ||
2777 | uiTextAction_ColorEscape "${dlg.addfolder}", "bookmarks.addfolder"); | ||
2778 | setSelectAllOnFocus_InputWidget(findChild_Widget(dlg, "input"), iTrue); | ||
2779 | } | ||
2780 | return iTrue; | ||
2781 | } | ||
2782 | else if (equal_Command(cmd, "bookmarks.sort")) { | ||
2783 | sort_Bookmarks(d->bookmarks, arg_Command(cmd), cmpTitleAscending_Bookmark); | ||
2784 | postCommand_App("bookmarks.changed"); | ||
2785 | return iTrue; | ||
2786 | } | ||
2767 | else if (equal_Command(cmd, "bookmarks.reload.remote")) { | 2787 | else if (equal_Command(cmd, "bookmarks.reload.remote")) { |
2768 | fetchRemote_Bookmarks(bookmarks_App()); | 2788 | fetchRemote_Bookmarks(bookmarks_App()); |
2769 | return iTrue; | 2789 | return iTrue; |