# HG changeset patch # User Tomasz Mon # Date 1211536218 -7200 # Node ID b990e7eb0c25adfc6466a4e326a9137eb4fdbe55 # Parent 43a07a0607da2d401f6c0503ef00153965a23e8e save config on plugin cleanup diff -r 43a07a0607da -r b990e7eb0c25 src/skins/plugin.c --- a/src/skins/plugin.c Thu May 22 21:42:31 2008 +0200 +++ b/src/skins/plugin.c Fri May 23 11:50:18 2008 +0200 @@ -59,13 +59,16 @@ init_skins(config.skin); - mainwin_real_show(); + if (config.player_visible) mainwin_real_show(); + if (config.equalizer_visible) equalizerwin_show(TRUE); + if (config.playlist_visible) playlistwin_show(); return; } void skins_cleanup(void) { if (plugin_is_active == TRUE) { + skins_cfg_save(); ui_main_evlistener_dissociate(); ui_playlist_evlistener_dissociate(); skins_cfg_free(); diff -r 43a07a0607da -r b990e7eb0c25 src/skins/plugin.h --- a/src/skins/plugin.h Thu May 22 21:42:31 2008 +0200 +++ b/src/skins/plugin.h Fri May 23 11:50:18 2008 +0200 @@ -26,6 +26,8 @@ #include "skins_cfg.h" #include "ui_main.h" #include "ui_equalizer.h" +#include "ui_playlist.h" +#include "ui_skin.h" #define PACKAGE_NAME "audacious-plugins" diff -r 43a07a0607da -r b990e7eb0c25 src/skins/skins_cfg.c --- a/src/skins/skins_cfg.c Thu May 22 21:42:31 2008 +0200 +++ b/src/skins/skins_cfg.c Fri May 23 11:50:18 2008 +0200 @@ -167,23 +167,15 @@ void skins_cfg_load() { mcs_handle_t *cfgfile = aud_cfg_db_open(); - /* if (!aud_cfg_db_get_int(cfgfile, "skins", "field_name", &(cfg->where))) - cfg->where = default value - if (!aud_cfg_db_get_string(cfgfile, "skins", "field_name", &(cfg->where))) - cfg->where = g_strdup("defaul"); - if (!aud_cfg_db_get_bool(cfgfile, "skins", "field_name", &(cfg->where))) - cfg->where = FALSE / TRUE; - */ - memcpy(&config, &skins_default_config, sizeof(skins_cfg_t)); int i; - + for (i = 0; i < ncfgbent; ++i) { aud_cfg_db_get_bool(cfgfile, "skins", skins_boolents[i].be_vname, skins_boolents[i].be_vloc); } - + for (i = 0; i < ncfgient; ++i) { aud_cfg_db_get_int(cfgfile, "skins", skins_numents[i].ie_vname, @@ -200,16 +192,9 @@ } -void skins_cfg_save(skins_cfg_t * cfg) { +void skins_cfg_save() { mcs_handle_t *cfgfile = aud_cfg_db_open(); -/* - aud_cfg_db_set_int(cfgfile, "skins", "field_name", cfg->where); - aud_cfg_db_set_string(cfgfile, "skins", "field_name", cfg->where); - aud_cfg_db_set_bool(cfgfile, "skins", "field_name", cfg->where); -*/ - aud_cfg_db_set_string(cfgfile, "skins", "skin", cfg->skin); - int i; for (i = 0; i < ncfgbent; ++i) diff -r 43a07a0607da -r b990e7eb0c25 src/skins/ui_skinned_textbox.c --- a/src/skins/ui_skinned_textbox.c Thu May 22 21:42:31 2008 +0200 +++ b/src/skins/ui_skinned_textbox.c Fri May 23 11:50:18 2008 +0200 @@ -707,6 +707,8 @@ void ui_skinned_textbox_set_scroll(GtkWidget *widget, gboolean scroll) { g_return_if_fail(widget != NULL); + g_return_if_fail(UI_SKINNED_IS_TEXTBOX(widget)); + UiSkinnedTextbox *textbox = UI_SKINNED_TEXTBOX(widget); UiSkinnedTextboxPrivate *priv = UI_SKINNED_TEXTBOX_GET_PRIVATE(textbox);