Re: K-Meleon 1.6.0 Beta Development
Posted by: JamesD
Date: September 14, 2011 07:31AM

Let me try to explain the programming problem that I have and perhaps need for a tab identifier and window identifier will be clearer. Some user asked if there was a way to return a zoomed page to its default size. I made a copy of zoom.kmm and did some work with counters. I added an ALT+SHIFT+0 accelerator to run the new code. This worked very well until I tested with more than one tab.

For each type of zoom; text, images, and page; I changed the count for each zoom. When the user presses ALT+SHIFT+0 (zero) the macro zooms each type until the count is zero. The problem is that all the zooming back happens in the current tab (with focus). If some of the user’s zooms have been in other tabs then those counts are included. The page will be returned to a wrong size.

I need to segregate the zooms by the tab and window so that I can un-zoom only the ones which were done in the current tab and window.

That is also why I asked about an array. Maybe array is the wrong word. What I need is a variable whose name is variable. Where I now have $zoom_text_cnt, I need a variable whose name is $zoom_text_cnt[$_zoom_source]. $_zoom_source is equal to WindowID.”&”.TabID. If this is impossible I can get around it by constructing a user-perf name with WindowID.”&”.TabID.

I have a copy of my version of zoom.kmm here: http://dl.dropbox.com/u/1522294/zoom.7z

Re: K-Meleon 1.6.0 Beta Development
Posted by: deadlock
Date: September 14, 2011 07:58PM

@JamesD
That is confusing.
I'll keep that in mind for later.

Your zooming affects all open tabs,
while my zooming with <ctrl> + mouse wheel
only changes the current tab.
Is it really such a problem to change
default zoom.kmm to do the opposite?

It may be related to Siria's problem with
Block Advertisement refreshing all tabs.

Reset of zoom should be added to accelerators.

Re: K-Meleon 1.6.0 Beta Development
Posted by: JamesD
Date: September 15, 2011 12:05AM

Quote
deadlock
Your zooming affects all open tabs,
while my zooming with <ctrl> + mouse wheel
only changes the current tab.

I don't see that. If I open another tab and go to that tab, I can zoom in the text four times. If I then return to this tab and do ALT+SHIFT+0, the text here will be zoomed out four times. The text in the other tab will remain four zooms bigger than the default. The zoom macro only affects the tab in focus.

Edit: I think I know the difference. I used the zoom buttons on the KM toolbar. How does the mouse wheel change the zoom? Does it not use zoom.kmm? When I zoom with the wheel, then ALT+SHIFT+0 does nothing.



Edited 1 time(s). Last edit at 09/15/2011 12:13AM by JamesD.

Re: K-Meleon 1.6.0 Beta Development
Posted by: deadlock
Date: September 15, 2011 04:11AM

@JamesD
You said your new zoom.kmm changed all open tabs.
I only tested with default zoom.kmm from 1.6b2.
Using <ctrl> with mouse wheel works like <ctrl> with "+/-".
With keyboard only, status bar displays "Full Zoom: 2-40".
All tabs are independent.

>The text in the other tab will remain four zooms bigger
>than the default.

I misunderstood that? So where was the real problem?
You wrote this before:
>I added an ALT+SHIFT+0 accelerator to run the new code.
>This worked very well until I tested with more than one tab.

Doesn't "very well until" mean - reset changed all tabs?

>Edit: I think I know the difference.
>I used the zoom buttons on the KM >toolbar.
>How does the mouse wheel change the zoom?
>Does it not use zoom.kmm?
>When I zoom with the wheel, then ALT+SHIFT+0 does nothing.


I never used zoom buttons and I still don't need them.

Ooops! Keyboard and mouse wheel do not use zoom.kmm!
Wouldn't it be better to add <ctrl> + <numpad 5> and
doubleclick mouse wheel to the program for reset of zoom?

A quick look in about:config with search for zoom
shows a mess of values, but I won't understand
how zoom.kmm works until I've written my own.

Re: K-Meleon 1.6.0 Beta Development
Posted by: JamesD
Date: September 15, 2011 04:35AM

Quote
deadlock
Ooops! Keyboard and mouse wheel do not use zoom.kmm!
Wouldn't it be better to add <ctrl> + <numpad 5> and
doubleclick mouse wheel to the program for reset of zoom?

I have no idea how to reset a zoom done with the mouse wheel. It does not seem worthwhile to continue the zoom project. I had never used the keyboard or the mouse wheel for zoom. Scratch head, and start all over someday.

