author | kergoth <kergoth> | 2003-08-09 16:12:19 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 16:12:19 (UTC) |
commit | 1c58d1407f9584fedcdae390a04e2b37e5853361 (patch) (unidiff) | |
tree | 3c6e741c4d382d1a53c182930052b684d6e35b91 /noncore/apps/tinykate | |
parent | e3f4607edd0c1ca1434adb446df1d4a1d27c6a86 (diff) | |
download | opie-1c58d1407f9584fedcdae390a04e2b37e5853361.zip opie-1c58d1407f9584fedcdae390a04e2b37e5853361.tar.gz opie-1c58d1407f9584fedcdae390a04e2b37e5853361.tar.bz2 |
Merge from BRANCH_1_0
18 files changed, 90 insertions, 140 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katebuffer.cpp b/noncore/apps/tinykate/libkate/document/katebuffer.cpp index 38ba55d..22a4917 100644 --- a/noncore/apps/tinykate/libkate/document/katebuffer.cpp +++ b/noncore/apps/tinykate/libkate/document/katebuffer.cpp | |||
@@ -118,13 +118,13 @@ KWBuffer::slotLoadFile() | |||
118 | /** | 118 | /** |
119 | * Return the total number of lines in the buffer. | 119 | * Return the total number of lines in the buffer. |
120 | */ | 120 | */ |
121 | int | 121 | int |
122 | KWBuffer::count() | 122 | KWBuffer::count() |
123 | { | 123 | { |
124 | // qDebug("m_stringList.count %d",m_stringList.count()); | 124 | qDebug("m_stringList.count %d",m_stringList.count()); |
125 | return m_lineCount; | 125 | return m_lineCount; |
126 | //return m_stringList.count(); | 126 | //return m_stringList.count(); |
127 | // return m_totalLines; | 127 | // return m_totalLines; |
128 | } | 128 | } |
129 | 129 | ||
130 | 130 | ||
diff --git a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp index 844f27d..f90a5f8 100644 --- a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp +++ b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp | |||
@@ -68,13 +68,13 @@ void SyntaxDocument::setupModeList(bool force) | |||
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 = *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)); |
@@ -102,12 +102,13 @@ void SyntaxDocument::setupModeList(bool force) | |||
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->sync(); | 109 | // config->sync(); |
109 | } | 110 | } |
110 | 111 | ||
111 | SyntaxModeList SyntaxDocument::modeList() | 112 | SyntaxModeList SyntaxDocument::modeList() |
112 | { | 113 | { |
113 | return myModeList; | 114 | return myModeList; |
diff --git a/noncore/apps/tinykate/libkate/libkate.pro b/noncore/apps/tinykate/libkate/libkate.pro index 5cb0b14..b282059 100644 --- a/noncore/apps/tinykate/libkate/libkate.pro +++ b/noncore/apps/tinykate/libkate/libkate.pro | |||
@@ -22,12 +22,14 @@ HEADERS = microkde/kapplication.h \ | |||
22 | microkde/krun.h \ | 22 | microkde/krun.h \ |
23 | microkde/knumvalidator.h \ | 23 | microkde/knumvalidator.h \ |
24 | microkde/kstaticdeleter.h \ | 24 | microkde/kstaticdeleter.h \ |
25 | microkde/klistview.h \ | 25 | microkde/klistview.h \ |
26 | microkde/kglobalsettings.h \ | 26 | microkde/kglobalsettings.h \ |
27 | microkde/kcolorbtn.h \ | 27 | microkde/kcolorbtn.h \ |
28 | \ | ||
29 | \ | ||
28 | qt3back/qregexp3.h \ | 30 | qt3back/qregexp3.h \ |
29 | microkde/ksharedptr.h \ | 31 | microkde/ksharedptr.h \ |
30 | document/katebuffer.h document/katedialogs.h \ | 32 | document/katebuffer.h document/katedialogs.h \ |
31 | document/katetextline.h \ | 33 | document/katetextline.h \ |
32 | document/katecmd.h \ | 34 | document/katecmd.h \ |
33 | document/katehighlight.h \ | 35 | document/katehighlight.h \ |
@@ -46,18 +48,21 @@ SOURCES = microkde/kapplication.cpp \ | |||
46 | microkde/klocale.cpp \ | 48 | microkde/klocale.cpp \ |
47 | microkde/kmessagebox.cpp \ | 49 | microkde/kmessagebox.cpp \ |
48 | microkde/kprocess.cpp \ | 50 | microkde/kprocess.cpp \ |
49 | microkde/kstandarddirs.cpp \ | 51 | microkde/kstandarddirs.cpp \ |
50 | microkde/ktempfile.cpp \ | 52 | microkde/ktempfile.cpp \ |
51 | microkde/kurlrequester.cpp \ | 53 | microkde/kurlrequester.cpp \ |
54 | microkde/kcolordialog.cpp \ | ||
52 | microkde/kfontdialog.cpp \ | 55 | microkde/kfontdialog.cpp \ |
53 | microkde/krun.cpp \ | 56 | microkde/krun.cpp \ |
54 | microkde/knumvalidator.cpp \ | 57 | microkde/knumvalidator.cpp \ |
55 | microkde/kglobal.cpp \ | 58 | microkde/kglobal.cpp \ |
56 | microkde/kglobalsettings.cpp \ | 59 | microkde/kglobalsettings.cpp \ |
57 | microkde/kcolorbtn.cpp \ | 60 | microkde/kcolorbtn.cpp \ |
61 | \ | ||
62 | \ | ||
58 | qt3back/qregexp3.cpp \ | 63 | qt3back/qregexp3.cpp \ |
59 | ktexteditor/ktexteditor.cpp \ | 64 | ktexteditor/ktexteditor.cpp \ |
60 | document/katebuffer.cpp document/katedialogs.cpp \ | 65 | document/katebuffer.cpp document/katedialogs.cpp \ |
61 | document/katehighlight.cpp \ | 66 | document/katehighlight.cpp \ |
62 | document/katecmd.cpp \ | 67 | document/katecmd.cpp \ |
63 | document/katesyntaxdocument.cpp document/katecmds.cpp \ | 68 | document/katesyntaxdocument.cpp document/katecmds.cpp \ |
diff --git a/noncore/apps/tinykate/libkate/microkde/kcolorbtn.cpp b/noncore/apps/tinykate/libkate/microkde/kcolorbtn.cpp index 976f1db..5d21f15 100644 --- a/noncore/apps/tinykate/libkate/microkde/kcolorbtn.cpp +++ b/noncore/apps/tinykate/libkate/microkde/kcolorbtn.cpp | |||
@@ -20,17 +20,15 @@ | |||
20 | 20 | ||
21 | #include <qdialog.h> | 21 | #include <qdialog.h> |
22 | #include <qpainter.h> | 22 | #include <qpainter.h> |
23 | #include <qdrawutil.h> | 23 | #include <qdrawutil.h> |
24 | #include <qapplication.h> | 24 | #include <qapplication.h> |
25 | #include <kglobalsettings.h> | 25 | #include <kglobalsettings.h> |
26 | //#include "kcolordialog.h" | 26 | #include "kcolordialog.h" |
27 | #include "kcolorbtn.h" | 27 | #include "kcolorbtn.h" |
28 | 28 | ||
29 | #include <opie/colordialog.h> | ||
30 | |||
31 | KColorButton::KColorButton( QWidget *parent, const char *name ) | 29 | KColorButton::KColorButton( QWidget *parent, const char *name ) |
32 | : QPushButton( parent, name ), dragFlag(false) | 30 | : QPushButton( parent, name ), dragFlag(false) |
33 | { | 31 | { |
34 | // 2000-10-15 (putzer): fixes broken keyboard usage | 32 | // 2000-10-15 (putzer): fixes broken keyboard usage |
35 | connect (this, SIGNAL(clicked()), this, SLOT(chooseColor())); | 33 | connect (this, SIGNAL(clicked()), this, SLOT(chooseColor())); |
36 | } | 34 | } |
@@ -72,15 +70,15 @@ void KColorButton::drawButtonLabel( QPainter *painter ) | |||
72 | painter->fillRect( l+b, t+b, w-b*2, h-b*2, fillCol ); | 70 | painter->fillRect( l+b, t+b, w-b*2, h-b*2, fillCol ); |
73 | } | 71 | } |
74 | } | 72 | } |
75 | 73 | ||
76 | void KColorButton::chooseColor() | 74 | void KColorButton::chooseColor() |
77 | { | 75 | { |
78 | QColor newCol=OColorDialog::getColor( col); | 76 | if( KColorDialog::getColor( col) == QDialog::Rejected ) |
79 | if( newCol != QDialog::Rejected ) | ||
80 | { | 77 | { |
81 | col=newCol; | 78 | return; |
79 | } | ||
80 | |||
82 | repaint( false ); | 81 | repaint( false ); |
83 | emit changed( col ); | 82 | emit changed( col ); |
84 | } | 83 | } |
85 | } | ||
86 | 84 | ||
diff --git a/noncore/apps/tinykate/libkate/microkde/kcolordialog.h b/noncore/apps/tinykate/libkate/microkde/kcolordialog.h index 1d5c27e..0f831cd 100644 --- a/noncore/apps/tinykate/libkate/microkde/kcolordialog.h +++ b/noncore/apps/tinykate/libkate/microkde/kcolordialog.h | |||
@@ -1,15 +1,13 @@ | |||
1 | #ifndef MINIKDE_KCOLORDIALOG_H | 1 | #ifndef MINIKDE_KCOLORDIALOG_H |
2 | #define MINIKDE_KCOLORDIALOG_H | 2 | #define MINIKDE_KCOLORDIALOG_H |
3 | 3 | ||
4 | #include <qcolor.h> | 4 | #include <qcolor.h> |
5 | #include <opie/colordialog.h> | ||
6 | 5 | ||
7 | class KColorDialog : OColorDialog | 6 | class KColorDialog |
8 | { | 7 | { |
9 | Q_OBJECT | ||
10 | public: | 8 | public: |
11 | enum { Accepted }; | 9 | enum { Accepted }; |
12 | 10 | ||
13 | static int getColor( const QColor & ); | 11 | static int getColor( const QColor & ); |
14 | }; | 12 | }; |
15 | 13 | ||
diff --git a/noncore/apps/tinykate/libkate/view/kateview.cpp b/noncore/apps/tinykate/libkate/view/kateview.cpp index de81d0f..af3b30d 100644 --- a/noncore/apps/tinykate/libkate/view/kateview.cpp +++ b/noncore/apps/tinykate/libkate/view/kateview.cpp | |||
@@ -2193,19 +2193,21 @@ bool KateView::askReplaceEnd() { | |||
2193 | // ask for continue | 2193 | // ask for continue |
2194 | if (!(s.flags & KateView::sfBackward)) { | 2194 | if (!(s.flags & KateView::sfBackward)) { |
2195 | // forward search | 2195 | // forward search |
2196 | str = i18n("%1 replacement(s) made.\n" | 2196 | str = i18n("%1 replacement(s) made.\n" |
2197 | "End of document reached.\n" | 2197 | "End of document reached.\n" |
2198 | "Continue from the beginning?").arg(replaces); | 2198 | "Continue from the beginning?").arg(replaces); |
2199 | query = KMessageBox::questionYesNo(this, str, i18n("Continue"), i18n("Stop")); | 2199 | query = KMessageBox::questionYesNo(this, str, i18n("Replace"), |
2200 | i18n("Continue"), i18n("Stop")); | ||
2200 | } else { | 2201 | } else { |
2201 | // backward search | 2202 | // backward search |
2202 | str = i18n("%1 replacement(s) made.\n" | 2203 | str = i18n("%1 replacement(s) made.\n" |
2203 | "Beginning of document reached.\n" | 2204 | "Beginning of document reached.\n" |
2204 | "Continue from the end?").arg(replaces); | 2205 | "Continue from the end?").arg(replaces); |
2205 | query = KMessageBox::questionYesNo(this, str, i18n("Continue"), i18n("Stop")); | 2206 | query = KMessageBox::questionYesNo(this, str, i18n("Replace"), |
2207 | i18n("Continue"), i18n("Stop")); | ||
2206 | } | 2208 | } |
2207 | replaces = 0; | 2209 | replaces = 0; |
2208 | continueSearch(s); | 2210 | continueSearch(s); |
2209 | return (query == KMessageBox::No); | 2211 | return (query == KMessageBox::No); |
2210 | } | 2212 | } |
2211 | 2213 | ||
@@ -2263,13 +2265,12 @@ void KateView::writeSessionConfig(KateConfig *config) | |||
2263 | } | 2265 | } |
2264 | 2266 | ||
2265 | void KateView::configDialog() | 2267 | void KateView::configDialog() |
2266 | { | 2268 | { |
2267 | 2269 | ||
2268 | #warning fixme | 2270 | #warning fixme |
2269 | QScrollView *pScroll; | ||
2270 | 2271 | ||
2271 | #if 1 | 2272 | #if 1 |
2272 | KDialogBase *kd = new KDialogBase(KDialogBase::IconList, | 2273 | KDialogBase *kd = new KDialogBase(KDialogBase::IconList, |
2273 | i18n("Configure Editor"), | 2274 | i18n("Configure Editor"), |
2274 | KDialogBase::Ok | KDialogBase::Cancel | | 2275 | KDialogBase::Ok | KDialogBase::Cancel | |
2275 | KDialogBase::Help , | 2276 | KDialogBase::Help , |
@@ -2300,15 +2301,14 @@ void KateView::configDialog() | |||
2300 | 2301 | ||
2301 | SelectConfigTab *selectConfig = new SelectConfigTab(page, this); | 2302 | SelectConfigTab *selectConfig = new SelectConfigTab(page, this); |
2302 | 2303 | ||
2303 | // edit options | 2304 | // edit options |
2304 | page=kd->addPage(i18n("Edit")); | 2305 | page=kd->addPage(i18n("Edit")); |
2305 | (new QVBoxLayout(page))->setAutoAdd(true); | 2306 | (new QVBoxLayout(page))->setAutoAdd(true); |
2306 | pScroll=new QScrollView(page); | 2307 | |
2307 | EditConfigTab *editConfig = new EditConfigTab(page, this); | 2308 | EditConfigTab *editConfig = new EditConfigTab(page, this); |
2308 | pScroll->addChild(editConfig); | ||
2309 | 2309 | ||
2310 | 2310 | ||
2311 | 2311 | ||
2312 | HighlightDialogPage *hlPage; | 2312 | HighlightDialogPage *hlPage; |
2313 | HlManager *hlManager; | 2313 | HlManager *hlManager; |
2314 | HlDataList hlDataList; | 2314 | HlDataList hlDataList; |
@@ -2322,16 +2322,14 @@ void KateView::configDialog() | |||
2322 | hlDataList.setAutoDelete(true); | 2322 | hlDataList.setAutoDelete(true); |
2323 | //this gets the data from the KateConfig object | 2323 | //this gets the data from the KateConfig object |
2324 | hlManager->getHlDataList(hlDataList); | 2324 | hlManager->getHlDataList(hlDataList); |
2325 | 2325 | ||
2326 | page=kd->addPage(i18n("Highlighting")); | 2326 | page=kd->addPage(i18n("Highlighting")); |
2327 | (new QVBoxLayout(page))->setAutoAdd(true); | 2327 | (new QVBoxLayout(page))->setAutoAdd(true); |
2328 | pScroll=new QScrollView(page); | ||
2329 | hlPage = new HighlightDialogPage(hlManager, &defaultStyleList, &hlDataList, 0, pScroll->viewport()); | ||
2330 | pScroll->addChild(hlPage); | ||
2331 | 2328 | ||
2329 | hlPage = new HighlightDialogPage(hlManager, &defaultStyleList, &hlDataList, 0, page); | ||
2332 | kd->showMaximized(); | 2330 | kd->showMaximized(); |
2333 | if (kd->exec()) { | 2331 | if (kd->exec()) { |
2334 | // color options | 2332 | // color options |
2335 | colorConfig->getColors(colors); | 2333 | colorConfig->getColors(colors); |
2336 | myDoc->setFont (fontConfig->getFont()); | 2334 | myDoc->setFont (fontConfig->getFont()); |
2337 | 2335 | ||
diff --git a/noncore/apps/tinykate/main.cpp b/noncore/apps/tinykate/main.cpp index e92df69..e06668a 100644 --- a/noncore/apps/tinykate/main.cpp +++ b/noncore/apps/tinykate/main.cpp | |||
@@ -19,11 +19,10 @@ | |||
19 | 19 | ||
20 | 20 | ||
21 | int main( int argc, char ** argv ) | 21 | int main( int argc, char ** argv ) |
22 | { | 22 | { |
23 | QPEApplication a( argc, argv ); | 23 | QPEApplication a( argc, argv ); |
24 | 24 | ||
25 | TinyKate *m = new TinyKate(); | 25 | TinyKate m; |
26 | a.setMainWidget( m ); | 26 | a.showMainWidget(&m ); |
27 | m->showMaximized(); | ||
28 | return a.exec(); | 27 | return a.exec(); |
29 | } | 28 | } |
diff --git a/noncore/apps/tinykate/opie-tinykate-syntax-commondev.control b/noncore/apps/tinykate/opie-tinykate-syntax-commondev.control index 76704c1..dd5e24b 100644 --- a/noncore/apps/tinykate/opie-tinykate-syntax-commondev.control +++ b/noncore/apps/tinykate/opie-tinykate-syntax-commondev.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-tinykate-syntax-commondev | 1 | Package: opie-tinykate-syntax-commondev |
2 | Files: share/tinykate/syntax/c.xml share/tinykate/syntax/cpp.xml share/tinykate/syntax/gnuassembler.xml share/tinykate/syntax/kbasic.xml share/tinykate/syntax/pascal.xml share/tinykate/syntax/perl.xml share/tinykate/syntax/php.xml share/tinykate/syntax/python.xml share/tinykate/syntax/ruby.xml share/tinykate/syntax/sql.xml share/tinykate/syntax/tcl.xml share/tinykate/syntax/xml.xml share/tinykate/syntax/xmldebug.xml share/tinykate/syntax/java.xml | 2 | Files: share/tinykate/syntax/c.xml share/tinykate/syntax/cpp.xml share/tinykate/syntax/gnuassembler.xml share/tinykate/syntax/kbasic.xml share/tinykate/syntax/pascal.xml share/tinykate/syntax/perl.xml share/tinykate/syntax/php.xml share/tinykate/syntax/python.xml share/tinykate/syntax/ruby.xml share/tinykate/syntax/sql.xml share/tinykate/syntax/tcl.xml share/tinykate/syntax/xml.xml share/tinykate/syntax/xmldebug.xml share/tinykate/syntax/java.xml |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal, opie-tinykate | 7 | Depends: task-opie-minimal, opie-tinykate |
9 | Description: Syntax Highlighting Patterns for for common programming languages for TinyKate | 8 | Description: Syntax Highlighting Patterns for for common programming languages for TinyKate |
9 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/apps/tinykate/opie-tinykate-syntax-documentation.control b/noncore/apps/tinykate/opie-tinykate-syntax-documentation.control index 9f60156..c47acc0 100644 --- a/noncore/apps/tinykate/opie-tinykate-syntax-documentation.control +++ b/noncore/apps/tinykate/opie-tinykate-syntax-documentation.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-tinykate-syntax-documentation | 1 | Package: opie-tinykate-syntax-documentation |
2 | Files: share/tinykate/syntax/latex.xml share/tinykate/syntax/postscript.xml share/tinykate/syntax/sgml.xml | 2 | Files: share/tinykate/syntax/latex.xml share/tinykate/syntax/postscript.xml share/tinykate/syntax/sgml.xml |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal, opie-tinykate | 7 | Depends: task-opie-minimal, opie-tinykate |
9 | Description: Syntax Highlighting Patterns for document oriented languages for TinyKate | 8 | Description: Syntax Highlighting Patterns for document oriented languages for TinyKate |
9 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/apps/tinykate/opie-tinykate-syntax-misc.control b/noncore/apps/tinykate/opie-tinykate-syntax-misc.control index 4e0f529..0e80518 100644 --- a/noncore/apps/tinykate/opie-tinykate-syntax-misc.control +++ b/noncore/apps/tinykate/opie-tinykate-syntax-misc.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-tinykate-syntax-misc | 1 | Package: opie-tinykate-syntax-misc |
2 | Files: share/tinykate/syntax/idconsole.xml share/tinykate/syntax/matlab.xml share/tinykate/syntax/verilog.xml share/tinykate/syntax/vhdl.xml | 2 | Files: share/tinykate/syntax/idconsole.xml share/tinykate/syntax/matlab.xml share/tinykate/syntax/verilog.xml share/tinykate/syntax/vhdl.xml |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal, opie-tinykate | 7 | Depends: task-opie-minimal, opie-tinykate |
9 | Description: Syntax Highlighting Patterns for misc languages for TinyKate | 8 | Description: Syntax Highlighting Patterns for misc languages for TinyKate |
9 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/apps/tinykate/opie-tinykate-syntax-miscdev.control b/noncore/apps/tinykate/opie-tinykate-syntax-miscdev.control index 3c8f61a..3f7ea0d 100644 --- a/noncore/apps/tinykate/opie-tinykate-syntax-miscdev.control +++ b/noncore/apps/tinykate/opie-tinykate-syntax-miscdev.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-tinykate-syntax-miscdev | 1 | Package: opie-tinykate-syntax-miscdev |
2 | Files: share/tinykate/syntax/ada.xml share/tinykate/syntax/eiffel.xml share/tinykate/syntax/ferite.xml share/tinykate/syntax/fortran.xml share/tinykate/syntax/haskell.xml share/tinykate/syntax/literate-haskell.xml share/tinykate/syntax/objectivec.xml share/tinykate/syntax/sather.xml share/tinykate/syntax/scheme.xml | 2 | Files: share/tinykate/syntax/ada.xml share/tinykate/syntax/eiffel.xml share/tinykate/syntax/ferite.xml share/tinykate/syntax/fortran.xml share/tinykate/syntax/haskell.xml share/tinykate/syntax/literate-haskell.xml share/tinykate/syntax/objectivec.xml share/tinykate/syntax/sather.xml share/tinykate/syntax/scheme.xml |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal, opie-tinykate | 7 | Depends: task-opie-minimal, opie-tinykate |
9 | Description: Syntax Highlighting Patterns for for uncommon programming languages for TinyKate | 8 | Description: Syntax Highlighting Patterns for for uncommon programming languages for TinyKate |
9 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/apps/tinykate/opie-tinykate-syntax-unix.control b/noncore/apps/tinykate/opie-tinykate-syntax-unix.control index 36e88b5..ea4e026 100644 --- a/noncore/apps/tinykate/opie-tinykate-syntax-unix.control +++ b/noncore/apps/tinykate/opie-tinykate-syntax-unix.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-tinykate-syntax-unix | 1 | Package: opie-tinykate-syntax-unix |
2 | Files: share/tinykate/syntax/cs.xml share/tinykate/syntax/bash.xml share/tinykate/syntax/changelog.xml share/tinykate/syntax/desktop.xml share/tinykate/syntax/diff.xml share/tinykate/syntax/mab.xml share/tinykate/syntax/makefile.xml share/tinykate/syntax/rpmspec.xml share/tinykate/syntax/sml.xml share/tinykate/syntax/winehq.xml | 2 | Files: share/tinykate/syntax/cs.xml share/tinykate/syntax/bash.xml share/tinykate/syntax/changelog.xml share/tinykate/syntax/desktop.xml share/tinykate/syntax/diff.xml share/tinykate/syntax/mab.xml share/tinykate/syntax/makefile.xml share/tinykate/syntax/rpmspec.xml share/tinykate/syntax/sml.xml share/tinykate/syntax/winehq.xml |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal, opie-tinykate | 7 | Depends: task-opie-minimal, opie-tinykate |
9 | Description: Syntax Highlighting Patterns for UNIX/Linux specific files for TinyKate | 8 | Description: Syntax Highlighting Patterns for UNIX/Linux specific files for TinyKate |
9 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/apps/tinykate/opie-tinykate-syntax-web.control b/noncore/apps/tinykate/opie-tinykate-syntax-web.control index 46fe64a..8f9c71a 100644 --- a/noncore/apps/tinykate/opie-tinykate-syntax-web.control +++ b/noncore/apps/tinykate/opie-tinykate-syntax-web.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-tinykate-syntax-web | 1 | Package: opie-tinykate-syntax-web |
2 | Files: share/tinykate/syntax/css.xml share/tinykate/syntax/html.xml share/tinykate/syntax/javascript.xml | 2 | Files: share/tinykate/syntax/css.xml share/tinykate/syntax/html.xml share/tinykate/syntax/javascript.xml |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal, opie-tinykate | 7 | Depends: task-opie-minimal, opie-tinykate |
9 | Description: Syntax Highlighting Patterns for for common programming languages for TinyKate | 8 | Description: Syntax Highlighting Patterns for for common programming languages for TinyKate |
9 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/apps/tinykate/opie-tinykate-syntax.control b/noncore/apps/tinykate/opie-tinykate-syntax.control index c4156fc..712933c 100644 --- a/noncore/apps/tinykate/opie-tinykate-syntax.control +++ b/noncore/apps/tinykate/opie-tinykate-syntax.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-tinykate-syntax | 1 | Package: opie-tinykate-syntax |
2 | Priority: optional | 2 | Priority: optional |
3 | Section: opie/applications | 3 | Section: opie/applications |
4 | Maintainer: Opie Team <opie@handhelds.org> | 4 | Maintainer: Opie Team <opie@handhelds.org> |
5 | Architecture: arm | 5 | Architecture: arm |
6 | Version: $QPE_VERSION-$SUB_VERSION | ||
7 | Depends: task-opie-minimal, opie-tinykate, opie-tinykate-syntax-commondev, opie-tinykate-syntax-documentation, opie-tinykate-syntax-misc, opie-tinykate-syntax-miscdev, opie-tinykate-syntax-unix, opie-tinykate-syntax-web | 6 | Depends: task-opie-minimal, opie-tinykate, opie-tinykate-syntax-commondev, opie-tinykate-syntax-documentation, opie-tinykate-syntax-misc, opie-tinykate-syntax-miscdev, opie-tinykate-syntax-unix, opie-tinykate-syntax-web |
8 | Description: Syntax Highlighting Patterns virtual package, which installs all available syntax patterns. | 7 | Description: Syntax Highlighting Patterns virtual package, which installs all available syntax patterns. |
9 | Files: | 8 | Files: |
9 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/apps/tinykate/opie-tinykate.control b/noncore/apps/tinykate/opie-tinykate.control index 95dd7e0..731375c 100644 --- a/noncore/apps/tinykate/opie-tinykate.control +++ b/noncore/apps/tinykate/opie-tinykate.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-tinykate | 1 | Package: opie-tinykate |
2 | Files: bin/tinykate apps/Applications/tinykate.desktop pics/tinykate $OPIEDIR/lib/libtinykate.so.1.0.0 $OPIEDIR/lib/libtinykate.so.1.0 $OPIEDIR/lib/libtinykate.so.1 | 2 | Files: bin/tinykate apps/Applications/tinykate.desktop pics/tinykate $OPIEDIR/lib/libtinykate.so.1.0.0 $OPIEDIR/lib/libtinykate.so.1.0 $OPIEDIR/lib/libtinykate.so.1 |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Kate for opie | 8 | Description: Kate for opie |
9 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/apps/tinykate/tinykate.cpp b/noncore/apps/tinykate/tinykate.cpp index dda8405..f470645 100644 --- a/noncore/apps/tinykate/tinykate.cpp +++ b/noncore/apps/tinykate/tinykate.cpp | |||
@@ -5,141 +5,140 @@ | |||
5 | begin : November 2002 | 5 | begin : November 2002 |
6 | copyright : (C) 2002 by Joseph Wenninger <jowenn@kde.org> | 6 | copyright : (C) 2002 by Joseph Wenninger <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 softwaSre; 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. * | 13 | * the Free Software Foundation. * |
14 | * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE * | 14 | * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | #include <qwidget.h> | 17 | #include <qwidget.h> |
18 | #include <qaction.h> | 18 | #include <qaction.h> |
19 | #include <qlayout.h> | 19 | #include <qlayout.h> |
20 | #include <qpe/qpetoolbar.h> | 20 | #include <qtoolbutton.h> |
21 | #include <qpe/qpemenubar.h> | 21 | #include <qmenubar.h> |
22 | #include <qpe/resource.h> | 22 | #include <qpe/resource.h> |
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
25 | 25 | ||
26 | #include <opie/ofiledialog.h> | 26 | #include <opie/ofiledialog.h> |
27 | 27 | ||
28 | #include "cgotoline.h" | ||
29 | |||
30 | #include "tinykate.h" | 28 | #include "tinykate.h" |
31 | 29 | ||
32 | #include <katedocument.h> | 30 | #include <katedocument.h> |
33 | #include <katehighlight.h> | 31 | #include <katehighlight.h> |
34 | #include <kateview.h> | 32 | #include <kateview.h> |
35 | #include <kglobal.h> | 33 | #include <kglobal.h> |
36 | 34 | ||
37 | TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | 35 | TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : |
38 | QMainWindow( parent, name, f ) | 36 | QMainWindow( parent, name, f ) |
39 | { | 37 | { |
38 | shutDown=false; | ||
40 | nextUnnamed=0; | 39 | nextUnnamed=0; |
41 | currentView=0; | 40 | currentView=0; |
42 | viewCount=0; | 41 | viewCount=0; |
43 | setCaption("TinyKATE : line 1 col 1"); | 42 | setCaption(tr("TinyKATE")); |
44 | KGlobal::setAppName("TinyKATE"); | 43 | KGlobal::setAppName("TinyKATE"); |
45 | 44 | ||
46 | curLine=curCol=1; | 45 | QMenuBar *mb = new QMenuBar( this ); |
47 | |||
48 | setToolBarsMovable(FALSE); | ||
49 | |||
50 | QPEToolBar *bar = new QPEToolBar( this ); | ||
51 | bar->setHorizontalStretchable( TRUE ); | ||
52 | QPEMenuBar *mb = new QPEMenuBar( bar ); | ||
53 | mb->setMargin( 0 ); | 46 | mb->setMargin( 0 ); |
54 | 47 | ||
55 | tabwidget=new OTabWidget(this); | 48 | tabwidget=new OTabWidget(this); |
56 | setCentralWidget(tabwidget); | 49 | setCentralWidget(tabwidget); |
57 | connect(tabwidget,SIGNAL(currentChanged( QWidget *)),this,SLOT(slotCurrentChanged(QWidget *))); | 50 | connect(tabwidget,SIGNAL(currentChanged( QWidget *)),this,SLOT(slotCurrentChanged(QWidget *))); |
58 | 51 | ||
59 | //FILE ACTIONS | 52 | //FILE ACTIONS |
60 | QPopupMenu *popup = new QPopupMenu( this ); | 53 | QPopupMenu *popup = new QPopupMenu( this ); |
61 | 54 | ||
62 | // Action for creating a new document | 55 | // Action for creating a new document |
63 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, CTRL+Key_N, this, 0 ); | 56 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); |
64 | a->addTo( popup ); | 57 | a->addTo( popup ); |
65 | connect(a, SIGNAL(activated()), this, SLOT(slotNew())); | 58 | connect(a, SIGNAL(activated()), this, SLOT(slotNew())); |
66 | 59 | ||
67 | // Action for opening an exisiting document | 60 | // Action for opening an exisiting document |
68 | a = new QAction( tr( "Open" ), Resource::loadPixmap( "fileopen" ), QString::null, CTRL+Key_O, this, 0 ); | 61 | a = new QAction( tr( "Open" ),Resource::loadPixmap( "fileopen" ) , QString::null, 0, this, 0 ); |
69 | a->addTo(popup); | 62 | a->addTo(popup); |
70 | connect(a, SIGNAL(activated()), this, SLOT(slotOpen())); | 63 | connect(a, SIGNAL(activated()), this, SLOT(slotOpen())); |
71 | 64 | ||
72 | 65 | ||
73 | // Action for saving document | 66 | // Action for saving document |
74 | a = new QAction( tr( "Save" ), Resource::loadPixmap( "save" ), QString::null, CTRL+Key_S, this, 0 ); | 67 | a = new QAction( tr( "Save" ), Resource::loadPixmap( "save" ) , QString::null, 0, this, 0 ); |
75 | a->addTo(popup); | 68 | a->addTo(popup); |
76 | connect(a, SIGNAL(activated()), this, SLOT(slotSave())); | 69 | connect(a, SIGNAL(activated()), this, SLOT(slotSave())); |
77 | 70 | ||
78 | // Action for saving document to a new name | 71 | // Action for saving document to a new name |
79 | a = new QAction( tr( "Save As" ), Resource::loadPixmap( "save" ), QString::null, 0, this, 0 ); | 72 | a = new QAction( tr( "Save As" ), Resource::loadPixmap( "save" ), QString::null, 0, this, 0 ); |
80 | a->addTo(popup); | 73 | a->addTo(popup); |
81 | connect(a, SIGNAL(activated()), this, SLOT(slotSaveAs())); | 74 | connect(a, SIGNAL(activated()), this, SLOT(slotSaveAs())); |
82 | 75 | ||
83 | // Action for closing the currently active document | 76 | // Action for closing the currently active document |
84 | a = new QAction( tr( "Close" ), Resource::loadPixmap( "close" ), QString::null, CTRL+Key_W, this, 0 ); | 77 | a = new QAction( tr( "Close" ), Resource::loadPixmap( "quit_icon" ) , QString::null, 0, this, 0 ); |
85 | a->addTo(popup); | 78 | a->addTo(popup); |
86 | connect(a, SIGNAL(activated()), this, SLOT(slotClose())); | 79 | connect(a, SIGNAL(activated()), this, SLOT(slotClose())); |
87 | 80 | ||
88 | 81 | ||
89 | mb->insertItem(tr("File"),popup); | 82 | mb->insertItem(tr("File"),popup); |
90 | 83 | ||
91 | //EDIT ACTIONS | 84 | //EDIT ACTIONS |
92 | 85 | ||
93 | // Action for cutting text | 86 | // Action for cutting text |
94 | editCut = new QAction( tr( "Cut" ), Resource::loadPixmap( "cut" ), QString::null, CTRL+Key_X, this, 0 ); | 87 | editCut = new QToolButton( 0 ); |
95 | editCut->addTo( bar ); | 88 | editCut->setAutoRaise( true ); |
89 | editCut->setIconSet( Resource::loadPixmap( "cut" ) ); | ||
96 | 90 | ||
97 | // Action for Copying text | 91 | // Action for Copying text |
98 | editCopy = new QAction( tr( "Copy" ), Resource::loadPixmap( "copy" ), QString::null, CTRL+Key_C, this, 0 ); | 92 | editCopy = new QToolButton( 0 ); |
99 | editCopy->addTo( bar ); | 93 | editCopy->setAutoRaise( true ); |
94 | editCopy->setIconSet( Resource::loadPixmap( "copy" ) ); | ||
100 | 95 | ||
101 | // Action for pasting text | 96 | // Action for pasting text |
102 | editPaste = new QAction( tr( "Paste" ), Resource::loadPixmap( "paste" ), QString::null, CTRL+Key_V, this, 0 ); | 97 | editPaste = new QToolButton( 0 ); |
103 | editPaste->addTo( bar ); | 98 | editPaste->setAutoRaise( true ); |
104 | 99 | editPaste->setIconSet( Resource::loadPixmap( "paste" ) ); | |
105 | 100 | ||
106 | // Action for finding / replacing text | 101 | // Action for finding / replacing text |
107 | editFindReplace = new QAction( tr( "Replace" ), Resource::loadPixmap("find"), QString::null, CTRL+Key_R, this, 0 ); | 102 | editFindReplace = new QToolButton( 0 ); |
108 | editFind = new QAction( tr( "Find" ), Resource::loadPixmap("find"), QString::null, CTRL+Key_F, this, 0 ); | 103 | editFindReplace->setAutoRaise( true ); |
109 | editFind->addTo( bar ); | 104 | editFindReplace->setIconSet( Resource::loadPixmap("find") ); |
110 | 105 | ||
111 | // Action for undo | 106 | // Action for undo |
112 | editUndo = new QAction( tr( "Undo" ), Resource::loadPixmap( "undo" ), QString::null, CTRL+Key_Z, this, 0 ); | 107 | editUndo = new QToolButton( 0 ); |
113 | editUndo->addTo( bar ); | 108 | editUndo->setAutoRaise( true ); |
109 | editUndo->setIconSet( Resource::loadPixmap( "undo" ) ); | ||
114 | 110 | ||
115 | // Action for redo | 111 | // Action for redo |
116 | editRedo = new QAction( tr( "Redo" ), Resource::loadPixmap( "redo" ), QString::null, CTRL+SHIFT+Key_Z, this, 0 ); | 112 | editRedo = new QToolButton( 0 ); |
117 | editRedo->addTo( bar ); | 113 | editRedo->setAutoRaise( true ); |
118 | 114 | editRedo->setIconSet( Resource::loadPixmap( "redo" ) ); | |
119 | 115 | ||
120 | //VIEW ACITONS | 116 | //VIEW ACITONS |
121 | popup = new QPopupMenu( this ); | 117 | popup = new QPopupMenu( this ); |
122 | 118 | ||
123 | a = new QAction( tr( "Goto" ), QString::null, CTRL+Key_G, this, 0 ); | ||
124 | a->addTo( popup ); | ||
125 | connect(a, SIGNAL(activated()), this, SLOT(slotGoTo())); | ||
126 | |||
127 | viewIncFontSizes = new QAction( tr( "Font +" ), QString::null, 0, this, 0 ); | 119 | viewIncFontSizes = new QAction( tr( "Font +" ), QString::null, 0, this, 0 ); |
128 | viewIncFontSizes->addTo( popup ); | 120 | viewIncFontSizes->addTo( popup ); |
129 | 121 | ||
130 | viewDecFontSizes = new QAction( tr( "Font -" ), QString::null, 0, this, 0 ); | 122 | viewDecFontSizes = new QAction( tr( "Font -" ), QString::null, 0, this, 0 ); |
131 | viewDecFontSizes->addTo( popup ); | 123 | viewDecFontSizes->addTo( popup ); |
132 | 124 | ||
133 | mb->insertItem(tr("View"),popup); | 125 | mb->insertItem(tr("View"),popup); |
134 | 126 | ||
135 | |||
136 | |||
137 | popup = new QPopupMenu( this ); | 127 | popup = new QPopupMenu( this ); |
138 | mb->insertItem(tr("Utils"),popup); | 128 | mb->insertItem(tr("Utils"),popup); |
139 | 129 | ||
130 | |||
131 | mb->insertItem( editCut ); | ||
132 | mb->insertItem( editCopy ); | ||
133 | mb->insertItem( editPaste ); | ||
134 | mb->insertItem( editFindReplace ); | ||
135 | mb->insertItem( editUndo ); | ||
136 | mb->insertItem( editRedo ); | ||
137 | |||
138 | |||
140 | //Highlight management | 139 | //Highlight management |
141 | hlmenu=new QPopupMenu(this); | 140 | hlmenu=new QPopupMenu(this); |
142 | HlManager *hlm=HlManager::self(); | 141 | HlManager *hlm=HlManager::self(); |
143 | for (int i=0;i<hlm->highlights();i++) | 142 | for (int i=0;i<hlm->highlights();i++) |
144 | { | 143 | { |
145 | hlmenu->insertItem(hlm->hlName(i),i); | 144 | hlmenu->insertItem(hlm->hlName(i),i); |
@@ -147,27 +146,27 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | |||
147 | popup->insertItem(tr("Highlighting"),hlmenu); | 146 | popup->insertItem(tr("Highlighting"),hlmenu); |
148 | 147 | ||
149 | 148 | ||
150 | utilSettings = new QAction( tr( "Settings" ), QString::null, 0, this, 0 ); | 149 | utilSettings = new QAction( tr( "Settings" ), QString::null, 0, this, 0 ); |
151 | utilSettings->addTo( popup); | 150 | utilSettings->addTo( popup); |
152 | 151 | ||
153 | popup->insertSeparator(); | ||
154 | editFind->addTo(popup); | ||
155 | editFindReplace->addTo(popup); | ||
156 | |||
157 | if( qApp->argc() > 1) open(qApp->argv()[1]); | 152 | if( qApp->argc() > 1) open(qApp->argv()[1]); |
158 | else slotNew(); | 153 | else slotNew(); |
159 | 154 | ||
160 | } | 155 | } |
161 | 156 | ||
162 | TinyKate::~TinyKate( ) | 157 | TinyKate::~TinyKate( ) |
163 | { | 158 | { |
164 | qWarning("TinyKate destructor\n"); | 159 | qWarning("TinyKate destructor\n"); |
165 | printf("~TinyKate()\n"); | 160 | |
161 | shutDown=true; | ||
162 | while (currentView!=0) { | ||
163 | slotClose(); | ||
164 | } | ||
165 | |||
166 | if( KGlobal::config() != 0 ) { | 166 | if( KGlobal::config() != 0 ) { |
167 | printf("~TinyKate(): delete configs...\n"); | ||
168 | qWarning("deleting KateConfig object..\n"); | 167 | qWarning("deleting KateConfig object..\n"); |
169 | delete KGlobal::config(); | 168 | delete KGlobal::config(); |
170 | } | 169 | } |
171 | } | 170 | } |
172 | 171 | ||
173 | void TinyKate::slotOpen( ) | 172 | void TinyKate::slotOpen( ) |
@@ -190,50 +189,44 @@ void TinyKate::open(const QString & filename) | |||
190 | 189 | ||
191 | kd->setDocName( filenamed); | 190 | kd->setDocName( filenamed); |
192 | kd->open( filename ); | 191 | kd->open( filename ); |
193 | viewCount++; | 192 | viewCount++; |
194 | } | 193 | } |
195 | 194 | ||
196 | void TinyKate::setDocument(const QString &doc) | 195 | void TinyKate::setDocument(const QString& fileref) |
197 | { | 196 | { |
198 | printf("tinykate: setDocument(\"%s\")\n",(const char*)doc); | 197 | open( fileref ); |
199 | open(doc); | ||
200 | } | 198 | } |
201 | 199 | ||
202 | void TinyKate::slotCurrentChanged( QWidget * view) | 200 | void TinyKate::slotCurrentChanged( QWidget * view) |
203 | { | 201 | { |
204 | if (currentView) { | 202 | if (currentView) { |
205 | 203 | ||
206 | disconnect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); | 204 | disconnect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); |
207 | disconnect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); | 205 | disconnect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); |
208 | disconnect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); | 206 | disconnect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); |
209 | disconnect(editUndo,SIGNAL(activated()),currentView,SLOT(undo())); | 207 | disconnect(editUndo,SIGNAL(activated()),currentView,SLOT(undo())); |
210 | disconnect(editRedo,SIGNAL(activated()),currentView,SLOT(redo())); | 208 | disconnect(editRedo,SIGNAL(activated()),currentView,SLOT(redo())); |
211 | disconnect(editFindReplace,SIGNAL(activated()),currentView,SLOT(replace())); | ||
212 | disconnect(editFind,SIGNAL(activated()),currentView,SLOT(find())); | ||
213 | disconnect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); | 209 | disconnect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); |
214 | disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); | 210 | disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); |
215 | disconnect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); | 211 | disconnect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); |
216 | disconnect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog())); | 212 | disconnect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog())); |
217 | disconnect(currentView,SIGNAL(newCurPos()),this,SLOT(slotCursorMoved())); | ||
218 | } | 213 | } |
219 | 214 | ||
220 | currentView=(KTextEditor::View*)view; | 215 | currentView=(KTextEditor::View*)view; |
221 | 216 | ||
222 | connect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); | 217 | connect(editCopy,SIGNAL(clicked()),currentView,SLOT(copy())); |
223 | connect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); | 218 | connect(editCut,SIGNAL(clicked()),currentView,SLOT(cut())); |
224 | connect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); | 219 | connect(editPaste,SIGNAL(clicked()),currentView,SLOT(paste())); |
225 | connect(editUndo,SIGNAL(activated()),currentView,SLOT(undo())); | 220 | connect(editUndo,SIGNAL(clicked()),currentView,SLOT(undo())); |
226 | connect(editRedo,SIGNAL(activated()),currentView,SLOT(redo())); | 221 | connect(editRedo,SIGNAL(clicked()),currentView,SLOT(redo())); |
227 | connect(editFindReplace,SIGNAL(activated()),currentView,SLOT(replace())); | ||
228 | connect(editFind,SIGNAL(activated()),currentView,SLOT(find())); | ||
229 | connect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); | 222 | connect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); |
230 | connect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); | 223 | connect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); |
231 | connect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); | 224 | connect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); |
232 | connect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog())); | 225 | connect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog())); |
233 | connect(currentView,SIGNAL(newCurPos()),this,SLOT(slotCursorMoved())); | 226 | |
234 | } | 227 | } |
235 | 228 | ||
236 | void TinyKate::slotNew( ) | 229 | void TinyKate::slotNew( ) |
237 | { | 230 | { |
238 | KateDocument *kd= new KateDocument(false, false, this,0,this); | 231 | KateDocument *kd= new KateDocument(false, false, this,0,this); |
239 | KTextEditor::View *kv; | 232 | KTextEditor::View *kv; |
@@ -248,13 +241,13 @@ void TinyKate::slotClose( ) | |||
248 | if (currentView==0) return; | 241 | if (currentView==0) return; |
249 | KTextEditor::View *dv=currentView; | 242 | KTextEditor::View *dv=currentView; |
250 | currentView=0; | 243 | currentView=0; |
251 | tabwidget->removePage(dv); | 244 | tabwidget->removePage(dv); |
252 | delete dv->document(); | 245 | delete dv->document(); |
253 | viewCount--; | 246 | viewCount--; |
254 | if (!viewCount) slotNew(); | 247 | if ((!viewCount) && (!shutDown)) slotNew(); |
255 | } | 248 | } |
256 | 249 | ||
257 | void TinyKate::slotSave() { | 250 | void TinyKate::slotSave() { |
258 | // feel free to make this how you want | 251 | // feel free to make this how you want |
259 | if (currentView==0) return; | 252 | if (currentView==0) return; |
260 | 253 | ||
@@ -285,37 +278,6 @@ void TinyKate::slotSaveAs() { | |||
285 | // KTextEditor::View *dv = currentView; | 278 | // KTextEditor::View *dv = currentView; |
286 | // tabwidget->changeTab( dv, filenamed); | 279 | // tabwidget->changeTab( dv, filenamed); |
287 | // need to change tab label here | 280 | // need to change tab label here |
288 | } | 281 | } |
289 | 282 | ||
290 | } | 283 | } |
291 | |||
292 | void TinyKate::slotGoTo() | ||
293 | { | ||
294 | int l,c; | ||
295 | if (currentView==0) return; | ||
296 | |||
297 | currentView->getCursorPosition(&l,&c); | ||
298 | |||
299 | CGotoLine g(l); | ||
300 | |||
301 | if(g.exec()==QDialog::Accepted) | ||
302 | { | ||
303 | currentView->setCursorPosition( g.line(), c ); | ||
304 | } | ||
305 | } | ||
306 | |||
307 | void TinyKate::slotCursorMoved() | ||
308 | { | ||
309 | char buf[100]; | ||
310 | int newLine,newCol; | ||
311 | currentView->getCursorPosition(&newLine,&newCol); | ||
312 | newLine++; | ||
313 | newCol++; | ||
314 | if((newLine!=curLine)||(newCol!=curCol)) | ||
315 | { | ||
316 | sprintf(buf,"TinyKATE : line %-6d col %d",newLine,newCol); | ||
317 | setCaption(buf); | ||
318 | curLine=newLine; | ||
319 | curCol=newCol; | ||
320 | } | ||
321 | } | ||
diff --git a/noncore/apps/tinykate/tinykate.h b/noncore/apps/tinykate/tinykate.h index 077d5f0..2bf4de6 100644 --- a/noncore/apps/tinykate/tinykate.h +++ b/noncore/apps/tinykate/tinykate.h | |||
@@ -20,56 +20,45 @@ | |||
20 | 20 | ||
21 | 21 | ||
22 | #include <qmainwindow.h> | 22 | #include <qmainwindow.h> |
23 | #include <opie/otabwidget.h> | 23 | #include <opie/otabwidget.h> |
24 | #include <ktexteditor.h> | 24 | #include <ktexteditor.h> |
25 | 25 | ||
26 | class QToolButton; | ||
26 | class QAction; | 27 | class QAction; |
27 | class QPopupMenu; | 28 | class QPopupMenu; |
28 | class CGotoLine; | ||
29 | 29 | ||
30 | class TinyKate : public QMainWindow | 30 | class TinyKate : public QMainWindow |
31 | { | 31 | { |
32 | Q_OBJECT | 32 | Q_OBJECT |
33 | public: | 33 | public: |
34 | TinyKate( QWidget *parent=0, const char *name=0, WFlags f = 0); | 34 | TinyKate( QWidget *parent=0, const char *name=0, WFlags f = 0); |
35 | ~TinyKate( ); | 35 | ~TinyKate( ); |
36 | 36 | ||
37 | public slots: | 37 | public slots: |
38 | void slotNew(); | 38 | void slotNew(); |
39 | void setDocument(const QString& fileref); | ||
39 | 40 | ||
40 | protected slots: | 41 | protected slots: |
41 | void slotOpen(); | 42 | void slotOpen(); |
42 | void slotClose(); | 43 | void slotClose(); |
43 | void slotCurrentChanged(QWidget *); | 44 | void slotCurrentChanged(QWidget *); |
44 | void slotSave(); | 45 | void slotSave(); |
45 | void slotSaveAs(); | 46 | void slotSaveAs(); |
46 | void slotGoTo(); | ||
47 | void slotCursorMoved(); | ||
48 | void setDocument(const QString &doc); | ||
49 | |||
50 | protected: | 47 | protected: |
51 | void open(const QString&); | 48 | void open(const QString&); |
52 | private: | 49 | private: |
53 | QString currentFileName; | 50 | QString currentFileName; |
54 | OTabWidget *tabwidget; | 51 | OTabWidget *tabwidget; |
55 | KTextEditor::View *currentView; | 52 | KTextEditor::View *currentView; |
53 | bool shutDown; | ||
56 | 54 | ||
57 | QAction *editCopy; | 55 | QToolButton *editCopy, *editCut, *editPaste, *editUndo, *editRedo, *editFindReplace; |
58 | QAction *editCut; | 56 | QAction *viewIncFontSizes, *viewDecFontSizes, *utilSettings; |
59 | QAction *editPaste; | ||
60 | QAction *editUndo; | ||
61 | QAction *editRedo; | ||
62 | QAction *editFind; | ||
63 | QAction *editFindReplace; | ||
64 | QAction *viewIncFontSizes; | ||
65 | QAction *viewDecFontSizes; | ||
66 | QAction *utilSettings; | ||
67 | 57 | ||
68 | QPopupMenu *hlmenu; | 58 | QPopupMenu *hlmenu; |
69 | uint nextUnnamed; | 59 | uint nextUnnamed; |
70 | uint viewCount; | 60 | uint viewCount; |
71 | int curLine,curCol; | ||
72 | }; | 61 | }; |
73 | 62 | ||
74 | 63 | ||
75 | #endif // __TINYKATE_H__ | 64 | #endif // __TINYKATE_H__ |
diff --git a/noncore/apps/tinykate/tinykate.pro b/noncore/apps/tinykate/tinykate.pro index f7ff451..632bd49 100644 --- a/noncore/apps/tinykate/tinykate.pro +++ b/noncore/apps/tinykate/tinykate.pro | |||
@@ -1,12 +1,12 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG = qt warn_on release | 2 | CONFIG = qt warn_on release |
3 | DESTDIR = $(OPIEDIR)/bin | 3 | DESTDIR = $(OPIEDIR)/bin |
4 | HEADERS = tinykate.h cgotoline.h | 4 | HEADERS = tinykate.h |
5 | SOURCES = tinykate.cpp main.cpp cgotoline.cpp | 5 | SOURCES = tinykate.cpp main.cpp |
6 | INTERFACES = cgotobase.ui | 6 | INTERFACES= |
7 | INCLUDEPATH += $(OPIEDIR)/include \ | 7 | INCLUDEPATH += $(OPIEDIR)/include \ |
8 | $(OPIEDIR)/noncore/apps/tinykate/libkate \ | 8 | $(OPIEDIR)/noncore/apps/tinykate/libkate \ |
9 | $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \ | 9 | $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \ |
10 | $(OPIEDIR)/noncore/apps/tinykate/libkate/document \ | 10 | $(OPIEDIR)/noncore/apps/tinykate/libkate/document \ |
11 | $(OPIEDIR)/noncore/apps/tinykate/libkate/view \ | 11 | $(OPIEDIR)/noncore/apps/tinykate/libkate/view \ |
12 | $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \ | 12 | $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \ |