General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Can You Restore Last Session?
Posted by: DasFox
Date: August 02, 2008 08:27AM

If you have several layers open, and need to close KM and get back to it later, can you have KM open up where you were with all the layers open? Known as restore last session...

THANKS

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: disrupted
Date: August 02, 2008 09:38AM

you certainly can,
if you're using kmeleon 1.1.x just click on the 'groups' menu and select 'last session'

if you're using kmeleon 1.5, click on the sessions menu, select load session then previous session

notable, if kmeleon crashes or gets terminated from a task manager for example(not properly closed), it will automatically prompt you to restore the last session next time it's opened.

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: JujuLand
Date: August 02, 2008 06:54PM

With 1.1.x

Display > Homepage > Last Session

A+



Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:38.0) Gecko/20100101 Ubuntu/12.04 K-Meleon/76.0


Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr



Ubuntu 12.04 - Gramps 3.4.9 - Harbour 3.2.0 - Hwgui 2.20-3 - K-Meleon 76.0 rc



Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: guenter
Date: August 02, 2008 08:48PM

All works (mostly) since some time.
The only problem is that You must find the menu item tongue sticking out smiley

I observed occasional, non reproducable shortcomings with sessions that include Tabs & Windows if XUL items (which are applications - e.g. Firefox extensions ) are in use.

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: MrWoo
Date: August 06, 2008 07:18AM

I have been using Kmeleon for a long while. It is usually my bacukp to Opera for various reasons. I decided that Opera has more bloat than it used to, and therefore am learning some macro language for Kmeleon.

Here is my first macro. Maybe not pretty, but pretty useful for me. It allows the last session to be opened upon startup. An ini file lets the value dictate if it does this or not. Perhaps a more advanced user could tell me if this should not be a macro itself, but should go somewhere else, or any other suggestions

You create a folder in the Kmeleon root called LaSession. Inside of LaSession create LaSession.ini. In this ini add this

[Main]
Last=1
Show=0

where Last is to load last session and 1 is true, 0 is false. Show is nothing yet.

Next create LaSession.kmm in the macros directory, and add this to it


# on startup, last session will be attempted to load
# ---------- Open last session by default -------------------------------------
# 
# Dependencies	: main.kmm, groups.kmm
# Resources	: -
# Preferences	: -
#
# -----------------------------------------------------------------------------

# declare/initialize variables

$PATH = getfolder(RootFolder); # set the path to root of kmeleon 
$_LaSess_CommandLine=""; # initialize variable
$_LaSess_ini="LaSession\\LaSession.ini"; # set ini path
$_LaSess_iContent=""; # initialize variable
$_LaSess_Choise=""; # initialize variable

# ----- PRIVATE

# get the value from ini file into variable
_LaSess_Parse{
$start_pos=index($_LaSess_iContent,"Last="); # get start pos
$start_pos=$start_pos+5 # position to start stringmid
$stop_pos=index($_LaSess_iContent,"Show="); # get end pos
$stop_pos=$stop_pos-1 # position to stop stringmid
$_LaSess_Choise=substr($_LaSess_iContent,$start_pos,($stop_pos-$start_pos)); # this is a stringmid fucntion basically
}

# the action yes or no
_LaSess_GetChoise{
$_LaSess_iContent=readfile($_LaSess_ini); # read a small text file <= 32kb
$_LaSess_iContent==""? 0: &_LaSess_Parse; # IF '' then nothing (0) ELSE do function
$_LaSess_Choise=="1"? macros(Groups_OpenLastSession):0;	# IF 1 load last session ELSE do nothing (0)
}

$OnStartup=$OnStartup."_LaSess_GetChoise;";

# -----------------------------------------------------------------------------
$macroModules=$macroModules."LaSession;";

It works for me anyway. Just like Opera did I guess.

MrWoo.

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: desga2
Date: August 06, 2008 10:40AM

Thanks for shared your macro code MrWoo.
Can you add it in the Macro Library?

Macro code in forums is hard to find in the future.

Thanks.

K-Meleon in Spanish

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: JamesD
Date: August 06, 2008 02:57PM

With the new KM 1.5 version, the ability to restart in the previous session is built in. Try SESSIONS - OPTIONS, check the box for open the following session at startup and select previous session from the dropdown.

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: kko
Date: August 06, 2008 03:04PM

Quote
MrWoo
Here is my first macro. Maybe not pretty, but pretty useful for me. It allows the last session to be opened upon startup. An ini file lets the value dictate if it does this or not. Perhaps a more advanced user could tell me if this should not be a macro itself, but should go somewhere else, or any other suggestions

Well done! I just don't quite understand the purpose of this macro. I mean, this functionality is built in by default. If you want to start with the last session, all you need to do is checking "View" > "Home" > "Start With Last Session". That does exactly the same as this macro - without ini file.

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: guenter
Date: August 06, 2008 04:22PM

