summaryrefslogtreecommitdiff
authorzecke <zecke>2004-03-14 17:01:11 (UTC)
committer zecke <zecke>2004-03-14 17:01:11 (UTC)
commit64820b76cc9d1c06a6967cd34114f3b95896aaeb (patch) (unidiff)
tree0d285b9d61392587b38f779688f518070a9e3e7b
parent52169e2469a1edcca986e9f0404c3ca815d5833b (diff)
downloadopie-64820b76cc9d1c06a6967cd34114f3b95896aaeb.zip
opie-64820b76cc9d1c06a6967cd34114f3b95896aaeb.tar.gz
opie-64820b76cc9d1c06a6967cd34114f3b95896aaeb.tar.bz2
Only use ODP
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/config.in2
-rw-r--r--noncore/apps/qashmoney/config.in2
-rw-r--r--noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp18
-rw-r--r--noncore/apps/tinykate/libkate/document/katesyntaxdocument.h8
-rw-r--r--noncore/apps/tinykate/libkate/view/kateviewdialog.cpp3
-rw-r--r--noncore/apps/tinykate/libkate/view/kateviewdialog.h2
6 files changed, 17 insertions, 18 deletions
diff --git a/noncore/apps/opie-reader/config.in b/noncore/apps/opie-reader/config.in
index 9f1e02e..8ade941 100644
--- a/noncore/apps/opie-reader/config.in
+++ b/noncore/apps/opie-reader/config.in
@@ -1,4 +1,4 @@
1 config OPIE-READER 1 config OPIE-READER
2 boolean "opie-reader (E-Text reader)" 2 boolean "opie-reader (E-Text reader)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 )
diff --git a/noncore/apps/qashmoney/config.in b/noncore/apps/qashmoney/config.in
index 94c39b6..91739fe 100644
--- a/noncore/apps/qashmoney/config.in
+++ b/noncore/apps/qashmoney/config.in
@@ -1,4 +1,4 @@
1 config QASHMONEY 1 config QASHMONEY
2 boolean "opie-qashmoney (money manager)" 2 boolean "opie-qashmoney (money manager)"
3 default "n" 3 default "n"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 )
diff --git a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp
index f90a5f8..6059e9b 100644
--- a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp
+++ b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp
@@ -1,306 +1,306 @@
1/*************************************************************************** 1/***************************************************************************
2 katesyntaxdocument.cpp - description 2 katesyntaxdocument.cpp - description
3 ------------------- 3 -------------------
4 begin : Sat 31 March 2001 4 begin : Sat 31 March 2001
5 copyright : (C) 2001,2002 by Joseph Wenninger 5 copyright : (C) 2001,2002 by Joseph Wenninger
6 email : jowenn@kde.org 6 email : jowenn@kde.org
7 ***************************************************************************/ 7 ***************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
18#include "katesyntaxdocument.h" 18#include "katesyntaxdocument.h"
19#include <kateconfig.h> 19#include <kateconfig.h>
20#include <qfile.h> 20#include <qfile.h>
21#include <kdebug.h> 21#include <kdebug.h>
22#include <kstddirs.h> 22#include <kstddirs.h>
23#include <klocale.h> 23#include <klocale.h>
24#include <kmessagebox.h> 24#include <kmessagebox.h>
25#include <qstringlist.h> 25#include <qstringlist.h>
26#include <kglobal.h> 26#include <kglobal.h>
27#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
28#include <qdir.h> 28#include <qdir.h>
29 29
30SyntaxDocument::SyntaxDocument() 30SyntaxDocument::SyntaxDocument()
31{ 31{
32 m_root=0; 32 m_root=0;
33 currentFile=""; 33 currentFile="";
34 setupModeList(); 34 setupModeList();
35} 35}
36 36
37void SyntaxDocument::setIdentifier(const QString& identifier) 37void SyntaxDocument::setIdentifier(const QString& identifier)
38{ 38{
39#warning FIXME delete m_root; 39#warning FIXME delete m_root;
40 m_root=Opie::XMLElement::load(identifier); 40 m_root=Opie::Core::XMLElement::load(identifier);
41 if (!m_root) KMessageBox::error( 0L, i18n("Can't open %1").arg(identifier) ); 41 if (!m_root) KMessageBox::error( 0L, i18n("Can't open %1").arg(identifier) );
42 42
43} 43}
44 44
45SyntaxDocument::~SyntaxDocument() 45SyntaxDocument::~SyntaxDocument()
46{ 46{
47} 47}
48 48
49void SyntaxDocument::setupModeList(bool force) 49void SyntaxDocument::setupModeList(bool force)
50{ 50{
51 51
52 if (myModeList.count() > 0) return; 52 if (myModeList.count() > 0) return;
53 53
54 KateConfig *config=KGlobal::config(); 54 KateConfig *config=KGlobal::config();
55 KStandardDirs *dirs = KGlobal::dirs(); 55 KStandardDirs *dirs = KGlobal::dirs();
56 56
57// QStringList list=dirs->findAllResources("data","kate/syntax/*.xml",false,true); 57// QStringList list=dirs->findAllResources("data","kate/syntax/*.xml",false,true);
58 QString path=QPEApplication::qpeDir() +"share/tinykate/syntax/"; 58 QString path=QPEApplication::qpeDir() +"share/tinykate/syntax/";
59 59
60 QDir dir(path); 60 QDir dir(path);
61 QStringList list=dir.entryList("*.xml"); 61 QStringList list=dir.entryList("*.xml");
62 62
63 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) 63 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
64 { 64 {
65 QString Group="Highlighting_Cache"+path+*it; 65 QString Group="Highlighting_Cache"+path+*it;
66 if ((config->hasGroup(Group)) && (!force)) 66 if ((config->hasGroup(Group)) && (!force))
67 { 67 {
68 config->setGroup(Group); 68 config->setGroup(Group);
69 syntaxModeListItem *mli=new syntaxModeListItem; 69 syntaxModeListItem *mli=new syntaxModeListItem;
70 mli->name = config->readEntry("name",""); 70 mli->name = config->readEntry("name","");
71 mli->section = config->readEntry("section",""); 71 mli->section = config->readEntry("section","");
72 mli->mimetype = config->readEntry("mimetype",""); 72 mli->mimetype = config->readEntry("mimetype","");
73 mli->extension = config->readEntry("extension",""); 73 mli->extension = config->readEntry("extension","");
74 mli->identifier = path+*it; 74 mli->identifier = path+*it;
75 myModeList.append(mli); 75 myModeList.append(mli);
76 } 76 }
77 else 77 else
78 { 78 {
79 qDebug("Found a description file:"+path+(*it)); 79 qDebug("Found a description file:"+path+(*it));
80 setIdentifier(path+(*it)); 80 setIdentifier(path+(*it));
81 Opie::XMLElement *e=m_root; 81 Opie::Core::XMLElement *e=m_root;
82 if (e) 82 if (e)
83 { 83 {
84 e=e->firstChild(); 84 e=e->firstChild();
85 qDebug(e->tagName()); 85 qDebug(e->tagName());
86 if (e->tagName()=="language") 86 if (e->tagName()=="language")
87 { 87 {
88 syntaxModeListItem *mli=new syntaxModeListItem; 88 syntaxModeListItem *mli=new syntaxModeListItem;
89 mli->name = e->attribute("name"); 89 mli->name = e->attribute("name");
90 mli->section = e->attribute("section"); 90 mli->section = e->attribute("section");
91 mli->mimetype = e->attribute("mimetype"); 91 mli->mimetype = e->attribute("mimetype");
92 mli->extension = e->attribute("extensions"); 92 mli->extension = e->attribute("extensions");
93 qDebug(QString("valid description for: %1/%2").arg(mli->section).arg(mli->name)); 93 qDebug(QString("valid description for: %1/%2").arg(mli->section).arg(mli->name));
94 if (mli->section.isEmpty()) 94 if (mli->section.isEmpty())
95 mli->section=i18n("Other"); 95 mli->section=i18n("Other");
96 96
97 mli->identifier = path+(*it); 97 mli->identifier = path+(*it);
98 config->setGroup(Group); 98 config->setGroup(Group);
99 config->writeEntry("name",mli->name); 99 config->writeEntry("name",mli->name);
100 config->writeEntry("section",mli->section); 100 config->writeEntry("section",mli->section);
101 config->writeEntry("mimetype",mli->mimetype); 101 config->writeEntry("mimetype",mli->mimetype);
102 config->writeEntry("extension",mli->extension); 102 config->writeEntry("extension",mli->extension);
103 myModeList.append(mli); 103 myModeList.append(mli);
104 } 104 }
105 } 105 }
106 } 106 }
107 } 107 }
108 config->write(); 108 config->write();
109// config->sync(); 109// config->sync();
110} 110}
111 111
112SyntaxModeList SyntaxDocument::modeList() 112SyntaxModeList SyntaxDocument::modeList()
113{ 113{
114 return myModeList; 114 return myModeList;
115} 115}
116 116
117bool SyntaxDocument::nextGroup( syntaxContextData* data) 117bool SyntaxDocument::nextGroup( syntaxContextData* data)
118{ 118{
119 if(!data) return false; 119 if(!data) return false;
120 120
121 if (!data->currentGroup) 121 if (!data->currentGroup)
122 data->currentGroup=data->parent->firstChild(); 122 data->currentGroup=data->parent->firstChild();
123 else 123 else
124 data->currentGroup=data->currentGroup->nextChild(); 124 data->currentGroup=data->currentGroup->nextChild();
125 125
126 data->item=0; 126 data->item=0;
127 127
128 if (!data->currentGroup) 128 if (!data->currentGroup)
129 return false; 129 return false;
130 else 130 else
131 return true; 131 return true;
132} 132}
133 133
134bool SyntaxDocument::nextItem( syntaxContextData* data) 134bool SyntaxDocument::nextItem( syntaxContextData* data)
135{ 135{
136 if(!data) return false; 136 if(!data) return false;
137 137
138 if (!data->item) 138 if (!data->item)
139 data->item=data->currentGroup->firstChild(); 139 data->item=data->currentGroup->firstChild();
140 else 140 else
141 data->item=data->item->nextChild(); 141 data->item=data->item->nextChild();
142 142
143 if (!data->item) 143 if (!data->item)
144 return false; 144 return false;
145 else 145 else
146 return true; 146 return true;
147} 147}
148 148
149QString SyntaxDocument::groupItemData( syntaxContextData* data,QString name) 149QString SyntaxDocument::groupItemData( syntaxContextData* data,QString name)
150{ 150{
151 if(!data) 151 if(!data)
152 return QString::null; 152 return QString::null;
153 153
154 if ( (data->item) && (name.isEmpty())) 154 if ( (data->item) && (name.isEmpty()))
155 return data->item->tagName(); 155 return data->item->tagName();
156 156
157 if (data->item) 157 if (data->item)
158 return data->item->attribute(name); 158 return data->item->attribute(name);
159 else 159 else
160 return QString(); 160 return QString();
161} 161}
162 162
163QString SyntaxDocument::groupData( syntaxContextData* data,QString name) 163QString SyntaxDocument::groupData( syntaxContextData* data,QString name)
164{ 164{
165 if(!data) 165 if(!data)
166 return QString::null; 166 return QString::null;
167 167
168 if (data->currentGroup) 168 if (data->currentGroup)
169 return data->currentGroup->attribute(name); 169 return data->currentGroup->attribute(name);
170 else 170 else
171 return QString(); 171 return QString();
172} 172}
173 173
174void SyntaxDocument::freeGroupInfo( syntaxContextData* data) 174void SyntaxDocument::freeGroupInfo( syntaxContextData* data)
175{ 175{
176 if (data) 176 if (data)
177 delete data; 177 delete data;
178} 178}
179 179
180syntaxContextData* SyntaxDocument::getSubItems(syntaxContextData* data) 180syntaxContextData* SyntaxDocument::getSubItems(syntaxContextData* data)
181{ 181{
182 syntaxContextData *retval=new syntaxContextData; 182 syntaxContextData *retval=new syntaxContextData;
183 retval->parent=0; 183 retval->parent=0;
184 retval->currentGroup=0; 184 retval->currentGroup=0;
185 retval->item=0; 185 retval->item=0;
186 if (data != 0) 186 if (data != 0)
187 { 187 {
188 retval->parent=data->currentGroup; 188 retval->parent=data->currentGroup;
189 retval->currentGroup=data->item; 189 retval->currentGroup=data->item;
190 retval->item=0; 190 retval->item=0;
191 } 191 }
192 192
193 return retval; 193 return retval;
194} 194}
195 195
196syntaxContextData* SyntaxDocument::getConfig(const QString& mainGroupName, const QString &Config) 196syntaxContextData* SyntaxDocument::getConfig(const QString& mainGroupName, const QString &Config)
197{ 197{
198 Opie::XMLElement *e = m_root->firstChild()->firstChild(); 198 Opie::Core::XMLElement *e = m_root->firstChild()->firstChild();
199 199
200 while (e) 200 while (e)
201 { 201 {
202 kdDebug(13010)<<"in SyntaxDocument::getGroupInfo (outer loop) " <<endl; 202 kdDebug(13010)<<"in SyntaxDocument::getGroupInfo (outer loop) " <<endl;
203 203
204 if (e->tagName().compare(mainGroupName)==0 ) 204 if (e->tagName().compare(mainGroupName)==0 )
205 { 205 {
206 Opie::XMLElement *e1=e->firstChild(); 206 Opie::Core::XMLElement *e1=e->firstChild();
207 207
208 while (e1) 208 while (e1)
209 { 209 {
210 kdDebug(13010)<<"in SyntaxDocument::getGroupInfo (inner loop) " <<endl; 210 kdDebug(13010)<<"in SyntaxDocument::getGroupInfo (inner loop) " <<endl;
211 211
212 if (e1->tagName()==Config) 212 if (e1->tagName()==Config)
213 { 213 {
214 syntaxContextData *data=new ( syntaxContextData); 214 syntaxContextData *data=new ( syntaxContextData);
215 data->currentGroup=0; 215 data->currentGroup=0;
216 data->parent=0; 216 data->parent=0;
217 data->item=e1; 217 data->item=e1;
218 return data; 218 return data;
219 } 219 }
220 220
221 e1=e1->nextChild(); 221 e1=e1->nextChild();
222 } 222 }
223 223
224 kdDebug(13010) << "WARNING :returning null 3"<< endl; 224 kdDebug(13010) << "WARNING :returning null 3"<< endl;
225 return 0; 225 return 0;
226 } 226 }
227 227
228 e=e->nextChild(); 228 e=e->nextChild();
229 } 229 }
230 230
231 kdDebug(13010) << "WARNING :returning null 4" << endl; 231 kdDebug(13010) << "WARNING :returning null 4" << endl;
232 return 0; 232 return 0;
233} 233}
234 234
235 235
236 236
237syntaxContextData* SyntaxDocument::getGroupInfo(const QString& mainGroupName, const QString &group) 237syntaxContextData* SyntaxDocument::getGroupInfo(const QString& mainGroupName, const QString &group)
238{ 238{
239 239
240 Opie::XMLElement *e=m_root->firstChild()->firstChild(); 240 Opie::Core::XMLElement *e=m_root->firstChild()->firstChild();
241 241
242 while (e) 242 while (e)
243 { 243 {
244 kdDebug(13010)<<"in SyntaxDocument::getGroupInfo (outer loop) " <<endl; 244 kdDebug(13010)<<"in SyntaxDocument::getGroupInfo (outer loop) " <<endl;
245 245
246 if (e->tagName().compare(mainGroupName)==0 ) 246 if (e->tagName().compare(mainGroupName)==0 )
247 { 247 {
248 Opie::XMLElement *e1=e->firstChild(); 248 Opie::Core::XMLElement *e1=e->firstChild();
249 249
250 while (e1) 250 while (e1)
251 { 251 {
252 kdDebug(13010)<<"in SyntaxDocument::getGroupInfo (inner loop) " <<endl; 252 kdDebug(13010)<<"in SyntaxDocument::getGroupInfo (inner loop) " <<endl;
253 if (e1->tagName()==group+"s") 253 if (e1->tagName()==group+"s")
254 { 254 {
255 syntaxContextData *data=new ( syntaxContextData); 255 syntaxContextData *data=new ( syntaxContextData);
256 data->parent=e1; 256 data->parent=e1;
257 data->currentGroup=0; 257 data->currentGroup=0;
258 data->item=0; 258 data->item=0;
259 return data; 259 return data;
260 } 260 }
261 261
262 e1=e1->nextChild(); 262 e1=e1->nextChild();
263 } 263 }
264 264
265 kdDebug(13010) << "WARNING : getGroupInfo returning null :1 " << endl; 265 kdDebug(13010) << "WARNING : getGroupInfo returning null :1 " << endl;
266 return 0; 266 return 0;
267 } 267 }
268 268
269 e=e->nextChild(); 269 e=e->nextChild();
270 } 270 }
271 271
272 kdDebug(13010) << "WARNING : getGroupInfo returning null :2" << endl; 272 kdDebug(13010) << "WARNING : getGroupInfo returning null :2" << endl;
273 return 0; 273 return 0;
274} 274}
275 275
276 276
277QStringList& SyntaxDocument::finddata(const QString& mainGroup,const QString& type,bool clearList) 277QStringList& SyntaxDocument::finddata(const QString& mainGroup,const QString& type,bool clearList)
278{ 278{
279 Opie::XMLElement *e = m_root->firstChild(); 279 Opie::Core::XMLElement *e = m_root->firstChild();
280 if (clearList) 280 if (clearList)
281 m_data.clear(); 281 m_data.clear();
282 282
283 for(e=e->firstChild(); e; e=e->nextChild()) 283 for(e=e->firstChild(); e; e=e->nextChild())
284 { 284 {
285 if (e->tagName()==mainGroup) 285 if (e->tagName()==mainGroup)
286 { 286 {
287 for (Opie::XMLElement *e1=e->firstChild();e1;e1=e1->nextChild()) 287 for (Opie::Core::XMLElement *e1=e->firstChild();e1;e1=e1->nextChild())
288 { 288 {
289 if (e1->tagName()!="list") continue; 289 if (e1->tagName()!="list") continue;
290 290
291 if (e1->attribute("name")==type) 291 if (e1->attribute("name")==type)
292 { 292 {
293 for (Opie::XMLElement *e2=e1->firstChild();e2;e2=e2->nextChild()) 293 for (Opie::Core::XMLElement *e2=e1->firstChild();e2;e2=e2->nextChild())
294 { 294 {
295 qDebug("FOUND A LIST ENTRY("+e2->tagName()+"):"+e2->firstChild()->value()); 295 qDebug("FOUND A LIST ENTRY("+e2->tagName()+"):"+e2->firstChild()->value());
296 m_data+=e2->firstChild()->value().stripWhiteSpace(); 296 m_data+=e2->firstChild()->value().stripWhiteSpace();
297 } 297 }
298 break; 298 break;
299 } 299 }
300 } 300 }
301 break; 301 break;
302 } 302 }
303 } 303 }
304 304
305 return m_data; 305 return m_data;
306} 306}
diff --git a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.h b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.h
index 5eefc77..072f5f0 100644
--- a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.h
+++ b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.h
@@ -1,73 +1,73 @@
1/*************************************************************************** 1/***************************************************************************
2 katesyntaxdocument.h - description 2 katesyntaxdocument.h - description
3 ------------------- 3 -------------------
4 begin : Sat 31 March 2001 4 begin : Sat 31 March 2001
5 copyright : (C) 2001,2002 by Joseph Wenninger 5 copyright : (C) 2001,2002 by Joseph Wenninger
6 email : jowenn@kde.org 6 email : jowenn@kde.org
7 ***************************************************************************/ 7 ***************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
18#ifndef SYNTAXDOCUMENT_H 18#ifndef SYNTAXDOCUMENT_H
19#define SYNTAXDOCUMENT_H 19#define SYNTAXDOCUMENT_H
20 20
21#include <opie2/xmltree.h> 21#include <opie2/xmltree.h>
22#include <qlist.h> 22#include <qlist.h>
23#include <qstringlist.h> 23#include <qstringlist.h>
24 24
25 25
26class syntaxModeListItem 26class syntaxModeListItem
27{ 27{
28 public: 28 public:
29 QString name; 29 QString name;
30 QString section; 30 QString section;
31 QString mimetype; 31 QString mimetype;
32 QString extension; 32 QString extension;
33 QString identifier; 33 QString identifier;
34}; 34};
35 35
36class syntaxContextData 36class syntaxContextData
37{ 37{
38 public: 38 public:
39 Opie::XMLElement *parent; 39 Opie::Core::XMLElement *parent;
40 Opie::XMLElement *currentGroup; 40 Opie::Core::XMLElement *currentGroup;
41 Opie::XMLElement *item; 41 Opie::Core::XMLElement *item;
42}; 42};
43 43
44typedef QList<syntaxModeListItem> SyntaxModeList; 44typedef QList<syntaxModeListItem> SyntaxModeList;
45 45
46class SyntaxDocument 46class SyntaxDocument
47{ 47{
48 public: 48 public:
49 SyntaxDocument(); 49 SyntaxDocument();
50 ~SyntaxDocument(); 50 ~SyntaxDocument();
51 51
52 QStringList& finddata(const QString& mainGroup,const QString& type,bool clearList=true); 52 QStringList& finddata(const QString& mainGroup,const QString& type,bool clearList=true);
53 SyntaxModeList modeList(); 53 SyntaxModeList modeList();
54 54
55 syntaxContextData* getGroupInfo(const QString& langName, const QString &group); 55 syntaxContextData* getGroupInfo(const QString& langName, const QString &group);
56 void freeGroupInfo(syntaxContextData* data); 56 void freeGroupInfo(syntaxContextData* data);
57 syntaxContextData* getConfig(const QString& mainGroupName, const QString &Config); 57 syntaxContextData* getConfig(const QString& mainGroupName, const QString &Config);
58 bool nextItem(syntaxContextData* data); 58 bool nextItem(syntaxContextData* data);
59 bool nextGroup(syntaxContextData* data); 59 bool nextGroup(syntaxContextData* data);
60 syntaxContextData* getSubItems(syntaxContextData* data); 60 syntaxContextData* getSubItems(syntaxContextData* data);
61 QString groupItemData(syntaxContextData* data,QString name); 61 QString groupItemData(syntaxContextData* data,QString name);
62 QString groupData(syntaxContextData* data,QString name); 62 QString groupData(syntaxContextData* data,QString name);
63 void setIdentifier(const QString& identifier); 63 void setIdentifier(const QString& identifier);
64 64
65 private: 65 private:
66 Opie::XMLElement *m_root; 66 Opie::Core::XMLElement *m_root;
67 void setupModeList(bool force=false); 67 void setupModeList(bool force=false);
68 QString currentFile; 68 QString currentFile;
69 SyntaxModeList myModeList; 69 SyntaxModeList myModeList;
70 QStringList m_data; 70 QStringList m_data;
71}; 71};
72 72
73#endif 73#endif
diff --git a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp
index c3a0a2e..f82356b 100644
--- a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp
+++ b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp
@@ -1,573 +1,572 @@
1/*************************************************************************** 1/***************************************************************************
2 kateviewdialog.cpp - description 2 kateviewdialog.cpp - description
3 ------------------- 3 -------------------
4 copyright : (C) 2001 by The Kate Team 4 copyright : (C) 2001 by The Kate Team
5 (C) 2002 by Joseph Wenninger 5 (C) 2002 by Joseph Wenninger
6 email : kwrite-devel@kde.org 6 email : kwrite-devel@kde.org
7 jowenn@kde.org 7 jowenn@kde.org
8 8
9 ***************************************************************************/ 9 ***************************************************************************/
10 10
11/*************************************************************************** 11/***************************************************************************
12 * * 12 * *
13 * This program is free software; you can redistribute it and/or modify * 13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by * 14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or * 15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. * 16 * (at your option) any later version. *
17 * * 17 * *
18 ***************************************************************************/ 18 ***************************************************************************/
19// Dialogs 19// Dialogs
20 20
21#include <stdio.h> 21#include <stdio.h>
22#include <stdlib.h> 22#include <stdlib.h>
23 23
24#include <qgrid.h> 24#include <qgrid.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qlistbox.h> 27#include <qlistbox.h>
28#include <qgroupbox.h> 28#include <qgroupbox.h>
29#include <qlineedit.h> 29#include <qlineedit.h>
30#include <qcheckbox.h> 30#include <qcheckbox.h>
31#include <qcollection.h> 31#include <qcollection.h>
32#include <qpushbutton.h> 32#include <qpushbutton.h>
33#include <qobjectlist.h> 33#include <qobjectlist.h>
34#include <qradiobutton.h> 34#include <qradiobutton.h>
35#include <qwhatsthis.h> 35#include <qwhatsthis.h>
36#include <qstringlist.h> 36#include <qstringlist.h>
37#include <klocale.h> 37#include <klocale.h>
38#include <kcolorbtn.h> 38#include <kcolorbtn.h>
39#include <kglobal.h> 39#include <kglobal.h>
40#include <qvbox.h> 40#include <qvbox.h>
41#include <qspinbox.h> 41#include <qspinbox.h>
42#include <qcombobox.h> 42#include <qcombobox.h>
43#include <kfontdialog.h> 43#include <kfontdialog.h>
44 44
45#include "../document/katedocument.h" 45#include "../document/katedocument.h"
46#include "kateviewdialog.h" 46#include "kateviewdialog.h"
47#include <opie2/ofontselector.h> 47#include <opie2/ofontselector.h>
48 48
49 49
50using namespace Opie::Ui; 50using namespace Opie::Ui;
51using namespace Opie::Ui;
52SearchDialog::SearchDialog( QWidget *parent, QStringList &searchFor, QStringList &replaceWith, int flags ) 51SearchDialog::SearchDialog( QWidget *parent, QStringList &searchFor, QStringList &replaceWith, int flags )
53 : KDialogBase( parent, 0L, true, i18n( "Find Text" ), Ok | Cancel, Ok ) 52 : KDialogBase( parent, 0L, true, i18n( "Find Text" ), Ok | Cancel, Ok )
54 , m_replace( 0L ) 53 , m_replace( 0L )
55{ 54{
56 QWidget *page = new QWidget( this ); 55 QWidget *page = new QWidget( this );
57 setMainWidget( page ); 56 setMainWidget( page );
58 57
59 QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); 58 QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );
60 59
61 m_search = new QComboBox( true, page ); 60 m_search = new QComboBox( true, page );
62 m_search->insertStringList( searchFor ); 61 m_search->insertStringList( searchFor );
63 m_search->setMinimumWidth( m_search->sizeHint().width() ); 62 m_search->setMinimumWidth( m_search->sizeHint().width() );
64 m_search->lineEdit()->selectAll(); 63 m_search->lineEdit()->selectAll();
65 QLabel *label = new QLabel( m_search, i18n( "&Text To Find:" ), page ); 64 QLabel *label = new QLabel( m_search, i18n( "&Text To Find:" ), page );
66 m_optRegExp = new QCheckBox( i18n( "Regular Expression" ), page ); 65 m_optRegExp = new QCheckBox( i18n( "Regular Expression" ), page );
67 topLayout->addWidget( label ); 66 topLayout->addWidget( label );
68 topLayout->addWidget( m_search ); 67 topLayout->addWidget( m_search );
69 topLayout->addWidget( m_optRegExp ); 68 topLayout->addWidget( m_optRegExp );
70 69
71 if( flags & KateView::sfReplace ) 70 if( flags & KateView::sfReplace )
72 { 71 {
73 // make it a replace dialog 72 // make it a replace dialog
74 setCaption( i18n( "Replace Text" ) ); 73 setCaption( i18n( "Replace Text" ) );
75 m_replace = new QComboBox( true, page ); 74 m_replace = new QComboBox( true, page );
76 m_replace->insertStringList( replaceWith ); 75 m_replace->insertStringList( replaceWith );
77 m_replace->setMinimumWidth( m_search->sizeHint().width() ); 76 m_replace->setMinimumWidth( m_search->sizeHint().width() );
78 label = new QLabel( m_replace, i18n( "&Replace With:" ), page ); 77 label = new QLabel( m_replace, i18n( "&Replace With:" ), page );
79 //m_optPlaceholders = new QCheckBox( i18n( "&Use Placeholders" ), page ); 78 //m_optPlaceholders = new QCheckBox( i18n( "&Use Placeholders" ), page );
80 topLayout->addWidget( label ); 79 topLayout->addWidget( label );
81 topLayout->addWidget( m_replace ); 80 topLayout->addWidget( m_replace );
82 //topLayout->addWidget( m_optPlaceholders ); 81 //topLayout->addWidget( m_optPlaceholders );
83 } 82 }
84 83
85 QGroupBox *group = new QGroupBox( i18n( "Options" ), page ); 84 QGroupBox *group = new QGroupBox( i18n( "Options" ), page );
86 topLayout->addWidget( group, 10 ); 85 topLayout->addWidget( group, 10 );
87 86
88 QGridLayout *gbox = new QGridLayout( group, 5, 2, spacingHint() ); 87 QGridLayout *gbox = new QGridLayout( group, 5, 2, spacingHint() );
89 gbox->addRowSpacing( 0, fontMetrics().lineSpacing() ); 88 gbox->addRowSpacing( 0, fontMetrics().lineSpacing() );
90 gbox->setRowStretch( 4, 10 ); 89 gbox->setRowStretch( 4, 10 );
91 90
92 m_opt1 = new QCheckBox( i18n( "C&ase Sensitive" ), group ); 91 m_opt1 = new QCheckBox( i18n( "C&ase Sensitive" ), group );
93 gbox->addWidget( m_opt1, 1, 0 ); 92 gbox->addWidget( m_opt1, 1, 0 );
94 93
95 m_opt2 = new QCheckBox(i18n("&Whole Words Only" ), group ); 94 m_opt2 = new QCheckBox(i18n("&Whole Words Only" ), group );
96 gbox->addWidget( m_opt2, 2, 0 ); 95 gbox->addWidget( m_opt2, 2, 0 );
97 96
98 m_opt3 = new QCheckBox(i18n("&From Beginning" ), group ); 97 m_opt3 = new QCheckBox(i18n("&From Beginning" ), group );
99 gbox->addWidget( m_opt3, 3, 0 ); 98 gbox->addWidget( m_opt3, 3, 0 );
100 99
101 m_opt4 = new QCheckBox(i18n("Find &Backwards" ), group ); 100 m_opt4 = new QCheckBox(i18n("Find &Backwards" ), group );
102 gbox->addWidget( m_opt4, 1, 1 ); 101 gbox->addWidget( m_opt4, 1, 1 );
103 102
104 m_opt5 = new QCheckBox(i18n("&Selected Text" ), group ); 103 m_opt5 = new QCheckBox(i18n("&Selected Text" ), group );
105 gbox->addWidget( m_opt5, 2, 1 ); 104 gbox->addWidget( m_opt5, 2, 1 );
106 105
107 m_opt1->setChecked( flags & KateView::sfCaseSensitive ); 106 m_opt1->setChecked( flags & KateView::sfCaseSensitive );
108 m_opt2->setChecked( flags & KateView::sfWholeWords ); 107 m_opt2->setChecked( flags & KateView::sfWholeWords );
109 m_opt3->setChecked( flags & KateView::sfFromBeginning ); 108 m_opt3->setChecked( flags & KateView::sfFromBeginning );
110 m_optRegExp->setChecked( flags & KateView::sfRegularExpression ); 109 m_optRegExp->setChecked( flags & KateView::sfRegularExpression );
111 m_opt4->setChecked( flags & KateView::sfBackward ); 110 m_opt4->setChecked( flags & KateView::sfBackward );
112 m_opt5->setChecked( flags & KateView::sfSelected ); 111 m_opt5->setChecked( flags & KateView::sfSelected );
113 112
114 if( m_replace ) 113 if( m_replace )
115 { 114 {
116 m_opt6 = new QCheckBox( i18n( "&Prompt On Replace" ), group ); 115 m_opt6 = new QCheckBox( i18n( "&Prompt On Replace" ), group );
117 m_opt6->setChecked( flags & KateView::sfPrompt ); 116 m_opt6->setChecked( flags & KateView::sfPrompt );
118 gbox->addWidget( m_opt6, 3, 1 ); 117 gbox->addWidget( m_opt6, 3, 1 );
119 } 118 }
120 119
121 m_search->setFocus(); 120 m_search->setFocus();
122} 121}
123 122
124QString SearchDialog::getSearchFor() 123QString SearchDialog::getSearchFor()
125{ 124{
126 return m_search->currentText(); 125 return m_search->currentText();
127} 126}
128 127
129QString SearchDialog::getReplaceWith() 128QString SearchDialog::getReplaceWith()
130{ 129{
131 return m_replace->currentText(); 130 return m_replace->currentText();
132} 131}
133 132
134int SearchDialog::getFlags() 133int SearchDialog::getFlags()
135{ 134{
136 int flags = 0; 135 int flags = 0;
137 136
138 if( m_opt1->isChecked() ) flags |= KateView::sfCaseSensitive; 137 if( m_opt1->isChecked() ) flags |= KateView::sfCaseSensitive;
139 if( m_opt2->isChecked() ) flags |= KateView::sfWholeWords; 138 if( m_opt2->isChecked() ) flags |= KateView::sfWholeWords;
140 if( m_opt3->isChecked() ) flags |= KateView::sfFromBeginning; 139 if( m_opt3->isChecked() ) flags |= KateView::sfFromBeginning;
141 if( m_opt4->isChecked() ) flags |= KateView::sfBackward; 140 if( m_opt4->isChecked() ) flags |= KateView::sfBackward;
142 if( m_opt5->isChecked() ) flags |= KateView::sfSelected; 141 if( m_opt5->isChecked() ) flags |= KateView::sfSelected;
143 if( m_optRegExp->isChecked() ) flags |= KateView::sfRegularExpression; 142 if( m_optRegExp->isChecked() ) flags |= KateView::sfRegularExpression;
144 if( m_replace ) 143 if( m_replace )
145 { 144 {
146 if( m_opt6->isChecked() ) 145 if( m_opt6->isChecked() )
147 flags |= KateView::sfPrompt; 146 flags |= KateView::sfPrompt;
148 147
149 flags |= KateView::sfReplace; 148 flags |= KateView::sfReplace;
150 } 149 }
151 150
152 return flags; 151 return flags;
153} 152}
154 153
155void SearchDialog::slotOk() 154void SearchDialog::slotOk()
156{ 155{
157 if ( !m_search->currentText().isEmpty() ) 156 if ( !m_search->currentText().isEmpty() )
158 { 157 {
159 if ( !m_optRegExp->isChecked() ) 158 if ( !m_optRegExp->isChecked() )
160 { 159 {
161 accept(); 160 accept();
162 } 161 }
163 else 162 else
164 { 163 {
165 // Check for a valid regular expression. 164 // Check for a valid regular expression.
166 165
167 QRegExp regExp( m_search->currentText() ); 166 QRegExp regExp( m_search->currentText() );
168 167
169 if ( regExp.isValid() ) 168 if ( regExp.isValid() )
170 accept(); 169 accept();
171 } 170 }
172 } 171 }
173} 172}
174 173
175void SearchDialog::setSearchText( const QString &searchstr ) 174void SearchDialog::setSearchText( const QString &searchstr )
176 { 175 {
177 m_search->insertItem( searchstr, 0 ); 176 m_search->insertItem( searchstr, 0 );
178 m_search->setCurrentItem( 0 ); 177 m_search->setCurrentItem( 0 );
179 m_search->lineEdit()->selectAll(); 178 m_search->lineEdit()->selectAll();
180 } 179 }
181 180
182// this dialog is not modal 181// this dialog is not modal
183ReplacePrompt::ReplacePrompt( QWidget *parent ) 182ReplacePrompt::ReplacePrompt( QWidget *parent )
184 : KDialogBase(parent, 0L, false, i18n( "Replace Text" ), 183 : KDialogBase(parent, 0L, false, i18n( "Replace Text" ),
185 User3 | User2 | User1 | Close, User3, true, 184 User3 | User2 | User1 | Close, User3, true,
186 i18n("&All"), i18n("&No"), i18n("&Yes")) { 185 i18n("&All"), i18n("&No"), i18n("&Yes")) {
187 186
188 QWidget *page = new QWidget(this); 187 QWidget *page = new QWidget(this);
189 setMainWidget(page); 188 setMainWidget(page);
190 189
191 QBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); 190 QBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );
192 QLabel *label = new QLabel(i18n("Replace this occurence?"),page); 191 QLabel *label = new QLabel(i18n("Replace this occurence?"),page);
193 topLayout->addWidget(label ); 192 topLayout->addWidget(label );
194} 193}
195 194
196void ReplacePrompt::slotUser1( void ) { // All 195void ReplacePrompt::slotUser1( void ) { // All
197 done(KateView::srAll); 196 done(KateView::srAll);
198} 197}
199 198
200void ReplacePrompt::slotUser2( void ) { // No 199void ReplacePrompt::slotUser2( void ) { // No
201 done(KateView::srNo); 200 done(KateView::srNo);
202} 201}
203 202
204void ReplacePrompt::slotUser3( void ) { // Yes 203void ReplacePrompt::slotUser3( void ) { // Yes
205 accept(); 204 accept();
206} 205}
207 206
208void ReplacePrompt::done(int r) { 207void ReplacePrompt::done(int r) {
209 setResult(r); 208 setResult(r);
210 emit clicked(); 209 emit clicked();
211} 210}
212 211
213void ReplacePrompt::closeEvent(QCloseEvent *) { 212void ReplacePrompt::closeEvent(QCloseEvent *) {
214 reject(); 213 reject();
215} 214}
216 215
217GotoLineDialog::GotoLineDialog(QWidget *parent, int line, int max) 216GotoLineDialog::GotoLineDialog(QWidget *parent, int line, int max)
218 : KDialogBase(parent, 0L, true, i18n("Goto Line"), Ok | Cancel, Ok) { 217 : KDialogBase(parent, 0L, true, i18n("Goto Line"), Ok | Cancel, Ok) {
219 218
220 QWidget *page = new QWidget(this); 219 QWidget *page = new QWidget(this);
221 setMainWidget(page); 220 setMainWidget(page);
222 221
223 QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); 222 QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );
224 e1 = new QSpinBox(page); 223 e1 = new QSpinBox(page);
225 e1->setMinValue(1); 224 e1->setMinValue(1);
226 e1->setMaxValue(max); 225 e1->setMaxValue(max);
227 e1->setValue((int)line); 226 e1->setValue((int)line);
228 227
229 QLabel *label = new QLabel( e1,i18n("&Goto Line:"), page ); 228 QLabel *label = new QLabel( e1,i18n("&Goto Line:"), page );
230 topLayout->addWidget(label); 229 topLayout->addWidget(label);
231 topLayout->addWidget(e1); 230 topLayout->addWidget(e1);
232 topLayout->addSpacing(spacingHint()); // A little bit extra space 231 topLayout->addSpacing(spacingHint()); // A little bit extra space
233 topLayout->addStretch(10); 232 topLayout->addStretch(10);
234 e1->setFocus(); 233 e1->setFocus();
235} 234}
236 235
237int GotoLineDialog::getLine() { 236int GotoLineDialog::getLine() {
238 return e1->value(); 237 return e1->value();
239} 238}
240 239
241const int IndentConfigTab::flags[] = {KateView::cfAutoIndent, KateView::cfSpaceIndent, 240const int IndentConfigTab::flags[] = {KateView::cfAutoIndent, KateView::cfSpaceIndent,
242 KateView::cfBackspaceIndents,KateView::cfTabIndents, KateView::cfKeepIndentProfile, KateView::cfKeepExtraSpaces}; 241 KateView::cfBackspaceIndents,KateView::cfTabIndents, KateView::cfKeepIndentProfile, KateView::cfKeepExtraSpaces};
243 242
244IndentConfigTab::IndentConfigTab(QWidget *parent, KateView *view) 243IndentConfigTab::IndentConfigTab(QWidget *parent, KateView *view)
245 : QWidget(parent, 0L) 244 : QWidget(parent, 0L)
246{ 245{
247 QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() ); 246 QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() );
248 int configFlags = view->config(); 247 int configFlags = view->config();
249 248
250 opt[0] = new QCheckBox(i18n("&Auto Indent"), this); 249 opt[0] = new QCheckBox(i18n("&Auto Indent"), this);
251 layout->addWidget(opt[0], 0, AlignLeft); 250 layout->addWidget(opt[0], 0, AlignLeft);
252 opt[0]->setChecked(configFlags & flags[0]); 251 opt[0]->setChecked(configFlags & flags[0]);
253 252
254 opt[1] = new QCheckBox(i18n("Indent With &Spaces"), this); 253 opt[1] = new QCheckBox(i18n("Indent With &Spaces"), this);
255 layout->addWidget(opt[1], 0, AlignLeft); 254 layout->addWidget(opt[1], 0, AlignLeft);
256 opt[1]->setChecked(configFlags & flags[1]); 255 opt[1]->setChecked(configFlags & flags[1]);
257 256
258 opt[2] = new QCheckBox(i18n("&Backspace Key Indents"), this); 257 opt[2] = new QCheckBox(i18n("&Backspace Key Indents"), this);
259 layout->addWidget(opt[2], 0, AlignLeft); 258 layout->addWidget(opt[2], 0, AlignLeft);
260 opt[2]->setChecked(configFlags & flags[2]); 259 opt[2]->setChecked(configFlags & flags[2]);
261 260
262 opt[3] = new QCheckBox(i18n("&Tab Key Indents"), this); 261 opt[3] = new QCheckBox(i18n("&Tab Key Indents"), this);
263 layout->addWidget(opt[3], 0, AlignLeft); 262 layout->addWidget(opt[3], 0, AlignLeft);
264 opt[3]->setChecked(configFlags & flags[3]); 263 opt[3]->setChecked(configFlags & flags[3]);
265 264
266 opt[4] = new QCheckBox(i18n("Keep Indent &Profile"), this); 265 opt[4] = new QCheckBox(i18n("Keep Indent &Profile"), this);
267 layout->addWidget(opt[4], 0, AlignLeft); 266 layout->addWidget(opt[4], 0, AlignLeft);
268// opt[4]->setChecked(configFlags & flags[4]); 267// opt[4]->setChecked(configFlags & flags[4]);
269 opt[4]->setChecked(true); 268 opt[4]->setChecked(true);
270 opt[4]->hide(); 269 opt[4]->hide();
271 270
272 opt[5] = new QCheckBox(i18n("&Keep Extra Spaces"), this); 271 opt[5] = new QCheckBox(i18n("&Keep Extra Spaces"), this);
273 layout->addWidget(opt[5], 0, AlignLeft); 272 layout->addWidget(opt[5], 0, AlignLeft);
274 opt[5]->setChecked(configFlags & flags[5]); 273 opt[5]->setChecked(configFlags & flags[5]);
275 274
276 layout->addStretch(); 275 layout->addStretch();
277 276
278 // What is this? help 277 // What is this? help
279 QWhatsThis::add(opt[0], i18n("When <b>Auto indent</b> is on, KateView will indent new lines to equal the indent on the previous line.<p>If the previous line is blank, the nearest line above with text is used")); 278 QWhatsThis::add(opt[0], i18n("When <b>Auto indent</b> is on, KateView will indent new lines to equal the indent on the previous line.<p>If the previous line is blank, the nearest line above with text is used"));
280 QWhatsThis::add(opt[1], i18n("Check this if you want to indent with spaces rather than tabs.<br>A Tab will be converted to <u>Tab-width</u> as set in the <b>edit</b> options")); 279 QWhatsThis::add(opt[1], i18n("Check this if you want to indent with spaces rather than tabs.<br>A Tab will be converted to <u>Tab-width</u> as set in the <b>edit</b> options"));
281 QWhatsThis::add(opt[2], i18n("This allows the <b>backspace</b> key to be used to indent.")); 280 QWhatsThis::add(opt[2], i18n("This allows the <b>backspace</b> key to be used to indent."));
282 QWhatsThis::add(opt[3], i18n("This allows the <b>tab</b> key to be used to indent.")); 281 QWhatsThis::add(opt[3], i18n("This allows the <b>tab</b> key to be used to indent."));
283 QWhatsThis::add(opt[4], i18n("This retains current indentation settings for future documents.")); 282 QWhatsThis::add(opt[4], i18n("This retains current indentation settings for future documents."));
284 QWhatsThis::add(opt[5], i18n("Indentations of more than the selected number of spaces will not be shortened.")); 283 QWhatsThis::add(opt[5], i18n("Indentations of more than the selected number of spaces will not be shortened."));
285} 284}
286 285
287void IndentConfigTab::getData(KateView *view) { 286void IndentConfigTab::getData(KateView *view) {
288 int configFlags, z; 287 int configFlags, z;
289 288
290 configFlags = view->config(); 289 configFlags = view->config();
291 for (z = 0; z < numFlags; z++) { 290 for (z = 0; z < numFlags; z++) {
292 configFlags &= ~flags[z]; 291 configFlags &= ~flags[z];
293 if (opt[z]->isChecked()) configFlags |= flags[z]; 292 if (opt[z]->isChecked()) configFlags |= flags[z];
294 } 293 }
295 view->setConfig(configFlags); 294 view->setConfig(configFlags);
296} 295}
297 296
298const int SelectConfigTab::flags[] = {KateView::cfPersistent, KateView::cfDelOnInput, 297const int SelectConfigTab::flags[] = {KateView::cfPersistent, KateView::cfDelOnInput,
299 KateView::cfMouseAutoCopy, KateView::cfSingleSelection, KateView::cfVerticalSelect, KateView::cfXorSelect}; 298 KateView::cfMouseAutoCopy, KateView::cfSingleSelection, KateView::cfVerticalSelect, KateView::cfXorSelect};
300 299
301SelectConfigTab::SelectConfigTab(QWidget *parent, KateView *view) 300SelectConfigTab::SelectConfigTab(QWidget *parent, KateView *view)
302 : QWidget(parent, 0L) 301 : QWidget(parent, 0L)
303{ 302{
304 QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() ); 303 QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() );
305 int configFlags = view->config(); 304 int configFlags = view->config();
306 305
307 opt[0] = new QCheckBox(i18n("&Persistent Selections"), this); 306 opt[0] = new QCheckBox(i18n("&Persistent Selections"), this);
308 layout->addWidget(opt[0], 0, AlignLeft); 307 layout->addWidget(opt[0], 0, AlignLeft);
309 opt[0]->setChecked(configFlags & flags[0]); 308 opt[0]->setChecked(configFlags & flags[0]);
310 309
311 opt[1] = new QCheckBox(i18n("&Overwrite Selections"), this); 310 opt[1] = new QCheckBox(i18n("&Overwrite Selections"), this);
312 layout->addWidget(opt[1], 0, AlignLeft); 311 layout->addWidget(opt[1], 0, AlignLeft);
313 opt[1]->setChecked(configFlags & flags[1]); 312 opt[1]->setChecked(configFlags & flags[1]);
314 313
315 opt[2] = new QCheckBox(i18n("Mouse &Autocopy"), this); 314 opt[2] = new QCheckBox(i18n("Mouse &Autocopy"), this);
316 layout->addWidget(opt[2], 0, AlignLeft); 315 layout->addWidget(opt[2], 0, AlignLeft);
317 opt[2]->setChecked(configFlags & flags[2]); 316 opt[2]->setChecked(configFlags & flags[2]);
318 317
319 opt[3] = new QCheckBox(i18n("&X11-like Single Selection"), this); 318 opt[3] = new QCheckBox(i18n("&X11-like Single Selection"), this);
320 layout->addWidget(opt[3], 0, AlignLeft); 319 layout->addWidget(opt[3], 0, AlignLeft);
321 opt[3]->setChecked(configFlags & flags[3]); 320 opt[3]->setChecked(configFlags & flags[3]);
322 321
323 opt[4] = new QCheckBox(i18n("&Vertical Selections"), this); 322 opt[4] = new QCheckBox(i18n("&Vertical Selections"), this);
324 layout->addWidget(opt[4], 0, AlignLeft); 323 layout->addWidget(opt[4], 0, AlignLeft);
325 opt[4]->setChecked(configFlags & flags[4]); 324 opt[4]->setChecked(configFlags & flags[4]);
326 325
327 opt[5] = new QCheckBox(i18n("&Toggle Old"), this); 326 opt[5] = new QCheckBox(i18n("&Toggle Old"), this);
328 layout->addWidget(opt[5], 0, AlignLeft); 327 layout->addWidget(opt[5], 0, AlignLeft);
329 opt[5]->setChecked(configFlags & flags[5]); 328 opt[5]->setChecked(configFlags & flags[5]);
330 329
331 layout->addStretch(); 330 layout->addStretch();
332 331
333 // What is this? help 332 // What is this? help
334 QWhatsThis::add(opt[0], i18n("Enabling this prevents key input or cursor movement by way of the arrow keys from causing the elimination of text selection.<p><b>Note:</b> If the Overwrite Selections option is activated then any typed character input or paste operation will replace the selected text.")); 333 QWhatsThis::add(opt[0], i18n("Enabling this prevents key input or cursor movement by way of the arrow keys from causing the elimination of text selection.<p><b>Note:</b> If the Overwrite Selections option is activated then any typed character input or paste operation will replace the selected text."));
335 QWhatsThis::add(opt[1], i18n("When this is on, any keyed character input or paste operation will replace the selected text.")); 334 QWhatsThis::add(opt[1], i18n("When this is on, any keyed character input or paste operation will replace the selected text."));
336 QWhatsThis::add(opt[2], i18n("When this is on, any text selected with the mouse will be automatically copied to the clipboard.")); 335 QWhatsThis::add(opt[2], i18n("When this is on, any text selected with the mouse will be automatically copied to the clipboard."));
337 QWhatsThis::add(opt[3], i18n("Not implemented yet.")); 336 QWhatsThis::add(opt[3], i18n("Not implemented yet."));
338 QWhatsThis::add(opt[4], i18n("Enabling this allows you to make vertical selections.")); 337 QWhatsThis::add(opt[4], i18n("Enabling this allows you to make vertical selections."));
339 QWhatsThis::add(opt[5], i18n("Not yet implemented.")); 338 QWhatsThis::add(opt[5], i18n("Not yet implemented."));
340} 339}
341 340
342void SelectConfigTab::getData(KateView *view) { 341void SelectConfigTab::getData(KateView *view) {
343 int configFlags, z; 342 int configFlags, z;
344 343
345 configFlags = view->config(); 344 configFlags = view->config();
346 for (z = 0; z < numFlags; z++) { 345 for (z = 0; z < numFlags; z++) {
347 configFlags &= ~flags[z]; // clear flag 346 configFlags &= ~flags[z]; // clear flag
348 if (opt[z]->isChecked()) configFlags |= flags[z]; // set flag if checked 347 if (opt[z]->isChecked()) configFlags |= flags[z]; // set flag if checked
349 } 348 }
350 view->setConfig(configFlags); 349 view->setConfig(configFlags);
351} 350}
352 351
353const int EditConfigTab::flags[] = {KateView::cfWordWrap, KateView::cfReplaceTabs, KateView::cfRemoveSpaces, 352const int EditConfigTab::flags[] = {KateView::cfWordWrap, KateView::cfReplaceTabs, KateView::cfRemoveSpaces,
354 KateView::cfAutoBrackets, KateView::cfGroupUndo, KateView::cfShowTabs, KateView::cfSmartHome, 353 KateView::cfAutoBrackets, KateView::cfGroupUndo, KateView::cfShowTabs, KateView::cfSmartHome,
355 KateView::cfPageUDMovesCursor, KateView::cfWrapCursor}; 354 KateView::cfPageUDMovesCursor, KateView::cfWrapCursor};
356 355
357EditConfigTab::EditConfigTab(QWidget *parent, KateView *view) 356EditConfigTab::EditConfigTab(QWidget *parent, KateView *view)
358 : QWidget(parent, 0L) { 357 : QWidget(parent, 0L) {
359 358
360 QHBoxLayout *mainLayout; 359 QHBoxLayout *mainLayout;
361 QVBoxLayout *cbLayout, *leLayout; 360 QVBoxLayout *cbLayout, *leLayout;
362 int configFlags; 361 int configFlags;
363 362
364 mainLayout = new QHBoxLayout(this, 0, KDialog::spacingHint() ); 363 mainLayout = new QHBoxLayout(this, 0, KDialog::spacingHint() );
365 364
366 // checkboxes 365 // checkboxes
367 cbLayout = new QVBoxLayout( mainLayout ); 366 cbLayout = new QVBoxLayout( mainLayout );
368 configFlags = view->config(); 367 configFlags = view->config();
369 368
370 opt[0] = new QCheckBox(i18n("&Word wrap"), this); 369 opt[0] = new QCheckBox(i18n("&Word wrap"), this);
371 cbLayout->addWidget(opt[0], 0, AlignLeft); 370 cbLayout->addWidget(opt[0], 0, AlignLeft);
372 opt[0]->setChecked(view->doc()->wordWrap()); 371 opt[0]->setChecked(view->doc()->wordWrap());
373 372
374 opt[1] = new QCheckBox(i18n("Replace &tabs with spaces"), this); 373 opt[1] = new QCheckBox(i18n("Replace &tabs with spaces"), this);
375 cbLayout->addWidget(opt[1], 0, AlignLeft); 374 cbLayout->addWidget(opt[1], 0, AlignLeft);
376 opt[1]->setChecked(configFlags & flags[1]); 375 opt[1]->setChecked(configFlags & flags[1]);
377 376
378 opt[2] = new QCheckBox(i18n("&Remove trailing spaces"), this); 377 opt[2] = new QCheckBox(i18n("&Remove trailing spaces"), this);
379 cbLayout->addWidget(opt[2], 0, AlignLeft); 378 cbLayout->addWidget(opt[2], 0, AlignLeft);
380 opt[2]->setChecked(configFlags & flags[2]); 379 opt[2]->setChecked(configFlags & flags[2]);
381 380
382 opt[3] = new QCheckBox(i18n("&Auto brackets"), this); 381 opt[3] = new QCheckBox(i18n("&Auto brackets"), this);
383 cbLayout->addWidget(opt[3], 0, AlignLeft); 382 cbLayout->addWidget(opt[3], 0, AlignLeft);
384 opt[3]->setChecked(configFlags & flags[3]); 383 opt[3]->setChecked(configFlags & flags[3]);
385 384
386 opt[4] = new QCheckBox(i18n("Group &undos"), this); 385 opt[4] = new QCheckBox(i18n("Group &undos"), this);
387 cbLayout->addWidget(opt[4], 0, AlignLeft); 386 cbLayout->addWidget(opt[4], 0, AlignLeft);
388 opt[4]->setChecked(configFlags & flags[4]); 387 opt[4]->setChecked(configFlags & flags[4]);
389 388
390 opt[5] = new QCheckBox(i18n("&Show tabs"), this); 389 opt[5] = new QCheckBox(i18n("&Show tabs"), this);
391 cbLayout->addWidget(opt[5], 0, AlignLeft); 390 cbLayout->addWidget(opt[5], 0, AlignLeft);
392 opt[5]->setChecked(configFlags & flags[5]); 391 opt[5]->setChecked(configFlags & flags[5]);
393 392
394 opt[6] = new QCheckBox(i18n("Smart &home"), this); 393 opt[6] = new QCheckBox(i18n("Smart &home"), this);
395 cbLayout->addWidget(opt[6], 0, AlignLeft); 394 cbLayout->addWidget(opt[6], 0, AlignLeft);
396 opt[6]->setChecked(configFlags & flags[6]); 395 opt[6]->setChecked(configFlags & flags[6]);
397 396
398 opt[7] = new QCheckBox(i18n("&Page up/down moves cursor"), this); 397 opt[7] = new QCheckBox(i18n("&Page up/down moves cursor"), this);
399 cbLayout->addWidget(opt[7], 0, AlignLeft); 398 cbLayout->addWidget(opt[7], 0, AlignLeft);
400 opt[7]->setChecked(configFlags & flags[7]); 399 opt[7]->setChecked(configFlags & flags[7]);
401 400
402 opt[8] = new QCheckBox(i18n("Wrap &cursor"), this); 401 opt[8] = new QCheckBox(i18n("Wrap &cursor"), this);
403 cbLayout->addWidget(opt[8], 0, AlignLeft); 402 cbLayout->addWidget(opt[8], 0, AlignLeft);
404 opt[8]->setChecked(configFlags & flags[8]); 403 opt[8]->setChecked(configFlags & flags[8]);
405 404
406 cbLayout->addStretch(); 405 cbLayout->addStretch();
407 406
408 // edit lines 407 // edit lines
409 leLayout = new QVBoxLayout(); 408 leLayout = new QVBoxLayout();
410 mainLayout->addLayout(leLayout,10); 409 mainLayout->addLayout(leLayout,10);
411 410
412 e1 = new QSpinBox(this); 411 e1 = new QSpinBox(this);
413 e1->setMinValue(20); 412 e1->setMinValue(20);
414 e1->setMaxValue( 200); 413 e1->setMaxValue( 200);
415 e1->setValue((int)(view->doc()->wordWrapAt())); 414 e1->setValue((int)(view->doc()->wordWrapAt()));
416#warning fixme e1->setLabel(i18n("Wrap Words At:")); 415#warning fixme e1->setLabel(i18n("Wrap Words At:"));
417 416
418 e2 = new QSpinBox(this); 417 e2 = new QSpinBox(this);
419 e2->setMinValue(1); 418 e2->setMinValue(1);
420 e2->setMaxValue(16); 419 e2->setMaxValue(16);
421 e2->setValue((int)view->tabWidth()); 420 e2->setValue((int)view->tabWidth());
422 421
423#warning fixme e2->setLabel(i18n("Tab/Indent Width:")); 422#warning fixme e2->setLabel(i18n("Tab/Indent Width:"));
424 423
425 e3 = new QSpinBox(this); 424 e3 = new QSpinBox(this);
426 e3->setMinValue(5); 425 e3->setMinValue(5);
427 e3->setMaxValue( 30000); 426 e3->setMaxValue( 30000);
428#warning fixme e3->setLabel(i18n("Undo steps:")); 427#warning fixme e3->setLabel(i18n("Undo steps:"));
429 e3->setValue((int)view->undoSteps()); 428 e3->setValue((int)view->undoSteps());
430 429
431 leLayout->addWidget(e1, 0, AlignLeft); 430 leLayout->addWidget(e1, 0, AlignLeft);
432 leLayout->addWidget(e2, 0, AlignLeft); 431 leLayout->addWidget(e2, 0, AlignLeft);
433 leLayout->addWidget(e3, 0, AlignLeft); 432 leLayout->addWidget(e3, 0, AlignLeft);
434 433
435 434
436 QVBox *box = new QVBox (this); 435 QVBox *box = new QVBox (this);
437 leLayout->addWidget (box, 0, AlignLeft); 436 leLayout->addWidget (box, 0, AlignLeft);
438 437
439 new QLabel (i18n("Encoding:"), box); 438 new QLabel (i18n("Encoding:"), box);
440 439
441 encoding = new QComboBox(box); 440 encoding = new QComboBox(box);
442#warning fixme 441#warning fixme
443#if 0 442#if 0
444 encoding->insertStringList (KGlobal::charsets()->availableEncodingNames()); 443 encoding->insertStringList (KGlobal::charsets()->availableEncodingNames());
445 encoding->setCurrentItem (KGlobal::charsets()->availableEncodingNames().findIndex(view->doc()->encoding())); 444 encoding->setCurrentItem (KGlobal::charsets()->availableEncodingNames().findIndex(view->doc()->encoding()));
446#endif 445#endif
447 leLayout->addStretch(); 446 leLayout->addStretch();
448 447
449 // What is this? help 448 // What is this? help
450 QWhatsThis::add(opt[0], i18n("Word wrap is a feature that causes the editor to automatically start a new line of text and move (wrap) the cursor to the beginning of that new line. KateView will automatically start a new line of text when the current line reaches the length specified by the Wrap Words At: option.<p><b>NOTE:<b> Word Wrap will not change existing lines or wrap them for easy reading as in some applications.")); 449 QWhatsThis::add(opt[0], i18n("Word wrap is a feature that causes the editor to automatically start a new line of text and move (wrap) the cursor to the beginning of that new line. KateView will automatically start a new line of text when the current line reaches the length specified by the Wrap Words At: option.<p><b>NOTE:<b> Word Wrap will not change existing lines or wrap them for easy reading as in some applications."));
451 QWhatsThis::add(e1, i18n("If the Word Wrap option is selected this entry determines the length (in characters) at which the editor will automatically start a new line.")); 450 QWhatsThis::add(e1, i18n("If the Word Wrap option is selected this entry determines the length (in characters) at which the editor will automatically start a new line."));
452 QWhatsThis::add(opt[1], i18n("KateView will replace any tabs with the number of spaces indicated in the Tab Width: entry.")); 451 QWhatsThis::add(opt[1], i18n("KateView will replace any tabs with the number of spaces indicated in the Tab Width: entry."));
453 QWhatsThis::add(e2, i18n("If the Replace Tabs By Spaces option is selected this entry determines the number of spaces with which the editor will automatically replace tabs.")); 452 QWhatsThis::add(e2, i18n("If the Replace Tabs By Spaces option is selected this entry determines the number of spaces with which the editor will automatically replace tabs."));
454 QWhatsThis::add(opt[2], i18n("KateView will automatically eliminate extra spaces at the ends of lines of text.")); 453 QWhatsThis::add(opt[2], i18n("KateView will automatically eliminate extra spaces at the ends of lines of text."));
455 QWhatsThis::add(opt[3], i18n("When the user types a left bracket ([,(, or {) KateView automatically enters the right bracket (}, ), or ]) to the right of the cursor.")); 454 QWhatsThis::add(opt[3], i18n("When the user types a left bracket ([,(, or {) KateView automatically enters the right bracket (}, ), or ]) to the right of the cursor."));
456 QWhatsThis::add(opt[4], i18n("Checking this will cause sequences of similar actions to be undone at once.")); 455 QWhatsThis::add(opt[4], i18n("Checking this will cause sequences of similar actions to be undone at once."));
457 QWhatsThis::add(opt[5], i18n("The editor will display a symbol to indicate the presence of a tab in the text.")); 456 QWhatsThis::add(opt[5], i18n("The editor will display a symbol to indicate the presence of a tab in the text."));
458 QWhatsThis::add(opt[6], i18n("Not yet implemented.")); 457 QWhatsThis::add(opt[6], i18n("Not yet implemented."));
459 QWhatsThis::add(opt[7], i18n("If this is selected, the insertion cursor will be moved to the first/last line when pressing the page up/down buttons.<p>If not selected, it will remain at it's relative position in the visible text.")); 458 QWhatsThis::add(opt[7], i18n("If this is selected, the insertion cursor will be moved to the first/last line when pressing the page up/down buttons.<p>If not selected, it will remain at it's relative position in the visible text."));
460 QWhatsThis::add(e3, i18n("Sets the number of undo/redo steps to record. More steps uses more memory.")); 459 QWhatsThis::add(e3, i18n("Sets the number of undo/redo steps to record. More steps uses more memory."));
461 QWhatsThis::add(opt[8], i18n("When on, moving the insertion cursor using the <b>Left</b> and <b>Right</b> keys will go on to previous/next line at beginning/end of the line, similar to most editors.<p>When off, the insertion cursor cannot be moved left of the line start, but it can be moved off the line end, which can be very handy for programmers.")); 460 QWhatsThis::add(opt[8], i18n("When on, moving the insertion cursor using the <b>Left</b> and <b>Right</b> keys will go on to previous/next line at beginning/end of the line, similar to most editors.<p>When off, the insertion cursor cannot be moved left of the line start, but it can be moved off the line end, which can be very handy for programmers."));
462} 461}
463 462
464void EditConfigTab::getData(KateView *view) 463void EditConfigTab::getData(KateView *view)
465{ 464{
466 int configFlags, z; 465 int configFlags, z;
467 466
468 configFlags = view->config(); 467 configFlags = view->config();
469 for (z = 1; z < numFlags; z++) { 468 for (z = 1; z < numFlags; z++) {
470 configFlags &= ~flags[z]; 469 configFlags &= ~flags[z];
471 if (opt[z]->isChecked()) configFlags |= flags[z]; 470 if (opt[z]->isChecked()) configFlags |= flags[z];
472 } 471 }
473 view->setConfig(configFlags); 472 view->setConfig(configFlags);
474 473
475 view->setEncoding (encoding->currentText()); 474 view->setEncoding (encoding->currentText());
476 view->doc()->setWordWrapAt(e1->value()); 475 view->doc()->setWordWrapAt(e1->value());
477 view->doc()->setWordWrap (opt[0]->isChecked()); 476 view->doc()->setWordWrap (opt[0]->isChecked());
478 view->setTabWidth(e2->value()); 477 view->setTabWidth(e2->value());
479 view->setUndoSteps(e3->value()); 478 view->setUndoSteps(e3->value());
480} 479}
481 480
482ColorConfig::ColorConfig( QWidget *parent, char *name ) 481ColorConfig::ColorConfig( QWidget *parent, char *name )
483 : QWidget( parent, name ) 482 : QWidget( parent, name )
484{ 483{
485 QGridLayout *glay = new QGridLayout( this, 6, 2, 0, KDialog::spacingHint()); 484 QGridLayout *glay = new QGridLayout( this, 6, 2, 0, KDialog::spacingHint());
486 glay->setColStretch(1,1); 485 glay->setColStretch(1,1);
487 glay->setRowStretch(5,1); 486 glay->setRowStretch(5,1);
488 487
489 QLabel *label; 488 QLabel *label;
490 489
491 label = new QLabel( i18n("Background:"), this); 490 label = new QLabel( i18n("Background:"), this);
492 label->setAlignment( AlignRight|AlignVCenter ); 491 label->setAlignment( AlignRight|AlignVCenter );
493 m_back = new KColorButton( this ); 492 m_back = new KColorButton( this );
494 glay->addWidget( label, 0, 0 ); 493 glay->addWidget( label, 0, 0 );
495 glay->addWidget( m_back, 0, 1 ); 494 glay->addWidget( m_back, 0, 1 );
496 495
497 label = new QLabel( i18n("Selected:"), this); 496 label = new QLabel( i18n("Selected:"), this);
498 label->setAlignment( AlignRight|AlignVCenter ); 497 label->setAlignment( AlignRight|AlignVCenter );
499 m_selected = new KColorButton( this ); 498 m_selected = new KColorButton( this );
500 glay->addWidget( label, 2, 0 ); 499 glay->addWidget( label, 2, 0 );
501 glay->addWidget( m_selected, 2, 1 ); 500 glay->addWidget( m_selected, 2, 1 );
502 501
503 // QWhatsThis help 502 // QWhatsThis help
504 QWhatsThis::add(m_back, i18n("Sets the background color of the editing area")); 503 QWhatsThis::add(m_back, i18n("Sets the background color of the editing area"));
505 QWhatsThis::add(m_selected, i18n("Sets the background color of the selection. To set the text color for selected text, use the &quot;<b>Configure Highlighting</b>&quot; dialog.")); 504 QWhatsThis::add(m_selected, i18n("Sets the background color of the selection. To set the text color for selected text, use the &quot;<b>Configure Highlighting</b>&quot; dialog."));
506} 505}
507 506
508 507
509ColorConfig::~ColorConfig() 508ColorConfig::~ColorConfig()
510{ 509{
511} 510}
512 511
513void ColorConfig::setColors(QColor *colors) 512void ColorConfig::setColors(QColor *colors)
514{ 513{
515 m_back->setColor( colors[0] ); 514 m_back->setColor( colors[0] );
516 m_selected->setColor( colors[1] ); 515 m_selected->setColor( colors[1] );
517} 516}
518 517
519void ColorConfig::getColors(QColor *colors) 518void ColorConfig::getColors(QColor *colors)
520{ 519{
521 colors[0] = m_back->color(); 520 colors[0] = m_back->color();
522 colors[1] = m_selected->color(); 521 colors[1] = m_selected->color();
523} 522}
524 523
525FontConfig::FontConfig( QWidget *parent, char *name ) 524FontConfig::FontConfig( QWidget *parent, char *name )
526 : QWidget( parent, name ) 525 : QWidget( parent, name )
527{ 526{
528 // sizemanagment 527 // sizemanagment
529 QGridLayout *grid = new QGridLayout( this, 1, 1 ); 528 QGridLayout *grid = new QGridLayout( this, 1, 1 );
530// QString familyStr = cfg. readEntry ( "FontFamily", "Helvetica" ); 529// QString familyStr = cfg. readEntry ( "FontFamily", "Helvetica" );
531// QString styleStr = cfg. readEntry ( "FontStyle", "Regular" ); 530// QString styleStr = cfg. readEntry ( "FontStyle", "Regular" );
532// int size = cfg. readNumEntry ( "FontSize", 10 ); 531// int size = cfg. readNumEntry ( "FontSize", 10 );
533// OFontSelector *m_fontselect; 532// OFontSelector *m_fontselect;
534 533
535 m_fontselect = new Opie::OFontSelector ( false, this, "FontTab" ); 534 m_fontselect = new OFontSelector ( false, this, "FontTab" );
536// m_fontselect-> setSelectedFont ( familyStr, styleStr, size ); 535// m_fontselect-> setSelectedFont ( familyStr, styleStr, size );
537// QWhatsThis::add( m_fontselect, 536// QWhatsThis::add( m_fontselect,
538// tr( "Select the desired name, style and size of the default font applications will use." ) ); 537// tr( "Select the desired name, style and size of the default font applications will use." ) );
539 538
540 connect( m_fontselect, SIGNAL( fontSelected(const QFont&)), 539 connect( m_fontselect, SIGNAL( fontSelected(const QFont&)),
541 this, SLOT( slotFontSelected(const QFont&))); 540 this, SLOT( slotFontSelected(const QFont&)));
542 grid->addWidget( m_fontselect, 0, 0); 541 grid->addWidget( m_fontselect, 0, 0);
543 542
544 543
545// #if 0 544// #if 0
546// m_fontchooser = new KFontChooser ( this ); 545// m_fontchooser = new KFontChooser ( this );
547// m_fontchooser->enableColumn(KFontChooser::StyleList, false); 546// m_fontchooser->enableColumn(KFontChooser::StyleList, false);
548// grid->addWidget( m_fontchooser, 0, 0); 547// grid->addWidget( m_fontchooser, 0, 0);
549 548
550// connect (m_fontchooser, SIGNAL (fontSelected(const QFont&)), this, SLOT (slotFontSelected(const QFont&))); 549// connect (m_fontchooser, SIGNAL (fontSelected(const QFont&)), this, SLOT (slotFontSelected(const QFont&)));
551// #endif 550// #endif
552} 551}
553 552
554FontConfig::~FontConfig() 553FontConfig::~FontConfig()
555{ 554{
556} 555}
557 556
558void FontConfig::setFont ( const QFont &font ) 557void FontConfig::setFont ( const QFont &font )
559{ 558{
560//#if 0 559//#if 0
561m_fontselect->setFont (font); 560m_fontselect->setFont (font);
562 myFont = font; 561 myFont = font;
563//#endif 562//#endif
564} 563}
565 564
566void FontConfig::slotFontSelected( const QFont &font ) 565void FontConfig::slotFontSelected( const QFont &font )
567{ 566{
568 myFont = font; 567 myFont = font;
569} 568}
570 569
571 570
572 571
573 572
diff --git a/noncore/apps/tinykate/libkate/view/kateviewdialog.h b/noncore/apps/tinykate/libkate/view/kateviewdialog.h
index d081152..65f2dca 100644
--- a/noncore/apps/tinykate/libkate/view/kateviewdialog.h
+++ b/noncore/apps/tinykate/libkate/view/kateviewdialog.h
@@ -1,196 +1,196 @@
1/*************************************************************************** 1/***************************************************************************
2 kateviewdialog.h - description 2 kateviewdialog.h - description
3 ------------------- 3 -------------------
4 copyright : (C) 2001 by The Kate Team 4 copyright : (C) 2001 by The Kate Team
5 (C) 2002 by Joseph Wenninger 5 (C) 2002 by Joseph Wenninger
6 email : kwrite-devel@kde.org 6 email : kwrite-devel@kde.org
7 jowenn@kde.org 7 jowenn@kde.org
8 8
9 ***************************************************************************/ 9 ***************************************************************************/
10 10
11/*************************************************************************** 11/***************************************************************************
12 * * 12 * *
13 * This program is free software; you can redistribute it and/or modify * 13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by * 14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or * 15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. * 16 * (at your option) any later version. *
17 * * 17 * *
18 ***************************************************************************/ 18 ***************************************************************************/
19// Dialogs 19// Dialogs
20 20
21#ifndef _KWDIALOG_H_ 21#ifndef _KWDIALOG_H_
22#define _KWDIALOG_H_ 22#define _KWDIALOG_H_
23 23
24 24
25class QCheckBox; 25class QCheckBox;
26class QLineEdit; 26class QLineEdit;
27class QPushButton; 27class QPushButton;
28class QRadioButton; 28class QRadioButton;
29class QSpinBox; 29class QSpinBox;
30class KColorButton; 30class KColorButton;
31class QComboBox; 31class QComboBox;
32 32
33#include <kdialogbase.h> 33#include <kdialogbase.h>
34#include <opie2/ofontselector.h> 34#include <opie2/ofontselector.h>
35#include "kateview.h" 35#include "kateview.h"
36 36
37class SearchDialog : public KDialogBase 37class SearchDialog : public KDialogBase
38{ 38{
39 Q_OBJECT 39 Q_OBJECT
40 40
41 public: 41 public:
42 SearchDialog( QWidget *parent, QStringList &searchFor, QStringList &replaceWith, int flags ); 42 SearchDialog( QWidget *parent, QStringList &searchFor, QStringList &replaceWith, int flags );
43 QString getSearchFor(); 43 QString getSearchFor();
44 QString getReplaceWith(); 44 QString getReplaceWith();
45 int getFlags(); 45 int getFlags();
46 void setSearchText( const QString &searchstr ); 46 void setSearchText( const QString &searchstr );
47 47
48 protected slots: 48 protected slots:
49 void slotOk(); 49 void slotOk();
50 50
51 protected: 51 protected:
52 QComboBox *m_search; 52 QComboBox *m_search;
53 QComboBox *m_replace; 53 QComboBox *m_replace;
54 QCheckBox *m_opt1; 54 QCheckBox *m_opt1;
55 QCheckBox *m_opt2; 55 QCheckBox *m_opt2;
56 QCheckBox *m_opt3; 56 QCheckBox *m_opt3;
57 QCheckBox *m_optRegExp; 57 QCheckBox *m_optRegExp;
58 QCheckBox *m_opt4; 58 QCheckBox *m_opt4;
59 QCheckBox *m_opt5; 59 QCheckBox *m_opt5;
60 QCheckBox *m_opt6; 60 QCheckBox *m_opt6;
61}; 61};
62 62
63class ReplacePrompt : public KDialogBase 63class ReplacePrompt : public KDialogBase
64{ 64{
65 Q_OBJECT 65 Q_OBJECT
66 66
67 public: 67 public:
68 68
69 ReplacePrompt(QWidget *parent); 69 ReplacePrompt(QWidget *parent);
70 70
71 signals: 71 signals:
72 72
73 void clicked(); 73 void clicked();
74 74
75 protected slots: 75 protected slots:
76 76
77 void slotUser1( void ); // All 77 void slotUser1( void ); // All
78 void slotUser2( void ); // No 78 void slotUser2( void ); // No
79 void slotUser3( void ); // Yes 79 void slotUser3( void ); // Yes
80 virtual void done(int); 80 virtual void done(int);
81 81
82 protected: 82 protected:
83 83
84 void closeEvent(QCloseEvent *); 84 void closeEvent(QCloseEvent *);
85}; 85};
86 86
87class GotoLineDialog : public KDialogBase 87class GotoLineDialog : public KDialogBase
88{ 88{
89 Q_OBJECT 89 Q_OBJECT
90 90
91 public: 91 public:
92 92
93 GotoLineDialog(QWidget *parent, int line, int max); 93 GotoLineDialog(QWidget *parent, int line, int max);
94 int getLine(); 94 int getLine();
95 95
96 protected: 96 protected:
97 97
98 QSpinBox *e1; 98 QSpinBox *e1;
99 QPushButton *btnOK; 99 QPushButton *btnOK;
100}; 100};
101 101
102class IndentConfigTab : public QWidget 102class IndentConfigTab : public QWidget
103{ 103{
104 Q_OBJECT 104 Q_OBJECT
105 105
106 public: 106 public:
107 107
108 IndentConfigTab(QWidget *parent, KateView *); 108 IndentConfigTab(QWidget *parent, KateView *);
109 void getData(KateView *); 109 void getData(KateView *);
110 110
111 protected: 111 protected:
112 112
113 static const int numFlags = 6; 113 static const int numFlags = 6;
114 static const int flags[numFlags]; 114 static const int flags[numFlags];
115 QCheckBox *opt[numFlags]; 115 QCheckBox *opt[numFlags];
116}; 116};
117 117
118class SelectConfigTab : public QWidget 118class SelectConfigTab : public QWidget
119{ 119{
120 Q_OBJECT 120 Q_OBJECT
121 121
122 public: 122 public:
123 123
124 SelectConfigTab(QWidget *parent, KateView *); 124 SelectConfigTab(QWidget *parent, KateView *);
125 void getData(KateView *); 125 void getData(KateView *);
126 126
127 protected: 127 protected:
128 128
129 static const int numFlags = 6; 129 static const int numFlags = 6;
130 static const int flags[numFlags]; 130 static const int flags[numFlags];
131 QCheckBox *opt[numFlags]; 131 QCheckBox *opt[numFlags];
132}; 132};
133 133
134class EditConfigTab : public QWidget 134class EditConfigTab : public QWidget
135{ 135{
136 Q_OBJECT 136 Q_OBJECT
137 137
138 public: 138 public:
139 139
140 EditConfigTab(QWidget *parent, KateView *); 140 EditConfigTab(QWidget *parent, KateView *);
141 void getData(KateView *); 141 void getData(KateView *);
142 142
143 protected: 143 protected:
144 144
145 static const int numFlags = 9; 145 static const int numFlags = 9;
146 static const int flags[numFlags]; 146 static const int flags[numFlags];
147 QCheckBox *opt[numFlags]; 147 QCheckBox *opt[numFlags];
148 QComboBox *encoding; 148 QComboBox *encoding;
149 149
150 150
151 QSpinBox *e1; 151 QSpinBox *e1;
152 QSpinBox *e2; 152 QSpinBox *e2;
153 QSpinBox *e3; 153 QSpinBox *e3;
154}; 154};
155 155
156class ColorConfig : public QWidget 156class ColorConfig : public QWidget
157{ 157{
158 Q_OBJECT 158 Q_OBJECT
159 159
160public: 160public:
161 161
162 ColorConfig( QWidget *parent = 0, char *name = 0 ); 162 ColorConfig( QWidget *parent = 0, char *name = 0 );
163 ~ColorConfig(); 163 ~ColorConfig();
164 164
165 void setColors( QColor * ); 165 void setColors( QColor * );
166 void getColors( QColor * ); 166 void getColors( QColor * );
167 167
168private: 168private:
169 169
170 KColorButton *m_back; 170 KColorButton *m_back;
171 KColorButton *m_selected; 171 KColorButton *m_selected;
172}; 172};
173 173
174class FontConfig : public QWidget 174class FontConfig : public QWidget
175{ 175{
176 Q_OBJECT 176 Q_OBJECT
177 177
178public: 178public:
179 179
180 FontConfig( QWidget *parent = 0, char *name = 0 ); 180 FontConfig( QWidget *parent = 0, char *name = 0 );
181 ~FontConfig(); 181 ~FontConfig();
182 182
183 void setFont ( const QFont &font ); 183 void setFont ( const QFont &font );
184 QFont getFont ( ) { return myFont; }; 184 QFont getFont ( ) { return myFont; };
185 185
186 private: 186 private:
187 Opie::Opie::Ui::OFontSelector *m_fontselect; 187 Opie::Ui::OFontSelector *m_fontselect;
188// class KFontChooser *m_fontchooser; 188// class KFontChooser *m_fontchooser;
189 QFont myFont; 189 QFont myFont;
190 190
191 private slots: 191 private slots:
192 void slotFontSelected( const QFont &font ); 192 void slotFontSelected( const QFont &font );
193}; 193};
194 194
195 195
196#endif //_KWDIALOG_H_ 196#endif //_KWDIALOG_H_