summaryrefslogtreecommitdiff
path: root/inputmethods/handwriting/qimpensetup.cpp
Side-by-side diff
Diffstat (limited to 'inputmethods/handwriting/qimpensetup.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/handwriting/qimpensetup.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/inputmethods/handwriting/qimpensetup.cpp b/inputmethods/handwriting/qimpensetup.cpp
index 2441102..d0f9ffd 100644
--- a/inputmethods/handwriting/qimpensetup.cpp
+++ b/inputmethods/handwriting/qimpensetup.cpp
@@ -340,129 +340,130 @@ QIMPenEdit::QIMPenEdit( QIMPenProfile *p, QWidget *parent,
pw = new QIMPenWidget( this );
pw->setFixedHeight( 75 );
gl->addMultiCellWidget( pw, 2, 3, 0, 0 );
connect( pw, SIGNAL(stroke(QIMPenStroke *)),
SLOT(newStroke(QIMPenStroke *)) );
QVBoxLayout *vb = new QVBoxLayout();
gl->addLayout( vb, 1, 1 );
newBtn = new QPushButton( tr("New..."), this );
connect( newBtn, SIGNAL(clicked()), SLOT(addNewChar()) );
vb->addWidget( newBtn );
addBtn = new QPushButton( tr("Add"), this );
connect( addBtn, SIGNAL(clicked()), SLOT(addChar()) );
vb->addWidget( addBtn );
removeBtn = new QPushButton( tr("Remove"), this );
connect( removeBtn, SIGNAL(clicked()), SLOT(removeChar()) );
vb->addWidget( removeBtn );
QPushButton *pb = new QPushButton( tr("Default"), this );
connect( pb, SIGNAL(clicked()), SLOT(defaultChars()) );
vb->addWidget( pb );
QHBoxLayout *hb = new QHBoxLayout();
gl->addLayout( hb, 2, 1 );
prevBtn = new QPushButton( this );
prevBtn->setPixmap( QPixmap( (const char **)left_xpm ) );
connect( prevBtn, SIGNAL(clicked()), SLOT(prevChar()));
hb->addWidget( prevBtn );
nextBtn = new QPushButton( this );
nextBtn->setPixmap( QPixmap( (const char **)right_xpm ) );
connect( nextBtn, SIGNAL(clicked()), SLOT(nextChar()));
hb->addWidget( nextBtn );
pb = new QPushButton( tr("Clear"), this );
connect( pb, SIGNAL(clicked()), SLOT(clearChar()) );
gl->addWidget( pb, 3, 1 );
//--
#if !defined(Q_WS_QWS)
hb = new QHBoxLayout( tvb );
pb = new QPushButton( tr("OK"), this );
connect( pb, SIGNAL(clicked()), SLOT(accept()) );
hb->addWidget( pb );
pb = new QPushButton( tr("Cancel"), this );
connect( pb, SIGNAL(clicked()), SLOT(reject()) );
hb->addWidget( pb );
#endif
selectCharSet( 0 );
charList->setFocus();
resize( minimumSize() );
enableButtons();
}
void QIMPenEdit::setProfile( QIMPenProfile *p )
{
profile = p;
charSetCombo->clear();
QIMPenCharSetIterator it( profile->charSets() );
for ( ; it.current(); ++it ) {
- charSetCombo->insertItem( it.current()->description() );
+ if ( ! it.current()->hidden() )
+ charSetCombo->insertItem( it.current()->description() );
}
selectCharSet( 0 );
charList->setFocus();
enableButtons();
}
void QIMPenEdit::selectCharSet( QIMPenCharSet *c )
{
int i = 0;
QIMPenCharSetIterator it( profile->charSets() );
for ( ; it.current(); ++it, i++ ) {
if ( it.current() == c ) {
charSetCombo->setCurrentItem( i );
selectCharSet( i );
}
}
}
/*!
Fill the character list box with the characters. Duplicates are not
inserted.
*/
void QIMPenEdit::fillCharList()
{
charList->clear();
QIMPenCharIterator it( currentSet->characters() );
CharListItem *li = 0;
for ( ; it.current(); ++it ) {
uint ch = it.current()->character();
QString n = it.current()->name();
if ( !n.isEmpty() )
li = new CharListItem( n, ch );
if ( li ) {
CharListItem *i = (CharListItem *)charList->findItem( li->text() );
if ( !i || i->code() != ch ) {
charList->insertItem( li );
} else {
delete li;
li = 0;
}
}
}
currentChar = 0;
}
void QIMPenEdit::enableButtons()
{
bool add = !inputChar->isEmpty();
newBtn->setEnabled( add );
addBtn->setEnabled( add );
removeBtn->setEnabled( currentChar );
}
/*!
Find the previous character with the same code as the current one.
returns 0 if there is no previous character.
*/
QIMPenChar *QIMPenEdit::findPrev()
{
if ( !currentChar )
return 0;
QIMPenCharIterator it( currentSet->characters() );
bool found = FALSE;