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 /core/launcher/launcher.cpp | |
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 |
1 files changed, 69 insertions, 33 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 @@ -22,6 +22,8 @@ // have this class. #define QTOPIA_INTERNAL_FSLP +//#include <opie/ofiledialog.h> +#include <opie/ofileselector.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/resource.h> #include <qpe/applnk.h> @@ -197,7 +199,7 @@ 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; if ( categoryBar ) { @@ -251,13 +253,23 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, QImage img( Resource::loadImage( "DocsIcon" ) ); 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)) ); @@ -273,9 +285,20 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, categoryBar->show(); 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 ) { QString grp( "Tab %1" ); // No tr @@ -318,13 +341,10 @@ void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg ) tab->fgColor = QColor(tabTextCol); } -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() { @@ -343,7 +363,7 @@ void CategoryTabWidget::tabProperties() QString CategoryTabWidget::getAllDocLinkInfo() const { - return docview->getAllDocLinkInfo(); + return ""; } LauncherView* CategoryTabWidget::newView( const QString& id, const QPixmap& pm, const QString& label ) @@ -361,15 +381,14 @@ 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(); } void CategoryTabWidget::paletteChange( const QPalette &p ) @@ -387,7 +406,7 @@ void CategoryTabWidget::setBusy(bool on) if ( 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); } @@ -648,6 +667,7 @@ Launcher::Launcher( QWidget* parent, const char* name, WFlags fl ) connect( tabs, SIGNAL(rightPressed(AppLnk*)), this, SLOT(properties(AppLnk*))); + #if !defined(QT_NO_COP) QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); connect( sysChannel, SIGNAL(received(const QCString &, const QByteArray &)), @@ -732,16 +752,13 @@ 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" ) ); owait->show(); qApp->processEvents(); - - delete docsFolder; + if(docsFolder) delete docsFolder; docsFolder = new DocLnkSet; - DocLnkSet *tmp = 0; QString home = QString(getenv("HOME")) + "/Documents"; tmp = new DocLnkSet( home , QString::null); @@ -764,9 +781,11 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global:: Config mediumCfg( "medium"); 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 // if the current timestamp doesn't match this is a new file system and @@ -785,6 +804,8 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global:: delete tmp; } } // done + owait->hide(); + delete owait; return; // save the else } // c) zecke @@ -848,7 +869,6 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global:: void Launcher::updateTabs() { MimeType::updateApplications(); // ### reads all applnks twice - delete rootFolder; rootFolder = new AppLnkSet( MimeType::appsFolderName() ); @@ -860,7 +880,7 @@ void Launcher::updateTabs() void Launcher::updateDocs() { loadDocs(); - tabs->updateDocs(docsFolder,storage->fileSystems()); + // tabs->updateDocs(docsFolder,storage->fileSystems()); } void Launcher::viewSelected(const QString& s) @@ -1317,3 +1337,19 @@ void Launcher::preloadApps() #endif } } + +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() { + +} + |