author | zecke <zecke> | 2004-03-13 22:41:59 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-13 22:41:59 (UTC) |
commit | 3d27828732fe7e499219ad6e208dc13dead86431 (patch) (unidiff) | |
tree | faa42dec364ad1e0470a370c81d0a7dc0cd2f9bc | |
parent | ee753c0009da5bec4a71d3263e9623d04dddc5c4 (diff) | |
download | opie-3d27828732fe7e499219ad6e208dc13dead86431.zip opie-3d27828732fe7e499219ad6e208dc13dead86431.tar.gz opie-3d27828732fe7e499219ad6e208dc13dead86431.tar.bz2 |
Namespace changes for Apps
QAshMoney and Reader need to be valgrinded
43 files changed, 90 insertions, 63 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 | |||
@@ -4,64 +4,66 @@ | |||
4 | ** Created: Sat Mar 9 23:33:09 2002 | 4 | ** Created: Sat Mar 9 23:33:09 2002 |
5 | copyright : (C) 2002 by ljp | 5 | copyright : (C) 2002 by ljp |
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 | #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 | ||
60 | void AdvancedFm::cleanUp() { | 62 | void AdvancedFm::cleanUp() { |
61 | QString sfile=QDir::homeDirPath(); | 63 | QString sfile=QDir::homeDirPath(); |
62 | if(sfile.right(1) != "/") | 64 | if(sfile.right(1) != "/") |
63 | sfile+="/._temp"; | 65 | sfile+="/._temp"; |
64 | else | 66 | else |
65 | sfile+="._temp"; | 67 | sfile+="._temp"; |
66 | QFile file( sfile); | 68 | QFile file( sfile); |
67 | if(file.exists()) | 69 | if(file.exists()) |
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 | |||
@@ -1,65 +1,64 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | advancedfm.h | 2 | advancedfm.h |
3 | ------------------- | 3 | ------------------- |
4 | ** Created: Sat Mar 9 23:33:09 2002 | 4 | ** Created: Sat Mar 9 23:33:09 2002 |
5 | copyright : (C) 2002 by ljp | 5 | copyright : (C) 2002 by ljp |
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 | #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: |
58 | static QString appName() { return QString::fromLatin1("advancedfm"); } | 57 | static QString appName() { return QString::fromLatin1("advancedfm"); } |
59 | #ifdef NOQUICKLAUNCH | 58 | #ifdef NOQUICKLAUNCH |
60 | AdvancedFm(); | 59 | AdvancedFm(); |
61 | #else | 60 | #else |
62 | AdvancedFm(QWidget *p = 0, const char* name = 0, WFlags fl = 0); | 61 | AdvancedFm(QWidget *p = 0, const char* name = 0, WFlags fl = 0); |
63 | #endif | 62 | #endif |
64 | ~AdvancedFm(); | 63 | ~AdvancedFm(); |
65 | protected slots: | 64 | protected slots: |
@@ -67,65 +66,65 @@ protected slots: | |||
67 | void selectAll(); | 66 | void selectAll(); |
68 | void addToDocs(); | 67 | void addToDocs(); |
69 | void doDirChange(); | 68 | void doDirChange(); |
70 | void mkDir(); | 69 | void mkDir(); |
71 | void del(); | 70 | void del(); |
72 | void rn(); | 71 | void rn(); |
73 | void populateView(); | 72 | void populateView(); |
74 | void rePopulate(); | 73 | void rePopulate(); |
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(); |
124 | void initConnections(); | 123 | void initConnections(); |
125 | void keyReleaseEvent( QKeyEvent *); | 124 | void keyReleaseEvent( QKeyEvent *); |
126 | void keyPressEvent( QKeyEvent *); | 125 | void keyPressEvent( QKeyEvent *); |
127 | QString getFileSystemType(const QString &); | 126 | QString getFileSystemType(const QString &); |
128 | QString getDiskSpace(const QString &); | 127 | QString getDiskSpace(const QString &); |
129 | void parsetab(const QString &fileName); | 128 | void parsetab(const QString &fileName); |
130 | QString checkDiskSpace(const QString &); | 129 | QString checkDiskSpace(const QString &); |
131 | QString dealWithSymName(const QString &); | 130 | QString dealWithSymName(const QString &); |
@@ -152,41 +151,41 @@ protected slots: | |||
152 | void copyAs(); | 151 | void copyAs(); |
153 | void copySameDir(); | 152 | void copySameDir(); |
154 | void currentPathComboActivated(const QString &); | 153 | void currentPathComboActivated(const QString &); |
155 | void fillCombo(const QString &); | 154 | void fillCombo(const QString &); |
156 | bool copyFile( const QString & , const QString & ); | 155 | bool copyFile( const QString & , const QString & ); |
157 | void move(); | 156 | void move(); |
158 | void fileStatus(); | 157 | void fileStatus(); |
159 | void doAbout(); | 158 | void doAbout(); |
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 | |||
@@ -1,61 +1,62 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | advancedfmData.cpp | 2 | advancedfmData.cpp |
3 | ------------------- | 3 | ------------------- |
4 | ** Created: Mon 09-23-2002 13:24:11 | 4 | ** Created: Mon 09-23-2002 13:24:11 |
5 | copyright : (C) 2002 by ljp | 5 | copyright : (C) 2002 by ljp |
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 ); |
54 | 55 | ||
55 | 56 | ||
56 | QHBox *lineBox = new QHBox( this ); | 57 | QHBox *lineBox = new QHBox( this ); |
57 | 58 | ||
58 | qpeDirButton= new QToolButton( 0,"QPEButton"); | 59 | qpeDirButton= new QToolButton( 0,"QPEButton"); |
59 | qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); | 60 | qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); |
60 | qpeDirButton->setAutoRaise( true ); | 61 | qpeDirButton->setAutoRaise( true ); |
61 | menuBar->insertItem( qpeDirButton ); | 62 | menuBar->insertItem( qpeDirButton ); |
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 | |||
@@ -3,64 +3,66 @@ | |||
3 | ------------------- | 3 | ------------------- |
4 | ** Created: Sat Mar 9 23:33:09 2002 | 4 | ** Created: Sat Mar 9 23:33:09 2002 |
5 | copyright : (C) 2002 by ljp | 5 | copyright : (C) 2002 by ljp |
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 | #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(); |
59 | } | 61 | } |
60 | 62 | ||
61 | void AdvancedFm::showHidden() { | 63 | void AdvancedFm::showHidden() { |
62 | if (b) { | 64 | if (b) { |
63 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 65 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
64 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 66 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
65 | } else { | 67 | } else { |
66 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 68 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
@@ -673,68 +675,68 @@ void AdvancedFm::doBeam() { | |||
673 | if(!ir.supported()) { | 675 | if(!ir.supported()) { |
674 | } else { | 676 | } else { |
675 | QStringList curFileList = getPath(); | 677 | QStringList curFileList = getPath(); |
676 | if( curFileList.count() > 0) { | 678 | if( curFileList.count() > 0) { |
677 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 679 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
678 | QString curFile = (*it); | 680 | QString curFile = (*it); |
679 | QString curFilePath = CurrentDir()->canonicalPath()+"/"+curFile; | 681 | QString curFilePath = CurrentDir()->canonicalPath()+"/"+curFile; |
680 | if( curFilePath.right(1) == "/") { | 682 | if( curFilePath.right(1) == "/") { |
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 ) { |
733 | QKeyEvent *ke = (QKeyEvent*)e; | 735 | QKeyEvent *ke = (QKeyEvent*)e; |
734 | if ( ke->key() == Key_Return || | 736 | if ( ke->key() == Key_Return || |
735 | ke->key() == Key_Enter ) { | 737 | ke->key() == Key_Enter ) { |
736 | okRename(); | 738 | okRename(); |
737 | return true; | 739 | return true; |
738 | } | 740 | } |
739 | else if ( ke->key() == Key_Escape ) { | 741 | else if ( ke->key() == Key_Escape ) { |
740 | cancelRename(); | 742 | cancelRename(); |
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,50 +1,52 @@ | |||
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", |
43 | "( c #828282", | 45 | "( c #828282", |
44 | "_ c #6F6F6F", | 46 | "_ c #6F6F6F", |
45 | ": c #C9C9C9", | 47 | ": c #C9C9C9", |
46 | "< c #050505", | 48 | "< c #050505", |
47 | "[ c #292929", | 49 | "[ c #292929", |
48 | "} c #777777", | 50 | "} c #777777", |
49 | "| c #616161", | 51 | "| c #616161", |
50 | "1 c #3A3A3A", | 52 | "1 c #3A3A3A", |
@@ -112,71 +114,71 @@ static char * filesave_xpm[] = { | |||
112 | " +...vEKxzLM ", | 114 | " +...vEKxzLM ", |
113 | " +...z]n$ ", | 115 | " +...z]n$ ", |
114 | " +... "}; | 116 | " +... "}; |
115 | 117 | ||
116 | Output::Output( const QStringList commands, QWidget* parent, const char* name, bool modal, WFlags fl) | 118 | Output::Output( const QStringList commands, QWidget* parent, const char* name, bool modal, WFlags fl) |
117 | : QDialog( parent, name, modal, fl ) | 119 | : QDialog( parent, name, modal, fl ) |
118 | { | 120 | { |
119 | QStringList cmmds; | 121 | QStringList cmmds; |
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 | } |
175 | 177 | ||
176 | void Output::saveOutput() { | 178 | void Output::saveOutput() { |
177 | 179 | ||
178 | InputDialog *fileDlg; | 180 | InputDialog *fileDlg; |
179 | fileDlg = new InputDialog(this,tr("Save output to file (name only)"),TRUE, 0); | 181 | fileDlg = new InputDialog(this,tr("Save output to file (name only)"),TRUE, 0); |
180 | fileDlg->exec(); | 182 | fileDlg->exec(); |
181 | if( fileDlg->result() == 1 ) { | 183 | if( fileDlg->result() == 1 ) { |
182 | QString filename = QPEApplication::documentDir(); | 184 | QString filename = QPEApplication::documentDir(); |
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 | |||
@@ -6,60 +6,60 @@ | |||
6 | ** | 6 | ** |
7 | ** WARNING! All changes made in this file will be lost! | 7 | ** WARNING! All changes made in this file will be lost! |
8 | ****************************************************************************/ | 8 | ****************************************************************************/ |
9 | #ifndef OUTPUT_H | 9 | #ifndef OUTPUT_H |
10 | #define OUTPUT_H | 10 | #define OUTPUT_H |
11 | 11 | ||
12 | #include <qvariant.h> | 12 | #include <qvariant.h> |
13 | #include <qdialog.h> | 13 | #include <qdialog.h> |
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 |
diff --git a/noncore/apps/checkbook/checkbook.cpp b/noncore/apps/checkbook/checkbook.cpp index 1b933f2..706d970 100644 --- a/noncore/apps/checkbook/checkbook.cpp +++ b/noncore/apps/checkbook/checkbook.cpp | |||
@@ -29,64 +29,65 @@ | |||
29 | #include "checkbook.h" | 29 | #include "checkbook.h" |
30 | #include "cbinfo.h" | 30 | #include "cbinfo.h" |
31 | #include "transaction.h" | 31 | #include "transaction.h" |
32 | #include "traninfo.h" | 32 | #include "traninfo.h" |
33 | #include "graph.h" | 33 | #include "graph.h" |
34 | #include "graphinfo.h" | 34 | #include "graphinfo.h" |
35 | #include "password.h" | 35 | #include "password.h" |
36 | #include "cfg.h" | 36 | #include "cfg.h" |
37 | 37 | ||
38 | #include <qpe/qpeapplication.h> | 38 | #include <qpe/qpeapplication.h> |
39 | #include <qpe/qpemessagebox.h> | 39 | #include <qpe/qpemessagebox.h> |
40 | #include <qpe/resource.h> | 40 | #include <qpe/resource.h> |
41 | 41 | ||
42 | #include <qcheckbox.h> | 42 | #include <qcheckbox.h> |
43 | #include <qcombobox.h> | 43 | #include <qcombobox.h> |
44 | #include <qlabel.h> | 44 | #include <qlabel.h> |
45 | #include <qlayout.h> | 45 | #include <qlayout.h> |
46 | #include <qlineedit.h> | 46 | #include <qlineedit.h> |
47 | #include <qmultilineedit.h> | 47 | #include <qmultilineedit.h> |
48 | #include <qpushbutton.h> | 48 | #include <qpushbutton.h> |
49 | #include <qwhatsthis.h> | 49 | #include <qwhatsthis.h> |
50 | #include <qpopupmenu.h> | 50 | #include <qpopupmenu.h> |
51 | 51 | ||
52 | #define COL_ID 0 | 52 | #define COL_ID 0 |
53 | #define COL_SORTDATE 1 | 53 | #define COL_SORTDATE 1 |
54 | #define COL_NUM 2 | 54 | #define COL_NUM 2 |
55 | #define COL_DATE 3 | 55 | #define COL_DATE 3 |
56 | #define COL_DESC 4 | 56 | #define COL_DESC 4 |
57 | #define COL_AMOUNT 5 | 57 | #define COL_AMOUNT 5 |
58 | #define COL_BAL 6 | 58 | #define COL_BAL 6 |
59 | 59 | ||
60 | // --- Checkbook -------------------------------------------------------------- | 60 | // --- Checkbook -------------------------------------------------------------- |
61 | using namespace Opie::Ui; | ||
61 | Checkbook::Checkbook( QWidget *parent, CBInfo *i, Cfg *cfg ) | 62 | Checkbook::Checkbook( QWidget *parent, CBInfo *i, Cfg *cfg ) |
62 | : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) | 63 | : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) |
63 | { | 64 | { |
64 | info = i; | 65 | info = i; |
65 | _pCfg=cfg; | 66 | _pCfg=cfg; |
66 | 67 | ||
67 | // Title bar | 68 | // Title bar |
68 | if ( info->name() != "" ) | 69 | if ( info->name() != "" ) |
69 | { | 70 | { |
70 | QString tempstr = info->name(); | 71 | QString tempstr = info->name(); |
71 | tempstr.append( " - " ); | 72 | tempstr.append( " - " ); |
72 | tempstr.append( tr( "Checkbook" ) ); | 73 | tempstr.append( tr( "Checkbook" ) ); |
73 | setCaption( tempstr ); | 74 | setCaption( tempstr ); |
74 | } | 75 | } |
75 | else | 76 | else |
76 | { | 77 | { |
77 | setCaption( tr( "New checkbook" ) ); | 78 | setCaption( tr( "New checkbook" ) ); |
78 | } | 79 | } |
79 | 80 | ||
80 | 81 | ||
81 | // Setup layout to make everything pretty | 82 | // Setup layout to make everything pretty |
82 | QVBoxLayout *layout = new QVBoxLayout( this ); | 83 | QVBoxLayout *layout = new QVBoxLayout( this ); |
83 | layout->setMargin( 2 ); | 84 | layout->setMargin( 2 ); |
84 | layout->setSpacing( 4 ); | 85 | layout->setSpacing( 4 ); |
85 | 86 | ||
86 | // Setup tabs for all info | 87 | // Setup tabs for all info |
87 | mainWidget = new OTabWidget( this ); | 88 | mainWidget = new OTabWidget( this ); |
88 | layout->addWidget( mainWidget ); | 89 | layout->addWidget( mainWidget ); |
89 | mainWidget->addTab( initInfo(), "checkbook/infotab", tr( "Info" ) ); | 90 | mainWidget->addTab( initInfo(), "checkbook/infotab", tr( "Info" ) ); |
90 | mainWidget->addTab( initTransactions(), "checkbook/trantab", tr( "Transactions" ) ); | 91 | mainWidget->addTab( initTransactions(), "checkbook/trantab", tr( "Transactions" ) ); |
91 | mainWidget->addTab( initCharts(), "checkbook/charttab", tr( "Charts" ) ); | 92 | mainWidget->addTab( initCharts(), "checkbook/charttab", tr( "Charts" ) ); |
92 | if( _pCfg->isShowLastTab() ) | 93 | if( _pCfg->isShowLastTab() ) |
diff --git a/noncore/apps/checkbook/checkbook.h b/noncore/apps/checkbook/checkbook.h index e2f0e56..80bc106 100644 --- a/noncore/apps/checkbook/checkbook.h +++ b/noncore/apps/checkbook/checkbook.h | |||
@@ -6,103 +6,102 @@ | |||
6 | _;:, .> :=|. This file is free software; you can | 6 | _;:, .> :=|. This file is free software; you can |
7 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
9 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
10 | - . .-<_> .<> Foundation; either version 2 of the License, | 10 | - . .-<_> .<> Foundation; either version 2 of the License, |
11 | ._= =} : or (at your option) any later version. | 11 | ._= =} : or (at your option) any later version. |
12 | .%`+i> _;_. | 12 | .%`+i> _;_. |
13 | .i_,=:_. -<s. This file is distributed in the hope that | 13 | .i_,=:_. -<s. This file is distributed in the hope that |
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
15 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
18 | ..}^=.= = ; Public License for more details. | 18 | ..}^=.= = ; Public License for more details. |
19 | ++= -. .` .: | 19 | ++= -. .` .: |
20 | : = ...= . :.=- You should have received a copy of the GNU | 20 | : = ...= . :.=- You should have received a copy of the GNU |
21 | -. .:....=;==+<; General Public License along with this file; | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #ifndef CHECKBOOK_H | 29 | #ifndef CHECKBOOK_H |
30 | #define CHECKBOOK_H | 30 | #define CHECKBOOK_H |
31 | 31 | ||
32 | #include <opie2/otabwidget.h> | 32 | #include <opie2/otabwidget.h> |
33 | 33 | ||
34 | #include <qdatetime.h> | 34 | #include <qdatetime.h> |
35 | #include <qdialog.h> | 35 | #include <qdialog.h> |
36 | #include <qlistview.h> | 36 | #include <qlistview.h> |
37 | 37 | ||
38 | using Opie::OTabWidget; | ||
39 | 38 | ||
40 | class CBInfo; | 39 | class CBInfo; |
41 | class Graph; | 40 | class Graph; |
42 | class GraphInfo; | 41 | class GraphInfo; |
43 | class QCheckBox; | 42 | class QCheckBox; |
44 | class QComboBox; | 43 | class QComboBox; |
45 | class QLabel; | 44 | class QLabel; |
46 | class QLineEdit; | 45 | class QLineEdit; |
47 | class QListView; | 46 | class QListView; |
48 | class QMultiLineEdit; | 47 | class QMultiLineEdit; |
49 | class QString; | 48 | class QString; |
50 | class TranInfo; | 49 | class TranInfo; |
51 | class TranInfoList; | 50 | class TranInfoList; |
52 | class Cfg; | 51 | class Cfg; |
53 | class QMouseEvent; | 52 | class QMouseEvent; |
54 | 53 | ||
55 | 54 | ||
56 | // --- Checkbook -------------------------------------------------------------- | 55 | // --- Checkbook -------------------------------------------------------------- |
57 | class Checkbook : public QDialog | 56 | class Checkbook : public QDialog |
58 | { | 57 | { |
59 | Q_OBJECT | 58 | Q_OBJECT |
60 | 59 | ||
61 | public: | 60 | public: |
62 | Checkbook( QWidget *, CBInfo *, Cfg *cfg ); | 61 | Checkbook( QWidget *, CBInfo *, Cfg *cfg ); |
63 | ~Checkbook(); | 62 | ~Checkbook(); |
64 | 63 | ||
65 | // resort | 64 | // resort |
66 | void resort(); | 65 | void resort(); |
67 | 66 | ||
68 | // members | 67 | // members |
69 | TranInfoList *getTranList() { return(tranList); } | 68 | TranInfoList *getTranList() { return(tranList); } |
70 | 69 | ||
71 | private: | 70 | private: |
72 | CBInfo *info; | 71 | CBInfo *info; |
73 | TranInfoList *tranList; | 72 | TranInfoList *tranList; |
74 | Cfg *_pCfg; | 73 | Cfg *_pCfg; |
75 | 74 | ||
76 | OTabWidget *mainWidget; | 75 | Opie::Ui::OTabWidget *mainWidget; |
77 | void loadCheckbook(); | 76 | void loadCheckbook(); |
78 | void adjustBalance(); | 77 | void adjustBalance(); |
79 | 78 | ||
80 | // Info tab | 79 | // Info tab |
81 | QWidget *initInfo(); | 80 | QWidget *initInfo(); |
82 | QCheckBox *passwordCB; | 81 | QCheckBox *passwordCB; |
83 | QLineEdit *nameEdit; | 82 | QLineEdit *nameEdit; |
84 | QComboBox *typeList; | 83 | QComboBox *typeList; |
85 | QLineEdit *bankEdit; | 84 | QLineEdit *bankEdit; |
86 | QLineEdit *acctNumEdit; | 85 | QLineEdit *acctNumEdit; |
87 | QLineEdit *pinNumEdit; | 86 | QLineEdit *pinNumEdit; |
88 | QLineEdit *balanceEdit; | 87 | QLineEdit *balanceEdit; |
89 | QMultiLineEdit *notesEdit; | 88 | QMultiLineEdit *notesEdit; |
90 | int _sortCol; | 89 | int _sortCol; |
91 | 90 | ||
92 | // Transactions tab | 91 | // Transactions tab |
93 | QWidget *initTransactions(); | 92 | QWidget *initTransactions(); |
94 | QListView *tranTable; | 93 | QListView *tranTable; |
95 | QComboBox *_cbSortType; | 94 | QComboBox *_cbSortType; |
96 | QDate _dLastNew; | 95 | QDate _dLastNew; |
97 | 96 | ||
98 | // Charts tab | 97 | // Charts tab |
99 | QWidget *initCharts(); | 98 | QWidget *initCharts(); |
100 | GraphInfo *graphInfo; | 99 | GraphInfo *graphInfo; |
101 | QComboBox *graphList; | 100 | QComboBox *graphList; |
102 | Graph *graphWidget; | 101 | Graph *graphWidget; |
103 | 102 | ||
104 | void drawBalanceChart(); | 103 | void drawBalanceChart(); |
105 | void drawCategoryChart( bool = TRUE ); | 104 | void drawCategoryChart( bool = TRUE ); |
106 | 105 | ||
107 | 106 | ||
108 | protected slots: | 107 | protected slots: |
diff --git a/noncore/apps/checkbook/main.cpp b/noncore/apps/checkbook/main.cpp index 0384620..1135bee 100644 --- a/noncore/apps/checkbook/main.cpp +++ b/noncore/apps/checkbook/main.cpp | |||
@@ -1,33 +1,35 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. | 3 | =. |
4 | .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> | 4 | .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This file is free software; you can | 6 | _;:, .> :=|. This file is free software; you can |
7 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
9 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
10 | - . .-<_> .<> Foundation; either version 2 of the License, | 10 | - . .-<_> .<> Foundation; either version 2 of the License, |
11 | ._= =} : or (at your option) any later version. | 11 | ._= =} : or (at your option) any later version. |
12 | .%`+i> _;_. | 12 | .%`+i> _;_. |
13 | .i_,=:_. -<s. This file is distributed in the hope that | 13 | .i_,=:_. -<s. This file is distributed in the hope that |
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
15 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
18 | ..}^=.= = ; Public License for more details. | 18 | ..}^=.= = ; Public License for more details. |
19 | ++= -. .` .: | 19 | ++= -. .` .: |
20 | : = ...= . :.=- You should have received a copy of the GNU | 20 | : = ...= . :.=- You should have received a copy of the GNU |
21 | -. .:....=;==+<; General Public License along with this file; | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <opie2/oapplicationfactory.h> | 29 | #include <opie2/oapplicationfactory.h> |
30 | 30 | ||
31 | using namespace Opie::Core; | ||
32 | using namespace Opie::Core; | ||
31 | #include "mainwindow.h" | 33 | #include "mainwindow.h" |
32 | 34 | ||
33 | OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) | 35 | OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) |
diff --git a/noncore/apps/checkbook/mainwindow.cpp b/noncore/apps/checkbook/mainwindow.cpp index 254ce6a..ce15e3e 100644 --- a/noncore/apps/checkbook/mainwindow.cpp +++ b/noncore/apps/checkbook/mainwindow.cpp | |||
@@ -6,65 +6,65 @@ | |||
6 | _;:, .> :=|. This file is free software; you can | 6 | _;:, .> :=|. This file is free software; you can |
7 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
9 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
10 | - . .-<_> .<> Foundation; either version 2 of the License, | 10 | - . .-<_> .<> Foundation; either version 2 of the License, |
11 | ._= =} : or (at your option) any later version. | 11 | ._= =} : or (at your option) any later version. |
12 | .%`+i> _;_. | 12 | .%`+i> _;_. |
13 | .i_,=:_. -<s. This file is distributed in the hope that | 13 | .i_,=:_. -<s. This file is distributed in the hope that |
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
15 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
18 | ..}^=.= = ; Public License for more details. | 18 | ..}^=.= = ; Public License for more details. |
19 | ++= -. .` .: | 19 | ++= -. .` .: |
20 | : = ...= . :.=- You should have received a copy of the GNU | 20 | : = ...= . :.=- You should have received a copy of the GNU |
21 | -. .:....=;==+<; General Public License along with this file; | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "mainwindow.h" | 29 | #include "mainwindow.h" |
30 | #include "cbinfo.h" | 30 | #include "cbinfo.h" |
31 | #include "configuration.h" | 31 | #include "configuration.h" |
32 | #include "password.h" | 32 | #include "password.h" |
33 | #include "checkbook.h" | 33 | #include "checkbook.h" |
34 | 34 | ||
35 | #include <qpe/config.h> | 35 | #include <qpe/config.h> |
36 | #include <qpe/qpeapplication.h> | 36 | #include <qpe/qpeapplication.h> |
37 | #include <qpe/qpemessagebox.h> | 37 | #include <qpe/qpemessagebox.h> |
38 | #include <qpe/qpetoolbar.h> | 38 | #include <qtoolbar.h> |
39 | #include <qpe/resource.h> | 39 | #include <qpe/resource.h> |
40 | 40 | ||
41 | #include <qmenubar.h> | 41 | #include <qmenubar.h> |
42 | #include <qaction.h> | 42 | #include <qaction.h> |
43 | #include <qdir.h> | 43 | #include <qdir.h> |
44 | #include <qwhatsthis.h> | 44 | #include <qwhatsthis.h> |
45 | 45 | ||
46 | 46 | ||
47 | MainWindow::MainWindow( QWidget* parent, const char* name, WFlags /*fl*/ ) | 47 | MainWindow::MainWindow( QWidget* parent, const char* name, WFlags /*fl*/ ) |
48 | : QMainWindow( parent, name, WStyle_ContextHelp ) | 48 | : QMainWindow( parent, name, WStyle_ContextHelp ) |
49 | { | 49 | { |
50 | setCaption( tr( "Checkbook" ) ); | 50 | setCaption( tr( "Checkbook" ) ); |
51 | 51 | ||
52 | cbDir = Global::applicationFileName( "checkbook", "" ); | 52 | cbDir = Global::applicationFileName( "checkbook", "" ); |
53 | lockIcon = Resource::loadPixmap( "locked" ); | 53 | lockIcon = Resource::loadPixmap( "locked" ); |
54 | 54 | ||
55 | // Load configuration options | 55 | // Load configuration options |
56 | Config config( "checkbook" ); | 56 | Config config( "checkbook" ); |
57 | _cfg.readConfig( config ); | 57 | _cfg.readConfig( config ); |
58 | 58 | ||
59 | 59 | ||
60 | // Build menu and tool bars | 60 | // Build menu and tool bars |
61 | setToolBarsMovable( FALSE ); | 61 | setToolBarsMovable( FALSE ); |
62 | 62 | ||
63 | QToolBar *bar = new QToolBar( this ); | 63 | QToolBar *bar = new QToolBar( this ); |
64 | bar->setHorizontalStretchable( TRUE ); | 64 | bar->setHorizontalStretchable( TRUE ); |
65 | QMenuBar *mb = new QMenuBar( bar ); | 65 | QMenuBar *mb = new QMenuBar( bar ); |
66 | mb->setMargin( 0 ); | 66 | mb->setMargin( 0 ); |
67 | QPopupMenu *popup = new QPopupMenu( this ); | 67 | QPopupMenu *popup = new QPopupMenu( this ); |
68 | 68 | ||
69 | bar = new QToolBar( this ); | 69 | bar = new QToolBar( this ); |
70 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); | 70 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); |
diff --git a/noncore/apps/confedit/main.cpp b/noncore/apps/confedit/main.cpp index 584e6b2..3a010dd 100644 --- a/noncore/apps/confedit/main.cpp +++ b/noncore/apps/confedit/main.cpp | |||
@@ -1,5 +1,6 @@ | |||
1 | |||
2 | #include "mainwindow.h" | 1 | #include "mainwindow.h" |
3 | #include <opie2/oapplicationfactory.h> | 2 | #include <opie2/oapplicationfactory.h> |
4 | 3 | ||
4 | using namespace Opie::Core; | ||
5 | |||
5 | OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) | 6 | OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) |
diff --git a/noncore/apps/odict/main.cpp b/noncore/apps/odict/main.cpp index d5b08d3..7729d5f 100644 --- a/noncore/apps/odict/main.cpp +++ b/noncore/apps/odict/main.cpp | |||
@@ -1,24 +1,26 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | application: : ODict | 2 | application: : ODict |
3 | 3 | ||
4 | begin : December 2002 | 4 | begin : December 2002 |
5 | copyright : ( C ) 2002, 2003 by Carsten Niehaus | 5 | copyright : ( C ) 2002, 2003 by Carsten Niehaus |
6 | email : cniehaus@handhelds.org | 6 | email : cniehaus@handhelds.org |
7 | **************************************************************************/ | 7 | **************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * ( at your option ) any later version. * | 14 | * ( at your option ) any later version. * |
15 | * * | 15 | * * |
16 | **************************************************************************/ | 16 | **************************************************************************/ |
17 | 17 | ||
18 | 18 | ||
19 | #include <opie2/oapplicationfactory.h> | 19 | #include <opie2/oapplicationfactory.h> |
20 | 20 | ||
21 | #include "odict.h" | 21 | #include "odict.h" |
22 | 22 | ||
23 | 23 | ||
24 | using namespace Opie::Core; | ||
25 | using namespace Opie::Core; | ||
24 | OPIE_EXPORT_APP( OApplicationFactory<ODict> ) | 26 | OPIE_EXPORT_APP( OApplicationFactory<ODict> ) |
diff --git a/noncore/apps/odict/searchmethoddlg.cpp b/noncore/apps/odict/searchmethoddlg.cpp index f71cfd8..34e8b16 100644 --- a/noncore/apps/odict/searchmethoddlg.cpp +++ b/noncore/apps/odict/searchmethoddlg.cpp | |||
@@ -1,65 +1,64 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | application: : ODict | 2 | application: : ODict |
3 | 3 | ||
4 | begin : December 2002 | 4 | begin : December 2002 |
5 | copyright : ( C ) 2002, 2003 by Carsten Niehaus | 5 | copyright : ( C ) 2002, 2003 by Carsten Niehaus |
6 | email : cniehaus@handhelds.org | 6 | email : cniehaus@handhelds.org |
7 | **************************************************************************/ | 7 | **************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * ( at your option ) any later version. * | 14 | * ( at your option ) any later version. * |
15 | * * | 15 | * * |
16 | **************************************************************************/ | 16 | **************************************************************************/ |
17 | #include "searchmethoddlg.h" | 17 | #include "searchmethoddlg.h" |
18 | 18 | ||
19 | #include <opie2/ofileselector.h> | 19 | #include <opie2/ofileselector.h> |
20 | #include <opie2/ofiledialog.h> | 20 | #include <opie2/ofiledialog.h> |
21 | 21 | ||
22 | #include <qpe/config.h> | 22 | #include <qpe/config.h> |
23 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | 24 | ||
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include <qvbox.h> | 26 | #include <qvbox.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
29 | #include <qlineedit.h> | 29 | #include <qlineedit.h> |
30 | #include <qdir.h> | 30 | #include <qdir.h> |
31 | 31 | ||
32 | using Opie::OFileDialog; | 32 | using namespace Opie::Ui; |
33 | using Opie::OFileSelector; | ||
34 | 33 | ||
35 | SearchMethodDlg::SearchMethodDlg(QWidget *parent, const char *name, bool modal, QString itemname) : QDialog(parent, name, modal) | 34 | SearchMethodDlg::SearchMethodDlg(QWidget *parent, const char *name, bool modal, QString itemname) : QDialog(parent, name, modal) |
36 | { | 35 | { |
37 | 36 | ||
38 | QVBoxLayout *vbox_layout = new QVBoxLayout( this, 4,4,"vbox_layout" ); | 37 | QVBoxLayout *vbox_layout = new QVBoxLayout( this, 4,4,"vbox_layout" ); |
39 | QVBox *vbox = new QVBox( this ); | 38 | QVBox *vbox = new QVBox( this ); |
40 | 39 | ||
41 | QHBox *hbox1 = new QHBox( vbox ); | 40 | QHBox *hbox1 = new QHBox( vbox ); |
42 | QLabel *nameLabel = new QLabel( tr( "Name:" ) , hbox1 ); | 41 | QLabel *nameLabel = new QLabel( tr( "Name:" ) , hbox1 ); |
43 | nameLE = new QLineEdit( hbox1 ); | 42 | nameLE = new QLineEdit( hbox1 ); |
44 | 43 | ||
45 | QLabel *dictLabel = new QLabel( tr( "Dictionary file" ), vbox ); | 44 | QLabel *dictLabel = new QLabel( tr( "Dictionary file" ), vbox ); |
46 | QHBox *hbox2 = new QHBox( vbox ); | 45 | QHBox *hbox2 = new QHBox( vbox ); |
47 | dictFileLE = new QLineEdit( hbox2 ); | 46 | dictFileLE = new QLineEdit( hbox2 ); |
48 | QPushButton *browseButton = new QPushButton( tr( "Browse" ) , hbox2 ); | 47 | QPushButton *browseButton = new QPushButton( tr( "Browse" ) , hbox2 ); |
49 | connect( browseButton, SIGNAL( clicked() ), this, SLOT( slotBrowse() ) ); | 48 | connect( browseButton, SIGNAL( clicked() ), this, SLOT( slotBrowse() ) ); |
50 | 49 | ||
51 | QWidget *dummywidget = new QWidget( vbox ); | 50 | QWidget *dummywidget = new QWidget( vbox ); |
52 | QLabel *lag1 = new QLabel( tr( "Language 1" ),dummywidget); | 51 | QLabel *lag1 = new QLabel( tr( "Language 1" ),dummywidget); |
53 | QLabel *devider = new QLabel( tr( "Decollator" ),dummywidget); | 52 | QLabel *devider = new QLabel( tr( "Decollator" ),dummywidget); |
54 | QLabel *lag2 = new QLabel( tr( "Language 2" ),dummywidget); | 53 | QLabel *lag2 = new QLabel( tr( "Language 2" ),dummywidget); |
55 | lang1 = new QLineEdit( dummywidget ); | 54 | lang1 = new QLineEdit( dummywidget ); |
56 | lang2 = new QLineEdit( dummywidget ); | 55 | lang2 = new QLineEdit( dummywidget ); |
57 | trenner = new QLineEdit( dummywidget ); | 56 | trenner = new QLineEdit( dummywidget ); |
58 | trenner->setText( "::" ); | 57 | trenner->setText( "::" ); |
59 | 58 | ||
60 | QGridLayout *grid = new QGridLayout( dummywidget, 2,3 ); | 59 | QGridLayout *grid = new QGridLayout( dummywidget, 2,3 ); |
61 | grid->addWidget( lag1, 0,0 ); | 60 | grid->addWidget( lag1, 0,0 ); |
62 | grid->addWidget( devider, 0,1 ); | 61 | grid->addWidget( devider, 0,1 ); |
63 | grid->addWidget( lag2, 0,2 ); | 62 | grid->addWidget( lag2, 0,2 ); |
64 | grid->addWidget( lang1, 1,0 ); | 63 | grid->addWidget( lang1, 1,0 ); |
65 | grid->addWidget( trenner, 1,1 ); | 64 | grid->addWidget( trenner, 1,1 ); |
diff --git a/noncore/apps/opie-bartender/bartender.cpp b/noncore/apps/opie-bartender/bartender.cpp index b6401ed..e6cb515 100644 --- a/noncore/apps/opie-bartender/bartender.cpp +++ b/noncore/apps/opie-bartender/bartender.cpp | |||
@@ -1,51 +1,51 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** | 2 | ** |
3 | ** Created: Sat Jul 20 08:10:53 2002 | 3 | ** Created: Sat Jul 20 08:10:53 2002 |
4 | ** by: L.J. Potter <ljp@llornkcor.com> | 4 | ** by: L.J. Potter <ljp@llornkcor.com> |
5 | ** copyright : (C) 2002 by ljp | 5 | ** copyright : (C) 2002 by ljp |
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 | 12 | ||
13 | #include "bartender.h" | 13 | #include "bartender.h" |
14 | #include "showdrinks.h" | 14 | #include "showdrinks.h" |
15 | #include "inputDialog.h" | 15 | #include "inputDialog.h" |
16 | #include "searchresults.h" | 16 | #include "searchresults.h" |
17 | #include "bac.h" | 17 | #include "bac.h" |
18 | 18 | ||
19 | #include <qpe/qpetoolbar.h> | 19 | #include <qtoolbar.h> |
20 | #include <qmenubar.h> | 20 | #include <qmenubar.h> |
21 | //#include <opie2/colorpopupmenu.h> | 21 | //#include <opie2/colorpopupmenu.h> |
22 | #include <qpe/qpeapplication.h> | 22 | #include <qpe/qpeapplication.h> |
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | 24 | ||
25 | #include <qlineedit.h> | 25 | #include <qlineedit.h> |
26 | #include <qdir.h> | 26 | #include <qdir.h> |
27 | #include <qpushbutton.h> | 27 | #include <qpushbutton.h> |
28 | #include <qlistbox.h> | 28 | #include <qlistbox.h> |
29 | #include <qmultilineedit.h> | 29 | #include <qmultilineedit.h> |
30 | #include <qmessagebox.h> | 30 | #include <qmessagebox.h> |
31 | #include <qtextstream.h> | 31 | #include <qtextstream.h> |
32 | #include <qaction.h> | 32 | #include <qaction.h> |
33 | #include <qheader.h> | 33 | #include <qheader.h> |
34 | #include <qlistview.h> | 34 | #include <qlistview.h> |
35 | #include <qlayout.h> | 35 | #include <qlayout.h> |
36 | 36 | ||
37 | #include <fcntl.h> | 37 | #include <fcntl.h> |
38 | #include <unistd.h> | 38 | #include <unistd.h> |
39 | #include <stdlib.h> | 39 | #include <stdlib.h> |
40 | #include <stdio.h> | 40 | #include <stdio.h> |
41 | #include <errno.h> | 41 | #include <errno.h> |
42 | 42 | ||
43 | 43 | ||
44 | Bartender::Bartender( QWidget* parent, const char* name, WFlags fl ) | 44 | Bartender::Bartender( QWidget* parent, const char* name, WFlags fl ) |
45 | : QMainWindow( parent, name, fl ) { | 45 | : QMainWindow( parent, name, fl ) { |
46 | if ( !name ) | 46 | if ( !name ) |
47 | setName( "Bartender" ); | 47 | setName( "Bartender" ); |
48 | QGridLayout *layout = new QGridLayout( this ); | 48 | QGridLayout *layout = new QGridLayout( this ); |
49 | layout->setSpacing( 2); | 49 | layout->setSpacing( 2); |
50 | layout->setMargin( 2); | 50 | layout->setMargin( 2); |
51 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 51 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp index 1a8c979..35a328f 100644 --- a/noncore/apps/opie-console/io_bt.cpp +++ b/noncore/apps/opie-console/io_bt.cpp | |||
@@ -1,71 +1,73 @@ | |||
1 | 1 | ||
2 | #include "io_bt.h" | 2 | #include "io_bt.h" |
3 | 3 | ||
4 | using namespace Opie::Core; | ||
5 | using namespace Opie::Core; | ||
4 | IOBt::IOBt( const Profile &config ) : IOSerial( config ) { | 6 | IOBt::IOBt( const Profile &config ) : IOSerial( config ) { |
5 | m_attach = 0; | 7 | m_attach = 0; |
6 | } | 8 | } |
7 | 9 | ||
8 | 10 | ||
9 | IOBt::~IOBt() { | 11 | IOBt::~IOBt() { |
10 | if ( m_attach ) { | 12 | if ( m_attach ) { |
11 | delete m_attach; | 13 | delete m_attach; |
12 | } | 14 | } |
13 | } | 15 | } |
14 | 16 | ||
15 | 17 | ||
16 | void IOBt::close() { | 18 | void IOBt::close() { |
17 | 19 | ||
18 | IOSerial::close(); | 20 | IOSerial::close(); |
19 | // still need error handling | 21 | // still need error handling |
20 | if ( m_attach ) { | 22 | if ( m_attach ) { |
21 | delete m_attach; | 23 | delete m_attach; |
22 | m_attach = 0; | 24 | m_attach = 0; |
23 | } | 25 | } |
24 | } | 26 | } |
25 | 27 | ||
26 | bool IOBt::open() { | 28 | bool IOBt::open() { |
27 | bool ret = false; | 29 | bool ret = false; |
28 | 30 | ||
29 | // only set up bt stuff if mac address was set, otherwise use the device set | 31 | // only set up bt stuff if mac address was set, otherwise use the device set |
30 | if ( !m_mac.isEmpty() ) { | 32 | if ( !m_mac.isEmpty() ) { |
31 | 33 | ||
32 | // now it should also be checked, if there is a connection to the device with that mac allready | 34 | // now it should also be checked, if there is a connection to the device with that mac allready |
33 | // hciattach here | 35 | // hciattach here |
34 | m_attach = new OProcess(); | 36 | m_attach = new OProcess(); |
35 | *m_attach << "hciattach /dev/ttyS2 any 57600"; | 37 | *m_attach << "hciattach /dev/ttyS2 any 57600"; |
36 | 38 | ||
37 | // then start hcid, then rcfomm handling (m_mac) | 39 | // then start hcid, then rcfomm handling (m_mac) |
38 | 40 | ||
39 | connect( m_attach, SIGNAL( processExited(OProcess*) ), | 41 | connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ), |
40 | this, SLOT( slotExited(OProcess*) ) ); | 42 | this, SLOT( slotExited(OProcess*) ) ); |
41 | 43 | ||
42 | if ( m_attach->start() ) { | 44 | if ( m_attach->start() ) { |
43 | ret = IOSerial::open(); | 45 | ret = IOSerial::open(); |
44 | } else { | 46 | } else { |
45 | qWarning("could not attach to device"); | 47 | qWarning("could not attach to device"); |
46 | delete m_attach; | 48 | delete m_attach; |
47 | m_attach = 0; | 49 | m_attach = 0; |
48 | } | 50 | } |
49 | } else { | 51 | } else { |
50 | // directly to the normal serial | 52 | // directly to the normal serial |
51 | // TODO: look first if the connection really exists. ( is set up ) | 53 | // TODO: look first if the connection really exists. ( is set up ) |
52 | 54 | ||
53 | ret =IOSerial::open(); | 55 | ret =IOSerial::open(); |
54 | } | 56 | } |
55 | return ret; | 57 | return ret; |
56 | } | 58 | } |
57 | 59 | ||
58 | void IOBt::reload( const Profile &config ) { | 60 | void IOBt::reload( const Profile &config ) { |
59 | m_device = config.readEntry("Device", BT_DEFAULT_DEVICE); | 61 | m_device = config.readEntry("Device", BT_DEFAULT_DEVICE); |
60 | m_mac = config.readEntry("Mac", BT_DEFAULT_MAC); | 62 | m_mac = config.readEntry("Mac", BT_DEFAULT_MAC); |
61 | m_baud = config.readNumEntry("Baud", BT_DEFAULT_BAUD); | 63 | m_baud = config.readNumEntry("Baud", BT_DEFAULT_BAUD); |
62 | m_parity = config.readNumEntry("Parity", BT_DEFAULT_PARITY); | 64 | m_parity = config.readNumEntry("Parity", BT_DEFAULT_PARITY); |
63 | m_dbits = config.readNumEntry("DataBits", BT_DEFAULT_DBITS); | 65 | m_dbits = config.readNumEntry("DataBits", BT_DEFAULT_DBITS); |
64 | m_sbits = config.readNumEntry("StopBits", BT_DEFAULT_SBITS); | 66 | m_sbits = config.readNumEntry("StopBits", BT_DEFAULT_SBITS); |
65 | m_flow = config.readNumEntry("Flow", BT_DEFAULT_FLOW); | 67 | m_flow = config.readNumEntry("Flow", BT_DEFAULT_FLOW); |
66 | } | 68 | } |
67 | 69 | ||
68 | 70 | ||
69 | QString IOBt::identifier() const { | 71 | QString IOBt::identifier() const { |
70 | return "bluetooth"; | 72 | return "bluetooth"; |
71 | } | 73 | } |
diff --git a/noncore/apps/opie-console/io_bt.h b/noncore/apps/opie-console/io_bt.h index df6dd38..00ca7e5 100644 --- a/noncore/apps/opie-console/io_bt.h +++ b/noncore/apps/opie-console/io_bt.h | |||
@@ -12,40 +12,40 @@ | |||
12 | #define BT_DEFAULT_SBITS 1 | 12 | #define BT_DEFAULT_SBITS 1 |
13 | #define BT_DEFAULT_FLOW 0 | 13 | #define BT_DEFAULT_FLOW 0 |
14 | #define BT_DEFAULT_MAC 0 | 14 | #define BT_DEFAULT_MAC 0 |
15 | 15 | ||
16 | 16 | ||
17 | /* IOSerial implements a RS232 IO Layer */ | 17 | /* IOSerial implements a RS232 IO Layer */ |
18 | 18 | ||
19 | class IOBt : public IOSerial { | 19 | class IOBt : public IOSerial { |
20 | 20 | ||
21 | Q_OBJECT | 21 | Q_OBJECT |
22 | 22 | ||
23 | public: | 23 | public: |
24 | 24 | ||
25 | IOBt(const Profile &); | 25 | IOBt(const Profile &); |
26 | ~IOBt(); | 26 | ~IOBt(); |
27 | 27 | ||
28 | virtual QString identifier() const; | 28 | virtual QString identifier() const; |
29 | virtual QString name() const; | 29 | virtual QString name() const; |
30 | virtual QBitArray supports() const; | 30 | virtual QBitArray supports() const; |
31 | virtual bool isConnected(); | 31 | virtual bool isConnected(); |
32 | 32 | ||
33 | signals: | 33 | signals: |
34 | void received(const QByteArray &); | 34 | void received(const QByteArray &); |
35 | void error(int, const QString &); | 35 | void error(int, const QString &); |
36 | 36 | ||
37 | public slots: | 37 | public slots: |
38 | virtual void send( const QByteArray& ); | 38 | virtual void send( const QByteArray& ); |
39 | virtual bool open(); | 39 | virtual bool open(); |
40 | virtual void close(); | 40 | virtual void close(); |
41 | virtual void reload(const Profile &); | 41 | virtual void reload(const Profile &); |
42 | 42 | ||
43 | private: | 43 | private: |
44 | OProcess *m_attach; | 44 | Opie::Core::OProcess *m_attach; |
45 | QString m_mac; | 45 | QString m_mac; |
46 | private slots: | 46 | private slots: |
47 | void slotExited(OProcess* proc); | 47 | void slotExited(Opie::Core::OProcess* proc); |
48 | 48 | ||
49 | }; | 49 | }; |
50 | 50 | ||
51 | #endif /* OPIE_IO_IRDA */ | 51 | #endif /* OPIE_IO_IRDA */ |
diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp index b281b7d..ba0b0e5 100644 --- a/noncore/apps/opie-console/io_irda.cpp +++ b/noncore/apps/opie-console/io_irda.cpp | |||
@@ -1,62 +1,64 @@ | |||
1 | 1 | ||
2 | #include "io_irda.h" | 2 | #include "io_irda.h" |
3 | 3 | ||
4 | using namespace Opie::Core; | ||
5 | using namespace Opie::Core; | ||
4 | IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { | 6 | IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { |
5 | m_attach = 0; | 7 | m_attach = 0; |
6 | } | 8 | } |
7 | 9 | ||
8 | 10 | ||
9 | IOIrda::~IOIrda() { | 11 | IOIrda::~IOIrda() { |
10 | if ( m_attach ) { | 12 | if ( m_attach ) { |
11 | delete m_attach; | 13 | delete m_attach; |
12 | } | 14 | } |
13 | } | 15 | } |
14 | 16 | ||
15 | 17 | ||
16 | void IOIrda::close() { | 18 | void IOIrda::close() { |
17 | 19 | ||
18 | IOSerial::close(); | 20 | IOSerial::close(); |
19 | // still need error handling | 21 | // still need error handling |
20 | delete m_attach; | 22 | delete m_attach; |
21 | } | 23 | } |
22 | 24 | ||
23 | bool IOIrda::open() { | 25 | bool IOIrda::open() { |
24 | bool ret; | 26 | bool ret; |
25 | 27 | ||
26 | // irdaattach here | 28 | // irdaattach here |
27 | m_attach = new OProcess(); | 29 | m_attach = new OProcess(); |
28 | *m_attach << "irattach /dev/ttyS2 -s"; | 30 | *m_attach << "irattach /dev/ttyS2 -s"; |
29 | 31 | ||
30 | connect( m_attach, SIGNAL( processExited(OProcess*) ), | 32 | connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ), |
31 | this, SLOT( slotExited(OProcess*) ) ); | 33 | this, SLOT( slotExited(OProcess*) ) ); |
32 | 34 | ||
33 | if ( m_attach->start() ) { | 35 | if ( m_attach->start() ) { |
34 | ret= IOSerial::open(); | 36 | ret= IOSerial::open(); |
35 | } else { | 37 | } else { |
36 | // emit error!!! | 38 | // emit error!!! |
37 | qWarning("could not attach to device"); | 39 | qWarning("could not attach to device"); |
38 | delete m_attach; | 40 | delete m_attach; |
39 | m_attach = 0l; | 41 | m_attach = 0l; |
40 | } | 42 | } |
41 | return ret; | 43 | return ret; |
42 | } | 44 | } |
43 | 45 | ||
44 | void IOIrda::reload( const Profile &config ) { | 46 | void IOIrda::reload( const Profile &config ) { |
45 | m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); | 47 | m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); |
46 | m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD); | 48 | m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD); |
47 | m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY); | 49 | m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY); |
48 | m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS); | 50 | m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS); |
49 | m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS); | 51 | m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS); |
50 | m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); | 52 | m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); |
51 | } | 53 | } |
52 | 54 | ||
53 | 55 | ||
54 | QString IOIrda::identifier() const { | 56 | QString IOIrda::identifier() const { |
55 | return "irda"; | 57 | return "irda"; |
56 | } | 58 | } |
57 | 59 | ||
58 | QString IOIrda::name() const { | 60 | QString IOIrda::name() const { |
59 | return "Irda IO Layer"; | 61 | return "Irda IO Layer"; |
60 | } | 62 | } |
61 | 63 | ||
62 | void IOIrda::slotExited(OProcess* proc ){ | 64 | void IOIrda::slotExited(OProcess* proc ){ |
diff --git a/noncore/apps/opie-console/io_irda.h b/noncore/apps/opie-console/io_irda.h index 69bed7d..fb29686 100644 --- a/noncore/apps/opie-console/io_irda.h +++ b/noncore/apps/opie-console/io_irda.h | |||
@@ -10,40 +10,40 @@ | |||
10 | #define IRDA_DEFAULT_PARITY 0 | 10 | #define IRDA_DEFAULT_PARITY 0 |
11 | #define IRDA_DEFAULT_DBITS 8 | 11 | #define IRDA_DEFAULT_DBITS 8 |
12 | #define IRDA_DEFAULT_SBITS 1 | 12 | #define IRDA_DEFAULT_SBITS 1 |
13 | #define IRDA_DEFAULT_FLOW 0 | 13 | #define IRDA_DEFAULT_FLOW 0 |
14 | 14 | ||
15 | /* IOSerial implements a RS232 IO Layer */ | 15 | /* IOSerial implements a RS232 IO Layer */ |
16 | 16 | ||
17 | class IOIrda : public IOSerial { | 17 | class IOIrda : public IOSerial { |
18 | 18 | ||
19 | Q_OBJECT | 19 | Q_OBJECT |
20 | 20 | ||
21 | public: | 21 | public: |
22 | 22 | ||
23 | IOIrda(const Profile &); | 23 | IOIrda(const Profile &); |
24 | ~IOIrda(); | 24 | ~IOIrda(); |
25 | 25 | ||
26 | virtual QString identifier() const; | 26 | virtual QString identifier() const; |
27 | virtual QString name() const; | 27 | virtual QString name() const; |
28 | virtual QBitArray supports() const; | 28 | virtual QBitArray supports() const; |
29 | virtual bool isConnected(); | 29 | virtual bool isConnected(); |
30 | 30 | ||
31 | signals: | 31 | signals: |
32 | void received(const QByteArray &); | 32 | void received(const QByteArray &); |
33 | void error(int, const QString &); | 33 | void error(int, const QString &); |
34 | 34 | ||
35 | public slots: | 35 | public slots: |
36 | virtual void send( const QByteArray& ); | 36 | virtual void send( const QByteArray& ); |
37 | virtual bool open(); | 37 | virtual bool open(); |
38 | virtual void close(); | 38 | virtual void close(); |
39 | virtual void reload(const Profile &); | 39 | virtual void reload(const Profile &); |
40 | 40 | ||
41 | private: | 41 | private: |
42 | OProcess *m_attach; | 42 | Opie::Core::OProcess *m_attach; |
43 | 43 | ||
44 | private slots: | 44 | private slots: |
45 | void slotExited(OProcess* proc); | 45 | void slotExited(Opie::Core::OProcess* proc); |
46 | 46 | ||
47 | }; | 47 | }; |
48 | 48 | ||
49 | #endif /* OPIE_IO_IRDA */ | 49 | #endif /* OPIE_IO_IRDA */ |
diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp index 1ce680a..b74d076 100644 --- a/noncore/apps/opie-console/io_modem.cpp +++ b/noncore/apps/opie-console/io_modem.cpp | |||
@@ -1,37 +1,39 @@ | |||
1 | 1 | ||
2 | #include "io_modem.h" | 2 | #include "io_modem.h" |
3 | 3 | ||
4 | #include "dialer.h" | 4 | #include "dialer.h" |
5 | 5 | ||
6 | using namespace Opie::Core; | ||
7 | using namespace Opie::Core; | ||
6 | IOModem::IOModem( const Profile &profile ) | 8 | IOModem::IOModem( const Profile &profile ) |
7 | : IOSerial( profile ) { | 9 | : IOSerial( profile ) { |
8 | m_profile = profile; | 10 | m_profile = profile; |
9 | } | 11 | } |
10 | 12 | ||
11 | 13 | ||
12 | IOModem::~IOModem() { | 14 | IOModem::~IOModem() { |
13 | 15 | ||
14 | } | 16 | } |
15 | 17 | ||
16 | 18 | ||
17 | void IOModem::close() { | 19 | void IOModem::close() { |
18 | // Hangup, discarding result | 20 | // Hangup, discarding result |
19 | //int fd = rawIO(); | 21 | //int fd = rawIO(); |
20 | internDetach(); | 22 | internDetach(); |
21 | Dialer d(m_profile, m_fd); | 23 | Dialer d(m_profile, m_fd); |
22 | d.setHangupOnly(); | 24 | d.setHangupOnly(); |
23 | //d.exec(); | 25 | //d.exec(); |
24 | internAttach(); | 26 | internAttach(); |
25 | //closeRawIO(fd); | 27 | //closeRawIO(fd); |
26 | 28 | ||
27 | IOSerial::close(); | 29 | IOSerial::close(); |
28 | } | 30 | } |
29 | 31 | ||
30 | bool IOModem::open() { | 32 | bool IOModem::open() { |
31 | bool ret = IOSerial::open(); | 33 | bool ret = IOSerial::open(); |
32 | if(!ret) return false; | 34 | if(!ret) return false; |
33 | 35 | ||
34 | //int fd = rawIO(); | 36 | //int fd = rawIO(); |
35 | internDetach(); | 37 | internDetach(); |
36 | Dialer d(m_profile, m_fd); | 38 | Dialer d(m_profile, m_fd); |
37 | 39 | ||
diff --git a/noncore/apps/opie-console/io_modem.h b/noncore/apps/opie-console/io_modem.h index 96ec3ef..5b99e00 100644 --- a/noncore/apps/opie-console/io_modem.h +++ b/noncore/apps/opie-console/io_modem.h | |||
@@ -38,37 +38,37 @@ class IOModem : public IOSerial { | |||
38 | 38 | ||
39 | Q_OBJECT | 39 | Q_OBJECT |
40 | 40 | ||
41 | public: | 41 | public: |
42 | 42 | ||
43 | IOModem(const Profile &); | 43 | IOModem(const Profile &); |
44 | ~IOModem(); | 44 | ~IOModem(); |
45 | 45 | ||
46 | virtual QString identifier() const; | 46 | virtual QString identifier() const; |
47 | virtual QString name() const; | 47 | virtual QString name() const; |
48 | virtual QBitArray supports() const; | 48 | virtual QBitArray supports() const; |
49 | virtual bool isConnected(); | 49 | virtual bool isConnected(); |
50 | 50 | ||
51 | signals: | 51 | signals: |
52 | void received(const QByteArray &); | 52 | void received(const QByteArray &); |
53 | void error(int, const QString &); | 53 | void error(int, const QString &); |
54 | 54 | ||
55 | public slots: | 55 | public slots: |
56 | virtual void send( const QByteArray& ); | 56 | virtual void send( const QByteArray& ); |
57 | virtual bool open(); | 57 | virtual bool open(); |
58 | virtual void close(); | 58 | virtual void close(); |
59 | virtual void reload(const Profile &); | 59 | virtual void reload(const Profile &); |
60 | 60 | ||
61 | private: | 61 | private: |
62 | 62 | ||
63 | QString m_initString, m_resetString, m_dialPref1, m_dialSuf1, m_dialPref2, | 63 | QString m_initString, m_resetString, m_dialPref1, m_dialSuf1, m_dialPref2, |
64 | m_dialSuf2, m_dialPref3, m_dialSuf3, m_connect, m_hangup, m_cancel; | 64 | m_dialSuf2, m_dialPref3, m_dialSuf3, m_connect, m_hangup, m_cancel; |
65 | int m_dialTime, m_delayRedial, m_numberTries, m_dtrDropTime, | 65 | int m_dialTime, m_delayRedial, m_numberTries, m_dtrDropTime, |
66 | m_bpsDetect, m_dcdLines, m_multiLineUntag; | 66 | m_bpsDetect, m_dcdLines, m_multiLineUntag; |
67 | Profile m_profile; | 67 | Profile m_profile; |
68 | 68 | ||
69 | private slots: | 69 | private slots: |
70 | void slotExited(OProcess* proc); | 70 | void slotExited(Opie::Core::OProcess* proc); |
71 | 71 | ||
72 | }; | 72 | }; |
73 | 73 | ||
74 | #endif | 74 | #endif |
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 197f799..06a8f7d 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -1,58 +1,59 @@ | |||
1 | #include <assert.h> | 1 | #include <assert.h> |
2 | 2 | ||
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qmenubar.h> | 4 | #include <qmenubar.h> |
5 | #include <qtoolbar.h> | 5 | #include <qtoolbar.h> |
6 | #include <qmessagebox.h> | 6 | #include <qmessagebox.h> |
7 | #include <qwhatsthis.h> | 7 | #include <qwhatsthis.h> |
8 | #include <qfileinfo.h> | 8 | #include <qfileinfo.h> |
9 | 9 | ||
10 | #include <qpe/filemanager.h> | 10 | #include <qpe/filemanager.h> |
11 | 11 | ||
12 | #include <opie2/ofiledialog.h> | 12 | #include <opie2/ofiledialog.h> |
13 | 13 | ||
14 | #include "TEmulation.h" | 14 | #include "TEmulation.h" |
15 | #include "profileeditordialog.h" | 15 | #include "profileeditordialog.h" |
16 | #include "configdialog.h" | 16 | #include "configdialog.h" |
17 | #include "default.h" | 17 | #include "default.h" |
18 | #include "profilemanager.h" | 18 | #include "profilemanager.h" |
19 | #include "mainwindow.h" | 19 | #include "mainwindow.h" |
20 | #include "tabwidget.h" | 20 | #include "tabwidget.h" |
21 | #include "transferdialog.h" | 21 | #include "transferdialog.h" |
22 | #include "function_keyboard.h" | 22 | #include "function_keyboard.h" |
23 | #include "emulation_handler.h" | 23 | #include "emulation_handler.h" |
24 | #include "script.h" | 24 | #include "script.h" |
25 | 25 | ||
26 | 26 | ||
27 | using namespace Opie::Ui; | ||
27 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { | 28 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { |
28 | KeyTrans::loadAll(); | 29 | KeyTrans::loadAll(); |
29 | for (int i = 0; i < KeyTrans::count(); i++ ) { | 30 | for (int i = 0; i < KeyTrans::count(); i++ ) { |
30 | KeyTrans* s = KeyTrans::find(i ); | 31 | KeyTrans* s = KeyTrans::find(i ); |
31 | assert( s ); | 32 | assert( s ); |
32 | } | 33 | } |
33 | m_factory = new MetaFactory(); | 34 | m_factory = new MetaFactory(); |
34 | Default def(m_factory); | 35 | Default def(m_factory); |
35 | m_sessions.setAutoDelete( TRUE ); | 36 | m_sessions.setAutoDelete( TRUE ); |
36 | m_curSession = 0; | 37 | m_curSession = 0; |
37 | m_manager = new ProfileManager( m_factory ); | 38 | m_manager = new ProfileManager( m_factory ); |
38 | m_manager->load(); | 39 | m_manager->load(); |
39 | m_scriptsData.setAutoDelete(TRUE); | 40 | m_scriptsData.setAutoDelete(TRUE); |
40 | 41 | ||
41 | initUI(); | 42 | initUI(); |
42 | populateProfiles(); | 43 | populateProfiles(); |
43 | populateScripts(); | 44 | populateScripts(); |
44 | } | 45 | } |
45 | 46 | ||
46 | void MainWindow::initUI() { | 47 | void MainWindow::initUI() { |
47 | 48 | ||
48 | setToolBarsMovable( FALSE ); | 49 | setToolBarsMovable( FALSE ); |
49 | 50 | ||
50 | /* tool bar for the menu */ | 51 | /* tool bar for the menu */ |
51 | m_tool = new QToolBar( this ); | 52 | m_tool = new QToolBar( this ); |
52 | m_tool->setHorizontalStretchable( TRUE ); | 53 | m_tool->setHorizontalStretchable( TRUE ); |
53 | 54 | ||
54 | m_bar = new QMenuBar( m_tool ); | 55 | m_bar = new QMenuBar( m_tool ); |
55 | m_console = new QPopupMenu( this ); | 56 | m_console = new QPopupMenu( this ); |
56 | m_scripts = new QPopupMenu( this ); | 57 | m_scripts = new QPopupMenu( this ); |
57 | m_sessionsPop= new QPopupMenu( this ); | 58 | m_sessionsPop= new QPopupMenu( this ); |
58 | m_scriptsPop = new QPopupMenu( this ); | 59 | m_scriptsPop = new QPopupMenu( this ); |
@@ -303,65 +304,65 @@ MetaFactory* MainWindow::factory() { | |||
303 | Session* MainWindow::currentSession() { | 304 | Session* MainWindow::currentSession() { |
304 | return m_curSession; | 305 | return m_curSession; |
305 | } | 306 | } |
306 | 307 | ||
307 | QList<Session> MainWindow::sessions() { | 308 | QList<Session> MainWindow::sessions() { |
308 | return m_sessions; | 309 | return m_sessions; |
309 | } | 310 | } |
310 | 311 | ||
311 | void MainWindow::slotNew() { | 312 | void MainWindow::slotNew() { |
312 | ProfileEditorDialog dlg(factory() ); | 313 | ProfileEditorDialog dlg(factory() ); |
313 | dlg.setCaption( tr("New Connection") ); | 314 | dlg.setCaption( tr("New Connection") ); |
314 | int ret = QPEApplication::execDialog( &dlg ); | 315 | int ret = QPEApplication::execDialog( &dlg ); |
315 | 316 | ||
316 | if ( ret == QDialog::Accepted ) { | 317 | if ( ret == QDialog::Accepted ) { |
317 | create( dlg.profile() ); | 318 | create( dlg.profile() ); |
318 | } | 319 | } |
319 | } | 320 | } |
320 | 321 | ||
321 | void MainWindow::slotRecordScript() { | 322 | void MainWindow::slotRecordScript() { |
322 | if (currentSession()) { | 323 | if (currentSession()) { |
323 | currentSession()->emulationHandler()->startRecording(); | 324 | currentSession()->emulationHandler()->startRecording(); |
324 | m_saveScript->setEnabled(true); | 325 | m_saveScript->setEnabled(true); |
325 | m_recordScript->setEnabled(false); | 326 | m_recordScript->setEnabled(false); |
326 | } | 327 | } |
327 | } | 328 | } |
328 | 329 | ||
329 | void MainWindow::slotSaveScript() { | 330 | void MainWindow::slotSaveScript() { |
330 | if (currentSession() && currentSession()->emulationHandler()->isRecording()) { | 331 | if (currentSession() && currentSession()->emulationHandler()->isRecording()) { |
331 | QMap<QString, QStringList> map; | 332 | QMap<QString, QStringList> map; |
332 | QStringList text; | 333 | QStringList text; |
333 | text << "text/plain"; | 334 | text << "text/plain"; |
334 | map.insert(tr("Script"), text ); | 335 | map.insert(tr("Script"), text ); |
335 | QString filename = Opie::OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); | 336 | QString filename = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); |
336 | if (!filename.isEmpty()) { | 337 | if (!filename.isEmpty()) { |
337 | QFileInfo info(filename); | 338 | QFileInfo info(filename); |
338 | if (info.extension(FALSE) != "script") | 339 | if (info.extension(FALSE) != "script") |
339 | filename += ".script"; | 340 | filename += ".script"; |
340 | DocLnk nf; | 341 | DocLnk nf; |
341 | nf.setType("text/plain"); | 342 | nf.setType("text/plain"); |
342 | nf.setFile(filename); | 343 | nf.setFile(filename); |
343 | nf.setName(info.fileName()); | 344 | nf.setName(info.fileName()); |
344 | FileManager fm; | 345 | FileManager fm; |
345 | fm.saveFile(nf, currentSession()->emulationHandler()->script()->script()); | 346 | fm.saveFile(nf, currentSession()->emulationHandler()->script()->script()); |
346 | currentSession()->emulationHandler()->clearScript(); | 347 | currentSession()->emulationHandler()->clearScript(); |
347 | m_saveScript->setEnabled(false); | 348 | m_saveScript->setEnabled(false); |
348 | m_recordScript->setEnabled(true); | 349 | m_recordScript->setEnabled(true); |
349 | populateScripts(); | 350 | populateScripts(); |
350 | } | 351 | } |
351 | } | 352 | } |
352 | } | 353 | } |
353 | 354 | ||
354 | void MainWindow::slotRunScript(int id) { | 355 | void MainWindow::slotRunScript(int id) { |
355 | if (currentSession()) { | 356 | if (currentSession()) { |
356 | int index = m_scriptsPop->indexOf(id); | 357 | int index = m_scriptsPop->indexOf(id); |
357 | DocLnk *lnk = m_scriptsData.at(index); | 358 | DocLnk *lnk = m_scriptsData.at(index); |
358 | QString filePath = lnk->file(); | 359 | QString filePath = lnk->file(); |
359 | Script script(filePath); | 360 | Script script(filePath); |
360 | currentSession()->emulationHandler()->runScript(&script); | 361 | currentSession()->emulationHandler()->runScript(&script); |
361 | } | 362 | } |
362 | } | 363 | } |
363 | 364 | ||
364 | void MainWindow::slotConnect() { | 365 | void MainWindow::slotConnect() { |
365 | if ( currentSession() ) { | 366 | if ( currentSession() ) { |
366 | bool ret = currentSession()->layer()->open(); | 367 | bool ret = currentSession()->layer()->open(); |
367 | if(!ret) QMessageBox::warning(currentSession()->widgetStack(), | 368 | if(!ret) QMessageBox::warning(currentSession()->widgetStack(), |
@@ -676,52 +677,52 @@ void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) { | |||
676 | QApplication::sendEvent((QObject *)m_curSession->widget(), &ke); | 677 | QApplication::sendEvent((QObject *)m_curSession->widget(), &ke); |
677 | ke.ignore(); | 678 | ke.ignore(); |
678 | } | 679 | } |
679 | } | 680 | } |
680 | void MainWindow::slotCopy() { | 681 | void MainWindow::slotCopy() { |
681 | if (!currentSession() ) return; | 682 | if (!currentSession() ) return; |
682 | currentSession()->emulationHandler()->copy(); | 683 | currentSession()->emulationHandler()->copy(); |
683 | } | 684 | } |
684 | void MainWindow::slotPaste() { | 685 | void MainWindow::slotPaste() { |
685 | if (!currentSession() ) return; | 686 | if (!currentSession() ) return; |
686 | currentSession()->emulationHandler()->paste(); | 687 | currentSession()->emulationHandler()->paste(); |
687 | } | 688 | } |
688 | 689 | ||
689 | /* | 690 | /* |
690 | * Save the session | 691 | * Save the session |
691 | */ | 692 | */ |
692 | 693 | ||
693 | void MainWindow::slotSaveSession() { | 694 | void MainWindow::slotSaveSession() { |
694 | if (!currentSession() ) { | 695 | if (!currentSession() ) { |
695 | QMessageBox::information(this, tr("Save Connection"), | 696 | QMessageBox::information(this, tr("Save Connection"), |
696 | tr("<qt>There is no Connection.</qt>"), 1 ); | 697 | tr("<qt>There is no Connection.</qt>"), 1 ); |
697 | return; | 698 | return; |
698 | } | 699 | } |
699 | manager()->add( currentSession()->profile() ); | 700 | manager()->add( currentSession()->profile() ); |
700 | manager()->save(); | 701 | manager()->save(); |
701 | populateProfiles(); | 702 | populateProfiles(); |
702 | } | 703 | } |
703 | void MainWindow::slotSaveHistory() { | 704 | void MainWindow::slotSaveHistory() { |
704 | QMap<QString, QStringList> map; | 705 | QMap<QString, QStringList> map; |
705 | QStringList text; | 706 | QStringList text; |
706 | text << "text/plain"; | 707 | text << "text/plain"; |
707 | map.insert(tr("History"), text ); | 708 | map.insert(tr("History"), text ); |
708 | QString filename = Opie::OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); | 709 | QString filename = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); |
709 | if (filename.isEmpty() ) return; | 710 | if (filename.isEmpty() ) return; |
710 | 711 | ||
711 | QFileInfo info(filename); | 712 | QFileInfo info(filename); |
712 | 713 | ||
713 | DocLnk nf; | 714 | DocLnk nf; |
714 | nf.setType("text/plain"); | 715 | nf.setType("text/plain"); |
715 | nf.setFile(filename); | 716 | nf.setFile(filename); |
716 | nf.setName(info.fileName()); | 717 | nf.setName(info.fileName()); |
717 | 718 | ||
718 | 719 | ||
719 | QFile file(filename); | 720 | QFile file(filename); |
720 | file.open(IO_WriteOnly ); | 721 | file.open(IO_WriteOnly ); |
721 | QTextStream str(&file ); | 722 | QTextStream str(&file ); |
722 | if ( currentSession() ) | 723 | if ( currentSession() ) |
723 | currentSession()->emulationHandler()->emulation()->streamHistory(&str); | 724 | currentSession()->emulationHandler()->emulation()->streamHistory(&str); |
724 | 725 | ||
725 | file.close(); | 726 | file.close(); |
726 | nf.writeLink(); | 727 | nf.writeLink(); |
727 | } | 728 | } |
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp index 6e1e23e..dc42d8b 100644 --- a/noncore/apps/opie-console/profileeditordialog.cpp +++ b/noncore/apps/opie-console/profileeditordialog.cpp | |||
@@ -1,43 +1,44 @@ | |||
1 | #include <qlayout.h> | 1 | #include <qlayout.h> |
2 | #include <qlineedit.h> | 2 | #include <qlineedit.h> |
3 | #include <qlabel.h> | 3 | #include <qlabel.h> |
4 | #include <qmessagebox.h> | 4 | #include <qmessagebox.h> |
5 | #include <qcombobox.h> | 5 | #include <qcombobox.h> |
6 | #include <qcheckbox.h> | 6 | #include <qcheckbox.h> |
7 | #include <qscrollview.h> | 7 | #include <qscrollview.h> |
8 | 8 | ||
9 | #include "metafactory.h" | 9 | #include "metafactory.h" |
10 | #include "profileeditordialog.h" | 10 | #include "profileeditordialog.h" |
11 | 11 | ||
12 | using namespace Opie::Ui; | ||
12 | namespace { | 13 | namespace { |
13 | void setCurrent( const QString& str, QComboBox* bo ) { | 14 | void setCurrent( const QString& str, QComboBox* bo ) { |
14 | for (int i = 0; i < bo->count(); i++ ) { | 15 | for (int i = 0; i < bo->count(); i++ ) { |
15 | if ( bo->text(i) == str ) { | 16 | if ( bo->text(i) == str ) { |
16 | bo->setCurrentItem( i ); | 17 | bo->setCurrentItem( i ); |
17 | } | 18 | } |
18 | } | 19 | } |
19 | }; | 20 | }; |
20 | } | 21 | } |
21 | 22 | ||
22 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, | 23 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, |
23 | const Profile& prof ) | 24 | const Profile& prof ) |
24 | : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) | 25 | : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) |
25 | { | 26 | { |
26 | initUI(); | 27 | initUI(); |
27 | 28 | ||
28 | // Apply current profile | 29 | // Apply current profile |
29 | // plugin_plugin->load(profile); | 30 | // plugin_plugin->load(profile); |
30 | // ... (reset profile name line edit etc.) | 31 | // ... (reset profile name line edit etc.) |
31 | } | 32 | } |
32 | 33 | ||
33 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) | 34 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) |
34 | : QDialog(0, 0, TRUE), m_fact( fact ) | 35 | : QDialog(0, 0, TRUE), m_fact( fact ) |
35 | { | 36 | { |
36 | // Default profile | 37 | // Default profile |
37 | m_prof = Profile(tr("New Profile"), "serial", "default", Profile::Black, Profile::White, Profile::VT102); | 38 | m_prof = Profile(tr("New Profile"), "serial", "default", Profile::Black, Profile::White, Profile::VT102); |
38 | 39 | ||
39 | initUI(); | 40 | initUI(); |
40 | 41 | ||
41 | // Apply current profile | 42 | // Apply current profile |
42 | // plugin_plugin->load(profile); | 43 | // plugin_plugin->load(profile); |
43 | } | 44 | } |
diff --git a/noncore/apps/opie-console/profileeditordialog.h b/noncore/apps/opie-console/profileeditordialog.h index 97bd650..e7a88e9 100644 --- a/noncore/apps/opie-console/profileeditordialog.h +++ b/noncore/apps/opie-console/profileeditordialog.h | |||
@@ -24,38 +24,38 @@ public: | |||
24 | const Profile& prof ); | 24 | const Profile& prof ); |
25 | ProfileEditorDialog(MetaFactory* fact ); | 25 | ProfileEditorDialog(MetaFactory* fact ); |
26 | ~ProfileEditorDialog(); | 26 | ~ProfileEditorDialog(); |
27 | Profile profile()const; | 27 | Profile profile()const; |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | public slots: | 31 | public slots: |
32 | void accept(); | 32 | void accept(); |
33 | 33 | ||
34 | private slots: | 34 | private slots: |
35 | void slotConActivated(const QString& ); | 35 | void slotConActivated(const QString& ); |
36 | void slotTermActivated( const QString& ); | 36 | void slotTermActivated( const QString& ); |
37 | void slotKeyActivated(const QString&); | 37 | void slotKeyActivated(const QString&); |
38 | private: | 38 | private: |
39 | void initUI(); | 39 | void initUI(); |
40 | QString profName()const; | 40 | QString profName()const; |
41 | QCString profType()const; | 41 | QCString profType()const; |
42 | 42 | ||
43 | MetaFactory* m_fact; | 43 | MetaFactory* m_fact; |
44 | QHBoxLayout* m_lay; | 44 | QHBoxLayout* m_lay; |
45 | Profile m_prof; | 45 | Profile m_prof; |
46 | 46 | ||
47 | QLineEdit *m_name; | 47 | QLineEdit *m_name; |
48 | QComboBox *m_conCmb, *m_termCmb; | 48 | QComboBox *m_conCmb, *m_termCmb; |
49 | QCheckBox *m_autoConnect; | 49 | QCheckBox *m_autoConnect; |
50 | 50 | ||
51 | QScrollView *m_svCon, *m_svTerm; | 51 | QScrollView *m_svCon, *m_svTerm; |
52 | 52 | ||
53 | QWidget *m_tabCon, *m_tabTerm, *m_tabKey; | 53 | QWidget *m_tabCon, *m_tabTerm, *m_tabKey; |
54 | ProfileDialogWidget* m_con, *m_term, *m_key; | 54 | ProfileDialogWidget* m_con, *m_term, *m_key; |
55 | QHBoxLayout *m_layCon, *m_layTerm, *m_layKey; | 55 | QHBoxLayout *m_layCon, *m_layTerm, *m_layKey; |
56 | OTabWidget *tabWidget; | 56 | Opie::Ui::OTabWidget *tabWidget; |
57 | QWidget *tabprof; | 57 | QWidget *tabprof; |
58 | int m_showconntab; | 58 | int m_showconntab; |
59 | }; | 59 | }; |
60 | 60 | ||
61 | #endif | 61 | #endif |
diff --git a/noncore/apps/opie-console/sz_transfer.cpp b/noncore/apps/opie-console/sz_transfer.cpp index 2f82417..5958e93 100644 --- a/noncore/apps/opie-console/sz_transfer.cpp +++ b/noncore/apps/opie-console/sz_transfer.cpp | |||
@@ -1,64 +1,66 @@ | |||
1 | 1 | ||
2 | #include "sz_transfer.h" | 2 | #include "sz_transfer.h" |
3 | #include <qfile.h> | 3 | #include <qfile.h> |
4 | #include <stdio.h> | 4 | #include <stdio.h> |
5 | #include <sys/termios.h> | 5 | #include <sys/termios.h> |
6 | 6 | ||
7 | 7 | ||
8 | 8 | ||
9 | using namespace Opie::Core; | ||
10 | using namespace Opie::Core; | ||
9 | SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t) | 11 | SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t) |
10 | { | 12 | { |
11 | } | 13 | } |
12 | 14 | ||
13 | SzTransfer::~SzTransfer() { | 15 | SzTransfer::~SzTransfer() { |
14 | } | 16 | } |
15 | 17 | ||
16 | void SzTransfer::sendFile(const QFile& file) { | 18 | void SzTransfer::sendFile(const QFile& file) { |
17 | 19 | ||
18 | sendFile(file.name()); | 20 | sendFile(file.name()); |
19 | } | 21 | } |
20 | 22 | ||
21 | void SzTransfer::sendFile(const QString& file) { | 23 | void SzTransfer::sendFile(const QString& file) { |
22 | 24 | ||
23 | //setcbreak(2); /* raw no echo */ | 25 | //setcbreak(2); /* raw no echo */ |
24 | 26 | ||
25 | proc = new OProcess; | 27 | proc = new OProcess; |
26 | *proc << "sz"; | 28 | *proc << "sz"; |
27 | *proc << "-v" << "-v" << "-b" << file; | 29 | *proc << "-v" << "-v" << "-b" << file; |
28 | connect(proc, SIGNAL(processExited(OProcess*)), | 30 | connect(proc, SIGNAL(processExited(Opie::Core::OProcess*)), |
29 | this, SLOT(sent())); | 31 | this, SLOT(sent())); |
30 | connect(proc, SIGNAL(receivedStdout(OProcess*,char*,int)), | 32 | connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)), |
31 | this, SLOT(SzReceivedStdout(OProcess*,char*,int))); | 33 | this, SLOT(SzReceivedStdout(OProcess*,char*,int))); |
32 | connect(proc, SIGNAL(receivedStderr(OProcess*,char*,int)), | 34 | connect(proc, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)), |
33 | this, SLOT(SzReceivedStderr(OProcess*,char*,int))); | 35 | this, SLOT(SzReceivedStderr(OProcess*,char*,int))); |
34 | connect(layer(), SIGNAL(received(const QByteArray&)), | 36 | connect(layer(), SIGNAL(received(const QByteArray&)), |
35 | this, SLOT(receivedStdin(const QByteArray&))); | 37 | this, SLOT(receivedStdin(const QByteArray&))); |
36 | proc->start(OProcess::NotifyOnExit, OProcess::All); | 38 | proc->start(OProcess::NotifyOnExit, OProcess::All); |
37 | 39 | ||
38 | } | 40 | } |
39 | 41 | ||
40 | void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { | 42 | void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { |
41 | 43 | ||
42 | qWarning("recieved from sz on stdout %d bytes", buflen); | 44 | qWarning("recieved from sz on stdout %d bytes", buflen); |
43 | 45 | ||
44 | QByteArray data(buflen); | 46 | QByteArray data(buflen); |
45 | data.fill(*buffer, buflen); | 47 | data.fill(*buffer, buflen); |
46 | for (uint i = 0; i < data.count(); i++ ) { | 48 | for (uint i = 0; i < data.count(); i++ ) { |
47 | printf("%c", buffer[i] ); | 49 | printf("%c", buffer[i] ); |
48 | } | 50 | } |
49 | printf("\n"); | 51 | printf("\n"); |
50 | 52 | ||
51 | // send out through the io layer | 53 | // send out through the io layer |
52 | layer()->send(data); | 54 | layer()->send(data); |
53 | } | 55 | } |
54 | 56 | ||
55 | void SzTransfer::SzReceivedStderr(OProcess *, char *buffer, int length) { | 57 | void SzTransfer::SzReceivedStderr(OProcess *, char *buffer, int length) { |
56 | 58 | ||
57 | // parse and show data in a progress dialog/widget | 59 | // parse and show data in a progress dialog/widget |
58 | printf("stderr:\n"); | 60 | printf("stderr:\n"); |
59 | //for (int i = 0; i < length; i++) | 61 | //for (int i = 0; i < length; i++) |
60 | // printf("%c", buffer[i]); | 62 | // printf("%c", buffer[i]); |
61 | //printf("\n"); | 63 | //printf("\n"); |
62 | } | 64 | } |
63 | 65 | ||
64 | void SzTransfer::receivedStdin(const QByteArray &data) { | 66 | void SzTransfer::receivedStdin(const QByteArray &data) { |
diff --git a/noncore/apps/opie-console/sz_transfer.h b/noncore/apps/opie-console/sz_transfer.h index aa97c32..0505215 100644 --- a/noncore/apps/opie-console/sz_transfer.h +++ b/noncore/apps/opie-console/sz_transfer.h | |||
@@ -1,40 +1,40 @@ | |||
1 | #ifndef OPIE_FL_SZ_H | 1 | #ifndef OPIE_FL_SZ_H |
2 | #define OPIE_FL_SZ_H | 2 | #define OPIE_FL_SZ_H |
3 | 3 | ||
4 | #include "file_layer.h" | 4 | #include "file_layer.h" |
5 | #include <opie2/oprocess.h> | 5 | #include <opie2/oprocess.h> |
6 | 6 | ||
7 | class SzTransfer : public FileTransferLayer { | 7 | class SzTransfer : public FileTransferLayer { |
8 | 8 | ||
9 | Q_OBJECT | 9 | Q_OBJECT |
10 | 10 | ||
11 | public: | 11 | public: |
12 | enum Type { | 12 | enum Type { |
13 | SZ=0, | 13 | SZ=0, |
14 | SX, | 14 | SX, |
15 | SY | 15 | SY |
16 | }; | 16 | }; |
17 | 17 | ||
18 | SzTransfer( Type t, IOLayer * ); | 18 | SzTransfer( Type t, IOLayer * ); |
19 | ~SzTransfer(); | 19 | ~SzTransfer(); |
20 | 20 | ||
21 | public slots: | 21 | public slots: |
22 | /** | 22 | /** |
23 | * send a file over the layer | 23 | * send a file over the layer |
24 | */ | 24 | */ |
25 | void sendFile( const QString& file ) ; | 25 | void sendFile( const QString& file ) ; |
26 | void sendFile( const QFile& ); | 26 | void sendFile( const QFile& ); |
27 | void sent(); | 27 | void sent(); |
28 | 28 | ||
29 | private slots: | 29 | private slots: |
30 | void SzReceivedStdout(OProcess *, char *, int); | 30 | void SzReceivedStdout(Opie::Core::OProcess *, char *, int); |
31 | void SzReceivedStderr(OProcess *, char *, int); | 31 | void SzReceivedStderr(Opie::Core::OProcess *, char *, int); |
32 | void receivedStdin(const QByteArray &); | 32 | void receivedStdin(const QByteArray &); |
33 | 33 | ||
34 | private: | 34 | private: |
35 | OProcess *proc; | 35 | Opie::Core::OProcess *proc; |
36 | Type m_t; | 36 | Type m_t; |
37 | 37 | ||
38 | }; | 38 | }; |
39 | 39 | ||
40 | #endif | 40 | #endif |
diff --git a/noncore/apps/opie-console/tabwidget.cpp b/noncore/apps/opie-console/tabwidget.cpp index 419f8ac..6429e3c 100644 --- a/noncore/apps/opie-console/tabwidget.cpp +++ b/noncore/apps/opie-console/tabwidget.cpp | |||
@@ -1,35 +1,36 @@ | |||
1 | 1 | ||
2 | #include "tabwidget.h" | 2 | #include "tabwidget.h" |
3 | 3 | ||
4 | using namespace Opie::Ui; | ||
4 | TabWidget::TabWidget( QWidget* parent, const char* name ) | 5 | TabWidget::TabWidget( QWidget* parent, const char* name ) |
5 | : OTabWidget( parent, name ) { | 6 | : OTabWidget( parent, name ) { |
6 | connect(this, SIGNAL( currentChanged(QWidget*) ), | 7 | connect(this, SIGNAL( currentChanged(QWidget*) ), |
7 | this, SLOT( slotCurChanged(QWidget*) ) ); | 8 | this, SLOT( slotCurChanged(QWidget*) ) ); |
8 | } | 9 | } |
9 | 10 | ||
10 | TabWidget::~TabWidget() { | 11 | TabWidget::~TabWidget() { |
11 | } | 12 | } |
12 | 13 | ||
13 | void TabWidget::add( Session* ses ) { | 14 | void TabWidget::add( Session* ses ) { |
14 | qWarning("session ses " + ses->name() ); | 15 | qWarning("session ses " + ses->name() ); |
15 | if ( !ses->widgetStack() ) return; | 16 | if ( !ses->widgetStack() ) return; |
16 | //reparent( ses->widgetStack(), QPoint() ); | 17 | //reparent( ses->widgetStack(), QPoint() ); |
17 | addTab( ses->widgetStack(), "console/konsole", ses->name() ); | 18 | addTab( ses->widgetStack(), "console/konsole", ses->name() ); |
18 | //addTab( ses->widgetStack(), ses->name() ); | 19 | //addTab( ses->widgetStack(), ses->name() ); |
19 | m_map.insert( ses->widgetStack(), ses ); | 20 | m_map.insert( ses->widgetStack(), ses ); |
20 | } | 21 | } |
21 | 22 | ||
22 | void TabWidget::remove( Session* ses ) { | 23 | void TabWidget::remove( Session* ses ) { |
23 | m_map.remove( ses->widgetStack() ); | 24 | m_map.remove( ses->widgetStack() ); |
24 | removePage( ses->widgetStack() ); | 25 | removePage( ses->widgetStack() ); |
25 | } | 26 | } |
26 | 27 | ||
27 | void TabWidget::slotCurChanged( QWidget* wid ) { | 28 | void TabWidget::slotCurChanged( QWidget* wid ) { |
28 | QMap<QWidget*, Session*>::Iterator it; | 29 | QMap<QWidget*, Session*>::Iterator it; |
29 | it = m_map.find( wid ); | 30 | it = m_map.find( wid ); |
30 | if ( it == m_map.end() ) { | 31 | if ( it == m_map.end() ) { |
31 | return; | 32 | return; |
32 | } | 33 | } |
33 | 34 | ||
34 | emit activated( it.data() ); | 35 | emit activated( it.data() ); |
35 | } | 36 | } |
diff --git a/noncore/apps/opie-console/tabwidget.h b/noncore/apps/opie-console/tabwidget.h index 98450a3..0138645 100644 --- a/noncore/apps/opie-console/tabwidget.h +++ b/noncore/apps/opie-console/tabwidget.h | |||
@@ -1,29 +1,29 @@ | |||
1 | #ifndef OPIE_TAB_WIDGET_H | 1 | #ifndef OPIE_TAB_WIDGET_H |
2 | #define OPIE_TAB_WIDGET_H | 2 | #define OPIE_TAB_WIDGET_H |
3 | 3 | ||
4 | #include <qmap.h> | 4 | #include <qmap.h> |
5 | #include <opie2/otabwidget.h> | 5 | #include <opie2/otabwidget.h> |
6 | 6 | ||
7 | #include "session.h" | 7 | #include "session.h" |
8 | /** | 8 | /** |
9 | * This is our central tab widget | 9 | * This is our central tab widget |
10 | * we can add sessions here | 10 | * we can add sessions here |
11 | */ | 11 | */ |
12 | class TabWidget : public OTabWidget{ | 12 | class TabWidget : public Opie::Ui::OTabWidget{ |
13 | Q_OBJECT | 13 | Q_OBJECT |
14 | public: | 14 | public: |
15 | TabWidget(QWidget *parent, const char* name ); | 15 | TabWidget(QWidget *parent, const char* name ); |
16 | ~TabWidget(); | 16 | ~TabWidget(); |
17 | void add( Session* ); | 17 | void add( Session* ); |
18 | void remove( Session* ); | 18 | void remove( Session* ); |
19 | void setCurrent( Session* ); | 19 | void setCurrent( Session* ); |
20 | 20 | ||
21 | signals: | 21 | signals: |
22 | void activated(Session* ses ); | 22 | void activated(Session* ses ); |
23 | private slots: | 23 | private slots: |
24 | void slotCurChanged( QWidget* wid ); | 24 | void slotCurChanged( QWidget* wid ); |
25 | private: | 25 | private: |
26 | QMap<QWidget*, Session*> m_map; | 26 | QMap<QWidget*, Session*> m_map; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | #endif | 29 | #endif |
diff --git a/noncore/apps/opie-console/test/senderui.cpp b/noncore/apps/opie-console/test/senderui.cpp index b1725db..df27055 100644 --- a/noncore/apps/opie-console/test/senderui.cpp +++ b/noncore/apps/opie-console/test/senderui.cpp | |||
@@ -1,49 +1,51 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | #include <fcntl.h> | 3 | #include <fcntl.h> |
4 | #include <sys/termios.h> | 4 | #include <sys/termios.h> |
5 | 5 | ||
6 | #include <qmultilineedit.h> | 6 | #include <qmultilineedit.h> |
7 | #include <qsocketnotifier.h> | 7 | #include <qsocketnotifier.h> |
8 | 8 | ||
9 | #include "../profile.h" | 9 | #include "../profile.h" |
10 | #include "../io_serial.h" | 10 | #include "../io_serial.h" |
11 | #include "../filetransfer.h" | 11 | #include "../filetransfer.h" |
12 | #include "../filereceive.h" | 12 | #include "../filereceive.h" |
13 | 13 | ||
14 | #include <opie2/oprocess.h> | 14 | #include <opie2/oprocess.h> |
15 | 15 | ||
16 | #include "senderui.h" | 16 | #include "senderui.h" |
17 | 17 | ||
18 | using namespace Opie::Core; | ||
19 | using namespace Opie::Core; | ||
18 | SenderUI::SenderUI() | 20 | SenderUI::SenderUI() |
19 | : Sender() { | 21 | : Sender() { |
20 | 22 | ||
21 | /* we do that manually */ | 23 | /* we do that manually */ |
22 | Profile prof; | 24 | Profile prof; |
23 | QString str = "/dev/bty0"; | 25 | QString str = "/dev/bty0"; |
24 | prof.writeEntry("Device",str ); | 26 | prof.writeEntry("Device",str ); |
25 | prof.writeEntry("Baud", 19200 ); | 27 | prof.writeEntry("Baud", 19200 ); |
26 | 28 | ||
27 | qWarning("prof " + prof.readEntry("Device") + " " + str); | 29 | qWarning("prof " + prof.readEntry("Device") + " " + str); |
28 | ser = new IOSerial(prof); | 30 | ser = new IOSerial(prof); |
29 | connect(ser, SIGNAL(received(const QByteArray&) ), | 31 | connect(ser, SIGNAL(received(const QByteArray&) ), |
30 | this, SLOT(got(const QByteArray&) ) ); | 32 | this, SLOT(got(const QByteArray&) ) ); |
31 | 33 | ||
32 | if ( ser->open() ) | 34 | if ( ser->open() ) |
33 | qWarning("opened!!!"); | 35 | qWarning("opened!!!"); |
34 | else | 36 | else |
35 | qWarning("could not open"); | 37 | qWarning("could not open"); |
36 | 38 | ||
37 | 39 | ||
38 | } | 40 | } |
39 | SenderUI::~SenderUI() { | 41 | SenderUI::~SenderUI() { |
40 | 42 | ||
41 | } | 43 | } |
42 | void SenderUI::slotSendFile() { | 44 | void SenderUI::slotSendFile() { |
43 | 45 | ||
44 | sz = new FileTransfer(FileTransfer::SY, ser); | 46 | sz = new FileTransfer(FileTransfer::SY, ser); |
45 | sz->sendFile("/home/ich/bootopie-v06-13.jffs2"); | 47 | sz->sendFile("/home/ich/bootopie-v06-13.jffs2"); |
46 | 48 | ||
47 | connect (sz, SIGNAL(sent()), | 49 | connect (sz, SIGNAL(sent()), |
48 | this, SLOT(fileTransComplete())); | 50 | this, SLOT(fileTransComplete())); |
49 | } | 51 | } |
diff --git a/noncore/apps/opie-console/test/senderui.h b/noncore/apps/opie-console/test/senderui.h index c130dcf..15f0743 100644 --- a/noncore/apps/opie-console/test/senderui.h +++ b/noncore/apps/opie-console/test/senderui.h | |||
@@ -1,34 +1,34 @@ | |||
1 | #ifndef SENDER_UI_H | 1 | #ifndef SENDER_UI_H |
2 | #define SENDER_UI_H | 2 | #define SENDER_UI_H |
3 | 3 | ||
4 | #include <qcstring.h> | 4 | #include <qcstring.h> |
5 | 5 | ||
6 | #include "sender.h" | 6 | #include "sender.h" |
7 | 7 | ||
8 | class IOSerial; | 8 | class IOSerial; |
9 | class FileTransfer; | 9 | class FileTransfer; |
10 | class QSocketNotifier; | 10 | class QSocketNotifier; |
11 | class OProcess; | 11 | namespace Opie {namespace Core {class Opie::Core::OProcess;}} |
12 | class SenderUI : public Sender { | 12 | class SenderUI : public Sender { |
13 | Q_OBJECT | 13 | Q_OBJECT |
14 | public: | 14 | public: |
15 | SenderUI(); | 15 | SenderUI(); |
16 | ~SenderUI(); | 16 | ~SenderUI(); |
17 | 17 | ||
18 | public slots: | 18 | public slots: |
19 | void send(); | 19 | void send(); |
20 | void slotSendFile(); | 20 | void slotSendFile(); |
21 | void slotSend(); | 21 | void slotSend(); |
22 | void slotRev(); | 22 | void slotRev(); |
23 | void got(const QByteArray& ); | 23 | void got(const QByteArray& ); |
24 | void fileTransComplete(); | 24 | void fileTransComplete(); |
25 | private: | 25 | private: |
26 | IOSerial* ser; | 26 | IOSerial* ser; |
27 | FileTransfer* sz; | 27 | FileTransfer* sz; |
28 | int m_fd; | 28 | int m_fd; |
29 | QSocketNotifier* m_sock; | 29 | QSocketNotifier* m_sock; |
30 | OProcess* m_proc; | 30 | Opie::Core::OProcess* m_proc; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | 33 | ||
34 | #endif | 34 | #endif |
diff --git a/noncore/apps/opie-console/transferdialog.cpp b/noncore/apps/opie-console/transferdialog.cpp index d494a6c..75eb443 100644 --- a/noncore/apps/opie-console/transferdialog.cpp +++ b/noncore/apps/opie-console/transferdialog.cpp | |||
@@ -1,49 +1,50 @@ | |||
1 | #include <qlayout.h> | 1 | #include <qlayout.h> |
2 | #include <qcombobox.h> | 2 | #include <qcombobox.h> |
3 | #include <qlabel.h> | 3 | #include <qlabel.h> |
4 | #include <qlineedit.h> | 4 | #include <qlineedit.h> |
5 | #include <qpushbutton.h> | 5 | #include <qpushbutton.h> |
6 | #include <qmessagebox.h> | 6 | #include <qmessagebox.h> |
7 | #include <qprogressbar.h> | 7 | #include <qprogressbar.h> |
8 | #include <qradiobutton.h> | 8 | #include <qradiobutton.h> |
9 | #include <qbuttongroup.h> | 9 | #include <qbuttongroup.h> |
10 | 10 | ||
11 | #include <opie2/ofiledialog.h> | 11 | #include <opie2/ofiledialog.h> |
12 | 12 | ||
13 | #include "metafactory.h" | 13 | #include "metafactory.h" |
14 | #include "mainwindow.h" | 14 | #include "mainwindow.h" |
15 | 15 | ||
16 | #include "transferdialog.h" | 16 | #include "transferdialog.h" |
17 | 17 | ||
18 | using namespace Opie::Ui; | ||
18 | TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const char *) | 19 | TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const char *) |
19 | : QDialog(parent, 0l, false), m_win(mainwindow) | 20 | : QDialog(parent, 0l, false), m_win(mainwindow) |
20 | { | 21 | { |
21 | m_lay = 0l; | 22 | m_lay = 0l; |
22 | m_recvlay = 0l; | 23 | m_recvlay = 0l; |
23 | QVBoxLayout *vbox, *vbox2; | 24 | QVBoxLayout *vbox, *vbox2; |
24 | QHBoxLayout *hbox, *hbox2, *hbox3; | 25 | QHBoxLayout *hbox, *hbox2, *hbox3; |
25 | QLabel *file, *mode, *progress, *status; | 26 | QLabel *file, *mode, *progress, *status; |
26 | QButtonGroup *group; | 27 | QButtonGroup *group; |
27 | QRadioButton *mode_send, *mode_receive; | 28 | QRadioButton *mode_send, *mode_receive; |
28 | 29 | ||
29 | m_autocleanup = 0; | 30 | m_autocleanup = 0; |
30 | m_running = true; | 31 | m_running = true; |
31 | 32 | ||
32 | group = new QButtonGroup(QObject::tr("Transfer mode"), this); | 33 | group = new QButtonGroup(QObject::tr("Transfer mode"), this); |
33 | mode_send = new QRadioButton(QObject::tr("Send"), group); | 34 | mode_send = new QRadioButton(QObject::tr("Send"), group); |
34 | mode_receive = new QRadioButton(QObject::tr("Receive"), group); | 35 | mode_receive = new QRadioButton(QObject::tr("Receive"), group); |
35 | group->insert(mode_send, id_send); | 36 | group->insert(mode_send, id_send); |
36 | group->insert(mode_receive, id_receive); | 37 | group->insert(mode_receive, id_receive); |
37 | vbox2 = new QVBoxLayout(group, 2); | 38 | vbox2 = new QVBoxLayout(group, 2); |
38 | vbox2->addSpacing(10); | 39 | vbox2->addSpacing(10); |
39 | hbox3 = new QHBoxLayout(vbox2, 2); | 40 | hbox3 = new QHBoxLayout(vbox2, 2); |
40 | hbox3->add(mode_send); | 41 | hbox3->add(mode_send); |
41 | hbox3->add(mode_receive); | 42 | hbox3->add(mode_receive); |
42 | mode_send->setChecked(true); | 43 | mode_send->setChecked(true); |
43 | m_transfermode = id_send; | 44 | m_transfermode = id_send; |
44 | 45 | ||
45 | file = new QLabel(QObject::tr("Send file"), this); | 46 | file = new QLabel(QObject::tr("Send file"), this); |
46 | mode = new QLabel(QObject::tr("Transfer protocol"), this); | 47 | mode = new QLabel(QObject::tr("Transfer protocol"), this); |
47 | progress = new QLabel(QObject::tr("Progress"), this); | 48 | progress = new QLabel(QObject::tr("Progress"), this); |
48 | status = new QLabel(QObject::tr("Status"), this); | 49 | status = new QLabel(QObject::tr("Status"), this); |
49 | 50 | ||
@@ -69,65 +70,65 @@ TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const ch | |||
69 | vbox->add(file); | 70 | vbox->add(file); |
70 | hbox = new QHBoxLayout(vbox, 0); | 71 | hbox = new QHBoxLayout(vbox, 0); |
71 | hbox->add(filename); | 72 | hbox->add(filename); |
72 | hbox->add(selector); | 73 | hbox->add(selector); |
73 | vbox->add(mode); | 74 | vbox->add(mode); |
74 | vbox->add(protocol); | 75 | vbox->add(protocol); |
75 | vbox->add(progress); | 76 | vbox->add(progress); |
76 | vbox->add(progressbar); | 77 | vbox->add(progressbar); |
77 | vbox->add(status); | 78 | vbox->add(status); |
78 | vbox->add(statusbar); | 79 | vbox->add(statusbar); |
79 | vbox->addStretch(1); | 80 | vbox->addStretch(1); |
80 | hbox2 = new QHBoxLayout(vbox, 2); | 81 | hbox2 = new QHBoxLayout(vbox, 2); |
81 | hbox2->add(ok); | 82 | hbox2->add(ok); |
82 | hbox2->add(cancel); | 83 | hbox2->add(cancel); |
83 | 84 | ||
84 | setCaption(QObject::tr("File transfer")); | 85 | setCaption(QObject::tr("File transfer")); |
85 | show(); | 86 | show(); |
86 | 87 | ||
87 | connect(selector, SIGNAL(clicked()), SLOT(slotFilename())); | 88 | connect(selector, SIGNAL(clicked()), SLOT(slotFilename())); |
88 | connect(ok, SIGNAL(clicked()), SLOT(slotTransfer())); | 89 | connect(ok, SIGNAL(clicked()), SLOT(slotTransfer())); |
89 | connect(cancel, SIGNAL(clicked()), SLOT(slotCancel())); | 90 | connect(cancel, SIGNAL(clicked()), SLOT(slotCancel())); |
90 | connect(group, SIGNAL(clicked(int)), SLOT(slotMode(int))); | 91 | connect(group, SIGNAL(clicked(int)), SLOT(slotMode(int))); |
91 | } | 92 | } |
92 | 93 | ||
93 | TransferDialog::~TransferDialog() | 94 | TransferDialog::~TransferDialog() |
94 | { | 95 | { |
95 | } | 96 | } |
96 | 97 | ||
97 | void TransferDialog::slotFilename() | 98 | void TransferDialog::slotFilename() |
98 | { | 99 | { |
99 | QString f; | 100 | QString f; |
100 | 101 | ||
101 | f = Opie::OFileDialog::getOpenFileName(0); | 102 | f = OFileDialog::getOpenFileName(0); |
102 | if(!f.isNull()) filename->setText(f); | 103 | if(!f.isNull()) filename->setText(f); |
103 | } | 104 | } |
104 | 105 | ||
105 | void TransferDialog::slotTransfer() | 106 | void TransferDialog::slotTransfer() |
106 | { | 107 | { |
107 | if((m_transfermode == id_send) && (filename->text().isEmpty())) | 108 | if((m_transfermode == id_send) && (filename->text().isEmpty())) |
108 | { | 109 | { |
109 | QMessageBox::information(this, | 110 | QMessageBox::information(this, |
110 | QObject::tr("Attention"), | 111 | QObject::tr("Attention"), |
111 | QObject::tr("No file has been specified.")); | 112 | QObject::tr("No file has been specified.")); |
112 | return; | 113 | return; |
113 | } | 114 | } |
114 | 115 | ||
115 | ok->setEnabled(false); | 116 | ok->setEnabled(false); |
116 | 117 | ||
117 | cleanup(); | 118 | cleanup(); |
118 | m_autocleanup = 0; | 119 | m_autocleanup = 0; |
119 | 120 | ||
120 | if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending...")); | 121 | if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending...")); |
121 | else statusbar->setText(QObject::tr("Receiving...")); | 122 | else statusbar->setText(QObject::tr("Receiving...")); |
122 | 123 | ||
123 | if(m_transfermode == id_send) | 124 | if(m_transfermode == id_send) |
124 | { | 125 | { |
125 | m_lay = m_win->factory()->newFileTransfer(protocol->currentText(), m_win->currentSession()->layer()); | 126 | m_lay = m_win->factory()->newFileTransfer(protocol->currentText(), m_win->currentSession()->layer()); |
126 | m_lay->sendFile(filename->text()); | 127 | m_lay->sendFile(filename->text()); |
127 | 128 | ||
128 | connect(m_lay, SIGNAL(progress(const QString&,int,int,int,int,int)), | 129 | connect(m_lay, SIGNAL(progress(const QString&,int,int,int,int,int)), |
129 | SLOT(slotProgress(const QString&,int,int,int,int,int))); | 130 | SLOT(slotProgress(const QString&,int,int,int,int,int))); |
130 | connect(m_lay, SIGNAL(error(int,const QString&)), SLOT(slotError(int,const QString&))); | 131 | connect(m_lay, SIGNAL(error(int,const QString&)), SLOT(slotError(int,const QString&))); |
131 | connect(m_lay, SIGNAL(sent()), SLOT(slotSent())); | 132 | connect(m_lay, SIGNAL(sent()), SLOT(slotSent())); |
132 | } | 133 | } |
133 | else | 134 | else |
diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp index b0d589e..b072854 100644 --- a/noncore/apps/opie-reader/QTReaderApp.cpp +++ b/noncore/apps/opie-reader/QTReaderApp.cpp | |||
@@ -1,58 +1,58 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. Allrights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. Allrights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qt Palmtop Environment. | 4 | ** This file is part of Qt Palmtop Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "useqpe.h" | 20 | #include "useqpe.h" |
21 | #include <qregexp.h> | 21 | #include <qregexp.h> |
22 | #include <qclipboard.h> | 22 | #include <qclipboard.h> |
23 | #include <qwidgetstack.h> | 23 | #include <qwidgetstack.h> |
24 | #ifdef USEQPE | 24 | #ifdef USEQPE |
25 | #include <qmenubar.h> | 25 | #include <qmenubar.h> |
26 | #include <qpe/qpetoolbar.h> | 26 | #include <qtoolbar.h> |
27 | #endif | 27 | #endif |
28 | #include <qmenubar.h> | 28 | #include <qmenubar.h> |
29 | #include <qtoolbar.h> | 29 | #include <qtoolbar.h> |
30 | #ifdef USEQPE | 30 | #ifdef USEQPE |
31 | #include <qpe/menubutton.h> | 31 | #include <qpe/menubutton.h> |
32 | #include <qpe/fontdatabase.h> | 32 | #include <qpe/fontdatabase.h> |
33 | #endif | 33 | #endif |
34 | #include <qcombobox.h> | 34 | #include <qcombobox.h> |
35 | #include <qpopupmenu.h> | 35 | #include <qpopupmenu.h> |
36 | #include <qaction.h> | 36 | #include <qaction.h> |
37 | #include <qapplication.h> | 37 | #include <qapplication.h> |
38 | #include <qlineedit.h> | 38 | #include <qlineedit.h> |
39 | #include <qtoolbutton.h> | 39 | #include <qtoolbutton.h> |
40 | #include <qspinbox.h> | 40 | #include <qspinbox.h> |
41 | #include <qobjectlist.h> | 41 | #include <qobjectlist.h> |
42 | #ifdef USEQPE | 42 | #ifdef USEQPE |
43 | #include <qpe/global.h> | 43 | #include <qpe/global.h> |
44 | #include <qpe/applnk.h> | 44 | #include <qpe/applnk.h> |
45 | #endif | 45 | #endif |
46 | #include <qfileinfo.h> | 46 | #include <qfileinfo.h> |
47 | #include <stdlib.h> //getenv | 47 | #include <stdlib.h> //getenv |
48 | #include <qprogressbar.h> | 48 | #include <qprogressbar.h> |
49 | #ifdef USEQPE | 49 | #ifdef USEQPE |
50 | #include <qpe/config.h> | 50 | #include <qpe/config.h> |
51 | #endif | 51 | #endif |
52 | #include <qbuttongroup.h> | 52 | #include <qbuttongroup.h> |
53 | #include <qradiobutton.h> | 53 | #include <qradiobutton.h> |
54 | #ifdef USEQPE | 54 | #ifdef USEQPE |
55 | #include <qpe/qcopenvelope_qws.h> | 55 | #include <qpe/qcopenvelope_qws.h> |
56 | #endif | 56 | #endif |
57 | #include "QTReader.h" | 57 | #include "QTReader.h" |
58 | #include "GraphicWin.h" | 58 | #include "GraphicWin.h" |
diff --git a/noncore/apps/opie-sheet/main.cpp b/noncore/apps/opie-sheet/main.cpp index c7a7d88..861473e 100644 --- a/noncore/apps/opie-sheet/main.cpp +++ b/noncore/apps/opie-sheet/main.cpp | |||
@@ -1,20 +1,23 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | 9 | ||
10 | /* | 10 | /* |
11 | * Opie Sheet (formerly Sheet/Qt) | 11 | * Opie Sheet (formerly Sheet/Qt) |
12 | * by Serdar Ozler <sozler@sitebest.com> | 12 | * by Serdar Ozler <sozler@sitebest.com> |
13 | */ | 13 | */ |
14 | 14 | ||
15 | |||
15 | #include "mainwindow.h" | 16 | #include "mainwindow.h" |
16 | 17 | ||
17 | #include <opie2/oapplicationfactory.h> | 18 | #include <opie2/oapplicationfactory.h> |
18 | 19 | ||
20 | using namespace Opie::Core; | ||
21 | |||
19 | OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) | 22 | OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) |
20 | 23 | ||
diff --git a/noncore/apps/opie-write/main.cpp b/noncore/apps/opie-write/main.cpp index 6a8aaaa..036fe48 100644 --- a/noncore/apps/opie-write/main.cpp +++ b/noncore/apps/opie-write/main.cpp | |||
@@ -1,28 +1,30 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** Licensees holding valid Qtopia Developer license may use this | 6 | ** Licensees holding valid Qtopia Developer license may use this |
7 | ** file in accordance with the Qtopia Developer License Agreement | 7 | ** file in accordance with the Qtopia Developer License Agreement |
8 | ** provided with the Software. | 8 | ** provided with the Software. |
9 | ** | 9 | ** |
10 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING | 10 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING |
11 | ** THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 11 | ** THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
12 | ** PURPOSE. | 12 | ** PURPOSE. |
13 | ** | 13 | ** |
14 | ** email sales@trolltech.com for information about Qtopia License | 14 | ** email sales@trolltech.com for information about Qtopia License |
15 | ** Agreements. | 15 | ** Agreements. |
16 | ** | 16 | ** |
17 | ** Contact info@trolltech.com if any conditions of this licensing are | 17 | ** Contact info@trolltech.com if any conditions of this licensing are |
18 | ** not clear to you. | 18 | ** not clear to you. |
19 | ** | 19 | ** |
20 | **********************************************************************/ | 20 | **********************************************************************/ |
21 | 21 | ||
22 | |||
22 | #include "mainwindow.h" | 23 | #include "mainwindow.h" |
23 | 24 | ||
24 | #include <opie2/oapplicationfactory.h> | 25 | #include <opie2/oapplicationfactory.h> |
25 | 26 | ||
27 | using namespace Opie::Core; | ||
26 | OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) | 28 | OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) |
27 | 29 | ||
28 | 30 | ||
diff --git a/noncore/apps/oxygen/main.cpp b/noncore/apps/oxygen/main.cpp index 276b90d..e2a602b 100644 --- a/noncore/apps/oxygen/main.cpp +++ b/noncore/apps/oxygen/main.cpp | |||
@@ -1,23 +1,25 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | application: : Oxygen | 2 | application: : Oxygen |
3 | 3 | ||
4 | begin : September 2002 | 4 | begin : September 2002 |
5 | copyright : ( C ) 2002 by Carsten Niehaus | 5 | copyright : ( C ) 2002 by Carsten Niehaus |
6 | email : cniehaus@handhelds.org | 6 | email : cniehaus@handhelds.org |
7 | **************************************************************************/ | 7 | **************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * ( at your option ) any later version. * | 14 | * ( at your option ) any later version. * |
15 | * * | 15 | * * |
16 | **************************************************************************/ | 16 | **************************************************************************/ |
17 | 17 | ||
18 | #include <opie2/oapplicationfactory.h> | 18 | #include <opie2/oapplicationfactory.h> |
19 | 19 | ||
20 | #include "oxygen.h" | 20 | #include "oxygen.h" |
21 | 21 | ||
22 | 22 | ||
23 | using namespace Opie::Core; | ||
24 | using namespace Opie::Core; | ||
23 | OPIE_EXPORT_APP( OApplicationFactory<Oxygen> ) | 25 | OPIE_EXPORT_APP( OApplicationFactory<Oxygen> ) |
diff --git a/noncore/apps/tableviewer/main.cpp b/noncore/apps/tableviewer/main.cpp index 80a76e0..7ef281c 100644 --- a/noncore/apps/tableviewer/main.cpp +++ b/noncore/apps/tableviewer/main.cpp | |||
@@ -1,25 +1,27 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "tableviewer.h" | 20 | #include "tableviewer.h" |
21 | 21 | ||
22 | #include <opie2/oapplicationfactory.h> | 22 | #include <opie2/oapplicationfactory.h> |
23 | 23 | ||
24 | using namespace Opie::Core; | ||
24 | OPIE_EXPORT_APP( OApplicationFactory<TableViewerWindow> ) | 25 | OPIE_EXPORT_APP( OApplicationFactory<TableViewerWindow> ) |
26 | using namespace Opie::Core; | ||
25 | 27 | ||
diff --git a/noncore/apps/tableviewer/tableviewer.cpp b/noncore/apps/tableviewer/tableviewer.cpp index 4c6d809..102b94c 100644 --- a/noncore/apps/tableviewer/tableviewer.cpp +++ b/noncore/apps/tableviewer/tableviewer.cpp | |||
@@ -1,65 +1,65 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | /* local includes */ | 21 | /* local includes */ |
22 | #include "tableviewer.h" | 22 | #include "tableviewer.h" |
23 | #include "ui/tvbrowseview.h" | 23 | #include "ui/tvbrowseview.h" |
24 | #include "ui/tvfilterview.h" | 24 | #include "ui/tvfilterview.h" |
25 | #include "ui/tvlistview.h" | 25 | #include "ui/tvlistview.h" |
26 | #include "ui/tveditview.h" | 26 | #include "ui/tveditview.h" |
27 | #include "ui/tvkeyedit.h" | 27 | #include "ui/tvkeyedit.h" |
28 | #include "db/datacache.h" | 28 | #include "db/datacache.h" |
29 | 29 | ||
30 | /* QPE includes */ | 30 | /* QPE includes */ |
31 | #include <qpe/fileselector.h> | 31 | #include <qpe/fileselector.h> |
32 | #include <qpe/resource.h> | 32 | #include <qpe/resource.h> |
33 | #include <qpe/qpetoolbar.h> | 33 | #include <qtoolbar.h> |
34 | 34 | ||
35 | /* QTE includes */ | 35 | /* QTE includes */ |
36 | #include <qmenubar.h> | 36 | #include <qmenubar.h> |
37 | #include <qpopupmenu.h> | 37 | #include <qpopupmenu.h> |
38 | #include <qapplication.h> | 38 | #include <qapplication.h> |
39 | #include <qwidgetstack.h> | 39 | #include <qwidgetstack.h> |
40 | #include <qlayout.h> | 40 | #include <qlayout.h> |
41 | #include <qbuffer.h> | 41 | #include <qbuffer.h> |
42 | /*! | 42 | /*! |
43 | \class TableViewerWindow | 43 | \class TableViewerWindow |
44 | \brief The main window widget of the application | 44 | \brief The main window widget of the application |
45 | 45 | ||
46 | This is the main widget of the table viewer application. | 46 | This is the main widget of the table viewer application. |
47 | It is the co-ordination point. | 47 | It is the co-ordination point. |
48 | */ | 48 | */ |
49 | 49 | ||
50 | /*! | 50 | /*! |
51 | Constructs a new TableViewerWindow | 51 | Constructs a new TableViewerWindow |
52 | */ | 52 | */ |
53 | TableViewerWindow::TableViewerWindow(QWidget *parent, const char *name, WFlags f) | 53 | TableViewerWindow::TableViewerWindow(QWidget *parent, const char *name, WFlags f) |
54 | : QMainWindow(parent, name, f) | 54 | : QMainWindow(parent, name, f) |
55 | { | 55 | { |
56 | setCaption(tr("Table Viewer")); | 56 | setCaption(tr("Table Viewer")); |
57 | 57 | ||
58 | /* Build data */ | 58 | /* Build data */ |
59 | ds = new DBStore(); | 59 | ds = new DBStore(); |
60 | doc.setType("text/x-xml-tableviewer"); | 60 | doc.setType("text/x-xml-tableviewer"); |
61 | doc.setName("table"); | 61 | doc.setName("table"); |
62 | 62 | ||
63 | dirty = FALSE; | 63 | dirty = FALSE; |
64 | ts.current_column = 0; | 64 | ts.current_column = 0; |
65 | ts.kRep = ds->getKeys(); | 65 | ts.kRep = ds->getKeys(); |
diff --git a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp index 8e68262..c3a0a2e 100644 --- a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp +++ b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp | |||
@@ -18,64 +18,66 @@ | |||
18 | ***************************************************************************/ | 18 | ***************************************************************************/ |
19 | // Dialogs | 19 | // Dialogs |
20 | 20 | ||
21 | #include <stdio.h> | 21 | #include <stdio.h> |
22 | #include <stdlib.h> | 22 | #include <stdlib.h> |
23 | 23 | ||
24 | #include <qgrid.h> | 24 | #include <qgrid.h> |
25 | #include <qlabel.h> | 25 | #include <qlabel.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qlistbox.h> | 27 | #include <qlistbox.h> |
28 | #include <qgroupbox.h> | 28 | #include <qgroupbox.h> |
29 | #include <qlineedit.h> | 29 | #include <qlineedit.h> |
30 | #include <qcheckbox.h> | 30 | #include <qcheckbox.h> |
31 | #include <qcollection.h> | 31 | #include <qcollection.h> |
32 | #include <qpushbutton.h> | 32 | #include <qpushbutton.h> |
33 | #include <qobjectlist.h> | 33 | #include <qobjectlist.h> |
34 | #include <qradiobutton.h> | 34 | #include <qradiobutton.h> |
35 | #include <qwhatsthis.h> | 35 | #include <qwhatsthis.h> |
36 | #include <qstringlist.h> | 36 | #include <qstringlist.h> |
37 | #include <klocale.h> | 37 | #include <klocale.h> |
38 | #include <kcolorbtn.h> | 38 | #include <kcolorbtn.h> |
39 | #include <kglobal.h> | 39 | #include <kglobal.h> |
40 | #include <qvbox.h> | 40 | #include <qvbox.h> |
41 | #include <qspinbox.h> | 41 | #include <qspinbox.h> |
42 | #include <qcombobox.h> | 42 | #include <qcombobox.h> |
43 | #include <kfontdialog.h> | 43 | #include <kfontdialog.h> |
44 | 44 | ||
45 | #include "../document/katedocument.h" | 45 | #include "../document/katedocument.h" |
46 | #include "kateviewdialog.h" | 46 | #include "kateviewdialog.h" |
47 | #include <opie2/ofontselector.h> | 47 | #include <opie2/ofontselector.h> |
48 | 48 | ||
49 | 49 | ||
50 | using namespace Opie::Ui; | ||
51 | using namespace Opie::Ui; | ||
50 | SearchDialog::SearchDialog( QWidget *parent, QStringList &searchFor, QStringList &replaceWith, int flags ) | 52 | SearchDialog::SearchDialog( QWidget *parent, QStringList &searchFor, QStringList &replaceWith, int flags ) |
51 | : KDialogBase( parent, 0L, true, i18n( "Find Text" ), Ok | Cancel, Ok ) | 53 | : KDialogBase( parent, 0L, true, i18n( "Find Text" ), Ok | Cancel, Ok ) |
52 | , m_replace( 0L ) | 54 | , m_replace( 0L ) |
53 | { | 55 | { |
54 | QWidget *page = new QWidget( this ); | 56 | QWidget *page = new QWidget( this ); |
55 | setMainWidget( page ); | 57 | setMainWidget( page ); |
56 | 58 | ||
57 | QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); | 59 | QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); |
58 | 60 | ||
59 | m_search = new QComboBox( true, page ); | 61 | m_search = new QComboBox( true, page ); |
60 | m_search->insertStringList( searchFor ); | 62 | m_search->insertStringList( searchFor ); |
61 | m_search->setMinimumWidth( m_search->sizeHint().width() ); | 63 | m_search->setMinimumWidth( m_search->sizeHint().width() ); |
62 | m_search->lineEdit()->selectAll(); | 64 | m_search->lineEdit()->selectAll(); |
63 | QLabel *label = new QLabel( m_search, i18n( "&Text To Find:" ), page ); | 65 | QLabel *label = new QLabel( m_search, i18n( "&Text To Find:" ), page ); |
64 | m_optRegExp = new QCheckBox( i18n( "Regular Expression" ), page ); | 66 | m_optRegExp = new QCheckBox( i18n( "Regular Expression" ), page ); |
65 | topLayout->addWidget( label ); | 67 | topLayout->addWidget( label ); |
66 | topLayout->addWidget( m_search ); | 68 | topLayout->addWidget( m_search ); |
67 | topLayout->addWidget( m_optRegExp ); | 69 | topLayout->addWidget( m_optRegExp ); |
68 | 70 | ||
69 | if( flags & KateView::sfReplace ) | 71 | if( flags & KateView::sfReplace ) |
70 | { | 72 | { |
71 | // make it a replace dialog | 73 | // make it a replace dialog |
72 | setCaption( i18n( "Replace Text" ) ); | 74 | setCaption( i18n( "Replace Text" ) ); |
73 | m_replace = new QComboBox( true, page ); | 75 | m_replace = new QComboBox( true, page ); |
74 | m_replace->insertStringList( replaceWith ); | 76 | m_replace->insertStringList( replaceWith ); |
75 | m_replace->setMinimumWidth( m_search->sizeHint().width() ); | 77 | m_replace->setMinimumWidth( m_search->sizeHint().width() ); |
76 | label = new QLabel( m_replace, i18n( "&Replace With:" ), page ); | 78 | label = new QLabel( m_replace, i18n( "&Replace With:" ), page ); |
77 | //m_optPlaceholders = new QCheckBox( i18n( "&Use Placeholders" ), page ); | 79 | //m_optPlaceholders = new QCheckBox( i18n( "&Use Placeholders" ), page ); |
78 | topLayout->addWidget( label ); | 80 | topLayout->addWidget( label ); |
79 | topLayout->addWidget( m_replace ); | 81 | topLayout->addWidget( m_replace ); |
80 | //topLayout->addWidget( m_optPlaceholders ); | 82 | //topLayout->addWidget( m_optPlaceholders ); |
81 | } | 83 | } |
diff --git a/noncore/apps/tinykate/libkate/view/kateviewdialog.h b/noncore/apps/tinykate/libkate/view/kateviewdialog.h index 98d8799..d081152 100644 --- a/noncore/apps/tinykate/libkate/view/kateviewdialog.h +++ b/noncore/apps/tinykate/libkate/view/kateviewdialog.h | |||
@@ -155,42 +155,42 @@ class EditConfigTab : public QWidget | |||
155 | 155 | ||
156 | class ColorConfig : public QWidget | 156 | class ColorConfig : public QWidget |
157 | { | 157 | { |
158 | Q_OBJECT | 158 | Q_OBJECT |
159 | 159 | ||
160 | public: | 160 | public: |
161 | 161 | ||
162 | ColorConfig( QWidget *parent = 0, char *name = 0 ); | 162 | ColorConfig( QWidget *parent = 0, char *name = 0 ); |
163 | ~ColorConfig(); | 163 | ~ColorConfig(); |
164 | 164 | ||
165 | void setColors( QColor * ); | 165 | void setColors( QColor * ); |
166 | void getColors( QColor * ); | 166 | void getColors( QColor * ); |
167 | 167 | ||
168 | private: | 168 | private: |
169 | 169 | ||
170 | KColorButton *m_back; | 170 | KColorButton *m_back; |
171 | KColorButton *m_selected; | 171 | KColorButton *m_selected; |
172 | }; | 172 | }; |
173 | 173 | ||
174 | class FontConfig : public QWidget | 174 | class FontConfig : public QWidget |
175 | { | 175 | { |
176 | Q_OBJECT | 176 | Q_OBJECT |
177 | 177 | ||
178 | public: | 178 | public: |
179 | 179 | ||
180 | FontConfig( QWidget *parent = 0, char *name = 0 ); | 180 | FontConfig( QWidget *parent = 0, char *name = 0 ); |
181 | ~FontConfig(); | 181 | ~FontConfig(); |
182 | 182 | ||
183 | void setFont ( const QFont &font ); | 183 | void setFont ( const QFont &font ); |
184 | QFont getFont ( ) { return myFont; }; | 184 | QFont getFont ( ) { return myFont; }; |
185 | 185 | ||
186 | private: | 186 | private: |
187 | Opie::OFontSelector *m_fontselect; | 187 | Opie::Opie::Ui::OFontSelector *m_fontselect; |
188 | // class KFontChooser *m_fontchooser; | 188 | // class KFontChooser *m_fontchooser; |
189 | QFont myFont; | 189 | QFont myFont; |
190 | 190 | ||
191 | private slots: | 191 | private slots: |
192 | void slotFontSelected( const QFont &font ); | 192 | void slotFontSelected( const QFont &font ); |
193 | }; | 193 | }; |
194 | 194 | ||
195 | 195 | ||
196 | #endif //_KWDIALOG_H_ | 196 | #endif //_KWDIALOG_H_ |
diff --git a/noncore/apps/tinykate/main.cpp b/noncore/apps/tinykate/main.cpp index e62930c..c14d10a 100644 --- a/noncore/apps/tinykate/main.cpp +++ b/noncore/apps/tinykate/main.cpp | |||
@@ -1,22 +1,25 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | |||
2 | main.cpp | 3 | main.cpp |
3 | ------------------- | 4 | ------------------- |
4 | begin : November 2002 | 5 | begin : November 2002 |
5 | copyright : (C) 2002 by Joseph Wenninger <jowenn@kde.org> | 6 | copyright : (C) 2002 by Joseph Wenninger <jowenn@kde.org> |
6 | ***************************************************************************/ | 7 | ***************************************************************************/ |
7 | 8 | ||
8 | /*************************************************************************** | 9 | /*************************************************************************** |
9 | * * | 10 | * * |
10 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
11 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
12 | * the Free Software Foundation. * | 13 | * the Free Software Foundation. * |
13 | * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE * | 14 | * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE * |
14 | * * | 15 | * * |
15 | ***************************************************************************/ | 16 | ***************************************************************************/ |
16 | 17 | ||
17 | #include <opie2/oapplicationfactory.h> | 18 | #include <opie2/oapplicationfactory.h> |
18 | 19 | ||
19 | #include "tinykate.h" | 20 | #include "tinykate.h" |
20 | 21 | ||
22 | using namespace Opie::Core; | ||
23 | |||
21 | OPIE_EXPORT_APP( OApplicationFactory<TinyKate> ) | 24 | OPIE_EXPORT_APP( OApplicationFactory<TinyKate> ) |
22 | 25 | ||
diff --git a/noncore/apps/tinykate/tinykate.cpp b/noncore/apps/tinykate/tinykate.cpp index 32c1eab..3c9a637 100644 --- a/noncore/apps/tinykate/tinykate.cpp +++ b/noncore/apps/tinykate/tinykate.cpp | |||
@@ -1,61 +1,62 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | tinykate.cpp | 2 | tinykate.cpp |
3 | Tiny KATE mainwindow | 3 | Tiny KATE mainwindow |
4 | ------------------- | 4 | ------------------- |
5 | begin : November 2002 | 5 | begin : November 2002 |
6 | copyright : (C) 2002 by Joseph Wenninger <jowenn@kde.org> | 6 | copyright : (C) 2002 by Joseph Wenninger <jowenn@kde.org> |
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free softwaSre; you can redistribute it and/or modify * | 11 | * This program is free softwaSre; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation. * | 13 | * the Free Software Foundation. * |
14 | * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE * | 14 | * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | #include <qaction.h> | 17 | #include <qaction.h> |
18 | #include <qtoolbutton.h> | 18 | #include <qtoolbutton.h> |
19 | #include <qmenubar.h> | 19 | #include <qmenubar.h> |
20 | #include <qpe/resource.h> | 20 | #include <qpe/resource.h> |
21 | #include <qpe/qpeapplication.h> | 21 | #include <qpe/qpeapplication.h> |
22 | 22 | ||
23 | #include <opie2/ofiledialog.h> | 23 | #include <opie2/ofiledialog.h> |
24 | 24 | ||
25 | #include "tinykate.h" | 25 | #include "tinykate.h" |
26 | 26 | ||
27 | #include <katedocument.h> | 27 | #include <katedocument.h> |
28 | #include <kglobal.h> | 28 | #include <kglobal.h> |
29 | 29 | ||
30 | using namespace Opie::Ui; | ||
30 | TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | 31 | TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : |
31 | QMainWindow( parent, name, f ) | 32 | QMainWindow( parent, name, f ) |
32 | { | 33 | { |
33 | shutDown=false; | 34 | shutDown=false; |
34 | nextUnnamed=0; | 35 | nextUnnamed=0; |
35 | currentView=0; | 36 | currentView=0; |
36 | viewCount=0; | 37 | viewCount=0; |
37 | setCaption(tr("TinyKATE")); | 38 | setCaption(tr("TinyKATE")); |
38 | KGlobal::setAppName("TinyKATE"); | 39 | KGlobal::setAppName("TinyKATE"); |
39 | 40 | ||
40 | QMenuBar *mb = new QMenuBar( this ); | 41 | QMenuBar *mb = new QMenuBar( this ); |
41 | mb->setMargin( 0 ); | 42 | mb->setMargin( 0 ); |
42 | 43 | ||
43 | tabwidget=new OTabWidget(this); | 44 | tabwidget=new OTabWidget(this); |
44 | setCentralWidget(tabwidget); | 45 | setCentralWidget(tabwidget); |
45 | connect(tabwidget,SIGNAL(currentChanged(QWidget*)),this,SLOT(slotCurrentChanged(QWidget*))); | 46 | connect(tabwidget,SIGNAL(currentChanged(QWidget*)),this,SLOT(slotCurrentChanged(QWidget*))); |
46 | 47 | ||
47 | //FILE ACTIONS | 48 | //FILE ACTIONS |
48 | QPopupMenu *popup = new QPopupMenu( this ); | 49 | QPopupMenu *popup = new QPopupMenu( this ); |
49 | 50 | ||
50 | // Action for creating a new document | 51 | // Action for creating a new document |
51 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); | 52 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); |
52 | a->addTo( popup ); | 53 | a->addTo( popup ); |
53 | connect(a, SIGNAL(activated()), this, SLOT(slotNew())); | 54 | connect(a, SIGNAL(activated()), this, SLOT(slotNew())); |
54 | 55 | ||
55 | // Action for opening an exisiting document | 56 | // Action for opening an exisiting document |
56 | a = new QAction( tr( "Open" ),Resource::loadPixmap( "fileopen" ) , QString::null, 0, this, 0 ); | 57 | a = new QAction( tr( "Open" ),Resource::loadPixmap( "fileopen" ) , QString::null, 0, this, 0 ); |
57 | a->addTo(popup); | 58 | a->addTo(popup); |
58 | connect(a, SIGNAL(activated()), this, SLOT(slotOpen())); | 59 | connect(a, SIGNAL(activated()), this, SLOT(slotOpen())); |
59 | 60 | ||
60 | 61 | ||
61 | // Action for saving document | 62 | // Action for saving document |
@@ -137,65 +138,65 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | |||
137 | for (int i=0;i<hlm->highlights();i++) | 138 | for (int i=0;i<hlm->highlights();i++) |
138 | { | 139 | { |
139 | hlmenu->insertItem(hlm->hlName(i),i); | 140 | hlmenu->insertItem(hlm->hlName(i),i); |
140 | } | 141 | } |
141 | popup->insertItem(tr("Highlighting"),hlmenu); | 142 | popup->insertItem(tr("Highlighting"),hlmenu); |
142 | 143 | ||
143 | 144 | ||
144 | utilSettings = new QAction( tr( "Settings" ), QString::null, 0, this, 0 ); | 145 | utilSettings = new QAction( tr( "Settings" ), QString::null, 0, this, 0 ); |
145 | utilSettings->addTo( popup); | 146 | utilSettings->addTo( popup); |
146 | 147 | ||
147 | if( qApp->argc() > 1) open(qApp->argv()[1]); | 148 | if( qApp->argc() > 1) open(qApp->argv()[1]); |
148 | else slotNew(); | 149 | else slotNew(); |
149 | 150 | ||
150 | } | 151 | } |
151 | 152 | ||
152 | TinyKate::~TinyKate( ) | 153 | TinyKate::~TinyKate( ) |
153 | { | 154 | { |
154 | qWarning("TinyKate destructor\n"); | 155 | qWarning("TinyKate destructor\n"); |
155 | 156 | ||
156 | shutDown=true; | 157 | shutDown=true; |
157 | while (currentView!=0) { | 158 | while (currentView!=0) { |
158 | slotClose(); | 159 | slotClose(); |
159 | } | 160 | } |
160 | 161 | ||
161 | if( KGlobal::config() != 0 ) { | 162 | if( KGlobal::config() != 0 ) { |
162 | qWarning("deleting KateConfig object..\n"); | 163 | qWarning("deleting KateConfig object..\n"); |
163 | delete KGlobal::config(); | 164 | delete KGlobal::config(); |
164 | } | 165 | } |
165 | } | 166 | } |
166 | 167 | ||
167 | void TinyKate::slotOpen( ) | 168 | void TinyKate::slotOpen( ) |
168 | { | 169 | { |
169 | QString filename = Opie::OFileDialog::getOpenFileName( OFileSelector::EXTENDED_ALL, | 170 | QString filename = OFileDialog::getOpenFileName( OFileSelector::EXTENDED_ALL, |
170 | QString::null); | 171 | QString::null); |
171 | if (!filename.isEmpty()) { | 172 | if (!filename.isEmpty()) { |
172 | open(filename); | 173 | open(filename); |
173 | } | 174 | } |
174 | } | 175 | } |
175 | 176 | ||
176 | void TinyKate::open(const QString & filename) | 177 | void TinyKate::open(const QString & filename) |
177 | { | 178 | { |
178 | KateDocument *kd= new KateDocument(false, false, this,0,this); | 179 | KateDocument *kd= new KateDocument(false, false, this,0,this); |
179 | KTextEditor::View *kv; | 180 | KTextEditor::View *kv; |
180 | QFileInfo fi(filename); | 181 | QFileInfo fi(filename); |
181 | QString filenamed = fi.fileName(); | 182 | QString filenamed = fi.fileName(); |
182 | tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed ); | 183 | tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed ); |
183 | qDebug(filename); | 184 | qDebug(filename); |
184 | 185 | ||
185 | kd->setDocName( filenamed); | 186 | kd->setDocName( filenamed); |
186 | kd->open( filename ); | 187 | kd->open( filename ); |
187 | viewCount++; | 188 | viewCount++; |
188 | } | 189 | } |
189 | 190 | ||
190 | void TinyKate::setDocument(const QString& fileref) | 191 | void TinyKate::setDocument(const QString& fileref) |
191 | { | 192 | { |
192 | open( fileref ); | 193 | open( fileref ); |
193 | } | 194 | } |
194 | 195 | ||
195 | void TinyKate::slotCurrentChanged( QWidget * view) | 196 | void TinyKate::slotCurrentChanged( QWidget * view) |
196 | { | 197 | { |
197 | if (currentView) { | 198 | if (currentView) { |
198 | 199 | ||
199 | disconnect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); | 200 | disconnect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); |
200 | disconnect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); | 201 | disconnect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); |
201 | disconnect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); | 202 | disconnect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); |
@@ -232,47 +233,47 @@ void TinyKate::slotNew( ) | |||
232 | } | 233 | } |
233 | 234 | ||
234 | void TinyKate::slotClose( ) | 235 | void TinyKate::slotClose( ) |
235 | { | 236 | { |
236 | if (currentView==0) return; | 237 | if (currentView==0) return; |
237 | KTextEditor::View *dv=currentView; | 238 | KTextEditor::View *dv=currentView; |
238 | currentView=0; | 239 | currentView=0; |
239 | tabwidget->removePage(dv); | 240 | tabwidget->removePage(dv); |
240 | delete dv->document(); | 241 | delete dv->document(); |
241 | viewCount--; | 242 | viewCount--; |
242 | if ((!viewCount) && (!shutDown)) slotNew(); | 243 | if ((!viewCount) && (!shutDown)) slotNew(); |
243 | } | 244 | } |
244 | 245 | ||
245 | void TinyKate::slotSave() { | 246 | void TinyKate::slotSave() { |
246 | // feel free to make this how you want | 247 | // feel free to make this how you want |
247 | if (currentView==0) return; | 248 | if (currentView==0) return; |
248 | 249 | ||
249 | // KateView *kv = (KateView*) currentView; | 250 | // KateView *kv = (KateView*) currentView; |
250 | KateDocument *kd = (KateDocument*) currentView->document(); | 251 | KateDocument *kd = (KateDocument*) currentView->document(); |
251 | // qDebug("saving file "+kd->docName()); | 252 | // qDebug("saving file "+kd->docName()); |
252 | if( kd->docName().isEmpty()) | 253 | if( kd->docName().isEmpty()) |
253 | slotSaveAs(); | 254 | slotSaveAs(); |
254 | else | 255 | else |
255 | kd->saveFile(); | 256 | kd->saveFile(); |
256 | // kv->save(); | 257 | // kv->save(); |
257 | // kd->saveFile(); | 258 | // kd->saveFile(); |
258 | } | 259 | } |
259 | 260 | ||
260 | void TinyKate::slotSaveAs() { | 261 | void TinyKate::slotSaveAs() { |
261 | if (currentView==0) return; | 262 | if (currentView==0) return; |
262 | KateDocument *kd = (KateDocument*) currentView->document(); | 263 | KateDocument *kd = (KateDocument*) currentView->document(); |
263 | 264 | ||
264 | QString filename= Opie::OFileDialog::getSaveFileName(OFileSelector::EXTENDED_ALL, | 265 | QString filename= OFileDialog::getSaveFileName(OFileSelector::EXTENDED_ALL, |
265 | QString::null); | 266 | QString::null); |
266 | if (!filename.isEmpty()) { | 267 | if (!filename.isEmpty()) { |
267 | qDebug("saving file "+filename); | 268 | qDebug("saving file "+filename); |
268 | QFileInfo fi(filename); | 269 | QFileInfo fi(filename); |
269 | QString filenamed = fi.fileName(); | 270 | QString filenamed = fi.fileName(); |
270 | kd->setDocFile( filename); | 271 | kd->setDocFile( filename); |
271 | kd->setDocName( filenamed); | 272 | kd->setDocName( filenamed); |
272 | kd->saveFile(); | 273 | kd->saveFile(); |
273 | // KTextEditor::View *dv = currentView; | 274 | // KTextEditor::View *dv = currentView; |
274 | // tabwidget->changeTab( dv, filenamed); | 275 | // tabwidget->changeTab( dv, filenamed); |
275 | // need to change tab label here | 276 | // need to change tab label here |
276 | } | 277 | } |
277 | 278 | ||
278 | } | 279 | } |
diff --git a/noncore/apps/tinykate/tinykate.h b/noncore/apps/tinykate/tinykate.h index f844c55..f435c03 100644 --- a/noncore/apps/tinykate/tinykate.h +++ b/noncore/apps/tinykate/tinykate.h | |||
@@ -21,46 +21,46 @@ | |||
21 | 21 | ||
22 | #include <qmainwindow.h> | 22 | #include <qmainwindow.h> |
23 | #include <opie2/otabwidget.h> | 23 | #include <opie2/otabwidget.h> |
24 | #include <ktexteditor.h> | 24 | #include <ktexteditor.h> |
25 | 25 | ||
26 | class QToolButton; | 26 | class QToolButton; |
27 | class QAction; | 27 | class QAction; |
28 | class QPopupMenu; | 28 | class QPopupMenu; |
29 | 29 | ||
30 | class TinyKate : public QMainWindow | 30 | class TinyKate : public QMainWindow |
31 | { | 31 | { |
32 | Q_OBJECT | 32 | Q_OBJECT |
33 | public: | 33 | public: |
34 | TinyKate( QWidget *parent=0, const char *name=0, WFlags f = 0); | 34 | TinyKate( QWidget *parent=0, const char *name=0, WFlags f = 0); |
35 | ~TinyKate( ); | 35 | ~TinyKate( ); |
36 | static QString appName() { return QString::fromLatin1( "kate" ); }; | 36 | static QString appName() { return QString::fromLatin1( "kate" ); }; |
37 | 37 | ||
38 | 38 | ||
39 | public slots: | 39 | public slots: |
40 | void slotNew(); | 40 | void slotNew(); |
41 | void setDocument(const QString& fileref); | 41 | void setDocument(const QString& fileref); |
42 | 42 | ||
43 | protected slots: | 43 | protected slots: |
44 | void slotOpen(); | 44 | void slotOpen(); |
45 | void slotClose(); | 45 | void slotClose(); |
46 | void slotCurrentChanged(QWidget *); | 46 | void slotCurrentChanged(QWidget *); |
47 | void slotSave(); | 47 | void slotSave(); |
48 | void slotSaveAs(); | 48 | void slotSaveAs(); |
49 | protected: | 49 | protected: |
50 | void open(const QString&); | 50 | void open(const QString&); |
51 | private: | 51 | private: |
52 | QString currentFileName; | 52 | QString currentFileName; |
53 | OTabWidget *tabwidget; | 53 | Opie::Ui::OTabWidget *tabwidget; |
54 | KTextEditor::View *currentView; | 54 | KTextEditor::View *currentView; |
55 | bool shutDown; | 55 | bool shutDown; |
56 | 56 | ||
57 | QToolButton *editCopy, *editCut, *editPaste, *editUndo, *editRedo, *editFindReplace; | 57 | QToolButton *editCopy, *editCut, *editPaste, *editUndo, *editRedo, *editFindReplace; |
58 | QAction *viewIncFontSizes, *viewDecFontSizes, *utilSettings; | 58 | QAction *viewIncFontSizes, *viewDecFontSizes, *utilSettings; |
59 | 59 | ||
60 | QPopupMenu *hlmenu; | 60 | QPopupMenu *hlmenu; |
61 | uint nextUnnamed; | 61 | uint nextUnnamed; |
62 | uint viewCount; | 62 | uint viewCount; |
63 | }; | 63 | }; |
64 | 64 | ||
65 | 65 | ||
66 | #endif // __TINYKATE_H__ | 66 | #endif // __TINYKATE_H__ |
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index a3467e5..3df55eb 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp | |||
@@ -1,66 +1,65 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** | 2 | ** |
3 | ** Created: Sat Apr 6 17:57:45 2002 | 3 | ** Created: Sat Apr 6 17:57:45 2002 |
4 | ** | 4 | ** |
5 | ** Author: Carsten Schneider <CarstenSchneider@t-online.de> | 5 | ** Author: Carsten Schneider <CarstenSchneider@t-online.de> |
6 | ** | 6 | ** |
7 | ** $Id$ | 7 | ** $Id$ |
8 | ** | 8 | ** |
9 | ** Homepage: http://home.t-online.de/home/CarstenSchneider/zsafe/index.html | 9 | ** Homepage: http://home.t-online.de/home/CarstenSchneider/zsafe/index.html |
10 | ** | 10 | ** |
11 | ** Compile Flags: | 11 | ** Compile Flags: |
12 | ** Zaurus arm : -DNO_OPIE | 12 | ** Zaurus arm : -DNO_OPIE |
13 | ** Zaurus Opie arm: none | 13 | ** Zaurus Opie arm: none |
14 | ** Linux Desktop : -DDESKTOP | 14 | ** Linux Desktop : -DDESKTOP |
15 | ** Windows Desktop: -DDESKTOP -DWIN32 | 15 | ** Windows Desktop: -DDESKTOP -DWIN32 |
16 | ** | 16 | ** |
17 | ** for japanese version additional use: -DJPATCH_HDE | 17 | ** for japanese version additional use: -DJPATCH_HDE |
18 | ** | 18 | ** |
19 | ****************************************************************************/ | 19 | ****************************************************************************/ |
20 | #include "zsafe.h" | 20 | #include "zsafe.h" |
21 | #include "newdialog.h" | 21 | #include "newdialog.h" |
22 | #include "searchdialog.h" | 22 | #include "searchdialog.h" |
23 | #include "categorydialog.h" | 23 | #include "categorydialog.h" |
24 | #include "passworddialog.h" | 24 | #include "passworddialog.h" |
25 | #include "infoform.h" | 25 | #include "infoform.h" |
26 | #include "zlistview.h" | 26 | #include "zlistview.h" |
27 | #include "shadedlistitem.h" | 27 | #include "shadedlistitem.h" |
28 | 28 | ||
29 | #ifndef DESKTOP | 29 | #ifndef DESKTOP |
30 | #ifndef NO_OPIE | 30 | #ifndef NO_OPIE |
31 | #include <opie2/ofiledialog.h> | 31 | #include <opie2/ofiledialog.h> |
32 | 32 | ||
33 | using Opie::OFileDialog; | 33 | using namespace Opie::Ui; |
34 | using Opie::OFileSelector; | ||
35 | #else | 34 | #else |
36 | #include "scqtfileedit.h" | 35 | #include "scqtfileedit.h" |
37 | #endif | 36 | #endif |
38 | #endif | 37 | #endif |
39 | 38 | ||
40 | #include <qclipboard.h> | 39 | #include <qclipboard.h> |
41 | 40 | ||
42 | #include <stdio.h> | 41 | #include <stdio.h> |
43 | 42 | ||
44 | #include <sys/types.h> | 43 | #include <sys/types.h> |
45 | #include <sys/stat.h> | 44 | #include <sys/stat.h> |
46 | #include <fcntl.h> | 45 | #include <fcntl.h> |
47 | #include <stdlib.h> | 46 | #include <stdlib.h> |
48 | #ifndef WIN32 | 47 | #ifndef WIN32 |
49 | #include <unistd.h> | 48 | #include <unistd.h> |
50 | #endif | 49 | #endif |
51 | #include <string.h> | 50 | #include <string.h> |
52 | #include <errno.h> | 51 | #include <errno.h> |
53 | 52 | ||
54 | #include <qmenubar.h> | 53 | #include <qmenubar.h> |
55 | #include <qpopupmenu.h> | 54 | #include <qpopupmenu.h> |
56 | 55 | ||
57 | #ifdef DESKTOP | 56 | #ifdef DESKTOP |
58 | #include <qfiledialog.h> | 57 | #include <qfiledialog.h> |
59 | #ifndef WIN32 | 58 | #ifndef WIN32 |
60 | #include <qsettings.h> | 59 | #include <qsettings.h> |
61 | #else | 60 | #else |
62 | #include "qsettings.h" | 61 | #include "qsettings.h" |
63 | #endif | 62 | #endif |
64 | #include <qapplication.h> | 63 | #include <qapplication.h> |
65 | #else | 64 | #else |
66 | #include <qfile.h> | 65 | #include <qfile.h> |