Mercurial > audlegacy-plugins
annotate src/lirc/lirc_cfg.c @ 2818:b30ca704f38a
Automated merge with ssh://hg.atheme-project.org//hg//audacious-plugins
author | Calin Crisan ccrisan@gmail.com |
---|---|
date | Sun, 13 Jul 2008 14:42:54 +0300 |
parents | f06ec6936b7e |
children | 3134a0987162 |
rev | line source |
---|---|
2279 | 1 #include <config.h> |
2 | |
3 #include <gtk/gtk.h> | |
4 #include <audacious/i18n.h> | |
5 #include <audacious/plugin.h> | |
6 #include <audacious/configdb.h> | |
7 | |
8 #include "common.h" | |
9 | |
10 GtkWidget *lirc_cfg = NULL; | |
11 | |
12 gint b_enable_reconnect; | |
13 gint reconnect_timeout; | |
2305
738914331374
Add ability to enter track number using remote. (Bugzilla #115)
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2279
diff
changeset
|
14 gchar *aosd_font = NULL; |
2279 | 15 |
16 void load_cfg(void) | |
17 { | |
18 ConfigDb *db; | |
19 db = aud_cfg_db_open(); | |
2807
f06ec6936b7e
migrated some plugins to auto_CFGID
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2775
diff
changeset
|
20 aud_cfg_db_get_int(db, LIRC_CFGID, "enable_reconnect", &b_enable_reconnect); |
f06ec6936b7e
migrated some plugins to auto_CFGID
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2775
diff
changeset
|
21 aud_cfg_db_get_int(db, LIRC_CFGID, "reconnect_timeout", &reconnect_timeout); |
2305
738914331374
Add ability to enter track number using remote. (Bugzilla #115)
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2279
diff
changeset
|
22 if (!aud_cfg_db_get_string(db, "aosd", "text_fonts_name_0", &aosd_font)) |
2772
fea021087241
enable lirc reconnect by default
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2305
diff
changeset
|
23 aosd_font = g_strdup("Sans 26"); |
fea021087241
enable lirc reconnect by default
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2305
diff
changeset
|
24 if (!reconnect_timeout) |
fea021087241
enable lirc reconnect by default
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2305
diff
changeset
|
25 { |
fea021087241
enable lirc reconnect by default
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2305
diff
changeset
|
26 reconnect_timeout = 5; |
fea021087241
enable lirc reconnect by default
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2305
diff
changeset
|
27 b_enable_reconnect = 1; |
fea021087241
enable lirc reconnect by default
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2305
diff
changeset
|
28 } |
2279 | 29 aud_cfg_db_close(db); |
30 } | |
31 | |
32 void save_cfg(void) | |
33 { | |
34 ConfigDb *db; | |
35 db = aud_cfg_db_open(); | |
2807
f06ec6936b7e
migrated some plugins to auto_CFGID
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2775
diff
changeset
|
36 aud_cfg_db_set_int(db, LIRC_CFGID, "enable_reconnect", b_enable_reconnect); |
f06ec6936b7e
migrated some plugins to auto_CFGID
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2775
diff
changeset
|
37 aud_cfg_db_set_int(db, LIRC_CFGID, "reconnect_timeout", reconnect_timeout); |
2279 | 38 aud_cfg_db_close(db); |
39 } | |
40 | |
41 void configure(void) | |
42 { | |
43 if (lirc_cfg) | |
44 { | |
45 gtk_window_present(GTK_WINDOW(lirc_cfg)); | |
46 return; | |
47 } | |
48 load_cfg(); | |
49 lirc_cfg = create_lirc_cfg(); | |
50 gtk_widget_show_all(lirc_cfg); | |
51 } |