summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2003-07-14 21:27:38 (UTC)
committer llornkcor <llornkcor>2003-07-14 21:27:38 (UTC)
commit115e09bdeb2ee3c7c0b9344f95179e1d10e86e48 (patch) (unidiff)
treee51a341aab0e6a3a1c932beabd73d52ceb4d37dd
parentab28f35bc3c9c184862ac19462322eed2be0f541 (diff)
downloadopie-115e09bdeb2ee3c7c0b9344f95179e1d10e86e48.zip
opie-115e09bdeb2ee3c7c0b9344f95179e1d10e86e48.tar.gz
opie-115e09bdeb2ee3c7c0b9344f95179e1d10e86e48.tar.bz2
another fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 5f050aa..0205622 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -120,125 +120,125 @@ public:
120 CategoryTab( const QIconSet &icon, const QString &text=QString::null ) 120 CategoryTab( const QIconSet &icon, const QString &text=QString::null )
121 : QTab( icon, text ) 121 : QTab( icon, text )
122 { 122 {
123 } 123 }
124 124
125 QColor bgColor; 125 QColor bgColor;
126 QColor fgColor; 126 QColor fgColor;
127}; 127};
128 128
129//=========================================================================== 129//===========================================================================
130 130
131CategoryTabWidget::CategoryTabWidget( QWidget* parent ) : 131CategoryTabWidget::CategoryTabWidget( QWidget* parent ) :
132 QVBox( parent ) 132 QVBox( parent )
133{ 133{
134 categoryBar = 0; 134 categoryBar = 0;
135 stack = 0; 135 stack = 0;
136} 136}
137 137
138void CategoryTabWidget::prevTab() 138void CategoryTabWidget::prevTab()
139{ 139{
140 if ( categoryBar ) { 140 if ( categoryBar ) {
141 int n = categoryBar->count(); 141 int n = categoryBar->count();
142 int tab = categoryBar->currentTab(); 142 int tab = categoryBar->currentTab();
143 if ( tab >= 0 ) 143 if ( tab >= 0 )
144 categoryBar->setCurrentTab( (tab - 1 + n)%n ); 144 categoryBar->setCurrentTab( (tab - 1 + n)%n );
145 } 145 }
146} 146}
147 147
148void CategoryTabWidget::nextTab() 148void CategoryTabWidget::nextTab()
149{ 149{
150 if ( categoryBar ) { 150 if ( categoryBar ) {
151 int n = categoryBar->count(); 151 int n = categoryBar->count();
152 int tab = categoryBar->currentTab(); 152 int tab = categoryBar->currentTab();
153 categoryBar->setCurrentTab( (tab + 1)%n ); 153 categoryBar->setCurrentTab( (tab + 1)%n );
154 } 154 }
155} 155}
156 156
157 157
158void CategoryTabWidget::showTab(const QString& id) 158void CategoryTabWidget::showTab(const QString& id)
159{ 159{
160 if ( categoryBar ) { 160 if ( categoryBar ) {
161 int idx = ids.findIndex( id ); 161 int idx = ids.findIndex( id );
162 categoryBar->setCurrentTab( idx ); 162 categoryBar->setCurrentTab( idx );
163 } 163 }
164} 164}
165 165
166void CategoryTabWidget::addItem( const QString& linkfile ) 166void CategoryTabWidget::addItem( const QString& linkfile )
167{ 167{
168 int i=0; 168// int i=0;
169 AppLnk *app = new AppLnk(linkfile); 169// AppLnk *app = new AppLnk(linkfile);
170 if ( !app->isValid() ) { 170// if ( !app->isValid() ) {
171 delete app; 171// delete app;
172 app=0; 172// app=0;
173 } 173// }
174 if ( !app || !app->file().isEmpty() ) { 174// if ( !app || !app->file().isEmpty() ) {
175 // A document 175 // A document
176// delete app; 176// delete app;
177// app = new DocLnk(linkfile); 177// app = new DocLnk(linkfile);
178// if ( app->fileKnown() ) { 178// if ( app->fileKnown() ) {
179// ((LauncherView*)(stack->widget(ids.count()-1)))->addItem(app); 179// ((LauncherView*)(stack->widget(ids.count()-1)))->addItem(app);
180// } else { 180// } else {
181// ((LauncherView*)(stack->widget(ids.count()-1)))->sort(); 181// ((LauncherView*)(stack->widget(ids.count()-1)))->sort();
182// delete app; 182// delete app;
183// } 183// }
184 return; 184// return;
185 } 185// }
186 // An application 186 // An application
187 for ( QStringList::Iterator it=ids.begin(); it!=ids.end(); ++it) { 187// for ( QStringList::Iterator it=ids.begin(); it!=ids.end(); ++it) {
188 if ( !(*it).isEmpty() ) { 188// if ( !(*it).isEmpty() ) {
189 QRegExp tf(*it,FALSE,TRUE); 189// QRegExp tf(*it,FALSE,TRUE);
190 if ( tf.match(app->type()) >= 0 ) { 190// if ( tf.match(app->type()) >= 0 ) {
191 ((LauncherView*)stack->widget(i))->addItem(app); 191// ((LauncherView*)stack->widget(i))->addItem(app);
192 return; 192// return;
193 } 193// }
194 i++; 194// i++;
195 } 195 // }
196 } 196 // }
197 197
198 QCopEnvelope e("QPE/TaskBar","reloadApps()"); 198 QCopEnvelope e("QPE/TaskBar","reloadApps()");
199} 199}
200 200
201void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, 201void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder,
202 AppLnkSet* /*docFolder*/, const QList<FileSystem> & /*fs*/) 202 AppLnkSet* /*docFolder*/, const QList<FileSystem> & /*fs*/)
203{ 203{
204 QString current; 204 QString current;
205 if ( categoryBar ) { 205 if ( categoryBar ) {
206 int c = categoryBar->currentTab(); 206 int c = categoryBar->currentTab();
207 if ( c >= 0 ) current = ids[c]; 207 if ( c >= 0 ) current = ids[c];
208 } 208 }
209 209
210 delete categoryBar; 210 delete categoryBar;
211 categoryBar = new CategoryTabBar( this ); 211 categoryBar = new CategoryTabBar( this );
212 QPalette pal = categoryBar->palette(); 212 QPalette pal = categoryBar->palette();
213 pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); 213 pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) );
214 pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); 214 pal.setColor( QColorGroup::Background, pal.active().background().light(110) );
215 categoryBar->setPalette( pal ); 215 categoryBar->setPalette( pal );
216 216
217 delete stack; 217 delete stack;
218 stack = new QWidgetStack(this); 218 stack = new QWidgetStack(this);
219 tabs=0; 219 tabs=0;
220 220
221 ids.clear(); 221 ids.clear();
222 222
223 Config cfg("Launcher"); 223 Config cfg("Launcher");
224 224
225 QStringList types = rootFolder->types(); 225 QStringList types = rootFolder->types();
226 for ( QStringList::Iterator it=types.begin(); it!=types.end(); ++it) { 226 for ( QStringList::Iterator it=types.begin(); it!=types.end(); ++it) {
227 if ( !(*it).isEmpty() ) { 227 if ( !(*it).isEmpty() ) {
228 (void)newView(*it,rootFolder->typePixmap(*it),rootFolder->typeName(*it)); 228 (void)newView(*it,rootFolder->typePixmap(*it),rootFolder->typeName(*it));
229 setTabAppearance( *it, cfg ); 229 setTabAppearance( *it, cfg );
230 } 230 }
231 } 231 }
232 QListIterator<AppLnk> it( rootFolder->children() ); 232 QListIterator<AppLnk> it( rootFolder->children() );
233 AppLnk* l; 233 AppLnk* l;
234 while ( (l=it.current()) ) { 234 while ( (l=it.current()) ) {
235 if ( l->type() == "Separator" ) { // No tr 235 if ( l->type() == "Separator" ) { // No tr
236 rootFolder->remove(l); 236 rootFolder->remove(l);
237 delete l; 237 delete l;
238 } else { 238 } else {
239 int i=0; 239 int i=0;
240 for ( QStringList::Iterator it=types.begin(); it!=types.end(); ++it) { 240 for ( QStringList::Iterator it=types.begin(); it!=types.end(); ++it) {
241 if ( *it == l->type() ) 241 if ( *it == l->type() )
242 ((LauncherView*)stack->widget(i))->addItem(l,FALSE); 242 ((LauncherView*)stack->widget(i))->addItem(l,FALSE);
243 i++; 243 i++;
244 } 244 }
@@ -1297,59 +1297,59 @@ bool Launcher::mkdir(const QString &localPath)
1297 1297
1298 // didn't find any seps; weird, use the cur dir instead 1298 // didn't find any seps; weird, use the cur dir instead
1299 if (dirIndex == -1) { 1299 if (dirIndex == -1) {
1300 //qDebug("No seperators found in path %s", localPath.latin1()); 1300 //qDebug("No seperators found in path %s", localPath.latin1());
1301 checkedPath = QDir::currentDirPath(); 1301 checkedPath = QDir::currentDirPath();
1302 } 1302 }
1303 1303
1304 while (checkedPath != localPath) { 1304 while (checkedPath != localPath) {
1305 // no more seperators found, use the local path 1305 // no more seperators found, use the local path
1306 if (dirIndex == -1) 1306 if (dirIndex == -1)
1307 checkedPath = localPath; 1307 checkedPath = localPath;
1308 else { 1308 else {
1309 // the next directory to check 1309 // the next directory to check
1310 checkedPath = localPath.left(dirIndex) + "/"; 1310 checkedPath = localPath.left(dirIndex) + "/";
1311 // advance the iterator; the next dir seperator 1311 // advance the iterator; the next dir seperator
1312 dirIndex = localPath.find(dirSeps, dirIndex+1); 1312 dirIndex = localPath.find(dirSeps, dirIndex+1);
1313 } 1313 }
1314 1314
1315 QDir checkDir(checkedPath); 1315 QDir checkDir(checkedPath);
1316 if (!checkDir.exists()) { 1316 if (!checkDir.exists()) {
1317 //qDebug("mkdir making dir %s", checkedPath.latin1()); 1317 //qDebug("mkdir making dir %s", checkedPath.latin1());
1318 1318
1319 if (!checkDir.mkdir(checkedPath)) { 1319 if (!checkDir.mkdir(checkedPath)) {
1320 qDebug("Unable to make directory %s", checkedPath.latin1()); 1320 qDebug("Unable to make directory %s", checkedPath.latin1());
1321 return FALSE; 1321 return FALSE;
1322 } 1322 }
1323 } 1323 }
1324 1324
1325 } 1325 }
1326 return TRUE; 1326 return TRUE;
1327} 1327}
1328 1328
1329void Launcher::preloadApps() 1329void Launcher::preloadApps()
1330{ 1330{
1331 Config cfg("Launcher"); 1331 Config cfg("Launcher");
1332 cfg.setGroup("Preload"); 1332 cfg.setGroup("Preload");
1333 QStringList apps = cfg.readListEntry("Apps",','); 1333 QStringList apps = cfg.readListEntry("Apps",',');
1334 for (QStringList::ConstIterator it=apps.begin(); it!=apps.end(); ++it) { 1334 for (QStringList::ConstIterator it=apps.begin(); it!=apps.end(); ++it) {
1335#ifndef QT_NO_COP 1335#ifndef QT_NO_COP
1336 QCopEnvelope e("QPE/Application/"+(*it).local8Bit(), "enablePreload()"); 1336 QCopEnvelope e("QPE/Application/"+(*it).local8Bit(), "enablePreload()");
1337#endif 1337#endif
1338 } 1338 }
1339} 1339}
1340 1340
1341DocumentTab::DocumentTab( QWidget *parent, int mode, int selector, const QString &dirName, const QString &fileName) 1341DocumentTab::DocumentTab( QWidget *parent, int mode, int selector, const QString &dirName, const QString &fileName)
1342 : OFileSelector(parent,mode,selector,dirName,fileName) 1342 : OFileSelector(parent,mode,selector,dirName,fileName)
1343{ 1343{
1344 setYesCancelVisible(false); 1344 setYesCancelVisible(false);
1345 setToolbarVisible(true); 1345 setToolbarVisible(false);
1346 setPermissionBarVisible(false); 1346 setPermissionBarVisible(false);
1347 setLineEditVisible(false) ; 1347 setLineEditVisible(false) ;
1348 //setChooserVisible( bool chooser ); 1348 //setChooserVisible( bool chooser );
1349 1349
1350} 1350}
1351 1351
1352DocumentTab::~DocumentTab() { 1352DocumentTab::~DocumentTab() {
1353 1353
1354} 1354}
1355 1355