author | zecke <zecke> | 2004-01-18 13:26:43 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-01-18 13:26:43 (UTC) |
commit | 7d94c9b04f8702d0f94c6c64454d159a186a2576 (patch) (side-by-side diff) | |
tree | a5989f07e02e610abab7cf7514737a67c78b1d68 /inputmethods | |
parent | a2a3aabf21655cc9c7df8e2ed0d420d2b208fd3d (diff) | |
download | opie-7d94c9b04f8702d0f94c6c64454d159a186a2576.zip opie-7d94c9b04f8702d0f94c6c64454d159a186a2576.tar.gz opie-7d94c9b04f8702d0f94c6c64454d159a186a2576.tar.bz2 |
Comit the "Mono" patch by
Brad Campbell <brad@wasp.net.au>
-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 | 3 |
5 files changed, 35 insertions, 3 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 @@ -343,24 +343,27 @@ bool QIMPenCharSet::load( const QString &fn, Domain d ) markDeleted( pc->character() ); // override system addChar( pc ); } if ( file.status() == IO_Ok ) ok = TRUE; } - + setHidden ( false ); return ok; } /*! Save this character set. */ 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"; QFile file( tmpFn ); if ( file.open( IO_WriteOnly|IO_Raw ) ) { 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 @@ -114,12 +114,14 @@ public: QString title() const { return csTitle; } 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 ); void down( QIMPenChar *ch ); @@ -146,12 +148,13 @@ protected: QString sysFilename; QString userFilename; Type csType; unsigned maxStrokes; QIMPenCharList chars; QIMPenCharMatchList matches; + bool phidden : 1; }; typedef QList<QIMPenCharSet> QIMPenCharSetList; typedef QListIterator<QIMPenCharSet> QIMPenCharSetIterator; #endif 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 @@ -45,12 +45,15 @@ QIMPenProfile::QIMPenProfile( const QString &fn ) pstyle = BothCases; 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() ); usrConfig.setGroup( "Settings" ); msTimeout = usrConfig.readNumEntry( "MultiTimeout", msTimeout ); @@ -116,13 +119,13 @@ void QIMPenProfile::loadData() combining = 0; } } // 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 ) combining->addCombined( cs ); sets.append( cs ); @@ -130,12 +133,32 @@ void QIMPenProfile::loadData() delete cs; } } // 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 ) combining->addCombined( cs ); sets.append( cs ); 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 @@ -30,12 +30,13 @@ public: const QString &name() const { return pname; } 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; } int multiStrokeTimeout() const { return msTimeout; } void setMultiStrokeTimeout( int t ); @@ -62,9 +63,10 @@ private: QString pname; QString pdesc; 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 @@ -398,13 +398,14 @@ QIMPenEdit::QIMPenEdit( QIMPenProfile *p, QWidget *parent, 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(); } |