General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Add a history toolbar button...
Posted by: MonkeeSage
Date: January 30, 2003 05:41AM

Anyone using my khistformat.exe, asmpgmr's convhist.exe, Nick's Perl script, or Ismo's batch file, and has a history macro (see: http://kmeleonbrowser.org/forum/read.php?f=1&i=7060&t=7060 ), here is a way to add a toolbar button to run the macro:

Edit:
your\current\skin\dir\toolbars.cfg

Or just go to Preferences -> Configs -> Toolbars

And an entry somewhere before the final curly brace }



History {
macros(history_macro_name)
hist_dead.bmp[0]
hist_hot.bmp[0]
hist_cold.bmp[0]
hist_dead.bmp[0]
}


Legend:
macros(history_macro_name) = replace "history_macro_name" with the name that runs your history macro
hist_dead.bmp = used for nothing, just to make its states show right, don't need a file
hist_cold.bmp = default pic to show for history button (its a good idea to use an image the same size as the rest, see the very top to toolbars.cfg for the dimensions (w, h)
hist_hot.bmp = mouseover image for history button

Use magic pink (R: 255 G: 0 B: 255, #FF00FF) to make areas of the pic invisible...


Ps. This same technique can be used to add any macro to a toolbar button, just change the macros() to call a different macro name and name the new button accordingly (e.g., NewButton {} instead of History {} ). smiling smiley


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Add a history toolbar button...
Posted by: MonkeeSage
Date: January 30, 2003 05:44AM

Oh yeah...

hist_cold.bmp
hist_hot.bmp
and
hist_cold.bmp (if you made one),

...go in your current theme directory, and if you change themes, you need to copy the files to your new theme dir, as well as re-add the lines to the new themes toolbars.cfg file.

Options: ReplyQuote
Re: Add a history toolbar button...
Posted by: MonkeeSage
Date: January 30, 2003 05:45AM

Oh yeah...

hist_cold.bmp
hist_hot.bmp
and
hist_dead.bmp (if you made one),

...go in your current theme directory, and if you change themes, you need to copy the files to your new theme dir, as well as re-add the lines to the new themes toolbars.cfg file.

Options: ReplyQuote
Re: Add a history toolbar button...
Posted by: Nick
Date: January 30, 2003 12:05PM

I get the a problem if I launch it from a macro - it appears not to find the history.txt file...

If I just double click on convhist.exe (which is located in the same folder as the history.txt file) it works OK - as soon as I call it (it runs) from a macro, it doesn't? My perl script also does similar - but does report the error (can't find history.txt).

What is the line in the macro to call it?

exec("Path\\to\\where\\convhist.exe");

Nick

Options: ReplyQuote
Re: Add a history toolbar button...
Posted by: MonkeeSage
Date: January 30, 2003 12:34PM

Nick:

asmpgmr hardcoded /history.txt as the input file, and I don't think K-M returns the path to its profile dir even though you call a program from there...cwd is non-inherited it seems.

You could alternately call it from a batch file, or use my binary khistformat in the macro ( http://monkeesage.d2g.com/khistformat.exe ), which takes a fully qualified path to any file... like

exec("Path\\to\\where\\khistformat.exe c:\\Path\\to\\where\\history.txt");

On the other page I also have a batch file that will work with khistformat to sort by date (newest to oldest) and then call khistformat.exe and then open the html output:

@echo off
CD "c:\Program Files\K-Meleon\profiles\default\xxxxxxxx.slt\"
sort /R history.txt /O history.srt
khistformat history.srt
del history.srt
history.html

That way I have a macro to call the batch then everything else is automatic. smiling smiley


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Add a history toolbar button...
Posted by: MonkeeSage
Date: January 30, 2003 12:38PM

Ps. If you use my binary, you can optionally put a file histbg.bmp in the same dir with the .exe and it will use that as the <body> background for the history display page that the binary puts out.

Options: ReplyQuote
Re: Add a history toolbar button...
Posted by: Nick
Date: January 30, 2003 05:33PM

OK, got it to work with a batch file including full path.

Now, when you use macro 'exec()' in KM, where exactly are we in the path schema of things.... in the root of KM?

NIck

Options: ReplyQuote


K-Meleon forum is powered by Phorum.