Mercurial > pidgin-twitter
annotate prefs.c @ 254:c2620a99622b
- divided the source file into several parts.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Sat, 22 Nov 2008 18:01:18 +0900 |
parents | |
children | 2d559555875f |
rev | line source |
---|---|
254
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
1 #include "pidgin-twitter.h" |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
2 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
3 extern GHashTable *icon_hash[]; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
4 extern source_t source; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
5 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
6 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
7 /* prototypes */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
8 static void icon_size_prefs_cb(const char *name, PurplePrefType type, gconstpointer val, gpointer data); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
9 static void interval_prefs_cb(const char *name, PurplePrefType type, gconstpointer val, gpointer data); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
10 static void text_changed_cb(gpointer *data); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
11 static void bool_toggled_cb(gpointer *data); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
12 static void spin_changed_cb(gpointer *data); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
13 static void combo_changed_cb(gpointer *data); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
14 static void disconnect_prefs_cb(GtkObject *object, gpointer data); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
15 static void counter_prefs_cb(const char *name, PurplePrefType type, gconstpointer val, gpointer data); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
16 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
17 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
18 static void |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
19 counter_prefs_cb(const char *name, PurplePrefType type, |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
20 gconstpointer val, gpointer data) |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
21 { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
22 gboolean enabled = purple_prefs_get_bool(OPT_COUNTER); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
23 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
24 if(enabled) |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
25 attach_to_window(); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
26 else |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
27 detach_from_window(); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
28 } |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
29 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
30 static void |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
31 icon_size_prefs_cb(const char *name, PurplePrefType type, |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
32 gconstpointer val, gpointer data) |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
33 { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
34 int i; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
35 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
36 /* invalidate icon cache */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
37 for(i = twitter_service; i < NUM_SERVICES; i++) { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
38 g_hash_table_foreach(icon_hash[i], |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
39 (GHFunc)invalidate_icon_data_func, NULL); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
40 } |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
41 } |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
42 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
43 static void |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
44 interval_prefs_cb(const char *name, PurplePrefType type, |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
45 gconstpointer val, gpointer data) |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
46 { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
47 /* remove idle func */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
48 g_source_remove_by_user_data((gpointer)(source.conv)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
49 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
50 /* add idle func */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
51 if(purple_prefs_get_bool(OPT_API_BASE_POST)) { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
52 source.id = g_timeout_add_seconds( |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
53 purple_prefs_get_int(OPT_API_BASE_GET_INTERVAL), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
54 get_status_with_api, (gpointer)(source.conv)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
55 } |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
56 } |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
57 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
58 static void |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
59 text_changed_cb(gpointer *data) |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
60 { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
61 const gchar *text; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
62 gchar *pref = (gchar *)g_object_get_data(G_OBJECT(data), "pref"); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
63 text = gtk_entry_get_text(GTK_ENTRY(data)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
64 purple_prefs_set_string(pref, text); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
65 } |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
66 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
67 static void |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
68 bool_toggled_cb(gpointer *data) |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
69 { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
70 gchar *pref = (gchar *)g_object_get_data(G_OBJECT(data), "pref"); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
71 gboolean value = purple_prefs_get_bool(pref); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
72 purple_prefs_set_bool(pref, !value); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
73 } |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
74 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
75 static void |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
76 spin_changed_cb(gpointer *data) |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
77 { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
78 gchar *pref = (gchar *)g_object_get_data(G_OBJECT(data), "pref"); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
79 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
80 twitter_debug("called\n"); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
81 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
82 purple_prefs_set_int(pref, |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
83 gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(data))); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
84 } |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
85 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
86 static void |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
87 combo_changed_cb(gpointer *data) |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
88 { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
89 gint position; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
90 gchar *pref = (gchar *)g_object_get_data(G_OBJECT(data), "pref"); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
91 position = gtk_combo_box_get_active(GTK_COMBO_BOX(data)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
92 purple_prefs_set_int(pref, position); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
93 } |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
94 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
95 static void |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
96 disconnect_prefs_cb(GtkObject *object, gpointer data) |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
97 { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
98 PurplePlugin *plugin = (PurplePlugin *)data; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
99 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
100 purple_prefs_disconnect_by_handle(plugin); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
101 } |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
102 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
103 static void |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
104 api_base_post_cb(const char *name, PurplePrefType type, gconstpointer value, |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
105 gpointer data) |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
106 { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
107 signed_on_cb(NULL); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
108 get_status_with_api((gpointer)(source.conv)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
109 } |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
110 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
111 GtkWidget * |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
112 prefs_get_frame(PurplePlugin *plugin) |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
113 { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
114 GtkBuilder *builder; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
115 GError *err = NULL; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
116 gchar *filename; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
117 GtkWidget *window, *notebook, *e; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
118 const gchar *text; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
119 GtkSpinButton *spin; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
120 GtkObject *adjust; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
121 gint value; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
122 #ifdef _WIN32 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
123 extern char binary_prefs_ui_start[]; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
124 extern char binary_prefs_ui_size[]; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
125 #endif |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
126 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
127 builder = gtk_builder_new(); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
128 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
129 #ifdef _WIN32 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
130 gtk_builder_add_from_string(builder, binary_prefs_ui_start, |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
131 (int)binary_prefs_ui_size, NULL); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
132 #else |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
133 filename = g_build_filename(DATADIR, |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
134 "pidgin-twitter", "prefs.ui", NULL); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
135 gtk_builder_add_from_file(builder, filename, &err); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
136 #endif |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
137 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
138 if(err) { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
139 twitter_debug("%s\n", err->message); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
140 g_free(filename); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
141 return NULL; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
142 } |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
143 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
144 g_free(filename); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
145 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
146 gtk_builder_connect_signals(builder, NULL); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
147 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
148 window = GTK_WIDGET(gtk_builder_get_object(builder, "prefswindow")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
149 notebook = GTK_WIDGET(gtk_builder_get_object(builder, "prefsnotebook")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
150 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
151 gtk_container_remove(GTK_CONTAINER(window), notebook); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
152 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
153 g_signal_connect(notebook, "destroy", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
154 G_CALLBACK(disconnect_prefs_cb), plugin); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
155 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
156 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
157 /**********************/ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
158 /* connect to signals */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
159 /**********************/ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
160 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
161 /****************/ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
162 /* account page */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
163 /****************/ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
164 e = GTK_WIDGET(gtk_builder_get_object (builder, "account_twitter")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
165 g_object_set_data(G_OBJECT(e), "pref", OPT_SCREEN_NAME_TWITTER); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
166 text = purple_prefs_get_string(OPT_SCREEN_NAME_TWITTER); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
167 gtk_entry_set_text(GTK_ENTRY(e), text); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
168 g_signal_connect(e, "changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
169 G_CALLBACK(text_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
170 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
171 e = GTK_WIDGET(gtk_builder_get_object (builder, "account_wassr")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
172 g_object_set_data(G_OBJECT(e), "pref", OPT_SCREEN_NAME_WASSR); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
173 text = purple_prefs_get_string(OPT_SCREEN_NAME_WASSR); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
174 gtk_entry_set_text(GTK_ENTRY(e), text); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
175 g_signal_connect(e, "changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
176 G_CALLBACK(text_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
177 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
178 e = GTK_WIDGET(gtk_builder_get_object (builder, "account_identica")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
179 g_object_set_data(G_OBJECT(e), "pref", OPT_SCREEN_NAME_IDENTICA); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
180 text = purple_prefs_get_string(OPT_SCREEN_NAME_IDENTICA); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
181 gtk_entry_set_text(GTK_ENTRY(e), text); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
182 g_signal_connect(e, "changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
183 G_CALLBACK(text_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
184 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
185 e = GTK_WIDGET(gtk_builder_get_object (builder, "account_jisko")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
186 g_object_set_data(G_OBJECT(e), "pref", OPT_SCREEN_NAME_JISKO); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
187 text = purple_prefs_get_string(OPT_SCREEN_NAME_JISKO); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
188 gtk_entry_set_text(GTK_ENTRY(e), text); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
189 g_signal_connect(e, "changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
190 G_CALLBACK(text_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
191 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
192 e = GTK_WIDGET(gtk_builder_get_object (builder, "account_api")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
193 g_object_set_data(G_OBJECT(e), "pref", OPT_API_BASE_POST); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
194 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
195 purple_prefs_get_bool(OPT_API_BASE_POST)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
196 g_signal_connect(e, "toggled", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
197 G_CALLBACK(bool_toggled_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
198 purple_prefs_connect_callback(plugin, OPT_API_BASE_POST, /* xxx divide? */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
199 api_base_post_cb, NULL); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
200 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
201 e = GTK_WIDGET(gtk_builder_get_object (builder, "account_api_password")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
202 g_object_set_data(G_OBJECT(e), "pref", OPT_PASSWORD_TWITTER); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
203 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
204 gtk_entry_set_visibility(GTK_ENTRY(e), FALSE); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
205 if (gtk_entry_get_invisible_char(GTK_ENTRY(e)) == '*') |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
206 gtk_entry_set_invisible_char(GTK_ENTRY(e), PIDGIN_INVISIBLE_CHAR); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
207 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
208 text = purple_prefs_get_string(OPT_PASSWORD_TWITTER); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
209 gtk_entry_set_text(GTK_ENTRY(e), text); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
210 g_signal_connect(e, "changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
211 G_CALLBACK(text_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
212 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
213 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
214 /* interval spin */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
215 e = GTK_WIDGET(gtk_builder_get_object (builder, |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
216 "account_api_get_interval_spin")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
217 g_object_set_data(G_OBJECT(e), "pref", OPT_API_BASE_GET_INTERVAL); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
218 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
219 spin = GTK_SPIN_BUTTON(e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
220 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
221 value = purple_prefs_get_int(OPT_API_BASE_GET_INTERVAL); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
222 twitter_debug("spin value = %d\n", value); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
223 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
224 adjust = gtk_adjustment_new(value, 40, 3600, 10, 100, 100); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
225 gtk_spin_button_set_adjustment(spin, GTK_ADJUSTMENT(adjust)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
226 gtk_widget_set_size_request(GTK_WIDGET(spin), 50, -1); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
227 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
228 if(value == 0) { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
229 value = TWITTER_DEFAULT_INTERVAL; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
230 purple_prefs_set_int(OPT_API_BASE_GET_INTERVAL, value); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
231 } |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
232 gtk_spin_button_set_value(GTK_SPIN_BUTTON(e), (gdouble)value); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
233 g_signal_connect(e, "value-changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
234 G_CALLBACK(spin_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
235 purple_prefs_connect_callback(plugin, OPT_API_BASE_GET_INTERVAL, |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
236 interval_prefs_cb, NULL); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
237 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
238 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
239 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
240 /********************/ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
241 /* translation page */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
242 /********************/ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
243 e = GTK_WIDGET(gtk_builder_get_object (builder, "translation_recipient")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
244 g_object_set_data(G_OBJECT(e), "pref", OPT_TRANSLATE_RECIPIENT); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
245 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
246 purple_prefs_get_bool(OPT_TRANSLATE_RECIPIENT)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
247 g_signal_connect(e, "toggled", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
248 G_CALLBACK(bool_toggled_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
249 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
250 e = GTK_WIDGET(gtk_builder_get_object (builder, "translation_sender")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
251 g_object_set_data(G_OBJECT(e), "pref", OPT_TRANSLATE_SENDER); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
252 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
253 purple_prefs_get_bool(OPT_TRANSLATE_SENDER)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
254 g_signal_connect(e, "toggled", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
255 G_CALLBACK(bool_toggled_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
256 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
257 e = GTK_WIDGET(gtk_builder_get_object (builder, "translation_channel")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
258 g_object_set_data(G_OBJECT(e), "pref", OPT_TRANSLATE_CHANNEL); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
259 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
260 purple_prefs_get_bool(OPT_TRANSLATE_CHANNEL)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
261 g_signal_connect(e, "toggled", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
262 G_CALLBACK(bool_toggled_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
263 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
264 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
265 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
266 /***************/ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
267 /* filter page */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
268 /***************/ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
269 e = GTK_WIDGET(gtk_builder_get_object (builder, "filter_filter_check")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
270 g_object_set_data(G_OBJECT(e), "pref", OPT_FILTER); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
271 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
272 purple_prefs_get_bool(OPT_FILTER)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
273 g_signal_connect(e, "toggled", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
274 G_CALLBACK(bool_toggled_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
275 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
276 e = GTK_WIDGET(gtk_builder_get_object (builder, "filter_exclude_reply_check")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
277 g_object_set_data(G_OBJECT(e), "pref", OPT_FILTER_EXCLUDE_REPLY); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
278 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
279 purple_prefs_get_bool(OPT_FILTER_EXCLUDE_REPLY)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
280 g_signal_connect(e, "toggled", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
281 G_CALLBACK(bool_toggled_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
282 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
283 e = GTK_WIDGET(gtk_builder_get_object (builder, "filter_twitter")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
284 g_object_set_data(G_OBJECT(e), "pref", OPT_FILTER_TWITTER); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
285 text = purple_prefs_get_string(OPT_FILTER_TWITTER); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
286 gtk_entry_set_text(GTK_ENTRY(e), text); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
287 g_signal_connect(e, "changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
288 G_CALLBACK(text_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
289 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
290 e = GTK_WIDGET(gtk_builder_get_object (builder, "filter_wassr")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
291 g_object_set_data(G_OBJECT(e), "pref", OPT_FILTER_WASSR); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
292 text = purple_prefs_get_string(OPT_FILTER_WASSR); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
293 gtk_entry_set_text(GTK_ENTRY(e), text); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
294 g_signal_connect(e, "changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
295 G_CALLBACK(text_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
296 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
297 e = GTK_WIDGET(gtk_builder_get_object (builder, "filter_identica")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
298 g_object_set_data(G_OBJECT(e), "pref", OPT_FILTER_IDENTICA); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
299 text = purple_prefs_get_string(OPT_FILTER_IDENTICA); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
300 gtk_entry_set_text(GTK_ENTRY(e), text); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
301 g_signal_connect(e, "changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
302 G_CALLBACK(text_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
303 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
304 e = GTK_WIDGET(gtk_builder_get_object (builder, "filter_jisko")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
305 g_object_set_data(G_OBJECT(e), "pref", OPT_FILTER_JISKO); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
306 text = purple_prefs_get_string(OPT_FILTER_JISKO); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
307 gtk_entry_set_text(GTK_ENTRY(e), text); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
308 g_signal_connect(e, "changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
309 G_CALLBACK(text_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
310 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
311 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
312 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
313 /*************/ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
314 /* icon page */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
315 /*************/ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
316 e = GTK_WIDGET(gtk_builder_get_object (builder, "icon_show_icon")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
317 g_object_set_data(G_OBJECT(e), "pref", OPT_SHOW_ICON); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
318 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
319 purple_prefs_get_bool(OPT_SHOW_ICON)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
320 g_signal_connect(e, "toggled", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
321 G_CALLBACK(bool_toggled_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
322 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
323 /* icon size spin */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
324 e = GTK_WIDGET(gtk_builder_get_object (builder, "icon_icon_size_spin")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
325 g_object_set_data(G_OBJECT(e), "pref", OPT_ICON_SIZE); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
326 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
327 spin = GTK_SPIN_BUTTON(e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
328 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
329 value = purple_prefs_get_int(OPT_ICON_SIZE); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
330 twitter_debug("spin value = %d\n", value); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
331 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
332 adjust = gtk_adjustment_new(value, 16, 128, 4, 4, 4); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
333 gtk_spin_button_set_adjustment(spin, GTK_ADJUSTMENT(adjust)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
334 gtk_widget_set_size_request(GTK_WIDGET(spin), 50, -1); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
335 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
336 if(value == 0) { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
337 value = DEFAULT_ICON_SIZE; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
338 purple_prefs_set_int(OPT_ICON_SIZE, value); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
339 } |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
340 gtk_spin_button_set_value(GTK_SPIN_BUTTON(e), (gdouble)value); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
341 g_signal_connect(e, "value-changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
342 G_CALLBACK(spin_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
343 purple_prefs_connect_callback(plugin, OPT_ICON_SIZE, |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
344 icon_size_prefs_cb, NULL); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
345 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
346 /* enable update */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
347 e = GTK_WIDGET(gtk_builder_get_object (builder, "icon_enable_update")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
348 g_object_set_data(G_OBJECT(e), "pref", OPT_UPDATE_ICON); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
349 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
350 purple_prefs_get_bool(OPT_UPDATE_ICON)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
351 g_signal_connect(e, "toggled", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
352 G_CALLBACK(bool_toggled_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
353 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
354 /* max count spin */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
355 e = GTK_WIDGET(gtk_builder_get_object (builder, "icon_max_count_spin")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
356 g_object_set_data(G_OBJECT(e), "pref", OPT_ICON_MAX_COUNT); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
357 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
358 spin = GTK_SPIN_BUTTON(e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
359 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
360 value = purple_prefs_get_int(OPT_ICON_MAX_COUNT); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
361 twitter_debug("spin value = %d\n", value); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
362 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
363 adjust = gtk_adjustment_new(value, 2, 10000, 1, 10, 10); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
364 gtk_spin_button_set_adjustment(spin, GTK_ADJUSTMENT(adjust)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
365 gtk_widget_set_size_request(GTK_WIDGET(spin), 50, -1); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
366 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
367 if(value == 0) { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
368 value = DEFAULT_ICON_MAX_COUNT; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
369 purple_prefs_set_int(OPT_ICON_MAX_COUNT, value); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
370 } |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
371 gtk_spin_button_set_value(GTK_SPIN_BUTTON(e), (gdouble)value); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
372 g_signal_connect(e, "value-changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
373 G_CALLBACK(spin_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
374 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
375 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
376 /* max days spin */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
377 e = GTK_WIDGET(gtk_builder_get_object (builder, "icon_max_days_spin")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
378 g_object_set_data(G_OBJECT(e), "pref", OPT_ICON_MAX_DAYS); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
379 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
380 spin = GTK_SPIN_BUTTON(e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
381 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
382 value = purple_prefs_get_int(OPT_ICON_MAX_DAYS); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
383 twitter_debug("spin value = %d\n", value); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
384 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
385 adjust = gtk_adjustment_new(value, 1, 180, 1, 10, 10); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
386 gtk_spin_button_set_adjustment(spin, GTK_ADJUSTMENT(adjust)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
387 gtk_widget_set_size_request(GTK_WIDGET(spin), 50, -1); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
388 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
389 if(value == 0) { |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
390 value = DEFAULT_ICON_MAX_DAYS; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
391 purple_prefs_set_int(OPT_ICON_MAX_DAYS, value); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
392 } |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
393 gtk_spin_button_set_value(GTK_SPIN_BUTTON(e), (gdouble)value); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
394 g_signal_connect(e, "value-changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
395 G_CALLBACK(spin_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
396 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
397 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
398 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
399 /**************/ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
400 /* sound page */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
401 /**************/ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
402 e = GTK_WIDGET(gtk_builder_get_object (builder, "sound_recip_check")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
403 g_object_set_data(G_OBJECT(e), "pref", OPT_PLAYSOUND_RECIPIENT); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
404 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
405 purple_prefs_get_bool(OPT_PLAYSOUND_RECIPIENT)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
406 g_signal_connect(e, "toggled", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
407 G_CALLBACK(bool_toggled_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
408 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
409 e = GTK_WIDGET(gtk_builder_get_object (builder, "sound_recip_list")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
410 g_object_set_data(G_OBJECT(e), "pref", OPT_USERLIST_RECIPIENT); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
411 text = purple_prefs_get_string(OPT_USERLIST_RECIPIENT); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
412 gtk_entry_set_text(GTK_ENTRY(e), text); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
413 g_signal_connect(e, "changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
414 G_CALLBACK(text_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
415 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
416 /* recipient combobox */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
417 e = GTK_WIDGET(gtk_builder_get_object (builder, "sound_recip_combo")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
418 gtk_combo_box_set_active(GTK_COMBO_BOX(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
419 purple_prefs_get_int(OPT_SOUNDID_RECIPIENT)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
420 g_object_set_data(G_OBJECT(e), "pref", OPT_SOUNDID_RECIPIENT); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
421 g_signal_connect(e, "changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
422 G_CALLBACK(combo_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
423 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
424 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
425 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
426 e = GTK_WIDGET(gtk_builder_get_object (builder, "sound_send_check")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
427 g_object_set_data(G_OBJECT(e), "pref", OPT_PLAYSOUND_SENDER); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
428 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
429 purple_prefs_get_bool(OPT_PLAYSOUND_SENDER)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
430 g_signal_connect(e, "toggled", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
431 G_CALLBACK(bool_toggled_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
432 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
433 e = GTK_WIDGET(gtk_builder_get_object (builder, "sound_send_list")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
434 g_object_set_data(G_OBJECT(e), "pref", OPT_USERLIST_SENDER); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
435 text = purple_prefs_get_string(OPT_USERLIST_SENDER); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
436 gtk_entry_set_text(GTK_ENTRY(e), text); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
437 g_signal_connect(e, "changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
438 G_CALLBACK(text_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
439 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
440 /* sender combobox */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
441 e = GTK_WIDGET(gtk_builder_get_object (builder, "sound_send_combo")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
442 gtk_combo_box_set_active(GTK_COMBO_BOX(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
443 purple_prefs_get_int(OPT_SOUNDID_RECIPIENT)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
444 g_object_set_data(G_OBJECT(e), "pref", OPT_SOUNDID_SENDER); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
445 g_signal_connect(e, "changed", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
446 G_CALLBACK(combo_changed_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
447 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
448 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
449 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
450 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
451 /****************/ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
452 /* utility page */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
453 /****************/ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
454 e = GTK_WIDGET(gtk_builder_get_object (builder, "utility_counter")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
455 g_object_set_data(G_OBJECT(e), "pref", OPT_COUNTER); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
456 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
457 purple_prefs_get_bool(OPT_COUNTER)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
458 g_signal_connect(e, "toggled", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
459 G_CALLBACK(bool_toggled_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
460 purple_prefs_connect_callback(plugin, OPT_COUNTER, |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
461 counter_prefs_cb, NULL); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
462 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
463 e = GTK_WIDGET(gtk_builder_get_object (builder, "utility_pseudo")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
464 g_object_set_data(G_OBJECT(e), "pref", OPT_ESCAPE_PSEUDO); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
465 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
466 purple_prefs_get_bool(OPT_ESCAPE_PSEUDO)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
467 g_signal_connect(e, "toggled", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
468 G_CALLBACK(bool_toggled_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
469 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
470 e = GTK_WIDGET(gtk_builder_get_object (builder, "utility_oops")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
471 g_object_set_data(G_OBJECT(e), "pref", OPT_SUPPRESS_OOPS); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
472 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
473 purple_prefs_get_bool(OPT_SUPPRESS_OOPS)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
474 g_signal_connect(e, "toggled", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
475 G_CALLBACK(bool_toggled_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
476 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
477 e = GTK_WIDGET(gtk_builder_get_object (builder, "utility_strip_excess_lf")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
478 g_object_set_data(G_OBJECT(e), "pref", OPT_STRIP_EXCESS_LF); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
479 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
480 purple_prefs_get_bool(OPT_STRIP_EXCESS_LF)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
481 g_signal_connect(e, "toggled", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
482 G_CALLBACK(bool_toggled_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
483 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
484 e = GTK_WIDGET(gtk_builder_get_object (builder, "utility_notify")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
485 g_object_set_data(G_OBJECT(e), "pref", OPT_PREVENT_NOTIFICATION); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
486 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
487 purple_prefs_get_bool(OPT_PREVENT_NOTIFICATION)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
488 g_signal_connect(e, "toggled", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
489 G_CALLBACK(bool_toggled_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
490 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
491 e = GTK_WIDGET(gtk_builder_get_object (builder, "utility_log_output")); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
492 g_object_set_data(G_OBJECT(e), "pref", OPT_LOG_OUTPUT); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
493 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e), |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
494 purple_prefs_get_bool(OPT_LOG_OUTPUT)); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
495 g_signal_connect(e, "toggled", |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
496 G_CALLBACK(bool_toggled_cb), &e); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
497 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
498 |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
499 /* all done */ |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
500 gtk_widget_show_all(notebook); |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
501 return notebook; |
c2620a99622b
- divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
502 } |