Lagrange [work/v1.17]

Action to mark all links on page as visited

=> d4743805ebf8f57c3879362b2302ad1251acd1fb

diff --git a/po/en.po b/po/en.po
index ce5ec830..de87c77a 100644
--- a/po/en.po
+++ b/po/en.po
@@ -464,6 +464,9 @@ msgstr "Import All Links on Page…"
 msgid "menu.page.import"
 msgstr "Import Links as Bookmarks…"
 
+msgid "menu.page.visitlinks"
+msgstr "Mark All Links as Visited"
+
 msgid "menu.page.translate"
 msgstr "Translate…"
 
diff --git a/res/lang/cs.bin b/res/lang/cs.bin
index 01bd8529..3a34ad9a 100644
Binary files a/res/lang/cs.bin and b/res/lang/cs.bin differ
diff --git a/res/lang/de.bin b/res/lang/de.bin
index fe140b86..35f8fa9a 100644
Binary files a/res/lang/de.bin and b/res/lang/de.bin differ
diff --git a/res/lang/en.bin b/res/lang/en.bin
index 09229bfe..26cef2f2 100644
Binary files a/res/lang/en.bin and b/res/lang/en.bin differ
diff --git a/res/lang/eo.bin b/res/lang/eo.bin
index 0a5dd9e8..68778112 100644
Binary files a/res/lang/eo.bin and b/res/lang/eo.bin differ
diff --git a/res/lang/es.bin b/res/lang/es.bin
index 8ed2fa37..523cdaa6 100644
Binary files a/res/lang/es.bin and b/res/lang/es.bin differ
diff --git a/res/lang/es_MX.bin b/res/lang/es_MX.bin
index a6288c90..f5eb481b 100644
Binary files a/res/lang/es_MX.bin and b/res/lang/es_MX.bin differ
diff --git a/res/lang/eu.bin b/res/lang/eu.bin
index 4472a069..53bb3d67 100644
Binary files a/res/lang/eu.bin and b/res/lang/eu.bin differ
diff --git a/res/lang/fi.bin b/res/lang/fi.bin
index c0d480c8..9195ebad 100644
Binary files a/res/lang/fi.bin and b/res/lang/fi.bin differ
diff --git a/res/lang/fr.bin b/res/lang/fr.bin
index 8505078e..e190f196 100644
Binary files a/res/lang/fr.bin and b/res/lang/fr.bin differ
diff --git a/res/lang/gl.bin b/res/lang/gl.bin
index 03b09939..c692dcd8 100644
Binary files a/res/lang/gl.bin and b/res/lang/gl.bin differ
diff --git a/res/lang/hu.bin b/res/lang/hu.bin
index f19f2e96..b4549e1a 100644
Binary files a/res/lang/hu.bin and b/res/lang/hu.bin differ
diff --git a/res/lang/ia.bin b/res/lang/ia.bin
index b23b441a..bb5f5ede 100644
Binary files a/res/lang/ia.bin and b/res/lang/ia.bin differ
diff --git a/res/lang/ie.bin b/res/lang/ie.bin
index 57439c4c..5d0c9b41 100644
Binary files a/res/lang/ie.bin and b/res/lang/ie.bin differ
diff --git a/res/lang/isv.bin b/res/lang/isv.bin
index e06b83c2..23c238a4 100644
Binary files a/res/lang/isv.bin and b/res/lang/isv.bin differ
diff --git a/res/lang/it.bin b/res/lang/it.bin
index 9894f60c..c3911467 100644
Binary files a/res/lang/it.bin and b/res/lang/it.bin differ
diff --git a/res/lang/ja.bin b/res/lang/ja.bin
index b74b54d8..da20f681 100644
Binary files a/res/lang/ja.bin and b/res/lang/ja.bin differ
diff --git a/res/lang/nl.bin b/res/lang/nl.bin
index d05f2ac8..4a3024f1 100644
Binary files a/res/lang/nl.bin and b/res/lang/nl.bin differ
diff --git a/res/lang/pl.bin b/res/lang/pl.bin
index 03cc3f7a..6d0587b7 100644
Binary files a/res/lang/pl.bin and b/res/lang/pl.bin differ
diff --git a/res/lang/ru.bin b/res/lang/ru.bin
index 2b719706..a1f9c4d5 100644
Binary files a/res/lang/ru.bin and b/res/lang/ru.bin differ
diff --git a/res/lang/sk.bin b/res/lang/sk.bin
index d0dc7df9..2e0e416a 100644
Binary files a/res/lang/sk.bin and b/res/lang/sk.bin differ
diff --git a/res/lang/sr.bin b/res/lang/sr.bin
index edc6e4a9..d8e5b943 100644
Binary files a/res/lang/sr.bin and b/res/lang/sr.bin differ
diff --git a/res/lang/tok.bin b/res/lang/tok.bin
index 3f2b05f4..be1e628c 100644
Binary files a/res/lang/tok.bin and b/res/lang/tok.bin differ
diff --git a/res/lang/tr.bin b/res/lang/tr.bin
index 0db87aab..2f61211a 100644
Binary files a/res/lang/tr.bin and b/res/lang/tr.bin differ
diff --git a/res/lang/uk.bin b/res/lang/uk.bin
index 15c0c180..f2165a0e 100644
Binary files a/res/lang/uk.bin and b/res/lang/uk.bin differ
diff --git a/res/lang/zh_Hans.bin b/res/lang/zh_Hans.bin
index 4c3ae410..6fbc626d 100644
Binary files a/res/lang/zh_Hans.bin and b/res/lang/zh_Hans.bin differ
diff --git a/res/lang/zh_Hant.bin b/res/lang/zh_Hant.bin
index 607a8c98..75a0295d 100644
Binary files a/res/lang/zh_Hant.bin and b/res/lang/zh_Hant.bin differ
diff --git a/src/app.c b/src/app.c
index f84d0acc..ca6785c9 100644
--- a/src/app.c
+++ b/src/app.c
@@ -174,7 +174,8 @@ struct Impl_App {
     iStringList *launchCommands;
     iBool        isFinishedLaunching;
     iTime        lastDropTime; /* for detecting drops of multiple items */
-    int          autoReloadTimer;
+    uint32_t     lastVisitedSaveTime;
+    int          autoReloadTimer; /* TODO: only start this when tabs are autoreloading */
     iPeriodic    periodic;
     int          warmupFrames; /* forced refresh just after resuming from background; FIXME: shouldn't be needed */
 #if defined (LAGRANGE_ENABLE_IDLE_SLEEP)
@@ -1317,6 +1318,7 @@ static void init_App_(iApp *d, int argc, char **argv) {
     d->certs     = new_GmCerts(dataDir_App_());
     d->visited   = new_Visited();
     d->bookmarks = new_Bookmarks();
+    d->lastVisitedSaveTime = 0;
     /* Dumping requested pages. */
     if (doDump) {
         const iGmIdentity *ident = NULL;
@@ -4017,7 +4019,13 @@ static iBool handleNonWindowRelatedCommand_App_(iApp *d, const char *cmd) {
         return iTrue;
     }
     else if (equal_Command(cmd, "visited.changed")) {
-        save_Visited(d->visited, dataDir_App_());
+        /* The visited file can grow large, so don't keep rewriting it after every navigation. */
+        const uint32_t now = SDL_GetTicks();
+        unsigned seconds = (now - d->lastVisitedSaveTime) / 1000;
+        if (seconds > 60) {
+            d->lastVisitedSaveTime = now;
+            save_Visited(d->visited, dataDir_App_());
+        }
         return iFalse;
     }
     else if (equal_Command(cmd, "idents.changed")) {
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 42711739..2949cc81 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -2916,6 +2916,16 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
         updateWindowTitle_DocumentWidget_(d);
         return iFalse;
     }
+    else if (equal_Command(cmd, "document.visitlinks") && d == document_App()) {
+        const iGmDocument *doc = d->view->doc;
+        for (size_t linkId = 1; linkId <= numLinks_GmDocument(doc); linkId++) {
+            const iString *url = linkUrl_GmDocument(doc, linkId);
+            visitUrl_Visited(visited_App(), url, transient_VisitedUrlFlag);
+        }
+        updateVisitedLinks_GmDocument(d->view->doc);
+        invalidate_DocumentWidget_(d);
+        return iTrue;
+    }
     else if (equal_Command(cmd, "document.select") && d == document_App()) {
         /* Touch selection mode. */
         if (!arg_Command(cmd)) {
diff --git a/src/ui/root.c b/src/ui/root.c
index eb7083fd..9c789503 100644
--- a/src/ui/root.c
+++ b/src/ui/root.c
@@ -2155,8 +2155,9 @@ void createUserInterface_Root(iRoot *d) {
            { upload_Icon " ${menu.page.upload}", 0, 0, "document.upload" },
            { edit_Icon " ${menu.page.upload.edit}", 0, 0, "document.upload copy:1" },
            { book_Icon " ${menu.page.import}", 0, 0, "bookmark.links confirm:1" },
+           { "${menu.page.visitlinks}", 0, 0, "document.visitlinks" },
            { timer_Icon " ${menu.autoreload}", 0, 0, "document.autoreload.menu" }
-        }, 5);
+        }, 6);
         setId_Widget(tabsMenu, "doctabs.menu");
         setId_Widget(barMenu, "barmenu");
         setId_Widget(toolsMenu, "toolsmenu");
Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.17/cdiff/d4743805ebf8f57c3879362b2302ad1251acd1fb
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
94.598449 milliseconds
Gemini-to-HTML Time
0.291221 milliseconds

This content has been proxied by September (3851b).