summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/installdlg.cpp61
-rw-r--r--noncore/settings/packagemanager/installdlg.h14
-rw-r--r--noncore/settings/packagemanager/mainwindow.cpp2
3 files changed, 63 insertions, 14 deletions
diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp
index 945dfed..781f8f5 100644
--- a/noncore/settings/packagemanager/installdlg.cpp
+++ b/noncore/settings/packagemanager/installdlg.cpp
@@ -32,2 +32,3 @@ _;:, .> :=|. This file is free software; you can
32#include <opie2/ofiledialog.h> 32#include <opie2/ofiledialog.h>
33#include <opie2/oprocess.h>
33 34
@@ -59,2 +60,3 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap
59 , m_currCommand( 0 ) 60 , m_currCommand( 0 )
61 , m_destItem( 0x0 )
60{ 62{
@@ -165,6 +167,2 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap
165 167
166InstallDlg::~InstallDlg()
167{
168}
169
170void InstallDlg::slotDisplayAvailSpace( const QString &destination ) 168void InstallDlg::slotDisplayAvailSpace( const QString &destination )
@@ -178,5 +176,6 @@ void InstallDlg::slotDisplayAvailSpace( const QString &destination )
178 // Get destination 176 // Get destination
179 OConfItem *dest = m_packman->findConfItem( OConfItem::Destination, destination ); 177 if ( !destination.isNull() )
178 m_destItem = m_packman->findConfItem( OConfItem::Destination, destination );
180 179
181 if ( dest ) 180 if ( m_destItem )
182 { 181 {
@@ -184,3 +183,3 @@ void InstallDlg::slotDisplayAvailSpace( const QString &destination )
184 struct statfs fs; 183 struct statfs fs;
185 if ( !statfs( dest->value(), &fs ) ) 184 if ( !statfs( m_destItem->value(), &fs ) )
186 { 185 {
@@ -222,2 +221,9 @@ void InstallDlg::slotBtnStart()
222 // Start was clicked, start executing 221 // Start was clicked, start executing
222 QString dest;
223 if ( m_destination )
224 {
225 dest = m_destination->currentText();
226 m_destination->setEnabled( false );
227 }
228
223 m_btnOptions->setEnabled( false ); 229 m_btnOptions->setEnabled( false );
@@ -233,6 +239,2 @@ void InstallDlg::slotBtnStart()
233 239
234 QString dest;
235 if ( m_destination )
236 dest = m_destination->currentText();
237
238 for ( m_currCommand = 0; m_currCommand < m_numCommands; m_currCommand++ ) 240 for ( m_currCommand = 0; m_currCommand < m_numCommands; m_currCommand++ )
@@ -243,2 +245,36 @@ void InstallDlg::slotBtnStart()
243 } 245 }
246 slotProcessDone(0l);
247
248 // Get destination
249/*
250 if ( dest == "root" )
251 {
252 slotProcessDone(0l);
253 return;
254 }
255
256 m_destItem = m_packman->findConfItem( OConfItem::Destination, dest );
257 if ( m_destItem )
258 {
259 QString path = m_destItem->value();
260 Opie::Core::OProcess *process = new Opie::Core::OProcess( this, "ipkg-link process" );
261 connect( process, SIGNAL(processExited(Opie::Core::OProcess*)),
262 this, SLOT(slotProcessDone(Opie::Core::OProcess*)) );
263
264 *process << "ipkg-link" << "mount" << path;
265 if ( !process->start( Opie::Core::OProcess::NotifyOnExit,
266 Opie::Core::OProcess::NoCommunication ) )
267 slotProcessDone( 0l );
268 m_output->append( tr( "Starting ipkg-link to link installed applications." ) );
269 m_output->setCursorPosition( m_output->numLines(), 0 );
270 }
271*/
272}
273
274void InstallDlg::slotProcessDone( Opie::Core::OProcess *proc )
275{
276 delete proc;
277
278 m_output->append( tr( "The package linking is done." ) );
279 m_output->setCursorPosition( m_output->numLines(), 0 );
244 280
@@ -296,2 +332,5 @@ void InstallDlg::slotOutput( char *msg )
296 m_output->setCursorPosition( m_output->numLines(), 0 ); 332 m_output->setCursorPosition( m_output->numLines(), 0 );
333
334 // Update available space
335 slotDisplayAvailSpace( QString::null );
297} 336}
diff --git a/noncore/settings/packagemanager/installdlg.h b/noncore/settings/packagemanager/installdlg.h
index cddc911..f45c17c 100644
--- a/noncore/settings/packagemanager/installdlg.h
+++ b/noncore/settings/packagemanager/installdlg.h
@@ -41,4 +41,13 @@ class QPushButton;
41 41
42class OConfItem;
42class OPackageManager; 43class OPackageManager;
43 44
45namespace Opie
46{
47 namespace Core
48 {
49 class OProcess;
50 }
51}
52
44class InstallDlg : public QWidget 53class InstallDlg : public QWidget
@@ -56,3 +65,2 @@ public:
56 const QStringList &packages3 = QStringList() ); 65 const QStringList &packages3 = QStringList() );
57 ~InstallDlg();
58 66
@@ -73,2 +81,3 @@ private:
73 QStringList m_packages[3]; // Lists of package names associated to commands (m_command[]) 81 QStringList m_packages[3]; // Lists of package names associated to commands (m_command[])
82 OConfItem *m_destItem; // Pointer to destination for package installation
74 83
@@ -79,3 +88,4 @@ private slots:
79 void slotBtnOptions(); 88 void slotBtnOptions();
80 89 void slotProcessDone( Opie::Core::OProcess *proc );
90
81 // Execution slots 91 // Execution slots
diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp
index 5e15874..459a75b 100644
--- a/noncore/settings/packagemanager/mainwindow.cpp
+++ b/noncore/settings/packagemanager/mainwindow.cpp
@@ -533,3 +533,3 @@ void MainWindow::slotApply()
533 // Create package manager output widget 533 // Create package manager output widget
534 InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Apply changes" ), true, 534 InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Apply changes" ), !installList.isEmpty(),
535 removeCmd, removeList, 535 removeCmd, removeList,