summaryrefslogtreecommitdiff
path: root/src/Remember.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Remember.cc')
-rw-r--r--src/Remember.cc25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/Remember.cc b/src/Remember.cc
index 7a2a69a..05e397e 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: Remember.cc,v 1.5 2003/04/26 13:14:37 fluxgen Exp $ 23// $Id: Remember.cc,v 1.6 2003/04/26 13:47:53 rathnor Exp $
24 24
25#include "Remember.hh" 25#include "Remember.hh"
26#include "StringUtil.hh" 26#include "StringUtil.hh"
@@ -117,6 +117,8 @@ FbTk::Menu *createRememberMenu(Remember &remember, FluxboxWindow &win) {
117 Remember::REM_DECOSTATE)); 117 Remember::REM_DECOSTATE));
118 menu->insert(new RememberMenuItem("Shaded", remember, win, 118 menu->insert(new RememberMenuItem("Shaded", remember, win,
119 Remember::REM_SHADEDSTATE)); 119 Remember::REM_SHADEDSTATE));
120 menu->insert(new RememberMenuItem("Layer", remember, win,
121 Remember::REM_LAYER));
120 // menu->insert(new RememberMenuItem("Tab", remember, win, 122 // menu->insert(new RememberMenuItem("Tab", remember, win,
121 // Remember::REM_TABSTATE)); 123 // Remember::REM_TABSTATE));
122 menu->insert(new RememberMenuItem("Save on close", remember, win, 124 menu->insert(new RememberMenuItem("Save on close", remember, win,
@@ -161,6 +163,7 @@ Application::Application() {
161 shadedstate_remember = 163 shadedstate_remember =
162 tabstate_remember = 164 tabstate_remember =
163 jumpworkspace_remember = 165 jumpworkspace_remember =
166 layer_remember =
164 save_on_close_remember = false; 167 save_on_close_remember = false;
165} 168}
166 169
@@ -222,6 +225,11 @@ int Remember::parseApp(ifstream &file, Application *a) {
222 istringstream iss(str_label.c_str()); 225 istringstream iss(str_label.c_str());
223 iss >> w; 226 iss >> w;
224 a->rememberWorkspace(w); 227 a->rememberWorkspace(w);
228 } else if (str_key == "Layer") {
229 unsigned int l;
230 istringstream iss(str_label.c_str());
231 iss >> l;
232 a->rememberLayer(l);
225 } else if (str_key == "Dimensions") { 233 } else if (str_key == "Dimensions") {
226 unsigned int h,w; 234 unsigned int h,w;
227 istringstream iss(str_label.c_str()); 235 istringstream iss(str_label.c_str());
@@ -386,6 +394,9 @@ void Remember::save() {
386 if (a->jumpworkspace_remember) { 394 if (a->jumpworkspace_remember) {
387 apps_file << " [Jump]\t{" << ((a->jumpworkspace)?"yes":"no") << "}" << endl; 395 apps_file << " [Jump]\t{" << ((a->jumpworkspace)?"yes":"no") << "}" << endl;
388 } 396 }
397 if (a->layer_remember) {
398 apps_file << " [Layer]\t{" << a->layer << "}" << endl;
399 }
389 if (a->save_on_close_remember) { 400 if (a->save_on_close_remember) {
390 apps_file << " [Close]\t{" << ((a->save_on_close)?"yes":"no") << "}" << endl; 401 apps_file << " [Close]\t{" << ((a->save_on_close)?"yes":"no") << "}" << endl;
391 } 402 }
@@ -421,6 +432,9 @@ bool Remember::isRemembered(WinClient &winclient, Attribute attrib) {
421 case REM_JUMPWORKSPACE: 432 case REM_JUMPWORKSPACE:
422 return app->jumpworkspace_remember; 433 return app->jumpworkspace_remember;
423 break; 434 break;
435 case REM_LAYER:
436 return app->layer_remember;
437 break;
424 case REM_SAVEONCLOSE: 438 case REM_SAVEONCLOSE:
425 return app->save_on_close_remember; 439 return app->save_on_close_remember;
426 break; 440 break;
@@ -462,6 +476,9 @@ void Remember::rememberAttrib(WinClient &winclient, Attribute attrib) {
462 case REM_JUMPWORKSPACE: 476 case REM_JUMPWORKSPACE:
463 app->rememberJumpworkspace(true); 477 app->rememberJumpworkspace(true);
464 break; 478 break;
479 case REM_LAYER:
480 app->rememberLayer(win->getLayerNum());
481 break;
465 case REM_SAVEONCLOSE: 482 case REM_SAVEONCLOSE:
466 app->rememberSaveOnClose(true); 483 app->rememberSaveOnClose(true);
467 break; 484 break;
@@ -504,6 +521,9 @@ void Remember::forgetAttrib(WinClient &winclient, Attribute attrib) {
504 case REM_JUMPWORKSPACE: 521 case REM_JUMPWORKSPACE:
505 app->forgetJumpworkspace(); 522 app->forgetJumpworkspace();
506 break; 523 break;
524 case REM_LAYER:
525 app->forgetLayer();
526 break;
507 case REM_SAVEONCLOSE: 527 case REM_SAVEONCLOSE:
508 app->forgetSaveOnClose(); 528 app->forgetSaveOnClose();
509 break; 529 break;
@@ -558,6 +578,9 @@ void Remember::setupWindow(FluxboxWindow &win) {
558 !win.isStuck() && app->stuckstate) 578 !win.isStuck() && app->stuckstate)
559 win.stick(); // toggles 579 win.stick(); // toggles
560 580
581 if (app->layer_remember)
582 win.moveToLayer(app->layer);
583
561 // add the menu, this -2 is somewhat dodgy... :-/ 584 // add the menu, this -2 is somewhat dodgy... :-/
562 // TODO: nls 585 // TODO: nls
563 win.getWindowmenu().insert("Remember...", 586 win.getWindowmenu().insert("Remember...",