Back to index

kdeartwork  4.3.2
Public Slots | Signals | Public Member Functions | Protected Slots | Private Attributes
IceWMConfig Class Reference

#include <config.h>

List of all members.

Public Slots

void load (KConfig *conf)
void save (KConfig *conf)
void defaults ()


void changed ()

Public Member Functions

 IceWMConfig (KConfig *conf, QWidget *parent)
 ~IceWMConfig ()

Protected Slots

void slotSelectionChanged ()
void callURL (const QString &s)
void findIceWMThemes ()

Private Attributes

KConfig * icewmConfig
QCheckBox * cbThemeTitleTextColors
QCheckBox * cbTitleBarOnTop
QCheckBox * cbShowMenuButtonIcon
Q3ListBox * themeListBox
QLabel * themeLabel
KUrlLabel * urlLabel
QString localThemeString
Q3VBox * mainWidget

Detailed Description

Definition at line 40 of file config.h.

Constructor & Destructor Documentation

IceWMConfig::IceWMConfig ( KConfig *  conf,
QWidget *  parent 

Definition at line 61 of file config.cpp.

       : QObject( parent )
       icewmConfig = new KConfig("kwinicewmrc");

       mainWidget = new Q3VBox( parent );
       mainWidget->setSpacing( KDialog::spacingHint() );

       themeListBox = new Q3ListBox( mainWidget );
                            i18n("Make your IceWM selection by clicking on a theme here. ") );

       cbThemeTitleTextColors = new QCheckBox(
                            i18n("Use theme &title text colors"), mainWidget );

                            i18n("When selected, titlebar colors will follow those set "
                            "in the IceWM theme. If not selected, the current KDE "
                            "titlebar colors will be used instead.") );

       cbTitleBarOnTop = new QCheckBox(
                            i18n("&Show title bar on top of windows"), mainWidget );

                            i18n("When selected, all window titlebars will be shown "
                            "at the top of each window, otherwise they will be "
                            "shown at the bottom.") );

       cbShowMenuButtonIcon = new QCheckBox(
                            i18n("&Menu button always shows application mini icon"), mainWidget );

                            i18n("When selected, all titlebar menu buttons will have "
                            "the application icon shown. If not selected, the current "
                            "theme's defaults are used instead.") );

       urlLabel = new KUrlLabel( mainWidget );
       urlLabel->setText( i18n("Open KDE's IceWM theme folder") );

       themeLabel = new QLabel(
                            i18n("Clicking on the link above will cause a window to appear "
                                "showing the KDE IceWM theme folder. You can "
                            "add or remove native IceWM themes by "
                            "uncompressing <b></b> theme files "
                            "into this folder, or by creating folder symlinks to "
                            "existing IceWM themes on your system."), mainWidget );

       // Load configuration options
       load( conf );

       // Ensure we track user changes properly
       connect( themeListBox, SIGNAL(selectionChanged()),
                      this, SLOT(slotSelectionChanged()) );

       connect( urlLabel, SIGNAL(leftClickedUrl(const QString&)),
                      this, SLOT(callURL(const QString&)));

       connect( cbThemeTitleTextColors, SIGNAL(clicked()),
                      this, SLOT(slotSelectionChanged()) );

       connect( cbTitleBarOnTop, SIGNAL(clicked()),
                      this, SLOT(slotSelectionChanged()) );

       connect( cbShowMenuButtonIcon, SIGNAL(clicked()),
                      this, SLOT(slotSelectionChanged()) );

       // Create the theme directory (if not found) ... and obtain the path as we do so.
       localThemeString = KGlobal::dirs()->saveLocation("data", "kwin");
       localThemeString += "/icewm-themes";
       if (!QFile::exists(localThemeString))

       // Watch the icewm theme directory for theme additions/removals
       connect( KDirWatch::self(), SIGNAL(dirty(const QString&)), this, SLOT(findIceWMThemes()) );
       connect( KDirWatch::self(), SIGNAL(created(const QString&)), this, SLOT(findIceWMThemes()) );
       connect( KDirWatch::self(), SIGNAL(deleted(const QString&)), this, SLOT(findIceWMThemes()) );

       // Set the konqui link url
       QString urlThemeString = QString("file://") + localThemeString;
       urlThemeString.replace( QRegExp("~"), "$HOME" );
       urlLabel->setURL( urlThemeString );

       // Make the widgets visible in kwindecoration


Here is the call graph for this function:

Definition at line 152 of file config.cpp.

       delete icewmConfig;
       delete mainWidget;

