November 9, 2008 8

Yalı4: Porting something to Qt4

Yali is the first Pardus software a user encounters. Basically, it recognizes the hardware and installs Pardus software from the installation media (i.e CD) to a hard disk partition user selects. Yalı was developed mainly with Qt and Python (PyQt ..) but for supporting new technologies (there is Qt4 now and it rocks !)

I ported Yalı Qt3 version to Qt4 named as Yali4 (to avoid chaos; we still use Qt3 version for some of other projects); while porting I have totally changed some approach in visual design.

General UI:

In general I used Qt Style Sheet support for design basics; a centered shiny background, transparent icons and graphics in screens and some WidgetStyle from Qt Style Sheet examples. For screens I prefer QStackedWidget which supports transparency too and some signals for walking between screens. (Also while desining YALI’ screen infrastructure I tried to make it modular — I will blog it later. )

Standard widgets of Qt4 are enough for YALI but for making something shiny I made some tricks;

For each partition I used a QRadioButton (which has already have checked/unchecked state) and QSplitter to seperate them (each splitter width calculated from partition size).

Flexibility of Qt4 gave me this;

You just need some CSS tricks like this;

  QRadioButton::indicator { width:1px;height:1px;border-color:white; }
  QRadioButton:checked { border:6px solid rgba(255,255,255,180); }
  QSplitter::handle { background-color:rgba(255,255,255,0); }

and some colors and icons;

  metaTypes = {"ntfs" :{"bgcolor":"#18D918",
                        "fgcolor":"#000000",
                        "icon"   :"windows"},
               "hfs+" :{"bgcolor":"#C0A39E",
                        "fgcolor":"#000000",
                        "icon"   :"other"},
               "ext3" :{"bgcolor":"#7590AE",
                        "fgcolor":"#FFFFFF",
                        "icon"   :"linux"}}

  partition.setIcon(QtGui.QIcon(":/gui/pics/%s.png" % icon))
  partition.setStyleSheet("background-color:%s;color:%s" % (meta["bgcolor"],meta["fgcolor"]))

I’m done time is 03:50 now :) For more information about Yalı feel free to get in source at Pardus SVN.

Tags: ,

8 Responses to “Yalı4: Porting something to Qt4”

  1. onety-three says:

    Verrry orange, but apart from that I like it a lot :) I guess I should finally try Pardus.
    Keep up the great work!

  2. Mark Kretschmann says:

    This looks very nice indeed :)

    It was interesting to see what Qt Style Sheets can achieve.

  3. CoolGoose says:

    I think that the confirmation dialog should be less transparent, but that’s only a personal opinion.

  4. gokmen says:

    @CoolGoose

    Yes, you are right I will change the background ;) thanks.

  5. Lukas says:

    Hey!
    Nice work done! Pardus seems to rock, need to try it :)

    Lukas

  6. Markus says:

    Very nice, but indeed, very, very orange as pointed out by the first comment here. Is this colour the final one?

    Apart from that, keep up the good work!

  7. Gil says:

    Wow, that’s pretty! very nice :)

  8. gokmen says:

    @Markus

    Yes, it is the final color; actually it is our 2008 Release color scheme ;)

    U can get and try from http://pardus.org.tr/eng/download.html

Leave a Reply