comparison src/gtkplugin.c @ 11741:8034f752feae

[gaim-migrate @ 14032] Das Warningfixens. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sun, 23 Oct 2005 07:31:20 +0000
parents 7e0ad3b6882a
children dfb66f3f9e87
comparison
equal deleted inserted replaced
11740:7e0ad3b6882a 11741:8034f752feae
117 GaimPlugin *plug; 117 GaimPlugin *plug;
118 gchar buf[1024]; 118 gchar buf[1024];
119 gchar *name = NULL, *description = NULL; 119 gchar *name = NULL, *description = NULL;
120 120
121 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); 121 GdkCursor *wait = gdk_cursor_new (GDK_WATCH);
122 gdk_window_set_cursor(plugin_dialog, wait); 122 gdk_window_set_cursor(GTK_WINDOW(plugin_dialog), wait);
123 gdk_cursor_unref(wait); 123 gdk_cursor_unref(wait);
124 124
125 gtk_tree_model_get_iter (model, &iter, path); 125 gtk_tree_model_get_iter (model, &iter, path);
126 gtk_tree_model_get (model, &iter, 2, &plug, -1); 126 gtk_tree_model_get (model, &iter, 2, &plug, -1);
127 127
129 gaim_plugin_load(plug); 129 gaim_plugin_load(plug);
130 else 130 else
131 gaim_plugin_unload(plug); 131 gaim_plugin_unload(plug);
132 132
133 133
134 gdk_window_set_cursor(plugin_dialog, NULL); 134 gdk_window_set_cursor(GTK_WINDOW(plugin_dialog), NULL);
135 135
136 name = g_markup_escape_text(_(plug->info->name), -1); 136 name = g_markup_escape_text(_(plug->info->name), -1);
137 description = g_markup_escape_text(_(plug->info->description), -1); 137 description = g_markup_escape_text(_(plug->info->description), -1);
138 138
139 if (plug->error != NULL) { 139 if (plug->error != NULL) {
169 gaim_gtk_plugins_save(); 169 gaim_gtk_plugins_save();
170 } 170 }
171 171
172 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) 172 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model)
173 { 173 {
174 gchar *buf, *pname, *perr, *pdesc, *pauth, *pweb; 174 gchar *buf, *pname, *pdesc, *pauth, *pweb;
175 GtkTreeIter iter; 175 GtkTreeIter iter;
176 GValue val = { 0, }; 176 GValue val = { 0, };
177 GaimPlugin *plug; 177 GaimPlugin *plug;
178 GaimGtkPluginUiInfo *ui_info;
179 178
180 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) 179 if (! gtk_tree_selection_get_selected (sel, &model, &iter))
181 return; 180 return;
182 gtk_tree_model_get_value (model, &iter, 2, &val); 181 gtk_tree_model_get_value (model, &iter, 2, &val);
183 plug = g_value_get_pointer(&val); 182 plug = g_value_get_pointer(&val);
216 g_free(pdesc); 215 g_free(pdesc);
217 g_free(pauth); 216 g_free(pauth);
218 g_free(pweb); 217 g_free(pweb);
219 } 218 }
220 219
221 static void pref_dialog_response_cb(GtkDialog *d, int response, void *null) 220 static void pref_dialog_response_cb(GtkWidget *d, int response, void *null)
222 { 221 {
223 switch (response) { 222 switch (response) {
224 case GTK_RESPONSE_CLOSE: 223 case GTK_RESPONSE_CLOSE:
225 case GTK_RESPONSE_DELETE_EVENT: 224 case GTK_RESPONSE_DELETE_EVENT:
226 gtk_widget_destroy(d); 225 gtk_widget_destroy(d);
227 plugin_dialog = NULL; 226 plugin_dialog = NULL;
228 break; 227 break;
229 } 228 }
230 } 229 }
231 static void plugin_dialog_response_cb(GtkDialog *d, int response, GtkTreeSelection *sel) 230 static void plugin_dialog_response_cb(GtkWidget *d, int response, GtkTreeSelection *sel)
232 { 231 {
233 GaimPlugin *plug; 232 GaimPlugin *plug;
234 GtkWidget *dialog, *box; 233 GtkWidget *dialog, *box;
235 GtkTreeModel *model; 234 GtkTreeModel *model;
236 GValue val; 235 GValue val;
251 break; 250 break;
252 box = gaim_gtk_plugin_get_config_frame(plug); 251 box = gaim_gtk_plugin_get_config_frame(plug);
253 if (box == NULL) 252 if (box == NULL)
254 break; 253 break;
255 254
256 dialog = gtk_dialog_new_with_buttons(GAIM_ALERT_TITLE, d, 255 dialog = gtk_dialog_new_with_buttons(GAIM_ALERT_TITLE, GTK_WINDOW(d),
257 GTK_DIALOG_NO_SEPARATOR | GTK_DIALOG_MODAL, 256 GTK_DIALOG_NO_SEPARATOR | GTK_DIALOG_MODAL,
258 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, 257 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
259 NULL); 258 NULL);
260 g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(pref_dialog_response_cb), NULL); 259 g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(pref_dialog_response_cb), NULL);
261 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), box); 260 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), box);
264 } 263 }
265 } 264 }
266 265
267 void gaim_gtk_plugin_dialog_show() 266 void gaim_gtk_plugin_dialog_show()
268 { 267 {
269 GtkWidget *sw, *vp; 268 GtkWidget *sw;
270 GtkWidget *event_view; 269 GtkWidget *event_view;
271 GtkListStore *ls; 270 GtkListStore *ls;
272 GtkCellRenderer *rend, *rendt; 271 GtkCellRenderer *rend, *rendt;
273 GtkTreeViewColumn *col; 272 GtkTreeViewColumn *col;
274 GtkTreeSelection *sel; 273 GtkTreeSelection *sel;
275 GtkTreePath *path;
276 GtkWidget *expander; 274 GtkWidget *expander;
277 275
278 if (plugin_dialog != NULL) { 276 if (plugin_dialog != NULL) {
279 gtk_window_present(GTK_WINDOW(plugin_dialog)); 277 gtk_window_present(GTK_WINDOW(plugin_dialog));
280 return; 278 return;