Member Function Documentation

void IceWMConfig::callURL ( const QString &  s) [protected, slot]

Definition at line 217 of file config.cpp.

       KToolInvocation::invokeBrowser( s );

Here is the caller graph for this function:

void IceWMConfig::changed ( ) [signal]

Here is the caller graph for this function:

void IceWMConfig::defaults ( ) [slot]

Definition at line 265 of file config.cpp.

       cbThemeTitleTextColors->setChecked( true );
       cbTitleBarOnTop->setChecked( true );
       cbShowMenuButtonIcon->setChecked( false );
       themeListBox->setCurrentItem( themeListBox->findItem(i18n("Infadel #2 (default)")) );
void IceWMConfig::findIceWMThemes ( ) [protected, slot]

Definition at line 162 of file config.cpp.

       QStringList dirList = KGlobal::dirs()->findDirs("data", "kwin/icewm-themes");
       QStringList::ConstIterator it;

       // Remove any old themes in the list (if any)
       themeListBox->insertItem( i18n("Infadel #2 (default)") );

       // Step through all kwin/icewm-themes directories...
       for( it = dirList.begin(); it != dirList.end(); it++)
              // List all directory names only...
              QDir d(*it, QString("*"), QDir::Unsorted, QDir::Dirs | QDir::Readable );
              if (d.exists())
                     QFileInfoListIterator it2( *d.entryInfoList() );
                     QFileInfo* finfo;

                     // Step through all directories within the kwin/icewm-themes directory
                     while( (finfo = it2.current()) )
                            // Ignore . and .. directories
                            if ( (finfo->fileName() == ".") || (finfo->fileName() == "..") )

                            if ( !themeListBox->findItem( finfo->fileName()) )
                                   themeListBox->insertItem( finfo->fileName() );


       // Sort the items

       // Select the currently used IceWM theme
       QString themeName = icewmConfig->readEntry("CurrentTheme");

       // Provide a theme alias
       if (themeName == "default")
              themeName = "";

       if (themeName.isEmpty())
                     themeListBox->findItem( i18n("Infadel #2 (default)") ) );
              themeListBox->setCurrentItem( themeListBox->findItem(themeName) );

Here is the caller graph for this function:

void IceWMConfig::load ( KConfig *  conf) [slot]

Definition at line 230 of file config.cpp.


       bool override = icewmConfig->readEntry( "ThemeTitleTextColors", true );
       cbThemeTitleTextColors->setChecked( override );

       override = icewmConfig->readEntry( "TitleBarOnTop", true );
       cbTitleBarOnTop->setChecked( override );

       override = icewmConfig->readEntry( "ShowMenuButtonIcon", false );
       cbShowMenuButtonIcon->setChecked( override );


Here is the call graph for this function:

Here is the caller graph for this function:

void IceWMConfig::save ( KConfig *  conf) [slot]

Definition at line 248 of file config.cpp.

       icewmConfig->writeEntry( "ThemeTitleTextColors", cbThemeTitleTextColors->isChecked() );
       icewmConfig->writeEntry( "TitleBarOnTop", cbTitleBarOnTop->isChecked() );
       icewmConfig->writeEntry( "ShowMenuButtonIcon", cbShowMenuButtonIcon->isChecked() );

       if (themeListBox->currentText() == i18n("Infadel #2 (default)"))
              icewmConfig->writeEntry("CurrentTheme", "default");
              icewmConfig->writeEntry("CurrentTheme", themeListBox->currentText() );

void IceWMConfig::slotSelectionChanged ( ) [protected, slot]

Definition at line 223 of file config.cpp.

       emit changed();

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

QCheckBox* IceWMConfig::cbShowMenuButtonIcon [private]

Definition at line 66 of file config.h.

Definition at line 64 of file config.h.

QCheckBox* IceWMConfig::cbTitleBarOnTop [private]

Definition at line 65 of file config.h.

KConfig* IceWMConfig::icewmConfig [private]

Definition at line 63 of file config.h.

QString IceWMConfig::localThemeString [private]

Definition at line 70 of file config.h.

Q3VBox* IceWMConfig::mainWidget [private]

Definition at line 71 of file config.h.

QLabel* IceWMConfig::themeLabel [private]

Definition at line 68 of file config.h.

Q3ListBox* IceWMConfig::themeListBox [private]

Definition at line 67 of file config.h.

KUrlLabel* IceWMConfig::urlLabel [private]

Definition at line 69 of file config.h.

The documentation for this class was generated from the following files: