summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/dialdialog.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/dialdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/dialdialog.cpp46
1 files changed, 27 insertions, 19 deletions
diff --git a/noncore/apps/opie-console/dialdialog.cpp b/noncore/apps/opie-console/dialdialog.cpp
index 0ace8f7..0d115bc 100644
--- a/noncore/apps/opie-console/dialdialog.cpp
+++ b/noncore/apps/opie-console/dialdialog.cpp
@@ -15,8 +15,6 @@
15DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 15DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
16 : QDialog( parent, name, modal, fl ) { 16 : QDialog( parent, name, modal, fl ) {
17 17
18 m_number = 0;
19
20 setCaption( tr( "Enter number" ) ); 18 setCaption( tr( "Enter number" ) );
21 19
22 QVBoxLayout *mainLayout = new QVBoxLayout( this ); 20 QVBoxLayout *mainLayout = new QVBoxLayout( this );
@@ -24,13 +22,21 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f
24 QLabel *textLabel = new QLabel( this ); 22 QLabel *textLabel = new QLabel( this );
25 textLabel->setText( tr("Enter the number you want to dial. When finished, press ok") ); 23 textLabel->setText( tr("Enter the number you want to dial. When finished, press ok") );
26 24
27 LCD = new QLCDNumber( this, "LCD" ); 25 LCD1 = new QLCDNumber( this, "LCD" );
28 QFont LCD_font( LCD->font() ); 26 QFont LCD_font1( LCD1->font() );
29 LCD_font.setPointSize( 7 ); 27 LCD_font1.setPointSize( 7 );
30 LCD->setFont( LCD_font ); 28 LCD1->setFont( LCD_font1 );
31 LCD->setNumDigits( 25 ); 29 LCD1->setNumDigits( 8 );
32 LCD->setSegmentStyle( QLCDNumber::Flat ); 30 LCD1->setSegmentStyle( QLCDNumber::Flat );
33 LCD->setMaximumHeight( 30 ); 31 LCD1->setMaximumHeight( 30 );
32
33 LCD2 = new QLCDNumber( this, "LCD" );
34 QFont LCD_font2( LCD2->font() );
35 LCD_font2.setPointSize( 7 );
36 LCD2->setFont( LCD_font2 );
37 LCD2->setNumDigits( 8 );
38 LCD2->setSegmentStyle( QLCDNumber::Flat );
39 LCD2->setMaximumHeight( 30 );
34 40
35 QGridLayout *layout = new QGridLayout( this , 4, 3 ); 41 QGridLayout *layout = new QGridLayout( this , 4, 3 );
36 42
@@ -68,12 +74,12 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f
68 74
69 mainLayout->addStretch( 0 ); 75 mainLayout->addStretch( 0 );
70 mainLayout->addWidget( textLabel ); 76 mainLayout->addWidget( textLabel );
71 mainLayout->addWidget( LCD ); 77 QHBoxLayout *lcdLayout = new QHBoxLayout(mainLayout);
78 lcdLayout->addWidget( LCD1 );
79 lcdLayout->addWidget( LCD2 );
72 mainLayout->addStretch( 0 ); 80 mainLayout->addStretch( 0 );
73 mainLayout->addLayout( layout ); 81 mainLayout->addLayout( layout );
74 mainLayout->addStretch( 0 ); 82 mainLayout->addStretch( 0 );
75
76
77} 83}
78 84
79 85
@@ -81,23 +87,25 @@ void DialDialog::slotEnterNumber( int number ) {
81 87
82 // pretty stupid, just for testing .-) 88 // pretty stupid, just for testing .-)
83 89
84 m_number = ( m_number * 10 ) + number; 90 m_number.append(QString("%1").arg(number));
85 qDebug( QString("%1").arg( m_number ) );
86 LCD->display( m_number );
87 91
92 setNumber(m_number);
88} 93}
89 94
90DialDialog::~DialDialog() { 95DialDialog::~DialDialog() {
91} 96}
92 97
93QString DialDialog::number() { 98QString DialDialog::number() {
94 return QString( "%1").arg( m_number ); 99 return m_number;
95 100
96} 101}
97 102
98void DialDialog::setNumber( int number ) 103void DialDialog::setNumber( QString number )
99{ 104{
100 m_number = number; 105 QString n1;
101 LCD->display( m_number ); 106 if(number.length() > 8) n1 = number.left(number.length() - 8);
107 QString n2 = number.right(8);
108 LCD1->display( n1.toInt() );
109 LCD2->display( n2.toInt() );
102} 110}
103 111