diff options
author | Michael Mann <mmann78@netscape.net> | 2012-08-08 12:13:24 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2012-08-08 12:13:24 +0000 |
commit | 3d12ea758b952de49a1f3dfde1552bdf87e1c455 (patch) | |
tree | eeef4695074baed1b4f01a500d2f734b4c355636 /ui | |
parent | 0e9df60466abc84ed798066dfde64f1b4dc33849 (diff) |
Base framework to allow all preferences to be part of generic preferences API. Implementation will follow, but I wanted the framework in place first.
svn path=/trunk/; revision=44331
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gtk/main_menubar.c | 5 | ||||
-rw-r--r-- | ui/gtk/prefs_dlg.c | 63 |
2 files changed, 68 insertions, 0 deletions
diff --git a/ui/gtk/main_menubar.c b/ui/gtk/main_menubar.c index 45835dddd2..991cb6f41c 100644 --- a/ui/gtk/main_menubar.c +++ b/ui/gtk/main_menubar.c @@ -5313,6 +5313,11 @@ add_protocol_prefs_menu (pref_t *pref, gpointer data) g_signal_connect (menu_item, "activate", G_CALLBACK(uat_window_cb), pref->varp.uat); g_free (label); break; + + case PREF_COLOR: + case PREF_CUSTOM: + /* currently not supported */ + case PREF_STATIC_TEXT: case PREF_OBSOLETE: default: diff --git a/ui/gtk/prefs_dlg.c b/ui/gtk/prefs_dlg.c index 83917c0b45..5289bb3dfb 100644 --- a/ui/gtk/prefs_dlg.c +++ b/ui/gtk/prefs_dlg.c @@ -250,6 +250,10 @@ pref_show(pref_t *pref, gpointer user_data) break; } + case PREF_COLOR: + case PREF_CUSTOM: + /* currently not supported */ + case PREF_OBSOLETE: g_assert_not_reached(); break; @@ -303,6 +307,13 @@ module_prefs_show(module_t *module, gpointer user_data) GtkTreeStore *model; GtkTreeIter iter; + if (!module->use_gui) { + /* This module uses its own GUI interface to modify its + * preferences, so ignore it + */ + return 0; + } + /* * Is this module an interior node, with modules underneath it? */ @@ -991,6 +1002,10 @@ pref_check(pref_t *pref, gpointer user_data) /* Value can't be bad. */ break; + case PREF_COLOR: + case PREF_CUSTOM: + /* currently not supported */ + case PREF_OBSOLETE: g_assert_not_reached(); break; @@ -1001,6 +1016,11 @@ pref_check(pref_t *pref, gpointer user_data) static guint module_prefs_check(module_t *module, gpointer user_data) { + /* Ignore any preferences with their own interface */ + if (!module->use_gui) { + return 0; + } + /* For all preferences in this module, fetch its value from this module's notebook page and check whether it's valid. */ return prefs_pref_foreach(module, pref_check, user_data); @@ -1094,6 +1114,10 @@ pref_fetch(pref_t *pref, gpointer user_data) case PREF_UAT: break; + case PREF_COLOR: + case PREF_CUSTOM: + /* currently not supported */ + case PREF_OBSOLETE: g_assert_not_reached(); break; @@ -1106,6 +1130,11 @@ module_prefs_fetch(module_t *module, gpointer user_data) { gboolean *must_redissect_p = user_data; + /* Ignore any preferences with their own interface */ + if (!module->use_gui) { + return 0; + } + /* For all preferences in this module, fetch its value from this module's notebook page. Find out whether any of them changed. */ module->prefs_changed = FALSE; /* assume none of them changed */ @@ -1223,6 +1252,10 @@ pref_clean(pref_t *pref, gpointer user_data _U_) case PREF_UAT: break; + case PREF_COLOR: + case PREF_CUSTOM: + /* currently not supported */ + case PREF_OBSOLETE: g_assert_not_reached(); break; @@ -1233,6 +1266,11 @@ pref_clean(pref_t *pref, gpointer user_data _U_) static guint module_prefs_clean(module_t *module, gpointer user_data _U_) { + /* Ignore any preferences with their own interface */ + if (!module->use_gui) { + return 0; + } + /* For all preferences in this module, clean up any cruft allocated for use by the GUI code. */ prefs_pref_foreach(module, pref_clean, NULL); @@ -1403,6 +1441,10 @@ pref_copy(pref_t *pref, gpointer user_data _U_) case PREF_UAT: break; + case PREF_COLOR: + case PREF_CUSTOM: + /* currently not supported */ + case PREF_OBSOLETE: g_assert_not_reached(); break; @@ -1413,6 +1455,11 @@ pref_copy(pref_t *pref, gpointer user_data _U_) static guint module_prefs_copy(module_t *module, gpointer user_data _U_) { + /* Ignore any preferences with their own interface */ + if (!module->use_gui) { + return 0; + } + /* For all preferences in this module, (re)save current value */ prefs_pref_foreach(module, pref_copy, NULL); return 0; /* continue making copies */ @@ -1609,6 +1656,10 @@ pref_revert(pref_t *pref, gpointer user_data) case PREF_UAT: break; + case PREF_COLOR: + case PREF_CUSTOM: + /* currently not supported */ + case PREF_OBSOLETE: g_assert_not_reached(); break; @@ -1621,6 +1672,11 @@ module_prefs_revert(module_t *module, gpointer user_data) { gboolean *must_redissect_p = user_data; + /* Ignore any preferences with their own interface */ + if (!module->use_gui) { + return 0; + } + /* For all preferences in this module, revert its value to the value it had when we popped up the Preferences dialog. Find out whether this changes any of them. */ @@ -1691,6 +1747,13 @@ module_search_properties(module_t *module, gpointer user_data) { struct properties_data *p = (struct properties_data *)user_data; + if (!module->use_gui) { + /* This module uses its own GUI interface, so its not a part + * of this search + */ + return 0; + } + /* If this module has the specified title, remember it. */ if (strcmp(module->title, p->title) == 0) { p->module = module; |