aboutsummaryrefslogtreecommitdiff
path: root/util/fluxbox-update_configs.cc
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2008-08-14 05:52:39 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2008-08-14 05:52:39 (GMT)
commite169d33552c8e7070aa6e13da0187f2013b4cfc3 (patch)
treeae9e92c7e885791c7f47645184070cbcd441ab94 /util/fluxbox-update_configs.cc
parentc82e7c0080f8a5c14dcf95ec92dc42f59ea9dd8b (diff)
parent91ca3bc5c8e2b892a9a81b18246f72aba7deebfd (diff)
downloadfluxbox_pavel-e169d33552c8e7070aa6e13da0187f2013b4cfc3.zip
fluxbox_pavel-e169d33552c8e7070aa6e13da0187f2013b4cfc3.tar.bz2
Merge branch 'master' into to_push
Diffstat (limited to 'util/fluxbox-update_configs.cc')
-rw-r--r--util/fluxbox-update_configs.cc37
1 files changed, 36 insertions, 1 deletions
diff --git a/util/fluxbox-update_configs.cc b/util/fluxbox-update_configs.cc
index 75be474..0105c18 100644
--- a/util/fluxbox-update_configs.cc
+++ b/util/fluxbox-update_configs.cc
@@ -48,6 +48,7 @@
48#include <fstream> 48#include <fstream>
49#include <set> 49#include <set>
50#include <map> 50#include <map>
51#include <cstdlib>
51#include <list> 52#include <list>
52 53
53using std::cout; 54using std::cout;
@@ -59,6 +60,8 @@ using std::ofstream;
59using std::set; 60using std::set;
60using std::map; 61using std::map;
61using std::list; 62using std::list;
63using std::exit;
64using std::getenv;
62 65
63string read_file(string filename); 66string read_file(string filename);
64void write_file(string filename, string &contents); 67void write_file(string filename, string &contents);
@@ -279,7 +282,7 @@ int run_updates(int old_version, FbTk::ResourceManager &rm) {
279 string whole_keyfile = read_file(keyfilename); 282 string whole_keyfile = read_file(keyfilename);
280 string new_keyfile = ""; 283 string new_keyfile = "";
281 // let's put our new keybindings first, so they're easy to find 284 // let's put our new keybindings first, so they're easy to find
282 new_keyfile += "# start tabbing windows together\n"; 285 new_keyfile += "!mouse actions added by fluxbox-update_configs\n";
283 new_keyfile += "OnTitlebar Mouse2 :StartTabbing\n\n"; 286 new_keyfile += "OnTitlebar Mouse2 :StartTabbing\n\n";
284 new_keyfile += whole_keyfile; // don't forget user's old keybindings 287 new_keyfile += whole_keyfile; // don't forget user's old keybindings
285 288
@@ -288,6 +291,38 @@ int run_updates(int old_version, FbTk::ResourceManager &rm) {
288 new_version = 7; 291 new_version = 7;
289 } 292 }
290 293
294 if (old_version < 8) { // disable icons in tabs for backwards compatibility
295 FbTk::Resource<bool> *show =
296 new FbTk::Resource<bool>(rm, false,
297 "session.screen0.tabs.usePixmap",
298 "Session.Screen0.Tabs.UsePixmap");
299 if (!*show) // only change if the setting didn't already exist
300 *show = false;
301 new_version = 8;
302 }
303
304 if (old_version < 9) { // change format of slit placement menu
305 FbTk::Resource<string> *placement =
306 new FbTk::Resource<string>(rm, "BottomRight",
307 "session.screen0.slit.placement",
308 "Session.Screen0.Slit.Placement");
309 FbTk::Resource<string> *direction =
310 new FbTk::Resource<string>(rm, "Vertical",
311 "session.screen0.slit.direction",
312 "Session.Screen0.Slit.Direction");
313 if (strcasecmp((**direction).c_str(), "vertical") == 0) {
314 if (strcasecmp((**placement).c_str(), "BottomRight") == 0)
315 *placement = "RightBottom";
316 else if (strcasecmp((**placement).c_str(), "BottomLeft") == 0)
317 *placement = "LeftBottom";
318 else if (strcasecmp((**placement).c_str(), "TopRight") == 0)
319 *placement = "RightTop";
320 else if (strcasecmp((**placement).c_str(), "TopLeft") == 0)
321 *placement = "LeftTop";
322 }
323 new_version = 9;
324 }
325
291 return new_version; 326 return new_version;
292} 327}
293 328