summaryrefslogtreecommitdiff
authorzecke <zecke>2004-01-18 13:26:43 (UTC)
committer zecke <zecke>2004-01-18 13:26:43 (UTC)
commit7d94c9b04f8702d0f94c6c64454d159a186a2576 (patch) (unidiff)
treea5989f07e02e610abab7cf7514737a67c78b1d68
parenta2a3aabf21655cc9c7df8e2ed0d420d2b208fd3d (diff)
downloadopie-7d94c9b04f8702d0f94c6c64454d159a186a2576.zip
opie-7d94c9b04f8702d0f94c6c64454d159a186a2576.tar.gz
opie-7d94c9b04f8702d0f94c6c64454d159a186a2576.tar.bz2
Comit the "Mono" patch by
Brad Campbell <brad@wasp.net.au>
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--inputmethods/handwriting/qimpenchar.cpp5
-rw-r--r--inputmethods/handwriting/qimpenchar.h3
-rw-r--r--inputmethods/handwriting/qimpenprofile.cpp25
-rw-r--r--inputmethods/handwriting/qimpenprofile.h2
-rw-r--r--inputmethods/handwriting/qimpensetup.cpp1
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
@@ -325,60 +325,63 @@ bool QIMPenCharSet::load( const QString &fn, Domain d )
325 int major = version.mid( 4, 1 ).toInt(); 325 int major = version.mid( 4, 1 ).toInt();
326 int minor = version.mid( 6 ).toInt(); 326 int minor = version.mid( 6 ).toInt();
327 if ( major >= 1 && minor > 0 ) { 327 if ( major >= 1 && minor > 0 ) {
328 ds >> (Q_INT8 &)csType; 328 ds >> (Q_INT8 &)csType;
329 } else { 329 } else {
330 if ( csTitle == "abc" ) 330 if ( csTitle == "abc" )
331 csType = Lower; 331 csType = Lower;
332 else if ( csTitle == "ABC" ) 332 else if ( csTitle == "ABC" )
333 csType = Upper; 333 csType = Upper;
334 else if ( csTitle == "123" ) 334 else if ( csTitle == "123" )
335 csType = Numeric; 335 csType = Numeric;
336 else if ( fn == "Combining" ) 336 else if ( fn == "Combining" )
337 csType = Combining; 337 csType = Combining;
338 } 338 }
339 while ( !ds.atEnd() ) { 339 while ( !ds.atEnd() ) {
340 QIMPenChar *pc = new QIMPenChar; 340 QIMPenChar *pc = new QIMPenChar;
341 ds >> *pc; 341 ds >> *pc;
342 if ( d == User ) 342 if ( d == User )
343 markDeleted( pc->character() ); // override system 343 markDeleted( pc->character() ); // override system
344 addChar( pc ); 344 addChar( pc );
345 } 345 }
346 if ( file.status() == IO_Ok ) 346 if ( file.status() == IO_Ok )
347 ok = TRUE; 347 ok = TRUE;
348 } 348 }
349 349 setHidden ( false );
350 return ok; 350 return ok;
351} 351}
352 352
353/*! 353/*!
354 Save this character set. 354 Save this character set.
355 */ 355 */
356bool QIMPenCharSet::save( Domain d ) 356bool QIMPenCharSet::save( Domain d )
357{ 357{
358 if ( filename( d ).isEmpty() ) 358 if ( filename( d ).isEmpty() )
359 return FALSE; 359 return FALSE;
360 360
361 if ( hidden() )
362 return TRUE;
363
361 bool ok = FALSE; 364 bool ok = FALSE;
362 365
363 QString fn = filename( d ); 366 QString fn = filename( d );
364 QString tmpFn = fn + ".new"; 367 QString tmpFn = fn + ".new";
365 QFile file( tmpFn ); 368 QFile file( tmpFn );
366 if ( file.open( IO_WriteOnly|IO_Raw ) ) { 369 if ( file.open( IO_WriteOnly|IO_Raw ) ) {
367 QByteArray buf; 370 QByteArray buf;
368 QDataStream ds( buf, IO_WriteOnly ); 371 QDataStream ds( buf, IO_WriteOnly );
369 ds << QString( "QPT 1.1" ); 372 ds << QString( "QPT 1.1" );
370 ds << csTitle; 373 ds << csTitle;
371 ds << desc; 374 ds << desc;
372 ds << (Q_INT8)csType; 375 ds << (Q_INT8)csType;
373 QIMPenCharIterator ci( chars ); 376 QIMPenCharIterator ci( chars );
374 for ( ; ci.current(); ++ci ) { 377 for ( ; ci.current(); ++ci ) {
375 QIMPenChar *pc = ci.current(); 378 QIMPenChar *pc = ci.current();
376 if ( ( ( (d == System) && pc->testFlag( QIMPenChar::System ) ) || 379 if ( ( ( (d == System) && pc->testFlag( QIMPenChar::System ) ) ||
377 ( (d == User) && !pc->testFlag( QIMPenChar::System ) ) ) && 380 ( (d == User) && !pc->testFlag( QIMPenChar::System ) ) ) &&
378 ( !pc->testFlag (QIMPenChar::Combined ) ) ) { 381 ( !pc->testFlag (QIMPenChar::Combined ) ) ) {
379 ds << *pc; 382 ds << *pc;
380 } 383 }
381 } 384 }
382 385
383 file.writeBlock( buf ); 386 file.writeBlock( buf );
384 file.close(); 387 file.close();
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
@@ -96,62 +96,65 @@ struct QIMPenCharMatch
96}; 96};
97 97
98typedef QValueList<QIMPenCharMatch> QIMPenCharMatchList; 98typedef QValueList<QIMPenCharMatch> QIMPenCharMatchList;
99 99
100 100
101class QIMPenCharSet 101class QIMPenCharSet
102{ 102{
103public: 103public:
104 QIMPenCharSet(); 104 QIMPenCharSet();
105 QIMPenCharSet( const QString &fn ); 105 QIMPenCharSet( const QString &fn );
106 106
107 bool isEmpty() const { return chars.isEmpty(); } 107 bool isEmpty() const { return chars.isEmpty(); }
108 unsigned int count() const { return chars.count(); } 108 unsigned int count() const { return chars.count(); }
109 void clear() { chars.clear(); } 109 void clear() { chars.clear(); }
110 110
111 void setDescription( const QString &d ) { desc = d; } 111 void setDescription( const QString &d ) { desc = d; }
112 QString description() const { return desc; } 112 QString description() const { return desc; }
113 void setTitle( const QString &t ) { csTitle = t; } 113 void setTitle( const QString &t ) { csTitle = t; }
114 QString title() const { return csTitle; } 114 QString title() const { return csTitle; }
115 115
116 QIMPenCharMatchList match( QIMPenChar *ch ); 116 QIMPenCharMatchList match( QIMPenChar *ch );
117 void addChar( QIMPenChar *ch ); 117 void addChar( QIMPenChar *ch );
118 void removeChar( QIMPenChar *ch ); 118 void removeChar( QIMPenChar *ch );
119 QIMPenChar *at( int i ); 119 QIMPenChar *at( int i );
120 void setHidden ( const bool &b ) { phidden = &b; }
121 bool hidden() const { return phidden; }
120 122
121 unsigned maximumStrokes() const { return maxStrokes; } 123 unsigned maximumStrokes() const { return maxStrokes; }
122 124
123 void up( QIMPenChar *ch ); 125 void up( QIMPenChar *ch );
124 void down( QIMPenChar *ch ); 126 void down( QIMPenChar *ch );
125 127
126 enum Domain { System, User }; 128 enum Domain { System, User };
127 enum Type { Unknown=0x00, Lower=0x01, Upper=0x02, Combining=0x04, 129 enum Type { Unknown=0x00, Lower=0x01, Upper=0x02, Combining=0x04,
128 Numeric=0x08, Punctuation=0x10, Symbol=0x20, Shortcut=0x40 }; 130 Numeric=0x08, Punctuation=0x10, Symbol=0x20, Shortcut=0x40 };
129 131
130 const QIMPenCharList &characters() const { return chars; } 132 const QIMPenCharList &characters() const { return chars; }
131 133
132 void setType( Type t ) { csType = t; } 134 void setType( Type t ) { csType = t; }
133 Type type() const { return csType; } 135 Type type() const { return csType; }
134 136
135 const QString &filename( Domain d ) const; 137 const QString &filename( Domain d ) const;
136 void setFilename( const QString &fn, Domain d=System ); 138 void setFilename( const QString &fn, Domain d=System );
137 bool load( const QString &fn, Domain d=System ); 139 bool load( const QString &fn, Domain d=System );
138 bool save( Domain d=System ); 140 bool save( Domain d=System );
139 141
140protected: 142protected:
141 void markDeleted( uint ch ); 143 void markDeleted( uint ch );
142 144
143protected: 145protected:
144 QString csTitle; 146 QString csTitle;
145 QString desc; 147 QString desc;
146 QString sysFilename; 148 QString sysFilename;
147 QString userFilename; 149 QString userFilename;
148 Type csType; 150 Type csType;
149 unsigned maxStrokes; 151 unsigned maxStrokes;
150 QIMPenCharList chars; 152 QIMPenCharList chars;
151 QIMPenCharMatchList matches; 153 QIMPenCharMatchList matches;
154 bool phidden : 1;
152}; 155};
153 156
154typedef QList<QIMPenCharSet> QIMPenCharSetList; 157typedef QList<QIMPenCharSet> QIMPenCharSetList;
155typedef QListIterator<QIMPenCharSet> QIMPenCharSetIterator; 158typedef QListIterator<QIMPenCharSet> QIMPenCharSetIterator;
156 159
157#endif 160#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
@@ -27,48 +27,51 @@
27 27
28 28
29QIMPenProfile::QIMPenProfile( const QString &fn ) 29QIMPenProfile::QIMPenProfile( const QString &fn )
30 : filename( fn ) 30 : filename( fn )
31{ 31{
32 sets.setAutoDelete( true ); 32 sets.setAutoDelete( true );
33 33
34 Config config( filename, Config::File ); 34 Config config( filename, Config::File );
35 config.setGroup( "Handwriting" ); 35 config.setGroup( "Handwriting" );
36 36
37 pname = config.readEntry( "Name" ); 37 pname = config.readEntry( "Name" );
38 pdesc = config.readEntry( "Description" ); 38 pdesc = config.readEntry( "Description" );
39 39
40 tstyle = config.readBoolEntry( "CanSelectStyle", false ); 40 tstyle = config.readBoolEntry( "CanSelectStyle", false );
41 41
42 wordMatch = config.readBoolEntry( "MatchWords", true ); 42 wordMatch = config.readBoolEntry( "MatchWords", true );
43 43
44 config.setGroup( "Settings" ); 44 config.setGroup( "Settings" );
45 45
46 pstyle = BothCases; 46 pstyle = BothCases;
47 QString s = config.readEntry( "Style", "BothCases" ); 47 QString s = config.readEntry( "Style", "BothCases" );
48 if ( s == "ToggleCases" ) 48 if ( s == "ToggleCases" )
49 pstyle = ToggleCases; 49 pstyle = ToggleCases;
50 50
51 QString t = config.readEntry( "Mono", "Dual" );
52 pmono = (QString::fromLatin1("Mono") == t );
53
51 msTimeout = config.readNumEntry( "MultiTimeout", 500 ); 54 msTimeout = config.readNumEntry( "MultiTimeout", 500 );
52 55
53 // Read user configuration 56 // Read user configuration
54 Config usrConfig( userConfig() ); 57 Config usrConfig( userConfig() );
55 usrConfig.setGroup( "Settings" ); 58 usrConfig.setGroup( "Settings" );
56 msTimeout = usrConfig.readNumEntry( "MultiTimeout", msTimeout ); 59 msTimeout = usrConfig.readNumEntry( "MultiTimeout", msTimeout );
57 60
58 if ( tstyle && usrConfig.hasKey( "Style" ) ) { 61 if ( tstyle && usrConfig.hasKey( "Style" ) ) {
59 pstyle = BothCases; 62 pstyle = BothCases;
60 QString s = usrConfig.readEntry( "Style", "BothCases" ); 63 QString s = usrConfig.readEntry( "Style", "BothCases" );
61 if ( s == "ToggleCases" ) 64 if ( s == "ToggleCases" )
62 pstyle = ToggleCases; 65 pstyle = ToggleCases;
63 } 66 }
64} 67}
65 68
66void QIMPenProfile::setStyle( Style s ) 69void QIMPenProfile::setStyle( Style s )
67{ 70{
68 if ( tstyle && s != pstyle ) { 71 if ( tstyle && s != pstyle ) {
69 pstyle = s; 72 pstyle = s;
70 Config config( userConfig() ); 73 Config config( userConfig() );
71 config.setGroup( "Settings" ); 74 config.setGroup( "Settings" );
72 QString s = pstyle == ToggleCases ? "ToggleCases" : "BothCases"; 75 QString s = pstyle == ToggleCases ? "ToggleCases" : "BothCases";
73 config.writeEntry( "Style", s ); 76 config.writeEntry( "Style", s );
74 } 77 }
@@ -98,62 +101,82 @@ QString QIMPenProfile::userConfig()
98 101
99 return un; 102 return un;
100} 103}
101 104
102void QIMPenProfile::loadData() 105void QIMPenProfile::loadData()
103{ 106{
104 Config config( filename, Config::File ); 107 Config config( filename, Config::File );
105 config.setGroup( "CharSets" ); 108 config.setGroup( "CharSets" );
106 109
107 QString baseDir = QPEApplication::qpeDir(); 110 QString baseDir = QPEApplication::qpeDir();
108 baseDir += "/etc/"; 111 baseDir += "/etc/";
109 // accents 112 // accents
110 QIMPenCombining *combining = 0; 113 QIMPenCombining *combining = 0;
111 QString s = config.readEntry( "Combining" ); 114 QString s = config.readEntry( "Combining" );
112 if ( !s.isEmpty() ) { 115 if ( !s.isEmpty() ) {
113 combining = new QIMPenCombining( baseDir + "qimpen/" + s ); 116 combining = new QIMPenCombining( baseDir + "qimpen/" + s );
114 if ( combining->isEmpty() ) { 117 if ( combining->isEmpty() ) {
115 delete combining; 118 delete combining;
116 combining = 0; 119 combining = 0;
117 } 120 }
118 } 121 }
119 // uppercase latin1 122 // uppercase latin1
120 QIMPenCharSet *cs = 0; 123 QIMPenCharSet *cs = 0;
121 s = config.readEntry( "Uppercase" ); 124 s = config.readEntry( "Uppercase" );
122 if ( !s.isEmpty() ) { 125 if ( !s.isEmpty() && !mono() ) {
123 cs = new QIMPenCharSet( baseDir + "qimpen/" + s ); 126 cs = new QIMPenCharSet( baseDir + "qimpen/" + s );
124 cs->load( Global::applicationFileName("qimpen",s), QIMPenCharSet::User ); 127 cs->load( Global::applicationFileName("qimpen",s), QIMPenCharSet::User );
125 if ( !cs->isEmpty() ) { 128 if ( !cs->isEmpty() ) {
126 if ( combining ) 129 if ( combining )
127 combining->addCombined( cs ); 130 combining->addCombined( cs );
128 sets.append( cs ); 131 sets.append( cs );
129 } else { 132 } else {
130 delete cs; 133 delete cs;
131 } 134 }
132 } 135 }
133 // lowercase latin1 136 // lowercase latin1
134 s = config.readEntry( "Lowercase" ); 137 s = config.readEntry( "Lowercase" );
135 if ( !s.isEmpty() ) { 138 if ( !s.isEmpty() ) {
139 if ( mono() ) {
140 cs = new QIMPenCharSet ( baseDir + "qimpen/" + s );
141 cs->load( Global::applicationFileName("qimpen",s), QIMPenCharSet::User );
142 if ( !cs->isEmpty() ) {
143 cs->setTitle( cs->title().upper() );
144 cs->setType( QIMPenCharSet::Upper );
145 cs->setHidden ( true );
146 QIMPenCharIterator it( cs->characters() );
147 for ( ; it.current(); ++it ) {
148 uint ch = it.current()->character();
149 if ( ch >= 'a' && ch <= 'z' )
150 it.current()->setCharacter( QChar(ch).upper() );
151 }
152 if ( combining )
153 combining->addCombined( cs );
154 sets.append( cs );
155 } else {
156 delete cs;
157 }
158 }
136 cs = new QIMPenCharSet( baseDir + "qimpen/" + s ); 159 cs = new QIMPenCharSet( baseDir + "qimpen/" + s );
137 cs->load( Global::applicationFileName("qimpen",s), QIMPenCharSet::User ); 160 cs->load( Global::applicationFileName("qimpen",s), QIMPenCharSet::User );
138 if ( !cs->isEmpty() ) { 161 if ( !cs->isEmpty() ) {
139 if ( combining ) 162 if ( combining )
140 combining->addCombined( cs ); 163 combining->addCombined( cs );
141 sets.append( cs ); 164 sets.append( cs );
142 } else { 165 } else {
143 delete cs; 166 delete cs;
144 } 167 }
145 } 168 }
146 // numeric (may comtain punctuation and symbols) 169 // numeric (may comtain punctuation and symbols)
147 s = config.readEntry( "Numeric" ); 170 s = config.readEntry( "Numeric" );
148 if ( !s.isEmpty() ) { 171 if ( !s.isEmpty() ) {
149 cs = new QIMPenCharSet( baseDir + "qimpen/" + s ); 172 cs = new QIMPenCharSet( baseDir + "qimpen/" + s );
150 cs->load( Global::applicationFileName("qimpen",s), QIMPenCharSet::User ); 173 cs->load( Global::applicationFileName("qimpen",s), QIMPenCharSet::User );
151 if ( !cs->isEmpty() ) { 174 if ( !cs->isEmpty() ) {
152 sets.append( cs ); 175 sets.append( cs );
153 } else { 176 } else {
154 delete cs; 177 delete cs;
155 } 178 }
156 } 179 }
157 // punctuation 180 // punctuation
158 s = config.readEntry( "Punctuation" ); 181 s = config.readEntry( "Punctuation" );
159 if ( !s.isEmpty() ) { 182 if ( !s.isEmpty() ) {
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
@@ -12,59 +12,61 @@
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#ifndef QIMPENPROFILE_H_ 21#ifndef QIMPENPROFILE_H_
22#define QIMPENPROFILE_H_ 22#define QIMPENPROFILE_H_
23 23
24#include "qimpenchar.h" 24#include "qimpenchar.h"
25 25
26class QIMPenProfile 26class QIMPenProfile
27{ 27{
28public: 28public:
29 QIMPenProfile( const QString &fn ); 29 QIMPenProfile( const QString &fn );
30 30
31 const QString &name() const { return pname; } 31 const QString &name() const { return pname; }
32 const QString &description() const { return pdesc; } 32 const QString &description() const { return pdesc; }
33 33
34 enum Style { ToggleCases, BothCases }; 34 enum Style { ToggleCases, BothCases };
35 Style style() const { return pstyle; } 35 Style style() const { return pstyle; }
36 bool mono() const { return pmono; }
36 void setStyle( Style s ); 37 void setStyle( Style s );
37 38
38 bool canSelectStyle() const { return tstyle; } 39 bool canSelectStyle() const { return tstyle; }
39 40
40 int multiStrokeTimeout() const { return msTimeout; } 41 int multiStrokeTimeout() const { return msTimeout; }
41 void setMultiStrokeTimeout( int t ); 42 void setMultiStrokeTimeout( int t );
42 43
43 bool matchWords() const { return wordMatch; } 44 bool matchWords() const { return wordMatch; }
44 45
45 QIMPenCharSet *uppercase(); 46 QIMPenCharSet *uppercase();
46 QIMPenCharSet *lowercase(); 47 QIMPenCharSet *lowercase();
47 QIMPenCharSet *numeric(); 48 QIMPenCharSet *numeric();
48 QIMPenCharSet *punctuation(); 49 QIMPenCharSet *punctuation();
49 QIMPenCharSet *symbol(); 50 QIMPenCharSet *symbol();
50 QIMPenCharSet *shortcut(); 51 QIMPenCharSet *shortcut();
51 QIMPenCharSet *find( QIMPenCharSet::Type t ); 52 QIMPenCharSet *find( QIMPenCharSet::Type t );
52 53
53 QIMPenCharSetList &charSets(); 54 QIMPenCharSetList &charSets();
54 55
55private: 56private:
56 QString userConfig(); 57 QString userConfig();
57 void loadData(); 58 void loadData();
58 59
59private: 60private:
60 QIMPenCharSetList sets; 61 QIMPenCharSetList sets;
61 QString filename; 62 QString filename;
62 QString pname; 63 QString pname;
63 QString pdesc; 64 QString pdesc;
64 Style pstyle; 65 Style pstyle;
65 bool tstyle; 66 bool tstyle;
66 int msTimeout; 67 int msTimeout;
67 bool wordMatch; 68 bool wordMatch;
69 bool pmono;
68}; 70};
69 71
70#endif 72#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
@@ -380,48 +380,49 @@ QIMPenEdit::QIMPenEdit( QIMPenProfile *p, QWidget *parent,
380 //-- 380 //--
381#if !defined(Q_WS_QWS) 381#if !defined(Q_WS_QWS)
382 hb = new QHBoxLayout( tvb ); 382 hb = new QHBoxLayout( tvb );
383 pb = new QPushButton( tr("OK"), this ); 383 pb = new QPushButton( tr("OK"), this );
384 connect( pb, SIGNAL(clicked()), SLOT(accept()) ); 384 connect( pb, SIGNAL(clicked()), SLOT(accept()) );
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 selectCharSet( 0 );
392 charList->setFocus(); 392 charList->setFocus();
393 393
394 resize( minimumSize() ); 394 resize( minimumSize() );
395 enableButtons(); 395 enableButtons();
396} 396}
397 397
398void QIMPenEdit::setProfile( QIMPenProfile *p ) 398void QIMPenEdit::setProfile( QIMPenProfile *p )
399{ 399{
400 profile = p; 400 profile = 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 charSetCombo->insertItem( it.current()->description() ); 405 charSetCombo->insertItem( it.current()->description() );
405 } 406 }
406 selectCharSet( 0 ); 407 selectCharSet( 0 );
407 charList->setFocus(); 408 charList->setFocus();
408 enableButtons(); 409 enableButtons();
409} 410}
410 411
411void QIMPenEdit::selectCharSet( QIMPenCharSet *c ) 412void QIMPenEdit::selectCharSet( QIMPenCharSet *c )
412{ 413{
413 int i = 0; 414 int i = 0;
414 QIMPenCharSetIterator it( profile->charSets() ); 415 QIMPenCharSetIterator it( profile->charSets() );
415 for ( ; it.current(); ++it, i++ ) { 416 for ( ; it.current(); ++it, i++ ) {
416 if ( it.current() == c ) { 417 if ( it.current() == c ) {
417 charSetCombo->setCurrentItem( i ); 418 charSetCombo->setCurrentItem( i );
418 selectCharSet( i ); 419 selectCharSet( i );
419 } 420 }
420 } 421 }
421} 422}
422 423
423 424
424/*! 425/*!
425 Fill the character list box with the characters. Duplicates are not 426 Fill the character list box with the characters. Duplicates are not
426 inserted. 427 inserted.
427*/ 428*/