IconClone Icon Exchange

miker1264 · 71770

Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #120 on: February 07, 2023, 05:53:49 PM
Miker I encountered a problem with this icon is named 1.3



miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #121 on: February 07, 2023, 06:09:35 PM
Miker I encountered a problem with this icon is named 1.3

Because is has a '.' dot in the filename. IconClone can't handle those filenames at the moment.

Same if the filename was "Image1.png" & the icon would then be "Image1.png.info" but it won't load the icon image. Not yet.



Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #122 on: February 07, 2023, 06:18:12 PM
Ok Miker :)



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #123 on: February 08, 2023, 04:04:54 AM
Here is the updated version 1.09 for testing. Compiled for x86. The ReadMe text file helps explain the changes.

I will test my copy for another day or two and if there are no changes I will upload it to AROS Archives.

When using Magellan the icon images that changed will not show correctly till the window or volume is re-opened. Then the new icon images will display correctly.

Outstanding Miker, now IconClone not only replaces the image to the icons, but creates the icon if not present by picking up the Def_Icons

Example, if a volume like DH0, RAM, don't have the "Disk.info" fil in the root of the volume, on the first drag and drop, IconClone will give a "physiological" error (Disk.info missing), meanwhile it has generated in that volume the "Disk.info" file, on the second drag and drop "voila" everything will work perfectly because the Disk.info had been generated


miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #124 on: February 09, 2023, 01:52:54 PM
Yes. It will first look for ':' for a volume name then it will append "disk.info' then it will use GetDiskObjectNew for the new filename (vol+disk.info). If GetDiskObject fails it uses GetDefDiskObject. Then it checks to see if the disk.info exists at the root of volume. If not it gives a warning. Then finally it uses PutDiskObject to copy the def_Disk icon.

I suppose the warning should be 'disk icon not found. would you like to assign one?' (YES/NO). That gives you the option to copy the def_icon instead of doing it by default.

The same is true for the drag-n-drop for drawers & files. If the drawer icon or file icon doesn't exist (it uses def_) then it will copy the def_icon to that location and load it instead. In that way you can easily assign new icons to drawers & files.

It won't work though if your file has a '.' dot in the filename such as "Image.png" & the icon name is "Image.png.info". Hopefully I will fix that in the next update for IconClone.

I believe that's a nice feature to easily assign icons. Not sure if I should leave the disk.info error message or simply remove it and copy def icons automatically then load them.
« Last Edit: February 09, 2023, 02:01:30 PM by miker1264 »



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #125 on: February 09, 2023, 02:00:50 PM
S in fact the message is better to remove it, some users might think of a mistake, and not understand that the icon incece was already copied from the def_


miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #126 on: February 09, 2023, 02:05:39 PM
I can remove the error message. If the user is dropping a volume disk icon then the intent is to display an icon for the icon exchange. It shouldn't matter if it's a def_icon.

So I will remove the message and copy the def_icon automatically just like other drawers & files without icons.



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #127 on: February 09, 2023, 02:33:03 PM
The Def_HardDisk.info usually is the standard AROS icon, by defaul no AROS volume should have a Disk.info, the AROS system by default assigns the correct icon automatically based on the Volume type.

There are special cases, such as when mounting a shared, AROS assigns a Floppy Icon, unlike OS3 which instead assigns a Hardisk.info Icon

This is normal, OS3 assigns volumes the def_Disk.info, AROS instead assigns volumes the def_HardDisk.info

In this case it is solved by creating a script to copy and customize the Shared icon, as I did on AROS One.


miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #128 on: February 09, 2023, 03:00:52 PM
The Def_HardDisk.info usually is the standard AROS icon, by defaul no AROS volume should have a Disk.info, the AROS system by default assigns the correct icon automatically based on the Volume type.

There are special cases, such as when mounting a shared, AROS assigns a Floppy Icon, unlike OS3 which instead assigns a Hardisk.info Icon

This is normal, OS3 assigns volumes the def_Disk.info, AROS instead assigns volumes the def_HardDisk.info

In this case it is solved by creating a script to copy and customize the Shared icon, as I did on AROS One.

GetDiskObjectNew takes care of all that for us automatically. If you open a shell and look at the root of the AROS: volume is the file "Disk.info". That's the filename IconClone is looking for. At that point it doesn't matter which file the def_icon refers to. IconClone merely assigns and loads whichever def_icon the system returns.

