author | tille <tille> | 2002-07-06 15:26:04 (UTC) |
---|---|---|
committer | tille <tille> | 2002-07-06 15:26:04 (UTC) |
commit | 7fcf35f1632134cc9f0b3d38949864df3df59c4c (patch) (unidiff) | |
tree | 1c3ef72622877e4d9b59fd73880fa8ffe7936897 | |
parent | 76685f88ebcfd475c2d3c6d8c69271883053b09f (diff) | |
download | opie-7fcf35f1632134cc9f0b3d38949864df3df59c4c.zip opie-7fcf35f1632134cc9f0b3d38949864df3df59c4c.tar.gz opie-7fcf35f1632134cc9f0b3d38949864df3df59c4c.tar.bz2 |
cmd line dialog
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 4 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 10 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.h | 2 |
3 files changed, 11 insertions, 5 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 53db477..d1be8d0 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -39,33 +39,33 @@ | |||
39 | #include "pksettingsbase.h" | 39 | #include "pksettingsbase.h" |
40 | #include "utils.h" | 40 | #include "utils.h" |
41 | #include "packagelistitem.h" | 41 | #include "packagelistitem.h" |
42 | 42 | ||
43 | 43 | ||
44 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | 44 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : |
45 | QMainWindow( parent, name, f ) | 45 | QMainWindow( parent, name, f ) |
46 | // packageListServers( QObject(parent), name ), | 46 | // packageListServers( QObject(parent), name ), |
47 | // packageListSearch( parent, name ), | 47 | // packageListSearch( parent, name ), |
48 | // packageListDocLnk( parent, name ) | 48 | // packageListDocLnk( parent, name ) |
49 | { | 49 | { |
50 | setCaption( tr("Package Manager") ); | 50 | setCaption( tr("Package Manager") ); |
51 | settings = new PackageManagerSettings(this,0,TRUE); | 51 | settings = new PackageManagerSettings(this,0,TRUE); |
52 | listViewPackages = new PackageListView( this,"listViewPackages",settings ); | 52 | listViewPackages = new PackageListView( this,"listViewPackages",settings ); |
53 | setCentralWidget( listViewPackages ); | 53 | setCentralWidget( listViewPackages ); |
54 | listViewPackages->addList( tr("feeds"), &packageListServers ); | 54 | listViewPackages->addList( tr("feeds"), &packageListServers ); |
55 | listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); | 55 | listViewPackages->addList( tr("ipkgfind&killefiz"), &packageListSearch ); |
56 | listViewPackages->addList( tr("documents"), &packageListDocLnk ); | 56 | listViewPackages->addList( tr("documents"), &packageListDocLnk ); |
57 | ipkg = new PmIpkg( settings, this ); | 57 | ipkg = new PmIpkg( settings, this ); |
58 | packageListServers.setSettings( settings ); | 58 | packageListServers.setSettings( settings ); |
59 | packageListSearch.setSettings( settings ); | 59 | packageListSearch.setSettings( settings ); |
60 | packageListDocLnk.setSettings( settings ); | 60 | packageListDocLnk.setSettings( settings ); |
61 | pvDebug(9,"packageListServers.update"); | 61 | pvDebug(9,"packageListServers.update"); |
62 | packageListServers.update(); | 62 | packageListServers.update(); |
63 | pvDebug(9,"packageListDocLnk.update"); | 63 | pvDebug(9,"packageListDocLnk.update"); |
64 | packageListDocLnk.update(); | 64 | packageListDocLnk.update(); |
65 | pvDebug(9,"makeMenu"); | 65 | pvDebug(9,"makeMenu"); |
66 | makeMenu(); | 66 | makeMenu(); |
67 | makeChannel(); | 67 | makeChannel(); |
68 | 68 | ||
69 | 69 | ||
70 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); | 70 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); |
71 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); | 71 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); |
@@ -179,33 +179,33 @@ void MainWindow::makeMenu() | |||
179 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), | 179 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), |
180 | this, SLOT( displayList() ) ); | 180 | this, SLOT( displayList() ) ); |
181 | a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | 181 | a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); |
182 | connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) ); | 182 | connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) ); |
183 | a->addTo( findBar ); | 183 | a->addTo( findBar ); |
184 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 184 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
185 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); | 185 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); |
186 | a->addTo( findBar ); | 186 | a->addTo( findBar ); |
187 | findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 ); | 187 | findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 ); |
188 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); | 188 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); |
189 | findAction->setToggleAction( true ); | 189 | findAction->setToggleAction( true ); |
190 | findAction->addTo( viewMenu ); | 190 | findAction->addTo( viewMenu ); |
191 | 191 | ||
192 | //SEARCH | 192 | //SEARCH |
193 | searchBar = new QPEToolBar(this); | 193 | searchBar = new QPEToolBar(this); |
194 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | 194 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); |
195 | label = new QLabel( tr("ipkgfind: "), searchBar ); | 195 | label = new QLabel( tr("Search: "), searchBar ); |
196 | // label->setBackgroundMode( PaletteForeground ); | 196 | // label->setBackgroundMode( PaletteForeground ); |
197 | searchBar->setHorizontalStretchable( TRUE ); | 197 | searchBar->setHorizontalStretchable( TRUE ); |
198 | searchEdit = new QLineEdit( searchBar, "seachEdit" ); | 198 | searchEdit = new QLineEdit( searchBar, "seachEdit" ); |
199 | searchBar->setStretchableWidget( searchEdit ); | 199 | searchBar->setStretchableWidget( searchEdit ); |
200 | // connect( searchEdit, SIGNAL( textChanged( const QString & ) ), | 200 | // connect( searchEdit, SIGNAL( textChanged( const QString & ) ), |
201 | // this, SLOT( displayList() ) ); | 201 | // this, SLOT( displayList() ) ); |
202 | a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | 202 | a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); |
203 | connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); | 203 | connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); |
204 | a->addTo( searchBar ); | 204 | a->addTo( searchBar ); |
205 | searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); | 205 | searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); |
206 | connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); | 206 | connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); |
207 | searchCommit->addTo( searchBar ); | 207 | searchCommit->addTo( searchBar ); |
208 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 208 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
209 | connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); | 209 | connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); |
210 | a->addTo( searchBar ); | 210 | a->addTo( searchBar ); |
211 | searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); | 211 | searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); |
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index d29036b..71e9b88 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp | |||
@@ -12,47 +12,47 @@ | |||
12 | #include "package.h" | 12 | #include "package.h" |
13 | #include "packagelistitem.h" | 13 | #include "packagelistitem.h" |
14 | 14 | ||
15 | #include <opie/oprocess.h> | 15 | #include <opie/oprocess.h> |
16 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
17 | #include <qpe/config.h> | 17 | #include <qpe/config.h> |
18 | #include <qpe/stringutil.h> | 18 | #include <qpe/stringutil.h> |
19 | #include <qpe/qpeapplication.h> | 19 | #include <qpe/qpeapplication.h> |
20 | #include <qdir.h> | 20 | #include <qdir.h> |
21 | #include <qfile.h> | 21 | #include <qfile.h> |
22 | #include <qgroupbox.h> | 22 | #include <qgroupbox.h> |
23 | #include <qmultilineedit.h> | 23 | #include <qmultilineedit.h> |
24 | #include <qstring.h> | 24 | #include <qstring.h> |
25 | #include <qcheckbox.h> | 25 | #include <qcheckbox.h> |
26 | #include <qtextstream.h> | 26 | #include <qtextstream.h> |
27 | #include <qtextview.h> | 27 | #include <qtextview.h> |
28 | 28 | #include <qmessagebox.h> | |
29 | #include <qprogressbar.h> | 29 | #include <qprogressbar.h> |
30 | #include <qpushbutton.h> | 30 | #include <qpushbutton.h> |
31 | #include <qlayout.h> | 31 | #include <qlayout.h> |
32 | 32 | ||
33 | #include <stdlib.h> | 33 | #include <stdlib.h> |
34 | #include <unistd.h> | 34 | #include <unistd.h> |
35 | 35 | ||
36 | #include "mainwindow.h" | 36 | #include "mainwindow.h" |
37 | 37 | ||
38 | 38 | ||
39 | //#define OPROCESS | 39 | //#define OPROCESS |
40 | 40 | ||
41 | PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) | 41 | PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) |
42 | : QObject ( p ) | 42 | : QObject ( p ), shellWarning(true) |
43 | { | 43 | { |
44 | settings = s; | 44 | settings = s; |
45 | runwindow = new RunWindow( p, name, true, f ); | 45 | runwindow = new RunWindow( p, name, true, f ); |
46 | #ifdef OPROCESS | 46 | #ifdef OPROCESS |
47 | ipkgProcess = new OProcess(); | 47 | ipkgProcess = new OProcess(); |
48 | connect ( ipkgProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), | 48 | connect ( ipkgProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), |
49 | this, SLOT(getIpkgOutput(OProcess*,char*,int))); | 49 | this, SLOT(getIpkgOutput(OProcess*,char*,int))); |
50 | 50 | ||
51 | connect ( ipkgProcess, SIGNAL(receivedStderr(OProcess*,char*,int)), | 51 | connect ( ipkgProcess, SIGNAL(receivedStderr(OProcess*,char*,int)), |
52 | this, SLOT(getIpkgOutput(OProcess*,char*,int))); | 52 | this, SLOT(getIpkgOutput(OProcess*,char*,int))); |
53 | installDialog = 0; | 53 | installDialog = 0; |
54 | #endif | 54 | #endif |
55 | } | 55 | } |
56 | 56 | ||
57 | PmIpkg::~PmIpkg() | 57 | PmIpkg::~PmIpkg() |
58 | { | 58 | { |
@@ -143,32 +143,38 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest ) | |||
143 | out("\nError while executing "+ cmd+"\n\n"); | 143 | out("\nError while executing "+ cmd+"\n\n"); |
144 | ret = false; | 144 | ret = false; |
145 | } else { | 145 | } else { |
146 | while ( fgets( line, sizeof line, fp) != NULL) | 146 | while ( fgets( line, sizeof line, fp) != NULL) |
147 | { | 147 | { |
148 | lineStr = line; | 148 | lineStr = line; |
149 | lineStr=lineStr.left(lineStr.length()-1); | 149 | lineStr=lineStr.left(lineStr.length()-1); |
150 | //Configuring opie-oipkg...Done | 150 | //Configuring opie-oipkg...Done |
151 | if (lineStr.contains("Done")) ret = true; | 151 | if (lineStr.contains("Done")) ret = true; |
152 | if (lineStr!=lineStrOld) | 152 | if (lineStr!=lineStrOld) |
153 | out(lineStr); | 153 | out(lineStr); |
154 | lineStrOld = lineStr; | 154 | lineStrOld = lineStr; |
155 | qApp->processEvents(); | 155 | qApp->processEvents(); |
156 | } | 156 | } |
157 | } | 157 | } |
158 | pclose(fp); | 158 | pclose(fp); |
159 | if (!ret && shellWarning) | ||
160 | { | ||
161 | shellWarning = false; | ||
162 | QMessageBox::critical( runwindow, tr("install failure"), | ||
163 | tr("<p>Did you start me from the command line?</p>")); | ||
164 | } | ||
159 | #endif | 165 | #endif |
160 | //out( "Finished!"); | 166 | //out( "Finished!"); |
161 | pvDebug(2,QString(ret?"success\n":"failure\n")); | 167 | pvDebug(2,QString(ret?"success\n":"failure\n")); |
162 | return ret; | 168 | return ret; |
163 | } | 169 | } |
164 | 170 | ||
165 | void PmIpkg::makeLinks(Package *pack) | 171 | void PmIpkg::makeLinks(Package *pack) |
166 | { | 172 | { |
167 | pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); | 173 | pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); |
168 | QString pn = pack->name(); | 174 | QString pn = pack->name(); |
169 | linkPackage( pack->packageName(), pack->dest() ); | 175 | linkPackage( pack->packageName(), pack->dest() ); |
170 | } | 176 | } |
171 | 177 | ||
172 | QStringList* PmIpkg::getList( QString packFileName, QString d ) | 178 | QStringList* PmIpkg::getList( QString packFileName, QString d ) |
173 | { | 179 | { |
174 | QString dest = settings->getDestinationUrlByName( d ); | 180 | QString dest = settings->getDestinationUrlByName( d ); |
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h index 28bc5dd..662800a 100644 --- a/noncore/unsupported/oipkg/pmipkg.h +++ b/noncore/unsupported/oipkg/pmipkg.h | |||
@@ -25,48 +25,48 @@ | |||
25 | #define createLink 0 | 25 | #define createLink 0 |
26 | #define removeLink 1 | 26 | #define removeLink 1 |
27 | 27 | ||
28 | class Package; | 28 | class Package; |
29 | class PmIpkg : public QObject | 29 | class PmIpkg : public QObject |
30 | { | 30 | { |
31 | Q_OBJECT | 31 | Q_OBJECT |
32 | public: | 32 | public: |
33 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); | 33 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); |
34 | ~PmIpkg(); | 34 | ~PmIpkg(); |
35 | 35 | ||
36 | int linkOpp; | 36 | int linkOpp; |
37 | void loadList( PackageList* ); | 37 | void loadList( PackageList* ); |
38 | void commit(); | 38 | void commit(); |
39 | void update(); | 39 | void update(); |
40 | void show(); | 40 | void show(); |
41 | /** No descriptions */ | ||
42 | void clearLists(); | 41 | void clearLists(); |
43 | 42 | ||
44 | public slots: | 43 | public slots: |
45 | void doIt(); | 44 | void doIt(); |
46 | void install(); | 45 | void install(); |
47 | void remove(); | 46 | void remove(); |
48 | void installFile(const QString &fileName, const QString &dest=""); | 47 | void installFile(const QString &fileName, const QString &dest=""); |
49 | void removeFile(const QString &fileName, const QString &dest=""); | 48 | void removeFile(const QString &fileName, const QString &dest=""); |
50 | void createLinks( const QString &dest ); | 49 | void createLinks( const QString &dest ); |
51 | void removeLinks( const QString &dest ); | 50 | void removeLinks( const QString &dest ); |
52 | 51 | ||
53 | //private slots: | 52 | //private slots: |
54 | void getIpkgOutput(OProcess *proc, char *buffer, int buflen); | 53 | void getIpkgOutput(OProcess *proc, char *buffer, int buflen); |
55 | 54 | ||
56 | private: | 55 | private: |
56 | bool shellWarning; | ||
57 | OProcess *ipkgProcess; | 57 | OProcess *ipkgProcess; |
58 | PackageManagerSettings* settings; | 58 | PackageManagerSettings* settings; |
59 | RunWindow *runwindow; | 59 | RunWindow *runwindow; |
60 | InstallDialog *installDialog; | 60 | InstallDialog *installDialog; |
61 | QList<Package> to_remove; | 61 | QList<Package> to_remove; |
62 | QList<Package> to_install; | 62 | QList<Package> to_install; |
63 | void makeLinks(Package*); | 63 | void makeLinks(Package*); |
64 | void linkPackage( QString, QString ); | 64 | void linkPackage( QString, QString ); |
65 | void processLinkDir( QString , QString ); | 65 | void processLinkDir( QString , QString ); |
66 | bool runIpkg(const QString& args, const QString& dest="" ); | 66 | bool runIpkg(const QString& args, const QString& dest="" ); |
67 | void out( QString ); | 67 | void out( QString ); |
68 | QStringList* getList( QString, QString ); | 68 | QStringList* getList( QString, QString ); |
69 | void processFileList( QStringList*, QString ); | 69 | void processFileList( QStringList*, QString ); |
70 | 70 | ||
71 | 71 | ||
72 | }; | 72 | }; |