summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/packagemanager/entrydlg.cpp74
-rw-r--r--noncore/settings/packagemanager/entrydlg.h45
-rw-r--r--noncore/settings/packagemanager/installdlg.cpp8
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.cpp10
4 files changed, 85 insertions, 52 deletions
diff --git a/noncore/settings/packagemanager/entrydlg.cpp b/noncore/settings/packagemanager/entrydlg.cpp
index fd275e1..3b794b4 100644
--- a/noncore/settings/packagemanager/entrydlg.cpp
+++ b/noncore/settings/packagemanager/entrydlg.cpp
@@ -1,26 +1,26 @@
/*
-                This file is part of the OPIE Project
+ This file is part of the OPIE Project
=. Copyright (c) 2004 Dan Williams <drw@handhelds.org>
-             .=l.
-           .>+-=
- _;:,     .>    :=|. This file is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU 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 file 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 General
-..}^=.=       =       ; Public License for more details.
-++=   -.     .`     .:
- :     =  ...= . :.=- You should have received a copy of the GNU
- -.   .:....=;==+<; General Public License along with this file;
-  -_. . .   )=.  = see the file COPYING. If not, write to the
-    --        :-=` Free Software Foundation, Inc.,
+ .=l.
+ .>+-=
+_;:, .> :=|. This file is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU 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 file 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 General
+..}^=.= = ; Public License for more details.
+++= -. .` .:
+: = ...= . :.=- You should have received a copy of the GNU
+-. .:....=;==+<; General Public License along with this file;
+ -_. . . )=. = see the file COPYING. If not, write to the
+ -- :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
@@ -30,5 +30,8 @@
#include "entrydlg.h"
+#include <opie2/ofiledialog.h>
+
#include <qpe/qpeapplication.h>
+#include <qpe/resource.h>
#include <qlabel.h>
@@ -40,14 +43,24 @@ EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, boo
: QDialog( parent, name, modal )
{
- QVBoxLayout *vbox = new QVBoxLayout( this, 6, 6 );
+ QGridLayout *layout = new QGridLayout( this, 3, 2, 2, 4 );
QLabel *l = new QLabel( label, this );
l->setAlignment( AlignLeft | AlignTop | WordBreak );
- vbox->addWidget( l );
+ layout->addMultiCellWidget( l, 0, 0, 0, 1 );
m_entry = new QLineEdit( this );
- vbox->addWidget( m_entry );
+ 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 );
+ btn->setMaximumWidth( btn->height() );
+ connect( btn, SIGNAL(clicked()), this, SLOT(slotSelectPath()) );
+ layout->addWidget( btn, 1, 1 );
+
+ layout->setRowStretch( 2, 10 );
- connect( m_entry, SIGNAL(returnPressed()), this, SLOT(tryAccept()) );
+ resize( width(), l->height() + btn->height() + 8 );
}
@@ -79,7 +92,16 @@ QString EntryDlg::getText( const QString &caption, const QString &label, const Q
return result;
}
-void EntryDlg::tryAccept()
+void EntryDlg::slotTryAccept()
{
if ( !m_entry->text().isEmpty() )
accept();
}
+
+void EntryDlg::slotSelectPath()
+{
+ QString path = Opie::Ui::OFileDialog::getDirectory( 0, m_entry->text() );
+ if ( path.at( path.length() - 1 ) == '/' )
+ path.truncate( path.length() - 1 );
+ if ( !path.isNull() )
+ m_entry->setText( path );
+}
diff --git a/noncore/settings/packagemanager/entrydlg.h b/noncore/settings/packagemanager/entrydlg.h
index 33a7920..012589b 100644
--- a/noncore/settings/packagemanager/entrydlg.h
+++ b/noncore/settings/packagemanager/entrydlg.h
@@ -1,26 +1,26 @@
/*
-                This file is part of the OPIE Project
+ This file is part of the OPIE Project
=. Copyright (c) 2004 Dan Williams <drw@handhelds.org>
-             .=l.
-           .>+-=
- _;:,     .>    :=|. This file is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU 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 file 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 General
-..}^=.=       =       ; Public License for more details.
-++=   -.     .`     .:
- :     =  ...= . :.=- You should have received a copy of the GNU
- -.   .:....=;==+<; General Public License along with this file;
-  -_. . .   )=.  = see the file COPYING. If not, write to the
-    --        :-=` Free Software Foundation, Inc.,
+ .=l.
+ .>+-=
+_;:, .> :=|. This file is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU 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 file 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 General
+..}^=.= = ; Public License for more details.
+++= -. .` .:
+: = ...= . :.=- You should have received a copy of the GNU
+-. .:....=;==+<; General Public License along with this file;
+ -_. . . )=. = see the file COPYING. If not, write to the
+ -- :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
@@ -49,5 +49,6 @@ public:
private slots:
- void tryAccept();
+ void slotTryAccept();
+ void slotSelectPath();
private:
diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp
index 36851b0..8aed10d 100644
--- a/noncore/settings/packagemanager/installdlg.cpp
+++ b/noncore/settings/packagemanager/installdlg.cpp
@@ -133,4 +133,5 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap
pic.convertFromImage( Resource::loadImage( "packagemanager/apply" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
m_btnStart = new QPushButton( pic, tr( "Start" ), this );
+ m_btnStart->setMinimumHeight( AppLnk::smallIconSize() );
layout->addWidget( m_btnStart, 3, 0 );
connect( m_btnStart, SIGNAL(clicked()), this, SLOT(slotBtnStart()) );
@@ -138,4 +139,5 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap
pic.convertFromImage( Resource::loadImage( "SettingsIcon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
m_btnOptions = new QPushButton( pic, tr( "Options" ), this );
+ m_btnOptions->setMinimumHeight( AppLnk::smallIconSize() );
layout->addWidget( m_btnOptions, 3, 1 );
connect( m_btnOptions, SIGNAL( clicked() ), this, SLOT(slotBtnOptions()) );
@@ -222,5 +224,5 @@ void InstallDlg::slotBtnStart()
m_btnStart->setText( tr( "Close" ) );
QPixmap pic;
- pic.convertFromImage( Resource::loadImage( "enter" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
+ pic.convertFromImage( Resource::loadImage( "close" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
m_btnStart->setIconSet( pic );
return;
@@ -246,5 +248,5 @@ void InstallDlg::slotBtnStart()
m_btnStart->setText( tr( "Abort" ) );
QPixmap pic;
- pic.convertFromImage( Resource::loadImage( "close" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
+ pic.convertFromImage( Resource::loadImage( "reset" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
m_btnStart->setIconSet( pic );
}
@@ -265,5 +267,5 @@ void InstallDlg::slotBtnStart()
m_btnStart->setText( tr( "Close" ) );
QPixmap pic;
- pic.convertFromImage( Resource::loadImage( "enter" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
+ pic.convertFromImage( Resource::loadImage( "close" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
m_btnStart->setIconSet( pic );
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
index 5f60990..d234251 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
@@ -184,4 +184,5 @@ void OIpkgConfigDlg::initServerWidget()
pic.convertFromImage( Resource::loadImage( "new" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
QPushButton *btn = new QPushButton( pic, tr( "New" ), container );
+ btn->setMinimumHeight( AppLnk::smallIconSize() );
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()) );
@@ -190,4 +191,5 @@ void OIpkgConfigDlg::initServerWidget()
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->setEnabled( false );
QWhatsThis::add( m_serverEditBtn, tr( "Tap here to edit the entry selected above." ) );
@@ -197,4 +199,5 @@ void OIpkgConfigDlg::initServerWidget()
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->setEnabled( false );
QWhatsThis::add( m_serverDeleteBtn, tr( "Tap here to delete the entry selected above." ) );
@@ -226,4 +229,5 @@ void OIpkgConfigDlg::initDestinationWidget()
pic.convertFromImage( Resource::loadImage( "new" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
QPushButton *btn = new QPushButton( pic, tr( "New" ), container );
+ btn->setMinimumHeight( AppLnk::smallIconSize() );
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()) );
@@ -232,4 +236,5 @@ void OIpkgConfigDlg::initDestinationWidget()
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->setEnabled( false );
QWhatsThis::add( m_destEditBtn, tr( "Tap here to edit the entry selected above." ) );
@@ -239,4 +244,5 @@ void OIpkgConfigDlg::initDestinationWidget()
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->setEnabled( false );
QWhatsThis::add( m_destDeleteBtn, tr( "Tap here to delete the entry selected above." ) );
@@ -655,5 +661,7 @@ OIpkgDestDlg::OIpkgDestDlg( OConfItem *dest, QWidget *parent )
QWhatsThis::add( m_location, tr( "Enter the absolute directory path of this entry here." ) );
layout2->addWidget( m_location );
- QPushButton *btn = new QPushButton( Resource::loadPixmap( "folder" ), QString::null, this );
+ QPixmap pic;
+ pic.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
+ QPushButton *btn = new QPushButton( pic, QString::null, this );
btn->setMaximumWidth( btn->height() );
QWhatsThis::add( btn, tr( "Tap here to select the desired location." ) );