aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2006-09-29 22:48:38 +0000
committerUlf Lamping <ulf.lamping@web.de>2006-09-29 22:48:38 +0000
commite940ff36b4645434b583a6389aff6c84ca1b7cb8 (patch)
treef408595b5121913db05c021f29a8d9e39fa3eb23
parent736bf234e83f84e6cfcf72f1f505b4e4eb9b035b (diff)
from Stephen Fisher:
Attached is a patch for consideration that changes the title in the preferences notebook to be the full description of the preference (but leaves the short name in the preferences list on the left). svn path=/trunk/; revision=19370
-rw-r--r--epan/prefs-int.h3
-rw-r--r--epan/prefs.c26
-rw-r--r--epan/prefs.h5
-rw-r--r--gtk/prefs_dlg.c2
4 files changed, 21 insertions, 15 deletions
diff --git a/epan/prefs-int.h b/epan/prefs-int.h
index 60267daa7a..fb96100286 100644
--- a/epan/prefs-int.h
+++ b/epan/prefs-int.h
@@ -28,7 +28,8 @@
struct pref_module {
const char *name; /* name of module */
- const char *title; /* title of module (displayed in preferences notebook) */
+ const char *title; /* title of module (displayed in preferences list) */
+ const char *description;/* Description of module (displayed in preferences notebook) */
gboolean is_subtree; /* if TRUE, this has other modules, not preferences, under it */
void (*apply_cb)(void); /* routine to call when preferences applied */
GList *prefs; /* list of its preferences or submodules */
diff --git a/epan/prefs.c b/epan/prefs.c
index f825d8bbe0..a042db5caa 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -52,7 +52,7 @@
/* Internal functions */
static module_t *find_module(const char *name);
static module_t *prefs_register_module_or_subtree(module_t *parent,
- const char *name, const char *title, gboolean is_subtree,
+ const char *name, const char *title, const char *description, gboolean is_subtree,
void (*apply_cb)(void));
static struct preference *find_preference(module_t *, const char *);
static int set_pref(gchar*, gchar*);
@@ -139,10 +139,10 @@ module_compare_title(gconstpointer p1_arg, gconstpointer p2_arg)
*/
module_t *
prefs_register_module(module_t *parent, const char *name, const char *title,
- void (*apply_cb)(void))
+ const char *description, void (*apply_cb)(void))
{
- return prefs_register_module_or_subtree(parent, name, title, FALSE,
- apply_cb);
+ return prefs_register_module_or_subtree(parent, name, title, description,
+ FALSE, apply_cb);
}
/*
@@ -152,15 +152,15 @@ prefs_register_module(module_t *parent, const char *name, const char *title,
* dialog box.
*/
module_t *
-prefs_register_subtree(module_t *parent, const char *title)
+prefs_register_subtree(module_t *parent, const char *title, const char *description)
{
- return prefs_register_module_or_subtree(parent, NULL, title, TRUE,
+ return prefs_register_module_or_subtree(parent, NULL, title, description, TRUE,
NULL);
}
static module_t *
prefs_register_module_or_subtree(module_t *parent, const char *name,
- const char *title, gboolean is_subtree, void (*apply_cb)(void))
+ const char *title, const char *description, gboolean is_subtree, void (*apply_cb)(void))
{
module_t *module;
const char *p;
@@ -169,6 +169,7 @@ prefs_register_module_or_subtree(module_t *parent, const char *name,
module = g_malloc(sizeof (module_t));
module->name = name;
module->title = title;
+ module->description = description;
module->is_subtree = is_subtree;
module->apply_cb = apply_cb;
module->prefs = NULL; /* no preferences, to start */
@@ -261,12 +262,13 @@ prefs_register_protocol(int id, void (*apply_cb)(void))
/*
* No. Do so.
*/
- protocols_module = prefs_register_subtree(NULL, "Protocols");
+ protocols_module = prefs_register_subtree(NULL, "Protocols", NULL);
}
protocol = find_protocol_by_id(id);
return prefs_register_module(protocols_module,
proto_get_protocol_filter_name(id),
- proto_get_protocol_short_name(protocol), apply_cb);
+ proto_get_protocol_short_name(protocol),
+ proto_get_protocol_name(id), apply_cb);
}
/*
@@ -286,12 +288,13 @@ prefs_register_protocol_obsolete(int id)
/*
* No. Do so.
*/
- protocols_module = prefs_register_subtree(NULL, "Protocols");
+ protocols_module = prefs_register_subtree(NULL, "Protocols", NULL);
}
protocol = find_protocol_by_id(id);
module = prefs_register_module(protocols_module,
proto_get_protocol_filter_name(id),
- proto_get_protocol_short_name(protocol), NULL);
+ proto_get_protocol_short_name(protocol),
+ proto_get_protocol_name(id), NULL);
module->obsolete = TRUE;
return module;
}
@@ -2653,3 +2656,4 @@ free_col_info(e_prefs *pr)
pr->col_list = NULL;
}
+
diff --git a/epan/prefs.h b/epan/prefs.h
index 887d73a73a..c4d2662053 100644
--- a/epan/prefs.h
+++ b/epan/prefs.h
@@ -176,7 +176,7 @@ typedef struct pref_module module_t;
* call so that the "Protocol Properties..." menu item works.
*/
extern module_t *prefs_register_module(module_t *parent, const char *name,
- const char *title, void (*apply_cb)(void));
+ const char *title, const char *description, void (*apply_cb)(void));
/*
* Register a subtree that will have modules under it.
@@ -184,7 +184,8 @@ extern module_t *prefs_register_module(module_t *parent, const char *name,
* at the top level and the title used in the tab for it in a preferences
* dialog box.
*/
-extern module_t *prefs_register_subtree(module_t *parent, const char *title);
+extern module_t *prefs_register_subtree(module_t *parent, const char *title,
+ const char *description);
/*
* Register that a protocol has preferences.
diff --git a/gtk/prefs_dlg.c b/gtk/prefs_dlg.c
index a83f0269e9..690e1aef6d 100644
--- a/gtk/prefs_dlg.c
+++ b/gtk/prefs_dlg.c
@@ -316,7 +316,7 @@ module_prefs_show(module_t *module, gpointer user_data)
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(main_sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
/* Frame */
- frame = gtk_frame_new(module->title);
+ frame = gtk_frame_new(module->description);
gtk_container_set_border_width(GTK_CONTAINER(frame), 5);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(main_sw), frame);
OBJECT_SET_DATA(main_sw, E_PAGESW_FRAME_KEY, frame);