summaryrefslogtreecommitdiff
path: root/core/settings/launcher/taskbarsettings.cpp
authorsandman <sandman>2002-10-02 22:15:33 (UTC)
committer sandman <sandman>2002-10-02 22:15:33 (UTC)
commit7e864eb22b5663ad9771b562fbe901042dc68657 (patch) (side-by-side diff)
treec7cc270012ff2aba51308088b51022b2056f9721 /core/settings/launcher/taskbarsettings.cpp
parentc8d4ed632ac27261219e5824f988a320b96b8ae2 (diff)
downloadopie-7e864eb22b5663ad9771b562fbe901042dc68657.zip
opie-7e864eb22b5663ad9771b562fbe901042dc68657.tar.gz
opie-7e864eb22b5663ad9771b562fbe901042dc68657.tar.bz2
Launcher settings now also supports the new menu applets interface
Diffstat (limited to 'core/settings/launcher/taskbarsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/taskbarsettings.cpp68
1 files changed, 38 insertions, 30 deletions
diff --git a/core/settings/launcher/taskbarsettings.cpp b/core/settings/launcher/taskbarsettings.cpp
index b5c03c8..5bc5ad2 100644
--- a/core/settings/launcher/taskbarsettings.cpp
+++ b/core/settings/launcher/taskbarsettings.cpp
@@ -52,7 +52,7 @@ TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name )
QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 );
- QLabel *l = new QLabel ( tr( "Load applets:" ), this );
+ QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this );
lay-> addWidget ( l );
m_list = new QListView ( this );
@@ -84,37 +84,45 @@ void TaskbarSettings::init ( )
QLibrary *lib = new QLibrary ( path + "/" + *it );
lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface );
- if ( iface ) {
-
- QString lang = getenv( "LANG" );
- QTranslator *trans = new QTranslator ( qApp );
- QString type = (*it). left ((*it). find ("."));
- QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm";
- if ( trans-> load ( tfn ))
- qApp-> installTranslator ( trans );
- else
- delete trans;
- name = iface-> name ( );
- icon = iface-> icon ( );
+ if ( iface ) {
+ QString lang = getenv( "LANG" );
+ QTranslator *trans = new QTranslator ( qApp );
+ QString type = (*it). left ((*it). find ("."));
+ QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm";
+ if ( trans-> load ( tfn ))
+ qApp-> installTranslator ( trans );
+ else
+ delete trans;
+ name = iface-> name ( );
+ icon = iface-> icon ( );
iface-> release ( );
- lib-> unload ( );
- } else {
- delete lib;
- name = (*it). mid ( 3 );
- int sep = name. find( ".so" );
- if ( sep > 0 )
- name. truncate ( sep );
- sep = name. find ( "applet" );
- if ( sep == (int) name.length ( ) - 6 )
- name. truncate ( sep );
- name[0] = name[0]. upper ( );
}
- QCheckListItem *item;
- item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox );
- if ( !icon. isNull ( ))
- item-> setPixmap ( 0, icon );
- item-> setOn ( exclude. find ( *it ) == exclude. end ( ));
- m_applets [*it] = item;
+ if ( !iface ) {
+ lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface );
+
+ if ( iface ) {
+ name = (*it). mid ( 3 );
+ int sep = name. find( ".so" );
+ if ( sep > 0 )
+ name. truncate ( sep );
+ sep = name. find ( "applet" );
+ if ( sep == (int) name.length ( ) - 6 )
+ name. truncate ( sep );
+ name[0] = name[0]. upper ( );
+ iface-> release ( );
+ }
+ }
+
+ if ( iface ) {
+ QCheckListItem *item;
+ item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox );
+ if ( !icon. isNull ( ))
+ item-> setPixmap ( 0, icon );
+ item-> setOn ( exclude. find ( *it ) == exclude. end ( ));
+ m_applets [*it] = item;
+ }
+ lib-> unload ( );
+ delete lib;
}
}