// --------------------------------------------------
// backward compatibility
// detect if it's an old config file (==1)
-static int old_config_file;
+static int new_config_file;
void default_config()
{
config_path = 0;
snapshot_path = 0;
- old_config_file = 1;
+ new_config_file = 0;
}
void cleanup_config()
}
}
else if (strcmp (key, "panel_items") == 0) {
- if (panel_items_order) g_free(panel_items_order);
+ new_config_file = 1;
panel_items_order = strdup(value);
int j;
for (j=0 ; j < strlen(panel_items_order) ; j++) {
/* Clock */
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");
+ else
+ panel_items_order = strdup("C");
+ }
if (strlen(value) > 0) {
time1_format = strdup (value);
clock_enabled = 1;
}
}
+ // old config option
+ else if (strcmp(key, "systray") == 0) {
+ 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");
+ }
+ }
+ }
+ else if (strcmp(key, "battery") == 0) {
+ 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");
+ }
+ }
+ }
else
fprintf(stderr, "tint2 : invalid option \"%s\",\n upgrade tint2 or correct your config file\n", key);
}
}
fclose (fp);
+
+ // append Taskbar item
+ if (new_config_file == 0) {
+ taskbar_enabled = 1;
+ if (panel_items_order) {
+ char *tmp = strdup("T");
+ panel_items_order = strcat(tmp, panel_items_order);
+ }
+ else
+ panel_items_order = strdup("T");
+ }
return 1;
}
task_dragged = 0;
panel_horizontal = 1;
panel_position = CENTER;
- panel_items_order = strdup("LTBSC"); // Default order : Launcher, Taskbar, Battery, Systray, Clock
+ panel_items_order = 0;
panel_autohide = 0;
panel_autohide_show_timeout = 0;
panel_autohide_hide_timeout = 0;
g_slist_free(p->area.list);
p->area.list = 0;
}
-
+ printf("panel_items_order %s\n", panel_items_order);
for (k=0 ; k < strlen(panel_items_order) ; k++) {
if (panel_items_order[k] == 'L') {
init_launcher_panel(p);
child->posx = pos;
child->redraw = 1;
}
- //printf("level %d, object %d, pos %d\n", level, i, pos);
+ printf("level %d, object %d, pos %d\n", level, i, pos);
size_by_layout(child, pos, level+1);