Extensions :  K-Meleon Forum
All about K-Meleon extensions. 
Now this works! Unprompted PreviousSession loading on "Restart" , else: prompt user.
Posted by: SoerenB
Date: February 22, 2010 02:37AM

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

KM 1.74b4u1 in Wine 1.6 on Linux Mint 17 (XFCE)
- and still being surprised every day
how easily all of this works ...



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

Options: ReplyQuote


K-Meleon forum is powered by Phorum.