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) (side-by-side diff)
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) (ignore 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.pro93
-rw-r--r--noncore/apps/tinykate/libkate/microkde/kcolorbtn.cpp14
-rw-r--r--noncore/apps/tinykate/libkate/microkde/kcolordialog.h4
-rw-r--r--noncore/apps/tinykate/libkate/view/kateview.cpp16
-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.cpp162
-rw-r--r--noncore/apps/tinykate/tinykate.h25
-rw-r--r--noncore/apps/tinykate/tinykate.pro22
18 files changed, 156 insertions, 206 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
@@ -121,7 +121,7 @@ KWBuffer::slotLoadFile()
int
KWBuffer::count()
{
-// qDebug("m_stringList.count %d",m_stringList.count());
+ qDebug("m_stringList.count %d",m_stringList.count());
return m_lineCount;
// return m_stringList.count();
// return m_totalLines;
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
@@ -71,7 +71,7 @@ void SyntaxDocument::setupModeList(bool force)
mli->section = config->readEntry("section","");
mli->mimetype = config->readEntry("mimetype","");
mli->extension = config->readEntry("extension","");
- mli->identifier = *it;
+ mli->identifier = path+*it;
myModeList.append(mli);
}
else
@@ -105,6 +105,7 @@ void SyntaxDocument::setupModeList(bool force)
}
}
}
+ config->write();
// 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
@@ -1,7 +1,7 @@
-TEMPLATE = lib
-CONFIG = qt warn_on release
-HEADERS = microkde/kapplication.h \
- kateconfig.h \
+TEMPLATE = lib
+CONFIG = qt warn_on release
+HEADERS = microkde/kapplication.h \
+ kateconfig.h \
microkde/kdebug.h \
microkde/kdialog.h \
microkde/kdialogbase.h \
@@ -24,61 +24,66 @@ HEADERS = microkde/kapplication.h \
microkde/kstaticdeleter.h \
microkde/klistview.h \
microkde/kglobalsettings.h \
- microkde/kcolorbtn.h \
- qt3back/qregexp3.h \
- microkde/ksharedptr.h \
- document/katebuffer.h document/katedialogs.h \
- document/katetextline.h \
- document/katecmd.h \
- document/katehighlight.h \
- document/katecmds.h document/katedocument.h \
- document/katesyntaxdocument.h \
- view/kateundohistory.h \
- view/kateview.h \
- view/kateviewdialog.h \
- interfaces/view.h \
- interfaces/document.h \
- ktexteditor/ktexteditor.h
+ microkde/kcolorbtn.h \
+ \
+ \
+ qt3back/qregexp3.h \
+ microkde/ksharedptr.h \
+ document/katebuffer.h document/katedialogs.h \
+ document/katetextline.h \
+ document/katecmd.h \
+ document/katehighlight.h \
+ document/katecmds.h document/katedocument.h \
+ document/katesyntaxdocument.h \
+ view/kateundohistory.h \
+ view/kateview.h \
+ view/kateviewdialog.h \
+ interfaces/view.h \
+ interfaces/document.h \
+ ktexteditor/ktexteditor.h
-SOURCES = microkde/kapplication.cpp \
+SOURCES = microkde/kapplication.cpp \
microkde/kdialogbase.cpp \
- kateconfig.cpp \
+ kateconfig.cpp \
microkde/klocale.cpp \
microkde/kmessagebox.cpp \
microkde/kprocess.cpp \
microkde/kstandarddirs.cpp \
microkde/ktempfile.cpp \
microkde/kurlrequester.cpp \
+ microkde/kcolordialog.cpp \
microkde/kfontdialog.cpp \
microkde/krun.cpp \
microkde/knumvalidator.cpp \
microkde/kglobal.cpp \
microkde/kglobalsettings.cpp \
- microkde/kcolorbtn.cpp \
- qt3back/qregexp3.cpp \
- ktexteditor/ktexteditor.cpp \
- document/katebuffer.cpp document/katedialogs.cpp \
- document/katehighlight.cpp \
- document/katecmd.cpp \
- document/katesyntaxdocument.cpp document/katecmds.cpp \
- document/katedocument.cpp document/katetextline.cpp \
- view/kateundohistory.cpp \
- view/kateview.cpp \
- view/kateviewdialog.cpp \
- interfaces/interfaces.cpp
+ microkde/kcolorbtn.cpp \
+ \
+ \
+ qt3back/qregexp3.cpp \
+ ktexteditor/ktexteditor.cpp \
+ document/katebuffer.cpp document/katedialogs.cpp \
+ document/katehighlight.cpp \
+ document/katecmd.cpp \
+ document/katesyntaxdocument.cpp document/katecmds.cpp \
+ document/katedocument.cpp document/katetextline.cpp \
+ view/kateundohistory.cpp \
+ view/kateview.cpp \
+ view/kateviewdialog.cpp \
+ interfaces/interfaces.cpp
-INTERFACES =
-INCLUDEPATH += $(OPIEDIR)/include \
- $(OPIEDIR)/noncore/apps/tinykate/libkate \
- $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \
- $(OPIEDIR)/noncore/apps/tinykate/libkate/document \
- $(OPIEDIR)/noncore/apps/tinykate/libkate/view \
- $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \
- $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \
- $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back
-DEPENDPATH += $(OPIEDIR)/include
+INTERFACES =
+INCLUDEPATH += $(OPIEDIR)/include \
+ $(OPIEDIR)/noncore/apps/tinykate/libkate \
+ $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \
+ $(OPIEDIR)/noncore/apps/tinykate/libkate/document \
+ $(OPIEDIR)/noncore/apps/tinykate/libkate/view \
+ $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \
+ $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \
+ $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back
+DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lopie
-TARGET = tinykate
+TARGET = tinykate
INCLUDEPATH += $(OPIEDIR)/include
DESTDIR = $(OPIEDIR)/lib$(PROJMAK)
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
@@ -23,11 +23,9 @@
#include <qdrawutil.h>
#include <qapplication.h>
#include <kglobalsettings.h>
-//#include "kcolordialog.h"
+#include "kcolordialog.h"
#include "kcolorbtn.h"
-#include <opie/colordialog.h>
-
KColorButton::KColorButton( QWidget *parent, const char *name )
: QPushButton( parent, name ), dragFlag(false)
{
@@ -36,7 +34,7 @@ KColorButton::KColorButton( QWidget *parent, const char *name )
}
KColorButton::KColorButton( const QColor &c, QWidget *parent,
- const char *name )
+ const char *name )
: QPushButton( parent, name ), col(c), dragFlag(false)
{
@@ -75,12 +73,12 @@ void KColorButton::drawButtonLabel( QPainter *painter )
void KColorButton::chooseColor()
{
- QColor newCol=OColorDialog::getColor( col);
- if( newCol != QDialog::Rejected )
+ if( KColorDialog::getColor( col) == QDialog::Rejected )
{
- col=newCol;
+ return;
+ }
+
repaint( false );
emit changed( col );
- }
}
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
@@ -2,11 +2,9 @@
#define MINIKDE_KCOLORDIALOG_H
#include <qcolor.h>
-#include <opie/colordialog.h>
-class KColorDialog : OColorDialog
+class KColorDialog
{
- Q_OBJECT
public:
enum { Accepted };
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
@@ -2196,13 +2196,15 @@ bool KateView::askReplaceEnd() {
str = i18n("%1 replacement(s) made.\n"
"End of document reached.\n"
"Continue from the beginning?").arg(replaces);
- query = KMessageBox::questionYesNo(this, str, i18n("Continue"), i18n("Stop"));
+ query = KMessageBox::questionYesNo(this, str, i18n("Replace"),
+ i18n("Continue"), i18n("Stop"));
} else {
// backward search
str = i18n("%1 replacement(s) made.\n"
"Beginning of document reached.\n"
"Continue from the end?").arg(replaces);
- query = KMessageBox::questionYesNo(this, str, i18n("Continue"), i18n("Stop"));
+ query = KMessageBox::questionYesNo(this, str, i18n("Replace"),
+ i18n("Continue"), i18n("Stop"));
}
replaces = 0;
continueSearch(s);
@@ -2266,7 +2268,6 @@ void KateView::configDialog()
{
#warning fixme
- QScrollView *pScroll;
#if 1
KDialogBase *kd = new KDialogBase(KDialogBase::IconList,
@@ -2303,9 +2304,8 @@ void KateView::configDialog()
// edit options
page=kd->addPage(i18n("Edit"));
(new QVBoxLayout(page))->setAutoAdd(true);
- pScroll=new QScrollView(page);
+
EditConfigTab *editConfig = new EditConfigTab(page, this);
- pScroll->addChild(editConfig);
@@ -2325,11 +2325,9 @@ void KateView::configDialog()
page=kd->addPage(i18n("Highlighting"));
(new QVBoxLayout(page))->setAutoAdd(true);
- pScroll=new QScrollView(page);
- hlPage = new HighlightDialogPage(hlManager, &defaultStyleList, &hlDataList, 0, pScroll->viewport());
- pScroll->addChild(hlPage);
- kd->showMaximized();
+ hlPage = new HighlightDialogPage(hlManager, &defaultStyleList, &hlDataList, 0, page);
+ kd->showMaximized();
if (kd->exec()) {
// color options
colorConfig->getColors(colors);
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
@@ -22,8 +22,7 @@ int main( int argc, char ** argv )
{
QPEApplication a( argc, argv );
- TinyKate *m = new TinyKate();
- a.setMainWidget( m );
- m->showMaximized();
+ TinyKate m;
+ a.showMainWidget(&m );
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
@@ -4,6 +4,6 @@ Priority: optional
Section: opie/applications
Maintainer: Opie Team <opie@handhelds.org>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal, opie-tinykate
Description: Syntax Highlighting Patterns for for common programming languages for TinyKate
+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
@@ -4,6 +4,6 @@ Priority: optional
Section: opie/applications
Maintainer: Opie Team <opie@handhelds.org>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal, opie-tinykate
Description: Syntax Highlighting Patterns for document oriented languages for TinyKate
+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
@@ -4,6 +4,6 @@ Priority: optional
Section: opie/applications
Maintainer: Opie Team <opie@handhelds.org>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal, opie-tinykate
Description: Syntax Highlighting Patterns for misc languages for TinyKate
+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
@@ -4,6 +4,6 @@ Priority: optional
Section: opie/applications
Maintainer: Opie Team <opie@handhelds.org>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal, opie-tinykate
Description: Syntax Highlighting Patterns for for uncommon programming languages for TinyKate
+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
@@ -4,6 +4,6 @@ Priority: optional
Section: opie/applications
Maintainer: Opie Team <opie@handhelds.org>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal, opie-tinykate
Description: Syntax Highlighting Patterns for UNIX/Linux specific files for TinyKate
+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
@@ -4,6 +4,6 @@ Priority: optional
Section: opie/applications
Maintainer: Opie Team <opie@handhelds.org>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal, opie-tinykate
Description: Syntax Highlighting Patterns for for common programming languages for TinyKate
+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
@@ -3,7 +3,7 @@ Priority: optional
Section: opie/applications
Maintainer: Opie Team <opie@handhelds.org>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
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
Description: Syntax Highlighting Patterns virtual package, which installs all available syntax patterns.
Files:
+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
@@ -4,6 +4,6 @@ Priority: optional
Section: opie/applications
Maintainer: Opie Team <opie@handhelds.org>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal
Description: Kate for opie
+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
@@ -8,7 +8,7 @@
/***************************************************************************
* *
- * This program is free software; you can redistribute it and/or modify *
+ * This program is free softwaSre; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation. *
* ONLY VERSION 2 OF THE LICENSE IS APPLICABLE *
@@ -17,16 +17,14 @@
#include <qwidget.h>
#include <qaction.h>
#include <qlayout.h>
-#include <qpe/qpetoolbar.h>
-#include <qpe/qpemenubar.h>
+#include <qtoolbutton.h>
+#include <qmenubar.h>
#include <qpe/resource.h>
#include <qpe/global.h>
#include <qpe/qpeapplication.h>
#include <opie/ofiledialog.h>
-#include "cgotoline.h"
-
#include "tinykate.h"
#include <katedocument.h>
@@ -36,21 +34,16 @@
TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
QMainWindow( parent, name, f )
-{
+{
+ shutDown=false;
nextUnnamed=0;
currentView=0;
viewCount=0;
- setCaption("TinyKATE : line 1 col 1");
+ setCaption(tr("TinyKATE"));
KGlobal::setAppName("TinyKATE");
- curLine=curCol=1;
-
- setToolBarsMovable(FALSE);
-
- QPEToolBar *bar = new QPEToolBar( this );
- bar->setHorizontalStretchable( TRUE );
- QPEMenuBar *mb = new QPEMenuBar( bar );
- mb->setMargin( 0 );
+ QMenuBar *mb = new QMenuBar( this );
+ mb->setMargin( 0 );
tabwidget=new OTabWidget(this);
setCentralWidget(tabwidget);
@@ -60,82 +53,88 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
QPopupMenu *popup = new QPopupMenu( this );
// Action for creating a new document
- QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, CTRL+Key_N, this, 0 );
+ QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
a->addTo( popup );
connect(a, SIGNAL(activated()), this, SLOT(slotNew()));
// Action for opening an exisiting document
- a = new QAction( tr( "Open" ), Resource::loadPixmap( "fileopen" ), QString::null, CTRL+Key_O, this, 0 );
+ a = new QAction( tr( "Open" ),Resource::loadPixmap( "fileopen" ) , QString::null, 0, this, 0 );
a->addTo(popup);
connect(a, SIGNAL(activated()), this, SLOT(slotOpen()));
// Action for saving document
- a = new QAction( tr( "Save" ), Resource::loadPixmap( "save" ), QString::null, CTRL+Key_S, this, 0 );
+ a = new QAction( tr( "Save" ), Resource::loadPixmap( "save" ) , QString::null, 0, this, 0 );
a->addTo(popup);
connect(a, SIGNAL(activated()), this, SLOT(slotSave()));
// Action for saving document to a new name
- a = new QAction( tr( "Save As" ), Resource::loadPixmap( "save" ), QString::null, 0, this, 0 );
+ a = new QAction( tr( "Save As" ),Resource::loadPixmap( "save" ) , QString::null, 0, this, 0 );
a->addTo(popup);
connect(a, SIGNAL(activated()), this, SLOT(slotSaveAs()));
// Action for closing the currently active document
- a = new QAction( tr( "Close" ), Resource::loadPixmap( "close" ), QString::null, CTRL+Key_W, this, 0 );
+ a = new QAction( tr( "Close" ), Resource::loadPixmap( "quit_icon" ) , QString::null, 0, this, 0 );
a->addTo(popup);
connect(a, SIGNAL(activated()), this, SLOT(slotClose()));
-
+
mb->insertItem(tr("File"),popup);
//EDIT ACTIONS
// Action for cutting text
- editCut = new QAction( tr( "Cut" ), Resource::loadPixmap( "cut" ), QString::null, CTRL+Key_X, this, 0 );
- editCut->addTo( bar );
+ editCut = new QToolButton( 0 );
+ editCut->setAutoRaise( true );
+ editCut->setIconSet( Resource::loadPixmap( "cut" ) );
// Action for Copying text
- editCopy = new QAction( tr( "Copy" ), Resource::loadPixmap( "copy" ), QString::null, CTRL+Key_C, this, 0 );
- editCopy->addTo( bar );
+ editCopy = new QToolButton( 0 );
+ editCopy->setAutoRaise( true );
+ editCopy->setIconSet( Resource::loadPixmap( "copy" ) );
// Action for pasting text
- editPaste = new QAction( tr( "Paste" ), Resource::loadPixmap( "paste" ), QString::null, CTRL+Key_V, this, 0 );
- editPaste->addTo( bar );
-
+ editPaste = new QToolButton( 0 );
+ editPaste->setAutoRaise( true );
+ editPaste->setIconSet( Resource::loadPixmap( "paste" ) );
// Action for finding / replacing text
- editFindReplace = new QAction( tr( "Replace" ), Resource::loadPixmap("find"), QString::null, CTRL+Key_R, this, 0 );
- editFind = new QAction( tr( "Find" ), Resource::loadPixmap("find"), QString::null, CTRL+Key_F, this, 0 );
- editFind->addTo( bar );
+ editFindReplace = new QToolButton( 0 );
+ editFindReplace->setAutoRaise( true );
+ editFindReplace->setIconSet( Resource::loadPixmap("find") );
- // Action for undo
- editUndo = new QAction( tr( "Undo" ), Resource::loadPixmap( "undo" ), QString::null, CTRL+Key_Z, this, 0 );
- editUndo->addTo( bar );
+ // Action for undo
+ editUndo = new QToolButton( 0 );
+ editUndo->setAutoRaise( true );
+ editUndo->setIconSet( Resource::loadPixmap( "undo" ) );
// Action for redo
- editRedo = new QAction( tr( "Redo" ), Resource::loadPixmap( "redo" ), QString::null, CTRL+SHIFT+Key_Z, this, 0 );
- editRedo->addTo( bar );
-
+ editRedo = new QToolButton( 0 );
+ editRedo->setAutoRaise( true );
+ editRedo->setIconSet( Resource::loadPixmap( "redo" ) );
//VIEW ACITONS
popup = new QPopupMenu( this );
-
- a = new QAction( tr( "Goto" ), QString::null, CTRL+Key_G, this, 0 );
- a->addTo( popup );
- connect(a, SIGNAL(activated()), this, SLOT(slotGoTo()));
-
+
viewIncFontSizes = new QAction( tr( "Font +" ), QString::null, 0, this, 0 );
viewIncFontSizes->addTo( popup );
viewDecFontSizes = new QAction( tr( "Font -" ), QString::null, 0, this, 0 );
viewDecFontSizes->addTo( popup );
- mb->insertItem(tr("View"),popup);
+ mb->insertItem(tr("View"),popup);
+ popup = new QPopupMenu( this );
+ mb->insertItem(tr("Utils"),popup);
- popup = new QPopupMenu( this );
- mb->insertItem(tr("Utils"),popup);
+ mb->insertItem( editCut );
+ mb->insertItem( editCopy );
+ mb->insertItem( editPaste );
+ mb->insertItem( editFindReplace );
+ mb->insertItem( editUndo );
+ mb->insertItem( editRedo );
+
//Highlight management
hlmenu=new QPopupMenu(this);
@@ -150,10 +149,6 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
utilSettings = new QAction( tr( "Settings" ), QString::null, 0, this, 0 );
utilSettings->addTo( popup);
- popup->insertSeparator();
- editFind->addTo(popup);
- editFindReplace->addTo(popup);
-
if( qApp->argc() > 1) open(qApp->argv()[1]);
else slotNew();
@@ -162,9 +157,13 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
TinyKate::~TinyKate( )
{
qWarning("TinyKate destructor\n");
- printf("~TinyKate()\n");
+
+ shutDown=true;
+ while (currentView!=0) {
+ slotClose();
+ }
+
if( KGlobal::config() != 0 ) {
- printf("~TinyKate(): delete configs...\n");
qWarning("deleting KateConfig object..\n");
delete KGlobal::config();
}
@@ -193,10 +192,9 @@ void TinyKate::open(const QString & filename)
viewCount++;
}
-void TinyKate::setDocument(const QString &doc)
+void TinyKate::setDocument(const QString& fileref)
{
- printf("tinykate: setDocument(\"%s\")\n",(const char*)doc);
- open(doc);
+ open( fileref );
}
void TinyKate::slotCurrentChanged( QWidget * view)
@@ -208,29 +206,24 @@ void TinyKate::slotCurrentChanged( QWidget * view)
disconnect(editPaste,SIGNAL(activated()),currentView,SLOT(paste()));
disconnect(editUndo,SIGNAL(activated()),currentView,SLOT(undo()));
disconnect(editRedo,SIGNAL(activated()),currentView,SLOT(redo()));
- disconnect(editFindReplace,SIGNAL(activated()),currentView,SLOT(replace()));
- disconnect(editFind,SIGNAL(activated()),currentView,SLOT(find()));
- disconnect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes()));
- disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes()));
+ disconnect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes()));
+ disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes()));
disconnect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int)));
disconnect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog()));
- disconnect(currentView,SIGNAL(newCurPos()),this,SLOT(slotCursorMoved()));
}
currentView=(KTextEditor::View*)view;
-
- connect(editCopy,SIGNAL(activated()),currentView,SLOT(copy()));
- connect(editCut,SIGNAL(activated()),currentView,SLOT(cut()));
- connect(editPaste,SIGNAL(activated()),currentView,SLOT(paste()));
- connect(editUndo,SIGNAL(activated()),currentView,SLOT(undo()));
- connect(editRedo,SIGNAL(activated()),currentView,SLOT(redo()));
- connect(editFindReplace,SIGNAL(activated()),currentView,SLOT(replace()));
- connect(editFind,SIGNAL(activated()),currentView,SLOT(find()));
+
+ connect(editCopy,SIGNAL(clicked()),currentView,SLOT(copy()));
+ connect(editCut,SIGNAL(clicked()),currentView,SLOT(cut()));
+ connect(editPaste,SIGNAL(clicked()),currentView,SLOT(paste()));
+ connect(editUndo,SIGNAL(clicked()),currentView,SLOT(undo()));
+ connect(editRedo,SIGNAL(clicked()),currentView,SLOT(redo()));
connect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes()));
connect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes()));
connect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int)));
connect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog()));
- connect(currentView,SIGNAL(newCurPos()),this,SLOT(slotCursorMoved()));
+
}
void TinyKate::slotNew( )
@@ -251,7 +244,7 @@ void TinyKate::slotClose( )
tabwidget->removePage(dv);
delete dv->document();
viewCount--;
- if (!viewCount) slotNew();
+ if ((!viewCount) && (!shutDown)) slotNew();
}
void TinyKate::slotSave() {
@@ -288,34 +281,3 @@ void TinyKate::slotSaveAs() {
}
}
-
-void TinyKate::slotGoTo()
-{
- int l,c;
- if (currentView==0) return;
-
- currentView->getCursorPosition(&l,&c);
-
- CGotoLine g(l);
-
- if(g.exec()==QDialog::Accepted)
- {
- currentView->setCursorPosition( g.line(), c );
- }
-}
-
-void TinyKate::slotCursorMoved()
-{
- char buf[100];
- int newLine,newCol;
- currentView->getCursorPosition(&newLine,&newCol);
- newLine++;
- newCol++;
- if((newLine!=curLine)||(newCol!=curCol))
- {
- sprintf(buf,"TinyKATE : line %-6d col %d",newLine,newCol);
- setCaption(buf);
- curLine=newLine;
- curCol=newCol;
- }
-}
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
@@ -23,9 +23,9 @@
#include <opie/otabwidget.h>
#include <ktexteditor.h>
+class QToolButton;
class QAction;
class QPopupMenu;
-class CGotoLine;
class TinyKate : public QMainWindow
{
@@ -36,6 +36,7 @@ public:
public slots:
void slotNew();
+ void setDocument(const QString& fileref);
protected slots:
void slotOpen();
@@ -43,32 +44,20 @@ protected slots:
void slotCurrentChanged(QWidget *);
void slotSave();
void slotSaveAs();
- void slotGoTo();
- void slotCursorMoved();
- void setDocument(const QString &doc);
-
protected:
void open(const QString&);
private:
QString currentFileName;
OTabWidget *tabwidget;
KTextEditor::View *currentView;
-
- QAction *editCopy;
- QAction *editCut;
- QAction *editPaste;
- QAction *editUndo;
- QAction *editRedo;
- QAction *editFind;
- QAction *editFindReplace;
- QAction *viewIncFontSizes;
- QAction *viewDecFontSizes;
- QAction *utilSettings;
-
+ bool shutDown;
+
+ QToolButton *editCopy, *editCut, *editPaste, *editUndo, *editRedo, *editFindReplace;
+ QAction *viewIncFontSizes, *viewDecFontSizes, *utilSettings;
+
QPopupMenu *hlmenu;
uint nextUnnamed;
uint viewCount;
- int curLine,curCol;
};
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,21 +1,21 @@
-TEMPLATE = app
-CONFIG = qt warn_on release
-DESTDIR = $(OPIEDIR)/bin
-HEADERS = tinykate.h cgotoline.h
-SOURCES = tinykate.cpp main.cpp cgotoline.cpp
-INTERFACES = cgotobase.ui
-INCLUDEPATH += $(OPIEDIR)/include \
- $(OPIEDIR)/noncore/apps/tinykate/libkate \
- $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \
+TEMPLATE = app
+CONFIG = qt warn_on release
+DESTDIR = $(OPIEDIR)/bin
+HEADERS = tinykate.h
+SOURCES = tinykate.cpp main.cpp
+INTERFACES =
+INCLUDEPATH += $(OPIEDIR)/include \
+ $(OPIEDIR)/noncore/apps/tinykate/libkate \
+ $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \
$(OPIEDIR)/noncore/apps/tinykate/libkate/document \
$(OPIEDIR)/noncore/apps/tinykate/libkate/view \
$(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \
$(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \
$(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back
-DEPENDPATH += $(OPIEDIR)/include
+DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -ltinykate -lopie
-TARGET = tinykate
+TARGET = tinykate