summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2004-01-08 22:46:40 (UTC)
committer llornkcor <llornkcor>2004-01-08 22:46:40 (UTC)
commitb52dbdb9e992bd891d69601a6425086099e2ea04 (patch) (side-by-side diff)
tree16f57fb5e0063c5095161b30a898287e22e318b5
parent5862ce131c780c38d5df7d336ec5d8fb8f62a0bc (diff)
downloadopie-b52dbdb9e992bd891d69601a6425086099e2ea04.zip
opie-b52dbdb9e992bd891d69601a6425086099e2ea04.tar.gz
opie-b52dbdb9e992bd891d69601a6425086099e2ea04.tar.bz2
make quicklaunch again
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp10
-rw-r--r--noncore/apps/advancedfm/advancedfm.h5
-rw-r--r--noncore/apps/advancedfm/advancedfm.pro28
-rw-r--r--noncore/apps/advancedfm/main.cpp6
4 files changed, 44 insertions, 5 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index ac16540..9c13e53 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -28,49 +28,53 @@
#include <qpe/resource.h>
#include <qpe/menubutton.h>
#include <qdatetime.h>
#include <qfile.h>
#include <qcombobox.h>
#include <qpopupmenu.h>
#include <qlistview.h>
#include <qlabel.h>
#include <qwidget.h>
#include <qlayout.h>
#include <qimage.h>
#include <qmessagebox.h>
#include <qlineedit.h>
#include <qpe/qpemessagebox.h>
#include <sys/stat.h>
#include <time.h>
#include <dirent.h>
#include <fcntl.h>
#include <sys/vfs.h>
#include <mntent.h>
+#ifdef NOQUICKLAUNCH
AdvancedFm::AdvancedFm( )
+#else
+AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags )
+#endif
: QMainWindow( ) {
init();
renameBox = 0;
unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
initConnections();
whichTab=1;
rePopulate();
currentPathCombo->setFocus();
channel = new QCopChannel( "QPE/Application/advancedfm", this );
connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
this, SLOT( qcopReceive(const QCString&, const QByteArray&)) );
}
AdvancedFm::~AdvancedFm() {
}
void AdvancedFm::cleanUp() {
QString sfile=QDir::homeDirPath();
if(sfile.right(1) != "/")
sfile+="/._temp";
else
@@ -82,55 +86,55 @@ void AdvancedFm::cleanUp() {
void AdvancedFm::tabChanged(QWidget *) {
// qWarning("tab changed");
QString path = CurrentDir()->canonicalPath();
currentPathCombo->lineEdit()->setText( path );
if(whichTab == 1) {
viewMenu->setItemChecked(viewMenu->idAt(0), true);
viewMenu->setItemChecked(viewMenu->idAt(1), false);
} else {
viewMenu->setItemChecked(viewMenu->idAt(0), false);
viewMenu->setItemChecked(viewMenu->idAt(1), true);
}
QString fs= getFileSystemType( (const QString &) path);
setCaption(tr("AdvancedFm :: ")+fs+" :: "
+checkDiskSpace( (const QString &) path )+ tr(" kB free") );
chdir( path.latin1());
}
void AdvancedFm::populateView() {
-qWarning("PopulateView");
+// qWarning("PopulateView");
QPixmap pm;
QListView *thisView = CurrentView();
QDir *thisDir = CurrentDir();
QString path = thisDir->canonicalPath();
-qWarning("path is "+path);
+//qWarning("path is "+path);
thisView->clear();
thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
thisDir->setMatchAllDirs(TRUE);
thisDir->setNameFilter(filterStr);
QString fileL, fileS, fileDate;
QString fs= getFileSystemType((const QString &) path);
setCaption(tr("AdvancedFm :: ")+fs+" :: "
+checkDiskSpace((const QString &) path)+ tr(" kB free") );
bool isDir=FALSE;
const QFileInfoList *list = thisDir->entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
QFileInfoListIterator it(*list);
QFileInfo *fi;
while ( (fi=it.current()) ) {
if (fi->isSymLink() ) {
QString symLink=fi->readLink();
QFileInfo sym( symLink);
fileS.sprintf( "%10i", sym.size() );
fileL = fi->fileName() +" -> " + sym.filePath().data();
fileDate = sym.lastModified().toString();
} else {
fileS.sprintf( "%10i", fi->size() );
fileL = fi->fileName();
fileDate= fi->lastModified().toString();
if( QDir(QDir::cleanDirPath( path +"/"+fileL)).exists() ) {
@@ -792,49 +796,49 @@ QDir *AdvancedFm::OtherDir() {
return &currentRemoteDir;
} else {
return &currentDir;
}
}
QListView * AdvancedFm::CurrentView() {
if ( whichTab == 1) {
// qWarning("CurrentView Tab 1");
return Local_View;
} else {
// qWarning("CurrentView Tab 2");
return Remote_View;
}
}
QListView * AdvancedFm::OtherView() {
if ( whichTab == 1)
return Remote_View;
else
return Local_View;
}
void AdvancedFm::setOtherTabCurrent() {
- qWarning("setOtherTabCurrent() %d", whichTab);
+// qWarning("setOtherTabCurrent() %d", whichTab);
if ( whichTab == 1) {
TabWidget->setCurrentWidget(1);
} else {
TabWidget->setCurrentWidget(0);
}
OtherView()->setFocus();
OtherView()->setSelected( CurrentView()->firstChild(), true);
}
void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) {
// qDebug("qcop message "+msg );
QDataStream stream ( data, IO_ReadOnly );
if ( msg == "openDirectory(QString)" ) {
// qDebug("received");
QString file;
stream >> file;
gotoDirectory( (const QString &) file);
}
}
void AdvancedFm::setDocument(const QString &file) {
gotoDirectory( file);
}
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index be574c4..bfefa77 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -34,49 +34,54 @@ class OSplitter;
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QComboBox;
class QListView;
class QListviewItem;
class QLabel;
class QProgressBar;
class QSpinBox;
class QTabWidget;
class QWidget;
class QPopupMenu;
class QFile;
class QListViewItem;
class QLineEdit;
class MenuButton;
class QToolButton;
class Ir;
class AdvancedFm : public QMainWindow
{
Q_OBJECT
public:
+ static QString appName() { return QString::fromLatin1("advancedfm"); }
+#ifdef NOQUICKLAUNCH
AdvancedFm();
+#else
+ AdvancedFm(QWidget *p = 0, const char* name = 0, WFlags fl = 0);
+#endif
~AdvancedFm();
protected slots:
void slotSwitchMenu(int);
void selectAll();
void addToDocs();
void doDirChange();
void mkDir();
void del();
void rn();
void populateView();
void rePopulate();
void showHidden();
void showMenuHidden();
void writeConfig();
void readConfig();
void ListClicked(QListViewItem *);
void ListPressed( int, QListViewItem *, const QPoint&, int);
void makeDir();
void doDelete();
void tabChanged(QWidget*);
void cleanUp();
void renameIt();
void runThis();
void runText();
diff --git a/noncore/apps/advancedfm/advancedfm.pro b/noncore/apps/advancedfm/advancedfm.pro
index 590db6a..70db018 100644
--- a/noncore/apps/advancedfm/advancedfm.pro
+++ b/noncore/apps/advancedfm/advancedfm.pro
@@ -1,11 +1,35 @@
TEMPLATE = app
-CONFIG += qt warn_on release
+CONFIG += qt warn_on release quick-app
+# CONFIG += qt warn_on release
HEADERS = advancedfm.h filePermissions.h output.h
SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp filePermissions.cpp output.cpp main.cpp
TARGET = advancedfm
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-DESTDIR = $(OPIEDIR)/bin
LIBS += -lqpe -lopie
+TRANSLATIONS = ../../../i18n/de/advancedfm.ts \
+ ../../../i18n/nl/advancedfm.ts \
+ ../../../i18n/da/advancedfm.ts \
+ ../../../i18n/xx/advancedfm.ts \
+ ../../../i18n/en/advancedfm.ts \
+ ../../../i18n/es/advancedfm.ts \
+ ../../../i18n/fr/advancedfm.ts \
+ ../../../i18n/hu/advancedfm.ts \
+ ../../../i18n/ja/advancedfm.ts \
+ ../../../i18n/ko/advancedfm.ts \
+ ../../../i18n/no/advancedfm.ts \
+ ../../../i18n/pl/advancedfm.ts \
+ ../../../i18n/pt/advancedfm.ts \
+ ../../../i18n/pt_BR/advancedfm.ts \
+ ../../../i18n/sl/advancedfm.ts \
+ ../../../i18n/zh_CN/advancedfm.ts \
+ ../../../i18n/zh_TW/advancedfm.ts
+
+
+!contains(CONFIG,quick-app) {
+ DESTDIR = $(OPIEDIR)/bin
+ DEFINES += NOQUICKLAUNCH
+}
+
include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/apps/advancedfm/main.cpp b/noncore/apps/advancedfm/main.cpp
index 8cacc4a..51e38dc 100644
--- a/noncore/apps/advancedfm/main.cpp
+++ b/noncore/apps/advancedfm/main.cpp
@@ -1,27 +1,33 @@
/***************************************************************************
main.cpp - description
-------------------
begin : March 10, 2002
copyright : (C) 2002 by llornkcor
email : ljp@llornkcor.com
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include <qpe/qpeapplication.h>
#include "advancedfm.h"
+#ifdef NOQUICKLAUNCH
int main(int argc, char *argv[])
{
QPEApplication a(argc, argv);
AdvancedFm advencedFm;
a.showMainWidget( &advencedFm);
return a.exec();
}
+#else
+#include <opie/oapplicationfactory.h>
+OPIE_EXPORT_APP( OApplicationFactory<AdvancedFm> )
+
+#endif