summaryrefslogtreecommitdiff
path: root/core/settings/launcher/taskbarsettings.cpp
Unidiff
Diffstat (limited to 'core/settings/launcher/taskbarsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/taskbarsettings.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/settings/launcher/taskbarsettings.cpp b/core/settings/launcher/taskbarsettings.cpp
index badb98f..43886c9 100644
--- a/core/settings/launcher/taskbarsettings.cpp
+++ b/core/settings/launcher/taskbarsettings.cpp
@@ -17,97 +17,97 @@
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "taskbarsettings.h" 29#include "taskbarsettings.h"
30 30
31#include <qpe/config.h> 31#include <qpe/config.h>
32#include <qpe/qlibrary.h> 32#include <qpe/qlibrary.h>
33#include <qpe/qpeapplication.h> 33#include <qpe/qpeapplication.h>
34#include <qpe/taskbarappletinterface.h> 34#include <qpe/taskbarappletinterface.h>
35#include <qpe/qcopenvelope_qws.h> 35#include <qpe/qcopenvelope_qws.h>
36 36
37#include <qdir.h> 37#include <qdir.h>
38#include <qlistview.h> 38#include <qlistview.h>
39#include <qheader.h> 39#include <qheader.h>
40#include <qlayout.h> 40#include <qlayout.h>
41#include <qlabel.h> 41#include <qlabel.h>
42#include <qwhatsthis.h> 42#include <qwhatsthis.h>
43 43
44#include <stdlib.h> 44#include <stdlib.h>
45 45
46 46
47TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name ) 47TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name )
48 : QWidget ( parent, name ) 48 : QWidget ( parent, name )
49{ 49{
50 m_applets_changed = false; 50 m_applets_changed = false;
51 51
52 QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); 52 QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 );
53 53
54 QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this ); 54 QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this );
55 lay-> addWidget ( l ); 55 lay-> addWidget ( l );
56 56
57 m_list = new QListView ( this ); 57 m_list = new QListView ( this );
58 m_list-> addColumn ( "foobar" ); 58 m_list-> addColumn ( "foobar" );
59 m_list-> header ( )-> hide ( ); 59 m_list-> header ( )-> hide ( );
60 60
61 lay-> addWidget ( m_list ); 61 lay-> addWidget ( m_list );
62 62
63 QWhatsThis::add ( m_list, tr( "Check the applets that you want displayed in the Taskbar." )); 63 QWhatsThis::add ( m_list, tr( "Check the applets that you want displayed in the Taskbar." ));
64 64
65 connect ( m_list, SIGNAL( clicked ( QListViewItem * )), this, SLOT( appletChanged ( ))); 65 connect ( m_list, SIGNAL( clicked(QListViewItem*)), this, SLOT( appletChanged()));
66 66
67 init ( ); 67 init ( );
68} 68}
69 69
70void TaskbarSettings::init ( ) 70void TaskbarSettings::init ( )
71{ 71{
72 Config cfg ( "Taskbar" ); 72 Config cfg ( "Taskbar" );
73 cfg. setGroup ( "Applets" ); 73 cfg. setGroup ( "Applets" );
74 QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); 74 QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' );
75 75
76 QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; 76 QString path = QPEApplication::qpeDir ( ) + "/plugins/applets";
77#ifdef Q_OS_MACX 77#ifdef Q_OS_MACX
78 QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); 78 QStringList list = QDir ( path, "lib*.dylib" ). entryList ( );
79#else 79#else
80 QStringList list = QDir ( path, "lib*.so" ). entryList ( ); 80 QStringList list = QDir ( path, "lib*.so" ). entryList ( );
81#endif /* Q_OS_MACX */ 81#endif /* Q_OS_MACX */
82 82
83 for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { 83 for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) {
84 QString name; 84 QString name;
85 QPixmap icon; 85 QPixmap icon;
86 TaskbarNamedAppletInterface *iface = 0; 86 TaskbarNamedAppletInterface *iface = 0;
87 87
88 qWarning("Load applet: %s", (*it).latin1() ); 88 qWarning("Load applet: %s", (*it).latin1() );
89 QLibrary *lib = new QLibrary ( path + "/" + *it ); 89 QLibrary *lib = new QLibrary ( path + "/" + *it );
90 lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); 90 lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface );
91 qWarning("<1>"); 91 qWarning("<1>");
92 if ( iface ) { 92 if ( iface ) {
93 qWarning("<2>"); 93 qWarning("<2>");
94 QString lang = getenv( "LANG" ); 94 QString lang = getenv( "LANG" );
95 QTranslator *trans = new QTranslator ( qApp ); 95 QTranslator *trans = new QTranslator ( qApp );
96 QString type = (*it). left ((*it). find (".")); 96 QString type = (*it). left ((*it). find ("."));
97 QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; 97 QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm";
98 if ( trans-> load ( tfn )) 98 if ( trans-> load ( tfn ))
99 qApp-> installTranslator ( trans ); 99 qApp-> installTranslator ( trans );
100 else 100 else
101 delete trans; 101 delete trans;
102 name = iface-> name ( ); 102 name = iface-> name ( );
103 icon = iface-> icon ( ); 103 icon = iface-> icon ( );
104 iface-> release ( ); 104 iface-> release ( );
105 } 105 }
106 qWarning("<3>"); 106 qWarning("<3>");
107 if ( !iface ) { 107 if ( !iface ) {
108 qWarning("<4>"); 108 qWarning("<4>");
109 lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface ); 109 lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface );
110 110
111 if ( iface ) { 111 if ( iface ) {
112 qWarning("<5>"); 112 qWarning("<5>");
113 name = (*it). mid ( 3 ); 113 name = (*it). mid ( 3 );