summaryrefslogtreecommitdiff
path: root/riscos/configure
diff options
context:
space:
mode:
authorSteve Fryatt <stevef@netsurf-browser.org>2014-06-08 18:29:03 +0100
committerSteve Fryatt <stevef@netsurf-browser.org>2014-06-08 18:29:03 +0100
commitcc1d5477ab32c544c915ffad880642f399e1a910 (patch)
treee29c4683c3196b800b76362c0d297a9388e9952f /riscos/configure
parente687a359c702e13a7f3e7bb5ba8e7b76d32283b1 (diff)
downloadnetsurf-cc1d5477ab32c544c915ffad880642f399e1a910.tar.gz
netsurf-cc1d5477ab32c544c915ffad880642f399e1a910.tar.bz2
Add disc cache parameters to configuration GUI.
Diffstat (limited to 'riscos/configure')
-rw-r--r--riscos/configure/con_cache.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/riscos/configure/con_cache.c b/riscos/configure/con_cache.c
index cb464f799..468eef454 100644
--- a/riscos/configure/con_cache.c
+++ b/riscos/configure/con_cache.c
@@ -35,9 +35,15 @@
#define CACHE_MEMORY_SIZE 3
#define CACHE_MEMORY_DEC 4
#define CACHE_MEMORY_INC 5
-#define CACHE_DEFAULT_BUTTON 7
-#define CACHE_CANCEL_BUTTON 8
-#define CACHE_OK_BUTTON 9
+#define CACHE_DISC_SIZE 10
+#define CACHE_DISC_DEC 11
+#define CACHE_DISC_INC 12
+#define CACHE_DISC_EXPIRE 15
+#define CACHE_DISC_EXPIRE_DEC 16
+#define CACHE_DISC_EXPIRE_INC 17
+#define CACHE_DEFAULT_BUTTON 19
+#define CACHE_CANCEL_BUTTON 20
+#define CACHE_OK_BUTTON 21
static bool ro_gui_options_cache_click(wimp_pointer *pointer);
static bool ro_gui_options_cache_ok(wimp_w w);
@@ -47,10 +53,19 @@ bool ro_gui_options_cache_initialise(wimp_w w)
/* set the current values */
ro_gui_set_icon_decimal(w, CACHE_MEMORY_SIZE,
(nsoption_int(memory_cache_size) * 10) >> 20, 1);
+ ro_gui_set_icon_decimal(w, CACHE_DISC_SIZE,
+ (nsoption_int(disc_cache_size)) >> 20, 0);
+ ro_gui_set_icon_decimal(w, CACHE_DISC_EXPIRE,
+ (nsoption_int(disc_cache_age)), 0);
/* initialise all functions for a newly created window */
ro_gui_wimp_event_register_numeric_field(w, CACHE_MEMORY_SIZE,
CACHE_MEMORY_INC, CACHE_MEMORY_DEC, 0, 640, 1, 1);
+ ro_gui_wimp_event_register_numeric_field(w, CACHE_DISC_SIZE,
+ CACHE_DISC_INC, CACHE_DISC_DEC, 0, 2047, 1, 0);
+ ro_gui_wimp_event_register_numeric_field(w, CACHE_DISC_EXPIRE,
+ CACHE_DISC_EXPIRE_INC, CACHE_DISC_EXPIRE_DEC, 1, 3650,
+ 1, 0);
ro_gui_wimp_event_register_mouse_click(w, ro_gui_options_cache_click);
ro_gui_wimp_event_register_cancel(w, CACHE_CANCEL_BUTTON);
ro_gui_wimp_event_register_ok(w, CACHE_OK_BUTTON,
@@ -67,7 +82,11 @@ bool ro_gui_options_cache_click(wimp_pointer *pointer)
case CACHE_DEFAULT_BUTTON:
/* set the default values */
ro_gui_set_icon_decimal(pointer->w, CACHE_MEMORY_SIZE,
- 20, 1);
+ 120, 1);
+ ro_gui_set_icon_decimal(pointer->w, CACHE_DISC_SIZE,
+ 1024, 0);
+ ro_gui_set_icon_decimal(pointer->w, CACHE_DISC_EXPIRE,
+ 28, 0);
return true;
}
return false;
@@ -78,6 +97,11 @@ bool ro_gui_options_cache_ok(wimp_w w)
nsoption_set_int(memory_cache_size,
(((ro_gui_get_icon_decimal(w,
CACHE_MEMORY_SIZE, 1) + 1) << 20) - 1) / 10);
+ nsoption_set_int(disc_cache_size,
+ (((ro_gui_get_icon_decimal(w,
+ CACHE_DISC_SIZE, 0) + 1) << 20) - 1));
+ nsoption_set_int(disc_cache_age,
+ ro_gui_get_icon_decimal(w, CACHE_DISC_EXPIRE, 0));
ro_gui_save_options();
return true;