-rw-r--r-- | inputmethods/handwriting/qimpenchar.cpp | 5 | ||||
-rw-r--r-- | inputmethods/handwriting/qimpenchar.h | 3 | ||||
-rw-r--r-- | inputmethods/handwriting/qimpenprofile.cpp | 25 | ||||
-rw-r--r-- | inputmethods/handwriting/qimpenprofile.h | 2 | ||||
-rw-r--r-- | inputmethods/handwriting/qimpensetup.cpp | 1 |
5 files changed, 34 insertions, 2 deletions
diff --git a/inputmethods/handwriting/qimpenchar.cpp b/inputmethods/handwriting/qimpenchar.cpp index 0c37e5c..929f370 100644 --- a/inputmethods/handwriting/qimpenchar.cpp +++ b/inputmethods/handwriting/qimpenchar.cpp @@ -345,9 +345,9 @@ bool QIMPenCharSet::load( const QString &fn, Domain d ) } if ( file.status() == IO_Ok ) ok = TRUE; } - + setHidden ( false ); return ok; } /*! @@ -357,8 +357,11 @@ bool QIMPenCharSet::save( Domain d ) { if ( filename( d ).isEmpty() ) return FALSE; + if ( hidden() ) + return TRUE; + bool ok = FALSE; QString fn = filename( d ); QString tmpFn = fn + ".new"; diff --git a/inputmethods/handwriting/qimpenchar.h b/inputmethods/handwriting/qimpenchar.h index efd6f16..e4e7645 100644 --- a/inputmethods/handwriting/qimpenchar.h +++ b/inputmethods/handwriting/qimpenchar.h @@ -116,8 +116,10 @@ public: QIMPenCharMatchList match( QIMPenChar *ch ); void addChar( QIMPenChar *ch ); void removeChar( QIMPenChar *ch ); QIMPenChar *at( int i ); + void setHidden ( const bool &b ) { phidden = &b; } + bool hidden() const { return phidden; } unsigned maximumStrokes() const { return maxStrokes; } void up( QIMPenChar *ch ); @@ -148,8 +150,9 @@ protected: Type csType; unsigned maxStrokes; QIMPenCharList chars; QIMPenCharMatchList matches; + bool phidden : 1; }; typedef QList<QIMPenCharSet> QIMPenCharSetList; typedef QListIterator<QIMPenCharSet> QIMPenCharSetIterator; diff --git a/inputmethods/handwriting/qimpenprofile.cpp b/inputmethods/handwriting/qimpenprofile.cpp index 3b1b5e9..b1a6592 100644 --- a/inputmethods/handwriting/qimpenprofile.cpp +++ b/inputmethods/handwriting/qimpenprofile.cpp @@ -47,8 +47,11 @@ QIMPenProfile::QIMPenProfile( const QString &fn ) QString s = config.readEntry( "Style", "BothCases" ); if ( s == "ToggleCases" ) pstyle = ToggleCases; + QString t = config.readEntry( "Mono", "Dual" ); + pmono = (QString::fromLatin1("Mono") == t ); + msTimeout = config.readNumEntry( "MultiTimeout", 500 ); // Read user configuration Config usrConfig( userConfig() ); @@ -118,9 +121,9 @@ void QIMPenProfile::loadData() } // uppercase latin1 QIMPenCharSet *cs = 0; s = config.readEntry( "Uppercase" ); - if ( !s.isEmpty() ) { + if ( !s.isEmpty() && !mono() ) { cs = new QIMPenCharSet( baseDir + "qimpen/" + s ); cs->load( Global::applicationFileName("qimpen",s), QIMPenCharSet::User ); if ( !cs->isEmpty() ) { if ( combining ) @@ -132,8 +135,28 @@ void QIMPenProfile::loadData() } // lowercase latin1 s = config.readEntry( "Lowercase" ); if ( !s.isEmpty() ) { + if ( mono() ) { + cs = new QIMPenCharSet ( baseDir + "qimpen/" + s ); + cs->load( Global::applicationFileName("qimpen",s), QIMPenCharSet::User ); + if ( !cs->isEmpty() ) { + cs->setTitle( cs->title().upper() ); + cs->setType( QIMPenCharSet::Upper ); + cs->setHidden ( true ); + QIMPenCharIterator it( cs->characters() ); + for ( ; it.current(); ++it ) { + uint ch = it.current()->character(); + if ( ch >= 'a' && ch <= 'z' ) + it.current()->setCharacter( QChar(ch).upper() ); + } + if ( combining ) + combining->addCombined( cs ); + sets.append( cs ); + } else { + delete cs; + } + } cs = new QIMPenCharSet( baseDir + "qimpen/" + s ); cs->load( Global::applicationFileName("qimpen",s), QIMPenCharSet::User ); if ( !cs->isEmpty() ) { if ( combining ) diff --git a/inputmethods/handwriting/qimpenprofile.h b/inputmethods/handwriting/qimpenprofile.h index 4ce4367..adfa866 100644 --- a/inputmethods/handwriting/qimpenprofile.h +++ b/inputmethods/handwriting/qimpenprofile.h @@ -32,8 +32,9 @@ public: const QString &description() const { return pdesc; } enum Style { ToggleCases, BothCases }; Style style() const { return pstyle; } + bool mono() const { return pmono; } void setStyle( Style s ); bool canSelectStyle() const { return tstyle; } @@ -64,7 +65,8 @@ private: Style pstyle; bool tstyle; int msTimeout; bool wordMatch; + bool pmono; }; #endif 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 @@ -400,8 +400,9 @@ void QIMPenEdit::setProfile( QIMPenProfile *p ) profile = p; charSetCombo->clear(); QIMPenCharSetIterator it( profile->charSets() ); for ( ; it.current(); ++it ) { + if ( ! it.current()->hidden() ) charSetCombo->insertItem( it.current()->description() ); } selectCharSet( 0 ); charList->setFocus(); |