diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-09-24 19:32:40 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-09-24 19:32:40 +0300 |
commit | 030b535d831a8abf4a73d4e36f3f63adb07fff03 (patch) | |
tree | 774aa53298daf242be1501924c9ee0610d691553 /src/app.c | |
parent | 1480fff5e633d9a2d0c8cb1efb2fd517e2c25a99 (diff) |
SidebarWidget: Creating folders inside clicked folder
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -2766,15 +2766,21 @@ iBool handleCommand_App(const char *cmd) { | |||
2766 | return iTrue; | 2766 | return iTrue; |
2767 | } | 2767 | } |
2768 | else if (equal_Command(cmd, "bookmarks.addfolder")) { | 2768 | else if (equal_Command(cmd, "bookmarks.addfolder")) { |
2769 | const int parentId = argLabel_Command(cmd, "parent"); | ||
2769 | if (suffixPtr_Command(cmd, "value")) { | 2770 | if (suffixPtr_Command(cmd, "value")) { |
2770 | add_Bookmarks(d->bookmarks, NULL, collect_String(suffix_Command(cmd, "value")), NULL, 0); | 2771 | uint32_t id = add_Bookmarks(d->bookmarks, NULL, |
2772 | collect_String(suffix_Command(cmd, "value")), NULL, 0); | ||
2773 | if (parentId) { | ||
2774 | get_Bookmarks(d->bookmarks, id)->parentId = parentId; | ||
2775 | } | ||
2771 | postCommand_App("bookmarks.changed"); | 2776 | postCommand_App("bookmarks.changed"); |
2772 | } | 2777 | } |
2773 | else { | 2778 | else { |
2774 | iWidget *dlg = makeValueInput_Widget(get_Root()->widget, | 2779 | iWidget *dlg = makeValueInput_Widget( |
2775 | collectNewCStr_String(cstr_Lang("dlg.addfolder.defaulttitle")), | 2780 | get_Root()->widget, collectNewCStr_String(cstr_Lang("dlg.addfolder.defaulttitle")), |
2776 | uiHeading_ColorEscape "${heading.addfolder}", "${dlg.addfolder.prompt}", | 2781 | uiHeading_ColorEscape "${heading.addfolder}", "${dlg.addfolder.prompt}", |
2777 | uiTextAction_ColorEscape "${dlg.addfolder}", "bookmarks.addfolder"); | 2782 | uiTextAction_ColorEscape "${dlg.addfolder}", |
2783 | format_CStr("bookmarks.addfolder parent:%d", parentId)); | ||
2778 | setSelectAllOnFocus_InputWidget(findChild_Widget(dlg, "input"), iTrue); | 2784 | setSelectAllOnFocus_InputWidget(findChild_Widget(dlg, "input"), iTrue); |
2779 | } | 2785 | } |
2780 | return iTrue; | 2786 | return iTrue; |