@kko & MrWoo, Yes, well done.

- MrWoo sorry that You did not find that kko'd done it already.
- good when ppl try to help themselves & all.



Edited 1 time(s). Last edit at 08/06/2008 04:27PM by guenter.

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: desga2
Date: August 06, 2008 04:54PM

This macro code can to do something that you can do with default options but it's a good example for people that start to use and learning macro code to how use a ini file.
You can use this macro for example to import configs or prefs from an ini file when you like port certain configs or prefs to a lot of K-Meleon installations and don't like port all prefs.js file.

K-Meleon in Spanish

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: MrWoo
Date: August 06, 2008 05:51PM

Quote
desga2
Thanks for shared your macro code MrWoo.
Can you add it in the Macro Library?

Macro code in forums is hard to find in the future.

Thanks.

I can add it. I will look to see how.

Quote
JamesD
With the new KM 1.5 version, the ability to restart in the previous session is built in. Try SESSIONS - OPTIONS, check the box for open the following session at startup and select previous session from the dropdown.

I have not seen the preference you talk about. Where is it?

Quote
kko
Well done! I just don't quite understand the purpose of this macro. I mean, this functionality is built in by default. If you want to start with the last session, all you need to do is checking "View" > "Home" > "Start With Last Session". That does exactly the same as this macro - without ini file.

Purpose (because I did not know it was possible already) is to start Kmel with the last session. I never checked the Home menu. Opera does this and I use it all the time. It was just time to learn some new stuff I guess.

Quote
desga2
This macro code can to do something that you can do with default options but it's a good example for people that start to use and learning macro code to how use a ini file.
You can use this macro for example to import configs or prefs from an ini file when you like port certain configs or prefs to a lot of K-Meleon installations and don't like port all prefs.js file.

Yes, I thought it was good to learn this much. Basic scripting really, although the examples are not the easiest to follow, they skip around a bit. Either way, if you want to learn something other than how to just click an option, it is commented to help understand.

Now, is there a place in the future, where one would store those ini settings globally or something? Or a macro that you would just add those few functions to that could be called globally?

Thanks for the replies.

MrWoo

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: JamesD
Date: August 06, 2008 06:35PM

Quote
MrWoo
I have not seen the preference you talk about. Where is it?

SESSIONS is an item on the main menu. It is just to the left of TOOLS.

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: desga2
Date: August 06, 2008 06:44PM

Quote
MrWoo
Now, is there a place in the future, where one would store those ini settings globally or something? Or a macro that you would just add those few functions to that could be called globally?

You can use prefs to do this, not need ini files.
All macros can be called globally.

K-Meleon in Spanish

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: MrWoo
Date: August 06, 2008 11:32PM

I see no SESSIONS. I am using this - K-Meleon 1.1.6

I see File,Edit,View,Bookmarks,Groups,Tools,Help.

Under Groups there is: Add page to group.. Add layers to group.. Delete group..

I am using Tabs. Does that make a difference? I see in the normal Preferences that the plugin Session Saver says (not compatible with layers). Is this why?

MrWoo

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: JamesD
Date: August 07, 2008 12:11AM

SESSIONS menu item is found only in the new 1.5 version of KM.

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: MrWoo
Date: August 07, 2008 04:35AM

I don't consider myself a noob at all, but I cannot see what you refer to. I have version 1.1.6 installed, and version 1.1.3. I see that in neither. I downloaded the zipped version 1.1.5, but again, I do not see what you speak of. How do I get that to show? I still see Groups only.

MrWoo.

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: JamesD
Date: August 07, 2008 11:27AM

I am sorry that I was not clear in my statement before. I am using the not yet official version 1.5beta2. The 1.5 version is in release code now and will be official soon. It has tabs and sessions. The versions you have in the 1.1.x series have layers and groups. You do not have tabs and sessions.

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: desga2
Date: August 07, 2008 12:34PM

In 1.1.X version you have load last session but not saved it (only you can saved groups of layers not sessions of windows with layers).

To load last session in 1.1.X you can found a menu option in: Groups -> Last Session (Ctrl+Alt+L)

If you like load last session at start K-Meleon you can select it in menu View -> Home -> Open Last Session (to open now) and Start With Last Session (to open in next starts), or doing right click over Home toolbar button this menu is showed.

K-Meleon in Spanish



Edited 3 time(s). Last edit at 08/07/2008 12:37PM by desga2.

Options: ReplyQuote
Re: Can You Restore Last Session?
Posted by: MrWoo
Date: August 07, 2008 07:16PM

Ah. This explains much. I will have to give 1.5 beta a try.

Thanks for the explanations.

MrWoo

Options: ReplyQuote


K-Meleon forum is powered by Phorum.