Re: K-Meleon 1.6.0 Beta Development
Posted by: deadlock
Date: September 15, 2011 05:22AM

@JamesD
>I have no idea how to reset a zoom done with the mouse wheel.
A reset is applied on first frame.
Zooms to 100%. I can add a keycode.

float zoom = (float)theApp.preferences.GetInt("zoom.defaultPercent", 100);
this->mpBrowserView->GetBrowserWrapper()->SetFullZoom(zoom / 100);

>Scratch head, and start all over someday.
Write a small example to describe the problem
using more than one tab.

Re: K-Meleon 1.6.0 Beta Development
Posted by: JamesD
Date: September 15, 2011 06:09AM

I had no idea that there were so many ways to zoom. These keys apparently call the the command ID directly. I see no way to capture the action. I have even less of an idea how to capture a action by the mouse wheel.

Zoom
CTRL VK_PLUS 	 ID_FONT_INCREASE 	Increase the font size.
CTRL VK_ADD 	 ID_FONT_INCREASE 	Increase the font size.
CTRL VK_MINUS 	 ID_FONT_DECREASE 	Decrease the font size.
CTRL VK_SUBTRACT ID_FONT_DECREASE 	Decrease the font size.

I think I can capture these actions, because they are in zoom.kmm.

Defined by Macros: zoom.kmm
ALT VK_PLUS 	        macros(Zoom_Images_In) 	Increase image size.
ALT VK_ADD 	        macros(Zoom_Images_In) 	Increase image size.
ALT VK_MINUS 	        macros(Zoom_Images_Out) Decrease image size.
ALT VK_SUBTRACT 	macros(Zoom_Images_Out) Decrease image size.
CTRL ALT VK_PLUS 	macros(Zoom_Page_In) 	Zoom into the current page.
CTRL ALT VK_ADD 	macros(Zoom_Page_In) 	Zoom into the current page.
CTRL ALT VK_MINUS 	macros(Zoom_Page_Out) 	Zoom out of the current page.
CTRL ALT VK_SUBTRACT 	macros(Zoom_Page_Out) 	Zoom out of the current page.

This information came from: http://kmeleon.110mb.com/lizard/commands.html#l_defaccel

I can describe how you can see the problem on your own computer if you wish to temporarily install the zoom.kmm file that I referenced a couple of posts ago. Remember, my fix does not capture all zoom methods.

Re: K-Meleon 1.6.0 Beta Development
Posted by: deadlock
Date: September 15, 2011 07:03AM

@JamesD
>CTRL VK_PLUS ID_FONT_INCREASE Increase the font size.
>CTRL VK_ADD ID_FONT_INCREASE Increase the font size.
>CTRL VK_MINUS ID_FONT_DECREASE Decrease the font size.
>CTRL VK_SUBTRACT ID_FONT_DECREASE Decrease the font size.

They use page zoom not ID_FONT_INCREASE/ID_FONT_DECREASE.

>I can describe how you can see the problem on your own computer
>if you wish to temporarily install the zoom.kmm file

Just did.
If I use zoom in 3 times it can be reset with <alt><shift>0.
If I use zoom out 3 times it can NOT be reset with <alt><shift>0.

Reset of second tab does not change first tab (good).
The concept is wrong, if it doesn't reset pages zoomed
with <ctrl><+>. You should fix that first.
With 144 lines it is not a good example.

Re: K-Meleon 1.6.0 Beta Development
Posted by: JamesD
Date: September 15, 2011 09:08AM

@ deadlock

You have found something new. Well, new to me. There is an item in EDIT - PREFERENCES - PAGE DISPLAY - GENERAL. It is called default zoom. You cannot go as far with page out as you can with page in zoom if you are set at the default of 100.

Also you must use one of the methods which uses the zoom.kmm file in order for the zoom action to be captured.

Try this for a test.
Open two tabs each with some text showing. Go to the tab on the right in your tab bar. Increase the text zoom there two times using "CTRL ALT VK_PLUS". (I am assuming that is the one on the numeric keypad.) Change the focus to the tab on the left. Reset the zoom using ALT+SHIFT+0. Your left tab will zoom out twice or to the minimum default zoom. Check the text zoom in the statusbar. Shift the focus to the right tab. It has not changed. Try ALT+SHIFT+0 again. Nothing will happen. All the count was used when you were in the left tab. The count was global because I don't have any way to identify which tab did the zooms. If the zooms had been identified as belonging to the right tab, then nothing should have happened when you were in the left tab and pressed ALT+SHIFT+0. The right tab's count would have been kept available in case you wanted to reset the right tab.

