Groups2 questions ...
Posted by: micro
Date: August 05, 2010 09:21PM

Thu Aug 05 14:58:26 BST 2010

Hi JamesD and desga2,

Thanks for creating the Groups2 extension.

1) Upon initial installation, is k-meleon_Groups2.count 0 or 1?

2) Somehow, mine was set to 0. Subsequent deletion of groups (that did not exist)
caused this value to go negative. Addition of any new group showed that it
already existed ($_Groups2_Match defaulting to "true"?)
Things only behaved properly when this is set to 1.

3) If a group is deleted, the prefs stay. eg:
a) initially save a group of 5 tabs under name 'test'
b) delete group 'test'. k-meleon_Groups2.test.<0-4> remain in prefs
c) add 3 more tabs (total now 8)
d) save group under name 'test'. At this point, k-meleon_Groups2.test.count=8,
but prefs k-meleon_Groups2.test.<5-7> are not created.
(Same happens if an overwrite is requested.

Is there a way to completely remove these prefs when a group is deleted?

EDIT: When k-meleon is restarted, the prefs mentioned in 3 are removed for deleted groups.

TIA

µ



Edited 2 time(s). Last edit at 08/05/2010 09:46PM by micro.

Re: Groups2 questions ...
Posted by: desga2
Date: August 06, 2010 06:11AM

Hi micro, thanks for your report.

As you can look your problem begin because you had some groups from some previous version of Groups in your prefs.js file in your profile.
Groups2 must have k-meleon_Groups2.count to 0 in initial installation.
This produce to you the problems 1 and 2. Problem 3 can be a code designed problem that we need check to fix it.
Like you tested preferences are definitely deleted when K-Meleon is closed.
This is the K-Meleon way to work with preferences.

Is possible this will be fixed in next release of Groups2 and this could include HotGroups options (open Groups with Hotlinks feature):
http://kmeleon.sourceforge.net/forum/read.php?1,109132

Greetings.

K-Meleon in Spanish



Edited 2 time(s). Last edit at 08/06/2010 06:15AM by desga2.

Re: Groups2 questions ...
Posted by: micro
Date: August 06, 2010 05:38PM

Fri Aug 06 11:30:05 BST 2010

Hi desga2,

Thanks for responding. I have confirmed that it starts off at 0 by manually resetting k-meleon_Groups2.count.

Please investigate the behaviour when a single group is created and then deleted twice (without restarting k-meleon).

Please also then look at what happens when attempting to save a group under *any* other name (when .count is negative).

µ

Re: Groups2 questions ...
Posted by: JamesD
Date: August 06, 2010 08:38PM

@ desga2

I can confirm the count goes to -1 when extra deletes of a group are done. The following is some code I did for Groups Multisearch which is to verify that the name chosen by the user is in fact a multisearch group. Shall I work on putting something like this into Groups2 or are you already working on that? I know you are already busy with preferences stuff.

Edit: I see you already have some code for this in HotGroups.

Edit2: Groups2 is catching duplicate deletes, but Groups2_HotGroups is not. Also did not remove from menu on first delete.


##########  DELETES

_Grp_M_Search_Del {
macroinfo = _("Delete an existing multisearch group.");
$_Grp_M_Search_Names =  getpref(STRING,"k-meleon_search_group.names");
##  only 62 character display in prompt - display other name in statusbar
if (length($_Grp_M_Search_Names) > 62 ) {
	macros(_Grp_M_Search_LongList);
	$_Grp_M_Search_Na62 = substr($_Grp_M_Search_Names, 0 , $_Grp_M_Search_pcp);
	$_Grp_M_Search_Na63 = substr($_Grp_M_Search_Names, $_Grp_M_Search_pcp +1 );
	statusbar("Additional Names >> ".$_Grp_M_Search_Na63);
	$_Grp_M_Search_Delete = prompt($_Grp_M_Search_Na62, _("For delete, enter name without the %"));
	statusbar("");
	} else {
	$_Grp_M_Search_Delete = prompt($_Grp_M_Search_Names, _("For delete, enter name without the %"));
	statusbar("");
	}
## catch cancel
$_Grp_M_Search_Delete == "" ? &_Grp_M_Search_CancelD : &_Grp_M_Search_Missing ;
}

_Grp_M_Search_LongList {
##  compute position last delimiter in first 62 string
$_Grp_M_Search_pos = 61 ;
while($_Grp_M_Search_pos != -1 ) {
	if (substr(	$_Grp_M_Search_Names, $_Grp_M_Search_pos, 1 ) == "%") {
		$_Grp_M_Search_pcp = $_Grp_M_Search_pos;
		$_Grp_M_Search_pos = -1 ;
		} else {  $_Grp_M_Search_pos = $_Grp_M_Search_pos -1 ; }
}
}

_Grp_M_Search_Missing {
## catch missing
macros(_Grp_M_Search_DelV);
$_Grp_M_Search_Mis == true ? &_Grp_M_Search_misx : &_Grp_M_Search_Del2  ;
}

_Grp_M_Search_CancelD {
$_Grp_M_Search_Can = confirm(_("Did you mean to cancel?"), _("Prompt was cancelled"),YESNO,QUESTION);
$_Grp_M_Search_Can == "YES" ? 0 : &_Grp_M_Search_Del ;
}

_Grp_M_Search_misx {
$_Grp_M_Search_mis = confirm(_("The name  ").$_Grp_M_Search_Delete._("  is not found."), _("Not in list"),RETRYCANCEL,QUESTION);
$_Grp_M_Search_mis == 0 ? 0 : &_Grp_M_Search_Del ;
}



Edited 3 time(s). Last edit at 08/06/2010 09:41PM by JamesD.

Re: Groups2 questions ...
Posted by: JamesD
Date: August 07, 2010 01:07AM

I have a partial fix for Groups2_HotGroups.kmm. This addresses the problem of allowing a group to be deleted twice. The third line in the code below should be added to Groups2_HotGroups.kmm right after the first two lines which already exist.
_Groups2_RunCode_Delete {
macroinfo = _("Delete a saved group of tabs.");
$_Groups2_Match = "";

I am still researching why the menu is not updating.

Edit: Menu does not update only when deleting the only group. Deleting a group when there are two or more groups works just fine. The same bug in also in Groups2.kmm.



Edited 1 time(s). Last edit at 08/07/2010 02:40AM by JamesD.

Re: Groups2 questions ...
Posted by: desga2
Date: August 07, 2010 02:52AM

@ JamesD:

Quote
JamesD
Shall I work on putting something like this into Groups2 or are you already working on that? I know you are already busy with preferences stuff.

Edit: I see you already have some code for this in HotGroups.

Edit2: Groups2 is catching duplicate deletes, but Groups2_HotGroups is not. Also did not remove from menu on first delete.

I'm not changed the Groups2 code since Groups2_HotGroups was released.
Yes I'm busy currently with 1.6a4 preferences and chrome.
You must remember that Groups2 is also your code and your help is very apreciate by me.
Groups2_HotGroups is the 0.6.3 code released in MacroLibrary with HotGroups functions added only, no more code was changed (except the little variable with bad named that you detected and send me by mail, it was changed in the Groups2 0.6.3 version in MacroLibrary).

Please, can you try to fix micro reported errors and send me the macro file to test it when I have some free time?

Thanks.

K-Meleon in Spanish



Edited 1 time(s). Last edit at 08/07/2010 02:54AM by desga2.

Re: Groups2 questions ...
Posted by: JamesD
Date: August 07, 2010 04:04AM

@ desga2

I have found the error. Same in both files. Still have to get all my alert--DEBUG statements out of code. A few more hours for clean up and testing should do it. I will e-mail you notes and code.

Re: Groups2 questions ...
Posted by: micro
Date: August 07, 2010 11:17PM

Sat Aug 07 17:15:28 BST 2010

Hi desga2 and JamesD,

Thanks for looking into this and finding a solution.

What about saving a group (with more tabs) that was previously deleted (before a restart)?

µ



Edited 1 time(s). Last edit at 08/07/2010 11:24PM by micro.

Re: Groups2 questions ...
Posted by: JamesD
Date: August 07, 2010 11:40PM

Quote
micro
What about saving a group (with more tabs) that was previously deleted (before a restart)?

A short answer would be no. The groups information is contained as user prefs in your prefs.js file. When a delpref() command happens the user pref is deleted right away.

The other anwser is that I will have a look to see if there can be some history of groups deletion created. This may take a little time.

Re: Groups2 questions ...
Posted by: desga2
Date: August 08, 2010 07:40AM

@ micro:

Are you copy the Groups2's macro code from MacroLibrary o installed it from Extension Central with his exe file?
That I like know is if your Groups version is the last code in MacroLibrary 0.6.3.
Can you check your groups2.kmm file version in your macros folder?

Version is in the header of file, the .kmm file can be opened with any text editor:

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
# File name: Groups2.kmm
# ---------- Groups2 in tabs for K-Meleon 1.5.x and later -------------------------------
#
# Dependencies                : main.kmm KM version 1.5 or later and tabs
# Resources                        : -
# Preferences                : k-meleon_Groups2.<group_name>.<#> = URL
#                                        : k-meleon_Groups2.<group_name>.count = Number of URLs in group
#                                        : k-meleon_Groups2.count = Total of groups count
#                                        : k-meleon_Groups2.<#> = Group name
#                                        : k-meleon_Groups2.startup = Start group name
#                                         : k-meleon_Groups2.exportpath, k-meleon_Groups2.importpath, 
#                                         : k-meleon_Groups2.backuppath, k-meleon_Groups2.paths
# Version                        : 0.6.3 2010-06-02
# Authors                        : JamesD and desga2
# ---------------------------------------------------------------------------------------

Thanks.

K-Meleon in Spanish



Edited 1 time(s). Last edit at 08/08/2010 07:40AM by desga2.

Re: Groups2 questions ...
Posted by: micro
Date: August 09, 2010 05:53PM

Mon Aug 09 11:47:08 BST 2010

@ desga2:

Groups2 version:
# Version : 0.6.3 2010-06-02
K-Meleon version: 1.5.4

file downloaded was a .7z compressed file: http://kmext.sourceforge.net/macros/groups2.7z

loaded using Tools -> Extensions Manager

µ

Re: Groups2 questions ...
Posted by: JamesD
Date: August 17, 2010 06:39AM

@ micro

Sorry to be so long with an answer. I think I can have a new version ready in three days. That all depends on how much time I get on the computer. Some of the delay has been that I was waiting on desga2, the co-author, to return emails. Right now he is very, very busy on the chrome for the Preferences panels, so he said I go ahead without waiting on him.

Thanks for bringing to our attention the negative number count problem. I have that fixed and I also have history working in some test code. Groups2 is getting many options now and each one adds complexity.

For testing this version, I will have to make a written test plan. I don't want another problem like the negative number count to show up later, and I don't have desga2 testing my testing.

Thank you for your patience.

Re: Groups2 questions ...
Posted by: JamesD
Date: August 18, 2010 11:16PM

I have finished Groups2 version 0.6.7 and it is available here. http://dl.dropbox.com/u/1522294/Groups2_067.7z

You may replace your Groups2.kmm file version 0.6.3 by copying this code to the same location. You might wish to make a backup prior to replacing the code.

There are now stops in place to prevent a deletion starting if there are no groups to delete. This should prevent negative numbers for count.

There is a session history for deleted groups. The history is deleted when KM is closed. I don't use the KM loader, so I don't know if the OnQuit is ever called in that case.

Re: Groups2 questions ...
Posted by: SoerenB
Date: August 19, 2010 01:08AM

Hi, JamesD,
great work, thanks!

Just one tiny improvement suggestion:

I always find it more agreeable to have menu items which I use frequently closer to the menu's top than those I use rarely.

(Edited to mend the issue thar JamesD mentions in the next postsmiling smiley

Consequently, in the Groups2.kmm, I moved the lines

	$_Groups2_DelName = "";
	&_Groups2_BuildGroupsMenu;

from their position as the last lines of the "_Groups2_BuildMenu" section
to this place (marked red) near the top:

_Groups2_BuildMenu {
if ($kTabs) {
	$_g = "&Groups";
#	setmenu(Main, popup, $_g, "&Tools");
	$_Groups2_DelName = "";
	&_Groups2_BuildGroupsMenu;
	$__m = "_Groups";

Btw., as I have that menu as the Right/LongLeftClick action of the chevron in siria's Little toolbar for personal HOTLINKS, I don't need it to fatten my main menu, and commented that one out (blue line in code).

Anybody sharing my tastes, concerning this?

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 3 time(s). Last edit at 08/19/2010 05:39AM by SoerenB.

Re: Groups2 questions ...
Posted by: JamesD
Date: August 19, 2010 02:58AM

@ SoerenB

Did you check the error console after that? I tried it, and I am seeing an error about $_Groups2_DelName.

You can, of course, make any changes in your copy. I don't know if the average user would know how to use Groups2 without the item on the menu. I have no idea how to start it using your method. But that is just me. I like items to click on with the mouse.

Re: Groups2 questions ...
Posted by: SoerenB
Date: August 19, 2010 05:32AM

Hi, JamesD,

thanks for pointing out the error. I was able to fix that, will edit the above post soon. - But, of course, not having the slightest idea about the inner workings of groups2, I do NOT know for sure if everything is always going to work - especially not deleting groups ...
So, anybody using my tweak should not complain to JamesD if things go wrong - and have your backups handy!

Quote
JamesD
I like items to click on with the mouse.

Oh yes, so do I! (one of my early posts here was about Mouse Only Browsing ...)
I get the Groups2 menu (whether tweaked or not) by longClicking a Button. As I said, I'm using the "chevron"-like button of siria's hotlinks toolbar:
%ifplugin macros
	Hotlinks{
	macros(kmPrefs())|&Groups
	Prefs. LongClick for Groups
	myhotlinksLive.bmp[10]
	myhotlinks.bmp[10]
	}
	%endif

- any other button would do, it's the '|&Groups' part that does the trick.

For me, though, the menu order was the more important issue. What do you think about that "frequently used -> to the top" preference?

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 ...

Re: Groups2 questions ...
Posted by: JamesD
Date: August 19, 2010 10:27AM

@ SoerenB

If you get a clean error console with your latest change, then everything should work. I forgot to ask whether you stop and restart KM when you use it or do you leave it running?

Seems that the 'delpref{}' function only finishes when KM shuts down, Therefore I can only do the history cleanup at the OnQuit event.

Re: Groups2 questions ...
Posted by: SoerenB
Date: August 19, 2010 02:05PM

Hi, JamesD,

Quote

whether you stop and restart KM when you use it

-I'm not sure what you mean by "it"?
After editing the kmm: restart, of course. But that is only done once in the lifetime of the kmm ... If I get the editing right the first time, that is. smiling smiley
After deleting a group: haven't tried yet. Seems like I should, you're meaning to say?

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 1 time(s). Last edit at 08/19/2010 02:08PM by SoerenB.

Re: Groups2 questions ...
Posted by: JamesD
Date: August 19, 2010 05:58PM

Quote
SoerenB

Quote

whether you stop and restart KM when you use it


-I'm not sure what you mean by "it"?
After editing the kmm: restart, of course. But that is only done once in the lifetime of the kmm ... If I get the editing right the first time, that is. smiling smiley
After deleting a group: haven't tried yet. Seems like I should, you're meaning to say?

I do not leave KM running when I am not using it. So each time I stop KM when I am finished. When I stop KM the OnQuit event happens and that is where session history is deleted. My question was whether you stopped KM each time you finish using it, or do you just leave it running? If you leave it running, then history is not deleted. If you use the loader, I think you are leaving KM running.

Re: Groups2 questions ...
Posted by: SoerenB
Date: August 19, 2010 06:51PM

Ah - the loader,

well. no, I learned hating the loader, messin' 'n fiddlin' with my KM all the time, editing a cfg, adding a macro, switching off a plugin ... And if you forget killing the loader, there's trouble ahead ...

But I do admit to having open a minimized KM window most of the times.

Error console warning hasn't appeared any more since my fix.

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 ...

K-Meleon forum is powered by Phorum.