But your explanation helps to understand which def_icons are for which volumes. Thanks for that information.

BTW - I have a theory about why I'm having such difficulty doing a direct icon image exchange using the command line only.

But then it may be as easy as a misplaced EraseRectangle operation to erase a portion of a non-existent rasterport for an unopened window because we are using the command line!

PS - Removing the misplaced EraseRectangle function call helped some. It no longer crashes on x86-64 when doing an icon image exchange at the command line. But there are more issues to resolve than just that to get the CLI version working.

« Last Edit: February 10, 2023, 09:50:11 PM by miker1264 »



miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #129 on: February 12, 2023, 04:25:09 PM
Sometimes it is better to use AROS x86-64 to develop applications because it is very precise which requires precise program code.

AROS x86 however is much more forgiving. On AROS x86 doing an icon image exchange at the commandline simply didn't work. There were no errors. It just didn't work.

On AROS x86-64 though at first the system would crash every time I tried until I realized that the Erase_Rectangle function was the culprit. Erase_Rectangle uses graphics library to draw the background color in a specified rectangle on the window rasterport. But the problem at the commandline is that you cannot erase a portion of a window that hasn't been opened.

But even after that correction the Exchange_Icon function when used at the commandline kept causing a system crash. I had been looking at the code in the function for 3 days now trying everything I possibly could to make it work. But it failed.

The solution is very easy when you think about it. The last line of code in the Exchange_Icon function was Display_Icon(destname, "right", ...). It was an Id-10-t error!

You cannot display an icon image in a user interface that hasn't been opened. That causes a horrible system crash! Now it works just fine! :-)

« Last Edit: February 12, 2023, 11:08:39 PM by miker1264 »



miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #130 on: February 13, 2023, 08:05:15 AM
In the next few days I will remove any test code and I'll compile it for 68k, x86 & x86-64.

This will be the final release candidate for version 1.9 of IconClone. If all goes well then I will post it on AROS Archives. And this will be the first one posted on Aminet.  :)

I work full time during the day so it's not easy to do updates.
« Last Edit: February 13, 2023, 10:34:52 AM by miker1264 »



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3762
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #131 on: February 13, 2023, 10:38:44 AM
Thanks miker, great job ! will the 68k version be compatible with Amiga OS too ?


miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #132 on: February 13, 2023, 10:51:21 AM
Thanks miker, great job ! will the 68k version be compatible with Amiga OS too ?

The 68k version for AROS will work with OS35 icons (Glow Icons) & Amiga OS4 icons.

The binary file won't work on Amiga OS 3.x because it's compiled for AROS. As with many apps written for Amiga that work on AROS 68k but not all AROS apps work with Amiga unless they are specifically written for Amiga also.

I would like to see IconClone compiled for Amiga OS4.  8)

Maybe in the next update I can revise some of the source code to make it more compatible with compiling for Amiga.I could use the DevCPP IDE I used several years ago for Amiga OS3.
« Last Edit: February 13, 2023, 11:30:56 AM by miker1264 »



miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #133 on: February 14, 2023, 09:13:15 AM
@paolone

The command line icon exchange is now working! I will compile IconClone for x86. This will be the release candidate for the latest version.

Also -
The message that was displayed when a volume disk icon wasn't found has been removed. Now it won't prompt. It will just copy the default disk icon to that location then load it for the icon exchange. It behaves the same now as dropping a file or directory that only has a default icon. It copies it instead.

The '.' dot in filename issue is also being fixed. In Display_Icon we have to get a diskobject to view the images. If it fails to get a diskobject it prompts: "Error loading icon. Bad filename.". I was using GetDiskObject for a file such as "Image png.info". But that will fail because it's a default picture icon. So I changed it to GetDiskObjectNew which will try to get a diskobject. If that fails it uses GetDefDiskObject instead. That's what we wanted.

So hopefully the new x86 binary will be ready later today. One of the nice features of these small icon tools that I'm writing is that they can all easily be compiled in a shell with gcc.

When using IconClone with Magellan the new icon images will not be visible until you close & re-open the drawer or volume where the destination icon is located. So if you do an icon exchange & nothing seems to happen do the above. When using Wanderer the icon image changes are visible automatically within a few seconds after the icon exchange.

« Last Edit: February 14, 2023, 07:05:01 PM by miker1264 »



Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #134 on: February 14, 2023, 01:15:44 PM
thank you Miker