The whole reset of zooms idea has a major flaw. There are ways to zoom that do not use zoom.kmm. If I am wrong in this it is because I don't see the point at which the other methods enter zoom.kmm.

Re: K-Meleon 1.6.0 Beta Development
Posted by: deadlock
Date: September 15, 2011 07:21PM

@JamesD

>Also you must use one of the methods
>which uses the zoom.kmm file in order
>for the zoom action to be captured.

That is wrong.
Zoom.kmm must learn to read
zoom level of active view.

>All the count was used when you were in the left tab.
>The count was global

What creates count and for what?
You where confused by the size of your macro? smiling smiley
Why don't you use zoom.defaultPercent for reset.

>The right tab's count would have been kept available
Did you intend to save zoom levels for every tab and window?

>The whole reset of zooms idea has a major flaw.
True, but a reset option is important.

>There are ways to zoom that do not use zoom.kmm.
>I don't see the point at which the other methods enter zoom.kmm.

As I told you before - they do not use it!
Delete it and use keyboard and mouse wheel zoom.

Re: K-Meleon 1.6.0 Beta Development
Posted by: JamesD
Date: September 16, 2011 03:37AM

Quote
deadlock
>Also you must use one of the methods
>which uses the zoom.kmm file in order
>for the zoom action to be captured.
That is wrong.
Zoom.kmm must learn to read
zoom level of active view.

>There are ways to zoom that do not use zoom.kmm.
>I don't see the point at which the other methods enter zoom.kmm.
As I told you before - they do not use it!
Delete it and use keyboard and mouse wheel zoom.

Those are conflicting goals.

From my recent research:
1) All zooming seems to start from a value of 10.
2) The text zoom value is reported in Special Global Variables as $TextZoom. It is also shown in the statusbar after a change.
3) The full zoom value is shown in the statusbar after a change, except when the change is by the mouse wheel. It is not reported in the Special Global Variables.
4) The zoom.defaultPercent affects how much of the page is shown, but zooming always begins at a value of 10. It is of no use to us here.
5) Only values reported in Special Global Variables are available to the macro language.
6) There are two other zooms. One is image (singular) and the other is images (all). They don't ever seem to be reported.

If all methods of zooming reported $TextZoom, $FullZoom, and $ImagesZoom to the Special Global Variables, Zoom.kmm would not need to maintain any counts. On a request to reset, it would just compare the various reported zooms to 10 and zoom in or out based on the difference.

$FullZoom and $ImagesZoom reporting does not exist yet.

Singular image zooms I would ignore for reset purposes.

Re: K-Meleon 1.6.0 Beta Development
Posted by: deadlock
Date: September 16, 2011 11:26PM

@JamesD
>Those are conflicting goals.
I want to reset zoom and you don't? smiling smiley

From my recent research:
1) A pref value of your choice.
2) Yes.
3) Yes.
4) Wrong. See 1).
5) Wrong. You have access to GRE prefs too.
6) Not documented. Who wrote the code?

>Zoom.kmm would not need to maintain any counts.
It took two years to get that idea?

>$FullZoom and $ImagesZoom reporting does not exist yet.
It may be possible to write a script for that but I was
lazy and implemented ID_FULLZOOM_RESET in KM1.6b3.

>Singular image zooms I would ignore for reset purposes.
As I did. It requires a bigger menu and more code.

Here is a fresh version for KM 1.6b2 zoom.kmm file.

Re: K-Meleon 1.6.0 Beta Development
Posted by: JamesD
Date: September 17, 2011 12:16AM

RE new zoom - I like it.

Re: K-Meleon 1.6.0 Beta Development
Posted by: deadlock
Date: September 26, 2011 02:16AM

Quote
JamesD
Quote
deadlock
@JamesD
I didn't test privileges.

I just finished testing. Yes, everything works just right now. I test both ways by running once with the current troubleshooting.kmm from guenter and then I change the test line from != to == in order to see if the error message (privilege.xhtml) is desplayed. It does work.

I think the code is good to go now. Thank you and thank guenter for the code to bypass the about: stuff.

@JamesD
Finally!
Found the menu option in:

Help/Troubleshooting/Check Privilege

K-Meleon freezes if I click on it.
Tested with KM 1.6 and KM 1.7.
Troubleshooting.kmm is in /macros,
warning page is available and
it is activated in preferences.
Are there any other dependencies?

Re: K-Meleon 1.6.0 Beta Development
Posted by: JamesD
Date: September 26, 2011 03:04AM

