X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fconfig.c;h=2ff77f548a6122fa2ed3fcf944cb085dd03c704a;hb=54c21917514f31f3c69ef747e609e93dc4b38dbe;hp=37a30eff74d31dc2228d5e45356eaf44996d8568;hpb=6f02aea86bfbd5bc086d2a67318f2534bb8b73c2;p=chaz%2Ftint2 diff --git a/src/config.c b/src/config.c index 37a30ef..2ff77f5 100644 --- a/src/config.c +++ b/src/config.c @@ -40,6 +40,7 @@ #include "panel.h" #include "task.h" #include "taskbar.h" +#include "taskbarname.h" #include "systraybar.h" #include "launcher.h" #include "clock.h" @@ -374,10 +375,13 @@ void add_entry (char *key, char *value) else if (strcmp (key, "time1_format") == 0) { if (new_config_file == 0) { clock_enabled = 1; - if (panel_items_order) - panel_items_order = strcat(panel_items_order, "C"); + if (panel_items_order) { + char* tmp = g_strconcat(panel_items_order, "C", NULL); + g_free( panel_items_order ); + panel_items_order = tmp; + } else - panel_items_order = strdup("C"); + panel_items_order = g_strdup("C"); } if (strlen(value) > 0) { time1_format = strdup (value); @@ -450,14 +454,27 @@ void add_entry (char *key, char *value) else if (strcmp (key, "taskbar_background_id") == 0) { int id = atoi (value); id = (id < backgrounds->len && id >= 0) ? id : 0; - panel_config.g_taskbar.bg = &g_array_index(backgrounds, Background, id); - panel_config.g_taskbar.area.bg = panel_config.g_taskbar.bg; + panel_config.g_taskbar.background[TASKBAR_NORMAL] = &g_array_index(backgrounds, Background, id); + if (panel_config.g_taskbar.background[TASKBAR_ACTIVE] == 0) + panel_config.g_taskbar.background[TASKBAR_ACTIVE] = panel_config.g_taskbar.background[TASKBAR_NORMAL]; } else if (strcmp (key, "taskbar_active_background_id") == 0) { int id = atoi (value); id = (id < backgrounds->len && id >= 0) ? id : 0; - panel_config.g_taskbar.bg_active = &g_array_index(backgrounds, Background, id); - panel_config.g_taskbar.use_active = 1; + panel_config.g_taskbar.background[TASKBAR_ACTIVE] = &g_array_index(backgrounds, Background, id); + } + else if (strcmp (key, "taskbar_name") == 0) { + taskbarname_enabled = atoi (value); + } + else if (strcmp (key, "taskbar_name_background_id") == 0) { + } + else if (strcmp (key, "taskbar_name_active_background_id") == 0) { + } + else if (strcmp (key, "taskbar_name_font") == 0) { + } + else if (strcmp (key, "taskbar_name_font_color") == 0) { + } + else if (strcmp (key, "taskbar_name_active_font_color") == 0) { } /* Task */ @@ -645,10 +662,13 @@ void add_entry (char *key, char *value) if (new_config_file == 0) { systray_enabled = atoi(value); if (systray_enabled) { - if (panel_items_order) - panel_items_order = strcat(panel_items_order, "S"); - else - panel_items_order = strdup("S"); + if (panel_items_order) { + char* tmp = g_strconcat(panel_items_order, "S", NULL); + g_free( panel_items_order ); + panel_items_order = tmp; + } + else + panel_items_order = g_strdup("S"); } } } @@ -656,10 +676,13 @@ void add_entry (char *key, char *value) if (new_config_file == 0) { battery_enabled = atoi(value); if (battery_enabled) { - if (panel_items_order) - panel_items_order = strcat(panel_items_order, "B"); - else - panel_items_order = strdup("B"); + if (panel_items_order) { + char* tmp = g_strconcat(panel_items_order, "B", NULL); + g_free( panel_items_order ); + panel_items_order = tmp; + } + else + panel_items_order = g_strdup("B"); } } } @@ -740,11 +763,12 @@ int config_read_file (const char *path) if (new_config_file == 0) { taskbar_enabled = 1; if (panel_items_order) { - char *tmp = strdup("T"); - panel_items_order = strcat(tmp, panel_items_order); + char* tmp = g_strconcat( "T", panel_items_order, NULL ); + g_free(panel_items_order); + panel_items_order = tmp; } else - panel_items_order = strdup("T"); + panel_items_order = g_strdup("T"); } return 1;