summaryrefslogtreecommitdiff
path: root/core
Side-by-side diff
Diffstat (limited to 'core') (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
@@ -24,2 +24,4 @@
+//#include <opie/ofiledialog.h>
+#include <opie/ofileselector.h>
#include <qpe/qcopenvelope_qws.h>
@@ -165,31 +167,31 @@ void CategoryTabWidget::addItem( const QString& linkfile )
{
- int i=0;
- AppLnk *app = new AppLnk(linkfile);
- if ( !app->isValid() ) {
- delete app;
- app=0;
- }
- if ( !app || !app->file().isEmpty() ) {
+// int i=0;
+// AppLnk *app = new AppLnk(linkfile);
+// if ( !app->isValid() ) {
+// delete app;
+// app=0;
+// }
+// if ( !app || !app->file().isEmpty() ) {
// A document
- delete app;
- app = new DocLnk(linkfile);
- if ( app->fileKnown() ) {
- ((LauncherView*)(stack->widget(ids.count()-1)))->addItem(app);
- } else {
- ((LauncherView*)(stack->widget(ids.count()-1)))->sort();
- delete app;
- }
- return;
- }
+// delete app;
+// app = new DocLnk(linkfile);
+// if ( app->fileKnown() ) {
+// ((LauncherView*)(stack->widget(ids.count()-1)))->addItem(app);
+// } else {
+// ((LauncherView*)(stack->widget(ids.count()-1)))->sort();
+// delete app;
+// }
+// return;
+// }
// An application
- for ( QStringList::Iterator it=ids.begin(); it!=ids.end(); ++it) {
- if ( !(*it).isEmpty() ) {
- QRegExp tf(*it,FALSE,TRUE);
- if ( tf.match(app->type()) >= 0 ) {
- ((LauncherView*)stack->widget(i))->addItem(app);
- return;
- }
- i++;
- }
- }
+// for ( QStringList::Iterator it=ids.begin(); it!=ids.end(); ++it) {
+// if ( !(*it).isEmpty() ) {
+// QRegExp tf(*it,FALSE,TRUE);
+// if ( tf.match(app->type()) >= 0 ) {
+// ((LauncherView*)stack->widget(i))->addItem(app);
+// return;
+// }
+// i++;
+ // }
+ // }
@@ -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;
- //qApp->processEvents();
- while ((view = (LauncherView*)stack->widget(i++))) {
- if ( view->removeLink(linkfile) )
- break;
- }
- addItem(linkfile);
- docview->updateTools();
+ // LauncherView* view;
+ qApp->processEvents();
+// 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(false);
+ setPermissionBarVisible(false);
+ setLineEditVisible(false) ;
+ //setChooserVisible( bool chooser );
+
+}
+
+DocumentTab::~DocumentTab() {
+
+}
+