Diffstat (limited to 'noncore/apps/opie-console/dialdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/dialdialog.cpp | 51 |
1 files changed, 20 insertions, 31 deletions
diff --git a/noncore/apps/opie-console/dialdialog.cpp b/noncore/apps/opie-console/dialdialog.cpp index 0d115bc..ac1e1db 100644 --- a/noncore/apps/opie-console/dialdialog.cpp +++ b/noncore/apps/opie-console/dialdialog.cpp | |||
@@ -22,27 +22,21 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f | |||
22 | QLabel *textLabel = new QLabel( this ); | 22 | QLabel *textLabel = new QLabel( this ); |
23 | 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") ); |
24 | 24 | ||
25 | LCD1 = new QLCDNumber( this, "LCD" ); | 25 | m_dialLine = new QLineEdit( this ); |
26 | QFont LCD_font1( LCD1->font() ); | 26 | m_dialLine->setReadOnly( true ); |
27 | LCD_font1.setPointSize( 7 ); | 27 | m_dialLine->setFrame( false ); |
28 | LCD1->setFont( LCD_font1 ); | 28 | m_dialLine->setAlignment( Qt::AlignLeft ); |
29 | LCD1->setNumDigits( 8 ); | 29 | QFont dialLine_font( m_dialLine->font() ); |
30 | LCD1->setSegmentStyle( QLCDNumber::Flat ); | 30 | dialLine_font.setBold( TRUE ); |
31 | LCD1->setMaximumHeight( 30 ); | 31 | dialLine_font.setPointSize( 18 ); |
32 | 32 | m_dialLine->setFont( dialLine_font ); | |
33 | LCD2 = new QLCDNumber( this, "LCD" ); | 33 | |
34 | QFont LCD_font2( LCD2->font() ); | 34 | QWidget* dialWidget = new QWidget( this ); |
35 | LCD_font2.setPointSize( 7 ); | 35 | QGridLayout *layout = new QGridLayout( dialWidget , 4, 3 ); |
36 | LCD2->setFont( LCD_font2 ); | ||
37 | LCD2->setNumDigits( 8 ); | ||
38 | LCD2->setSegmentStyle( QLCDNumber::Flat ); | ||
39 | LCD2->setMaximumHeight( 30 ); | ||
40 | |||
41 | QGridLayout *layout = new QGridLayout( this , 4, 3 ); | ||
42 | 36 | ||
43 | QButtonGroup *dialButtons = new QButtonGroup( ); | 37 | QButtonGroup *dialButtons = new QButtonGroup( ); |
44 | 38 | ||
45 | QPushButton *number0 = new QPushButton( this ); | 39 | QPushButton *number0 = new QPushButton( dialWidget ); |
46 | number0->setText( QString( "0" ) ); | 40 | number0->setText( QString( "0" ) ); |
47 | QFont number0_font( number0->font() ); | 41 | QFont number0_font( number0->font() ); |
48 | number0_font.setBold( TRUE ); | 42 | number0_font.setBold( TRUE ); |
@@ -52,7 +46,7 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f | |||
52 | 46 | ||
53 | int x = 0, y = 0; | 47 | int x = 0, y = 0; |
54 | for ( int i = 0 ; i < 9; i++ ) { | 48 | for ( int i = 0 ; i < 9; i++ ) { |
55 | QPushButton *number = new QPushButton( this ); | 49 | QPushButton *number = new QPushButton( dialWidget ); |
56 | number->setText( QString( "%1" ).arg( i + 1 ) ); | 50 | number->setText( QString( "%1" ).arg( i + 1 ) ); |
57 | QFont number_font( number->font() ); | 51 | QFont number_font( number->font() ); |
58 | number_font.setBold( TRUE ); | 52 | number_font.setBold( TRUE ); |
@@ -72,14 +66,13 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f | |||
72 | 66 | ||
73 | connect( dialButtons, SIGNAL( clicked( int ) ), this, SLOT( slotEnterNumber( int ) ) ); | 67 | connect( dialButtons, SIGNAL( clicked( int ) ), this, SLOT( slotEnterNumber( int ) ) ); |
74 | 68 | ||
75 | mainLayout->addStretch( 0 ); | 69 | mainLayout->addStretch( 2 ); |
76 | mainLayout->addWidget( textLabel ); | 70 | mainLayout->addWidget( textLabel ); |
77 | QHBoxLayout *lcdLayout = new QHBoxLayout(mainLayout); | 71 | mainLayout->addStretch( 1 ); |
78 | lcdLayout->addWidget( LCD1 ); | 72 | mainLayout->addWidget( m_dialLine ); |
79 | lcdLayout->addWidget( LCD2 ); | 73 | mainLayout->addStretch( 2 ); |
80 | mainLayout->addStretch( 0 ); | 74 | mainLayout->addWidget( dialWidget ); |
81 | mainLayout->addLayout( layout ); | 75 | mainLayout->addStretch( 4 ); |
82 | mainLayout->addStretch( 0 ); | ||
83 | } | 76 | } |
84 | 77 | ||
85 | 78 | ||
@@ -102,10 +95,6 @@ QString DialDialog::number() { | |||
102 | 95 | ||
103 | void DialDialog::setNumber( QString number ) | 96 | void DialDialog::setNumber( QString number ) |
104 | { | 97 | { |
105 | QString n1; | 98 | m_dialLine->setText( QString("%1").arg( 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() ); | ||
110 | } | 99 | } |
111 | 100 | ||