author | harlekin <harlekin> | 2002-10-12 15:44:01 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-12 15:44:01 (UTC) |
commit | e6b92ad451dba66f4eb5000a41b96eb2ee203dce (patch) (side-by-side diff) | |
tree | 07caa3f11d59c96858dd374d6b7cff90dbe3915e /noncore/apps/opie-console/dialdialog.cpp | |
parent | 83aed438ec060307bf5562d91bd8b61fe60f860b (diff) | |
download | opie-e6b92ad451dba66f4eb5000a41b96eb2ee203dce.zip opie-e6b92ad451dba66f4eb5000a41b96eb2ee203dce.tar.gz opie-e6b92ad451dba66f4eb5000a41b96eb2ee203dce.tar.bz2 |
some more stuff - modem config, bluetooth.. -, not finished
Diffstat (limited to 'noncore/apps/opie-console/dialdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/dialdialog.cpp | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/dialdialog.cpp b/noncore/apps/opie-console/dialdialog.cpp new file mode 100644 index 0000000..8bf32f9 --- a/dev/null +++ b/noncore/apps/opie-console/dialdialog.cpp @@ -0,0 +1,95 @@ + + +#include <qlayout.h> +#include <qlabel.h> +#include <qcombobox.h> +#include <qscrollview.h> +#include <qpushbutton.h> +#include <qfont.h> +#include <qbuttongroup.h> + +#include "dialdialog.h" + + + +DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) + : QDialog( parent, name, modal, fl ) { + + m_number = 0; + + setCaption( tr( "Enter number" ) ); + + QVBoxLayout *mainLayout = new QVBoxLayout( this ); + + QLabel *textLabel = new QLabel( this ); + textLabel->setText( tr("Enter the number you want to dial. When finished, press ok") ); + + LCD = new QLCDNumber( this, "LCD" ); + QFont LCD_font( LCD->font() ); + LCD_font.setPointSize( 7 ); + LCD->setFont( LCD_font ); + LCD->setNumDigits( 25 ); + LCD->setSegmentStyle( QLCDNumber::Flat ); + LCD->setMaximumHeight( 30 ); + + QGridLayout *layout = new QGridLayout( this , 4, 3 ); + + QButtonGroup *dialButtons = new QButtonGroup( ); + + QPushButton *number0 = new QPushButton( this ); + number0->setText( QString( "0" ) ); + QFont number0_font( number0->font() ); + number0_font.setBold( TRUE ); + number0->setFont( number0_font ); + layout->addWidget( number0, 4, 1 ); + dialButtons->insert( number0 ); + + int x = 0, y = 0; + for ( int i = 0 ; i < 9; i++ ) { + QPushButton *number = new QPushButton( this ); + number->setText( QString( "%1" ).arg( i + 1 ) ); + QFont number_font( number->font() ); + number_font.setBold( TRUE ); + number->setFont( number_font ); + + dialButtons->insert( number ); + + layout->addWidget( number, x, y ); + + if ( y < 2 ) { + y++; + } else { + x++; + y = 0; + } + } + + connect( dialButtons, SIGNAL( clicked( int ) ), this, SLOT( slotEnterNumber( int ) ) ); + + mainLayout->addStretch( 0 ); + mainLayout->addWidget( textLabel ); + mainLayout->addWidget( LCD ); + mainLayout->addStretch( 0 ); + mainLayout->addLayout( layout ); + mainLayout->addStretch( 0 ); + + +} + + +void DialDialog::slotEnterNumber( int number ) { + + // pretty stupid, just for testing .-) + + m_number = ( m_number * 10 ) + number; + qDebug( QString("%1").arg( m_number ) ); + LCD->display( m_number ); + +} + +DialDialog::~DialDialog() { +} + +QString DialDialog::number() { + return QString( "%1").arg( m_number ); +} |