summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/launcher.cpp102
-rw-r--r--core/launcher/launcher.h29
2 files changed, 93 insertions, 38 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index bcc2495..d9fc8e4 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -24,2 +24,4 @@
24 24
25//#include <opie/ofiledialog.h>
26#include <opie/ofileselector.h>
25#include <qpe/qcopenvelope_qws.h> 27#include <qpe/qcopenvelope_qws.h>
@@ -199,3 +201,3 @@ void CategoryTabWidget::addItem( const QString& linkfile )
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{
@@ -253,9 +255,19 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder,
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
@@ -275,2 +287,3 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder,
275 287
288
276 QCopEnvelope e("QPE/TaskBar","reloadApps()"); 289 QCopEnvelope e("QPE/TaskBar","reloadApps()");
@@ -278,2 +291,12 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder,
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 )
@@ -320,9 +343,6 @@ void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg )
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
@@ -345,3 +365,3 @@ QString CategoryTabWidget::getAllDocLinkInfo() const
345{ 365{
346 return docview->getAllDocLinkInfo(); 366 return "";
347} 367}
@@ -363,11 +383,10 @@ void CategoryTabWidget::updateLink(const QString& linkfile)
363{ 383{
364 int i=0; 384 // LauncherView* view;
365 LauncherView* view;
366 qApp->processEvents(); 385 qApp->processEvents();
367 while ((view = (LauncherView*)stack->widget(i++))) { 386// while ((view = (LauncherView*)stack->widget(i++))) {
368 if ( view->removeLink(linkfile) ) 387// if ( view->removeLink(linkfile) )
369 break; 388// break;
370 } 389// }
371 addItem(linkfile); 390 // addItem(linkfile);
372 docview->updateTools(); 391 fileSel->reparse();
373} 392}
@@ -389,3 +408,3 @@ void CategoryTabWidget::setBusy(bool on)
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);
@@ -650,2 +669,3 @@ Launcher::Launcher( QWidget* parent, const char* name, WFlags fl )
650 669
670
651#if !defined(QT_NO_COP) 671#if !defined(QT_NO_COP)
@@ -734,3 +754,2 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
734{ 754{
735
736 OWait *owait = new OWait(); 755 OWait *owait = new OWait();
@@ -740,6 +759,4 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
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;
@@ -766,5 +783,7 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
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
@@ -787,2 +806,4 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
787 } // done 806 } // done
807 owait->hide();
808 delete owait;
788 return; // save the else 809 return; // save the else
@@ -850,3 +871,2 @@ void Launcher::updateTabs()
850 MimeType::updateApplications(); // ### reads all applnks twice 871 MimeType::updateApplications(); // ### reads all applnks twice
851
852 delete rootFolder; 872 delete rootFolder;
@@ -862,3 +882,3 @@ void Launcher::updateDocs()
862 loadDocs(); 882 loadDocs();
863 tabs->updateDocs(docsFolder,storage->fileSystems()); 883 // tabs->updateDocs(docsFolder,storage->fileSystems());
864} 884}
@@ -1319 +1339,17 @@ void Launcher::preloadApps()
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(true);
1346 setPermissionBarVisible(false);
1347 setLineEditVisible(false) ;
1348 //setChooserVisible( bool chooser );
1349
1350}
1351
1352DocumentTab::~DocumentTab() {
1353
1354}
1355
diff --git a/core/launcher/launcher.h b/core/launcher/launcher.h
index c92ef5d..0616734 100644
--- a/core/launcher/launcher.h
+++ b/core/launcher/launcher.h
@@ -3,4 +3,3 @@
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.**
5**
6** This file may be distributed and/or modified under the terms of the 5** This file may be distributed and/or modified under the terms of the
@@ -23,2 +22,6 @@
23#include <qpe/config.h> 22#include <qpe/config.h>
23#include <qpe/applnk.h>
24
25#include <opie/ofileselector.h>
26
24#include <qmainwindow.h> 27#include <qmainwindow.h>
@@ -38,2 +41,13 @@ class SyncDialog;
38 41
42
43class DocumentTab : public OFileSelector
44{
45 Q_OBJECT
46public:
47 DocumentTab( QWidget *parent, int mode, int selector, const QString &dirName, const QString &fileName);//, 4,0, "/","");
48~DocumentTab();
49private:
50
51};
52
39class CategoryTabBar : public QTabBar 53class CategoryTabBar : public QTabBar
@@ -45,2 +59,4 @@ public:
45 59
60signals:
61
46protected slots: 62protected slots:
@@ -51,2 +67,3 @@ protected:
51 void paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const; 67 void paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const;
68
52}; 69};
@@ -60,3 +77,3 @@ public:
60 const QList<FileSystem> &); 77 const QList<FileSystem> &);
61 void updateDocs(AppLnkSet* docFolder, const QList<FileSystem> &fs); 78// void updateDocs(AppLnkSet* docFolder, const QList<FileSystem> &fs);
62 void updateLink(const QString& linkfile); 79 void updateLink(const QString& linkfile);
@@ -66,2 +83,3 @@ public:
66 void setBusyIndicatorType ( const QString &type ); 83 void setBusyIndicatorType ( const QString &type );
84 DocumentTab *fileSel;
67signals: 85signals:
@@ -70,3 +88,3 @@ signals:
70 void rightPressed(AppLnk*); 88 void rightPressed(AppLnk*);
71 89 void ofileSel(const DocLnk &);
72public slots: 90public slots:
@@ -75,3 +93,4 @@ public slots:
75 void showTab(const QString&); 93 void showTab(const QString&);
76 94 void clickie(const DocLnk&);
95 void clickie(const QString &);
77protected slots: 96protected slots: