author | llornkcor <llornkcor> | 2003-07-05 15:30:22 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-07-05 15:30:22 (UTC) |
commit | 2f6b0ede633948b44a5ed3ee1ec641395620f076 (patch) (side-by-side diff) | |
tree | 1c3d86b2932fe0ae18ce50f72c680949b1b22ee8 | |
parent | 51cb7e4cd9a7ec7f1bf864884928c61b9f2db3b0 (diff) | |
download | opie-2f6b0ede633948b44a5ed3ee1ec641395620f076.zip opie-2f6b0ede633948b44a5ed3ee1ec641395620f076.tar.gz opie-2f6b0ede633948b44a5ed3ee1ec641395620f076.tar.bz2 |
initial new doc tab using ofileselector
-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 @@ -23,4 +23,6 @@ #define QTOPIA_INTERNAL_FSLP +//#include <opie/ofiledialog.h> +#include <opie/ofileselector.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/resource.h> @@ -198,5 +200,5 @@ void CategoryTabWidget::addItem( const QString& linkfile ) void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, - AppLnkSet* docFolder, const QList<FileSystem> &fs) + AppLnkSet* /*docFolder*/, const QList<FileSystem> & /*fs*/) { QString current; @@ -252,11 +254,21 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, QPixmap pm; 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&)) ); connect( categoryBar, SIGNAL(selected(int)), stack, SLOT(raiseWidget(int)) ); @@ -274,7 +286,18 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, stack->show(); + QCopEnvelope e("QPE/TaskBar","reloadApps()"); } +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 ) { @@ -319,11 +342,8 @@ 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(); +//} void CategoryTabWidget::tabProperties() @@ -344,5 +364,5 @@ void CategoryTabWidget::tabProperties() QString CategoryTabWidget::getAllDocLinkInfo() const { - return docview->getAllDocLinkInfo(); + return ""; } @@ -362,13 +382,12 @@ LauncherView* CategoryTabWidget::newView( const QString& id, const QPixmap& pm, 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(); } @@ -388,5 +407,5 @@ void CategoryTabWidget::setBusy(bool on) ((LauncherView*)stack->visibleWidget())->setBusy(TRUE); else - for (int i=0; i<tabs; i++) + for (int i=0; i<tabs-1; i++) ((LauncherView*)stack->widget(i))->setBusy(FALSE); } @@ -649,4 +668,5 @@ Launcher::Launcher( QWidget* parent, const char* name, WFlags fl ) this, SLOT(properties(AppLnk*))); + #if !defined(QT_NO_COP) QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); @@ -733,5 +753,4 @@ void Launcher::updateMimeTypes(AppLnkSet* folder) void Launcher::loadDocs() // ok here comes a hack belonging to Global:: { - OWait *owait = new OWait(); Global::statusMessage( tr( "Finding documents" ) ); @@ -739,8 +758,6 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global:: owait->show(); qApp->processEvents(); - - delete docsFolder; + if(docsFolder) delete docsFolder; docsFolder = new DocLnkSet; - DocLnkSet *tmp = 0; QString home = QString(getenv("HOME")) + "/Documents"; @@ -765,7 +782,9 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global:: mediumCfg.setGroup("main"); // 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 // 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:: } } // done + owait->hide(); + delete owait; return; // save the else } @@ -849,5 +870,4 @@ void Launcher::updateTabs() { MimeType::updateApplications(); // ### reads all applnks twice - delete rootFolder; rootFolder = new AppLnkSet( MimeType::appsFolderName() ); @@ -861,5 +881,5 @@ void Launcher::updateDocs() { loadDocs(); - tabs->updateDocs(docsFolder,storage->fileSystems()); + // tabs->updateDocs(docsFolder,storage->fileSystems()); } @@ -1318,2 +1338,18 @@ 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 @@ -2,6 +2,5 @@ ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** -** 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 ** GNU General Public License version 2 as published by the Free Software @@ -22,4 +21,8 @@ #include <qpe/config.h> +#include <qpe/applnk.h> + +#include <opie/ofileselector.h> + #include <qmainwindow.h> #include <qtabbar.h> @@ -37,4 +40,15 @@ class StorageInfo; 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 { @@ -44,4 +58,6 @@ public: ~CategoryTabBar(); +signals: + protected slots: virtual void layoutTabs(); @@ -50,4 +66,5 @@ protected: void paint ( QPainter *p, QTab *t, bool f ) const; void paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const; + }; @@ -59,5 +76,5 @@ public: void initializeCategories(AppLnkSet* rootFolder, AppLnkSet* docFolder, const QList<FileSystem> &); - void updateDocs(AppLnkSet* docFolder, const QList<FileSystem> &fs); +// void updateDocs(AppLnkSet* docFolder, const QList<FileSystem> &fs); void updateLink(const QString& linkfile); void setBusy(bool on); @@ -65,14 +82,16 @@ public: LauncherView *view( const QString &id ); void setBusyIndicatorType ( const QString &type ); + DocumentTab *fileSel; signals: void selected(const QString&); void clicked(const AppLnk*); void rightPressed(AppLnk*); - + void ofileSel(const DocLnk &); public slots: void nextTab(); void prevTab(); void showTab(const QString&); - + void clickie(const DocLnk&); + void clickie(const QString &); protected slots: void tabProperties(); |