Development :  K-Meleon Web Browser Forum
K-Meleon development related discussions. 
Group & Session Macros For v0.8
Posted by: jsnj
Date: October 28, 2003 09:24PM

I expanded upon and tweaked the "Save Layers As Group" macros. They're posted here in the Macro Library section within the Wiki pages. I'm lookin for any interested v0.8 beta users to try them out to confirm that they work correctly and to give some feedback. They work fine on the PC's I tested it on, but I don't know if they work for anybody else.

Options: ReplyQuote
Re: Group & Session Macros For v0.8
Posted by: alain.NOSPAM.aupeix@wanadoo.fr
Date: October 29, 2003 02:44PM

Works well with 833.

Just a remark, is-it necessary to close all layers open before Ctrl-Alt-L ??
Isn't it possible to make a difference between Onload and Ctrl-Alt-L?

For example you can have an empty value in Global (Onloaded = "")

and

OnLoad {
&buttonSync;
$group = pluginmsgex(layers,"GetLayersInWindow","",STRING);
setpref(STRING, "kmeleon.grouptemp", $group);
$loaded == "" ? 0 : macros($loaded);
OnLoaded = "Yes"
}

After, a test of OnLoaded in the macro where you close the layers can make the difference.

Perhaps, it's not possible or difficult.

Options: ReplyQuote
Re: Group & Session Macros For v0.8
Posted by: jsnj
Date: October 29, 2003 07:05PM

Ctrl+Alt+L references macros(OpenLast) which gets its group info on exit from macros(OnQuit) which gets its group info from macros(Onload). This could've been easier if the OnQuit macro would accept plugin commands, but it doesn't, hence the work around I had to create.

If I'm understanding you correctly, what you want is for the last session to be opened alongside the currently open layers. This can be done similar to the Alt+/ "Open Group In Background" macros(GroupBg). Replace OpenLast with this one which opens the last session in the background

OpenLast{
$curr = pluginmsgex(layers,"GetLayersInWindow","",STRING);
$group = getpref(STRING, "kmeleon.grouplast");
pluginmsg(layers, "ReplaceLayersInWindow", $curr . $group);
}


Or this one which opens the last session in the foreground to the left of the currently opened layers:

OpenLast{
$curr = pluginmsgex(layers,"GetLayersInWindow","",STRING);
$group = getpref(STRING, "kmeleon.grouplast");
pluginmsg(layers, "ReplaceLayersInWindow", $group . $curr);
}


I haven't figured out a way to open a group alongside currently opened layers without having to reload the currently opened layers. I'm not sure if that's possible. Thanks for the feedback. Did you test the other functions?

Save As Group Alt+G
Add URL To Group Alt+U
Add Layers To Group Alt+L
Define Startup Group Alt+S
Disable Startup Group Alt+X

Options: ReplyQuote
Re: Group & Session Macros For v0.8
Posted by: alain.NOSPAM.aupeix@wanadoo.fr
Date: October 30, 2003 08:09AM

Ok, I thought it istn't easy, the only thing I ought to do was not to close layers opened if I launch Ctrl-Alt-L.

To make simply my demand:

I have a few layer groups
I have one Onload

I, sometimes want to load others groups without closing Onload group or others layers with perhaps having control and don't load layers already loaded (here is the difficult, perhaps)

If it too difficult, I think, it's not a problem, we'll use it without its feature.

Another feature, which is easier and more important, is to update the Onload group, when inserting a new layer in the group with Add menu entries. I think you know what I mean.

Options: ReplyQuote
Re: Group & Session Macros For v0.8
Posted by: jsnj
Date: October 30, 2003 05:08PM

Another feature, which is easier and more important, is to update the Onload group, when inserting a new layer in the group with Add menu entries. I think you know what I mean.

I'm not quite sure what you mean. Do you mean the ability to automatically have the group name listed in your menus when it is created? That would require building a plugin like the bookmarks plugin. The only file that can be automatically written to is the prefs.js file. That's where the groups are saved and then ,as you know, you just type the group's name in the URL bar to open all the layers that are in the group.

If you only ever have just one group that you use and frequently modify, then MonkeeSage's session macro may be more to your liking since it identifies each URL within that group as a number which is listed in menus. My group macros are designed as an easy way to save, add to, and open many different groups.

Options: ReplyQuote
Re: Group & Session Macros For v0.8
Posted by: alain.NOSPAM.aupeix@wanadoo.fr
Date: October 31, 2003 07:08AM

