From 770b06f6755b7ac87d397b6ea823214b5d35f5d6 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 23 Apr 2021 23:30:55 +0300 Subject: File URLs support directories and ZIP archives One is now able to view directory and ZIP archive contents using file URLs. Directory contents are shown as a list of links, enabling previewing supported formats. A link to the parent directory is included at the top of the page. ZIP archives behave like directories, except they also recognize "index.gmi" and "index.gemini" files and display them instead of the regular directory index (when viewing a directory inside a ZIP archive). This enables archiving a Gemini capsule and browsing it as a ZIP archive. Added a preference to disable loading of index pages. --- src/app.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/app.c') diff --git a/src/app.c b/src/app.c index c6a80b2c..4abb63c6 100644 --- a/src/app.c +++ b/src/app.c @@ -234,6 +234,7 @@ static iString *serializePrefs_App_(const iApp *d) { appendFormat_String(str, "prefs.centershort.changed arg:%d\n", d->prefs.centerShortDocs); appendFormat_String(str, "prefs.collapsepreonload.changed arg:%d\n", d->prefs.collapsePreOnLoad); appendFormat_String(str, "prefs.hoverlink.changed arg:%d\n", d->prefs.hoverLink); + appendFormat_String(str, "prefs.archive.openindex.changed arg:%d\n", d->prefs.openArchiveIndexPages); appendFormat_String(str, "quoteicon.set arg:%d\n", d->prefs.quoteIcon ? 1 : 0); appendFormat_String(str, "theme.set arg:%d auto:1\n", d->prefs.theme); appendFormat_String(str, "accent.set arg:%d\n", d->prefs.accent); @@ -1766,6 +1767,10 @@ iBool handleCommand_App(const char *cmd) { postRefresh_App(); return iTrue; } + else if (equal_Command(cmd, "prefs.archive.openindex.changed")) { + d->prefs.openArchiveIndexPages = arg_Command(cmd) != 0; + return iTrue; + } else if (equal_Command(cmd, "saturation.set")) { d->prefs.saturation = (float) arg_Command(cmd) / 100.0f; postCommandf_App("theme.changed auto:1"); @@ -1954,6 +1959,7 @@ iBool handleCommand_App(const char *cmd) { setToggle_Widget(findChild_Widget(dlg, "prefs.smoothscroll"), d->prefs.smoothScrolling); setToggle_Widget(findChild_Widget(dlg, "prefs.imageloadscroll"), d->prefs.loadImageInsteadOfScrolling); setToggle_Widget(findChild_Widget(dlg, "prefs.hidetoolbarscroll"), d->prefs.hideToolbarOnScroll); + setToggle_Widget(findChild_Widget(dlg, "prefs.archive.openindex"), d->prefs.openArchiveIndexPages); setToggle_Widget(findChild_Widget(dlg, "prefs.ostheme"), d->prefs.useSystemTheme); setToggle_Widget(findChild_Widget(dlg, "prefs.customframe"), d->prefs.customFrame); updateDropdownSelection_(findChild_Widget(dlg, "prefs.uilang"), cstr_String(&d->prefs.uiLanguage)); -- cgit v1.2.3