aboutsummaryrefslogtreecommitdiff
path: root/src/prefs_ui.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-03-17 07:12:57 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-03-17 07:12:57 +0000
commitd88b2045a5093c39dcd175dac5e3fd0153812922 (patch)
tree7bca0c7b70d1274fc37dfaaf53dea52c6526805b /src/prefs_ui.c
parent5d5b413e4b4213e72f51d6393d4f42ba96936ea2 (diff)
added the option for MIME filename encoding method.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1053 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/prefs_ui.c')
-rw-r--r--src/prefs_ui.c43
1 files changed, 42 insertions, 1 deletions
diff --git a/src/prefs_ui.c b/src/prefs_ui.c
index 5024cd2a..e8bc8227 100644
--- a/src/prefs_ui.c
+++ b/src/prefs_ui.c
@@ -1,6 +1,6 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2005 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2006 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -32,6 +32,7 @@
#include "prefs.h"
#include "prefs_ui.h"
+#include "menu.h"
#include "codeconv.h"
#include "utils.h"
#include "gtkutils.h"
@@ -512,3 +513,43 @@ void prefs_set_fontbtn(PrefParam *pparam)
pparam->type);
}
}
+
+void prefs_set_data_from_optmenu(PrefParam *pparam)
+{
+ PrefsUIData *ui_data;
+ GtkWidget *menu;
+ GtkWidget *menuitem;
+
+ ui_data = (PrefsUIData *)pparam->ui_data;
+ g_return_if_fail(ui_data != NULL);
+ g_return_if_fail(*ui_data->widget != NULL);
+
+ menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*ui_data->widget));
+ menuitem = gtk_menu_get_active(GTK_MENU(menu));
+ *((DummyEnum *)pparam->data) = GPOINTER_TO_INT
+ (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
+}
+
+void prefs_set_optmenu(PrefParam *pparam)
+{
+ PrefsUIData *ui_data;
+ DummyEnum val = *((DummyEnum *)pparam->data);
+ GtkOptionMenu *optmenu;
+ gint index;
+
+ ui_data = (PrefsUIData *)pparam->ui_data;
+ g_return_if_fail(ui_data != NULL);
+ g_return_if_fail(*ui_data->widget != NULL);
+
+ optmenu = GTK_OPTION_MENU(*ui_data->widget);
+ g_return_if_fail(optmenu != NULL);
+
+ index = menu_find_option_menu_index(optmenu, GINT_TO_POINTER(val),
+ NULL);
+ if (index >= 0)
+ gtk_option_menu_set_history(optmenu, index);
+ else {
+ gtk_option_menu_set_history(optmenu, 0);
+ prefs_set_data_from_optmenu(pparam);
+ }
+}