add remembering of layer
@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Remember.cc,v 1.5 2003/04/26 13:14:37 fluxgen Exp $ +// $Id: Remember.cc,v 1.6 2003/04/26 13:47:53 rathnor Exp $ #include "Remember.hh" #include "StringUtil.hh"@@ -117,6 +117,8 @@ menu->insert(new RememberMenuItem("Decorations", remember, win,
Remember::REM_DECOSTATE)); menu->insert(new RememberMenuItem("Shaded", remember, win, Remember::REM_SHADEDSTATE)); + menu->insert(new RememberMenuItem("Layer", remember, win, + Remember::REM_LAYER)); // menu->insert(new RememberMenuItem("Tab", remember, win, // Remember::REM_TABSTATE)); menu->insert(new RememberMenuItem("Save on close", remember, win,@@ -161,6 +163,7 @@ decostate_remember =
shadedstate_remember = tabstate_remember = jumpworkspace_remember = + layer_remember = save_on_close_remember = false; }@@ -222,6 +225,11 @@ unsigned int w;
istringstream iss(str_label.c_str()); iss >> w; a->rememberWorkspace(w); + } else if (str_key == "Layer") { + unsigned int l; + istringstream iss(str_label.c_str()); + iss >> l; + a->rememberLayer(l); } else if (str_key == "Dimensions") { unsigned int h,w; istringstream iss(str_label.c_str());@@ -385,6 +393,9 @@ apps_file << " [Sticky]\t{" << ((a->stuckstate)?"yes":"no") << "}" << endl;
} if (a->jumpworkspace_remember) { apps_file << " [Jump]\t{" << ((a->jumpworkspace)?"yes":"no") << "}" << endl; + } + if (a->layer_remember) { + apps_file << " [Layer]\t{" << a->layer << "}" << endl; } if (a->save_on_close_remember) { apps_file << " [Close]\t{" << ((a->save_on_close)?"yes":"no") << "}" << endl;@@ -421,6 +432,9 @@ // break;
case REM_JUMPWORKSPACE: return app->jumpworkspace_remember; break; + case REM_LAYER: + return app->layer_remember; + break; case REM_SAVEONCLOSE: return app->save_on_close_remember; break;@@ -461,6 +475,9 @@ // case REM_TABSTATE:
// break; case REM_JUMPWORKSPACE: app->rememberJumpworkspace(true); + break; + case REM_LAYER: + app->rememberLayer(win->getLayerNum()); break; case REM_SAVEONCLOSE: app->rememberSaveOnClose(true);@@ -504,6 +521,9 @@ // break;
case REM_JUMPWORKSPACE: app->forgetJumpworkspace(); break; + case REM_LAYER: + app->forgetLayer(); + break; case REM_SAVEONCLOSE: app->forgetSaveOnClose(); break;@@ -557,6 +577,9 @@ // if inconsistent...
if (win.isStuck() && !app->stuckstate || !win.isStuck() && app->stuckstate) win.stick(); // toggles + + if (app->layer_remember) + win.moveToLayer(app->layer); // add the menu, this -2 is somewhat dodgy... :-/ // TODO: nls
@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Remember.hh,v 1.3 2003/04/26 12:44:53 fluxgen Exp $ +// $Id: Remember.hh,v 1.4 2003/04/26 13:47:53 rathnor Exp $ /* Based on the original "Remember patch" by Xavier Brouckaert */@@ -44,6 +44,7 @@ inline void forgetTabstate() { tabstate_remember = false; }
inline void forgetDecostate() { decostate_remember = false; } inline void forgetStuckstate() { stuckstate_remember = false; } inline void forgetJumpworkspace() { jumpworkspace_remember = false; } + inline void forgetLayer() { layer_remember = false; } inline void forgetSaveOnClose() { save_on_close_remember = false; } inline void rememberWorkspace(int ws)@@ -62,6 +63,8 @@ inline void rememberStuckstate(bool state)
{ stuckstate = state; stuckstate_remember = true; } inline void rememberJumpworkspace(bool state) { jumpworkspace = state; jumpworkspace_remember = true; } + inline void rememberLayer(int layernum) + { layer = layernum; layer_remember = true; } inline void rememberSaveOnClose(bool state) { save_on_close = state; save_on_close_remember = true; }@@ -90,6 +93,9 @@
bool jumpworkspace_remember; bool jumpworkspace; + bool layer_remember; + int layer; + bool save_on_close_remember; bool save_on_close; };@@ -116,6 +122,7 @@ REM_STUCKSTATE,
REM_DECOSTATE, REM_SHADEDSTATE, //REM_TABSTATE, ... external tabs disabled atm + REM_LAYER, REM_JUMPWORKSPACE, REM_SAVEONCLOSE, REM_LASTATTRIB // not actually used