[Accepted] Include dialogbox in the repos

Forum Forums antiX-development Development [Accepted] Include dialogbox in the repos

  • This topic has 17 replies, 5 voices, and was last updated Apr 24-7:03 pm by Xecure.
Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #45750
    Member
    XecureXecure

    Package name: dialogbox
    Project site: https://github.com/martynets/dialogbox
    Description: create GUI widgets for shell scripts using qt libraries.
    This is a scriptable engine which implements the idea of a GUI <-> text filter tool.

    Dependencies: qt5 libraries and others
    Installed-Size: 146 kB
    For antix (base and full), all libraries are already installed (because of minstall, repo-manager, packageinstaller etc.), so you can install it without having to download anything extra.
    Packages for stretch: https://gitlab.com/nXecure/my-packages/-/tree/master/dialogbox/dialogbox-1.0-1/stretch
    Packages for buster: https://gitlab.com/nXecure/my-packages/-/tree/master/dialogbox/dialogbox-1.0-1/buster
    Packages for bullseye: https://gitlab.com/nXecure/my-packages/-/tree/master/dialogbox/dialogbox-1.0-1/bullseye

    Story:
    I have been looking for a more flexible tool than yad to build interfaces for shell scripts, and have fought with gtkdialog my fair bit (cannot get it to talk with functions inside the script and can only call the script with arguments, which isn’t very flexible).
    As GTK2 is no longer available in Debian Bullseye repos (even if some libraries will still be maintained by the antiX devs, little by little, with time, gtk2 will become a weight for antiX), I was looking for a replacement for it. I finally found a project by Andriy Martynets (from the Ukraine), named dialogbox. It is now based on qt5, so it will last for some more years.

    Compared to yad, it is way more flexible, but it misses some things that yad is much better at (and dialogbox also can do things yad cannot, like giving me to possibility to have different layouts and I can manage and customize each element separately). The main problem with yad is that interaction is mostly one directional, and the yad dialogs cannot change their appearance and options when I interact with it. yad windows are heavier than dialogbox windows, and sometimes stay in memory even when the yad window closes.

    Compared to gtkdialog, gtkdialog is lighter. gtkdialog lets you manage layouts inside layouts, while dialogbox cannot easily manage frames inside other frames. Resource wise, gtkdialog loads faster (on my “slow CPU emulation VM” Control Centre built with gtkdialog loads in 3-5 seconds while a similarly complex dialogbox window loads in 7-10 seconds. Comparing RAM use, gtk based COntrol Centre takes about 10 MBs, while a similarly complex dialogbox between 12-19 MBs.
    Comparing easy of use and flexibility, dialogbox is easier to use.

    Above I linked to packages I build for old, current and soon-to-come antiX releases. I have tested briefly on both 32 and 64bits of each and dialogbox seems to perform similarly on all of them. Probably more will reveal if there are hidden bugs, but I haven’t experienced them so far.
    new-antixcc
    With this, I would like not only for this package to be included in the antiX Linux repos, but possibly to also be included in the main installation when enough applications are created using it.
    Below I include a picture of an antiX Control Center remake using dialogbox, I also include the script in case you see it valuable enough for, after testing and general aproval, to be replace the current version.

    The script created is unnecessary complex (as I used it to learn and see some of the dialogbox possibilities), and simplifying it will probably reduce loading time on old machines (too many “for” loops). At the top of the file, you can see many variables you can edit to see the flexibility of the dialogbox tool. You can have tabs to separate pages, change icon size, change orientation, text inside or outside of buttons, number of consecutive elements, automatic separation between elements (stretch), etc. In this example, I am using a listbox that, when an element inside it is clicked, will hide the current frames of elements and show the ones corresponding to the selected list item. Transitions are smoother with tabs on, but scaling of the dialog doesn’t change element positions. If not running live, instead of removing the “Live” elements, I have them “disabled”, so you can see they exist but cannot launch them.
    I have used yad to complement the antiX Control centre for you to switch between different layouts I have considered best for the antiX CC (and they will be saved and remembered). Also, when selecting to view a text item (like icewm config files), it will launch a yad window to let you select the specific file instead of loading all of them. It will also use whatever text editor you set with Preferred Applications, and not geany.
    As I am using the same words as the original Control Centre, all translation efforts will not be lost (see image above).
    It still has the images hard-coded (I didn’t have the time to figure out a better way, so it will stay like that for now).
    If you launch it and see a different font, thtat is because qt applications use a different font. Launch qt5ct (QT5 Settings) with App select and, in the second tab “Fonts”, Change both to Ubuntu 11 Regular and Medium, and it will look similar to other gtk applications in antiX.

    I would like to use this tool to build the welcome screen and other tools for antiX, but I need the approval of the dev team first (if it is not included in future antiX releases, then the tools cannot work). I also hope it can be useful for all the people who, like me, only know bash scripting and would like to create programs without having to spend a lot of time learning python or other more difficult languages like C++).

    Edit: Thanks for accepting the request. I hope others will also be able to make use of it. I know I will.

    • This topic was modified 5 months, 2 weeks ago by Xecure. Reason: My thanks
    #45759
    Member
    AvatarPPC

    I just installed the 64 bits version of the dependency and tried out your control papel.
    You are a legend 🙂
    It’s fast and light on resources.
    I almost cried, because I only use YAD as a GUI for my scripts…
    – I never even noticed that the portuguese translation for the first tab is incomplete, it’s lacking the last few letters. I had to launch the official CC to confirm that also happens there!

    Positive critics:
    – The icons look a bit small
    – You could add some needed entries to the control centre – like your wi-fi switch, or even the script to add and remove apps to antiX startup

    P.

    #45764
    Forum Admin
    anticapitalistaanticapitalista

    Request granted! debs should appear asap.

    Philosophers have interpreted the world in many ways; the point is to change it.

    antiX with runit - leaner and meaner.

    #45766
    Member
    XecureXecure

    Request granted! debs should appear asap.

    Thanks, anticapitalista.

    @PPC I think we can take advantage of this for any kind of script. I was going to wait a bit and also publish a frugal install gui to show that we can create installation GUIs with dialogbox, but time is not on my hand right now, so that project is on hold.
    yad is more intuitive and easier, but it isn’t as flexible for creating complex layouts. The best discovery I had with yad was when I saw your first welcome screen and discovered that you can use columns to separate elements inside a yad form. That was already a big win, but after some time I felt restricted, so exploration for alternatives started.

    – You could add some needed entries to the control centre – like your wi-fi switch, or even the script to add and remove apps to antiX startup

    I wanted to only display the initial elements in the antiX CC as a proof of concept, and then we could add the necessary new items on popular demand.
    [But let me tell you a secret. You cannot see it, but the antiX wifi switch is hiding inside the Control Centre version I shared. When launching connman or ceni, in reality it launches them through the antiX wifi switch script, hehehehe. Once I modify it and make it even more silent, nobody will know the script exists, but it will be there, helping the user in secret].

    I never even noticed that the portuguese translation for the first tab is incomplete, it’s lacking the last few letters. I had to launch the official CC to confirm that also happens there!

    That is probably related to how large the tab names can get. The Portuguese translator was smart and cut the words so they fit well. Other languages didn’t take that into account, and that is why I limited the size of the listbox, so that really long section names wouldn’t make that much space (and you would need to scroll to be able to see it).

    • This reply was modified 5 months, 2 weeks ago by Xecure. Reason: Tab/section names and translations
    #45781
    Forum Admin
    anticapitalistaanticapitalista

    Should be in main repos now.

    Philosophers have interpreted the world in many ways; the point is to change it.

    antiX with runit - leaner and meaner.

    #45783
    Member
    XecureXecure

    Just checked. It is there. Thank you very much!

    #45819
    Member
    Avatarskidoo

    antixcc-dialogbox.zip

    suggestion:
    qproperty-alignment: AlignCenter
    qproperty-alignment: ‘AlignVCenter | AlignLeft’

    seems to yield a better visual result, especially for the ClassicView mode

    #45832
    Member
    XecureXecure

    qproperty-alignment: ‘AlignVCenter | AlignLeft’

    Thanks, skidoo. It works well on the classic view.
    I will add it as a property only for the classic view, so it can look as close as the original antixcc script as possible.

    #45833
    Member
    KooKoo

    antixcc-dialogbox version is now my default control-center. Nice job Xecure

    Is there a way to change the font. Can’t find anything in the script related to font type. ?

    T430 i7-3632QM 16gb , antiX-19.2.1-runit_x64-base Hannie Schaft 29 March 2020 , 5.8.16-antix.1-amd64-smp

    #45836
    Member
    XecureXecure

    Is there a way to change the font. Can’t find anything in the script related to font type. ?

    Yes. As it uses qt instead of gtk, you need to launch qt5ct and edit the fonts in the second tab. I set mine to Ubuntu 11 regular and ubuntu 11 medium.

    Glad you enjoyed it. Once I figure out how to get the script to find icons corresponding to the default icon theme, then changing themes would also change the icons it displays for each button, and default to the antix-papirus icons for cases when they are not found. I myself enjoy the antix-papirus icons (comes by default with the package control-centre-antix in buster, I think)

    • This reply was modified 5 months, 2 weeks ago by Xecure. Reason: icon info
    #45909
    Member
    KooKoo

    Thanks for your reply will be having some fun. You always come up with interesting new ideas.

    T430 i7-3632QM 16gb , antiX-19.2.1-runit_x64-base Hannie Schaft 29 March 2020 , 5.8.16-antix.1-amd64-smp

    #46399
    Member
    KooKoo

    I see you have updated to version 1.01 an change of uploading just the script. Don’t want an installer

    T430 i7-3632QM 16gb , antiX-19.2.1-runit_x64-base Hannie Schaft 29 March 2020 , 5.8.16-antix.1-amd64-smp

    #46401
    Member
    Avatarskidoo

    Koo, it’s not “just a script”. It is a compiled executable file.
    You can use gdebi or other to extract just the executable file… but idunno why anyone would do so.
    BTW, changelog indicates that v1.01 changed away from using Qt4 libs; now using Qt5.
    Without the debfile “installer”, you’ll be flying blind — unaware of which dependent packages it requires.

    #46480
    Member
    KooKoo

    Sorry was thinking it was the antixcc.sh script that was updated, now relies it was the program dialogbox itself that was updated

    T430 i7-3632QM 16gb , antiX-19.2.1-runit_x64-base Hannie Schaft 29 March 2020 , 5.8.16-antix.1-amd64-smp

    #46680
    Member
    XecureXecure

    I need to go back on my words. I was testing different things on dialogbox and decided to see how much RAM it used when loading HTML pages. I discovered that I was off by my RAM calculations before.

    In fact, the control Centre remake (using nothing but dialogbox) I linked uses similar RAM to package installer or Repo manager, both using similar qt libraries. About 41 MBs of RAM. Much more than the 10 MBs of RAM used by the current Control Centre.
    I tried other small programs with gtkdialog and I reach the same RAM uses. When loading HTML pages inside textview widgets it uses and extra 5MBs, but that is irrelevant.

    Sorry for the inaccurate measurements in my original post. Using “watch sudo ps_mem.py” is more accurate to the truth, in my opinion, and I should have used it before posting. gtkdialog based programs use a ridiculous (as in small) amount of RAM. So dialogbox is not a good alternative for replacing any gtkdialog based antiX programs.

    Sorry for the wrong information. I will keep looking for other alternatives.

    Regards.

Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.