Mercurial > geeqie.yaz
annotate src/compat.c @ 1321:50b325a2386e
fixed filter initialization
author | nadvornik |
---|---|
date | Wed, 25 Feb 2009 18:21:20 +0000 |
parents | 8b89e3ff286b |
children | ee2b66a09a03 |
rev | line source |
---|---|
457
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
1 /* |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
2 * Geeqie |
1284 | 3 * Copyright (C) 2008 - 2009 The Geeqie Team |
457
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
4 * |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
5 * Authors: Vladimir Nadvornik / Laurent Monin |
995 | 6 * |
457
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
7 * This software is released under the GNU General Public License (GNU GPL). |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
8 * Please read the included file COPYING for more information. |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
9 * This software comes with no warranty of any kind, use at your own risk! |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
10 */ |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
11 |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
12 #include "main.h" |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
13 #include "compat.h" |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
14 |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
15 /* gtk_radio_action_set_current_value() replacement for GTK+ < 2.10 */ |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
16 void radio_action_set_current_value(GtkRadioAction *action, gint current_value) |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
17 { |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
18 #if GTK_CHECK_VERSION(2, 10, 0) |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
19 gtk_radio_action_set_current_value(action, current_value); |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
20 #else |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
21 GSList *group; |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
22 gint value; |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
23 |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
24 group = gtk_radio_action_get_group(action); |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
25 while (group) |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
26 { |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
27 action = GTK_RADIO_ACTION(group->data); |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
28 g_object_get(G_OBJECT(action), "value", &value, NULL); |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
29 if (value == current_value) |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
30 { |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
31 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE); |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
32 return; |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
33 } |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
34 group = g_slist_next(group); |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
35 } |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
36 #endif |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
37 } |
1055
1646720364cf
Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents:
995
diff
changeset
|
38 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |