summaryrefslogtreecommitdiff
authordrw <drw>2005-06-05 22:41:15 (UTC)
committer drw <drw>2005-06-05 22:41:15 (UTC)
commit56b8917e2cca3715e9a19941965ddd73e6bba5d4 (patch) (side-by-side diff)
tree77f19a696d1cc4568083f38467390b59c5270da2
parent31e8d6aad8220f747113870cfa10261435a2a162 (diff)
downloadopie-56b8917e2cca3715e9a19941965ddd73e6bba5d4.zip
opie-56b8917e2cca3715e9a19941965ddd73e6bba5d4.tar.gz
opie-56b8917e2cca3715e9a19941965ddd73e6bba5d4.tar.bz2
Resource -> OResource
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/packagemanager/entrydlg.cpp8
-rw-r--r--noncore/settings/packagemanager/installdlg.cpp26
-rw-r--r--noncore/settings/packagemanager/mainwindow.cpp38
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.cpp52
-rw-r--r--noncore/settings/packagemanager/packageinfodlg.cpp8
5 files changed, 65 insertions, 67 deletions
diff --git a/noncore/settings/packagemanager/entrydlg.cpp b/noncore/settings/packagemanager/entrydlg.cpp
index 5d61342..1e87e64 100644
--- a/noncore/settings/packagemanager/entrydlg.cpp
+++ b/noncore/settings/packagemanager/entrydlg.cpp
@@ -10,73 +10,73 @@
:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This program is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
: ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
:     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "entrydlg.h"
#include <opie2/ofiledialog.h>
+#include <opie2/oresource.h>
#include <qpe/qpeapplication.h>
-#include <qpe/resource.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qpushbutton.h>
EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal )
: QDialog( parent, name, modal )
{
QGridLayout *layout = new QGridLayout( this, 3, 2, 2, 4 );
QLabel *l = new QLabel( label, this );
l->setAlignment( AlignLeft | AlignTop | WordBreak );
layout->addMultiCellWidget( l, 0, 0, 0, 1 );
m_entry = new QLineEdit( this );
layout->addWidget( m_entry, 1, 0 );
connect( m_entry, SIGNAL(returnPressed()), this, SLOT(slotTryAccept()) );
- QPixmap pic;
- pic.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- QPushButton *btn = new QPushButton( pic, QString::null, this );
+ QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "folder", Opie::Core::OResource::SmallIcon ),
+ QString::null, this );
+ btn->setMinimumHeight( AppLnk::smallIconSize()+4 );
btn->setMaximumWidth( btn->height() );
connect( btn, SIGNAL(clicked()), this, SLOT(slotSelectPath()) );
layout->addWidget( btn, 1, 1 );
layout->setRowStretch( 2, 10 );
resize( width(), l->height() + btn->height() + 8 );
}
void EntryDlg::setText( const QString &text )
{
m_entry->setText( text );
m_entry->selectAll();
}
QString EntryDlg::getText()
{
return m_entry->text();
}
QString EntryDlg::getText( const QString &caption, const QString &label, const QString &text, bool *ok,
QWidget *parent, const char *name )
{
EntryDlg *dlg = new EntryDlg( label, parent, name, true );
diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp
index 205d7ed..15d88ad 100644
--- a/noncore/settings/packagemanager/installdlg.cpp
+++ b/noncore/settings/packagemanager/installdlg.cpp
@@ -10,51 +10,51 @@
:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This program is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
: ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
:     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "installdlg.h"
#include <opie2/ofiledialog.h>
+#include <opie2/oresource.h>
#include <qpe/fileselector.h>
-#include <qpe/resource.h>
#include <qpe/storage.h>
#include <qapplication.h>
#include <qcombobox.h>
#include <qfileinfo.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qmap.h>
#include <qmultilineedit.h>
#include <qpushbutton.h>
#include <sys/vfs.h>
#include "opackagemanager.h"
InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption,
OPackage::Command command1, const QStringList &packages1,
OPackage::Command command2, const QStringList &packages2,
OPackage::Command command3, const QStringList &packages3 )
: QWidget( 0l )
, m_packman( pm )
, m_installFound( false )
, m_numCommands( 0 )
@@ -109,57 +109,56 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap
label = new QLabel( tr( "Space Avail" ), this );
layout->addWidget( label, 1, 0 );
m_availSpace = new QLabel( this );
layout->addWidget( m_availSpace, 1, 1 );
// TODO - select correct destination
slotDisplayAvailSpace( m_destination->currentText() );
}
else
{
m_destination = 0l;
m_availSpace = 0l;
}
QGroupBox *groupBox = new QGroupBox( 0, Qt::Vertical, tr( "Output" ), this );
groupBox->layout()->setSpacing( 0 );
groupBox->layout()->setMargin( 4 );
QVBoxLayout *groupBoxLayout = new QVBoxLayout( groupBox->layout() );
m_output = new QMultiLineEdit( groupBox );
m_output->setReadOnly( true );
groupBoxLayout->addWidget( m_output );
layout->addMultiCellWidget( groupBox, 2, 2, 0, 1 );
- QPixmap pic;
- pic.convertFromImage( Resource::loadImage( "packagemanager/apply" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- m_btnStart = new QPushButton( pic, tr( "Start" ), this );
+ m_btnStart = new QPushButton( Opie::Core::OResource::loadPixmap( "packagemanager/apply",
+ Opie::Core::OResource::SmallIcon ), tr( "Start" ), this );
m_btnStart->setMinimumHeight( AppLnk::smallIconSize() );
layout->addWidget( m_btnStart, 3, 0 );
connect( m_btnStart, SIGNAL(clicked()), this, SLOT(slotBtnStart()) );
- pic.convertFromImage( Resource::loadImage( "SettingsIcon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- m_btnOptions = new QPushButton( pic, tr( "Options" ), this );
+ m_btnOptions = new QPushButton( Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon ),
+ tr( "Options" ), this );
m_btnOptions->setMinimumHeight( AppLnk::smallIconSize() );
layout->addWidget( m_btnOptions, 3, 1 );
connect( m_btnOptions, SIGNAL( clicked() ), this, SLOT(slotBtnOptions()) );
// Display packages being acted upon in output widget
for( int i = 0; i < m_numCommands; i++ )
{
if ( !m_packages[ i ].isEmpty() )
{
QString lineStr = tr( "Packages to " );
switch( m_command[ i ] )
{
case OPackage::Install : lineStr.append( tr( "install" ) );
break;
case OPackage::Remove : lineStr.append( tr( "remove" ) );
break;
case OPackage::Upgrade : lineStr.append( tr( "upgrade" ) );
break;
case OPackage::Download : lineStr.append( tr( "download" ) );
break;
default :
break;
};
@@ -202,99 +201,92 @@ void InstallDlg::slotDisplayAvailSpace( const QString &destination )
long div = 1024 / fs.f_bsize;
if ( !mult ) mult = 1;
if ( !div ) div = 1;
long avail = fs.f_bavail * mult / div;
space = tr( "%1 Kb" ).arg( avail );
}
}
// Display available space
m_availSpace->setText( space );
}
void InstallDlg::slotBtnStart()
{
QString btnText = m_btnStart->text();
if ( btnText == tr( "Abort" ) )
{
// Prevent unexecuted commands from executing
m_currCommand = 999;
// Allow user to close dialog
m_btnStart->setText( tr( "Close" ) );
- QPixmap pic;
- pic.convertFromImage( Resource::loadImage( "close" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- m_btnStart->setIconSet( pic );
+ m_btnStart->setIconSet( Opie::Core::OResource::loadPixmap( "close", Opie::Core::OResource::SmallIcon ) );
return;
}
else if ( btnText == tr( "Close" ) )
{
// TODO - force reload of package data
emit closeInstallDlg();
return;
}
// Start was clicked, start executing
QString dest;
if ( m_installFound )
{
dest = m_destination->currentText();
m_destination->setEnabled( false );
}
m_btnOptions->setEnabled( false );
if ( m_numCommands > 1 )
{
m_btnStart->setText( tr( "Abort" ) );
- QPixmap pic;
- pic.convertFromImage( Resource::loadImage( "reset" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- m_btnStart->setIconSet( pic );
+ m_btnStart->setIconSet( Opie::Core::OResource::loadPixmap( "reset", Opie::Core::OResource::SmallIcon ) );
}
else
{
m_btnStart->setEnabled( false );
}
for ( m_currCommand = 0; m_currCommand < m_numCommands; m_currCommand++ )
{
// Execute next command
m_packman->executeCommand( m_command[ m_currCommand ], m_packages[ m_currCommand ], dest,
this, SLOT(slotOutput(const QString &)), true );
}
// All commands executed, allow user to close dialog
m_btnStart->setEnabled( true );
m_btnStart->setText( tr( "Close" ) );
- QPixmap pic;
- pic.convertFromImage( Resource::loadImage( "close" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- m_btnStart->setIconSet( pic );
+ m_btnStart->setIconSet( Opie::Core::OResource::loadPixmap( "close", Opie::Core::OResource::SmallIcon ) );
m_btnOptions->setEnabled( true );
m_btnOptions->setText( tr( "Save output" ) );
- pic.convertFromImage( Resource::loadImage( "save" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- m_btnOptions->setIconSet( pic );
+ m_btnOptions->setIconSet( Opie::Core::OResource::loadPixmap( "save", Opie::Core::OResource::SmallIcon ) );
}
void InstallDlg::slotBtnOptions()
{
QString btnText = m_btnOptions->text();
if ( btnText == tr( "Options" ) )
{
// Display configuration dialog (only options tab is enabled)
m_packman->configureDlg( true );
return;
}
// Save output was clicked
QMap<QString, QStringList> map;
map.insert( tr( "All" ), QStringList() );
QStringList text;
text << "text/*";
map.insert(tr( "Text" ), text );
text << "*";
map.insert( tr( "All" ), text );
QString filename = Opie::Ui::OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map );
if( !filename.isEmpty() )
{
diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp
index 0e40c01..e0e5e04 100644
--- a/noncore/settings/packagemanager/mainwindow.cpp
+++ b/noncore/settings/packagemanager/mainwindow.cpp
@@ -15,78 +15,78 @@
    .i_,=:_.      -<s. This program is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
: ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
:     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "mainwindow.h"
#include "installdlg.h"
#include "filterdlg.h"
#include "promptdlg.h"
#include "entrydlg.h"
#include "packageinfodlg.h"
#include <opie2/ofiledialog.h>
+#include <opie2/oresource.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/qpeapplication.h>
-#include <qpe/resource.h>
#include <qaction.h>
#include <qdir.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qmenubar.h>
#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qtimer.h>
#include <qtoolbar.h>
#include <qwhatsthis.h>
MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ )
: QMainWindow( parent, name, WStyle_ContextHelp )
, m_config( "packman" )
, m_packman( &m_config, this )
, m_menuBar( this )
, m_toolBar( this )
, m_findBar( this )
, m_widgetStack( this )
, m_packageList( this )
, m_statusWidget( this )
, m_statusText( &m_statusWidget )
, m_statusBar( &m_statusWidget )
- , m_iconUpdated( Resource::loadPixmap( "packagemanager/updated" ) )
- , m_iconInstalled( Resource::loadPixmap( "installed" ) )
+ , m_iconUpdated( Opie::Core::OResource::loadPixmap( "packagemanager/updated" ) )
+ , m_iconInstalled( Opie::Core::OResource::loadPixmap( "installed" ) )
, m_iconNull( m_iconUpdated.size() )
, m_filterName( QString::null )
, m_filterServer( QString::null )
, m_filterDest( QString::null )
, m_filterStatus( OPackageManager::NotDefined )
, m_filterCategory( QString::null )
{
// setCaption( tr( "Package Manager" ) );
m_iconNull.fill( colorGroup().base() );
connect( &m_widgetStack, SIGNAL(aboutToShow(QWidget*)), this, SLOT(slotWidgetStackShow(QWidget*)) );
// Initialize widget stack, package list and status widget
initStatusWidget();
initPackageList();
m_widgetStack.addWidget( &m_statusWidget, 2 );
m_widgetStack.addWidget( &m_packageList, 1 );
setCentralWidget( &m_widgetStack );
// Initialize remaining user interface items
initUI();
@@ -138,141 +138,149 @@ void MainWindow::initStatusWidget()
layout->addWidget( &m_statusBar );
}
void MainWindow::initUI()
{
// Build menu and tool bars
setToolBarsMovable( false );
m_menuBar.setHorizontalStretchable( true );
QMenuBar *mb = new QMenuBar( &m_menuBar );
mb->setMargin( 0 );
// Find toolbar
addToolBar( &m_findBar, QMainWindow::Top, true );
m_findBar.setHorizontalStretchable( true );
m_findEdit = new QLineEdit( &m_findBar );
QWhatsThis::add( m_findEdit, tr( "Type the text to search for here." ) );
m_findBar.setStretchableWidget( m_findEdit );
connect( m_findEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotFindChanged(const QString&)) );
// Packages menu
QPopupMenu *popup = new QPopupMenu( this );
- QAction *a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "packagemanager/update" ), QString::null, 0, this, 0 );
+ QAction *a = new QAction( tr( "Update lists" ), Opie::Core::OResource::loadPixmap( "packagemanager/update",
+ Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 );
a->setWhatsThis( tr( "Tap here to update package lists from servers." ) );
connect( a, SIGNAL(activated()), this, SLOT(slotUpdate()) );
a->addTo( popup );
a->addTo( &m_toolBar );
- QAction *actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "packagemanager/upgrade" ), QString::null, 0, this, 0 );
+ QAction *actionUpgrade = new QAction( tr( "Upgrade" ), Opie::Core::OResource::loadPixmap( "packagemanager/upgrade",
+ Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 );
actionUpgrade->setWhatsThis( tr( "Tap here to upgrade all installed packages if a newer version is available." ) );
connect( actionUpgrade, SIGNAL(activated()), this, SLOT(slotUpgrade()) );
actionUpgrade->addTo( popup );
actionUpgrade->addTo( &m_toolBar );
- QPixmap iconDownload = Resource::loadPixmap( "packagemanager/download" );
- QPixmap iconRemove = Resource::loadPixmap( "packagemanager/remove" );
+ QPixmap iconDownload = Opie::Core::OResource::loadPixmap( "packagemanager/download", Opie::Core::OResource::SmallIcon );
+ QPixmap iconRemove = Opie::Core::OResource::loadPixmap( "packagemanager/remove", Opie::Core::OResource::SmallIcon );
QAction *actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 );
actionDownload->setWhatsThis( tr( "Tap here to download the currently selected package(s)." ) );
connect( actionDownload, SIGNAL(activated()), this, SLOT(slotDownload()) );
actionDownload->addTo( popup );
actionDownload->addTo( &m_toolBar );
- a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "packagemanager/apply" ), QString::null, 0, this, 0 );
+ a = new QAction( tr( "Apply changes" ), Opie::Core::OResource::loadPixmap( "packagemanager/apply",
+ Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 );
a->setWhatsThis( tr( "Tap here to install, remove or upgrade currently selected package(s)." ) );
connect( a, SIGNAL(activated()), this, SLOT(slotApply()) );
a->addTo( popup );
a->addTo( &m_toolBar );
- a = new QAction( tr( "Install local package" ), Resource::loadPixmap( "folder" ), QString::null, 0, this, 0 );
+ a = new QAction( tr( "Install local package" ), Opie::Core::OResource::loadPixmap( "folder",
+ Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 );
a->setWhatsThis( tr( "Tap here to install a package file located on device." ) );
connect( a, SIGNAL(activated()), this, SLOT(slotInstallLocal()) );
a->addTo( popup );
//a->addTo( &m_toolBar );
popup->insertSeparator();
- a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 );
+ a = new QAction( tr( "Configure" ), Opie::Core::OResource::loadPixmap( "SettingsIcon",
+ Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 );
a->setWhatsThis( tr( "Tap here to configure this application." ) );
connect( a, SIGNAL(activated()), this, SLOT(slotConfigure()) );
a->addTo( popup );
mb->insertItem( tr( "Actions" ), popup );
// View menu
popup = new QPopupMenu( this );
m_actionShowNotInstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 );
m_actionShowNotInstalled->setToggleAction( true );
m_actionShowNotInstalled->setWhatsThis( tr( "Tap here to show packages available which have not been installed." ) );
connect( m_actionShowNotInstalled, SIGNAL(activated()), this, SLOT(slotShowNotInstalled()) );
m_actionShowNotInstalled->addTo( popup );
m_actionShowInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 );
m_actionShowInstalled->setToggleAction( true );
m_actionShowInstalled->setWhatsThis( tr( "Tap here to show packages currently installed on this device." ) );
connect( m_actionShowInstalled, SIGNAL(activated()), this, SLOT(slotShowInstalled()) );
m_actionShowInstalled->addTo( popup );
m_actionShowUpdated = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 );
m_actionShowUpdated->setToggleAction( true );
m_actionShowUpdated->setWhatsThis( tr( "Tap here to show packages currently installed on this device which have a newer version available." ) );
connect( m_actionShowUpdated, SIGNAL(activated()), this, SLOT(slotShowUpdated()) );
m_actionShowUpdated->addTo( popup );
popup->insertSeparator();
- m_actionFilter = new QAction( tr( "Filter" ), Resource::loadPixmap( "packagemanager/filter" ),
- QString::null, 0, this, 0 );
+ m_actionFilter = new QAction( tr( "Filter" ), Opie::Core::OResource::loadPixmap( "packagemanager/filter",
+ Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 );
m_actionFilter->setToggleAction( true );
m_actionFilter->setWhatsThis( tr( "Tap here to apply current filter." ) );
connect( m_actionFilter, SIGNAL(toggled(bool)), this, SLOT(slotFilter(bool)) );
m_actionFilter->addTo( popup );
a = new QAction( tr( "Filter settings" ), QString::null, 0, this, 0 );
a->setWhatsThis( tr( "Tap here to change the package filter criteria." ) );
connect( a, SIGNAL(activated()), this, SLOT(slotFilterChange()) );
a->addTo( popup );
popup->insertSeparator();
- a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 );
+ a = new QAction( tr( "Find" ), Opie::Core::OResource::loadPixmap( "find", Opie::Core::OResource::SmallIcon ),
+ QString::null, 0, this, 0 );
a->setWhatsThis( tr( "Tap here to search for text in package names." ) );
connect( a, SIGNAL(activated()), this, SLOT(slotFindShowToolbar()) );
a->addTo( popup );
- m_actionFindNext = new QAction( tr( "Find next" ), Resource::loadIconSet( "next" ), QString::null, 0, this, 0 );
+ m_actionFindNext = new QAction( tr( "Find next" ), Opie::Core::OResource::loadPixmap( "next",
+ Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 );
m_actionFindNext->setEnabled( false );
m_actionFindNext->setWhatsThis( tr( "Tap here to find the next package name containing the text you are searching for." ) );
connect( m_actionFindNext, SIGNAL(activated()), this, SLOT(slotFindNext()) );
m_actionFindNext->addTo( popup );
m_actionFindNext->addTo( &m_findBar );
mb->insertItem( tr( "View" ), popup );
// Finish find toolbar creation
- a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
+ a = new QAction( QString::null, Opie::Core::OResource::loadPixmap( "close", Opie::Core::OResource::SmallIcon ),
+ QString::null, 0, this, 0 );
a->setWhatsThis( tr( "Tap here to hide the find toolbar." ) );
connect( a, SIGNAL(activated()), this, SLOT(slotFindHideToolbar()) );
a->addTo( &m_findBar );
m_findBar.hide();
}
void MainWindow::loadPackageList( OPackageList *packages, bool clearList )
{
if ( clearList )
m_packageList.clear();
if ( packages )
{
for ( OPackageListIterator packageIt( *packages ); packageIt.current(); ++packageIt )
{
OPackage *package = packageIt.current();
QCheckListItem *item = new QCheckListItem( &m_packageList, package->name(),
QCheckListItem::CheckBox );
m_packageList.insertItem( item );
// If a different version of package is available, show update available icon
// Otherwise, show installed icon
if ( !package->versionInstalled().isNull() )
{
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
index 945571f..58c572b 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
@@ -10,51 +10,51 @@
:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This program is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
: ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
:     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "oipkgconfigdlg.h"
#include <opie2/ofiledialog.h>
+#include <opie2/oresource.h>
#include <qpe/qpeapplication.h>
-#include <qpe/resource.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qlistbox.h>
#include <qpushbutton.h>
#include <qscrollview.h>
#include <qwhatsthis.h>
OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent )
: QDialog( parent, QString::null, true, WStyle_ContextHelp )
, m_ipkg( ipkg )
, m_configs( 0l )
, m_installOptions( installOptions )
, m_serverCurrent( -1 )
, m_destCurrent( -1 )
, m_layout( this, 2, 4 )
, m_tabWidget( this )
{
setCaption( tr( "Configuration" ) );
// Initialize configuration widgets
@@ -161,112 +161,110 @@ void OIpkgConfigDlg::reject()
if ( m_configs )
delete m_configs;
}
void OIpkgConfigDlg::initServerWidget()
{
m_serverWidget = new QWidget( this );
// Initialize UI
QVBoxLayout *vb = new QVBoxLayout( m_serverWidget );
QScrollView *sv = new QScrollView( m_serverWidget );
vb->addWidget( sv, 0, 0 );
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->setFrameStyle( QFrame::NoFrame );
QWidget *container = new QWidget( sv->viewport() );
sv->addChild( container );
QGridLayout *layout = new QGridLayout( container, 2, 3, 2, 4 );
m_serverList = new QListBox( container );
QWhatsThis::add( m_serverList, tr( "This is a list of all servers configured. Select one here to edit or delete, or add a new one below." ) );
m_serverList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
connect( m_serverList, SIGNAL(highlighted(int)), this, SLOT(slotServerSelected(int)) );
layout->addMultiCellWidget( m_serverList, 0, 0, 0, 2 );
- QPixmap pic;
- pic.convertFromImage( Resource::loadImage( "new" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- QPushButton *btn = new QPushButton( pic, tr( "New" ), container );
- btn->setMinimumHeight( AppLnk::smallIconSize() );
+ QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ),
+ tr( "New" ), container );
+ btn->setMinimumHeight( AppLnk::smallIconSize()+4 );
QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) );
connect( btn, SIGNAL(clicked()), this, SLOT(slotServerNew()) );
layout->addWidget( btn, 1, 0 );
- pic.convertFromImage( Resource::loadImage( "edit" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- m_serverEditBtn = new QPushButton( pic, tr( "Edit" ), container );
- m_serverEditBtn->setMinimumHeight( AppLnk::smallIconSize() );
+ m_serverEditBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "edit", Opie::Core::OResource::SmallIcon ),
+ tr( "Edit" ), container );
+ m_serverEditBtn->setMinimumHeight( AppLnk::smallIconSize()+4 );
m_serverEditBtn->setEnabled( false );
QWhatsThis::add( m_serverEditBtn, tr( "Tap here to edit the entry selected above." ) );
connect( m_serverEditBtn, SIGNAL(clicked()), this, SLOT(slotServerEdit()) );
layout->addWidget( m_serverEditBtn, 1, 1 );
- pic.convertFromImage( Resource::loadImage( "trash" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- m_serverDeleteBtn = new QPushButton( pic, tr( "Delete" ), container );
- m_serverDeleteBtn->setMinimumHeight( AppLnk::smallIconSize() );
+ m_serverDeleteBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "trash", Opie::Core::OResource::SmallIcon ),
+ tr( "Delete" ), container );
+ m_serverDeleteBtn->setMinimumHeight( AppLnk::smallIconSize()+4 );
m_serverDeleteBtn->setEnabled( false );
QWhatsThis::add( m_serverDeleteBtn, tr( "Tap here to delete the entry selected above." ) );
connect( m_serverDeleteBtn, SIGNAL(clicked()), this, SLOT(slotServerDelete()) );
layout->addWidget( m_serverDeleteBtn, 1, 2 );
}
void OIpkgConfigDlg::initDestinationWidget()
{
m_destWidget = new QWidget( this );
// Initialize UI
QVBoxLayout *vb = new QVBoxLayout( m_destWidget );
QScrollView *sv = new QScrollView( m_destWidget );
vb->addWidget( sv, 0, 0 );
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->setFrameStyle( QFrame::NoFrame );
QWidget *container = new QWidget( sv->viewport() );
sv->addChild( container );
QGridLayout *layout = new QGridLayout( container, 2, 3, 2, 4 );
m_destList = new QListBox( container );
QWhatsThis::add( m_destList, tr( "This is a list of all destinations configured for this device. Select one here to edit or delete, or add a new one below." ) );
m_destList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
connect( m_destList, SIGNAL(highlighted(int)), this, SLOT(slotDestSelected(int)) );
layout->addMultiCellWidget( m_destList, 0, 0, 0, 2 );
- QPixmap pic;
- pic.convertFromImage( Resource::loadImage( "new" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- QPushButton *btn = new QPushButton( pic, tr( "New" ), container );
- btn->setMinimumHeight( AppLnk::smallIconSize() );
+ QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ),
+ tr( "New" ), container );
+ btn->setMinimumHeight( AppLnk::smallIconSize()+4 );
QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) );
connect( btn, SIGNAL(clicked()), this, SLOT(slotDestNew()) );
layout->addWidget( btn, 1, 0 );
- pic.convertFromImage( Resource::loadImage( "edit" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- m_destEditBtn = new QPushButton( pic, tr( "Edit" ), container );
- m_destEditBtn->setMinimumHeight( AppLnk::smallIconSize() );
+ m_destEditBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "edit", Opie::Core::OResource::SmallIcon ),
+ tr( "Edit" ), container );
+ m_destEditBtn->setMinimumHeight( AppLnk::smallIconSize()+4 );
m_destEditBtn->setEnabled( false );
QWhatsThis::add( m_destEditBtn, tr( "Tap here to edit the entry selected above." ) );
connect( m_destEditBtn, SIGNAL(clicked()), this, SLOT(slotDestEdit()) );
layout->addWidget( m_destEditBtn, 1, 1 );
- pic.convertFromImage( Resource::loadImage( "trash" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- m_destDeleteBtn = new QPushButton( pic, tr( "Delete" ), container );
- m_destDeleteBtn->setMinimumHeight( AppLnk::smallIconSize() );
+ m_destDeleteBtn = new QPushButton( Opie::Core::OResource::loadPixmap( "trash", Opie::Core::OResource::SmallIcon ),
+ tr( "Delete" ), container );
+ m_destDeleteBtn->setMinimumHeight( AppLnk::smallIconSize()+4 );
m_destDeleteBtn->setEnabled( false );
QWhatsThis::add( m_destDeleteBtn, tr( "Tap here to delete the entry selected above." ) );
connect( m_destDeleteBtn, SIGNAL(clicked()), this, SLOT(slotDestDelete()) );
layout->addWidget( m_destDeleteBtn, 1, 2 );
}
void OIpkgConfigDlg::initProxyWidget()
{
m_proxyWidget = new QWidget( this );
// Initialize UI
QVBoxLayout *vb = new QVBoxLayout( m_proxyWidget );
QScrollView *sv = new QScrollView( m_proxyWidget );
vb->addWidget( sv, 0, 0 );
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->setFrameStyle( QFrame::NoFrame );
QWidget *container = new QWidget( sv->viewport() );
sv->addChild( container );
QGridLayout *layout = new QGridLayout( container, 4, 2, 2, 4 );
// HTTP proxy server configuration
QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "HTTP Proxy" ), container );
grpbox->layout()->setSpacing( 2 );
grpbox->layout()->setMargin( 4 );
@@ -336,51 +334,52 @@ void OIpkgConfigDlg::initOptionsWidget()
m_optForceOverwrite = new QCheckBox( tr( "Force Overwrite" ), container );
QWhatsThis::add( m_optForceOverwrite, tr( "Tap here to enable or disable the '-force-overwrite' option for Ipkg." ) );
layout->addMultiCellWidget( m_optForceOverwrite, 3, 3, 0, 1 );
QLabel *l = new QLabel( tr( "Information level:" ), container );
QWhatsThis::add( l, tr( "Select information level for Ipkg." ) );
layout->addMultiCellWidget( l, 4, 4, 0, 1 );
m_optVerboseIpkg = new QComboBox( container );
QWhatsThis::add( m_optVerboseIpkg, tr( "Select information level for Ipkg." ) );
m_optVerboseIpkg->insertItem( tr( "Errors only" ) );
m_optVerboseIpkg->insertItem( tr( "Normal messages" ) );
m_optVerboseIpkg->insertItem( tr( "Informative messages" ) );
m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) );
layout->addMultiCellWidget( m_optVerboseIpkg, 5, 5, 0, 1 );
l = new QLabel( tr( "Package source lists directory:" ), container );
QWhatsThis::add( l, tr( "Enter the directory where package source feed information is stored." ) );
layout->addMultiCellWidget( l, 6, 6, 0, 1 );
m_optSourceLists = new QLineEdit( container );
QWhatsThis::add( m_optSourceLists, tr( "Enter the directory where package source feed information is stored." ) );
layout->addWidget( m_optSourceLists, 7, 0 );
- QPixmap pic;
- pic.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- QPushButton *btn = new QPushButton( pic, QString::null, container );
+
+ QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "folder", Opie::Core::OResource::SmallIcon ),
+ QString::null, container );
+ btn->setMinimumHeight( AppLnk::smallIconSize()+4 );
btn->setMaximumWidth( btn->height() );
QWhatsThis::add( btn, tr( "Tap here to select the directory where package source feed information is stored." ) );
connect( btn, SIGNAL(clicked()), this, SLOT(slotOptSelectSourceListsPath()) );
layout->addWidget( btn, 7, 1 );
layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
}
void OIpkgConfigDlg::initData()
{
// Read ipkg configuration (server/destination/proxy) information
if ( m_ipkg && !m_installOptions )
{
m_configs = m_ipkg->configItems();
if ( m_configs )
{
for ( OConfItemListIterator configIt( *m_configs ); configIt.current(); ++configIt )
{
OConfItem *config = configIt.current();
// Add configuration item to the appropriate dialog controls
if ( config )
{
switch ( config->type() )
@@ -641,51 +640,50 @@ OIpkgDestDlg::OIpkgDestDlg( OConfItem *dest, QWidget *parent )
QWhatsThis::add( m_active, tr( "Tap here to indicate whether this entry is active or not." ) );
layout->addWidget( m_active );
layout->addStretch();
QLabel *label = new QLabel( tr( "Name:" ), this );
QWhatsThis::add( label, tr( "Enter the name of this entry here." ) );
layout->addWidget( label );
m_name = new QLineEdit( this );
QWhatsThis::add( m_name, tr( "Enter the name of this entry here." ) );
layout->addWidget( m_name );
layout->addStretch();
label = new QLabel( tr( "Location:" ), this );
QWhatsThis::add( label, tr( "Enter the absolute directory path of this entry here." ) );
layout->addWidget( label );
QHBoxLayout *layout2 = new QHBoxLayout( this, 2, 4 );
layout->addLayout( layout2 );
m_location = new QLineEdit( this );
QWhatsThis::add( m_location, tr( "Enter the absolute directory path of this entry here." ) );
layout2->addWidget( m_location );
- QPixmap pic;
- pic.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- QPushButton *btn = new QPushButton( pic, QString::null, this );
+ QPushButton *btn = new QPushButton( Opie::Core::OResource::loadPixmap( "folder", Opie::Core::OResource::SmallIcon ),
+ QString::null, this );
btn->setMaximumWidth( btn->height() );
QWhatsThis::add( btn, tr( "Tap here to select the desired location." ) );
connect( btn, SIGNAL(clicked()), this, SLOT(slotSelectPath()) );
layout2->addWidget( btn );
// Populate initial information
if ( m_dest )
{
m_name->setText( m_dest->name() );
m_location->setText( m_dest->value() );
m_active->setChecked( m_dest->active() );
}
}
void OIpkgDestDlg::accept()
{
// Save information entered
QString name = m_name->text();
name.replace( QRegExp( " " ), "_" );
m_dest->setName( name );
m_dest->setValue( m_location->text() );
m_dest->setActive( m_active->isChecked() );
QDialog::accept();
diff --git a/noncore/settings/packagemanager/packageinfodlg.cpp b/noncore/settings/packagemanager/packageinfodlg.cpp
index e034f34..8b1b203 100644
--- a/noncore/settings/packagemanager/packageinfodlg.cpp
+++ b/noncore/settings/packagemanager/packageinfodlg.cpp
@@ -11,52 +11,51 @@
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This program is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
: ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
:     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "packageinfodlg.h"
#include "opackage.h"
#include "opackagemanager.h"
+#include <opie2/oresource.h>
#include <opie2/otabwidget.h>
-#include <qpe/resource.h>
-
#include <qlayout.h>
#include <qpushbutton.h>
#include <qwhatsthis.h>
PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package )
: QWidget( 0l )
, m_packman( pm )
, m_information( this )
, m_files( this )
, m_retrieveFiles( 0l )
{
// Initialize UI
if ( parent )
parent->setCaption( package );
QVBoxLayout *layout = new QVBoxLayout( this, 4, 2 );
Opie::Ui::OTabWidget *tabWidget = new Opie::Ui::OTabWidget( this );
layout->addWidget( tabWidget );
// Information tab
QWhatsThis::add( &m_information, tr( "This area contains information about the package." ) );
m_information.reparent( tabWidget, QPoint( 0, 0 ) );
m_information.setReadOnly( true );
@@ -75,50 +74,51 @@ PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QStr
m_information.setText( m_package->information() );
else
{
// Package information is not cached, retrieve it
QStringList list( package );
m_packman->executeCommand( OPackage::Info, list, QString::null,
this, SLOT(slotInfo(const QString &)), true );
}
// Files tab (display only if package is installed)
if ( !m_package->versionInstalled().isNull() )
{
QWidget *filesWidget = new QWidget( tabWidget );
QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 2, 2 );
QWhatsThis::add( &m_files, tr( "This area contains a list of files contained in this package." ) );
m_files.reparent( filesWidget, QPoint( 0, 0 ) );
m_files.setReadOnly( true );
filesLayout->addWidget( &m_files );
// If file list is already cached, display
if ( !m_package->files().isNull() )
m_files.setText( m_package->files() );
else
{
- m_retrieveFiles = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ),
- tr( "Retrieve file list" ), filesWidget );
+ m_retrieveFiles = new QPushButton( Opie::Core::OResource::loadPixmap( "packagemanager/apply",
+ Opie::Core::OResource::SmallIcon ), tr( "Retrieve file list" ),
+ filesWidget );
QWhatsThis::add( m_retrieveFiles, tr( "Tap here to retrieve list of files contained in this package." ) );
filesLayout->addWidget( m_retrieveFiles );
connect( m_retrieveFiles, SIGNAL(clicked()), this, SLOT(slotBtnFileScan()) );
}
tabWidget->addTab( filesWidget, "binary", tr( "File list" ) );
tabWidget->setCurrentTab( tr( "Information" ) );
}
else
m_files.hide();
}
PackageInfoDlg::~PackageInfoDlg()
{
if ( !m_package )
return;
// Cache package information
if ( !m_information.text().isNull() )
m_package->setInformation( m_information.text() );
// Cache package file list
if ( !m_files.text().isEmpty() )