summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/installdlg.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/packagemanager/installdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/installdlg.cpp61
1 files changed, 50 insertions, 11 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
#include <opie2/ofiledialog.h>
+#include <opie2/oprocess.h>
@@ -59,2 +60,3 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap
, m_currCommand( 0 )
+ , m_destItem( 0x0 )
{
@@ -165,6 +167,2 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap
-InstallDlg::~InstallDlg()
-{
-}
-
void InstallDlg::slotDisplayAvailSpace( const QString &destination )
@@ -178,5 +176,6 @@ void InstallDlg::slotDisplayAvailSpace( const QString &destination )
// Get destination
- OConfItem *dest = m_packman->findConfItem( OConfItem::Destination, destination );
+ if ( !destination.isNull() )
+ m_destItem = m_packman->findConfItem( OConfItem::Destination, destination );
- if ( dest )
+ if ( m_destItem )
{
@@ -184,3 +183,3 @@ void InstallDlg::slotDisplayAvailSpace( const QString &destination )
struct statfs fs;
- if ( !statfs( dest->value(), &fs ) )
+ if ( !statfs( m_destItem->value(), &fs ) )
{
@@ -222,2 +221,9 @@ void InstallDlg::slotBtnStart()
// Start was clicked, start executing
+ QString dest;
+ if ( m_destination )
+ {
+ dest = m_destination->currentText();
+ m_destination->setEnabled( false );
+ }
+
m_btnOptions->setEnabled( false );
@@ -233,6 +239,2 @@ void InstallDlg::slotBtnStart()
- QString dest;
- if ( m_destination )
- dest = m_destination->currentText();
-
for ( m_currCommand = 0; m_currCommand < m_numCommands; m_currCommand++ )
@@ -243,2 +245,36 @@ void InstallDlg::slotBtnStart()
}
+ slotProcessDone(0l);
+
+ // Get destination
+/*
+ if ( dest == "root" )
+ {
+ slotProcessDone(0l);
+ return;
+ }
+
+ m_destItem = m_packman->findConfItem( OConfItem::Destination, dest );
+ if ( m_destItem )
+ {
+ QString path = m_destItem->value();
+ Opie::Core::OProcess *process = new Opie::Core::OProcess( this, "ipkg-link process" );
+ connect( process, SIGNAL(processExited(Opie::Core::OProcess*)),
+ this, SLOT(slotProcessDone(Opie::Core::OProcess*)) );
+
+ *process << "ipkg-link" << "mount" << path;
+ if ( !process->start( Opie::Core::OProcess::NotifyOnExit,
+ Opie::Core::OProcess::NoCommunication ) )
+ slotProcessDone( 0l );
+ m_output->append( tr( "Starting ipkg-link to link installed applications." ) );
+ m_output->setCursorPosition( m_output->numLines(), 0 );
+ }
+*/
+}
+
+void InstallDlg::slotProcessDone( Opie::Core::OProcess *proc )
+{
+ delete proc;
+
+ m_output->append( tr( "The package linking is done." ) );
+ m_output->setCursorPosition( m_output->numLines(), 0 );
@@ -296,2 +332,5 @@ void InstallDlg::slotOutput( char *msg )
m_output->setCursorPosition( m_output->numLines(), 0 );
+
+ // Update available space
+ slotDisplayAvailSpace( QString::null );
}