summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/entrydlg.cpp
Unidiff
Diffstat (limited to 'noncore/settings/packagemanager/entrydlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/entrydlg.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/noncore/settings/packagemanager/entrydlg.cpp b/noncore/settings/packagemanager/entrydlg.cpp
index 8deaa37..663abd2 100644
--- a/noncore/settings/packagemanager/entrydlg.cpp
+++ b/noncore/settings/packagemanager/entrydlg.cpp
@@ -25,24 +25,26 @@
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "entrydlg.h" 30#include "entrydlg.h"
31 31
32#include <qlabel.h> 32#include <qlabel.h>
33#include <qlayout.h> 33#include <qlayout.h>
34#include <qlineedit.h> 34#include <qlineedit.h>
35#include <qpushbutton.h> 35#include <qpushbutton.h>
36 36
37#include <qpe/qpeapplication.h>
38
37EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal ) 39EntryDlg::EntryDlg( const QString &label, QWidget* parent, const char* name, bool modal )
38 : QDialog( parent, name, modal ) 40 : QDialog( parent, name, modal )
39{ 41{
40 QVBoxLayout *vbox = new QVBoxLayout( this, 6, 6 ); 42 QVBoxLayout *vbox = new QVBoxLayout( this, 6, 6 );
41 43
42 QLabel *l = new QLabel( label, this ); 44 QLabel *l = new QLabel( label, this );
43 l->setAlignment( AlignLeft | AlignTop | WordBreak ); 45 l->setAlignment( AlignLeft | AlignTop | WordBreak );
44 vbox->addWidget( l ); 46 vbox->addWidget( l );
45 47
46 m_entry = new QLineEdit( this ); 48 m_entry = new QLineEdit( this );
47 vbox->addWidget( m_entry ); 49 vbox->addWidget( m_entry );
48 50
@@ -59,24 +61,25 @@ QString EntryDlg::getText()
59{ 61{
60 return m_entry->text(); 62 return m_entry->text();
61} 63}
62 64
63QString EntryDlg::getText( const QString &caption, const QString &label, const QString &text, bool *ok, 65QString EntryDlg::getText( const QString &caption, const QString &label, const QString &text, bool *ok,
64 QWidget *parent, const char *name ) 66 QWidget *parent, const char *name )
65{ 67{
66 EntryDlg *dlg = new EntryDlg( label, parent, name, true ); 68 EntryDlg *dlg = new EntryDlg( label, parent, name, true );
67 dlg->setCaption( caption ); 69 dlg->setCaption( caption );
68 dlg->setText( text ); 70 dlg->setText( text );
69 71
70 QString result; 72 QString result;
71 *ok = ( dlg->exec() == QDialog::Accepted ); 73
74 *ok = ( QPEApplication::execDialog( dlg ) == QDialog::Accepted );
72 if ( *ok ) 75 if ( *ok )
73 result = dlg->getText(); 76 result = dlg->getText();
74 77
75 delete dlg; 78 delete dlg;
76 return result; 79 return result;
77} 80}
78void EntryDlg::tryAccept() 81void EntryDlg::tryAccept()
79{ 82{
80 if ( !m_entry->text().isEmpty() ) 83 if ( !m_entry->text().isEmpty() )
81 accept(); 84 accept();
82} 85}