summaryrefslogtreecommitdiff
path: root/inputmethods/handwriting/qimpensetup.cpp
Unidiff
Diffstat (limited to 'inputmethods/handwriting/qimpensetup.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/handwriting/qimpensetup.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/inputmethods/handwriting/qimpensetup.cpp b/inputmethods/handwriting/qimpensetup.cpp
index d1297a9..3f4841d 100644
--- a/inputmethods/handwriting/qimpensetup.cpp
+++ b/inputmethods/handwriting/qimpensetup.cpp
@@ -323,13 +323,13 @@ QIMPenEdit::QIMPenEdit( QIMPenProfile *p, QWidget *parent,
323 gl->setRowStretch( 1, 1 ); 323 gl->setRowStretch( 1, 1 );
324 gl->addRowSpacing( 2, 35 ); 324 gl->addRowSpacing( 2, 35 );
325 gl->addRowSpacing( 3, 35 ); 325 gl->addRowSpacing( 3, 35 );
326 326
327 charSetCombo = new QComboBox( this ); 327 charSetCombo = new QComboBox( this );
328 gl->addMultiCellWidget( charSetCombo, 0, 0, 0, 1 ); 328 gl->addMultiCellWidget( charSetCombo, 0, 0, 0, 1 );
329 connect( charSetCombo, SIGNAL(activated(int)), SLOT(selectCharSet(int))); 329 connect( charSetCombo, SIGNAL(activated(int)), SLOT(selectCharSetVisible(int)));
330 QIMPenCharSetIterator it( profile->charSets() ); 330 QIMPenCharSetIterator it( profile->charSets() );
331 for ( ; it.current(); ++it ) { 331 for ( ; it.current(); ++it ) {
332 charSetCombo->insertItem( it.current()->description() ); 332 charSetCombo->insertItem( it.current()->description() );
333 } 333 }
334 334
335 charList = new QListBox( this ); 335 charList = new QListBox( this );
@@ -385,13 +385,13 @@ QIMPenEdit::QIMPenEdit( QIMPenProfile *p, QWidget *parent,
385 hb->addWidget( pb ); 385 hb->addWidget( pb );
386 386
387 pb = new QPushButton( tr("Cancel"), this ); 387 pb = new QPushButton( tr("Cancel"), this );
388 connect( pb, SIGNAL(clicked()), SLOT(reject()) ); 388 connect( pb, SIGNAL(clicked()), SLOT(reject()) );
389 hb->addWidget( pb ); 389 hb->addWidget( pb );
390#endif 390#endif
391 selectCharSet( 0 ); 391 selectCharSetVisible( 0 );
392 charList->setFocus(); 392 charList->setFocus();
393 393
394 resize( minimumSize() ); 394 resize( minimumSize() );
395 enableButtons(); 395 enableButtons();
396} 396}
397 397
@@ -401,13 +401,13 @@ void QIMPenEdit::setProfile( QIMPenProfile *p )
401 charSetCombo->clear(); 401 charSetCombo->clear();
402 QIMPenCharSetIterator it( profile->charSets() ); 402 QIMPenCharSetIterator it( profile->charSets() );
403 for ( ; it.current(); ++it ) { 403 for ( ; it.current(); ++it ) {
404 if ( ! it.current()->hidden() ) 404 if ( ! it.current()->hidden() )
405 charSetCombo->insertItem( it.current()->description() ); 405 charSetCombo->insertItem( it.current()->description() );
406 } 406 }
407 selectCharSet( 0 ); 407 selectCharSetVisible( 0 );
408 charList->setFocus(); 408 charList->setFocus();
409 enableButtons(); 409 enableButtons();
410} 410}
411 411
412void QIMPenEdit::selectCharSet( QIMPenCharSet *c ) 412void QIMPenEdit::selectCharSet( QIMPenCharSet *c )
413{ 413{
@@ -546,12 +546,23 @@ void QIMPenEdit::selectChar( int i )
546 } 546 }
547 if ( !it.current() ) 547 if ( !it.current() )
548 setCurrentChar( 0 ); 548 setCurrentChar( 0 );
549 inputChar->clear(); 549 inputChar->clear();
550} 550}
551 551
552void QIMPenEdit::selectCharSetVisible( int c )
553{
554 int i = 0;
555 QIMPenCharSetIterator it( profile->charSets() );
556 for ( ; it.current(); ++it, i++ ) {
557 if ( charSetCombo->text( c ) == it.current()->description() ) {
558 selectCharSet( i );
559 }
560 }
561}
562
552void QIMPenEdit::selectCharSet( int i ) 563void QIMPenEdit::selectCharSet( int i )
553{ 564{
554 if ( currentSet ) 565 if ( currentSet )
555 pw->removeCharSet( 0 ); 566 pw->removeCharSet( 0 );
556 currentSet = profile->charSets().at( i ); 567 currentSet = profile->charSets().at( i );
557 fillCharList(); 568 fillCharList();