Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 2 files changed
  • 0 comments
  • 1 contributor
Apr 06, 2012
Xiangfu Liu remove useless translation: Control panel * f08c5aa
Xiangfu Liu gui/cp.c: break down that cp_notify_changed()
  into one that only sets the title and another one that save config file
e807609
22  src/gui/cp.c
@@ -53,16 +53,22 @@ static int appid;
53 53
 static struct filedialog *load_dlg;
54 54
 static struct filedialog *save_dlg;
55 55
 
56  
-static char default_config[8192] = "/ssd/default.per";
  56
+static char default_config[4096] = "/ssd/default.per";
57 57
 
58  
-void cp_notify_changed(void)
  58
+static void update_title_default_config(char * config_name)
59 59
 {
  60
+	if(config_name) strcpy(default_config, config_name);
  61
+
60 62
 	if(!strcmp(default_config, "/ssd/default.per"))
61 63
 		mtk_cmd(appid, "w.set(-title \"Control panel\")");
62 64
 	else
63 65
 		mtk_cmdf(appid, "w.set(-title \"\e%s\")",
64 66
 			 basename(default_config));
  67
+}
65 68
 
  69
+void cp_notify_changed(void)
  70
+{
  71
+	update_title_default_config(NULL);
66 72
 	config_save(default_config);
67 73
 }
68 74
 
@@ -85,10 +91,8 @@ static void loadok_callback(void *arg)
85 91
 		return;
86 92
 	}
87 93
 
88  
-	strcpy(default_config, buf);
89  
-
90 94
 	on_config_change();
91  
-	cp_notify_changed();
  95
+	update_title_default_config(buf);
92 96
 }
93 97
 
94 98
 static void saveok_callback(void *arg)
@@ -98,10 +102,7 @@ static void saveok_callback(void *arg)
98 102
 	get_filedialog_selection(save_dlg, buf, sizeof(buf));
99 103
 
100 104
 	config_save(buf);
101  
-
102  
-	strcpy(default_config, buf);
103  
-	on_config_change();
104  
-	cp_notify_changed();
  105
+	update_title_default_config(buf);
105 106
 }
106 107
 
107 108
 enum {
@@ -390,8 +391,7 @@ void cp_autostart(void)
390 391
 				return;
391 392
 			}
392 393
 			on_config_change();
393  
-			strcpy(default_config, autostart);
394  
-			cp_notify_changed();
  394
+			update_title_default_config(autostart);
395 395
 			start_performance(0, 0, 0);
396 396
 			break;
397 397
 	}
1  src/translations/french.c
@@ -44,7 +44,6 @@ struct mtk_i18n_entry translation_french[] = {
44 44
 
45 45
 	// Control panel
46 46
 	{ "Control panel",					"Panneau de contr\xf4""le" },
47  
-	{ "Control panel *",					"Panneau de contr\xf4""le *" },
48 47
 	{ "Interfaces",						"Interfaces" },
49 48
 	{ "Keyboard",						"Clavier" },
50 49
 	{ "IR remote",						"T\xe9""l\xe9""commande IR" },

No commit comments for this range

Something went wrong with that request. Please try again.