summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate
authorkergoth <kergoth>2003-08-09 16:12:19 (UTC)
committer kergoth <kergoth>2003-08-09 16:12:19 (UTC)
commit1c58d1407f9584fedcdae390a04e2b37e5853361 (patch) (unidiff)
tree3c6e741c4d382d1a53c182930052b684d6e35b91 /noncore/apps/tinykate
parente3f4607edd0c1ca1434adb446df1d4a1d27c6a86 (diff)
downloadopie-1c58d1407f9584fedcdae390a04e2b37e5853361.zip
opie-1c58d1407f9584fedcdae390a04e2b37e5853361.tar.gz
opie-1c58d1407f9584fedcdae390a04e2b37e5853361.tar.bz2
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/apps/tinykate') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/document/katebuffer.cpp2
-rw-r--r--noncore/apps/tinykate/libkate/document/katesyntaxdocument.cpp3
-rw-r--r--noncore/apps/tinykate/libkate/libkate.pro5
-rw-r--r--noncore/apps/tinykate/libkate/microkde/kcolorbtn.cpp12
-rw-r--r--noncore/apps/tinykate/libkate/microkde/kcolordialog.h4
-rw-r--r--noncore/apps/tinykate/libkate/view/kateview.cpp14
-rw-r--r--noncore/apps/tinykate/main.cpp5
-rw-r--r--noncore/apps/tinykate/opie-tinykate-syntax-commondev.control2
-rw-r--r--noncore/apps/tinykate/opie-tinykate-syntax-documentation.control2
-rw-r--r--noncore/apps/tinykate/opie-tinykate-syntax-misc.control2
-rw-r--r--noncore/apps/tinykate/opie-tinykate-syntax-miscdev.control2
-rw-r--r--noncore/apps/tinykate/opie-tinykate-syntax-unix.control2
-rw-r--r--noncore/apps/tinykate/opie-tinykate-syntax-web.control2
-rw-r--r--noncore/apps/tinykate/opie-tinykate-syntax.control2
-rw-r--r--noncore/apps/tinykate/opie-tinykate.control2
-rw-r--r--noncore/apps/tinykate/tinykate.cpp142
-rw-r--r--noncore/apps/tinykate/tinykate.h21
-rw-r--r--noncore/apps/tinykate/tinykate.pro6
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
@@ -123,3 +123,3 @@ 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;
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
@@ -73,3 +73,3 @@ void SyntaxDocument::setupModeList(bool force)
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);
@@ -107,2 +107,3 @@ void SyntaxDocument::setupModeList(bool force)
107 } 107 }
108 config->write();
108// config->sync(); 109// config->sync();
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
@@ -27,2 +27,4 @@ HEADERS = microkde/kapplication.h \
27 microkde/kcolorbtn.h \ 27 microkde/kcolorbtn.h \
28 \
29 \
28 qt3back/qregexp3.h \ 30 qt3back/qregexp3.h \
@@ -51,2 +53,3 @@ SOURCES = microkde/kapplication.cpp \
51 microkde/kurlrequester.cpp \ 53 microkde/kurlrequester.cpp \
54 microkde/kcolordialog.cpp \
52 microkde/kfontdialog.cpp \ 55 microkde/kfontdialog.cpp \
@@ -57,2 +60,4 @@ SOURCES = microkde/kapplication.cpp \
57 microkde/kcolorbtn.cpp \ 60 microkde/kcolorbtn.cpp \
61 \
62 \
58 qt3back/qregexp3.cpp \ 63 qt3back/qregexp3.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
@@ -25,7 +25,5 @@
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
31KColorButton::KColorButton( QWidget *parent, const char *name ) 29KColorButton::KColorButton( QWidget *parent, const char *name )
@@ -77,6 +75,7 @@ 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 );
@@ -84,3 +83,2 @@ void KColorButton::chooseColor()
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
@@ -4,7 +4,5 @@
4#include <qcolor.h> 4#include <qcolor.h>
5#include <opie/colordialog.h>
6 5
7class KColorDialog : OColorDialog 6class KColorDialog
8{ 7{
9 Q_OBJECT
10 public: 8 public:
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
@@ -2198,3 +2198,4 @@ bool KateView::askReplaceEnd() {
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 {
@@ -2204,3 +2205,4 @@ bool KateView::askReplaceEnd() {
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 }
@@ -2268,3 +2270,2 @@ void KateView::configDialog()
2268#warning fixme 2270#warning fixme
2269 QScrollView *pScroll;
2270 2271
@@ -2305,5 +2306,4 @@ void KateView::configDialog()
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
@@ -2327,6 +2327,4 @@ void KateView::configDialog()
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();
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
@@ -24,5 +24,4 @@ int main( int argc, char ** 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();
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
@@ -6,4 +6,4 @@ Maintainer: Opie Team <opie@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: $QPE_VERSION-$SUB_VERSION
8Depends: task-opie-minimal, opie-tinykate 7Depends: task-opie-minimal, opie-tinykate
9Description: Syntax Highlighting Patterns for for common programming languages for TinyKate 8Description: Syntax Highlighting Patterns for for common programming languages for TinyKate
9Version: $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
@@ -6,4 +6,4 @@ Maintainer: Opie Team <opie@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: $QPE_VERSION-$SUB_VERSION
8Depends: task-opie-minimal, opie-tinykate 7Depends: task-opie-minimal, opie-tinykate
9Description: Syntax Highlighting Patterns for document oriented languages for TinyKate 8Description: Syntax Highlighting Patterns for document oriented languages for TinyKate
9Version: $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
@@ -6,4 +6,4 @@ Maintainer: Opie Team <opie@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: $QPE_VERSION-$SUB_VERSION
8Depends: task-opie-minimal, opie-tinykate 7Depends: task-opie-minimal, opie-tinykate
9Description: Syntax Highlighting Patterns for misc languages for TinyKate 8Description: Syntax Highlighting Patterns for misc languages for TinyKate
9Version: $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
@@ -6,4 +6,4 @@ Maintainer: Opie Team <opie@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: $QPE_VERSION-$SUB_VERSION
8Depends: task-opie-minimal, opie-tinykate 7Depends: task-opie-minimal, opie-tinykate
9Description: Syntax Highlighting Patterns for for uncommon programming languages for TinyKate 8Description: Syntax Highlighting Patterns for for uncommon programming languages for TinyKate
9Version: $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
@@ -6,4 +6,4 @@ Maintainer: Opie Team <opie@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: $QPE_VERSION-$SUB_VERSION
8Depends: task-opie-minimal, opie-tinykate 7Depends: task-opie-minimal, opie-tinykate
9Description: Syntax Highlighting Patterns for UNIX/Linux specific files for TinyKate 8Description: Syntax Highlighting Patterns for UNIX/Linux specific files for TinyKate
9Version: $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
@@ -6,4 +6,4 @@ Maintainer: Opie Team <opie@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: $QPE_VERSION-$SUB_VERSION
8Depends: task-opie-minimal, opie-tinykate 7Depends: task-opie-minimal, opie-tinykate
9Description: Syntax Highlighting Patterns for for common programming languages for TinyKate 8Description: Syntax Highlighting Patterns for for common programming languages for TinyKate
9Version: $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
@@ -5,3 +5,2 @@ Maintainer: Opie Team <opie@handhelds.org>
5Architecture: arm 5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION
7Depends: 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 6Depends: 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
@@ -9 +8,2 @@ Description: Syntax Highlighting Patterns virtual package, which installs all av
9Files: 8Files:
9Version: $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
@@ -6,4 +6,4 @@ Maintainer: Opie Team <opie@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: $QPE_VERSION-$SUB_VERSION
8Depends: task-opie-minimal 7Depends: task-opie-minimal
9Description: Kate for opie 8Description: Kate for opie
9Version: $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
@@ -10,3 +10,3 @@
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 *
@@ -19,4 +19,4 @@
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>
@@ -27,4 +27,2 @@
27 27
28#include "cgotoline.h"
29
30#include "tinykate.h" 28#include "tinykate.h"
@@ -39,2 +37,3 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
39{ 37{
38 shutDown=false;
40 nextUnnamed=0; 39 nextUnnamed=0;
@@ -42,12 +41,6 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
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 );
@@ -62,3 +55,3 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
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 );
@@ -67,3 +60,3 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
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);
@@ -73,3 +66,3 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
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);
@@ -83,3 +76,3 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
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);
@@ -93,27 +86,30 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
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
@@ -122,6 +118,2 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
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 );
@@ -134,4 +126,2 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
134 126
135
136
137 popup = new QPopupMenu( this ); 127 popup = new QPopupMenu( this );
@@ -139,2 +129,11 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
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
@@ -152,6 +151,2 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
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]);
@@ -164,5 +159,9 @@ TinyKate::~TinyKate( )
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");
@@ -195,6 +194,5 @@ void TinyKate::open(const QString & filename)
195 194
196void TinyKate::setDocument(const QString &doc) 195void TinyKate::setDocument(const QString& fileref)
197{ 196{
198 printf("tinykate: setDocument(\"%s\")\n",(const char*)doc); 197 open( fileref );
199 open(doc);
200} 198}
@@ -210,4 +208,2 @@ void TinyKate::slotCurrentChanged( QWidget * view)
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()));
@@ -216,3 +212,2 @@ void TinyKate::slotCurrentChanged( QWidget * view)
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 }
@@ -221,9 +216,7 @@ void TinyKate::slotCurrentChanged( QWidget * 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()));
@@ -232,3 +225,3 @@ void TinyKate::slotCurrentChanged( QWidget * view)
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}
@@ -253,3 +246,3 @@ void TinyKate::slotClose( )
253 viewCount--; 246 viewCount--;
254 if (!viewCount) slotNew(); 247 if ((!viewCount) && (!shutDown)) slotNew();
255} 248}
@@ -290,32 +283 @@ void TinyKate::slotSaveAs() {
290} }
291
292void 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
307void 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
@@ -25,5 +25,5 @@
25 25
26class QToolButton;
26class QAction; 27class QAction;
27class QPopupMenu; 28class QPopupMenu;
28class CGotoLine;
29 29
@@ -38,2 +38,3 @@ public slots:
38 void slotNew(); 38 void slotNew();
39 void setDocument(const QString& fileref);
39 40
@@ -45,6 +46,2 @@ protected slots:
45 void slotSaveAs(); 46 void slotSaveAs();
46 void slotGoTo();
47 void slotCursorMoved();
48 void setDocument(const QString &doc);
49
50protected: 47protected:
@@ -55,13 +52,6 @@ private:
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
@@ -70,3 +60,2 @@ private:
70 uint viewCount; 60 uint viewCount;
71 int curLine,curCol;
72}; 61};
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
@@ -3,5 +3,5 @@ CONFIG = qt warn_on release
3DESTDIR = $(OPIEDIR)/bin 3DESTDIR = $(OPIEDIR)/bin
4HEADERS = tinykate.h cgotoline.h 4 HEADERS = tinykate.h
5SOURCES = tinykate.cpp main.cpp cgotoline.cpp 5 SOURCES = tinykate.cpp main.cpp
6INTERFACES = cgotobase.ui 6 INTERFACES=
7INCLUDEPATH += $(OPIEDIR)/include \ 7INCLUDEPATH += $(OPIEDIR)/include \