-rw-r--r-- | core/launcher/launcher.cpp | 102 | ||||
-rw-r--r-- | core/launcher/launcher.h | 29 |
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 @@ +//#include <opie/ofiledialog.h> +#include <opie/ofileselector.h> #include <qpe/qcopenvelope_qws.h> @@ -199,3 +201,3 @@ void CategoryTabWidget::addItem( const QString& linkfile ) void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, - AppLnkSet* docFolder, const QList<FileSystem> &fs) + AppLnkSet* /*docFolder*/, const QList<FileSystem> & /*fs*/) { @@ -253,9 +255,19 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); - docview = newView( "Documents", // No tr - pm, tr("Documents")); - docview->populate( docFolder, QString::null ); - docFolder->detachChildren(); - docview->setFileSystems(fs); - docview->setToolsEnabled(TRUE); - setTabAppearance( "Documents", cfg ); // No tr + + //ljpotter + CategoryTab *catTab ; + catTab = new CategoryTab( pm, "Documents" ); + + categoryBar->addTab( catTab ); + + fileSel = new DocumentTab( stack, 4, 0, "/",""); + stack->addWidget( fileSel, tabs++ ); + + // fileSel->hide(); + + connect( fileSel, SIGNAL( fileSelected( const DocLnk & )), + this, SLOT(clickie(const DocLnk&)) ); + +// connect( fileSel, SIGNAL( fileSelected( const QString & )), +// this, SLOT(clickie(const QString&)) ); @@ -275,2 +287,3 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, + QCopEnvelope e("QPE/TaskBar","reloadApps()"); @@ -278,2 +291,12 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, +void CategoryTabWidget::clickie(const DocLnk &lnk) { + lnk.execute(); + // fileSel->reparse(); +} + +void CategoryTabWidget::clickie(const QString &appStr) { +// DocLnk lnk(appStr); +// lnk.execute(); +} + void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg ) @@ -320,9 +343,6 @@ void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg ) -void CategoryTabWidget::updateDocs(AppLnkSet* docFolder, const QList<FileSystem> &fs) -{ - docview->populate( docFolder, QString::null ); - docFolder->detachChildren(); - docview->setFileSystems(fs); - docview->updateTools(); -} +//void CategoryTabWidget::updateDocs(AppLnkSet* docFolder, const QList<FileSystem> & /*fs*/) +//{ + // docFolder->detachChildren(); +//} @@ -345,3 +365,3 @@ QString CategoryTabWidget::getAllDocLinkInfo() const { - return docview->getAllDocLinkInfo(); + return ""; } @@ -363,11 +383,10 @@ void CategoryTabWidget::updateLink(const QString& linkfile) { - int i=0; - LauncherView* view; + // LauncherView* view; qApp->processEvents(); - while ((view = (LauncherView*)stack->widget(i++))) { - if ( view->removeLink(linkfile) ) - break; - } - addItem(linkfile); - docview->updateTools(); +// while ((view = (LauncherView*)stack->widget(i++))) { +// if ( view->removeLink(linkfile) ) +// break; +// } + // addItem(linkfile); + fileSel->reparse(); } @@ -389,3 +408,3 @@ void CategoryTabWidget::setBusy(bool on) else - for (int i=0; i<tabs; i++) + for (int i=0; i<tabs-1; i++) ((LauncherView*)stack->widget(i))->setBusy(FALSE); @@ -650,2 +669,3 @@ Launcher::Launcher( QWidget* parent, const char* name, WFlags fl ) + #if !defined(QT_NO_COP) @@ -734,3 +754,2 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global:: { - OWait *owait = new OWait(); @@ -740,6 +759,4 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global:: qApp->processEvents(); - - delete docsFolder; + if(docsFolder) delete docsFolder; docsFolder = new DocLnkSet; - DocLnkSet *tmp = 0; @@ -766,5 +783,7 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global:: // a) -zecke we don't want to check - if(!mediumCfg.readBoolEntry("use", true ) ) + if(!mediumCfg.readBoolEntry("use", true ) ) { + owait->hide(); + delete owait; return; - + } // find out wich filesystems are new in this round @@ -787,2 +806,4 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global:: } // done + owait->hide(); + delete owait; return; // save the else @@ -850,3 +871,2 @@ void Launcher::updateTabs() MimeType::updateApplications(); // ### reads all applnks twice - delete rootFolder; @@ -862,3 +882,3 @@ void Launcher::updateDocs() loadDocs(); - tabs->updateDocs(docsFolder,storage->fileSystems()); + // tabs->updateDocs(docsFolder,storage->fileSystems()); } @@ -1319 +1339,17 @@ void Launcher::preloadApps() } + +DocumentTab::DocumentTab( QWidget *parent, int mode, int selector, const QString &dirName, const QString &fileName) + : OFileSelector(parent,mode,selector,dirName,fileName) +{ + setYesCancelVisible(false); + setToolbarVisible(true); + setPermissionBarVisible(false); + setLineEditVisible(false) ; + //setChooserVisible( bool chooser ); + +} + +DocumentTab::~DocumentTab() { + +} + 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 @@ ** -** This file is part of the Qtopia Environment. -** +** This file is part of the Qtopia Environment.** ** This file may be distributed and/or modified under the terms of the @@ -23,2 +22,6 @@ #include <qpe/config.h> +#include <qpe/applnk.h> + +#include <opie/ofileselector.h> + #include <qmainwindow.h> @@ -38,2 +41,13 @@ class SyncDialog; + +class DocumentTab : public OFileSelector +{ + Q_OBJECT +public: + DocumentTab( QWidget *parent, int mode, int selector, const QString &dirName, const QString &fileName);//, 4,0, "/",""); +~DocumentTab(); +private: + +}; + class CategoryTabBar : public QTabBar @@ -45,2 +59,4 @@ public: +signals: + protected slots: @@ -51,2 +67,3 @@ protected: void paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const; + }; @@ -60,3 +77,3 @@ public: const QList<FileSystem> &); - void updateDocs(AppLnkSet* docFolder, const QList<FileSystem> &fs); +// void updateDocs(AppLnkSet* docFolder, const QList<FileSystem> &fs); void updateLink(const QString& linkfile); @@ -66,2 +83,3 @@ public: void setBusyIndicatorType ( const QString &type ); + DocumentTab *fileSel; signals: @@ -70,3 +88,3 @@ signals: void rightPressed(AppLnk*); - + void ofileSel(const DocLnk &); public slots: @@ -75,3 +93,4 @@ public slots: void showTab(const QString&); - + void clickie(const DocLnk&); + void clickie(const QString &); protected slots: |