I'm not quite sure what you mean. Do you mean the ability to automatically have the group name listed in your menus when it is created?

No, I just think to startup group.

If you add an URL to the group, it is not automaticly (or after a question) added to the startup group.

Options: ReplyQuote
Re: Group & Session Macros For v0.8
Posted by: jsnj
Date: October 31, 2003 07:12PM

If you add an URL to the group, it is not automaticly (or after a question) added to the startup group.

Yes it is. When you add a URL to any particular group with the "Add URL To Group \ Alt+U" macro, it IS automatically added. You can double check this by looking at the group string in prefs.js after you add the URL to the group.

The Startup group is seperate and has to be specified with the "Define Startup Group \ Alt+S" macro. So if you add a new URL to a group named: 'kmeleon', if your Startup Group is defined as 'kmeleon', then the next time you start the browser, the new URL will open with the group named: 'kmeleon'.

Options: ReplyQuote
Re: Group & Session Macros For v0.8
Posted by: jsnj
Date: October 31, 2003 07:30PM

Oh, I think I know what you mean now. I'll try and fix that and then post the update.

Options: ReplyQuote
Re: Group & Session Macros For v0.8
Posted by: jsnj
Date: October 31, 2003 08:47PM

OK. Thanks for catching that. I posted the fix in the macro wiki section. These are the macros changed:

DefineStartupGroup {
menu = "Define Startup Group";
$name = prompt("Enter Startup Group name. Type 'last' to continue from last session.", "Startup Group Name?", "");
$group = getpref(STRING, "kmeleon.group." . $name);
$name == "" ? "" : setpref(STRING, "kmeleon.general.startGroupName", $name);
$name == "" ? "" : setpref(BOOL, "kmeleon.general.startGroup", "true");
$name == "" ? "" : setpref(BOOL, "kmeleon.general.startHome", "false");
$name == "" ? "" : setpref(BOOL, "kmeleon.general.startLastSession", false);
$name == "" ? "" : getpref(STRING, "kmeleon.general.startGroupName") == "last" ? macros(AlertLast) : "";
$name == "" ? "" : getpref(BOOL, "kmeleon.general.startLastSession") == "false" ? macros(AlertGroup) : "";
}

StartupGroup{
$name = getpref(STRING, "kmeleon.general.startGroupName");
$group = getpref(STRING, "kmeleon.group." . $name);
setpref(STRING, "kmeleon.groupstart", $group);
$group = getpref(STRING, "kmeleon.groupstart");
pluginmsg(layers, "ReplaceLayersInWindow", $group);
}

Options: ReplyQuote
Re: Group & Session Macros For v0.8
Posted by: jsnj
Date: October 31, 2003 09:18PM

You can delete this line in the DefineStartupGroup macro above:

$group = getpref(STRING, "kmeleon.group." . $name);

Options: ReplyQuote
Re: Group & Session Macros For v0.8
Posted by: alain.NOSPAM.aupeix@wanadoo.fr
Date: November 03, 2003 08:45AM

Nice, that good

When I add an url or layer to the group which is choiced to be the startup group, prefs.js is now updated correctly and in the next Kmeleon start, its ok.

:-)

Just a remark (not important), is-it necessary to have:

user_pref("kmeleon.groupstart")

in prefs.js, as we have the name of the start group and its content in another line

Options: ReplyQuote
Re: Group & Session Macros For v0.8
Posted by: jsnj
Date: November 03, 2003 04:08PM

Just a remark (not important), is-it necessary to have:
user_pref("kmeleon.groupstart")


No, it isn't. If you notice, I made a couple more changes and deleted that when I updated it on Nov. 1st. :-)

Options: ReplyQuote
Re: Group & Session Macros For v0.8
Posted by: alain.NOSPAM.aupeix@wanadoo.fr
Date: November 04, 2003 07:52AM

I have a problem with Alt /

With french keyboard, this key don't work
I change it and choose Alt : (/ is shifted : in french keyboard)
and it works

I think that perhaps, it don't work with others keyboards.

When it handles, try other keys, Microsoft seems so bugged ...

That seems the same reasons that for Ctrl + and Ctrl - ...

I've notice that Ctrl-Alt-L clear all layers and launch last opened layers
and Ctrl / (or smiling smiley add layers of a group

Nice ...

Options: ReplyQuote
Re: Group & Session Macros For v0.8
Posted by: jsnj
Date: November 04, 2003 03:53PM

I have a problem with Alt /

With french keyboard, this key don't work


OK. I just changed it to ALT+ENTER. That should be more universal.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.