KEM-international (ver 2.0)
Posted by: disrupted
Date: October 08, 2009 02:41AM

kmeleon extensions manager (beta) with full support for any locale passed from kmeleon (unlimited locales). kem-international comes bundled with locales for these languages:
russian, portuguese, polish, french and german (no spanish sad smiley ) but i think spanish is similar to portuguse as amount of text per line so spanish should display properly..it's still beta cause awaiting feedback from alex trantul on russian display cause i can't see russian in my system.. i think russian and polish take most lines so gui has been updated to accomodate any possible language that takes bigger space than english.

kem-international can be downloaded from these links:
for nt systems(xp, vista, 2k etc)http://kmext.sourceforge.net/keih/kemNT-international.zip

for 9x windows(95, 98, me)
http://kmext.sourceforge.net/keih/kem9x-international.zip

macro changes:
kmextman{
$getlocale=getpref(STRING,"general.useragent.locale");
exec($_keu_path."\\kmextman.exe \"".$_profile_path."\" " . $getlocale);
}


autoit locales support part:
$localepath=(@scriptdir & "\locales\" & $cmdline[2] & "\kmextman.ini")
$testfile=IniRead($localepath, "kmextman", "1", "")

if $testfile=("") then
$txt1=("K-Meleon Extensions Manager Error")
$txt2=("Only execute the manager from inside k-meleon. ")
$txt3=("K-meleon Extensions Manager")
$txt4=("uninstall")
$txt5=("edit macro")
$txt6=("run installer")
$txt7=("Note: K-meleon will be restarted on an uninstall/install")
$txt8=("can't uninstall: malformed ini, please reinstall this extension or contact the author")
$txt9=("The extension: ")
$txt10=(" has been uninstalled successfully. ")
$txt11=("macro editor mode: when done remember to save and restart k-meleon for changes to take effect")
$txt12=("this extension does not include a macro")
$txt13=("You don't have any installed extensions. Would you like to download extensions?")
$txt14=("installed extensions:")
$txt15=("install date:")
else
$txt1=IniRead($localepath, "kmextman", "1", "")
$txt2=IniRead($localepath, "kmextman", "2", "")
$txt3=IniRead($localepath, "kmextman", "3", "")
$txt4=IniRead($localepath, "kmextman", "4", "")
$txt5=IniRead($localepath, "kmextman", "5", "")
$txt6=IniRead($localepath, "kmextman", "6", "")
$txt7=IniRead($localepath, "kmextman", "7", "")
$txt8=IniRead($localepath, "kmextman", "8", "")
$txt9=IniRead($localepath, "kmextman", "9", "")
$txt10=IniRead($localepath, "kmextman", "10", "")
$txt11=IniRead($localepath, "kmextman", "11", "")
$txt12=IniRead($localepath, "kmextman", "12", "")
$txt13=IniRead($localepath, "kmextman", "13", "")
$txt14=IniRead($localepath, "kmextman", "14", "")
$txt15=IniRead($localepath, "kmextman", "15", "")
endif


the script checks availability of locale file according to parameter passed from the macro, in case no locale is available or available locale but corrupted(doesn't contain proper translation strings).. the script will use embedded english strings.

special thanks to alain without whom this would have not been possible and desga for always wanting to improve things smiling smiley and extra thanks to translators: matt, siria, foobarly, alex tarantul and ofcourse alain

kmext. front page has been updated with translation links to many language with yahoo babelfish.. it's far from perfect and probably terrible..i don't understand those languages so i'm guessing it's a very bad translation.. italian is quite funny and translated italain sounds like a comedy show:
cookies manager:
un'estensione dell'amministrazione del biscotto. con cookieculler avete il potere di fissare determinati biscotti e di proteggerli dall'eliminazione mentre rimuovi gli altri biscotti.

Responsabile dei biscotti

questa estensione gli dà il controllo completo sopra i biscotti
(don't dare putting your hand in the cookie jar grinning smiley
translated german sounds like a big mess..but i think most germans can use english pages

update: spanish locale added.. thank you desga smiling smiley



Edited 3 time(s). Last edit at 11/05/2009 04:04AM by disrupted.

Re: KEM-international (betal)
Posted by: Matt
Date: October 08, 2009 04:18AM

localised texts display.

Only two things bother me:
1. texts in kmextman.ini slightly differ from what I posted here; obviously some polish characters got lost i.e. 'ń' is 'n', while others are ok (i.e. 'ó').
2. 'The extension:xxxhas been uninstalled successfully.' - there are no spaces between in pl version. I checked my translation and the spaces (line 9 and 10) are present; no biggie though.

I also modified the translation, just a little (changed Extensions to Add-ons + some minor changes).

1=("Błąd Menedżera Dodatków K-Meleona")
3=("Menedżer Dodatków K-Meleona")
8=("odinstalowanie nie jest możliwe: plik ini jest wadliwy, spróbuj ponownie zainstalować dodatek lub skontaktuj się z autorem")
9=("Dodatek: ")
10=(" został pomyślnie odinstalowany. ")
12=("ten dodatek nie zawiera makra")
13=("Nie masz zainstalowanych żadnych dodatków. Chcesz je pobrać?")
14=("zainstalowane dodatki:")

Other lines remain unchanged.
Will there be a kml-file for kmextmanager.kmm translation?

Regards
Matt

(sorry did not mean to edit the title of this post..i meant previous post... very tired )



Edited 2 time(s). Last edit at 10/09/2009 01:32AM by disrupted.

Re: KEM-international (beta)
Posted by: desga2
Date: October 08, 2009 04:21AM

I tried to test it, but show next errors;
When I tried to run kmextman.exe directlly (out of KM, from explorer)


I tried to rebuilding from the sources but show me this error building:


This errors happend in both versions NT and 9x.
I think this could be because I have installed a previous version of AutoIt v3.2.12.1 (you used 3.3.0).
But is possible that you forget included this library/code file in sources because I search it in new AutoIt 3.3.0 packet and I didn't find it.

I found this in Google about extprop.au3 file:
http://www.autoitscript.com/forum/index.php?showtopic=25859
http://www.autoitscript.com/forum/index.php?showtopic=103546
http://www.wuala.com/Autoit%20for%20fun/UDF/ExtProp.au3?key=8F6yoqu8Svv0
http://pgmacros.invisionzone.com/index.php?showtopic=2383

When I commented this line: #include <extprop.au3>
AutoIt build the code OK but resulted exe file show the same error at run it.

I checked the syntax of the au3 source file:
AutoIt3 Syntax Checker v1.54.8  Copyright (c) Tylo 2007

G:\K-Projects\KEM\kmextman.au3(28,16) : WARNING: $txt1: possibly used before declaration.
msgbox(48,$txt1,
~~~~~~~~~~~~~~~^
G:\K-Projects\KEM\kmextman.au3(28,23) : WARNING: $txt2: possibly used before declaration.
msgbox(48,$txt1, $txt2)
~~~~~~~~~~~~~~~~~~~~~~^
G:\K-Projects\KEM\kmextman.au3(106,33) : ERROR: _GetExtProperty(): undefined function.
$date=_GetExtProperty($inipath,4)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
G:\K-Projects\KEM\kmextman.au3 - 1 error(s), 2 warning(s)
>Exit code: 2

K-Meleon in Spanish



Edited 6 time(s). Last edit at 10/08/2009 04:47AM by desga2.

Re: KEM-international (beta)
Posted by: disrupted
Date: October 08, 2009 06:36AM

thanks desga..that's a dumb bug..it's due that $cmdline[0]=0 error message comes after declaring the locales at $cmdline[2].. so $cmdline[0] error message couldn't know what text to use in the messagebox because there was no locale parameter passed from kmeleon

the only fix for that is that if $cmdline[0] error message uses standard english text..it's not very important..i could just assign exit if cmdline[0]=0 ...i.e. not run if executed without parameters.

i fixed it now..please download again and check

now it's like that

f $cmdline[0]=0 then
msgbox(48,"K-Meleon Extensions Manager Error", "Only execute the manager from inside k-meleon. ")
else
$inini=(@scriptDir & "\kmextensions")
$kmunext="*.ini"
$inipath=("pending")
$kmprefs=($CmdLine[1] & "\prefs.js")
$kmprof=($CmdLine[1] & "\")
;$testrun=("c:\windows\notepad.exe")

$localepath=(@scriptdir & "\locales\" & $cmdline[2] & "\kmextman.ini")
$testfile=IniRead($localepath, "kmextman", "1", "")

if $testfile=("") then
$txt1=("K-Meleon Extensions Manager Error")
$txt2=("Only execute the manager from inside k-meleon. ")
$txt3=("K-meleon Extensions Manager")
$txt4=("uninstall")
$txt5=("edit macro")
$txt6=("run installer")
$txt7=("Note: K-meleon will be restarted on an uninstall/install")
$txt8=("can't uninstall: malformed ini, please reinstall this extension or contact the author")
$txt9=("The extension: ")
$txt10=(" has been uninstalled successfully. ")
$txt11=("macro editor mode: when done remember to save and restart k-meleon for changes to take effect")
$txt12=("this extension does not include a macro")
$txt13=("You don't have any installed extensions. Would you like to download extensions?")
$txt14=("installed extensions:")
$txt15=("install date:")
else
$txt1=IniRead($localepath, "kmextman", "1", "")
$txt2=IniRead($localepath, "kmextman", "2", "")
$txt3=IniRead($localepath, "kmextman", "3", "")
$txt4=IniRead($localepath, "kmextman", "4", "")
$txt5=IniRead($localepath, "kmextman", "5", "")
$txt6=IniRead($localepath, "kmextman", "6", "")
$txt7=IniRead($localepath, "kmextman", "7", "")
$txt8=IniRead($localepath, "kmextman", "8", "")
$txt9=IniRead($localepath, "kmextman", "9", "")
$txt10=IniRead($localepath, "kmextman", "10", "")
$txt11=IniRead($localepath, "kmextman", "11", "")
$txt12=IniRead($localepath, "kmextman", "12", "")
$txt13=IniRead($localepath, "kmextman", "13", "")
$txt14=IniRead($localepath, "kmextman", "14", "")
$txt15=IniRead($localepath, "kmextman", "15", "")
endif


now cmdline[0]=0 comes first and above everything else incase user tries to run directly and not from kmeleon menu, it will display message in english..only run from kmeleon..that's makes $txt2 and $txt3 no longer needed for localisation..but they won't harm so one learns from mistakes.. please test again, download from same links.

i think the extprop function is supported by all 3.x autotits but i can't be sure, in kem it \s only for getting the install date.. not used extensively like in image properties plus..so if it gives you any problems, hash it out all it's relying statements..you just won't have an install date..but as compiled exe, it shouldn't give you problems..i've tested it on 98 as well

i've uploaded it here if you want to play with it
http://kmext.sf.net/tests/ExtProp.au3

matt, the accents seem to be lost in the ansi encoded ini..not all of them..just certain ones with the n and c.. as a work around, i added a comma tongue sticking out smiley after the c so it kinda looks like the polish c with accent. a proper fix for that would be encoding the ini in utf-8 like russian but this will limit polish windows 9x versions from reading the file..so better leave it ansi and add accents as ' (commas).. for users who have no problems with unicode ini, they can type the proper letter and change the encoding to utf-8 (this problem will further be investigated on the russian front cause they know all about utf-8 problems and windows 98 and ansi cause cyrillic characters have to be specially coded for ansi in 9x)

the macro localisation is usually left for the users to make.. simpple text file with kml extension with the name of its corresponding macro and they the required english text is translated after = sign for example..kml file:
extensions manager=extensions manager in locale language

that's it

but since i know the translations for it, i added translated kml file for all languages in the packages-except for russian because i can't even see it here- so now the menu command will automatically use proper locale from the kml file



in the future..maybe we can all update every macro on kmext with a kml file with all languages supported by kmeleon..they are not many really..just few text lines for every macro..restart, cookies, convert image...set as wallpaper etc few lines..very easy

edit: desga, sorry.. no, you won't find extprop with the default installation of au3..i downloaded it separately from somewhere..don't remeber, but it was developed by someone at their forums.. there are so many 'unofficial' au3 functions..very interesting ones but must be added manually..

i found this one one day.. very powerful:
http://thorsten-willert.de/Themen/FFau3/FF.au3/FF.au3
sometimes the link doesn't work directly..try going to main page
http://thorsten-willert.de/ it's under software meny ff.au3

it adds complete control over firefox and webpage manipulation through autoit.. maybe we can talk mr thorsten into making similar one for kmeleon



Edited 1 time(s). Last edit at 10/08/2009 06:43AM by disrupted.

Re: KEM-international (beta)
Posted by: desga2
Date: October 08, 2009 02:27PM

Quote
disrupted
the only fix for that is that if $cmdline[0] error message uses standard english text..it's not very important..i could just assign exit if cmdline[0]=0 ...i.e. not run if executed without parameters.

if $cmdline[0]=0 then
msgbox(48,"K-Meleon Extensions Manager Error", "Only execute the manager from inside k-meleon. ")
else
$inini=(@scriptDir & "\kmextensions")
$kmunext="*.ini"
$inipath=("pending")
$kmprefs=($CmdLine[1] & "\prefs.js")
$kmprof=($CmdLine[1] & "\")
;$testrun=("c:\windows\notepad.exe")

$localepath=(@scriptdir & "\locales\" & $cmdline[2] & "\kmextman.ini")
$testfile=IniRead($localepath, "kmextman", "1", "")

if $testfile=("") then
$txt1=("K-Meleon Extensions Manager Error")
$txt2=("Only execute the manager from inside k-meleon. ")
$txt3=("K-meleon Extensions Manager")
$txt4=("uninstall")
$txt5=("edit macro")
$txt6=("run installer")
$txt7=("Note: K-meleon will be restarted on an uninstall/install")
$txt8=("can't uninstall: malformed ini, please reinstall this extension or contact the author")
$txt9=("The extension: ")
$txt10=(" has been uninstalled successfully. ")
$txt11=("macro editor mode: when done remember to save and restart k-meleon for changes to take effect")
$txt12=("this extension does not include a macro")
$txt13=("You don't have any installed extensions. Would you like to download extensions?")
$txt14=("installed extensions:")
$txt15=("install date:")
else
$txt1=IniRead($localepath, "kmextman", "1", "")
$txt2=IniRead($localepath, "kmextman", "2", "")
$txt3=IniRead($localepath, "kmextman", "3", "")
$txt4=IniRead($localepath, "kmextman", "4", "")
$txt5=IniRead($localepath, "kmextman", "5", "")
$txt6=IniRead($localepath, "kmextman", "6", "")
$txt7=IniRead($localepath, "kmextman", "7", "")
$txt8=IniRead($localepath, "kmextman", "8", "")
$txt9=IniRead($localepath, "kmextman", "9", "")
$txt10=IniRead($localepath, "kmextman", "10", "")
$txt11=IniRead($localepath, "kmextman", "11", "")
$txt12=IniRead($localepath, "kmextman", "12", "")
$txt13=IniRead($localepath, "kmextman", "13", "")
$txt14=IniRead($localepath, "kmextman", "14", "")
$txt15=IniRead($localepath, "kmextman", "15", "")
endif

Sorry disrrupted, but I'm disagree with your solution for this problem. tongue sticking out smiley
I'm working from some time ago in this translation method for AutoIt tools made for K-Meleon. I didn't finish and after holidays I forgive it.

I remember that I did something like this:


; First set default strings in english
$txt1=("K-Meleon Extensions Manager Error")
$txt2=("Only execute the manager from inside k-meleon. ")
$txt3=("K-meleon Extensions Manager")
$txt4=("uninstall")
$txt5=("edit macro")
$txt6=("run installer")
$txt7=("Note: K-meleon will be restarted on an uninstall/install")
$txt8=("can't uninstall: malformed ini, please reinstall this extension or contact the author")
$txt9=("The extension: ")
$txt10=(" has been uninstalled successfully. ")
$txt11=("macro editor mode: when done remember to save and restart k-meleon for changes to take effect")
$txt12=("this extension does not include a macro")
$txt13=("You don't have any installed extensions. Would you like to download extensions?")
$txt14=("installed extensions:")
$txt15=("install date:")

; Second check cmdline arguments
if $cmdline[0]=0 then
msgbox(48,$txt1, $txt2)
exit
endif

; Third load loacal language ini file
$inini=(@scriptDir & "\kmextensions")
$kmunext="*.ini"
$inipath=("pending")
$kmprefs=($CmdLine[1] & "\prefs.js")
$kmprof=($CmdLine[1] & "\")
;$testrun=("c:\windows\notepad.exe")

$localepath=(@scriptdir & "\locales\" & $cmdline[2] & "\kmextman.ini")
$testfile=IniRead($localepath, "kmextman", "1", "")

if $testfile!=("") then
$txt1=IniRead($localepath, "kmextman", "1", "")
$txt2=IniRead($localepath, "kmextman", "2", "")
$txt3=IniRead($localepath, "kmextman", "3", "")
$txt4=IniRead($localepath, "kmextman", "4", "")
$txt5=IniRead($localepath, "kmextman", "5", "")
$txt6=IniRead($localepath, "kmextman", "6", "")
$txt7=IniRead($localepath, "kmextman", "7", "")
$txt8=IniRead($localepath, "kmextman", "8", "")
$txt9=IniRead($localepath, "kmextman", "9", "")
$txt10=IniRead($localepath, "kmextman", "10", "")
$txt11=IniRead($localepath, "kmextman", "11", "")
$txt12=IniRead($localepath, "kmextman", "12", "")
$txt13=IniRead($localepath, "kmextman", "13", "")
$txt14=IniRead($localepath, "kmextman", "14", "")
$txt15=IniRead($localepath, "kmextman", "15", "")
endif



I think this is better solution. smiling smiley

About extprop.au3, I remember that there is a standard function to get the date of files, no additionals UDF is needed for it. I'll search it this evening.

K-Meleon in Spanish



Edited 3 time(s). Last edit at 10/10/2009 01:28AM by desga2.

Re: KEM-international (beta)
Posted by: JujuLand
Date: October 08, 2009 02:43PM

Hum, why not simply to execute

if $cmdline[0]!=0 then
msgbox(48,"K-Meleon Extensions Manager Error","Only execute the manager from inside k-meleon.")
exit
endif

and keep disrupted setting.

if $testfile=("") then
...
else
...
endif

You set variables with english content to exit if none, or set and change the content if parameter is here and ok. Is-it better ?

A+


Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:24.0) Gecko/20140105 Ubuntu/12.04 K-Meleon/74.0

Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr





Edited 1 time(s). Last edit at 10/08/2009 02:47PM by JujuLand.

Re: KEM-international (beta)
Posted by: desga2
Date: October 08, 2009 05:50PM

I think is better my solution because you have all strings at the begining of file and is more easy to update it and for create the ini files.

We must acepted that this error message will be showed in english and isn't needed translate it in localizations ini files.

Quote
desga2
About extprop.au3, I remember that there is a standard function to get the date of files, no additionals UDF is needed for it.

Look this standard AutoIt function: FileGetTime.

K-Meleon in Spanish



Edited 1 time(s). Last edit at 10/08/2009 05:51PM by desga2.

Re: KEM-international (beta)
Posted by: disrupted
Date: October 08, 2009 11:12PM

yes, i like your solution better..keeping the main statements first; it's more proper programming i think. the inequality operator is incorrect != works in macro language, maybe it's standard in most programming.. but it doesn;t work in autotit, they use <> for inequality..which works for both numbers and text strings (autotit people don't like many commands it seems-one size fits all policy)

there's no need for an endif for all these variables..because there's a closure endif
so now it's like this:
$KEITH=(@scriptDir & "\tools\keith\keith.exe")
$KMBIN=(@scriptDir & "\k-meleon.exe")
$DEL1=(@scriptDir & "\components\xpti.dat")
$DEL2=(@scriptDir & "\components\compreg.dat")
$kmexthome=("http://kmext.sourceforge.net";)
$openhome=($KMBIN & " " & $kmexthome)
$medit=(@scriptDir & "\tools\keith\notepad2.exe")
$locales=(@scriptdir & "\locales\")

$txt1=("K-Meleon Extensions Manager Error")
$txt2=("Only execute the manager from inside k-meleon. ")
$txt3=("K-meleon Extensions Manager")
$txt4=("uninstall")
$txt5=("edit macro")
$txt6=("run installer")
$txt7=("Note: K-meleon will be restarted on an uninstall/install")
$txt8=("can't uninstall: malformed ini, please reinstall this extension or contact the author")
$txt9=("The extension: ")
$txt10=(" has been uninstalled successfully. ")
$txt11=("macro editor mode: when done remember to save and restart k-meleon for changes to take effect")
$txt12=("this extension does not include a macro")
$txt13=("You don't have any installed extensions. Would you like to download extensions?")
$txt14=("installed extensions:")
$txt15=("install date:")

if $cmdline[0]=0 then
msgbox(48,"K-Meleon Extensions Manager Error", "Only execute the manager from inside k-meleon. ")
else
$inini=(@scriptDir & "\kmextensions")
$kmunext="*.ini"
$inipath=("pending")
$kmprefs=($CmdLine[1] & "\prefs.js")
$kmprof=($CmdLine[1] & "\")
;$testrun=("c:\windows\notepad.exe")

$localepath=(@scriptdir & "\locales\" & $cmdline[2] & "\kmextman.ini")
$testfile=IniRead($localepath, "kmextman", "1", "")

if $testfile<>("") then
$txt1=IniRead($localepath, "kmextman", "1", "")
$txt2=IniRead($localepath, "kmextman", "2", "")
$txt3=IniRead($localepath, "kmextman", "3", "")
$txt4=IniRead($localepath, "kmextman", "4", "")
$txt5=IniRead($localepath, "kmextman", "5", "")
$txt6=IniRead($localepath, "kmextman", "6", "")
$txt7=IniRead($localepath, "kmextman", "7", "")
$txt8=IniRead($localepath, "kmextman", "8", "")
$txt9=IniRead($localepath, "kmextman", "9", "")
$txt10=IniRead($localepath, "kmextman", "10", "")
$txt11=IniRead($localepath, "kmextman", "11", "")
$txt12=IniRead($localepath, "kmextman", "12", "")
$txt13=IniRead($localepath, "kmextman", "13", "")
$txt14=IniRead($localepath, "kmextman", "14", "")
$txt15=IniRead($localepath, "kmextman", "15", "")
endif

$FileList=_FileListToArray($inini,$kmunext)
If @Error=1 Then
openkmext()
Exit
EndIf
if $FileList= 0 Then
openkmext()
Else
runman()
endif
endif



i updated and tested using desga's method but haven't uploaded yet, waiting for russian macro kml from alex

also..autoit iniread function doesn't seem to be able to read utf-8 even on russian systems, so alex converted to a special ansi which can be handled by iniread..now we wait for final few russian tests and russian kml, then i'll upload final release which will replace standard(english-only) kem

with utf-8 ini:


with ansi-1251

(russian 'run installer' has been changed to 'installer' only..so now it fits coompletely inside the button)

Re: KEM-international (beta)
Posted by: Matt
Date: October 08, 2009 11:14PM

disrupted, all polish characters display ok under XP when the ini is ANSI encoded - example.
I don't know about 95, 98, me because I don't have an opportunity to test it on those systems.
I uploded the revised ini -> kmextman.ini.

Re: KEM-international (beta)
Posted by: disrupted
Date: October 09, 2009 01:29AM

this is perfect matt, thanks.. don't worry about it on 9x since it's ansi, it should display fine on 99x systems..maybe some characters can look a bit awkward on 9x but generally the text will display fine

kmeleon international is now a final release and has replaced english-only kem, kem can be downloaded there:
http://kmext.sourceforge.net/kem.htm

updates include:
updated autoit locale strings using desga's cleaner script
better macro support for kml locale
russian update for kml and ini
minor gui update for better russian support
added toolbar button as requested by alex tarantul





for future locales, i did a few tests with greek and japanese.. and it works fine..japanese proper display means that autoit can support all east asian/middle-eastern languages so if the need arises and kmeleon is localised in any language, autoit should support them fine.. i think 1.5.4 will include chinese locale




Re: KEM-international (beta)
Posted by: desga2
Date: October 09, 2009 02:32AM

@ disrupted:
Sorry for my mistake with != operator sometime I mix NSIS/AutoIt/KM-Macro operators.

Are you test to change this function?
Quote
desga2
About extprop.au3, I remember that there is a standard function to get the date of files, no additionals UDF is needed for it.

Look this standard AutoIt function: FileGetTime.

Delete this line: #include <extprop.au3>
And change this:
kmextman.au3(106,33) : ERROR: _GetExtProperty(): undefined function.
$date=_GetExtProperty($inipath,4)
by this:
$date=FileGetTime($inipath,1,1)

Other note about AutoIt iniread() function:
I think that the fourth parameter must be the default string, because you use a empty string this empty the text var and any text is showed in the tools dialogs.
Please replace this code lines type:
$txt1=IniRead($localepath, "kmextman", "1", "")
by this other type:
$txt1=IniRead($localepath, "kmextman", "1", $txt1)

By this way if strings are lost in localization ini file still default english strings.

About iniread() function and unicode/UTF8 support I found this:
http://www.autoitscript.com/autoit3/docs/intro/unicode.htm
And like you can read iniread functions are anso and not unicode functions, but the rest of functions to read files support unicode formats.

But all this of translations in AutoIt tools for K-Meleon is an old problem already solved by JamesD and for me but anyone had interest about it until now. tongue sticking out smiley

Read this old thread by JamesD and me in August of 2008.

Also I made this other version more advanced in those days to read ini files in unicode/UTF8 format to translate KMListBox tool and similars.
KMListBox2.zip
(files with _U at the end of filename are Unicode versions)

K-Meleon in Spanish



Edited 1 time(s). Last edit at 10/09/2009 02:35AM by desga2.

Re: KEM-international (beta)
Posted by: disrupted
Date: October 09, 2009 03:34AM

$txt1=IniRead($localepath, "kmextman", "1", $txt1)

this is very smart..thanks so much..this will always ensure using english if any locale line doesn't exist, i updated using that line for all locale lines

i tried previsouly using filegettime but i hate it because it brings it all as one line


it will need too much recoding to clean it up, extract out the numbers and then add backslashes and spaces just to make it look decent when getextproperty already does that with one command..it gets out date and time already in a nice format.. why don't you like getextproperty? in compiled binary it works on 98 without any problems..you just need to add it in the include folder to make it work from the source.. i think i used it in older 3.x autoit and it still worked.. i don't think it needs latest 3.3.0

i tested with unicode greek and japanese and displayed fine..so there weren't any problems, the problem was with russian and utf-18 for some weird reason.. if alex chose unicode, it'd have probably worked just as well but ansi is better for now because of users using windows 98..we can always convert to ansi-1251.. when windows9x is no longer supported(possibly km 1.6), then we can use unicode only

Re: KEM-international (beta)
Posted by: mslayer
Date: October 09, 2009 10:32AM

WOW! There are a lot of EndIfs in that au3 code.surprised smiley

Re: KEM-international (beta)
Posted by: desga2
Date: October 09, 2009 03:09PM

@ disrupted: You can use array format for better date display with FileGetTime function.

$a_date=FileGetTime($inipath,1)
;$a_date[0] = year (four digits)
;$a_date[1] = month (range 01 - 12)
;$a_date[2] = day (range 01 - 31)
;$a_date[3] = hour (range 00 - 23)
;$a_date[4] = min (range 00 - 59)
;$a_date[5] = sec (range 00 - 59)
If Not @error Then
    $date = $a__date[0] & "/" & $a_date[1] & "/" & $a_date[2] & " " & $a_date[3] & ":" & $a_date[4] & ":" & $a_date[5]
;   $date=yyyy/mm/dd hh:mmconfused smileys
EndIf

Or you can use above post FileGetTime format and use StringMid function to split it:
$full_date=FileGetTime($inipath,1,1)
; $date in format yyyy/mm/dd hh:mmconfused smileys
$date=StringMid($full_date, 1 , 4) & "/" & StringMid($full_date, 5 , 2) & "/" & StringMid($full_date, 7 , 2) & " " & StringMid($full_date, 9 , 2) & ":" StringMid($full_date, 11 , 2) & ":" & StringMid($full_date, 13 , 2)

Or you must at least add the function _GetExtProperty() in your kmextman.au3 file (copy&paste) or add the file extprop.au3 in the source packet.

About:
Quote
mslayer
WOW! There are a lot of EndIfs in that au3 code.surprised smiley

I recomemded already to disrupted changed to functions style to avoid repeted all If-EndIf code:
Quote
desga2
Sorry disrupted but I think that your code could be more simple (more easy to read) if you change this repeated sections:
if $findmacro=("") then
GUICtrlSetData($desc,"can't uninstall: malformed ini, please reinstall this extension or contact the author")
FileDelete($inipath)
elseif $findmacro=("\") then
GUICtrlSetData($desc,"can't uninstall: malformed ini, please reinstall this extension or contact the author")
FileDelete($inipath)
else

By something like this:
if $findmacro=("") OR $findmacro=("\") then
IniError()
else 

func IniError()
GUICtrlSetData($desc,"can't uninstall: malformed ini, please reinstall this extension or contact the author")
FileDelete($inipath)
endfunc

If you repeat some code in a lot of lines is better convert it in a function.

Quote
disrupted
desga, i'm not sure if this will work because it will be a function setting a command for a different function so guictrlsetdata will not know what gui to modify..i'm doing a slight update for kem(it will be a surprise) and test adding the seperate function

There isn't no problem to use a function for all this because you have the guiIDcontrol in var that is global.

All this are only suggestion for better the code, disrupted did a good work with this tool and I only want help to do a better supported code for the future.

K-Meleon in Spanish



Edited 2 time(s). Last edit at 10/09/2009 03:24PM by desga2.

Re: KEM-international (beta)
Posted by: mslayer
Date: October 09, 2009 10:59PM

I don't understand much of Autoit3, but if disrupter dislike the idea of using a Function what about using a Select/case constructor? Is that possible?



Good job disrupter, and thanks for sharing.

Re: KEM-international (beta)
Posted by: mslayer
Date: October 09, 2009 11:00PM

Quote
mslayer
I don't understand much of Autoit3, but if disrupter dislike the idea of using a Function what about using a Select/case constructor? Is that possible?



Good job disrupter, and thanks for sharing.
Sorry I mean disrupted.

Re: KEM-international (beta)
Posted by: disrupted
Date: October 10, 2009 04:30AM

disrupter is good enough grinning smiley

i tried using function, you're right about api being universal.. i never knew that can be done but it gave me erros everytime undeclared something so i kept copying everything it wanted inside the new function iniinfo and iniwhatsit.. but it has few bugs like with malformed ini.. i'll try to work on it more.. i'll include extprop within, that's a good idea

Re: KEM-international (beta)
Posted by: desga2
Date: October 10, 2009 04:38AM

Please disrupted not work more in your code, I working already in it to recoded all with functions and other implementations. I'll send you when this is finished for you can test it.
Thanks you.

K-Meleon in Spanish



Edited 2 time(s). Last edit at 10/10/2009 04:41AM by desga2.

Re: KEM-international (beta)
Posted by: disrupted
Date: October 10, 2009 04:41AM

smiling smiley (sigh of relief)

Re: KEM-international (beta)
Posted by: D_S
Date: October 11, 2009 12:42AM

Great work with KEM, I love it.

However when installed it doesn't see any previously installed extensions ('manually installed"). Can it be fixed somehow? I only had few extensions and I remember them all, so it wasn't any problem to re-install them again with KEM again, but if it was my laptop where I have like 30 or 40 extensions and they all would we wiped out... let's just say it wouldn't be nice ;)

Re: KEM-international (beta)
Posted by: disrupted(unlogged)
Date: October 11, 2009 12:59AM

no no, kem doesn't remove any of your previously installed extensions..it just doesn't recognise them as installed..they are all there. kem works through an ini which was added to all extensions after october 2nd. there was a notice for 5 days on kmext front page that if you wanted to enable kem support for your extension; you'll need to download it again but all extensions without the uninstall ini are intact and you can still use them normally..they just won't be displayed under kem

Re: KEM-international (beta)
Posted by: disrupted(unlogged)
Date: October 11, 2009 01:02AM

also, you don't need to use kem's installer; you can still install manually by extracting the extension with 7z etc and will still be displayed under kem.. just redownload all your extensions to make them supported

Re: KEM-international (beta)
Posted by: D_S
Date: October 11, 2009 01:03AM

Thanks for clarifying that, disrupted!

Again, great work on KEM.
/me love it smiling smiley

Re: KEM-international (beta)
Posted by: disrupted
Date: November 05, 2009 04:04AM

desga made major updates to kem.. now much better integrity checker for files at uninstall. kem dialog will no longer terminate upon uninstall, incase user wants to uninstall more than one extension. advanced script coding (no more 100 endifs smiling smiley and better memory management.

please update to kem 2.0
http://kmext.sf.net/kem.htm

; AutoIt Version: 3.2.12.1 or later
; Language: english by default with support to localizations
; Platform: Win9x/NT
; Authors: desgrupted (desga & yannis)
; Modifications: desga2

#Include <File.au3>
#Include <Array.au3>
#Include <Misc.au3>
#Include <GUIConstants E x.au3>
;#Include <GUIComboBox.au3>
#NoTrayIcon

; Only one instance allowed
If _Singleton("KME", 0)=0 Then
Exit
EndIf

; Setting dialogs strings
Dim $txt[20]
$txt[0]=19 ; Totals strings
$txt[1]="K-Meleon Extensions Manager Error"
$txt[2]="Only execute the manager from inside K-Meleon."
$txt[3]="K-Meleon Extensions Manager"
$txt[4]="Uninstall"
$txt[5]="Edit macro"
$txt[6]="Run installer"
$txt[7]="Note: K-Meleon will be restarted on an uninstall/install"
$txt[8]="Can't uninstall: malformed ini, please reinstall this extension or contact the author."
$txt[9]="The extension: "
$txt[10]=" has been uninstalled successfully."
$txt[11]="Macro editor mode: When done remember to save and restart K-Meleon for changes to take effect."
$txt[12]="This extension does not include a macro."
$txt[13]="You don't have any installed extensions. Would you like to download extensions?"
$txt[14]="Installed extensions:"
$txt[15]="Install date:"
$txt[16]="Info:"
$txt[17]="KEU: uninstall completed"
$txt[18]="Do you want delete this empty or malformed ini file?"
$txt[19]="N/A"

; Check if exist command line parameters
If $cmdline[0]=0 Then
MsgBox(48, $txt[1], $txt[2])
exit
EndIf

; Setting paths
$KEITH=@ScriptDir & "\tools\keith\keith.exe"
$KMBIN=@ScriptDir & "\k-meleon.exe"
$DEL1=@ScriptDir & "\components\xpti.dat"
$DEL2=@ScriptDir & "\components\compreg.dat"
$kmexthome="http://kmext.sourceforge.net";
$openhome=$KMBIN & " " & $kmexthome
$medit=@ScriptDir & "\tools\keith\notepad2.exe"
$locales=@ScriptDir & "\locales\"
; Settings other default strings
$inini=@ScriptDir & "\kmextensions"
$kmunext="*.ini"
$inipath="" ;"pending"
$kmprefs=$CmdLine[1] & "\prefs.js"
$kmprof=$CmdLine[1] & "\"
;$testrun="c:\windows\notepad.exe"
$localepath=@ScriptDir & "\locales\" & $cmdline[2] & "\kmextman.ini"

; Load localization strings from local ini file
If FileExists($localepath) Then
For $index=1 To $txt[0]
$txt[$index]=IniRead($localepath, "kmextman", $index, $txt[$index])
Next
EndIf

; Load extensions installed
$FileList=_FileListToArray($inini, $kmunext)
If @error=1 Or $FileList=0 Then
openkmext()
;MsgBox(64, "K-meleon Extensions Manager", "You don't have any installed extensions.")
Else
; Setting string of extensions installed
$pentrim=_ArrayToString($FileList, "|", 1)
$remini=StringReplace($pentrim, ".ini", "")
$first=StringInStr($remini, "|" , "", 1)
$initial=StringMid($remini, 1, $first-1)
;MsgBox(0, "test", $initial)
; Build the GUI dialog
$hGUI=GUICreate($txt[3], 310, 200)
$Label1=GUICtrlCreateLabel($txt[14] & " " & $FileList[0], 10, 3, 160, 15)
$hCombo=GUICtrlCreateCombo("", 10, 20, 180, 100)
$update=GUICtrlSetData($hCombo, $remini, $initial)
$hButton=GUICtrlCreateButton($txt[4], 200, 20, 100) ; Uninstall button
$mButton=GUICtrlCreateButton($txt[5], 200, 65, 100) ; Edit macro button
$iButton=GUICtrlCreateButton($txt[6], 200, 100, 100) ; Run installer button
$eButton=GUICtrlCreateButton("kmext.sf.net", 200, 130, 100) ; Web site button
$Label2=GUICtrlCreateLabel($txt[7], 10, 165, 290, 30)
$inipath=$inini & "\" & $initial & ".ini" ;GUICtrlRead($hCombo) & ".ini" ;$FileList[_GUICtrlComboBox_GetCurSel($hCombo)+1]
$findinfo=IniRead($inipath, "info", "1", $txt[19])
; Check if is a malformed ini file and warning about it
If $findinfo="" Then $findinfo=$txt[8]
$a_date=FileGetTime($inipath, 1)
;$a_date[0]=year (four digits)
;$a_date[1]=month (range 01 - 12)
;$a_date[2]=day (range 01 - 31)
;$a_date[3]=hour (range 00 - 23)
;$a_date[4]=min (range 00 - 59)
;$a_date[5]=sec (range 00 - 59)
If Not @error Then
$date=$a_date[0] & "/" & $a_date[1] & "/" & $a_date[2] & " " & $a_date[3] & ":" & $a_date[4] & ":" & $a_date[5]
; $date=yyyy/mm/dd hh:mmconfused smileys
EndIf
$extinstdate=GUICtrlCreateLabel($txt[15] & " " & $date, 11, 50, 180, 12)
;$setdata=GUICtrlCreateLabel($date, 100, 44, 150, 12)
$info=GUICtrlCreateLabel($txt[16], 11, 70, 180, 12)
$desc=GUICtrlCreateLabel($findinfo, 11, 85, 180, 70)
GUISetState() ;@SW_SHOW
WinActivate($txt[3])
;WinSetOnTop($txt[3], "", 1)
runman()
EndIf

Func runman()
While 1
$msg=GUIGetMsg()
Select
Case $msg=$GUI_EVENT_CLOSE
Exit

Case $msg=$hCombo ; Extension selection from combo list
$inipath=$inini & "\" & GUICtrlRead($hCombo) & ".ini" ;$FileList[_GUICtrlComboBox_GetCurSel($hCombo)+1]
$findinfo=IniRead($inipath, "info", "1", $txt[19])
; Check if is a malformed ini file and warning about it
If $findinfo="" Then $findinfo=$txt[8]
$a_date=FileGetTime($inipath,1)
If Not @error Then
$date=$a_date[0] & "/" & $a_date[1] & "/" & $a_date[2] & " " & $a_date[3] & ":" & $a_date[4] & ":" & $a_date[5]
; $date=yyyy/mm/dd hh:mmconfused smileys
EndIf
GUICtrlSetData($desc, $findinfo)
GUICtrlSetData($extinstdate, $txt[15] & " " & $date)

Case $msg=$hButton ; Uninstall button
;MsgBox(64, "K-meleon Extensions Manager", $testrun & " " & $inini & "\" & $FileList[_GUICtrlComboBox_GetCurSel($hCombo)+1]) ;GUICtrlRead($hCombo) & ".ini"
;$commandtest=$testrun & " " & $inini & "\" & $FileList[_GUICtrlComboBox_GetCurSel($hCombo)+1] ;GUICtrlRead($hCombo) & ".ini"
$inipath=$inini & "\" & GUICtrlRead($hCombo) & ".ini" ;$FileList[_GUICtrlComboBox_GetCurSel($hCombo)+1]
If FileExists($inipath) Then
;MsgBox(64, "K-meleon Extensions Manager", $inipath)
;$inisections=""
$inisections=IniReadSectionNames($inipath) ; element[0] is the total number of sections in ini file.
If @error Or $inisections="" Or $inisections[0]=0 Then
IniError()
Else
; Check integrity of ini file, no empty keys
$badini=0
For $i_sec=1 To $inisections[0]
$section=IniReadSection($inipath, $inisections[$i_sec])
If @error Then ContinueLoop
For $i_key=1 To $section[0][0]
; Security folder checked, only delete under KM folder
If FileExists($KMBIN) And $section[$i_key][1]="" Then
IniError()
$badini=1
ExitLoop 2
EndIf
Next
Next
If $badini=1 Then ContinueLoop
ProcessClose("loader.exe") ; Loader and K-Meleon will be now closed, are you sure to continue?
ProcessClose("k-meleon.exe")
While Process E xists("k-meleon.exe")
ProcessClose("k-meleon.exe") ; For kill multiples instances
WEnd
; DISABLE controls:
GUICtrlSetState($hCombo, $GUI_DISABLE)
GUICtrlSetState($hButton, $GUI_DISABLE)
GUICtrlSetState($mButton, $GUI_DISABLE)
GUICtrlSetState($iButton, $GUI_DISABLE)
;GUICtrlSetState($eButton, $GUI_DISABLE)
;GUISetState(@SW_DISABLE, $hGUI) ; Or disable the window
ProcessWaitClose("loader.exe") ;Sleep(500)
ProcessWaitClose("k-meleon.exe")
; Load ini file section arrays using IniReadSection("filename", "section") function:
; Element[n][0] is the key and element[n][1] is the value, element[0][0] is the total number of elements in section.
For $i_sec=1 To $inisections[0]
Switch $inisections[$i_sec]
Case "macros"
$section=IniReadSection($inipath, $inisections[$i_sec])
If @error Then ContinueLoop
For $i_key=1 To $section[0][0]
$delfile=@ScriptDir & "\" & "macros" & "\" & $section[$i_key][1]
; Security folder checked, only delete under KM folder
If FileExists($KMBIN) And $section[$i_key][1]<>"" And $section[$i_key][1]<>"." And Not(StringInStr($section[$i_key][1], "\") Or StringInStr($section[$i_key][1], "/") Or StringInStr($section[$i_key][1], "..") Or StringInStr($section[$i_key][1], ":") Or StringInStr($section[$i_key][1], "%") Or StringInStr($section[$i_key][1], "*") Or StringInStr($section[$i_key][1], "?")) And FileExists($delfile) Then
$f_attrib=FileGetAttrib($delfile)
If StringInStr($f_attrib, "D") Then
DirRemove($delfile, 1)
Else
FileDelete($delfile)
EndIf
EndIf
Next
Case "chrome"
$section=IniReadSection($inipath, $inisections[$i_sec])
If @error Then ContinueLoop
For $i_key=1 To $section[0][0]
$delfile=@ScriptDir & "\" & "chrome" & "\" & $section[$i_key][1]
; Security folder checked, only delete under KM folder
If FileExists($KMBIN) And $section[$i_key][1]<>"" And $section[$i_key][1]<>"." And Not(StringInStr($section[$i_key][1], "\") Or StringInStr($section[$i_key][1], "/") Or StringInStr($section[$i_key][1], "..") Or StringInStr($section[$i_key][1], ":") Or StringInStr($section[$i_key][1], "%") Or StringInStr($section[$i_key][1], "*") Or StringInStr($section[$i_key][1], "?")) And FileExists($delfile) Then
$f_attrib=FileGetAttrib($delfile)
If StringInStr($f_attrib, "D") Then
DirRemove($delfile, 1)
Else
FileDelete($delfile)
EndIf
EndIf
Next
Case "components"
$section=IniReadSection($inipath, $inisections[$i_sec])
If @error Then ContinueLoop
For $i_key=1 To $section[0][0]
$delfile=@ScriptDir & "\" & "components" & "\" & $section[$i_key][1]
; Security folder checked, only delete under KM folder
If FileExists($KMBIN) And $section[$i_key][1]<>"" And $section[$i_key][1]<>"." And Not(StringInStr($section[$i_key][1], "\") Or StringInStr($section[$i_key][1], "/") Or StringInStr($section[$i_key][1], "..") Or StringInStr($section[$i_key][1], ":") Or StringInStr($section[$i_key][1], "%") Or StringInStr($section[$i_key][1], "*") Or StringInStr($section[$i_key][1], "?")) And FileExists($delfile) Then
$f_attrib=FileGetAttrib($delfile)
If StringInStr($f_attrib, "D") Then
DirRemove($delfile, 1)
Else
FileDelete($delfile)
EndIf
EndIf
Next
Case "kplugins"
$section=IniReadSection($inipath, $inisections[$i_sec])
If @error Then ContinueLoop
For $i_key=1 To $section[0][0]
$delfile=@ScriptDir & "\" & "kplugins" & "\" & $section[$i_key][1]
; Security folder checked, only delete under KM folder
If FileExists($KMBIN) And $section[$i_key][1]<>"" And $section[$i_key][1]<>"." And Not(StringInStr($section[$i_key][1], "\") Or StringInStr($section[$i_key][1], "/") Or StringInStr($section[$i_key][1], "..") Or StringInStr($section[$i_key][1], ":") Or StringInStr($section[$i_key][1], "%") Or StringInStr($section[$i_key][1], "*") Or StringInStr($section[$i_key][1], "?")) And FileExists($delfile) Then
$f_attrib=FileGetAttrib($delfile)
If StringInStr($f_attrib, "D") Then
DirRemove($delfile, 1)
Else
FileDelete($delfile)
EndIf
EndIf
Next
Case "plugins"
$section=IniReadSection($inipath, $inisections[$i_sec])
If @error Then ContinueLoop
For $i_key=1 To $section[0][0]
$delfile=@ScriptDir & "\" & "plugins" & "\" & $section[$i_key][1]
; Security folder checked, only delete under KM folder
If FileExists($KMBIN) And $section[$i_key][1]<>"" And $section[$i_key][1]<>"." And Not(StringInStr($section[$i_key][1], "\") Or StringInStr($section[$i_key][1], "/") Or StringInStr($section[$i_key][1], "..") Or StringInStr($section[$i_key][1], ":") Or StringInStr($section[$i_key][1], "%") Or StringInStr($section[$i_key][1], "*") Or StringInStr($section[$i_key][1], "?")) And FileExists($delfile) Then
$f_attrib=FileGetAttrib($delfile)
If StringInStr($f_attrib, "D") Then
DirRemove($delfile, 1)
Else
FileDelete($delfile)
EndIf
EndIf
Next
Case "pref"
$section=IniReadSection($inipath, $inisections[$i_sec])
If @error Then ContinueLoop
For $i_key=1 To $section[0][0]
$delfile=@ScriptDir & "\" & "defaults\pref" & "\" & $section[$i_key][1]
; Security folder checked, only delete under KM folder
If FileExists($KMBIN) And $section[$i_key][1]<>"" And $section[$i_key][1]<>"." And Not(StringInStr($section[$i_key][1], "\") Or StringInStr($section[$i_key][1], "/") Or StringInStr($section[$i_key][1], "..") Or StringInStr($section[$i_key][1], ":") Or StringInStr($section[$i_key][1], "%") Or StringInStr($section[$i_key][1], "*") Or StringInStr($section[$i_key][1], "?")) And FileExists($delfile) Then
$f_attrib=FileGetAttrib($delfile)
If StringInStr($f_attrib, "D") Then
DirRemove($delfile, 1)
Else
FileDelete($delfile)
EndIf
EndIf
Next
Case "locales"
$section=IniReadSection($inipath, $inisections[$i_sec])
If @error Then ContinueLoop
For $i_key=1 To $section[0][0]
$delfile=@ScriptDir & "\" & "locales" & "\" & $section[$i_key][1]
; Security folder checked, only delete under KM folder
If FileExists($KMBIN) And $section[$i_key][1]<>"" And $section[$i_key][1]<>"." And Not(StringInStr($section[$i_key][1], "\") Or StringInStr($section[$i_key][1], "/") Or StringInStr($section[$i_key][1], "..") Or StringInStr($section[$i_key][1], ":") Or StringInStr($section[$i_key][1], "%") Or StringInStr($section[$i_key][1], "*") Or StringInStr($section[$i_key][1], "?")) And FileExists($delfile) Then
$f_attrib=FileGetAttrib($delfile)
If StringInStr($f_attrib, "D") Then
DirRemove($delfile, 1)
Else
FileDelete($delfile)
EndIf
EndIf
Next
Case "tools"
$section=IniReadSection($inipath, $inisections[$i_sec])
If @error Then ContinueLoop
For $i_key=1 To $section[0][0]
$delfile=@ScriptDir & "\" & "tools" & "\" & $section[$i_key][1]
; Security folder checked, only delete under KM folder
If FileExists($KMBIN) And $section[$i_key][1]<>"" And $section[$i_key][1]<>"." And Not(StringInStr($section[$i_key][1], "\") Or StringInStr($section[$i_key][1], "/") Or StringInStr($section[$i_key][1], "..") Or StringInStr($section[$i_key][1], ":") Or StringInStr($section[$i_key][1], "%") Or StringInStr($section[$i_key][1], "*") Or StringInStr($section[$i_key][1], "?")) And FileExists($delfile) Then
$f_attrib=FileGetAttrib($delfile)
If StringInStr($f_attrib, "D") Then
DirRemove($delfile, 1)
Else
FileDelete($delfile)
EndIf
EndIf
Next
Case "scripts"
$section=IniReadSection($inipath, $inisections[$i_sec])
If @error Then ContinueLoop
For $i_key=1 To $section[0][0]
$delfile=@ScriptDir & "\" & "scripts" & "\" & $section[$i_key][1]
; Security folder checked, only delete under KM folder
If FileExists($KMBIN) And $section[$i_key][1]<>"" And $section[$i_key][1]<>"." And Not(StringInStr($section[$i_key][1], "\") Or StringInStr($section[$i_key][1], "/") Or StringInStr($section[$i_key][1], "..") Or StringInStr($section[$i_key][1], ":") Or StringInStr($section[$i_key][1], "%") Or StringInStr($section[$i_key][1], "*") Or StringInStr($section[$i_key][1], "?")) And FileExists($delfile) Then
$f_attrib=FileGetAttrib($delfile)
If StringInStr($f_attrib, "D") Then
DirRemove($delfile, 1)
Else
FileDelete($delfile)
EndIf
EndIf
Next
Case "skins"
$section=IniReadSection($inipath, $inisections[$i_sec])
If @error Then ContinueLoop
For $i_key=1 To $section[0][0]
$delfile=@ScriptDir & "\" & "skins\default" & "\" & $section[$i_key][1]
; Security folder checked, only delete under KM folder
If FileExists($KMBIN) And $section[$i_key][1]<>"" And $section[$i_key][1]<>"." And Not(StringInStr($section[$i_key][1], "\") Or StringInStr($section[$i_key][1], "/") Or StringInStr($section[$i_key][1], "..") Or StringInStr($section[$i_key][1], ":") Or StringInStr($section[$i_key][1], "%") Or StringInStr($section[$i_key][1], "*") Or StringInStr($section[$i_key][1], "?")) And FileExists($delfile) Then
$f_attrib=FileGetAttrib($delfile)
If StringInStr($f_attrib, "D") Then
DirRemove($delfile, 1)
Else
FileDelete($delfile)
EndIf
EndIf
Next
Case "stylesheets"
$section=IniReadSection($inipath, $inisections[$i_sec])
If @error Then ContinueLoop
For $i_key=1 To $section[0][0]
$delfile=@ScriptDir & "\" & "styles" & "\" & $section[$i_key][1]
; Security folder checked, only delete under KM folder
If FileExists($KMBIN) And $section[$i_key][1]<>"" And $section[$i_key][1]<>"." And Not(StringInStr($section[$i_key][1], "\") Or StringInStr($section[$i_key][1], "/") Or StringInStr($section[$i_key][1], "..") Or StringInStr($section[$i_key][1], ":") Or StringInStr($section[$i_key][1], "%") Or StringInStr($section[$i_key][1], "*") Or StringInStr($section[$i_key][1], "?")) And FileExists($delfile) Then
$f_attrib=FileGetAttrib($delfile)
If StringInStr($f_attrib, "D") Then
DirRemove($delfile, 1)
Else
FileDelete($delfile)
EndIf
EndIf
Next
Case "profile"
$section=IniReadSection($inipath, $inisections[$i_sec])
If @error Then ContinueLoop
For $i_key=1 To $section[0][0]
$delfile=$CmdLine[1] & "\" & $section[$i_key][1]
; Security folder checked, only delete under KM folder
If FileExists($KMBIN) And $section[$i_key][1]<>"" And $section[$i_key][1]<>"." And Not(StringInStr($section[$i_key][1], "\") Or StringInStr($section[$i_key][1], "/") Or StringInStr($section[$i_key][1], "..") Or StringInStr($section[$i_key][1], ":") Or StringInStr($section[$i_key][1], "%") Or StringInStr($section[$i_key][1], "*") Or StringInStr($section[$i_key][1], "?")) And FileExists($delfile) Then
$f_attrib=FileGetAttrib($delfile)
If StringInStr($f_attrib, "D") Then
DirRemove($delfile, 1)
Else
FileDelete($delfile)
EndIf
EndIf
Next
Case "root"
$section=IniReadSection($inipath, $inisections[$i_sec])
If @error Then ContinueLoop
For $i_key=1 To $section[0][0]
$delfile=@ScriptDir & "\" & $section[$i_key][1]
; Security folder checked, only delete under KM folder
If FileExists($KMBIN) And $section[$i_key][1]<>"" And $section[$i_key][1]<>"." And Not(StringInStr($section[$i_key][1], "\") Or StringInStr($section[$i_key][1], "/") Or StringInStr($section[$i_key][1], "..") Or StringInStr($section[$i_key][1], ":") Or StringInStr($section[$i_key][1], "%") Or StringInStr($section[$i_key][1], "*") Or StringInStr($section[$i_key][1], "?")) And FileExists($delfile) Then
$f_attrib=FileGetAttrib($delfile)
If StringInStr($f_attrib, "D") Then
DirRemove($delfile, 1)
Else
FileDelete($delfile)
EndIf
EndIf
Next
EndSwitch
Next
Sleep(100)
FileDelete($inipath)
FileDelete($DEL1)
FileDelete($DEL2)

;GUIDelete()

$cleanclose='user_pref("kmeleon.plugins.sessions.cleanShutdown", true);'
FileWriteLine($kmprefs, $cleanclose)
Sleep(100)

Run($KMBIN)
WinWaitActive("[CLASS:KMeleon Browser Window]", "", 5)
Sleep(1000)

$findextname=GUICtrlRead($hCombo) ;StringTrimRight($findmacro, 4)
$message=$txt[9] & $findextname & $txt[10]
MsgBox(64, $txt[17], $message, 10)
ReloadExt()
; ENABLE controls:
;GUICtrlSetState($hCombo, $GUI_ENABLE)
;GUICtrlSetState($hButton, $GUI_ENABLE)
;GUICtrlSetState($mButton, $GUI_ENABLE)
GUICtrlSetState($iButton, $GUI_ENABLE)
;GUICtrlSetState($eButton, $GUI_ENABLE)
;GUISetState(@SW_ENABLE, $hGUI) ; Or enable the window
WinActivate($txt[3])
;Exit
EndIf
Else
GUICtrlSetData($desc, $txt[8])
EndIf

Case $msg=$mButton ; Edit macro button
$findmacro=IniRead($inipath, "macros", "1", "")
$macropath=@scriptdir &"\macros\" & $findmacro
If FileExists($macropath) Then
$editcmd=$medit & " " & $macropath
GUICtrlSetData($desc, $txt[11])
;WinSetOnTop($txt[3], "", 0)
Run($editcmd)
Else
GUICtrlSetData($desc, $txt[12])
EndIf

Case $msg=$iButton ; Run installer button
Run($KEITH)
Exit

Case $msg=$eButton ; Web site button
Run($openhome)
Exit
EndSelect
WEnd
EndFunc

Func openkmext()
$ask=MsgBox(32+4, $txt[3], $txt[13])
If $ask=7 Then
Exit
Else
Run($openhome)
EndIf
EndFunc

Func ReloadExt()
$FileList=_FileListToArray($inini, $kmunext)
If @error=1 Or $FileList=0 Then
; DISABLE controls:
GUICtrlSetState($hCombo, $GUI_DISABLE)
GUICtrlSetState($hButton, $GUI_DISABLE)
GUICtrlSetState($mButton, $GUI_DISABLE)
; Update labels and combobox control
$update=GUICtrlSetData($hCombo, "", "")
GUICtrlSetData($extinstdate, $txt[15])
GUICtrlSetData($desc, $txt[13])
GUICtrlSetData($Label1, $txt[14] & " 0")
;MsgBox(64, "K-meleon Extensions Manager", "You don't have any installed extensions.")
Else
; Setting string of extensions installed
$pentrim=_ArrayToString($FileList, "|", 1)
$remini=StringReplace($pentrim, ".ini", "")
$first=StringInStr($remini, "|" , "", 1)
$initial=StringMid($remini, 1, $first-1)
; Update labels and combobox control
$update=GUICtrlSetData($hCombo, "", "") ; First is needed clean the combo of elements
$update=GUICtrlSetData($hCombo, $remini, $initial)
GUICtrlSetData($Label1, $txt[14] & " " & $FileList[0])
$inipath=$inini & "\" & GUICtrlRead($hCombo) & ".ini" ;$FileList[_GUICtrlComboBox_GetCurSel($hCombo)+1]
$findinfo=IniRead($inipath, "info", "1", $txt[19])
; Check if is a malformed ini file and warning about it
If $findinfo="" Then $findinfo=$txt[8]
$a_date=FileGetTime($inipath,1)
If Not @error Then
$date=$a_date[0] & "/" & $a_date[1] & "/" & $a_date[2] & " " & $a_date[3] & ":" & $a_date[4] & ":" & $a_date[5]
; $date=yyyy/mm/dd hh:mmconfused smileys
EndIf
GUICtrlSetData($desc, $findinfo)
GUICtrlSetData($extinstdate, $txt[15] & " " & $date)
; ENABLE controls:
GUICtrlSetState($hCombo, $GUI_ENABLE)
GUICtrlSetState($hButton, $GUI_ENABLE)
GUICtrlSetState($mButton, $GUI_ENABLE)
EndIf
EndFunc

Func IniError()
$ask=MsgBox(32+4, $txt[3], $txt[8] & @CRLF & $txt[18])
If $ask=6 Then
If FileExists($KMBIN) Then ; Security folder checked, only delete under KM folder
FileDelete($inipath)
EndIf
Else
; Rename inifile to .bad
If FileExists($KMBIN) Then ; Security folder checked, only delete under KM folder
FileMove($inipath, StringReplace($inipath, ".ini", ".bad", 1), 1)
EndIf
EndIf
ReloadExt()
EndFunc


Re: KEM-international (beta)
Posted by: disrupted
Date: December 28, 2009 08:15PM

update:kem version 4.0

bug fix for the edit macro command when an extension does not include a macro

Re: KEM-international (beta)
Posted by: siria
Date: December 28, 2009 11:20PM

just a little syntax test ;-)

Quote

; $date=yyyy/mm/dd hh:mmconfused smiley

Quote

; $date=yyyy/mm/dd hh:mm:s


Re: KEM-international (beta)
Posted by: slayer
Date: January 20, 2010 02:57AM

I have a problem, suddenly the manager window doesn't appear. It seems to load something (sand clock), but nothing. Any ideas?

Re: KEM-international (beta)
Posted by: disrupted
Date: January 20, 2010 03:13AM

could be a corrupted locale file that it can't read, it's a one instance application so maybe it was running in the background or minimised? but that's probably not it ..try reinstalling it and restart the pc

kem is now version 5.0, update to fix a couple of bugs..try the latest
http://kmext.sourceforge.net/kem.htm

Re: KEM-international (beta)
Posted by: slayer
Date: January 20, 2010 03:38AM

Thanks, I've updated the extension with the link you gave me. Now it works. smiling smiley

Re: KEM-international (beta)
Posted by: jsnj
Date: January 20, 2010 12:07PM

Quote
disrupted
kem is now version 5.0, update to fix a couple of bugs..try the latest
http://kmext.sourceforge.net/kem.htm

v5.0 lists only 30 extensions. 4.0 lists them all.

K-Meleon forum is powered by Phorum.