| 242 gint subscript = GPOINTER_TO_INT(data); |
242 gint subscript = GPOINTER_TO_INT(data); |
| 243 |
243 |
| 244 if (response == GTK_RESPONSE_OK) { |
244 if (response == GTK_RESPONSE_OK) { |
| 245 GdkColor color; |
245 GdkColor color; |
| 246 gchar colorstr[8]; |
246 gchar colorstr[8]; |
| 247 #if GTK_CHECK_VERSION(2,14,0) |
|
| 248 GtkWidget *colorsel = |
247 GtkWidget *colorsel = |
| 249 gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog)); |
248 gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog)); |
| 250 #else |
|
| 251 GtkWidget *colorsel = GTK_COLOR_SELECTION_DIALOG(color_dialog)->colorsel; |
|
| 252 #endif |
|
| 253 |
249 |
| 254 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(colorsel), &color); |
250 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(colorsel), &color); |
| 255 |
251 |
| 256 g_snprintf(colorstr, sizeof(colorstr), "#%02X%02X%02X", |
252 g_snprintf(colorstr, sizeof(colorstr), "#%02X%02X%02X", |
| 257 color.red/256, color.green/256, color.blue/256); |
253 color.red/256, color.green/256, color.blue/256); |
| 278 |
274 |
| 279 pref = purple_prefs_get_string(color_prefs[subscript]); |
275 pref = purple_prefs_get_string(color_prefs[subscript]); |
| 280 |
276 |
| 281 if (pref != NULL && strcmp(pref, "")) { |
277 if (pref != NULL && strcmp(pref, "")) { |
| 282 if (gdk_color_parse(pref, &color)) { |
278 if (gdk_color_parse(pref, &color)) { |
| 283 #if GTK_CHECK_VERSION(2,14,0) |
|
| 284 gtk_color_selection_set_current_color(GTK_COLOR_SELECTION( |
279 gtk_color_selection_set_current_color(GTK_COLOR_SELECTION( |
| 285 gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog))), |
280 gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog))), |
| 286 &color); |
281 &color); |
| 287 #else |
|
| 288 gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(color_dialog)->colorsel), &color); |
|
| 289 #endif |
|
| 290 } |
282 } |
| 291 } |
283 } |
| 292 |
284 |
| 293 gtk_window_present(GTK_WINDOW(color_dialog)); |
285 gtk_window_present(GTK_WINDOW(color_dialog)); |
| 294 } |
286 } |