summaryrefslogtreecommitdiff
path: root/noncore/apps/advancedfm
Side-by-side diff
Diffstat (limited to 'noncore/apps/advancedfm') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp2
-rw-r--r--noncore/apps/advancedfm/advancedfm.h7
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp1
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp6
-rw-r--r--noncore/apps/advancedfm/main.cpp19
-rw-r--r--noncore/apps/advancedfm/output.cpp8
-rw-r--r--noncore/apps/advancedfm/output.h6
7 files changed, 22 insertions, 27 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 2ba3dca..a60d6ce 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -12,48 +12,50 @@
#define DEVELOPERS_VERSION
#include "advancedfm.h"
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qpe/mimetype.h>
#include <qpe/applnk.h>
#include <qpe/resource.h>
#include <qpe/menubutton.h>
#include <qcombobox.h>
#include <qpopupmenu.h>
#include <qlistview.h>
#include <qmessagebox.h>
#include <qlineedit.h>
#include <sys/stat.h>
#include <time.h>
#include <dirent.h>
#include <fcntl.h>
#include <sys/vfs.h>
#include <mntent.h>
+using namespace Opie::Ui;
+
#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() {
}
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index 547fa7c..4eaa6d6 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -9,49 +9,48 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef ADVANCEDFM_H
#define ADVANCEDFM_H
#define QTOPIA_INTERNAL_FSLP // to get access to fileproperties
#define QT_QWS_OPIE
#include <opie2/oprocess.h>
#include <opie2/osplitter.h>
#include <qpe/ir.h>
#include <qpe/qcopenvelope_qws.h>
#include <qvariant.h>
#include <qdialog.h>
#include <qmainwindow.h>
#include <qstringlist.h>
#include <qdir.h>
#include <qstring.h>
#include <qpoint.h>
#include <qtimer.h>
#include <qpixmap.h>
-using Opie::OSplitter;
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QComboBox;
class QListView;
class QListviewItem;
class QLabel;
class QProgressBar;
class QSpinBox;
class QWidget;
class QPopupMenu;
class QFile;
class QListViewItem;
class QLineEdit;
class MenuButton;
class QToolButton;
class Ir;
class AdvancedFm : public QMainWindow
{
Q_OBJECT
public:
@@ -75,49 +74,49 @@ protected slots:
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();
void filePerms();
void doProperties();
void runCommand();
void runCommandStd();
QStringList getPath();
void mkSym();
void switchToLocalTab();
void switchToRemoteTab();
protected:
- OSplitter *TabWidget;
+ Opie::Ui::OSplitter *TabWidget;
QCopChannel * channel;
QPixmap unknownXpm;
int whichTab;
// QTabWidget *TabWidget;
QWidget *tab, *tab_2, *tab_3;
QListView *Local_View, *Remote_View;
QLineEdit *currentPathEdit;
QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu /*, *customDirMenu*/;
QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton;
// QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton;
QDir currentDir, currentRemoteDir;
QComboBox *currentPathCombo;
QString filterStr, s_addBookmark, s_removeBookmark;
QListViewItem * item;
bool b;
QStringList fileSystemTypeList, fsList;
int currentServerConfig;
bool zaurusDevice;
QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3;
QStringList remoteDirPathStringList, localDirPathStringList;
QLineEdit *renameBox;
void init();
@@ -160,33 +159,33 @@ protected slots:
void doBeam();
void fileBeamFinished( Ir *);
bool copyDirectory( const QString & , const QString & );
// void navigateToSelected();
bool moveDirectory( const QString & , const QString & );
// void slotSwitchtoLocal(int);
private:
MenuButton *menuButton;
QString oldName;
QTimer menuTimer;
void startProcess(const QString &);
bool eventFilter( QObject * , QEvent * );
void cancelRename();
void doRename(QListView *);
void okRename();
void customDirsToMenu();
void addCustomDir();
void removeCustomDir();
void gotoDirectory(const QString &);
void navigateToSelected();
void findFile(const QString &);
private slots:
- void processEnded(OProcess *);
- void oprocessStderr(OProcess *, char *, int);
+ void processEnded(Opie::Core::OProcess *);
+ void oprocessStderr(Opie::Core::OProcess *, char *, int);
void gotoCustomDir(const QString &);
void qcopReceive(const QCString&, const QByteArray&);
void setDocument(const QString &);
};
#endif // ADVANCEDFM_H
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp
index f791c77..73ef8f9 100644
--- a/noncore/apps/advancedfm/advancedfmData.cpp
+++ b/noncore/apps/advancedfm/advancedfmData.cpp
@@ -6,48 +6,49 @@
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 "advancedfm.h"
#include <qpe/storage.h>
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
#include <qpe/menubutton.h>
#include <qlayout.h>
#include <qhbox.h>
#include <qmenubar.h>
#include <qcombobox.h>
#include <qtoolbutton.h>
#include <qlineedit.h>
#include <qlistview.h>
#include <sys/utsname.h>
+using namespace Opie::Ui;
void AdvancedFm::init() {
#if defined(QT_QWS_OPIE)
qDebug("<<<<<<<<<<<<<<<<<<<<<<<< OPIE!!!");
#endif
setCaption( tr( "AdvancedFm" ) );
QVBoxLayout *layout = new QVBoxLayout( this );
layout->setSpacing( 2);
layout->setMargin( 2);
QMenuBar *menuBar = new QMenuBar(this);
fileMenu = new QPopupMenu( this );
viewMenu = new QPopupMenu( this );
// customDirMenu = new QPopupMenu( this );
layout->addWidget( menuBar );
menuBar->insertItem( tr( "File" ), fileMenu);
menuBar->insertItem( tr( "View" ), viewMenu);
cdUpButton = new QToolButton( 0,"cdUpButton");
cdUpButton->setPixmap(Resource::loadPixmap("up"));
cdUpButton->setAutoRaise( true );
menuBar->insertItem( cdUpButton );
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index 9e740d0..a694b70 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -11,48 +11,50 @@
***************************************************************************/
#include "advancedfm.h"
#include "output.h"
#include "filePermissions.h"
#include <qpe/lnkproperties.h>
#include <qpe/qpeapplication.h>
#include <qpe/applnk.h>
#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qlistview.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <dirent.h>
#include <sys/sendfile.h>
#include <fcntl.h>
+using namespace Opie::Core;
+using namespace Opie::Core;
void AdvancedFm::doDirChange() {
QString pathItem = CurrentView()->currentItem()->text(0);
if( pathItem == "../") {
ListClicked( CurrentView()->currentItem());
} else {
if( pathItem.find(" -> ",0,TRUE) != -1)
pathItem = dealWithSymName((const QString&)pathItem)+"/";
// qWarning(pathItem);
gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) );
}
}
void AdvancedFm::showMenuHidden() {
if (b) {
CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
} else {
CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
fileMenu->setItemChecked( fileMenu->idAt(0),FALSE);
}
b = !b;
populateView();
@@ -681,52 +683,52 @@ void AdvancedFm::doBeam() {
curFilePath = curFilePath.left( curFilePath.length() -1);
}
Ir *file = new Ir(this, "IR");
connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished(Ir*)));
file->send( curFilePath, curFile );
}
}
}
}
void AdvancedFm::fileBeamFinished( Ir *) {
QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") );
}
void AdvancedFm::selectAll() {
QListView *thisView = CurrentView();
thisView->selectAll(true);
thisView->setSelected( thisView->firstChild(),false);
}
void AdvancedFm::startProcess(const QString & cmd) {
QStringList command;
OProcess *process;
process = new OProcess();
- connect(process, SIGNAL(processExited(OProcess*)),
+ connect(process, SIGNAL(processExited(Opie::Core::OProcess*)),
this, SLOT( processEnded(OProcess*)));
- connect(process, SIGNAL( receivedStderr(OProcess*,char*,int)),
+ connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)),
this, SLOT( oprocessStderr(OProcess*,char*,int)));
command << "/bin/sh";
command << "-c";
command << cmd.latin1();
*process << command;
if(!process->start(OProcess::NotifyOnExit, OProcess::All) )
qDebug("could not start process");
}
void AdvancedFm::processEnded(OProcess *) {
rePopulate();
}
void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) {
// qWarning("received stderrt %d bytes", buflen);
QString lineStr = buffer;
QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") );
}
bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) {
if ( o->inherits( "QLineEdit" ) ) {
if ( e->type() == QEvent::KeyPress ) {
diff --git a/noncore/apps/advancedfm/main.cpp b/noncore/apps/advancedfm/main.cpp
index 3c1a164..df0d4af 100644
--- a/noncore/apps/advancedfm/main.cpp
+++ b/noncore/apps/advancedfm/main.cpp
@@ -1,33 +1,22 @@
/***************************************************************************
+using namespace Opie::Core;
+using namespace Opie::Core;
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 "advancedfm.h"
-
-#ifdef NOQUICKLAUNCH
-
-#include <qpe/qpeapplication.h>
-
-int main(int argc, char *argv[])
-{
- QPEApplication a(argc, argv);
-
- AdvancedFm advencedFm;
- a.showMainWidget( &advencedFm);
- return a.exec();
-}
-#else
#include <opie2/oapplicationfactory.h>
+using namespace Opie::Core;
+
OPIE_EXPORT_APP( OApplicationFactory<AdvancedFm> )
-#endif
diff --git a/noncore/apps/advancedfm/output.cpp b/noncore/apps/advancedfm/output.cpp
index 0bba1d8..16a0992 100644
--- a/noncore/apps/advancedfm/output.cpp
+++ b/noncore/apps/advancedfm/output.cpp
@@ -1,42 +1,44 @@
/****************************************************************************
** outputEdit.cpp
**
** Copyright: Fri Apr 12 15:12:58 2002 L.J. Potter <ljp@llornkcor.com>
****************************************************************************/
#include "output.h"
#include <qpe/qpeapplication.h>
#include <qpe/applnk.h>
#include <qfile.h>
#include <qmultilineedit.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <errno.h>
/* XPM */
+using namespace Opie::Core;
+using namespace Opie::Core;
static char * filesave_xpm[] = {
"16 16 78 1",
" c None",
". c #343434",
"+ c #A0A0A0",
"@ c #565656",
"# c #9E9E9E",
"$ c #525252",
"% c #929292",
"& c #676767",
"* c #848484",
"= c #666666",
"- c #D8D8D8",
"; c #FFFFFF",
"> c #DBDBDB",
", c #636363",
"' c #989898",
") c #2D2D2D",
"! c #909090",
"~ c #AEAEAE",
"{ c #EAEAEA",
"] c #575757",
"^ c #585858",
"/ c #8A8A8A",
@@ -120,55 +122,55 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name,
// cmmds=QStringList::split( " ", commands, false);
cmmds=commands;
// qDebug("count %d", cmmds.count());
if ( !name )
setName( tr("Output"));
resize( 196, 269 );
setCaption( name );
OutputLayout = new QGridLayout( this );
OutputLayout->setSpacing( 2);
OutputLayout->setMargin( 2);
QPushButton *docButton;
docButton = new QPushButton( QPixmap(( const char** ) filesave_xpm ) ,"",this,"saveButton");
docButton->setFixedSize( QSize( 20, 20 ) );
connect( docButton,SIGNAL(released()),this,SLOT( saveOutput() ));
// docButton->setFlat(TRUE);
OutputLayout->addMultiCellWidget( docButton, 0,0,3,3 );
OutputEdit = new QMultiLineEdit( this, "OutputEdit" );
OutputLayout->addMultiCellWidget( OutputEdit, 1,1,0,3 );
proc = new OProcess();
- connect(proc, SIGNAL(processExited(OProcess*)),
+ connect(proc, SIGNAL(processExited(Opie::Core::OProcess*)),
this, SLOT( processFinished()));
- connect(proc, SIGNAL(receivedStdout(OProcess*,char*,int)),
+ connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),
this, SLOT(commandStdout(OProcess*,char*,int)));
- connect(proc, SIGNAL(receivedStderr(OProcess*,char*,int)),
+ connect(proc, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)),
this, SLOT(commandStderr(OProcess*,char*,int)));
// connect( , SIGNAL(received(const QByteArray&)),
// this, SLOT(commandStdin(const QByteArray&)));
// * proc << commands.latin1();
for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) {
qDebug( "%s", (*it).latin1() );
* proc << (*it).latin1();
}
if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) {
OutputEdit->append(tr("Process could not start") );
OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
perror("Error: ");
QString errorMsg=tr("Error\n")+(QString)strerror(errno);
OutputEdit->append( errorMsg);
OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
}
}
Output::~Output() {
}
diff --git a/noncore/apps/advancedfm/output.h b/noncore/apps/advancedfm/output.h
index 26c0fa0..37ba57d 100644
--- a/noncore/apps/advancedfm/output.h
+++ b/noncore/apps/advancedfm/output.h
@@ -14,52 +14,52 @@
#include <qcstring.h>
#include <qstringlist.h>
#include <qlineedit.h>
#include <qwhatsthis.h>
#include <opie2/oprocess.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QMultiLineEdit;
class Output : public QDialog
{
Q_OBJECT
public:
Output(const QStringList commands=0, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~Output();
QMultiLineEdit* OutputEdit;
protected:
QGridLayout* OutputLayout;
- OProcess *proc;
+ Opie::Core::OProcess *proc;
protected slots:
void saveOutput();
- void commandStdout(OProcess*, char *, int);
+ void commandStdout(Opie::Core::OProcess*, char *, int);
void commandStdin(const QByteArray &);
- void commandStderr(OProcess*, char *, int);
+ void commandStderr(Opie::Core::OProcess*, char *, int);
void processFinished();
private:
QString cmmd;
};
class InputDialog : public QDialog
{
Q_OBJECT
public:
InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~InputDialog();
QString inputText;
QLineEdit* LineEdit1;
void setInputText(const QString &);
private slots:
void returned();
};
#endif // OUTPUT_H