Now this works! Unprompted PreviousSession loading on "Restart" , else: prompt user.
Posted by: SoerenB
Date: February 21, 2010 07:37PM

Hi,

Works now! ...just some spaces & quotes where misplaced. If anybody used this tweak and doesn't know how to mend with the, now correct, code below, please feel free to ask.

returning to original text:
maybe someone has done this before. Searches for "restartplus" and "restart plus" returned nothing, "restart" returned too much to handle, so I tried it myself.
I just hacked a few lines into the restart.kmm, from the one without the button, but you could probably add the same lines there (restart2.7z when downloading, that one should be).

Having added these lines, you won't be asked whether or not to load your last session after you restarted via "-> File -> Restart Plus", it IS loaded. So, if you do NOT want the session to load, you'll have to exit & start the standard way - then you'll be asked.

I don't manage to color my new lines, so they are big italics.
Here is the code:
_________________________________________________________________

# K-Meleon Macros

(http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- restart kmeleon
#
# Dependencies : - jaffa cakes, plus the Session Saver
# -kplugin activated in F2 -> K-Meleön Plugins
# Resources : -
# Preferences : -
# --------------------------------------------------------------------------------

$_tool_path=getfolder(RootFolder)."\\Tools";
$_km_path=getfolder(RootFolder)."\\k-meleon.exe";

_restart_command{
setpref(BOOL,"kmeleon.plugins.sessions.ask_autoload",false);
exec($_tool_path."\\restartkm.exe \"".$_km_path."\"");
}

_ReTogAsk_command{
setpref(BOOL,"kmeleon.plugins.sessions.ask_autoload",true);

}


_restart_BuildMenu{
# file menu
setmenu("CloseWindow",macro,"Restart Plus",_restart_command,4);
}
# ------------------------------------------------------------
$OnInit=$OnInit."_restart_BuildMenu;";
$OnStartup=$OnStartup."_ReTogAsk_command;";
$macroModules=$macroModules."restarter;";





That's all there is to it.

Cheers
SoerenB


Back again ...



Edited 5 time(s). Last edit at 02/23/2010 10:13AM by SoerenB.

K-Meleon forum is powered by Phorum.