@ deadlock

The embed.jar file must include the Privilege.xhtml file from Guenter's post a page back in this thread.

The mozilla.xhtml file in the jar should be one for a quote from the book of mozilla.

Troubleshooting.kmm should be the version which includes this line.
$_TS_WarnPath="chrome://global/content/privilege.xhtml";

When I have the embed.jar file correct, I have no problems with troubleshooting in 1.6.0b2 or 1.7 versions.

Re: K-Meleon 1.6.0 Beta Development
Posted by: guenter
Date: September 26, 2011 03:59AM

Understand: Not me but You and deadlock worked out the code in & around Privilege.xhtml.

p.s. @ deadlock I had to delete some files on dhost.info to create space for an upload. I You also need more space maybe delete one of the SDK.
They could be downloaded to the wiki instead.



Edited 1 time(s). Last edit at 09/26/2011 04:04AM by guenter.

Re: K-Meleon 1.6.0 Beta Development
Posted by: JamesD
Date: September 26, 2011 06:39AM

@ guenter

Don't minimize your contribution. I would still be trying to use "about:mozilla" if you had not put the path starting with chrome into the kmm file.

@ deadlock

I have put my embed.jar and troubleshooting.kmm into a 7zip file on dropbox. http://dl.dropbox.com/u/1522294/TS_complete.7z

A new item in embed.jar is privilege.xhtml. It has the warning message, the warning symbol, and also has had the reference changed to point to the proper FAQ. These items are also referenced in the xhtml file.
    <link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" />
    <link rel="icon" type="image/png" id="favicon" href="chrome://global/skin/icons/warning-16.png"/>


The troubleshooting.kmm file now points to privilege.xhtml in embed.jar. It does not use the "about:" method for this.

I hope this answers all questions. If not, I remain available to try to answer any remaining points.

Re: K-Meleon 1.6.0 Beta Development
Posted by: guenter
Date: September 26, 2011 08:52AM

Quote
JamesD
@ guenter

Don't minimize your contribution. I would still be trying to use "about:mozilla" if you had not put the path starting with chrome into the kmm file.

AFAIK deadlock contributed that code and idea.


Question: Shall I download and upload the code (TS_complete.7z) to dhost.info?



Edited 1 time(s). Last edit at 09/26/2011 09:01AM by guenter.

Re: K-Meleon 1.6.0 Beta Development
Posted by: JamesD
Date: September 26, 2011 09:22AM

AFAIK deadlock contributed that code and idea.
My mistake, I thought you posted that.


Question: Shall I download and upload the code (TS_complete.7z) to dhost.info?
Only if you feel that it is necessary. I can leave it in dropbox for now. Was only to provide deadlock with all the parts needed to make troubleshooting.kmm work.

Deadlock had indicated a problem when he tried to use it. I don't actually have an area of my computer to which I cannot write. My test was to switch out the != with == in order to see if the error/warning worked. Do you think I should try to create a folder to which I do not have write authority and test again? I may have to have help doing that. Would I have to set up some logon for the ops sys?

Re: K-Meleon 1.6.0 Beta Development
Posted by: guenter
Date: September 26, 2011 04:12PM

Quote
JamesD
I can leave it in dropbox for now. Was only to provide deadlock with all the parts needed to make troubleshooting.kmm work.

Ok. I thought it might be already intended as improvement for all.

deadlock has access to dhost.info so he can decide whether or not to upload for all.

Greetings

Re: K-Meleon 1.6.0 Beta Development
Posted by: JamesD
Date: September 26, 2011 07:30PM

@ guenter

It could be used as improvement. I did 7zip the file with chrome and macros folders. That way, if someone extracts to KM's root, it should work just fine. Anyone can reach my dropbox from the public link that I posted. http://dl.dropbox.com/u/1522294/TS_complete.7z

I still have to figure out how to create a user on my computer who does not have write access to c:\Program Files so that I can do real world test.

Some things may yet change. I think the comment block in troubleshooting will need to be fixed. Version, date, and authors are not usually included in KM delivered macros. Also the "chrome://global/skin/netError.css" and "chrome://global/skin/icons/warning-16.png" items should be included in resources.

Have you tried a test to a profile to which you do not have write authority?

Edit: I have updated troubleshooting.kmm and uploaded the new file to the same dropbox location.



Edited 1 time(s). Last edit at 09/26/2011 07:49PM by JamesD.

Re: K-Meleon 1.6.0 Beta Development
Posted by: JamesD
Date: September 26, 2011 08:51PM

