summaryrefslogtreecommitdiff
authorkergoth <kergoth>2003-08-09 17:38:23 (UTC)
committer kergoth <kergoth>2003-08-09 17:38:23 (UTC)
commitec14206f63dd93e9fb84c76cbc76fc1968637590 (patch) (unidiff)
treea42b2a348677476b622c01aeef631b446eb4b0b7
parenta0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93 (diff)
downloadopie-ec14206f63dd93e9fb84c76cbc76fc1968637590.zip
opie-ec14206f63dd93e9fb84c76cbc76fc1968637590.tar.gz
opie-ec14206f63dd93e9fb84c76cbc76fc1968637590.tar.bz2
Merge from BRANCH_1_0
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/launcher.cpp158
1 files changed, 97 insertions, 61 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 8b2907a..0205622 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -23,4 +23,6 @@
23#define QTOPIA_INTERNAL_FSLP 23#define QTOPIA_INTERNAL_FSLP
24 24
25//#include <opie/ofiledialog.h>
26#include <opie/ofileselector.h>
25#include <qpe/qcopenvelope_qws.h> 27#include <qpe/qcopenvelope_qws.h>
26#include <qpe/resource.h> 28#include <qpe/resource.h>
@@ -164,33 +166,33 @@ void CategoryTabWidget::showTab(const QString& id)
164void CategoryTabWidget::addItem( const QString& linkfile ) 166void CategoryTabWidget::addItem( const QString& linkfile )
165{ 167{
166 int i=0; 168// int i=0;
167 AppLnk *app = new AppLnk(linkfile); 169// AppLnk *app = new AppLnk(linkfile);
168 if ( !app->isValid() ) { 170// if ( !app->isValid() ) {
169 delete app; 171// delete app;
170 app=0; 172// app=0;
171 } 173// }
172 if ( !app || !app->file().isEmpty() ) { 174// if ( !app || !app->file().isEmpty() ) {
173 // A document 175 // A document
174 delete app; 176// delete app;
175 app = new DocLnk(linkfile); 177// app = new DocLnk(linkfile);
176 if ( app->fileKnown() ) { 178// if ( app->fileKnown() ) {
177 ((LauncherView*)(stack->widget(ids.count()-1)))->addItem(app); 179// ((LauncherView*)(stack->widget(ids.count()-1)))->addItem(app);
178 } else { 180// } else {
179 ((LauncherView*)(stack->widget(ids.count()-1)))->sort(); 181// ((LauncherView*)(stack->widget(ids.count()-1)))->sort();
180 delete app; 182// delete app;
181 } 183// }
182 return; 184// return;
183 } 185// }
184 // An application 186 // An application
185 for ( QStringList::Iterator it=ids.begin(); it!=ids.end(); ++it) { 187// for ( QStringList::Iterator it=ids.begin(); it!=ids.end(); ++it) {
186 if ( !(*it).isEmpty() ) { 188// if ( !(*it).isEmpty() ) {
187 QRegExp tf(*it,FALSE,TRUE); 189// QRegExp tf(*it,FALSE,TRUE);
188 if ( tf.match(app->type()) >= 0 ) { 190// if ( tf.match(app->type()) >= 0 ) {
189 ((LauncherView*)stack->widget(i))->addItem(app); 191// ((LauncherView*)stack->widget(i))->addItem(app);
190 return; 192// return;
191 } 193// }
192 i++; 194// i++;
193 } 195 // }
194 } 196 // }
195 197
196 QCopEnvelope e("QPE/TaskBar","reloadApps()"); 198 QCopEnvelope e("QPE/TaskBar","reloadApps()");
@@ -198,5 +200,5 @@ void CategoryTabWidget::addItem( const QString& linkfile )
198 200
199void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, 201void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder,
200 AppLnkSet* docFolder, const QList<FileSystem> &fs) 202 AppLnkSet* /*docFolder*/, const QList<FileSystem> & /*fs*/)
201{ 203{
202 QString current; 204 QString current;
@@ -252,11 +254,21 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder,
252 QPixmap pm; 254 QPixmap pm;
253 pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); 255 pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
254 docview = newView( "Documents", // No tr 256
255 pm, tr("Documents")); 257 //ljpotter
256 docview->populate( docFolder, QString::null ); 258 CategoryTab *catTab ;
257 docFolder->detachChildren(); 259 catTab = new CategoryTab( pm, "Documents" );
258 docview->setFileSystems(fs); 260
259 docview->setToolsEnabled(TRUE); 261 categoryBar->addTab( catTab );
260 setTabAppearance( "Documents", cfg ); // No tr 262
263 fileSel = new DocumentTab( stack, 4, 0, "/","");
264 stack->addWidget( fileSel, tabs++ );
265
266 // fileSel->hide();
267
268 connect( fileSel, SIGNAL( fileSelected( const DocLnk & )),
269 this, SLOT(clickie(const DocLnk&)) );
270
271// connect( fileSel, SIGNAL( fileSelected( const QString & )),
272// this, SLOT(clickie(const QString&)) );
261 273
262 connect( categoryBar, SIGNAL(selected(int)), stack, SLOT(raiseWidget(int)) ); 274 connect( categoryBar, SIGNAL(selected(int)), stack, SLOT(raiseWidget(int)) );
@@ -274,7 +286,18 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder,
274 stack->show(); 286 stack->show();
275 287
288
276 QCopEnvelope e("QPE/TaskBar","reloadApps()"); 289 QCopEnvelope e("QPE/TaskBar","reloadApps()");
277} 290}
278 291
292void CategoryTabWidget::clickie(const DocLnk &lnk) {
293 lnk.execute();
294 // fileSel->reparse();
295}
296
297void CategoryTabWidget::clickie(const QString &appStr) {
298// DocLnk lnk(appStr);
299// lnk.execute();
300}
301
279void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg ) 302void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg )
280{ 303{
@@ -319,11 +342,8 @@ void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg )
319} 342}
320 343
321void CategoryTabWidget::updateDocs(AppLnkSet* docFolder, const QList<FileSystem> &fs) 344//void CategoryTabWidget::updateDocs(AppLnkSet* docFolder, const QList<FileSystem> & /*fs*/)
322{ 345//{
323 docview->populate( docFolder, QString::null ); 346 // docFolder->detachChildren();
324 docFolder->detachChildren(); 347//}
325 docview->setFileSystems(fs);
326 docview->updateTools();
327}
328 348
329void CategoryTabWidget::tabProperties() 349void CategoryTabWidget::tabProperties()
@@ -344,5 +364,5 @@ void CategoryTabWidget::tabProperties()
344QString CategoryTabWidget::getAllDocLinkInfo() const 364QString CategoryTabWidget::getAllDocLinkInfo() const
345{ 365{
346 return docview->getAllDocLinkInfo(); 366 return "";
347} 367}
348 368
@@ -362,13 +382,12 @@ LauncherView* CategoryTabWidget::newView( const QString& id, const QPixmap& pm,
362void CategoryTabWidget::updateLink(const QString& linkfile) 382void CategoryTabWidget::updateLink(const QString& linkfile)
363{ 383{
364 int i=0; 384 // LauncherView* view;
365 LauncherView* view; 385 qApp->processEvents();
366 //qApp->processEvents(); 386// while ((view = (LauncherView*)stack->widget(i++))) {
367 while ((view = (LauncherView*)stack->widget(i++))) { 387// if ( view->removeLink(linkfile) )
368 if ( view->removeLink(linkfile) ) 388// break;
369 break; 389// }
370 } 390 // addItem(linkfile);
371 addItem(linkfile); 391 fileSel->reparse();
372 docview->updateTools();
373} 392}
374 393
@@ -388,5 +407,5 @@ void CategoryTabWidget::setBusy(bool on)
388 ((LauncherView*)stack->visibleWidget())->setBusy(TRUE); 407 ((LauncherView*)stack->visibleWidget())->setBusy(TRUE);
389 else 408 else
390 for (int i=0; i<tabs; i++) 409 for (int i=0; i<tabs-1; i++)
391 ((LauncherView*)stack->widget(i))->setBusy(FALSE); 410 ((LauncherView*)stack->widget(i))->setBusy(FALSE);
392} 411}
@@ -649,4 +668,5 @@ Launcher::Launcher( QWidget* parent, const char* name, WFlags fl )
649 this, SLOT(properties(AppLnk*))); 668 this, SLOT(properties(AppLnk*)));
650 669
670
651#if !defined(QT_NO_COP) 671#if !defined(QT_NO_COP)
652 QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); 672 QCopChannel* sysChannel = new QCopChannel( "QPE/System", this );
@@ -733,5 +753,4 @@ void Launcher::updateMimeTypes(AppLnkSet* folder)
733void Launcher::loadDocs() // ok here comes a hack belonging to Global:: 753void Launcher::loadDocs() // ok here comes a hack belonging to Global::
734{ 754{
735
736 OWait *owait = new OWait(); 755 OWait *owait = new OWait();
737 Global::statusMessage( tr( "Finding documents" ) ); 756 Global::statusMessage( tr( "Finding documents" ) );
@@ -739,8 +758,6 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
739 owait->show(); 758 owait->show();
740 qApp->processEvents(); 759 qApp->processEvents();
741 760 if(docsFolder) delete docsFolder;
742 delete docsFolder;
743 docsFolder = new DocLnkSet; 761 docsFolder = new DocLnkSet;
744
745 DocLnkSet *tmp = 0; 762 DocLnkSet *tmp = 0;
746 QString home = QString(getenv("HOME")) + "/Documents"; 763 QString home = QString(getenv("HOME")) + "/Documents";
@@ -765,7 +782,9 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
765 mediumCfg.setGroup("main"); 782 mediumCfg.setGroup("main");
766 // a) -zecke we don't want to check 783 // a) -zecke we don't want to check
767 if(!mediumCfg.readBoolEntry("use", true ) ) 784 if(!mediumCfg.readBoolEntry("use", true ) ) {
785 owait->hide();
786 delete owait;
768 return; 787 return;
769 788 }
770 // find out wich filesystems are new in this round 789 // find out wich filesystems are new in this round
771 // We will do this by having a timestamp inside each mountpoint 790 // We will do this by having a timestamp inside each mountpoint
@@ -786,4 +805,6 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
786 } 805 }
787 } // done 806 } // done
807 owait->hide();
808 delete owait;
788 return; // save the else 809 return; // save the else
789 } 810 }
@@ -849,5 +870,4 @@ void Launcher::updateTabs()
849{ 870{
850 MimeType::updateApplications(); // ### reads all applnks twice 871 MimeType::updateApplications(); // ### reads all applnks twice
851
852 delete rootFolder; 872 delete rootFolder;
853 rootFolder = new AppLnkSet( MimeType::appsFolderName() ); 873 rootFolder = new AppLnkSet( MimeType::appsFolderName() );
@@ -861,5 +881,5 @@ void Launcher::updateDocs()
861{ 881{
862 loadDocs(); 882 loadDocs();
863 tabs->updateDocs(docsFolder,storage->fileSystems()); 883 // tabs->updateDocs(docsFolder,storage->fileSystems());
864} 884}
865 885
@@ -1318,2 +1338,18 @@ void Launcher::preloadApps()
1318 } 1338 }
1319} 1339}
1340
1341DocumentTab::DocumentTab( QWidget *parent, int mode, int selector, const QString &dirName, const QString &fileName)
1342 : OFileSelector(parent,mode,selector,dirName,fileName)
1343{
1344 setYesCancelVisible(false);
1345 setToolbarVisible(false);
1346 setPermissionBarVisible(false);
1347 setLineEditVisible(false) ;
1348 //setChooserVisible( bool chooser );
1349
1350}
1351
1352DocumentTab::~DocumentTab() {
1353
1354}
1355