summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-23 23:30:55 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-23 23:30:55 +0300
commit770b06f6755b7ac87d397b6ea823214b5d35f5d6 (patch)
tree48dea4069e3eda108e4bb5c92257d1298aa4721e /src/app.c
parentb0e0160ef5d8624d855d7226529e04c1b37ea05b (diff)
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.
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c6
1 files changed, 6 insertions, 0 deletions
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) {
234 appendFormat_String(str, "prefs.centershort.changed arg:%d\n", d->prefs.centerShortDocs); 234 appendFormat_String(str, "prefs.centershort.changed arg:%d\n", d->prefs.centerShortDocs);
235 appendFormat_String(str, "prefs.collapsepreonload.changed arg:%d\n", d->prefs.collapsePreOnLoad); 235 appendFormat_String(str, "prefs.collapsepreonload.changed arg:%d\n", d->prefs.collapsePreOnLoad);
236 appendFormat_String(str, "prefs.hoverlink.changed arg:%d\n", d->prefs.hoverLink); 236 appendFormat_String(str, "prefs.hoverlink.changed arg:%d\n", d->prefs.hoverLink);
237 appendFormat_String(str, "prefs.archive.openindex.changed arg:%d\n", d->prefs.openArchiveIndexPages);
237 appendFormat_String(str, "quoteicon.set arg:%d\n", d->prefs.quoteIcon ? 1 : 0); 238 appendFormat_String(str, "quoteicon.set arg:%d\n", d->prefs.quoteIcon ? 1 : 0);
238 appendFormat_String(str, "theme.set arg:%d auto:1\n", d->prefs.theme); 239 appendFormat_String(str, "theme.set arg:%d auto:1\n", d->prefs.theme);
239 appendFormat_String(str, "accent.set arg:%d\n", d->prefs.accent); 240 appendFormat_String(str, "accent.set arg:%d\n", d->prefs.accent);
@@ -1766,6 +1767,10 @@ iBool handleCommand_App(const char *cmd) {
1766 postRefresh_App(); 1767 postRefresh_App();
1767 return iTrue; 1768 return iTrue;
1768 } 1769 }
1770 else if (equal_Command(cmd, "prefs.archive.openindex.changed")) {
1771 d->prefs.openArchiveIndexPages = arg_Command(cmd) != 0;
1772 return iTrue;
1773 }
1769 else if (equal_Command(cmd, "saturation.set")) { 1774 else if (equal_Command(cmd, "saturation.set")) {
1770 d->prefs.saturation = (float) arg_Command(cmd) / 100.0f; 1775 d->prefs.saturation = (float) arg_Command(cmd) / 100.0f;
1771 postCommandf_App("theme.changed auto:1"); 1776 postCommandf_App("theme.changed auto:1");
@@ -1954,6 +1959,7 @@ iBool handleCommand_App(const char *cmd) {
1954 setToggle_Widget(findChild_Widget(dlg, "prefs.smoothscroll"), d->prefs.smoothScrolling); 1959 setToggle_Widget(findChild_Widget(dlg, "prefs.smoothscroll"), d->prefs.smoothScrolling);
1955 setToggle_Widget(findChild_Widget(dlg, "prefs.imageloadscroll"), d->prefs.loadImageInsteadOfScrolling); 1960 setToggle_Widget(findChild_Widget(dlg, "prefs.imageloadscroll"), d->prefs.loadImageInsteadOfScrolling);
1956 setToggle_Widget(findChild_Widget(dlg, "prefs.hidetoolbarscroll"), d->prefs.hideToolbarOnScroll); 1961 setToggle_Widget(findChild_Widget(dlg, "prefs.hidetoolbarscroll"), d->prefs.hideToolbarOnScroll);
1962 setToggle_Widget(findChild_Widget(dlg, "prefs.archive.openindex"), d->prefs.openArchiveIndexPages);
1957 setToggle_Widget(findChild_Widget(dlg, "prefs.ostheme"), d->prefs.useSystemTheme); 1963 setToggle_Widget(findChild_Widget(dlg, "prefs.ostheme"), d->prefs.useSystemTheme);
1958 setToggle_Widget(findChild_Widget(dlg, "prefs.customframe"), d->prefs.customFrame); 1964 setToggle_Widget(findChild_Widget(dlg, "prefs.customframe"), d->prefs.customFrame);
1959 updateDropdownSelection_(findChild_Widget(dlg, "prefs.uilang"), cstr_String(&d->prefs.uiLanguage)); 1965 updateDropdownSelection_(findChild_Widget(dlg, "prefs.uilang"), cstr_String(&d->prefs.uiLanguage));