summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp
index 65aaa32..19fe46a 100644
--- a/noncore/settings/aqpkg/installdlgimpl.cpp
+++ b/noncore/settings/aqpkg/installdlgimpl.cpp
@@ -1,169 +1,169 @@
/***************************************************************************
installdlgimpl.cpp - description
-------------------
begin : Mon Aug 26 2002
copyright : (C) 2002 by Andy Qua
email : andy.qua@blueyonder.co.uk
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <stdio.h>
#ifdef QWS
#include <qpe/config.h>
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
#include <qpe/storage.h>
#endif
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qdialog.h>
#include <qgroupbox.h>
#include <qmultilineedit.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qpushbutton.h>
#include "datamgr.h"
#include "destination.h"
#include "instoptionsimpl.h"
#include "installdlgimpl.h"
#include "ipkg.h"
#include "utils.h"
#include "global.h"
-InstallDlgImpl::InstallDlgImpl( vector<InstallData> &packageList, DataManager *dataManager, const char *title = 0 )
+InstallDlgImpl::InstallDlgImpl( vector<InstallData> &packageList, DataManager *dataManager, const char *title )
: QWidget( 0, 0, 0 )
{
setCaption( title );
init( TRUE );
pIpkg = 0;
upgradePackages = false;
dataMgr = dataManager;
vector<Destination>::iterator dit;
QString defaultDest = "root";
#ifdef QWS
Config cfg( "aqpkg" );
cfg.setGroup( "settings" );
defaultDest = cfg.readEntry( "dest", "root" );
// Grab flags - Turn MAKE_LINKS on by default (if no flags found)
flags = cfg.readNumEntry( "installFlags", 0 );
#else
flags = 0;
#endif
// Output text is read only
output->setReadOnly( true );
// QFont f( "helvetica" );
// f.setPointSize( 10 );
// output->setFont( f );
// setup destination data
int defIndex = 0;
int i;
for ( i = 0 , dit = dataMgr->getDestinationList().begin() ; dit != dataMgr->getDestinationList().end() ; ++dit, ++i )
{
destination->insertItem( dit->getDestinationName() );
if ( dit->getDestinationName() == defaultDest )
defIndex = i;
}
destination->setCurrentItem( defIndex );
vector<InstallData>::iterator it;
// setup package data
QString remove = tr( "Remove\n" );
QString install = tr( "Install\n" );
QString upgrade = tr( "Upgrade\n" );
for ( it = packageList.begin() ; it != packageList.end() ; ++it )
{
InstallData item = *it;
if ( item.option == "I" )
{
installList.push_back( item );
install.append( QString( " %1\n" ).arg( item.packageName ) );
}
else if ( item.option == "D" )
{
removeList.push_back( item );
remove.append( QString( " %1\n" ).arg( item.packageName ) );
}
else if ( item.option == "U" || item.option == "R" )
{
updateList.push_back( item );
QString type;
if ( item.option == "R" )
type = tr( "(ReInstall)" );
else
type = tr( "(Upgrade)" );
upgrade.append( QString( " %1 %2\n" ).arg( item.packageName ).arg( type ) );
}
}
output->setText( QString( "%1\n%2\n%3\n" ).arg( remove ).arg( install ).arg( upgrade ) );
displayAvailableSpace( destination->currentText() );
}
-InstallDlgImpl::InstallDlgImpl( Ipkg *ipkg, QString initialText, const char *title = 0 )
+InstallDlgImpl::InstallDlgImpl( Ipkg *ipkg, QString initialText, const char *title )
: QWidget( 0, 0, 0 )
{
setCaption( title );
init( FALSE );
pIpkg = ipkg;
output->setText( initialText );
}
InstallDlgImpl::~InstallDlgImpl()
{
if ( pIpkg )
delete pIpkg;
}
void InstallDlgImpl :: init( bool displayextrainfo )
{
QGridLayout *layout = new QGridLayout( this );
layout->setSpacing( 4 );
layout->setMargin( 4 );
if ( displayextrainfo )
{
QLabel *label = new QLabel( tr( "Destination" ), this );
layout->addWidget( label, 0, 0 );
destination = new QComboBox( FALSE, this );
layout->addWidget( destination, 0, 1 );
connect( destination, SIGNAL( highlighted( const QString & ) ),
this, SLOT( displayAvailableSpace( const QString & ) ) );
QLabel *label2 = new QLabel( tr( "Space Avail" ), this );
layout->addWidget( label2, 1, 0 );
txtAvailableSpace = new QLabel( "", this );
layout->addWidget( txtAvailableSpace, 1, 1 );
}
else
{
destination = 0x0;
txtAvailableSpace = 0x0;
}
QGroupBox *GroupBox2 = new QGroupBox( 0, Qt::Vertical, tr( "Output" ), this );
GroupBox2->layout()->setSpacing( 0 );
GroupBox2->layout()->setMargin( 4 );
QVBoxLayout *GroupBox2Layout = new QVBoxLayout( GroupBox2->layout() );
output = new QMultiLineEdit( GroupBox2 );
GroupBox2Layout->addWidget( output );