You are here

ConvertAll Portable: Custom Colors

5 posts / 0 new
Last post
Bart.S
Offline
Last seen: 6 months 2 weeks ago
Developer
Joined: 2008-07-23 07:56
ConvertAll Portable: Custom Colors

Hi Travis,
I don't know if this is a bug, let's call this a missing feature Smile

You could choose Custom Colors in ConvertAll.

  • Options --> Set background color --> Add to Custom Colors or
  • Options --> Set text color --> Add to Custom Colors

These colors are saved in the Registry:

  • HKCU\Software\Trolltech\OrganizationDefaults\Qt\customColors

Your launcher doesn't save and restore this key, it only deletes the key. So the Custom Colors are lost at next launch.

PS: Well folks, don't post the same in my FreeMat Portable thread, Dev Test 3 has the same missing feature too. Edit: Feature added in Dev Test 4 Smile

PPS: Another small thing for the next release: Legal Copyright: PortableApps.com and contributors

Bart.S
Offline
Last seen: 6 months 2 weeks ago
Developer
Joined: 2008-07-23 07:56
New thoughts :-)

I think we need common code for all QT-apps. Without that, registry keys becomes messy.
Say we have 2 or more QT-apps (like FreeMat and ConvertAll):

  1. Start App A:

    • customColors key is created
  2. Start App B:
    • customColors key is renamed to customColors-BackupbyB
    • new customColors key is created
  3. If you change custom colors in A or B, the customColors key will be changed
    • Case X:

      1. Close App B:

        • customColors key is removed
        • customColors-BackupbyB key is renamed to customColors
        • customColors changes are lost for A
      2. Close App A:
        • customColors key is removed
      3. nothing is left behind
    • Case Y:
      1. Close App A:

        • customColors key is removed
        • customColors changes are lost for B
      2. Use App B:
        • customColors key is recreated
      3. Close App B:
        • customColors key is removed
        • customColors-BackupbyB key is renamed to customColors
      4. customColors key is left behind

Suggestion: Instead of using -BackupbyAPortable and -BackupbyBPortable we should introduce something like -BackupbyPortableApps.com.
Each PortableApp uses the same key and the last closed set the original key back.

Ahh, too much html, but I hope you understand my thoughts Smile

Bart.S
Offline
Last seen: 6 months 2 weeks ago
Developer
Joined: 2008-07-23 07:56
Ok,

maybe something like this do the trick. Comments are welcome!

RegistryBackup:
	${registry::KeyExists} "HKCU\Software\PortableApps.com" $R0 
	StrCmp $R0 "0" NextLabel	;portable Qt-App running
	${registry::KeyExists} "HKCU\Software\Trolltech\OrganizationDefaults\Qt\customColors" $R0
	StrCmp $R0 "-1" NextLabel
	${registry::MoveKey} "HKCU\Software\Trolltech\OrganizationDefaults\Qt\customColors" "HKCU\Software\Trolltech\OrganizationDefaults\Qt\customColors-BackupByPortableApps" $R0

NextLabel:
	${registry::Read} "HKCU\Software\PortableApps.com" "QtAppsRunning" $0 $1
	StrCmp $1 "" '${registry::Write} "HKCU\Software\PortableApps.com" "QtAppsRunning" "1" "REG_QWORD" $R0'
	StrCmp $1 "" NextLabel2
	IntOp $2 $0 + 1
	${registry::Write} "HKCU\Software\PortableApps.com" "QtAppsRunning" $2 "REG_QWORD" $R0

NextLabel2:
	;Restore Keys
	;LaunchNow
	;CheckRunning
	
	${registry::Read} "HKCU\Software\PortableApps.com" "QtAppsRunning" $0 $1
	StrCmp $0 "1" '${registry::DeleteKey} "HKCU\Software\PortableApps.com" $R0' ;this is the last Qt-App running
	StrCmp $0 "1" SetOriginalKeyback
	IntOp $2 $0 - 1
	${registry::Write} "HKCU\Software\PortableApps.com" "QtAppsRunning" $2 "REG_QWORD" $R0
	Goto NextLabel3
	
SetOriginalKeyback:	
	${registry::KeyExists} "HKCU\Software\Trolltech\OrganizationDefaults\Qt\customColors-BackupByPortableApps" $R0
	StrCmp $R0 "-1" NextLabel3
	${registry::MoveKey} "HKCU\Software\Trolltech\OrganizationDefaults\Qt\customColors-BackupByPortableApps" "HKCU\Software\Trolltech\OrganizationDefaults\Qt\customColors" $R0

NextLabel3:	
	;SetSettingsBack
	;CleanUpRegistry
Travis Carrico
Offline
Last seen: 16 years 1 week ago
Developer
Joined: 2006-10-22 00:30
colors

well i was already aware of this. i decided to have it mess with the registry as little as possible because i didn't really think anyone would care about having their swatch of saved custom colors. if you change the color it saves the current one, it just doesn't save all the ones you make. i can add that in for the next upgraded version though

Bart.S
Offline
Last seen: 6 months 2 weeks ago
Developer
Joined: 2008-07-23 07:56
.

i didn't really think anyone would care about having their swatch of saved custom colors.
Well, that's true but not the main problem.
if you change the color it saves the current one, it just doesn't save all the ones you make
Nope, you could save 16 custom colors. Just click a square below custom colors, change the color and click "Add to custom colors".

I think the main problem is that if you use 2 or more Qt-Apps and you don't close them in reversed order, registry keys will be left behind and/or the original key will be overwritten.
There are many Qt-Apps out there, either we find a solution or the user should only use one portable Qt-App at the same time.

Log in or register to post comments