-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 7 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/advancedfm/main.cpp | 19 | ||||
-rw-r--r-- | noncore/apps/advancedfm/output.cpp | 8 | ||||
-rw-r--r-- | noncore/apps/advancedfm/output.h | 6 |
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 @@ | |||
12 | #define DEVELOPERS_VERSION | 12 | #define DEVELOPERS_VERSION |
13 | #include "advancedfm.h" | 13 | #include "advancedfm.h" |
14 | 14 | ||
15 | #include <qpe/qpeapplication.h> | 15 | #include <qpe/qpeapplication.h> |
16 | #include <qpe/config.h> | 16 | #include <qpe/config.h> |
17 | #include <qpe/mimetype.h> | 17 | #include <qpe/mimetype.h> |
18 | #include <qpe/applnk.h> | 18 | #include <qpe/applnk.h> |
19 | #include <qpe/resource.h> | 19 | #include <qpe/resource.h> |
20 | #include <qpe/menubutton.h> | 20 | #include <qpe/menubutton.h> |
21 | 21 | ||
22 | #include <qcombobox.h> | 22 | #include <qcombobox.h> |
23 | #include <qpopupmenu.h> | 23 | #include <qpopupmenu.h> |
24 | #include <qlistview.h> | 24 | #include <qlistview.h> |
25 | #include <qmessagebox.h> | 25 | #include <qmessagebox.h> |
26 | #include <qlineedit.h> | 26 | #include <qlineedit.h> |
27 | 27 | ||
28 | 28 | ||
29 | #include <sys/stat.h> | 29 | #include <sys/stat.h> |
30 | #include <time.h> | 30 | #include <time.h> |
31 | #include <dirent.h> | 31 | #include <dirent.h> |
32 | #include <fcntl.h> | 32 | #include <fcntl.h> |
33 | #include <sys/vfs.h> | 33 | #include <sys/vfs.h> |
34 | #include <mntent.h> | 34 | #include <mntent.h> |
35 | 35 | ||
36 | using namespace Opie::Ui; | ||
37 | |||
36 | #ifdef NOQUICKLAUNCH | 38 | #ifdef NOQUICKLAUNCH |
37 | AdvancedFm::AdvancedFm( ) | 39 | AdvancedFm::AdvancedFm( ) |
38 | #else | 40 | #else |
39 | AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) | 41 | AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) |
40 | #endif | 42 | #endif |
41 | : QMainWindow( ) { | 43 | : QMainWindow( ) { |
42 | init(); | 44 | init(); |
43 | renameBox = 0; | 45 | renameBox = 0; |
44 | 46 | ||
45 | unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); | 47 | unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); |
46 | 48 | ||
47 | initConnections(); | 49 | initConnections(); |
48 | whichTab=1; | 50 | whichTab=1; |
49 | rePopulate(); | 51 | rePopulate(); |
50 | currentPathCombo->setFocus(); | 52 | currentPathCombo->setFocus(); |
51 | channel = new QCopChannel( "QPE/Application/advancedfm", this ); | 53 | channel = new QCopChannel( "QPE/Application/advancedfm", this ); |
52 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), | 54 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), |
53 | this, SLOT( qcopReceive(const QCString&,const QByteArray&)) ); | 55 | this, SLOT( qcopReceive(const QCString&,const QByteArray&)) ); |
54 | } | 56 | } |
55 | 57 | ||
56 | AdvancedFm::~AdvancedFm() { | 58 | AdvancedFm::~AdvancedFm() { |
57 | } | 59 | } |
58 | 60 | ||
59 | 61 | ||
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 @@ | |||
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | #ifndef ADVANCEDFM_H | 12 | #ifndef ADVANCEDFM_H |
13 | #define ADVANCEDFM_H | 13 | #define ADVANCEDFM_H |
14 | #define QTOPIA_INTERNAL_FSLP // to get access to fileproperties | 14 | #define QTOPIA_INTERNAL_FSLP // to get access to fileproperties |
15 | #define QT_QWS_OPIE | 15 | #define QT_QWS_OPIE |
16 | 16 | ||
17 | #include <opie2/oprocess.h> | 17 | #include <opie2/oprocess.h> |
18 | #include <opie2/osplitter.h> | 18 | #include <opie2/osplitter.h> |
19 | 19 | ||
20 | #include <qpe/ir.h> | 20 | #include <qpe/ir.h> |
21 | #include <qpe/qcopenvelope_qws.h> | 21 | #include <qpe/qcopenvelope_qws.h> |
22 | 22 | ||
23 | #include <qvariant.h> | 23 | #include <qvariant.h> |
24 | #include <qdialog.h> | 24 | #include <qdialog.h> |
25 | #include <qmainwindow.h> | 25 | #include <qmainwindow.h> |
26 | #include <qstringlist.h> | 26 | #include <qstringlist.h> |
27 | #include <qdir.h> | 27 | #include <qdir.h> |
28 | #include <qstring.h> | 28 | #include <qstring.h> |
29 | #include <qpoint.h> | 29 | #include <qpoint.h> |
30 | #include <qtimer.h> | 30 | #include <qtimer.h> |
31 | #include <qpixmap.h> | 31 | #include <qpixmap.h> |
32 | 32 | ||
33 | using Opie::OSplitter; | ||
34 | 33 | ||
35 | class QVBoxLayout; | 34 | class QVBoxLayout; |
36 | class QHBoxLayout; | 35 | class QHBoxLayout; |
37 | class QGridLayout; | 36 | class QGridLayout; |
38 | class QComboBox; | 37 | class QComboBox; |
39 | class QListView; | 38 | class QListView; |
40 | class QListviewItem; | 39 | class QListviewItem; |
41 | class QLabel; | 40 | class QLabel; |
42 | class QProgressBar; | 41 | class QProgressBar; |
43 | class QSpinBox; | 42 | class QSpinBox; |
44 | class QWidget; | 43 | class QWidget; |
45 | class QPopupMenu; | 44 | class QPopupMenu; |
46 | class QFile; | 45 | class QFile; |
47 | class QListViewItem; | 46 | class QListViewItem; |
48 | class QLineEdit; | 47 | class QLineEdit; |
49 | class MenuButton; | 48 | class MenuButton; |
50 | 49 | ||
51 | class QToolButton; | 50 | class QToolButton; |
52 | class Ir; | 51 | class Ir; |
53 | 52 | ||
54 | class AdvancedFm : public QMainWindow | 53 | class AdvancedFm : public QMainWindow |
55 | { | 54 | { |
56 | Q_OBJECT | 55 | Q_OBJECT |
57 | public: | 56 | public: |
@@ -75,49 +74,49 @@ protected slots: | |||
75 | void showHidden(); | 74 | void showHidden(); |
76 | void showMenuHidden(); | 75 | void showMenuHidden(); |
77 | void writeConfig(); | 76 | void writeConfig(); |
78 | void readConfig(); | 77 | void readConfig(); |
79 | void ListClicked(QListViewItem *); | 78 | void ListClicked(QListViewItem *); |
80 | void ListPressed( int, QListViewItem *, const QPoint&, int); | 79 | void ListPressed( int, QListViewItem *, const QPoint&, int); |
81 | void makeDir(); | 80 | void makeDir(); |
82 | void doDelete(); | 81 | void doDelete(); |
83 | void tabChanged(QWidget*); | 82 | void tabChanged(QWidget*); |
84 | void cleanUp(); | 83 | void cleanUp(); |
85 | void renameIt(); | 84 | void renameIt(); |
86 | void runThis(); | 85 | void runThis(); |
87 | void runText(); | 86 | void runText(); |
88 | void filePerms(); | 87 | void filePerms(); |
89 | void doProperties(); | 88 | void doProperties(); |
90 | void runCommand(); | 89 | void runCommand(); |
91 | void runCommandStd(); | 90 | void runCommandStd(); |
92 | QStringList getPath(); | 91 | QStringList getPath(); |
93 | void mkSym(); | 92 | void mkSym(); |
94 | void switchToLocalTab(); | 93 | void switchToLocalTab(); |
95 | void switchToRemoteTab(); | 94 | void switchToRemoteTab(); |
96 | 95 | ||
97 | protected: | 96 | protected: |
98 | 97 | ||
99 | OSplitter *TabWidget; | 98 | Opie::Ui::OSplitter *TabWidget; |
100 | QCopChannel * channel; | 99 | QCopChannel * channel; |
101 | QPixmap unknownXpm; | 100 | QPixmap unknownXpm; |
102 | int whichTab; | 101 | int whichTab; |
103 | // QTabWidget *TabWidget; | 102 | // QTabWidget *TabWidget; |
104 | QWidget *tab, *tab_2, *tab_3; | 103 | QWidget *tab, *tab_2, *tab_3; |
105 | QListView *Local_View, *Remote_View; | 104 | QListView *Local_View, *Remote_View; |
106 | 105 | ||
107 | QLineEdit *currentPathEdit; | 106 | QLineEdit *currentPathEdit; |
108 | QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu /*, *customDirMenu*/; | 107 | QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu /*, *customDirMenu*/; |
109 | QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; | 108 | QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; |
110 | // QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; | 109 | // QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; |
111 | QDir currentDir, currentRemoteDir; | 110 | QDir currentDir, currentRemoteDir; |
112 | QComboBox *currentPathCombo; | 111 | QComboBox *currentPathCombo; |
113 | QString filterStr, s_addBookmark, s_removeBookmark; | 112 | QString filterStr, s_addBookmark, s_removeBookmark; |
114 | QListViewItem * item; | 113 | QListViewItem * item; |
115 | bool b; | 114 | bool b; |
116 | QStringList fileSystemTypeList, fsList; | 115 | QStringList fileSystemTypeList, fsList; |
117 | int currentServerConfig; | 116 | int currentServerConfig; |
118 | bool zaurusDevice; | 117 | bool zaurusDevice; |
119 | QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; | 118 | QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; |
120 | QStringList remoteDirPathStringList, localDirPathStringList; | 119 | QStringList remoteDirPathStringList, localDirPathStringList; |
121 | QLineEdit *renameBox; | 120 | QLineEdit *renameBox; |
122 | 121 | ||
123 | void init(); | 122 | void init(); |
@@ -160,33 +159,33 @@ protected slots: | |||
160 | void doBeam(); | 159 | void doBeam(); |
161 | void fileBeamFinished( Ir *); | 160 | void fileBeamFinished( Ir *); |
162 | bool copyDirectory( const QString & , const QString & ); | 161 | bool copyDirectory( const QString & , const QString & ); |
163 | // void navigateToSelected(); | 162 | // void navigateToSelected(); |
164 | bool moveDirectory( const QString & , const QString & ); | 163 | bool moveDirectory( const QString & , const QString & ); |
165 | // void slotSwitchtoLocal(int); | 164 | // void slotSwitchtoLocal(int); |
166 | 165 | ||
167 | private: | 166 | private: |
168 | MenuButton *menuButton; | 167 | MenuButton *menuButton; |
169 | QString oldName; | 168 | QString oldName; |
170 | QTimer menuTimer; | 169 | QTimer menuTimer; |
171 | void startProcess(const QString &); | 170 | void startProcess(const QString &); |
172 | bool eventFilter( QObject * , QEvent * ); | 171 | bool eventFilter( QObject * , QEvent * ); |
173 | void cancelRename(); | 172 | void cancelRename(); |
174 | void doRename(QListView *); | 173 | void doRename(QListView *); |
175 | void okRename(); | 174 | void okRename(); |
176 | void customDirsToMenu(); | 175 | void customDirsToMenu(); |
177 | void addCustomDir(); | 176 | void addCustomDir(); |
178 | void removeCustomDir(); | 177 | void removeCustomDir(); |
179 | void gotoDirectory(const QString &); | 178 | void gotoDirectory(const QString &); |
180 | void navigateToSelected(); | 179 | void navigateToSelected(); |
181 | void findFile(const QString &); | 180 | void findFile(const QString &); |
182 | 181 | ||
183 | private slots: | 182 | private slots: |
184 | void processEnded(OProcess *); | 183 | void processEnded(Opie::Core::OProcess *); |
185 | void oprocessStderr(OProcess *, char *, int); | 184 | void oprocessStderr(Opie::Core::OProcess *, char *, int); |
186 | void gotoCustomDir(const QString &); | 185 | void gotoCustomDir(const QString &); |
187 | void qcopReceive(const QCString&, const QByteArray&); | 186 | void qcopReceive(const QCString&, const QByteArray&); |
188 | void setDocument(const QString &); | 187 | void setDocument(const QString &); |
189 | 188 | ||
190 | }; | 189 | }; |
191 | 190 | ||
192 | #endif // ADVANCEDFM_H | 191 | #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 @@ | |||
6 | email : ljp@llornkcor.com | 6 | email : ljp@llornkcor.com |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | #include "advancedfm.h" | 12 | #include "advancedfm.h" |
13 | 13 | ||
14 | #include <qpe/storage.h> | 14 | #include <qpe/storage.h> |
15 | #include <qpe/qpeapplication.h> | 15 | #include <qpe/qpeapplication.h> |
16 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
17 | #include <qpe/menubutton.h> | 17 | #include <qpe/menubutton.h> |
18 | 18 | ||
19 | #include <qlayout.h> | 19 | #include <qlayout.h> |
20 | #include <qhbox.h> | 20 | #include <qhbox.h> |
21 | #include <qmenubar.h> | 21 | #include <qmenubar.h> |
22 | #include <qcombobox.h> | 22 | #include <qcombobox.h> |
23 | #include <qtoolbutton.h> | 23 | #include <qtoolbutton.h> |
24 | #include <qlineedit.h> | 24 | #include <qlineedit.h> |
25 | #include <qlistview.h> | 25 | #include <qlistview.h> |
26 | 26 | ||
27 | #include <sys/utsname.h> | 27 | #include <sys/utsname.h> |
28 | 28 | ||
29 | 29 | ||
30 | using namespace Opie::Ui; | ||
30 | void AdvancedFm::init() { | 31 | void AdvancedFm::init() { |
31 | #if defined(QT_QWS_OPIE) | 32 | #if defined(QT_QWS_OPIE) |
32 | qDebug("<<<<<<<<<<<<<<<<<<<<<<<< OPIE!!!"); | 33 | qDebug("<<<<<<<<<<<<<<<<<<<<<<<< OPIE!!!"); |
33 | #endif | 34 | #endif |
34 | setCaption( tr( "AdvancedFm" ) ); | 35 | setCaption( tr( "AdvancedFm" ) ); |
35 | 36 | ||
36 | QVBoxLayout *layout = new QVBoxLayout( this ); | 37 | QVBoxLayout *layout = new QVBoxLayout( this ); |
37 | layout->setSpacing( 2); | 38 | layout->setSpacing( 2); |
38 | layout->setMargin( 2); | 39 | layout->setMargin( 2); |
39 | 40 | ||
40 | QMenuBar *menuBar = new QMenuBar(this); | 41 | QMenuBar *menuBar = new QMenuBar(this); |
41 | fileMenu = new QPopupMenu( this ); | 42 | fileMenu = new QPopupMenu( this ); |
42 | viewMenu = new QPopupMenu( this ); | 43 | viewMenu = new QPopupMenu( this ); |
43 | // customDirMenu = new QPopupMenu( this ); | 44 | // customDirMenu = new QPopupMenu( this ); |
44 | 45 | ||
45 | layout->addWidget( menuBar ); | 46 | layout->addWidget( menuBar ); |
46 | 47 | ||
47 | menuBar->insertItem( tr( "File" ), fileMenu); | 48 | menuBar->insertItem( tr( "File" ), fileMenu); |
48 | menuBar->insertItem( tr( "View" ), viewMenu); | 49 | menuBar->insertItem( tr( "View" ), viewMenu); |
49 | 50 | ||
50 | cdUpButton = new QToolButton( 0,"cdUpButton"); | 51 | cdUpButton = new QToolButton( 0,"cdUpButton"); |
51 | cdUpButton->setPixmap(Resource::loadPixmap("up")); | 52 | cdUpButton->setPixmap(Resource::loadPixmap("up")); |
52 | cdUpButton->setAutoRaise( true ); | 53 | cdUpButton->setAutoRaise( true ); |
53 | menuBar->insertItem( cdUpButton ); | 54 | 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 @@ | |||
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | #include "advancedfm.h" | 12 | #include "advancedfm.h" |
13 | #include "output.h" | 13 | #include "output.h" |
14 | #include "filePermissions.h" | 14 | #include "filePermissions.h" |
15 | 15 | ||
16 | #include <qpe/lnkproperties.h> | 16 | #include <qpe/lnkproperties.h> |
17 | #include <qpe/qpeapplication.h> | 17 | #include <qpe/qpeapplication.h> |
18 | #include <qpe/applnk.h> | 18 | #include <qpe/applnk.h> |
19 | 19 | ||
20 | #include <qmessagebox.h> | 20 | #include <qmessagebox.h> |
21 | 21 | ||
22 | 22 | ||
23 | #include <qpopupmenu.h> | 23 | #include <qpopupmenu.h> |
24 | #include <qlistview.h> | 24 | #include <qlistview.h> |
25 | 25 | ||
26 | #include <errno.h> | 26 | #include <errno.h> |
27 | #include <stdlib.h> | 27 | #include <stdlib.h> |
28 | #include <unistd.h> | 28 | #include <unistd.h> |
29 | #include <sys/stat.h> | 29 | #include <sys/stat.h> |
30 | #include <dirent.h> | 30 | #include <dirent.h> |
31 | #include <sys/sendfile.h> | 31 | #include <sys/sendfile.h> |
32 | #include <fcntl.h> | 32 | #include <fcntl.h> |
33 | 33 | ||
34 | 34 | ||
35 | using namespace Opie::Core; | ||
36 | using namespace Opie::Core; | ||
35 | void AdvancedFm::doDirChange() { | 37 | void AdvancedFm::doDirChange() { |
36 | QString pathItem = CurrentView()->currentItem()->text(0); | 38 | QString pathItem = CurrentView()->currentItem()->text(0); |
37 | if( pathItem == "../") { | 39 | if( pathItem == "../") { |
38 | ListClicked( CurrentView()->currentItem()); | 40 | ListClicked( CurrentView()->currentItem()); |
39 | } else { | 41 | } else { |
40 | if( pathItem.find(" -> ",0,TRUE) != -1) | 42 | if( pathItem.find(" -> ",0,TRUE) != -1) |
41 | pathItem = dealWithSymName((const QString&)pathItem)+"/"; | 43 | pathItem = dealWithSymName((const QString&)pathItem)+"/"; |
42 | // qWarning(pathItem); | 44 | // qWarning(pathItem); |
43 | gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); | 45 | gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); |
44 | } | 46 | } |
45 | } | 47 | } |
46 | 48 | ||
47 | void AdvancedFm::showMenuHidden() { | 49 | void AdvancedFm::showMenuHidden() { |
48 | if (b) { | 50 | if (b) { |
49 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 51 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
50 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 52 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
51 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 53 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
52 | } else { | 54 | } else { |
53 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 55 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
54 | OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 56 | OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
55 | fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); | 57 | fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); |
56 | } | 58 | } |
57 | b = !b; | 59 | b = !b; |
58 | populateView(); | 60 | populateView(); |
@@ -681,52 +683,52 @@ void AdvancedFm::doBeam() { | |||
681 | curFilePath = curFilePath.left( curFilePath.length() -1); | 683 | curFilePath = curFilePath.left( curFilePath.length() -1); |
682 | } | 684 | } |
683 | Ir *file = new Ir(this, "IR"); | 685 | Ir *file = new Ir(this, "IR"); |
684 | connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished(Ir*))); | 686 | connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished(Ir*))); |
685 | file->send( curFilePath, curFile ); | 687 | file->send( curFilePath, curFile ); |
686 | } | 688 | } |
687 | } | 689 | } |
688 | } | 690 | } |
689 | } | 691 | } |
690 | 692 | ||
691 | void AdvancedFm::fileBeamFinished( Ir *) { | 693 | void AdvancedFm::fileBeamFinished( Ir *) { |
692 | QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); | 694 | QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); |
693 | } | 695 | } |
694 | 696 | ||
695 | void AdvancedFm::selectAll() { | 697 | void AdvancedFm::selectAll() { |
696 | QListView *thisView = CurrentView(); | 698 | QListView *thisView = CurrentView(); |
697 | thisView->selectAll(true); | 699 | thisView->selectAll(true); |
698 | thisView->setSelected( thisView->firstChild(),false); | 700 | thisView->setSelected( thisView->firstChild(),false); |
699 | } | 701 | } |
700 | 702 | ||
701 | void AdvancedFm::startProcess(const QString & cmd) { | 703 | void AdvancedFm::startProcess(const QString & cmd) { |
702 | QStringList command; | 704 | QStringList command; |
703 | OProcess *process; | 705 | OProcess *process; |
704 | process = new OProcess(); | 706 | process = new OProcess(); |
705 | connect(process, SIGNAL(processExited(OProcess*)), | 707 | connect(process, SIGNAL(processExited(Opie::Core::OProcess*)), |
706 | this, SLOT( processEnded(OProcess*))); | 708 | this, SLOT( processEnded(OProcess*))); |
707 | 709 | ||
708 | connect(process, SIGNAL( receivedStderr(OProcess*,char*,int)), | 710 | connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), |
709 | this, SLOT( oprocessStderr(OProcess*,char*,int))); | 711 | this, SLOT( oprocessStderr(OProcess*,char*,int))); |
710 | 712 | ||
711 | command << "/bin/sh"; | 713 | command << "/bin/sh"; |
712 | command << "-c"; | 714 | command << "-c"; |
713 | command << cmd.latin1(); | 715 | command << cmd.latin1(); |
714 | *process << command; | 716 | *process << command; |
715 | if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) | 717 | if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) |
716 | qDebug("could not start process"); | 718 | qDebug("could not start process"); |
717 | } | 719 | } |
718 | 720 | ||
719 | void AdvancedFm::processEnded(OProcess *) { | 721 | void AdvancedFm::processEnded(OProcess *) { |
720 | rePopulate(); | 722 | rePopulate(); |
721 | } | 723 | } |
722 | 724 | ||
723 | void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { | 725 | void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { |
724 | // qWarning("received stderrt %d bytes", buflen); | 726 | // qWarning("received stderrt %d bytes", buflen); |
725 | 727 | ||
726 | QString lineStr = buffer; | 728 | QString lineStr = buffer; |
727 | QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); | 729 | QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); |
728 | } | 730 | } |
729 | 731 | ||
730 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { | 732 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { |
731 | if ( o->inherits( "QLineEdit" ) ) { | 733 | if ( o->inherits( "QLineEdit" ) ) { |
732 | if ( e->type() == QEvent::KeyPress ) { | 734 | 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 @@ | |||
1 | 1 | ||
2 | /*************************************************************************** | 2 | /*************************************************************************** |
3 | using namespace Opie::Core; | ||
4 | using namespace Opie::Core; | ||
3 | main.cpp - description | 5 | main.cpp - description |
4 | ------------------- | 6 | ------------------- |
5 | begin : March 10, 2002 | 7 | begin : March 10, 2002 |
6 | copyright : (C) 2002 by llornkcor | 8 | copyright : (C) 2002 by llornkcor |
7 | email : ljp@llornkcor.com | 9 | email : ljp@llornkcor.com |
8 | * This program is free software; you can redistribute it and/or modify * | 10 | * This program is free software; you can redistribute it and/or modify * |
9 | * it under the terms of the GNU General Public License as published by * | 11 | * it under the terms of the GNU General Public License as published by * |
10 | * the Free Software Foundation; either version 2 of the License, or * | 12 | * the Free Software Foundation; either version 2 of the License, or * |
11 | * (at your option) any later version. * | 13 | * (at your option) any later version. * |
12 | ***************************************************************************/ | 14 | ***************************************************************************/ |
13 | 15 | ||
14 | #include "advancedfm.h" | 16 | #include "advancedfm.h" |
15 | |||
16 | #ifdef NOQUICKLAUNCH | ||
17 | |||
18 | #include <qpe/qpeapplication.h> | ||
19 | |||
20 | int main(int argc, char *argv[]) | ||
21 | { | ||
22 | QPEApplication a(argc, argv); | ||
23 | |||
24 | AdvancedFm advencedFm; | ||
25 | a.showMainWidget( &advencedFm); | ||
26 | return a.exec(); | ||
27 | } | ||
28 | #else | ||
29 | #include <opie2/oapplicationfactory.h> | 17 | #include <opie2/oapplicationfactory.h> |
30 | 18 | ||
19 | using namespace Opie::Core; | ||
20 | |||
31 | OPIE_EXPORT_APP( OApplicationFactory<AdvancedFm> ) | 21 | OPIE_EXPORT_APP( OApplicationFactory<AdvancedFm> ) |
32 | 22 | ||
33 | #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 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** outputEdit.cpp | 2 | ** outputEdit.cpp |
3 | ** | 3 | ** |
4 | ** Copyright: Fri Apr 12 15:12:58 2002 L.J. Potter <ljp@llornkcor.com> | 4 | ** Copyright: Fri Apr 12 15:12:58 2002 L.J. Potter <ljp@llornkcor.com> |
5 | ****************************************************************************/ | 5 | ****************************************************************************/ |
6 | #include "output.h" | 6 | #include "output.h" |
7 | 7 | ||
8 | #include <qpe/qpeapplication.h> | 8 | #include <qpe/qpeapplication.h> |
9 | #include <qpe/applnk.h> | 9 | #include <qpe/applnk.h> |
10 | 10 | ||
11 | #include <qfile.h> | 11 | #include <qfile.h> |
12 | #include <qmultilineedit.h> | 12 | #include <qmultilineedit.h> |
13 | #include <qpushbutton.h> | 13 | #include <qpushbutton.h> |
14 | #include <qlayout.h> | 14 | #include <qlayout.h> |
15 | 15 | ||
16 | #include <errno.h> | 16 | #include <errno.h> |
17 | 17 | ||
18 | /* XPM */ | 18 | /* XPM */ |
19 | using namespace Opie::Core; | ||
20 | using namespace Opie::Core; | ||
19 | static char * filesave_xpm[] = { | 21 | static char * filesave_xpm[] = { |
20 | "16 16 78 1", | 22 | "16 16 78 1", |
21 | " c None", | 23 | " c None", |
22 | ". c #343434", | 24 | ". c #343434", |
23 | "+ c #A0A0A0", | 25 | "+ c #A0A0A0", |
24 | "@ c #565656", | 26 | "@ c #565656", |
25 | "# c #9E9E9E", | 27 | "# c #9E9E9E", |
26 | "$ c #525252", | 28 | "$ c #525252", |
27 | "% c #929292", | 29 | "% c #929292", |
28 | "& c #676767", | 30 | "& c #676767", |
29 | "* c #848484", | 31 | "* c #848484", |
30 | "= c #666666", | 32 | "= c #666666", |
31 | "- c #D8D8D8", | 33 | "- c #D8D8D8", |
32 | "; c #FFFFFF", | 34 | "; c #FFFFFF", |
33 | "> c #DBDBDB", | 35 | "> c #DBDBDB", |
34 | ", c #636363", | 36 | ", c #636363", |
35 | "' c #989898", | 37 | "' c #989898", |
36 | ") c #2D2D2D", | 38 | ") c #2D2D2D", |
37 | "! c #909090", | 39 | "! c #909090", |
38 | "~ c #AEAEAE", | 40 | "~ c #AEAEAE", |
39 | "{ c #EAEAEA", | 41 | "{ c #EAEAEA", |
40 | "] c #575757", | 42 | "] c #575757", |
41 | "^ c #585858", | 43 | "^ c #585858", |
42 | "/ c #8A8A8A", | 44 | "/ c #8A8A8A", |
@@ -120,55 +122,55 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name, | |||
120 | // cmmds=QStringList::split( " ", commands, false); | 122 | // cmmds=QStringList::split( " ", commands, false); |
121 | cmmds=commands; | 123 | cmmds=commands; |
122 | // qDebug("count %d", cmmds.count()); | 124 | // qDebug("count %d", cmmds.count()); |
123 | if ( !name ) | 125 | if ( !name ) |
124 | setName( tr("Output")); | 126 | setName( tr("Output")); |
125 | resize( 196, 269 ); | 127 | resize( 196, 269 ); |
126 | setCaption( name ); | 128 | setCaption( name ); |
127 | 129 | ||
128 | OutputLayout = new QGridLayout( this ); | 130 | OutputLayout = new QGridLayout( this ); |
129 | OutputLayout->setSpacing( 2); | 131 | OutputLayout->setSpacing( 2); |
130 | OutputLayout->setMargin( 2); | 132 | OutputLayout->setMargin( 2); |
131 | 133 | ||
132 | QPushButton *docButton; | 134 | QPushButton *docButton; |
133 | docButton = new QPushButton( QPixmap(( const char** ) filesave_xpm ) ,"",this,"saveButton"); | 135 | docButton = new QPushButton( QPixmap(( const char** ) filesave_xpm ) ,"",this,"saveButton"); |
134 | docButton->setFixedSize( QSize( 20, 20 ) ); | 136 | docButton->setFixedSize( QSize( 20, 20 ) ); |
135 | connect( docButton,SIGNAL(released()),this,SLOT( saveOutput() )); | 137 | connect( docButton,SIGNAL(released()),this,SLOT( saveOutput() )); |
136 | // docButton->setFlat(TRUE); | 138 | // docButton->setFlat(TRUE); |
137 | OutputLayout->addMultiCellWidget( docButton, 0,0,3,3 ); | 139 | OutputLayout->addMultiCellWidget( docButton, 0,0,3,3 ); |
138 | 140 | ||
139 | OutputEdit = new QMultiLineEdit( this, "OutputEdit" ); | 141 | OutputEdit = new QMultiLineEdit( this, "OutputEdit" ); |
140 | OutputLayout->addMultiCellWidget( OutputEdit, 1,1,0,3 ); | 142 | OutputLayout->addMultiCellWidget( OutputEdit, 1,1,0,3 ); |
141 | 143 | ||
142 | proc = new OProcess(); | 144 | proc = new OProcess(); |
143 | 145 | ||
144 | connect(proc, SIGNAL(processExited(OProcess*)), | 146 | connect(proc, SIGNAL(processExited(Opie::Core::OProcess*)), |
145 | this, SLOT( processFinished())); | 147 | this, SLOT( processFinished())); |
146 | 148 | ||
147 | connect(proc, SIGNAL(receivedStdout(OProcess*,char*,int)), | 149 | connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)), |
148 | this, SLOT(commandStdout(OProcess*,char*,int))); | 150 | this, SLOT(commandStdout(OProcess*,char*,int))); |
149 | 151 | ||
150 | connect(proc, SIGNAL(receivedStderr(OProcess*,char*,int)), | 152 | connect(proc, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)), |
151 | this, SLOT(commandStderr(OProcess*,char*,int))); | 153 | this, SLOT(commandStderr(OProcess*,char*,int))); |
152 | 154 | ||
153 | // connect( , SIGNAL(received(const QByteArray&)), | 155 | // connect( , SIGNAL(received(const QByteArray&)), |
154 | // this, SLOT(commandStdin(const QByteArray&))); | 156 | // this, SLOT(commandStdin(const QByteArray&))); |
155 | 157 | ||
156 | // * proc << commands.latin1(); | 158 | // * proc << commands.latin1(); |
157 | for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) { | 159 | for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) { |
158 | qDebug( "%s", (*it).latin1() ); | 160 | qDebug( "%s", (*it).latin1() ); |
159 | * proc << (*it).latin1(); | 161 | * proc << (*it).latin1(); |
160 | } | 162 | } |
161 | 163 | ||
162 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) { | 164 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) { |
163 | 165 | ||
164 | OutputEdit->append(tr("Process could not start") ); | 166 | OutputEdit->append(tr("Process could not start") ); |
165 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | 167 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); |
166 | perror("Error: "); | 168 | perror("Error: "); |
167 | QString errorMsg=tr("Error\n")+(QString)strerror(errno); | 169 | QString errorMsg=tr("Error\n")+(QString)strerror(errno); |
168 | OutputEdit->append( errorMsg); | 170 | OutputEdit->append( errorMsg); |
169 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | 171 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); |
170 | } | 172 | } |
171 | } | 173 | } |
172 | 174 | ||
173 | Output::~Output() { | 175 | Output::~Output() { |
174 | } | 176 | } |
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 @@ | |||
14 | #include <qcstring.h> | 14 | #include <qcstring.h> |
15 | #include <qstringlist.h> | 15 | #include <qstringlist.h> |
16 | #include <qlineedit.h> | 16 | #include <qlineedit.h> |
17 | #include <qwhatsthis.h> | 17 | #include <qwhatsthis.h> |
18 | 18 | ||
19 | #include <opie2/oprocess.h> | 19 | #include <opie2/oprocess.h> |
20 | 20 | ||
21 | class QVBoxLayout; | 21 | class QVBoxLayout; |
22 | class QHBoxLayout; | 22 | class QHBoxLayout; |
23 | class QGridLayout; | 23 | class QGridLayout; |
24 | class QMultiLineEdit; | 24 | class QMultiLineEdit; |
25 | 25 | ||
26 | class Output : public QDialog | 26 | class Output : public QDialog |
27 | { | 27 | { |
28 | Q_OBJECT | 28 | Q_OBJECT |
29 | 29 | ||
30 | public: | 30 | public: |
31 | Output(const QStringList commands=0, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | 31 | Output(const QStringList commands=0, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
32 | ~Output(); | 32 | ~Output(); |
33 | 33 | ||
34 | QMultiLineEdit* OutputEdit; | 34 | QMultiLineEdit* OutputEdit; |
35 | 35 | ||
36 | protected: | 36 | protected: |
37 | QGridLayout* OutputLayout; | 37 | QGridLayout* OutputLayout; |
38 | OProcess *proc; | 38 | Opie::Core::OProcess *proc; |
39 | protected slots: | 39 | protected slots: |
40 | void saveOutput(); | 40 | void saveOutput(); |
41 | void commandStdout(OProcess*, char *, int); | 41 | void commandStdout(Opie::Core::OProcess*, char *, int); |
42 | void commandStdin(const QByteArray &); | 42 | void commandStdin(const QByteArray &); |
43 | void commandStderr(OProcess*, char *, int); | 43 | void commandStderr(Opie::Core::OProcess*, char *, int); |
44 | void processFinished(); | 44 | void processFinished(); |
45 | private: | 45 | private: |
46 | QString cmmd; | 46 | QString cmmd; |
47 | 47 | ||
48 | }; | 48 | }; |
49 | 49 | ||
50 | class InputDialog : public QDialog | 50 | class InputDialog : public QDialog |
51 | { | 51 | { |
52 | Q_OBJECT | 52 | Q_OBJECT |
53 | 53 | ||
54 | public: | 54 | public: |
55 | InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | 55 | InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
56 | ~InputDialog(); | 56 | ~InputDialog(); |
57 | QString inputText; | 57 | QString inputText; |
58 | QLineEdit* LineEdit1; | 58 | QLineEdit* LineEdit1; |
59 | void setInputText(const QString &); | 59 | void setInputText(const QString &); |
60 | private slots: | 60 | private slots: |
61 | void returned(); | 61 | void returned(); |
62 | 62 | ||
63 | }; | 63 | }; |
64 | 64 | ||
65 | #endif // OUTPUT_H | 65 | #endif // OUTPUT_H |