diff options
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -2109,6 +2109,7 @@ iBool handleCommand_App(const char *cmd) { | |||
2109 | iBool wasCurrent = (doc == (iWidget *) document_App()); | 2109 | iBool wasCurrent = (doc == (iWidget *) document_App()); |
2110 | size_t index = tabPageIndex_Widget(tabs, doc); | 2110 | size_t index = tabPageIndex_Widget(tabs, doc); |
2111 | iBool wasClosed = iFalse; | 2111 | iBool wasClosed = iFalse; |
2112 | postCommand_App("document.openurls.changed"); | ||
2112 | if (argLabel_Command(cmd, "toright")) { | 2113 | if (argLabel_Command(cmd, "toright")) { |
2113 | while (tabCount_Widget(tabs) > index + 1) { | 2114 | while (tabCount_Widget(tabs) > index + 1) { |
2114 | destroy_Widget(removeTabPage_Widget(tabs, index + 1)); | 2115 | destroy_Widget(removeTabPage_Widget(tabs, index + 1)); |
@@ -2314,6 +2315,11 @@ iBool handleCommand_App(const char *cmd) { | |||
2314 | save_Visited(d->visited, dataDir_App_()); | 2315 | save_Visited(d->visited, dataDir_App_()); |
2315 | return iFalse; | 2316 | return iFalse; |
2316 | } | 2317 | } |
2318 | else if (equal_Command(cmd, "document.changed")) { | ||
2319 | /* Set of open tabs has changed. */ | ||
2320 | postCommand_App("document.openurls.changed"); | ||
2321 | return iFalse; | ||
2322 | } | ||
2317 | else if (equal_Command(cmd, "ident.new")) { | 2323 | else if (equal_Command(cmd, "ident.new")) { |
2318 | iWidget *dlg = makeIdentityCreation_Widget(); | 2324 | iWidget *dlg = makeIdentityCreation_Widget(); |
2319 | setFocus_Widget(findChild_Widget(dlg, "ident.until")); | 2325 | setFocus_Widget(findChild_Widget(dlg, "ident.until")); |
@@ -2472,3 +2478,13 @@ iObjectList *listDocuments_App(const iRoot *rootOrNull) { | |||
2472 | } | 2478 | } |
2473 | return docs; | 2479 | return docs; |
2474 | } | 2480 | } |
2481 | |||
2482 | iStringSet *listOpenURLs_App(void) { | ||
2483 | iStringSet *set = new_StringSet(); | ||
2484 | iObjectList *docs = listDocuments_App(NULL); | ||
2485 | iConstForEach(ObjectList, i, docs) { | ||
2486 | insert_StringSet(set, withSpacesEncoded_String(url_DocumentWidget(i.object))); | ||
2487 | } | ||
2488 | iRelease(docs); | ||
2489 | return set; | ||
2490 | } | ||