Mercurial > geeqie.yaz
annotate src/compat.c @ 679:c881382f1a4f
Update POTFILES.in.
author | zas_ |
---|---|
date | Sat, 17 May 2008 21:28:02 +0000 |
parents | 48c8e49b571c |
children | 6ca2c5fd7b13 |
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 |
475 | 3 * Copyright (C) 2008 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 |
5e9c24d3b3a8
Add a replacement for gtk_radio_action_set_current_value() which
zas_
parents:
diff
changeset
|
6 * |
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 } |