summaryrefslogtreecommitdiff
path: root/noncore
authortille <tille>2002-05-03 09:40:11 (UTC)
committer tille <tille>2002-05-03 09:40:11 (UTC)
commit6bf450ac622d22ba7e9156e474a7abb714167eba (patch) (unidiff)
treeff89dd745715e0b540e6c8f17b6af4dec4c3c84a /noncore
parent6ebb8228b660634b4ca8a2a5bf05aef828e39f31 (diff)
downloadopie-6bf450ac622d22ba7e9156e474a7abb714167eba.zip
opie-6bf450ac622d22ba7e9156e474a7abb714167eba.tar.gz
opie-6bf450ac622d22ba7e9156e474a7abb714167eba.tar.bz2
added install dialog with ipkg options (that are shown ;)
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/TODO2
-rw-r--r--noncore/unsupported/oipkg/installdialog.cpp104
-rw-r--r--noncore/unsupported/oipkg/installdialog.h46
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp5
-rw-r--r--noncore/unsupported/oipkg/oipkg.pro2
-rw-r--r--noncore/unsupported/oipkg/packagelistremote.cpp2
-rw-r--r--noncore/unsupported/oipkg/pksettings.cpp11
-rw-r--r--noncore/unsupported/oipkg/pksettings.h1
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp78
-rw-r--r--noncore/unsupported/oipkg/pmipkg.h7
-rw-r--r--noncore/unsupported/oipkg/settings.h1
11 files changed, 193 insertions, 66 deletions
diff --git a/noncore/unsupported/oipkg/TODO b/noncore/unsupported/oipkg/TODO
index 1aa9e6b..b1ae6e3 100644
--- a/noncore/unsupported/oipkg/TODO
+++ b/noncore/unsupported/oipkg/TODO
@@ -2,13 +2,13 @@
2* tr() ;) 2* tr() ;)
3* Dialog to display ipkg output live 3* Dialog to display ipkg output live
4* parse "to install" and "to remove" from status 4* parse "to install" and "to remove" from status
5* install local file dialog 5* install local file dialog
6* qcop 6* qcop
7* error handling 7* error handling
8* manage links 8* manage links
9* dependency checking 9* dependency checking
10* create dest if it does not exist 10* create dest if it does not exist
11* allow reinstalling 11* allow reinstalling
12* different types of filters and searches 12* different types of filters and searches
13 i.e. name, desc, files etc 13 i.e. name, desc, files etc
14* get packages from doclnk \ No newline at end of file 14* mark packages from doclnk and ipkgfind installed if installed \ No newline at end of file
diff --git a/noncore/unsupported/oipkg/installdialog.cpp b/noncore/unsupported/oipkg/installdialog.cpp
new file mode 100644
index 0000000..72f436a
--- a/dev/null
+++ b/noncore/unsupported/oipkg/installdialog.cpp
@@ -0,0 +1,104 @@
1/****************************************************************************
2** Form implementation generated from reading ui file 'installdialog.ui'
3**
4** Created: Thu May 2 22:19:02 2002
5** by: The User Interface Compiler (uic)
6**
7** WARNING! All changes made in this file will be lost!
8****************************************************************************/
9#include "installdialog.h"
10
11#include <qcheckbox.h>
12#include <qgroupbox.h>
13#include <qheader.h>
14#include <qlistview.h>
15#include <qpushbutton.h>
16#include <qlayout.h>
17#include <qvariant.h>
18#include <qtooltip.h>
19#include <qwhatsthis.h>
20
21
22InstallDialog::InstallDialog( PackageManagerSettings* s, QWidget* parent, const char* name, bool modal, WFlags fl )
23 : QDialog( parent, name, modal, fl )
24{
25 settings = s;
26 if ( !name )
27 setName( "InstallDialog" );
28 resize( 223, 269 );
29 setCaption( tr( "Install" ) );
30 InstallDialogLayout = new QGridLayout( this );
31 InstallDialogLayout->setSpacing( 2 );
32 InstallDialogLayout->setMargin( 2 );
33
34 ListViewPackages = new PackageListView( this,"listViewPackages",settings );
35
36 InstallDialogLayout->addWidget( ListViewPackages, 0, 0 );
37
38 GroupBoxOptions = new QGroupBox( this, "GroupBoxOptions" );
39 GroupBoxOptions->setTitle( tr( "Ipkg options" ) );
40 GroupBoxOptions->setColumnLayout(0, Qt::Vertical );
41 GroupBoxOptions->layout()->setSpacing( 0 );
42 GroupBoxOptions->layout()->setMargin( 0 );
43 GroupBoxOptionsLayout = new QGridLayout( GroupBoxOptions->layout() );
44 GroupBoxOptionsLayout->setAlignment( Qt::AlignTop );
45 GroupBoxOptionsLayout->setSpacing( 2 );
46 GroupBoxOptionsLayout->setMargin( 2 );
47
48 _force_depends = new QCheckBox( GroupBoxOptions, "_force_depends" );
49 QFont _force_depends_font( _force_depends->font() );
50 _force_depends_font.setPointSize( 8 );
51 _force_depends->setFont( _force_depends_font );
52 _force_depends->setText( tr( "-force-depends" ) );
53 //_force_depends->setChecked( true );
54
55 GroupBoxOptionsLayout->addWidget( _force_depends, 0, 0 );
56
57 _force_reinstall = new QCheckBox( GroupBoxOptions, "_force_reinstall" );
58 QFont _force_reinstall_font( _force_reinstall->font() );
59 _force_reinstall_font.setPointSize( 8 );
60 _force_reinstall->setFont( _force_reinstall_font );
61 _force_reinstall->setText( tr( "-force-reinstall" ) );
62
63 GroupBoxOptionsLayout->addWidget( _force_reinstall, 1, 0 );
64
65 _force_remove = new QCheckBox( GroupBoxOptions, "_force_remove" );
66 QFont _force_remove_font( _force_remove->font() );
67 _force_remove_font.setPointSize( 8 );
68 _force_remove->setFont( _force_remove_font );
69 _force_remove->setText( tr( "-force-removal-of-essential-packages" ) );
70
71 GroupBoxOptionsLayout->addWidget( _force_remove, 2, 0 );
72
73 InstallDialogLayout->addWidget( GroupBoxOptions, 1, 0 );
74}
75
76/*
77 * Destroys the object and frees any allocated resources
78 */
79InstallDialog::~InstallDialog()
80{
81 // no need to delete child widgets, Qt does it all for us
82}
83
84/*
85 * Main event handler. Reimplemented to handle application
86 * font changes
87 */
88bool InstallDialog::event( QEvent* ev )
89{
90 bool ret = QDialog::event( ev );
91 if ( ev->type() == QEvent::ApplicationFontChange ) {
92 QFont _force_depends_font( _force_depends->font() );
93 _force_depends_font.setPointSize( 8 );
94 _force_depends->setFont( _force_depends_font );
95 QFont _force_reinstall_font( _force_reinstall->font() );
96 _force_reinstall_font.setPointSize( 8 );
97 _force_reinstall->setFont( _force_reinstall_font );
98 QFont _force_remove_font( _force_remove->font() );
99 _force_remove_font.setPointSize( 8 );
100 _force_remove->setFont( _force_remove_font );
101 }
102 return ret;
103}
104
diff --git a/noncore/unsupported/oipkg/installdialog.h b/noncore/unsupported/oipkg/installdialog.h
new file mode 100644
index 0000000..f2164ac
--- a/dev/null
+++ b/noncore/unsupported/oipkg/installdialog.h
@@ -0,0 +1,46 @@
1/****************************************************************************
2** Form interface generated from reading ui file 'installdialog.ui'
3**
4** Created: Thu May 2 22:19:01 2002
5** by: The User Interface Compiler (uic)
6**
7** WARNING! All changes made in this file will be lost!
8****************************************************************************/
9#ifndef INSTALLDIALOG_H
10#define INSTALLDIALOG_H
11
12#include "pksettings.h"
13#include "packagelistview.h"
14#include <qvariant.h>
15#include <qdialog.h>
16class QVBoxLayout;
17class QHBoxLayout;
18class QGridLayout;
19class QCheckBox;
20class QGroupBox;
21class QListView;
22class QListViewItem;
23
24class InstallDialog : public QDialog
25{
26 Q_OBJECT
27
28public:
29 InstallDialog( PackageManagerSettings* s, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
30 ~InstallDialog();
31
32 PackageListView* ListViewPackages;
33 QGroupBox* GroupBoxOptions;
34 QCheckBox* _force_depends;
35 QCheckBox* _force_reinstall;
36 QCheckBox* _force_remove;
37
38protected:
39 QGridLayout* InstallDialogLayout;
40 QGridLayout* GroupBoxOptionsLayout;
41 bool event( QEvent* );
42private:
43 PackageManagerSettings* settings;
44};
45
46#endif // INSTALLDIALOG_H
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index b668660..259a789 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -227,39 +227,42 @@ void MainWindow::makeMenu()
227 // configure the menus 227 // configure the menus
228 Config cfg( "oipkg", Config::User ); 228 Config cfg( "oipkg", Config::User );
229 cfg.setGroup( "gui" ); 229 cfg.setGroup( "gui" );
230 230
231 findShow( cfg.readBoolEntry( "findBar", true ) ); 231 findShow( cfg.readBoolEntry( "findBar", true ) );
232 searchShow( cfg.readBoolEntry( "searchBar", true ) ); 232 searchShow( cfg.readBoolEntry( "searchBar", true ) );
233 sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); 233 sectionShow( cfg.readBoolEntry( "sectionBar", true ) );
234 destShow( cfg.readBoolEntry( "destBar", false ) ); 234 destShow( cfg.readBoolEntry( "destBar", false ) );
235} 235}
236 236
237MainWindow::~MainWindow() 237MainWindow::~MainWindow()
238{ 238{
239 pvDebug(7,"MainWindow::~MainWindow ");
239 Config cfg( "oipkg", Config::User ); 240 Config cfg( "oipkg", Config::User );
240 cfg.setGroup( "gui" ); 241 cfg.setGroup( "gui" );
241 cfg.writeEntry( "findBar", !findBar->isHidden() ); 242 cfg.writeEntry( "findBar", !findBar->isHidden() );
242 cfg.writeEntry( "searchBar", !searchBar->isHidden() ); 243 cfg.writeEntry( "searchBar", !searchBar->isHidden() );
243 cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); 244 cfg.writeEntry( "sectionBar", !sectionBar->isHidden() );
244 cfg.writeEntry( "destBar", !destBar->isHidden() ); 245 cfg.writeEntry( "destBar", !destBar->isHidden() );
246 pvDebug(7,"MainWindow::~MainWindow ");
245 247
246} 248}
247 249
248void MainWindow::runIpkg() 250void MainWindow::runIpkg()
249{ 251{
250 packageListServers.allPackages(); 252 packageListServers.allPackages();
251 ipkg->loadList( packageListSearch ); 253 ipkg->loadList( packageListSearch );
252 ipkg->loadList( packageListDocLnk ); 254 ipkg->loadList( packageListDocLnk );
253 ipkg->commit( packageListServers ); 255 ipkg->loadList( packageListServers );
256 ipkg->commit();
254 // ##### If we looked in the list of files, we could send out accurate 257 // ##### If we looked in the list of files, we could send out accurate
255 // ##### messages. But we don't bother yet, and just do an "all". 258 // ##### messages. But we don't bother yet, and just do an "all".
256 QCopEnvelope e("QPE/System", "linkChanged(QString)"); 259 QCopEnvelope e("QPE/System", "linkChanged(QString)");
257 QString lf = QString::null; 260 QString lf = QString::null;
258 e << lf; 261 e << lf;
259 displayList(); 262 displayList();
260} 263}
261 264
262void MainWindow::updateList() 265void MainWindow::updateList()
263{ 266{
264 //wait->show(); 267 //wait->show();
265 QTimer *t = new QTimer( this ); 268 QTimer *t = new QTimer( this );
diff --git a/noncore/unsupported/oipkg/oipkg.pro b/noncore/unsupported/oipkg/oipkg.pro
index 6ee1963..9e2f5f8 100644
--- a/noncore/unsupported/oipkg/oipkg.pro
+++ b/noncore/unsupported/oipkg/oipkg.pro
@@ -1,32 +1,34 @@
1 DESTDIR = $(OPIEDIR)/bin 1 DESTDIR = $(OPIEDIR)/bin
2 TEMPLATE= app 2 TEMPLATE= app
3 #CONFIG = qt warn_on release 3 #CONFIG = qt warn_on release
4 CONFIG = qt warn_on debug 4 CONFIG = qt warn_on debug
5 HEADERS = mainwindow.h \ 5 HEADERS = mainwindow.h \
6 pksettings.h \ 6 pksettings.h \
7 pmipkg.h \ 7 pmipkg.h \
8 packagelistdoclnk.h \ 8 packagelistdoclnk.h \
9 installdialog.h \
9 utils.h \ 10 utils.h \
10 packagelistitem.h \ 11 packagelistitem.h \
11 packagelistremote.h \ 12 packagelistremote.h \
12 packagelist.h \ 13 packagelist.h \
13 packagelistlocal.h \ 14 packagelistlocal.h \
14 packagelistview.h \ 15 packagelistview.h \
15 package.h 16 package.h
16 SOURCES = main.cpp \ 17 SOURCES = main.cpp \
17 mainwindow.cpp \ 18 mainwindow.cpp \
18 utils.cpp \ 19 utils.cpp \
19 packagelistdoclnk.cpp \ 20 packagelistdoclnk.cpp \
20 packagelistview.cpp \ 21 packagelistview.cpp \
22 installdialog.cpp \
21 packagelistremote.cpp \ 23 packagelistremote.cpp \
22 packagelistlocal.cpp \ 24 packagelistlocal.cpp \
23 pksettings.cpp \ 25 pksettings.cpp \
24 pmipkg.cpp \ 26 pmipkg.cpp \
25 packagelistitem.cpp \ 27 packagelistitem.cpp \
26 packagelist.cpp \ 28 packagelist.cpp \
27 package.cpp 29 package.cpp
28INCLUDEPATH += $(OPIEDIR)/include 30INCLUDEPATH += $(OPIEDIR)/include
29 DEPENDPATH+= $(OPIEDIR)/ioclude 31 DEPENDPATH+= $(OPIEDIR)/ioclude
30LIBS += -lqpe 32LIBS += -lqpe
31 INTERFACES= runwindow.ui \ 33 INTERFACES= runwindow.ui \
32 pksettingsbase.ui 34 pksettingsbase.ui
diff --git a/noncore/unsupported/oipkg/packagelistremote.cpp b/noncore/unsupported/oipkg/packagelistremote.cpp
index 1ec7292..3c6ede7 100644
--- a/noncore/unsupported/oipkg/packagelistremote.cpp
+++ b/noncore/unsupported/oipkg/packagelistremote.cpp
@@ -32,16 +32,16 @@ void PackageListRemote::update()
32 QString cmd = "wget"; 32 QString cmd = "wget";
33 QString redirect = "/tmp/oipkg.query"; 33 QString redirect = "/tmp/oipkg.query";
34 34
35 // use file for output 35 // use file for output
36 cmd += " --output-document="+redirect; 36 cmd += " --output-document="+redirect;
37//http://ipkgfind.handhelds.org/packages.phtml?format=pda&query=ipkg&searchtype=package&section= 37//http://ipkgfind.handhelds.org/packages.phtml?format=pda&query=ipkg&searchtype=package&section=
38 QString server="http://ipkgfind.handhelds.org/"; 38 QString server="http://ipkgfind.handhelds.org/";
39 cmd += " \""+server+"/packages.phtml"; 39 cmd += " \""+server+"/packages.phtml";
40 cmd += "?format=pda&searchtype=package&section="; 40 cmd += "?format=pda&searchtype=package&section=";
41 cmd += "&query="+searchString; 41 cmd += "&query="+searchString;
42 cmd += "\""; 42 cmd += "\"";
43 43
44 pvDebug(2,"search :"+cmd); 44 pvDebug(4,"search :"+cmd);
45 r = system(cmd.latin1()); 45 r = system(cmd.latin1());
46 readFileEntries( redirect ); 46 readFileEntries( redirect );
47} 47}
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp
index 7e2ef10..24c7beb 100644
--- a/noncore/unsupported/oipkg/pksettings.cpp
+++ b/noncore/unsupported/oipkg/pksettings.cpp
@@ -49,24 +49,25 @@ PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* na
49 connect( settingName, SIGNAL(textChanged(const QString &)), this, SLOT(installationSettingSetName(const QString &)) ); 49 connect( settingName, SIGNAL(textChanged(const QString &)), this, SLOT(installationSettingSetName(const QString &)) );
50 connect( newsetting, SIGNAL(clicked()), this, SLOT(newInstallationSetting()) ); 50 connect( newsetting, SIGNAL(clicked()), this, SLOT(newInstallationSetting()) );
51 connect( renamesetting, SIGNAL(clicked()), this, SLOT(renameInstallationSetting()) ); 51 connect( renamesetting, SIGNAL(clicked()), this, SLOT(renameInstallationSetting()) );
52 connect( removesetting, SIGNAL(clicked()), this, SLOT(removeInstallationSetting()) ); 52 connect( removesetting, SIGNAL(clicked()), this, SLOT(removeInstallationSetting()) );
53 servername->setEnabled(FALSE); 53 servername->setEnabled(FALSE);
54 serverurl->setEnabled(FALSE); 54 serverurl->setEnabled(FALSE);
55 serverurlDic.setAutoDelete(TRUE); 55 serverurlDic.setAutoDelete(TRUE);
56 destinationname->setEnabled(FALSE); 56 destinationname->setEnabled(FALSE);
57 destinationurl->setEnabled(FALSE); 57 destinationurl->setEnabled(FALSE);
58 destinationurlDic.setAutoDelete(TRUE); 58 destinationurlDic.setAutoDelete(TRUE);
59 readSettings(); 59 readSettings();
60 activeLinkDestination->hide(); 60 activeLinkDestination->hide();
61 serverChanged = false;
61} 62}
62 63
63PackageManagerSettings::~PackageManagerSettings() 64PackageManagerSettings::~PackageManagerSettings()
64{ 65{
65} 66}
66 67
67 68
68void PackageManagerSettings::newServer() 69void PackageManagerSettings::newServer()
69{ 70{
70 int i = servers->count(); 71 int i = servers->count();
71 if ( servername->isEnabled() || serverurl->text().isEmpty() ) { 72 if ( servername->isEnabled() || serverurl->text().isEmpty() ) {
72 serverurlDic.insert(i,new QString("http://")); 73 serverurlDic.insert(i,new QString("http://"));
@@ -110,41 +111,42 @@ void PackageManagerSettings::editServer(int i)
110 if ( servername->isEnabled() ) { 111 if ( servername->isEnabled() ) {
111 disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); 112 disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) );
112 disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); 113 disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) );
113 } else { 114 } else {
114 servername->setEnabled(TRUE); 115 servername->setEnabled(TRUE);
115 serverurl->setEnabled(TRUE); 116 serverurl->setEnabled(TRUE);
116 } 117 }
117 118
118 servername->setText( servers->text(i) ); 119 servername->setText( servers->text(i) );
119 serverurl->setText( *serverurlDic[i] ); 120 serverurl->setText( *serverurlDic[i] );
120 121
121 editedserver = i; 122 editedserver = i;
122 123 serverChanged = true;
123 connect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); 124 connect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) );
124 connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); 125 connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) );
125 changed = true; 126 changed = true;
126} 127}
127 128
128 129
129void PackageManagerSettings::editDestination(int i) 130void PackageManagerSettings::editDestination(int i)
130{ 131{
131 if ( destinationname->isEnabled() ) { 132 if ( destinationname->isEnabled() ) {
132 disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); 133 disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) );
133 disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); 134 disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) );
134 } else { 135 } else {
135 destinationname->setEnabled(TRUE); 136 destinationname->setEnabled(TRUE);
136 destinationurl->setEnabled(TRUE); 137 destinationurl->setEnabled(TRUE);
137 createLinksButton->setEnabled(TRUE); 138 //since it does not work anyway
138 removeLinksButton->setEnabled(TRUE); 139// createLinksButton->setEnabled(TRUE);
140// removeLinksButton->setEnabled(TRUE);
139 } 141 }
140 142
141 destinationname->setText( destinations->text(i) ); 143 destinationname->setText( destinations->text(i) );
142 destinationurl->setText( *destinationurlDic[i] ); 144 destinationurl->setText( *destinationurlDic[i] );
143 145
144 editeddestination = i; 146 editeddestination = i;
145 147
146 connect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); 148 connect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) );
147 connect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); 149 connect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) );
148 changed = true; 150 changed = true;
149} 151}
150 152
@@ -175,43 +177,44 @@ void PackageManagerSettings::removeDestination()
175 activeLinkDestination->removeItem(editeddestination); 177 activeLinkDestination->removeItem(editeddestination);
176 connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); 178 connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
177 destinationname->setEnabled(FALSE); 179 destinationname->setEnabled(FALSE);
178 destinationurl->setEnabled(FALSE); 180 destinationurl->setEnabled(FALSE);
179 changed = true; 181 changed = true;
180} 182}
181 183
182void PackageManagerSettings::serverNameChanged(const QString& t) 184void PackageManagerSettings::serverNameChanged(const QString& t)
183{ 185{
184 disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); 186 disconnect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) );
185 servers->changeItem( t, editedserver ); 187 servers->changeItem( t, editedserver );
186 activeServers->changeItem( t, editedserver ); 188 activeServers->changeItem( t, editedserver );
187 changed = true;
188 connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); 189 connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) );
189 changed = true; 190 changed = true;
191 serverChanged = true;
190} 192}
191 193
192void PackageManagerSettings::destNameChanged(const QString& t) 194void PackageManagerSettings::destNameChanged(const QString& t)
193{ 195{
194 disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); 196 disconnect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
195 destinations->changeItem( t, editeddestination ); 197 destinations->changeItem( t, editeddestination );
196 activeDestination->changeItem( t, editeddestination ); 198 activeDestination->changeItem( t, editeddestination );
197 activeLinkDestination->changeItem( t, editeddestination ); 199 activeLinkDestination->changeItem( t, editeddestination );
198 connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); 200 connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
199 changed = true; 201 changed = true;
200} 202}
201 203
202void PackageManagerSettings::serverUrlChanged(const QString& t) 204void PackageManagerSettings::serverUrlChanged(const QString& t)
203{ 205{
204 serverurlDic.replace(editedserver, new QString(t)); 206 serverurlDic.replace(editedserver, new QString(t));
205 changed = true; 207 changed = true;
208 serverChanged = true;
206} 209}
207 210
208void PackageManagerSettings::destUrlChanged(const QString& t) 211void PackageManagerSettings::destUrlChanged(const QString& t)
209{ 212{
210 destinationurlDic.replace(editeddestination, new QString(t)); 213 destinationurlDic.replace(editeddestination, new QString(t));
211 changed = true; 214 changed = true;
212} 215}
213 216
214void PackageManagerSettings::writeIpkgConfig(const QString& conffile) 217void PackageManagerSettings::writeIpkgConfig(const QString& conffile)
215{ 218{
216 QFile conf(conffile); 219 QFile conf(conffile);
217 if ( ! conf.open(IO_WriteOnly) ) return; 220 if ( ! conf.open(IO_WriteOnly) ) return;
diff --git a/noncore/unsupported/oipkg/pksettings.h b/noncore/unsupported/oipkg/pksettings.h
index 1632d4a..dcc1e3a 100644
--- a/noncore/unsupported/oipkg/pksettings.h
+++ b/noncore/unsupported/oipkg/pksettings.h
@@ -55,20 +55,21 @@ signals:
55// void doCreateLinks( QString dest ); 55// void doCreateLinks( QString dest );
56// void doRemoveLinks( QString dest ); 56// void doRemoveLinks( QString dest );
57 57
58private: 58private:
59 QIntDict<QString> serverurlDic; 59 QIntDict<QString> serverurlDic;
60 QIntDict<QString> destinationurlDic; 60 QIntDict<QString> destinationurlDic;
61 int ipkg_old; 61 int ipkg_old;
62 int editedserver; 62 int editedserver;
63 int editeddestination; 63 int editeddestination;
64 int currentSetting; 64 int currentSetting;
65 int installationSettingsCount; 65 int installationSettingsCount;
66 bool changed; 66 bool changed;
67 bool serverChanged;
67 68
68 bool readIpkgConfig(const QString&); 69 bool readIpkgConfig(const QString&);
69 void writeIpkgConfig(const QString&); 70 void writeIpkgConfig(const QString&);
70 void writeSettings(); 71 void writeSettings();
71 void readSettings(); 72 void readSettings();
72}; 73};
73 74
74#endif 75#endif
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index be9d6da..fd8279b 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -48,31 +48,31 @@ int PmIpkg::runIpkg(const QString& args, const QString& dest )
48#endif 48#endif
49#ifdef SYSTEM 49#ifdef SYSTEM
50 QString cmd = "/usr/bin/ipkg "; 50 QString cmd = "/usr/bin/ipkg ";
51#endif 51#endif
52 pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); 52 pvDebug( 3,"PmIpkg::runIpkg got dest="+dest);
53 if ( dest == "" ) 53 if ( dest == "" )
54 cmd += " -dest "+settings->getDestinationName(); 54 cmd += " -dest "+settings->getDestinationName();
55 else 55 else
56 cmd += " -dest "+ dest; 56 cmd += " -dest "+ dest;
57 57
58 cmd += " -force-defaults "; 58 cmd += " -force-defaults ";
59 59
60 if (_force_depends) 60 if (installDialog->_force_depends)
61 { 61 {
62 if (_force_depends->isChecked()) 62 if (installDialog->_force_depends->isChecked())
63 cmd += " -force-depends "; 63 cmd += " -force-depends ";
64 if (_force_reinstall->isChecked()) 64 if (installDialog->_force_reinstall->isChecked())
65 cmd += " -force-reinstall "; 65 cmd += " -force-reinstall ";
66 if (_force_remove->isChecked()) 66 if (installDialog->_force_remove->isChecked())
67 cmd += " -force-removal-of-essential-packages "; 67 cmd += " -force-removal-of-essential-packages ";
68 } 68 }
69 69
70 out( "<hr><br>Starting to "+ args+"<br>\n"); 70 out( "<hr><br>Starting to "+ args+"<br>\n");
71 cmd += args; 71 cmd += args;
72 int r = 0; 72 int r = 0;
73#ifdef PROC 73#ifdef PROC
74 QString o = "start"; 74 QString o = "start";
75 Process *ipkg = new Process( cmd ); 75 Process *ipkg = new Process( cmd );
76 out( "running:<br>\n"+ipkg->arguments().join(" ")+"<br>\n" ); 76 out( "running:<br>\n"+ipkg->arguments().join(" ")+"<br>\n" );
77 QString description; 77 QString description;
78 ipkg->exec("",o); 78 ipkg->exec("",o);
@@ -164,141 +164,106 @@ void PmIpkg::processLinkDir( QString file, QString dest )
164 if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink"); 164 if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink");
165 if ( dest == "???" || dest == "" ) return; 165 if ( dest == "???" || dest == "" ) return;
166 QString destFile = file; 166 QString destFile = file;
167 file = dest+"/"+file; 167 file = dest+"/"+file;
168 if (file == dest) return; 168 if (file == dest) return;
169 QFileInfo fileInfo( file ); 169 QFileInfo fileInfo( file );
170 if ( fileInfo.isDir() ) 170 if ( fileInfo.isDir() )
171 { 171 {
172 pvDebug(4, "process dir "+file); 172 pvDebug(4, "process dir "+file);
173 QDir destDir( destFile ); 173 QDir destDir( destFile );
174 if (linkOpp==createLink) destDir.mkdir( destFile, true ); 174 if (linkOpp==createLink) destDir.mkdir( destFile, true );
175 QDir d( file ); 175 QDir d( file );
176 d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); 176// d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
177 const QFileInfoList *list = d.entryInfoList(); 177 const QFileInfoList *list = d.entryInfoList();
178 QFileInfoListIterator it( *list ); 178 QFileInfoListIterator it( *list );
179 QFileInfo *fi; 179 QFileInfo *fi;
180 qDebug( "while %i",list->count());
180 while ( (fi=it.current()) ) 181 while ( (fi=it.current()) )
181 { 182 {
183 pvDebug(4, "processLinkDir "+fi->absFilePath());
182 processLinkDir( fi->absFilePath(), dest ); 184 processLinkDir( fi->absFilePath(), dest );
183 ++it; 185 ++it;
184 } 186 }
185// if (linkOpp==removeLink)
186// {
187 // pvDebug(2,"remove destDir "+ destFile );
188 // destDir.remove( destFile, true );
189// }
190 } else 187 } else
191 if ( fileInfo.isFile() ) 188 if ( fileInfo.isFile() )
192 { 189 {
193 const char *instFile = strdup( (file).ascii() ); 190 const char *instFile = strdup( (file).ascii() );
194 const char *linkFile = strdup( (destFile).ascii()); 191 const char *linkFile = strdup( (destFile).ascii());
195 if( linkOpp==createLink ) 192 if( linkOpp==createLink )
196 { 193 {
197 pvDebug(4, "linking: "+file+" -> "+destFile ); 194 pvDebug(4, "linking: "+file+" -> "+destFile );
198 symlink( instFile, linkFile ); 195 symlink( instFile, linkFile );
199 } 196 }
200 } else { 197 } else {
201 const char *linkFile = strdup( (destFile).ascii()); 198 const char *linkFile = strdup( (destFile).ascii());
202 if( linkOpp==removeLink ) 199 if( linkOpp==removeLink )
203 { 200 {
204 pvDebug(4,"removing "+destFile+" no "+file);
205 QFileInfo toRemoveLink( destFile ); 201 QFileInfo toRemoveLink( destFile );
206 if ( !QFile::exists( file ) && toRemoveLink.isSymLink() ) 202 if ( !QFile::exists( file ) && toRemoveLink.isSymLink() )
203 {
204 pvDebug(4,"removing "+destFile+" no "+file);
207 unlink( linkFile ); 205 unlink( linkFile );
208 } 206 }
209 } 207 }
210} 208}
209}
211 210
212void PmIpkg::loadList( PackageList pl ) 211void PmIpkg::loadList( PackageList pl )
213 { 212 {
214 for( Package *pack = pl.first();pack ; (pack = pl.next()) ) 213 for( Package *pack = pl.first();pack ; (pack = pl.next()) )
215 { 214 {
216 if ( pack && (pack->name() != "") && pack) 215 if ( pack && (pack->name() != "") && pack)
217 { 216 {
218 if ( pack->toInstall() ) 217 if ( pack->toInstall() )
219 to_install.append( pack ); 218 to_install.append( pack );
220 if ( pack->toRemove() ) 219 if ( pack->toRemove() )
221 to_remove.append( pack ); 220 to_remove.append( pack );
222 } 221 }
223 } 222 }
224} 223}
225 224
226void PmIpkg::commit( PackageList pl ) 225void PmIpkg::commit()
227 { 226 {
228 int sizecount = 0; 227 int sizecount = 0;
229// QString rem="<b>"+tr("To remove:")+"</b><br>\n";
230// QString inst="<b>"+tr("To install:")+"</b><br>\n";
231 loadList(pl);
232 for (uint i=0; i < to_remove.count(); i++) 228 for (uint i=0; i < to_remove.count(); i++)
233 sizecount += 1; 229 sizecount += 1;
234 for (uint i=0; i < to_install.count(); i++) 230 for (uint i=0; i < to_install.count(); i++)
235 sizecount += to_install.at(i)->size().toInt(); 231 sizecount += to_install.at(i)->size().toInt();
236 runwindow->progress->setTotalSteps(sizecount); 232 runwindow->progress->setTotalSteps(sizecount);
237 startDialog(); 233 startDialog();
238} 234}
239 235
240void PmIpkg::startDialog() 236void PmIpkg::startDialog()
241{ 237{
242 installDialog = new QDialog(0,0,true); 238 installDialog = new InstallDialog(settings,0,0,true);
243 QGridLayout *RunWindowLayout = new QGridLayout( installDialog );
244 RunWindowLayout->setSpacing( 2 );
245 RunWindowLayout->setMargin( 2 );
246
247 PackageListView *plv = new PackageListView(installDialog, "install",settings);
248 plv->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding, plv->sizePolicy().mayShrinkVertically()) );
249 RunWindowLayout->addWidget( plv, 1, 0 );
250 QCheckListItem *toRemoveItem; 239 QCheckListItem *toRemoveItem;
251 toRemoveItem= new QCheckListItem( plv, QObject::tr("To remove") ); 240 toRemoveItem= new QCheckListItem( installDialog->ListViewPackages, QObject::tr("To remove") );
252 toRemoveItem->setOpen( true ); 241 toRemoveItem->setOpen( true );
253 for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) 242 for (Package *it=to_remove.first(); it != 0; it=to_remove.next() )
254 { 243 {
255 toRemoveItem->insertItem( new PackageListItem(plv, it,settings) ); 244 toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, it,settings) );
256 } 245 }
257 QCheckListItem *toInstallItem; 246 QCheckListItem *toInstallItem;
258 toInstallItem = new QCheckListItem( plv, QObject::tr("To install") ); 247 toInstallItem = new QCheckListItem( installDialog->ListViewPackages, QObject::tr("To install") );
259 toInstallItem->setOpen( true ); 248 toInstallItem->setOpen( true );
260 for (Package *it=to_install.first(); it != 0; it=to_install.next() ) 249 for (Package *it=to_install.first(); it != 0; it=to_install.next() )
261 { 250 {
262 toInstallItem->insertItem( new PackageListItem(plv, it,settings) ); 251 toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, it,settings) );
263 } 252 }
264
265 QGroupBox *GroupBox1 = new QGroupBox( installDialog, "Ipkg" );
266 GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, GroupBox1->sizePolicy().mayShrinkVertically() ) );
267 GroupBox1->setTitle( tr( "Ipkg options" ) );
268 GroupBox1->setColumnLayout(0, Qt::Vertical );
269 GroupBox1->layout()->setSpacing( 0 );
270 GroupBox1->layout()->setMargin( 0 );
271 QGridLayout *GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
272 GroupBox1Layout->setAlignment( Qt::AlignTop );
273 GroupBox1Layout->setSpacing( 3 );
274 GroupBox1Layout->setMargin( 3 );
275 _force_depends = new QCheckBox( GroupBox1, "_force_depends" );
276 _force_depends->setText( tr( "-force-depends" ) );
277 _force_depends->setAutoResize( TRUE );
278 _force_depends->setChecked(true);
279 GroupBox1Layout->addWidget( _force_depends, 0, 0 );
280 _force_reinstall = new QCheckBox( GroupBox1, "_force_reinstall" );
281 _force_reinstall->setText( tr( "-force-reinstall" ) );
282 _force_reinstall->setAutoResize( TRUE );
283 GroupBox1Layout->addWidget( _force_reinstall, 1, 0 );
284 _force_remove = new QCheckBox( GroupBox1, "_force_remove" );
285 _force_remove->setText( tr( "-force-removal-of-essential-packages" ) );
286 _force_remove->setAutoResize( TRUE );
287 GroupBox1Layout->addWidget( _force_remove, 1, 0 );
288 RunWindowLayout->addWidget( GroupBox1 , 3, 0 );
289 installDialog->showMaximized(); 253 installDialog->showMaximized();
290 if ( installDialog->exec() ) doIt(); 254 if ( installDialog->exec() ) doIt();
291 installDialog->close(); 255 installDialog->close();
292 out(tr("<b>All done.</b>")); 256 out(tr("<b>All done.</b>"));
257 to_install.clear();
293} 258}
294 259
295void PmIpkg::doIt() 260void PmIpkg::doIt()
296{ 261{
297 show( true ); 262 show( true );
298 remove(); 263 remove();
299 install(); 264 install();
300} 265}
301 266
302 267
303void PmIpkg::remove() 268void PmIpkg::remove()
304{ 269{
@@ -348,42 +313,45 @@ void PmIpkg::install()
348 out( "<br>creating links<br>" ); 313 out( "<br>creating links<br>" );
349 out( "for package "+it->name()+" in "+it->dest()+"<br>" ); 314 out( "for package "+it->name()+" in "+it->dest()+"<br>" );
350 makeLinks( it ); 315 makeLinks( it );
351 } 316 }
352 it->processed(); 317 it->processed();
353 // to_install.take( it->name() ); 318 // to_install.take( it->name() );
354 out("<br><hr>"); 319 out("<br><hr>");
355 }else{ 320 }else{
356 out("<b>"+tr("Error while installing")+"</b><hr>"+it->name()); 321 out("<b>"+tr("Error while installing")+"</b><hr>"+it->name());
357 } 322 }
358 } 323 }
359 out("<br>"); 324 out("<br>");
325 to_install.clear();
360} 326}
361 327
362void PmIpkg::createLinks( const QString &dest ) 328void PmIpkg::createLinks( const QString &dest )
363{ 329{
364 pvDebug(2,"PmIpkg::createLinks "+dest); 330 pvDebug(2,"PmIpkg::createLinks "+dest);
365 linkOpp=createLink; 331 linkOpp=createLink;
366 QString url = settings->getDestinationUrlByName( dest ); 332 QString url = settings->getDestinationUrlByName( dest );
367 url = url==""?dest:url; 333 url = url==""?dest:url;
368 processLinkDir( "/", url ); 334 processLinkDir( "/opt", url );
335 processLinkDir( "/usr", url );
369} 336}
370 337
371void PmIpkg::removeLinks( const QString &dest ) 338void PmIpkg::removeLinks( const QString &dest )
372{ 339{
373 pvDebug(2,"PmIpkg::removeLinks "+dest); 340 pvDebug(2,"PmIpkg::removeLinks "+dest);
374 linkOpp=removeLink; 341 linkOpp=removeLink;
375 QString url = settings->getDestinationUrlByName( dest ); 342 QString url = settings->getDestinationUrlByName( dest );
376 url = url==""?dest:url; 343 url = url==""?dest:url;
377 processLinkDir( "/", url ); 344 processLinkDir( "/opt", url );
345 processLinkDir( "/usr", url );
378} 346}
379 347
380void PmIpkg::update() 348void PmIpkg::update()
381{ 349{
382 show( false ); 350 show( false );
383 runIpkg( "update" ); 351 runIpkg( "update" );
384 runwindow->close(); 352 runwindow->close();
385} 353}
386 354
387void PmIpkg::out( QString o ) 355void PmIpkg::out( QString o )
388{ 356{
389 runwindow->outPut->append(o); 357 runwindow->outPut->append(o);
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h
index 3799969..d2490e8 100644
--- a/noncore/unsupported/oipkg/pmipkg.h
+++ b/noncore/unsupported/oipkg/pmipkg.h
@@ -1,60 +1,59 @@
1#ifndef PMIPKG_H 1#ifndef PMIPKG_H
2#define PMIPKG_H 2#define PMIPKG_H
3 3
4 4
5#include <qobject.h> 5#include <qobject.h>
6#include <qlist.h> 6#include <qlist.h>
7#include <qstring.h> 7#include <qstring.h>
8#include <qwidget.h> 8#include <qwidget.h>
9#include "pksettings.h" 9#include "pksettings.h"
10#include "runwindow.h" 10#include "runwindow.h"
11#include "packagelist.h" 11#include "packagelist.h"
12#include "installdialog.h"
12#include "debug.h" 13#include "debug.h"
13 14
14#define createLink 0 15#define createLink 0
15#define removeLink 1 16#define removeLink 1
16 17
17class Package; 18class Package;
18class PmIpkg : public QObject 19class PmIpkg : public QObject
19{ 20{
20 Q_OBJECT 21 Q_OBJECT
21public: 22public:
22 PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); 23 PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 );
23 ~PmIpkg(); 24 ~PmIpkg();
24 25
25 int linkOpp; 26 int linkOpp;
26 void loadList( PackageList ); 27 void loadList( PackageList );
27 void commit( PackageList ); 28 void commit();
28 void update(); 29 void update();
29 void showButtons(bool b=true); 30 void showButtons(bool b=true);
30 void show( bool buttons=true ); 31 void show( bool buttons=true );
31 32
32public slots: 33public slots:
33 void doIt(); 34 void doIt();
34 void install(); 35 void install();
35 void remove(); 36 void remove();
36 void installFile(const QString &fileName, const QString &dest=""); 37 void installFile(const QString &fileName, const QString &dest="");
37 void removeFile(const QString &fileName, const QString &dest=""); 38 void removeFile(const QString &fileName, const QString &dest="");
38 void createLinks( const QString &dest ); 39 void createLinks( const QString &dest );
39 void removeLinks( const QString &dest ); 40 void removeLinks( const QString &dest );
40 41
41private: 42private:
42 //int sizecount;
43 PackageManagerSettings* settings; 43 PackageManagerSettings* settings;
44 RunWindow *runwindow; 44 RunWindow *runwindow;
45 QDialog *installDialog; 45 InstallDialog *installDialog;
46 QList<Package> to_remove; 46 QList<Package> to_remove;
47 QList<Package> to_install; 47 QList<Package> to_install;
48// bool runwindowopen;
49 QString fileNameToInstall; 48 QString fileNameToInstall;
50 QCheckBox *_force_reinstall; 49 QCheckBox *_force_reinstall;
51 QCheckBox *_force_remove; 50 QCheckBox *_force_remove;
52 QCheckBox *_force_depends; 51 QCheckBox *_force_depends;
53 void startDialog(); 52 void startDialog();
54 void makeLinks(Package*); 53 void makeLinks(Package*);
55 void linkPackage( QString, QString ); 54 void linkPackage( QString, QString );
56 void processLinkDir( QString , QString ); 55 void processLinkDir( QString , QString );
57 int runIpkg(const QString& args, const QString& dest="" ); 56 int runIpkg(const QString& args, const QString& dest="" );
58 void out( QString ); 57 void out( QString );
59 QStringList* getList( QString, QString ); 58 QStringList* getList( QString, QString );
60 void processFileList( QStringList*, QString ); 59 void processFileList( QStringList*, QString );
diff --git a/noncore/unsupported/oipkg/settings.h b/noncore/unsupported/oipkg/settings.h
index bab7a4f..f01cb69 100644
--- a/noncore/unsupported/oipkg/settings.h
+++ b/noncore/unsupported/oipkg/settings.h
@@ -46,21 +46,22 @@ public slots:
46 void removeInstallationSetting(); 46 void removeInstallationSetting();
47 void renameInstallationSetting(); 47 void renameInstallationSetting();
48 48
49private: 49private:
50 QIntDict<QString> serverurlDic; 50 QIntDict<QString> serverurlDic;
51 QIntDict<QString> destinationurlDic; 51 QIntDict<QString> destinationurlDic;
52 int ipkg_old; 52 int ipkg_old;
53 int editedserver; 53 int editedserver;
54 int editeddestination; 54 int editeddestination;
55 int currentSetting; 55 int currentSetting;
56 int installationSettingsCount; 56 int installationSettingsCount;
57 bool changed; 57 bool changed;
58 bool serverChanged;
58 59
59 bool readIpkgConfig(const QString&); 60 bool readIpkgConfig(const QString&);
60 void writeIpkgConfig(const QString&); 61 void writeIpkgConfig(const QString&);
61 void writeSettings(); 62 void writeSettings();
62 void readSettings(); 63 void readSettings();
63}; 64};
64 65
65#endif 66#endif
66 67