I have tried to run KM from a "guest" id and also a "standard" id and I cannot even start KM when logged on that way. The message is that the profile cannot be used. I am on Win7 (32 bit) and I have KM located in c:\Program Files with the profile stored with it.

I have no idea how to run KM without write authority to the profile.

I did test troubleshooting.kmm by adding an alert between the creation of the ini file and the read of the ini file. While the alert was showing, I opened file explorer and deleted the ini file. When I let the macro finish, I got the warning message as I expected.

If anyone can explain how to better test this system, I sure would like to hear from them.

Re: K-Meleon 1.6.0 Beta Development
Posted by: deadlock
Date: September 27, 2011 02:23AM

@JamesD
>The message is that the profile cannot be used.
Should we add more instructions or load your
privilege.xhtml instead?

I had a different problem without access restrictions.

The while loop runs forever using 100% of CPU
if $_Priviledge_End isn't set. I guess you
didn't test it with different profile locations.
It doesn't work with my local profiles and
it may fail with some specific online and
LAN profile locations too.

We should add the privilege tests to the program.
Users should have an option to abort if there is
a problem.

Re: K-Meleon 1.6.0 Beta Development
Posted by: JamesD
Date: September 27, 2011 03:58AM

I guess I don't understand the locations of some of profiles. The code with the "while" was just to reduce the profilepath to one unique word. The macro does not really need to do that. Try replacing the "_Privilege_RunCode" section of troubleshooting with this version.

_Privilege_RunCode {
macroinfo=_("Check KM profile write Privilege");
$_TS_Path = getfolder(ProfileFolder);
alert($_TS_Path);
$_TS_Section = "Profile";
$_TS_Key = "Current" ;
$_TS_Value = $_TS_Path;
$_TS_Path = $_TS_Path . "\\Privilege.ini";
iniwrite($_TS_Section, $_TS_Key, $_TS_Value, $_TS_Path);
macros(_Privilege_Validate);
}


Re: K-Meleon 1.6.0 Beta Development
Posted by: deadlock
Date: September 27, 2011 07:25AM

@JamesD
>was just to reduce the profilepath to one unique word.
Your first CPU burn-in macro. :)

It doesn't freeze without the loop,
creates privilege.ini and shows correct popups.

Should we add about:privileges to GRE?

Re: K-Meleon 1.6.0 Beta Development
Posted by: guenter
Date: September 27, 2011 07:51AM

Quote
deadlock


Should we add about:privileges to GRE?

IMHO the GRE should be patched as little as possible to ease GRE updates by less competent users.

Re: K-Meleon 1.6.0 Beta Development
Posted by: JamesD
Date: September 27, 2011 08:09AM

@ deadlock

It doesn't freeze without the loop,
creates privilege.ini and shows correct popups.

Are you able to create situation where you do not have write privilege to your KM profile? I cannot seem to do that. I always just use a 7z version with the profile in the same folder structure. If I try to log on as another user, I cannot get KM to start.

Should we add privileges to GRE?

We are getting close to that goal. With the revised troubleshooting.kmm code, the complete path to the profile folder is written to the ini file. How likely is it that the path would consist of more than 250 characters? There is a maximum length for an item to be written to an ini file. Do I need code to check the length and sub-string out a value less than 250 characters long if needed?

Edit: Just to be safe, I have added code to sub-string the path to a size the ini file can handle. I have updated TS_complete.7z in dropbox. http://dl.dropbox.com/u/1522294/TS_complete.7z



Edited 1 time(s). Last edit at 09/27/2011 08:26AM by JamesD.

Re: K-Meleon 1.6.0 Beta Development
Posted by: deadlock
Date: September 27, 2011 08:29AM

@Guenter
>I had to delete some files on dhost.info
We can delete the old chrome and use compression.
I've updated troublemaking.kmm.

Fixed the hourglass on startup bug in 1.6b3/1.7b1.
1.6b2 users can stop it with gkwidget.dll from 'alpha 4'.

1.8x will have more hourglasses:
pref('ui.use_activity_cursor', true);

Re: K-Meleon 1.6.0 Beta Development
Posted by: deadlock
Date: September 27, 2011 09:19AM

@JamesD
>I cannot get KM to start.
Owner privilege? tongue sticking out smiley

Uploaded your file to dhost too.

Re: K-Meleon 1.6.0 Beta Development
Posted by: ndebord
Date: November 22, 2011 05:41AM

Deadlock,

Any luck on an updated beta?

Tks.

N

K-Meleon forum is powered by Phorum.