author | hash <hash> | 2002-09-29 18:47:40 (UTC) |
---|---|---|
committer | hash <hash> | 2002-09-29 18:47:40 (UTC) |
commit | ef6ab2eb7794f5c5b9faad1ed650424e39b8d011 (patch) (unidiff) | |
tree | 90a03f5f49a4fbc576ce60aa5aee0448c711da2f /inputmethods | |
parent | 0d4b54af104dadbff57804e5e6f8ac309aa36fc4 (diff) | |
download | opie-ef6ab2eb7794f5c5b9faad1ed650424e39b8d011.zip opie-ef6ab2eb7794f5c5b9faad1ed650424e39b8d011.tar.gz opie-ef6ab2eb7794f5c5b9faad1ed650424e39b8d011.tar.bz2 |
enabled profile selection which was already in there\!
-rw-r--r-- | inputmethods/handwriting/qimpeninput.cpp | 7 | ||||
-rw-r--r-- | inputmethods/handwriting/qimpensetup.cpp | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/inputmethods/handwriting/qimpeninput.cpp b/inputmethods/handwriting/qimpeninput.cpp index 9acab8b..6a21931 100644 --- a/inputmethods/handwriting/qimpeninput.cpp +++ b/inputmethods/handwriting/qimpeninput.cpp | |||
@@ -241,50 +241,53 @@ void QIMPenInput::loadProfiles() | |||
241 | shortcutCharSet->setTitle( "Shortcut" ); | 241 | shortcutCharSet->setTitle( "Shortcut" ); |
242 | QString path = QPEApplication::qpeDir() + "etc/qimpen"; | 242 | QString path = QPEApplication::qpeDir() + "etc/qimpen"; |
243 | QDir dir( path, "*.conf" ); | 243 | QDir dir( path, "*.conf" ); |
244 | QStringList list = dir.entryList(); | 244 | QStringList list = dir.entryList(); |
245 | QStringList::Iterator it; | 245 | QStringList::Iterator it; |
246 | for ( it = list.begin(); it != list.end(); ++it ) { | 246 | for ( it = list.begin(); it != list.end(); ++it ) { |
247 | QIMPenProfile *p = new QIMPenProfile( path + "/" + *it ); | 247 | QIMPenProfile *p = new QIMPenProfile( path + "/" + *it ); |
248 | profileList.append( p ); | 248 | profileList.append( p ); |
249 | if ( p->shortcut() ) { | 249 | if ( p->shortcut() ) { |
250 | QIMPenCharIterator it( p->shortcut()->characters() ); | 250 | QIMPenCharIterator it( p->shortcut()->characters() ); |
251 | for ( ; it.current(); ++it ) { | 251 | for ( ; it.current(); ++it ) { |
252 | shortcutCharSet->addChar( new QIMPenChar(*it.current()) ); | 252 | shortcutCharSet->addChar( new QIMPenChar(*it.current()) ); |
253 | } | 253 | } |
254 | } | 254 | } |
255 | } | 255 | } |
256 | 256 | ||
257 | |||
257 | Config config( "handwriting" ); | 258 | Config config( "handwriting" ); |
258 | config.setGroup( "Settings" ); | 259 | config.setGroup( "Settings" ); |
259 | QString prof = config.readEntry( "Profile", "Default" ); | 260 | QString prof = config.readEntry( "Profile", "Default" ); |
260 | selectProfile( prof ); | 261 | selectProfile( prof ); |
261 | } | 262 | } |
262 | 263 | ||
263 | void QIMPenInput::selectProfile( const QString &name ) | 264 | void QIMPenInput::selectProfile( const QString &name ) |
264 | { | 265 | { |
265 | QListIterator<QIMPenProfile> it( profileList ); | 266 | QListIterator<QIMPenProfile> it( profileList ); |
266 | for ( ; it.current(); ++it ) { | 267 | for ( ; it.current(); ++it ) { |
267 | if ( it.current()->name() == name ) { | 268 | if ( it.current()->name() == name ) { |
268 | profile = it.current(); | 269 | profile = it.current(); |
269 | break; | 270 | break; |
270 | } | 271 | } |
271 | } | 272 | } |
272 | 273 | ||
273 | if ( !it.current() ) | 274 | if ( !it.current() ) { |
274 | return; | 275 | qWarning("No profile selected!\n"); |
276 | return; | ||
277 | } | ||
275 | 278 | ||
276 | pw->clearCharSets(); | 279 | pw->clearCharSets(); |
277 | baseSets.clear(); | 280 | baseSets.clear(); |
278 | 281 | ||
279 | matcher->setMultiStrokeTimeout( profile->multiStrokeTimeout() ); | 282 | matcher->setMultiStrokeTimeout( profile->multiStrokeTimeout() ); |
280 | matcher->setWordMatchingEnabled( profile->matchWords() ); | 283 | matcher->setWordMatchingEnabled( profile->matchWords() ); |
281 | 284 | ||
282 | if ( !Global::fixedDawg().root() || !matcher->isWordMatchingEnabled() ) | 285 | if ( !Global::fixedDawg().root() || !matcher->isWordMatchingEnabled() ) |
283 | wordPicker->hide(); | 286 | wordPicker->hide(); |
284 | else | 287 | else |
285 | wordPicker->show(); | 288 | wordPicker->show(); |
286 | 289 | ||
287 | if ( profile->uppercase() && profile->style() == QIMPenProfile::BothCases ) { | 290 | if ( profile->uppercase() && profile->style() == QIMPenProfile::BothCases ) { |
288 | baseSets.append( profile->uppercase() ); | 291 | baseSets.append( profile->uppercase() ); |
289 | pw->insertCharSet( profile->uppercase() ); | 292 | pw->insertCharSet( profile->uppercase() ); |
290 | } | 293 | } |
diff --git a/inputmethods/handwriting/qimpensetup.cpp b/inputmethods/handwriting/qimpensetup.cpp index a6ae3a8..2c06fbc 100644 --- a/inputmethods/handwriting/qimpensetup.cpp +++ b/inputmethods/handwriting/qimpensetup.cpp | |||
@@ -80,33 +80,33 @@ static const char * const right_xpm[] = { | |||
80 | " ... ", | 80 | " ... ", |
81 | " .. ", | 81 | " .. ", |
82 | " . ", | 82 | " . ", |
83 | " ", | 83 | " ", |
84 | " "}; | 84 | " "}; |
85 | 85 | ||
86 | 86 | ||
87 | 87 | ||
88 | QIMPenSetup::QIMPenSetup( QIMPenProfile *p, QWidget *parent, | 88 | QIMPenSetup::QIMPenSetup( QIMPenProfile *p, QWidget *parent, |
89 | const char *name, bool modal, int WFlags ) | 89 | const char *name, bool modal, int WFlags ) |
90 | : QDialog( parent, name, modal, WFlags ), profileCombo(0), profile(p) | 90 | : QDialog( parent, name, modal, WFlags ), profileCombo(0), profile(p) |
91 | { | 91 | { |
92 | setCaption( tr("Setup Handwriting Input") ); | 92 | setCaption( tr("Setup Handwriting Input") ); |
93 | 93 | ||
94 | QVBoxLayout *vb = new QVBoxLayout( this ); | 94 | QVBoxLayout *vb = new QVBoxLayout( this ); |
95 | 95 | ||
96 | #if 0 | 96 | #if 1 |
97 | profileList.setAutoDelete( true ); | 97 | profileList.setAutoDelete( true ); |
98 | QHBoxLayout *hb = new QHBoxLayout( vb ); | 98 | QHBoxLayout *hb = new QHBoxLayout( vb ); |
99 | hb->setMargin( 6 ); | 99 | hb->setMargin( 6 ); |
100 | QLabel *l = new QLabel( tr("Character Profile:"), this ); | 100 | QLabel *l = new QLabel( tr("Character Profile:"), this ); |
101 | hb->addWidget( l ); | 101 | hb->addWidget( l ); |
102 | profileCombo = new QComboBox( this ); | 102 | profileCombo = new QComboBox( this ); |
103 | connect( profileCombo, SIGNAL(activated(const QString &)), | 103 | connect( profileCombo, SIGNAL(activated(const QString &)), |
104 | this, SLOT(selectProfile(const QString &)) ); | 104 | this, SLOT(selectProfile(const QString &)) ); |
105 | hb->addWidget( profileCombo ); | 105 | hb->addWidget( profileCombo ); |
106 | loadProfiles(); | 106 | loadProfiles(); |
107 | #else | 107 | #else |
108 | profileList.append( profile ); | 108 | profileList.append( profile ); |
109 | #endif | 109 | #endif |
110 | 110 | ||
111 | QTabWidget *tw = new QTabWidget( this ); | 111 | QTabWidget *tw = new QTabWidget( this ); |
112 | vb->addWidget( tw ); | 112 | vb->addWidget( tw ); |