Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/flickernoise
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 946dbc2
Choose a base ref
...
head repository: m-labs/flickernoise
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e807609
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Apr 6, 2012

  1. Copy the full SHA
    f08c5aa View commit details
  2. gui/cp.c: break down that cp_notify_changed()

      into one that only sets the title and another one that save config file
    xiangfu committed Apr 6, 2012
    Copy the full SHA
    e807609 View commit details
Showing with 11 additions and 12 deletions.
  1. +11 −11 src/gui/cp.c
  2. +0 −1 src/translations/french.c
22 changes: 11 additions & 11 deletions src/gui/cp.c
Original file line number Diff line number Diff line change
@@ -53,16 +53,22 @@ static int appid;
static struct filedialog *load_dlg;
static struct filedialog *save_dlg;

static char default_config[8192] = "/ssd/default.per";
static char default_config[4096] = "/ssd/default.per";

void cp_notify_changed(void)
static void update_title_default_config(char * config_name)
{
if(config_name) strcpy(default_config, config_name);

if(!strcmp(default_config, "/ssd/default.per"))
mtk_cmd(appid, "w.set(-title \"Control panel\")");
else
mtk_cmdf(appid, "w.set(-title \"\e%s\")",
basename(default_config));
}

void cp_notify_changed(void)
{
update_title_default_config(NULL);
config_save(default_config);
}

@@ -85,10 +91,8 @@ static void loadok_callback(void *arg)
return;
}

strcpy(default_config, buf);

on_config_change();
cp_notify_changed();
update_title_default_config(buf);
}

static void saveok_callback(void *arg)
@@ -98,10 +102,7 @@ static void saveok_callback(void *arg)
get_filedialog_selection(save_dlg, buf, sizeof(buf));

config_save(buf);

strcpy(default_config, buf);
on_config_change();
cp_notify_changed();
update_title_default_config(buf);
}

enum {
@@ -390,8 +391,7 @@ void cp_autostart(void)
return;
}
on_config_change();
strcpy(default_config, autostart);
cp_notify_changed();
update_title_default_config(autostart);
start_performance(0, 0, 0);
break;
}
1 change: 0 additions & 1 deletion src/translations/french.c
Original file line number Diff line number Diff line change
@@ -44,7 +44,6 @@ struct mtk_i18n_entry translation_french[] = {

// Control panel
{ "Control panel", "Panneau de contr\xf4""le" },
{ "Control panel *", "Panneau de contr\xf4""le *" },
{ "Interfaces", "Interfaces" },
{ "Keyboard", "Clavier" },
{ "IR remote", "T\xe9""l\xe9""commande IR" },