Diffstat (limited to 'core/settings/launcher/taskbarsettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/settings/launcher/taskbarsettings.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/core/settings/launcher/taskbarsettings.cpp b/core/settings/launcher/taskbarsettings.cpp index 43886c9..8dd9e97 100644 --- a/core/settings/launcher/taskbarsettings.cpp +++ b/core/settings/launcher/taskbarsettings.cpp | |||
@@ -19,37 +19,41 @@ | |||
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 | /* OPIE */ | ||
31 | #include <qpe/config.h> | 32 | #include <qpe/config.h> |
32 | #include <qpe/qlibrary.h> | 33 | #include <qpe/qlibrary.h> |
33 | #include <qpe/qpeapplication.h> | 34 | #include <qpe/qpeapplication.h> |
34 | #include <qpe/taskbarappletinterface.h> | 35 | #include <qpe/taskbarappletinterface.h> |
35 | #include <qpe/qcopenvelope_qws.h> | 36 | #include <qpe/qcopenvelope_qws.h> |
37 | #include <opie2/odebug.h> | ||
36 | 38 | ||
39 | /* QT */ | ||
37 | #include <qdir.h> | 40 | #include <qdir.h> |
38 | #include <qlistview.h> | 41 | #include <qlistview.h> |
39 | #include <qheader.h> | 42 | #include <qheader.h> |
40 | #include <qlayout.h> | 43 | #include <qlayout.h> |
41 | #include <qlabel.h> | 44 | #include <qlabel.h> |
42 | #include <qwhatsthis.h> | 45 | #include <qwhatsthis.h> |
43 | 46 | ||
47 | /* STD */ | ||
44 | #include <stdlib.h> | 48 | #include <stdlib.h> |
45 | 49 | ||
46 | 50 | ||
47 | TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name ) | 51 | TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name ) |
48 | : QWidget ( parent, name ) | 52 | : QWidget ( parent, name ) |
49 | { | 53 | { |
50 | m_applets_changed = false; | 54 | m_applets_changed = false; |
51 | 55 | ||
52 | QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); | 56 | QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); |
53 | 57 | ||
54 | QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this ); | 58 | QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this ); |
55 | lay-> addWidget ( l ); | 59 | lay-> addWidget ( l ); |
@@ -76,69 +80,69 @@ void TaskbarSettings::init ( ) | |||
76 | QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; | 80 | QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; |
77 | #ifdef Q_OS_MACX | 81 | #ifdef Q_OS_MACX |
78 | QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); | 82 | QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); |
79 | #else | 83 | #else |
80 | QStringList list = QDir ( path, "lib*.so" ). entryList ( ); | 84 | QStringList list = QDir ( path, "lib*.so" ). entryList ( ); |
81 | #endif /* Q_OS_MACX */ | 85 | #endif /* Q_OS_MACX */ |
82 | 86 | ||
83 | for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { | 87 | for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { |
84 | QString name; | 88 | QString name; |
85 | QPixmap icon; | 89 | QPixmap icon; |
86 | TaskbarNamedAppletInterface *iface = 0; | 90 | TaskbarNamedAppletInterface *iface = 0; |
87 | 91 | ||
88 | qWarning("Load applet: %s", (*it).latin1() ); | 92 | owarn << "Load applet: " << (*it) << "" << oendl; |
89 | QLibrary *lib = new QLibrary ( path + "/" + *it ); | 93 | QLibrary *lib = new QLibrary ( path + "/" + *it ); |
90 | lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); | 94 | lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); |
91 | qWarning("<1>"); | 95 | owarn << "<1>" << oendl; |
92 | if ( iface ) { | 96 | if ( iface ) { |
93 | qWarning("<2>"); | 97 | owarn << "<2>" << oendl; |
94 | QString lang = getenv( "LANG" ); | 98 | QString lang = getenv( "LANG" ); |
95 | QTranslator *trans = new QTranslator ( qApp ); | 99 | QTranslator *trans = new QTranslator ( qApp ); |
96 | QString type = (*it). left ((*it). find (".")); | 100 | QString type = (*it). left ((*it). find (".")); |
97 | QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; | 101 | QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; |
98 | if ( trans-> load ( tfn )) | 102 | if ( trans-> load ( tfn )) |
99 | qApp-> installTranslator ( trans ); | 103 | qApp-> installTranslator ( trans ); |
100 | else | 104 | else |
101 | delete trans; | 105 | delete trans; |
102 | name = iface-> name ( ); | 106 | name = iface-> name ( ); |
103 | icon = iface-> icon ( ); | 107 | icon = iface-> icon ( ); |
104 | iface-> release ( ); | 108 | iface-> release ( ); |
105 | } | 109 | } |
106 | qWarning("<3>"); | 110 | owarn << "<3>" << oendl; |
107 | if ( !iface ) { | 111 | if ( !iface ) { |
108 | qWarning("<4>"); | 112 | owarn << "<4>" << oendl; |
109 | lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface ); | 113 | lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface ); |
110 | 114 | ||
111 | if ( iface ) { | 115 | if ( iface ) { |
112 | qWarning("<5>"); | 116 | owarn << "<5>" << oendl; |
113 | name = (*it). mid ( 3 ); | 117 | name = (*it). mid ( 3 ); |
114 | qWarning("Found applet: %s", name.latin1() ); | 118 | owarn << "Found applet: " << name << "" << oendl; |
115 | #ifdef Q_OS_MACX | 119 | #ifdef Q_OS_MACX |
116 | int sep = name. find( ".dylib" ); | 120 | int sep = name. find( ".dylib" ); |
117 | #else | 121 | #else |
118 | int sep = name. find( ".so" ); | 122 | int sep = name. find( ".so" ); |
119 | #endif /* Q_OS_MACX */ | 123 | #endif /* Q_OS_MACX */ |
120 | if ( sep > 0 ) | 124 | if ( sep > 0 ) |
121 | name. truncate ( sep ); | 125 | name. truncate ( sep ); |
122 | sep = name. find ( "applet" ); | 126 | sep = name. find ( "applet" ); |
123 | if ( sep == (int) name.length ( ) - 6 ) | 127 | if ( sep == (int) name.length ( ) - 6 ) |
124 | name. truncate ( sep ); | 128 | name. truncate ( sep ); |
125 | name[0] = name[0]. upper ( ); | 129 | name[0] = name[0]. upper ( ); |
126 | iface-> release ( ); | 130 | iface-> release ( ); |
127 | } | 131 | } |
128 | } | 132 | } |
129 | qWarning("<6>"); | 133 | owarn << "<6>" << oendl; |
130 | 134 | ||
131 | if ( iface ) { | 135 | if ( iface ) { |
132 | qWarning("<7>"); | 136 | owarn << "<7>" << oendl; |
133 | QCheckListItem *item; | 137 | QCheckListItem *item; |
134 | item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); | 138 | item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); |
135 | if ( !icon. isNull ( )) | 139 | if ( !icon. isNull ( )) |
136 | item-> setPixmap ( 0, icon ); | 140 | item-> setPixmap ( 0, icon ); |
137 | item-> setOn ( exclude. find ( *it ) == exclude. end ( )); | 141 | item-> setOn ( exclude. find ( *it ) == exclude. end ( )); |
138 | m_applets [*it] = item; | 142 | m_applets [*it] = item; |
139 | } | 143 | } |
140 | lib-> unload ( ); | 144 | lib-> unload ( ); |
141 | delete lib; | 145 | delete lib; |
142 | } | 146 | } |
143 | } | 147 | } |
144 | 148 | ||