author | drw <drw> | 2004-02-23 18:12:57 (UTC) |
---|---|---|
committer | drw <drw> | 2004-02-23 18:12:57 (UTC) |
commit | 398c7d54acfc203ec90644d6c63e5b200391e906 (patch) (unidiff) | |
tree | 84a1f495a5a2450f7eb2f401037b6fd81162d72b | |
parent | f5762a3bee0ca4a176048f6552acaea2af827914 (diff) | |
download | opie-398c7d54acfc203ec90644d6c63e5b200391e906.zip opie-398c7d54acfc203ec90644d6c63e5b200391e906.tar.gz opie-398c7d54acfc203ec90644d6c63e5b200391e906.tar.bz2 |
TinyKate: libopie->libopie2
-rw-r--r-- | noncore/apps/tinykate/config.in | 2 | ||||
-rw-r--r-- | noncore/apps/tinykate/libkate/config.in | 2 | ||||
-rw-r--r-- | noncore/apps/tinykate/libkate/document/katesyntaxdocument.h | 6 | ||||
-rw-r--r-- | noncore/apps/tinykate/libkate/libkate.pro | 98 | ||||
-rw-r--r-- | noncore/apps/tinykate/libkate/microkde/kcolorbtn.cpp | 9 | ||||
-rw-r--r-- | noncore/apps/tinykate/libkate/view/kateviewdialog.cpp | 8 | ||||
-rw-r--r-- | noncore/apps/tinykate/main.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/tinykate/opie-tinykate.control | 2 | ||||
-rw-r--r-- | noncore/apps/tinykate/tinykate.cpp | 8 | ||||
-rw-r--r-- | noncore/apps/tinykate/tinykate.h | 2 | ||||
-rw-r--r-- | noncore/apps/tinykate/tinykate.pro | 24 |
11 files changed, 83 insertions, 84 deletions
diff --git a/noncore/apps/tinykate/config.in b/noncore/apps/tinykate/config.in index 39aedcf..2efc13e 100644 --- a/noncore/apps/tinykate/config.in +++ b/noncore/apps/tinykate/config.in | |||
@@ -1,6 +1,6 @@ | |||
1 | config TINYKATE | 1 | config TINYKATE |
2 | boolean "opie-tinykate (programmers editor Kate from KDE)" | 2 | boolean "opie-tinykate (programmers editor Kate from KDE)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && LIBKATE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI && LIBKATE |
5 | 5 | ||
6 | source "noncore/apps/tinykate/libkate/config.in" | 6 | source "noncore/apps/tinykate/libkate/config.in" |
diff --git a/noncore/apps/tinykate/libkate/config.in b/noncore/apps/tinykate/libkate/config.in index 47d7ef5..2e7e62c 100644 --- a/noncore/apps/tinykate/libkate/config.in +++ b/noncore/apps/tinykate/libkate/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config LIBKATE | 1 | config LIBKATE |
2 | boolean "libkate" | 2 | boolean "libkate" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBQTAUX && LIBOPIE2CORE && LIBOPIE2UI |
diff --git a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.h b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.h index 5c5c5a4..5eefc77 100644 --- a/noncore/apps/tinykate/libkate/document/katesyntaxdocument.h +++ b/noncore/apps/tinykate/libkate/document/katesyntaxdocument.h | |||
@@ -1,73 +1,73 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | katesyntaxdocument.h - description | 2 | katesyntaxdocument.h - description |
3 | ------------------- | 3 | ------------------- |
4 | begin : Sat 31 March 2001 | 4 | begin : Sat 31 March 2001 |
5 | copyright : (C) 2001,2002 by Joseph Wenninger | 5 | copyright : (C) 2001,2002 by Joseph Wenninger |
6 | email : jowenn@kde.org | 6 | email : jowenn@kde.org |
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | 17 | ||
18 | #ifndef SYNTAXDOCUMENT_H | 18 | #ifndef SYNTAXDOCUMENT_H |
19 | #define SYNTAXDOCUMENT_H | 19 | #define SYNTAXDOCUMENT_H |
20 | 20 | ||
21 | #include <opie/xmltree.h> | 21 | #include <opie2/xmltree.h> |
22 | #include <qlist.h> | 22 | #include <qlist.h> |
23 | #include <qstringlist.h> | 23 | #include <qstringlist.h> |
24 | 24 | ||
25 | 25 | ||
26 | class syntaxModeListItem | 26 | class syntaxModeListItem |
27 | { | 27 | { |
28 | public: | 28 | public: |
29 | QString name; | 29 | QString name; |
30 | QString section; | 30 | QString section; |
31 | QString mimetype; | 31 | QString mimetype; |
32 | QString extension; | 32 | QString extension; |
33 | QString identifier; | 33 | QString identifier; |
34 | }; | 34 | }; |
35 | 35 | ||
36 | class syntaxContextData | 36 | class syntaxContextData |
37 | { | 37 | { |
38 | public: | 38 | public: |
39 | Opie::XMLElement *parent; | 39 | Opie::XMLElement *parent; |
40 | Opie::XMLElement *currentGroup; | 40 | Opie::XMLElement *currentGroup; |
41 | Opie::XMLElement *item; | 41 | Opie::XMLElement *item; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | typedef QList<syntaxModeListItem> SyntaxModeList; | 44 | typedef QList<syntaxModeListItem> SyntaxModeList; |
45 | 45 | ||
46 | class SyntaxDocument | 46 | class SyntaxDocument |
47 | { | 47 | { |
48 | public: | 48 | public: |
49 | SyntaxDocument(); | 49 | SyntaxDocument(); |
50 | ~SyntaxDocument(); | 50 | ~SyntaxDocument(); |
51 | 51 | ||
52 | QStringList& finddata(const QString& mainGroup,const QString& type,bool clearList=true); | 52 | QStringList& finddata(const QString& mainGroup,const QString& type,bool clearList=true); |
53 | SyntaxModeList modeList(); | 53 | SyntaxModeList modeList(); |
54 | 54 | ||
55 | syntaxContextData* getGroupInfo(const QString& langName, const QString &group); | 55 | syntaxContextData* getGroupInfo(const QString& langName, const QString &group); |
56 | void freeGroupInfo(syntaxContextData* data); | 56 | void freeGroupInfo(syntaxContextData* data); |
57 | syntaxContextData* getConfig(const QString& mainGroupName, const QString &Config); | 57 | syntaxContextData* getConfig(const QString& mainGroupName, const QString &Config); |
58 | bool nextItem(syntaxContextData* data); | 58 | bool nextItem(syntaxContextData* data); |
59 | bool nextGroup(syntaxContextData* data); | 59 | bool nextGroup(syntaxContextData* data); |
60 | syntaxContextData* getSubItems(syntaxContextData* data); | 60 | syntaxContextData* getSubItems(syntaxContextData* data); |
61 | QString groupItemData(syntaxContextData* data,QString name); | 61 | QString groupItemData(syntaxContextData* data,QString name); |
62 | QString groupData(syntaxContextData* data,QString name); | 62 | QString groupData(syntaxContextData* data,QString name); |
63 | void setIdentifier(const QString& identifier); | 63 | void setIdentifier(const QString& identifier); |
64 | 64 | ||
65 | private: | 65 | private: |
66 | Opie::XMLElement *m_root; | 66 | Opie::XMLElement *m_root; |
67 | void setupModeList(bool force=false); | 67 | void setupModeList(bool force=false); |
68 | QString currentFile; | 68 | QString currentFile; |
69 | SyntaxModeList myModeList; | 69 | SyntaxModeList myModeList; |
70 | QStringList m_data; | 70 | QStringList m_data; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | #endif | 73 | #endif |
diff --git a/noncore/apps/tinykate/libkate/libkate.pro b/noncore/apps/tinykate/libkate/libkate.pro index 7266b18..f1b8063 100644 --- a/noncore/apps/tinykate/libkate/libkate.pro +++ b/noncore/apps/tinykate/libkate/libkate.pro | |||
@@ -1,90 +1,90 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE = lib |
2 | CONFIG = qt warn_on release | 2 | CONFIG = qt warn_on release |
3 | HEADERS = microkde/kapplication.h \ | 3 | HEADERS = microkde/kapplication.h \ |
4 | kateconfig.h \ | 4 | kateconfig.h \ |
5 | microkde/kdebug.h \ | 5 | microkde/kdebug.h \ |
6 | microkde/kdialog.h \ | 6 | microkde/kdialog.h \ |
7 | microkde/kdialogbase.h \ | 7 | microkde/kdialogbase.h \ |
8 | microkde/kfiledialog.h \ | 8 | microkde/kfiledialog.h \ |
9 | microkde/kglobal.h \ | 9 | microkde/kglobal.h \ |
10 | microkde/kiconloader.h \ | 10 | microkde/kiconloader.h \ |
11 | microkde/klineedit.h \ | 11 | microkde/klineedit.h \ |
12 | microkde/klocale.h \ | 12 | microkde/klocale.h \ |
13 | microkde/kmessagebox.h \ | 13 | microkde/kmessagebox.h \ |
14 | microkde/kprinter.h \ | 14 | microkde/kprinter.h \ |
15 | microkde/krestrictedline.h \ | 15 | microkde/krestrictedline.h \ |
16 | microkde/kseparator.h \ | 16 | microkde/kseparator.h \ |
17 | microkde/kstandarddirs.h \ | 17 | microkde/kstandarddirs.h \ |
18 | microkde/ktempfile.h \ | 18 | microkde/ktempfile.h \ |
19 | microkde/kunload.h \ | 19 | microkde/kunload.h \ |
20 | microkde/kurlrequester.h \ | 20 | microkde/kurlrequester.h \ |
21 | microkde/kfontdialog.h \ | 21 | microkde/kfontdialog.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 | \ | 28 | \ |
29 | \ | 29 | \ |
30 | qt3back/qregexp3.h \ | 30 | qt3back/qregexp3.h \ |
31 | microkde/ksharedptr.h \ | 31 | microkde/ksharedptr.h \ |
32 | document/katebuffer.h document/katedialogs.h \ | 32 | document/katebuffer.h document/katedialogs.h \ |
33 | document/katetextline.h \ | 33 | document/katetextline.h \ |
34 | document/katecmd.h \ | 34 | document/katecmd.h \ |
35 | document/katehighlight.h \ | 35 | document/katehighlight.h \ |
36 | document/katecmds.h document/katedocument.h \ | 36 | document/katecmds.h document/katedocument.h \ |
37 | document/katesyntaxdocument.h \ | 37 | document/katesyntaxdocument.h \ |
38 | view/kateundohistory.h \ | 38 | view/kateundohistory.h \ |
39 | view/kateview.h \ | 39 | view/kateview.h \ |
40 | view/kateviewdialog.h \ | 40 | view/kateviewdialog.h \ |
41 | interfaces/view.h \ | 41 | interfaces/view.h \ |
42 | interfaces/document.h \ | 42 | interfaces/document.h \ |
43 | ktexteditor/ktexteditor.h | 43 | ktexteditor/ktexteditor.h |
44 | 44 | ||
45 | SOURCES = microkde/kapplication.cpp \ | 45 | SOURCES = microkde/kapplication.cpp \ |
46 | microkde/kdialogbase.cpp \ | 46 | microkde/kdialogbase.cpp \ |
47 | kateconfig.cpp \ | 47 | kateconfig.cpp \ |
48 | microkde/klocale.cpp \ | 48 | microkde/klocale.cpp \ |
49 | microkde/kmessagebox.cpp \ | 49 | microkde/kmessagebox.cpp \ |
50 | microkde/kprocess.cpp \ | 50 | microkde/kprocess.cpp \ |
51 | microkde/kstandarddirs.cpp \ | 51 | microkde/kstandarddirs.cpp \ |
52 | microkde/ktempfile.cpp \ | 52 | microkde/ktempfile.cpp \ |
53 | microkde/kurlrequester.cpp \ | 53 | microkde/kurlrequester.cpp \ |
54 | microkde/kfontdialog.cpp \ | 54 | microkde/kfontdialog.cpp \ |
55 | microkde/krun.cpp \ | 55 | microkde/krun.cpp \ |
56 | microkde/knumvalidator.cpp \ | 56 | microkde/knumvalidator.cpp \ |
57 | microkde/kglobal.cpp \ | 57 | microkde/kglobal.cpp \ |
58 | microkde/kglobalsettings.cpp \ | 58 | microkde/kglobalsettings.cpp \ |
59 | microkde/kcolorbtn.cpp \ | 59 | microkde/kcolorbtn.cpp \ |
60 | \ | 60 | \ |
61 | \ | 61 | \ |
62 | qt3back/qregexp3.cpp \ | 62 | qt3back/qregexp3.cpp \ |
63 | ktexteditor/ktexteditor.cpp \ | 63 | ktexteditor/ktexteditor.cpp \ |
64 | document/katebuffer.cpp document/katedialogs.cpp \ | 64 | document/katebuffer.cpp document/katedialogs.cpp \ |
65 | document/katehighlight.cpp \ | 65 | document/katehighlight.cpp \ |
66 | document/katecmd.cpp \ | 66 | document/katecmd.cpp \ |
67 | document/katesyntaxdocument.cpp document/katecmds.cpp \ | 67 | document/katesyntaxdocument.cpp document/katecmds.cpp \ |
68 | document/katedocument.cpp document/katetextline.cpp \ | 68 | document/katedocument.cpp document/katetextline.cpp \ |
69 | view/kateundohistory.cpp \ | 69 | view/kateundohistory.cpp \ |
70 | view/kateview.cpp \ | 70 | view/kateview.cpp \ |
71 | view/kateviewdialog.cpp \ | 71 | view/kateviewdialog.cpp \ |
72 | interfaces/interfaces.cpp | 72 | interfaces/interfaces.cpp |
73 | 73 | ||
74 | INTERFACES= | 74 | INTERFACES = |
75 | INCLUDEPATH+= $(OPIEDIR)/include \ | 75 | INCLUDEPATH += $(OPIEDIR)/include \ |
76 | $(OPIEDIR)/noncore/apps/tinykate/libkate \ | 76 | $(OPIEDIR)/noncore/apps/tinykate/libkate \ |
77 | $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \ | 77 | $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \ |
78 | $(OPIEDIR)/noncore/apps/tinykate/libkate/document \ | 78 | $(OPIEDIR)/noncore/apps/tinykate/libkate/document \ |
79 | $(OPIEDIR)/noncore/apps/tinykate/libkate/view \ | 79 | $(OPIEDIR)/noncore/apps/tinykate/libkate/view \ |
80 | $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \ | 80 | $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \ |
81 | $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \ | 81 | $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \ |
82 | $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back | 82 | $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back |
83 | DEPENDPATH+= $(OPIEDIR)/include | 83 | DEPENDPATH += $(OPIEDIR)/include |
84 | LIBS += -lqpe -lopie | 84 | LIBS += -lqpe -lqtaux2 -lopiecore2 -lopieui2 |
85 | TARGET = tinykate | 85 | TARGET = tinykate |
86 | 86 | ||
87 | INCLUDEPATH += $(OPIEDIR)/include | 87 | INCLUDEPATH += $(OPIEDIR)/include |
88 | DESTDIR = $(OPIEDIR)/lib$(PROJMAK) | 88 | DESTDIR = $(OPIEDIR)/lib$(PROJMAK) |
89 | 89 | ||
90 | include ( $(OPIEDIR)/include.pro ) | 90 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/apps/tinykate/libkate/microkde/kcolorbtn.cpp b/noncore/apps/tinykate/libkate/microkde/kcolorbtn.cpp index 7be5af5..1320cbc 100644 --- a/noncore/apps/tinykate/libkate/microkde/kcolorbtn.cpp +++ b/noncore/apps/tinykate/libkate/microkde/kcolorbtn.cpp | |||
@@ -1,85 +1,84 @@ | |||
1 | /* This file is part of the KDE libraries | 1 | /* This file is part of the KDE libraries |
2 | Copyright (C) 1997 Martin Jones (mjones@kde.org) | 2 | Copyright (C) 1997 Martin Jones (mjones@kde.org) |
3 | Copyright (C) 1999 Cristian Tibirna (ctibirna@kde.org) | 3 | Copyright (C) 1999 Cristian Tibirna (ctibirna@kde.org) |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
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" | ||
27 | #include "kcolorbtn.h" | 26 | #include "kcolorbtn.h" |
28 | 27 | ||
29 | #include <opie/colordialog.h> | 28 | #include <opie2/qcolordialog.h> |
30 | 29 | ||
31 | KColorButton::KColorButton( QWidget *parent, const char *name ) | 30 | KColorButton::KColorButton( QWidget *parent, const char *name ) |
32 | : QPushButton( parent, name ), dragFlag(false) | 31 | : QPushButton( parent, name ), dragFlag(false) |
33 | { | 32 | { |
34 | // 2000-10-15 (putzer): fixes broken keyboard usage | 33 | // 2000-10-15 (putzer): fixes broken keyboard usage |
35 | connect (this, SIGNAL(clicked()), this, SLOT(chooseColor())); | 34 | connect (this, SIGNAL(clicked()), this, SLOT(chooseColor())); |
36 | } | 35 | } |
37 | 36 | ||
38 | KColorButton::KColorButton( const QColor &c, QWidget *parent, | 37 | KColorButton::KColorButton( const QColor &c, QWidget *parent, |
39 | const char *name ) | 38 | const char *name ) |
40 | : QPushButton( parent, name ), col(c), dragFlag(false) | 39 | : QPushButton( parent, name ), col(c), dragFlag(false) |
41 | { | 40 | { |
42 | 41 | ||
43 | // 2000-10-15 (putzer): fixes broken keyboard usage | 42 | // 2000-10-15 (putzer): fixes broken keyboard usage |
44 | connect (this, SIGNAL(clicked()), this, SLOT(chooseColor())); | 43 | connect (this, SIGNAL(clicked()), this, SLOT(chooseColor())); |
45 | } | 44 | } |
46 | 45 | ||
47 | void KColorButton::setColor( const QColor &c ) | 46 | void KColorButton::setColor( const QColor &c ) |
48 | { | 47 | { |
49 | col = c; | 48 | col = c; |
50 | repaint( false ); | 49 | repaint( false ); |
51 | } | 50 | } |
52 | 51 | ||
53 | void KColorButton::drawButtonLabel( QPainter *painter ) | 52 | void KColorButton::drawButtonLabel( QPainter *painter ) |
54 | { | 53 | { |
55 | QRect r = QApplication::style().buttonRect( 0, 0, width(), height() ); | 54 | QRect r = QApplication::style().buttonRect( 0, 0, width(), height() ); |
56 | int l = r.x(); | 55 | int l = r.x(); |
57 | int t = r.y(); | 56 | int t = r.y(); |
58 | int w = r.width(); | 57 | int w = r.width(); |
59 | int h = r.height(); | 58 | int h = r.height(); |
60 | int b = 5; | 59 | int b = 5; |
61 | 60 | ||
62 | QColor lnCol = colorGroup().text(); | 61 | QColor lnCol = colorGroup().text(); |
63 | QColor fillCol = isEnabled() ? col : backgroundColor(); | 62 | QColor fillCol = isEnabled() ? col : backgroundColor(); |
64 | 63 | ||
65 | if ( isDown() ) { | 64 | if ( isDown() ) { |
66 | qDrawPlainRect( painter, l+b+1, t+b+1, w-b*2, h-b*2, lnCol, 1, 0 ); | 65 | qDrawPlainRect( painter, l+b+1, t+b+1, w-b*2, h-b*2, lnCol, 1, 0 ); |
67 | b++; | 66 | b++; |
68 | painter->fillRect( l+b+1, t+b+1, w-b*2, h-b*2, fillCol ); | 67 | painter->fillRect( l+b+1, t+b+1, w-b*2, h-b*2, fillCol ); |
69 | } else { | 68 | } else { |
70 | qDrawPlainRect( painter, l+b, t+b, w-b*2, h-b*2, lnCol, 1, 0 ); | 69 | qDrawPlainRect( painter, l+b, t+b, w-b*2, h-b*2, lnCol, 1, 0 ); |
71 | b++; | 70 | b++; |
72 | painter->fillRect( l+b, t+b, w-b*2, h-b*2, fillCol ); | 71 | painter->fillRect( l+b, t+b, w-b*2, h-b*2, fillCol ); |
73 | } | 72 | } |
74 | } | 73 | } |
75 | 74 | ||
76 | void KColorButton::chooseColor() | 75 | void KColorButton::chooseColor() |
77 | { | 76 | { |
78 | QColor newCol=OColorDialog::getColor( col); | 77 | QColor newCol=QColorDialog::getColor( col); |
79 | if( newCol != QDialog::Rejected ) | 78 | if( newCol != QDialog::Rejected ) |
80 | { | 79 | { |
81 | col=newCol; | 80 | col=newCol; |
82 | repaint( false ); | 81 | repaint( false ); |
83 | emit changed( col ); | 82 | emit changed( col ); |
84 | } | 83 | } |
85 | } | 84 | } |
diff --git a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp index 6a19e01..4cb13e8 100644 --- a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp +++ b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp | |||
@@ -1,573 +1,573 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | kateviewdialog.cpp - description | 2 | kateviewdialog.cpp - description |
3 | ------------------- | 3 | ------------------- |
4 | copyright : (C) 2001 by The Kate Team | 4 | copyright : (C) 2001 by The Kate Team |
5 | (C) 2002 by Joseph Wenninger | 5 | (C) 2002 by Joseph Wenninger |
6 | email : kwrite-devel@kde.org | 6 | email : kwrite-devel@kde.org |
7 | jowenn@kde.org | 7 | jowenn@kde.org |
8 | 8 | ||
9 | ***************************************************************************/ | 9 | ***************************************************************************/ |
10 | 10 | ||
11 | /*************************************************************************** | 11 | /*************************************************************************** |
12 | * * | 12 | * * |
13 | * This program is free software; you can redistribute it and/or modify * | 13 | * This program is free software; you can redistribute it and/or modify * |
14 | * it under the terms of the GNU General Public License as published by * | 14 | * it under the terms of the GNU General Public License as published by * |
15 | * the Free Software Foundation; either version 2 of the License, or * | 15 | * the Free Software Foundation; either version 2 of the License, or * |
16 | * (at your option) any later version. * | 16 | * (at your option) any later version. * |
17 | * * | 17 | * * |
18 | ***************************************************************************/ | 18 | ***************************************************************************/ |
19 | // Dialogs | 19 | // Dialogs |
20 | 20 | ||
21 | #include <stdio.h> | 21 | #include <stdio.h> |
22 | #include <stdlib.h> | 22 | #include <stdlib.h> |
23 | 23 | ||
24 | #include <qgrid.h> | 24 | #include <qgrid.h> |
25 | #include <qlabel.h> | 25 | #include <qlabel.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qlistbox.h> | 27 | #include <qlistbox.h> |
28 | #include <qspinbox.h> | 28 | #include <qspinbox.h> |
29 | #include <qcombobox.h> | 29 | #include <qcombobox.h> |
30 | #include <qgroupbox.h> | 30 | #include <qgroupbox.h> |
31 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
32 | #include <qcheckbox.h> | 32 | #include <qcheckbox.h> |
33 | #include <qcollection.h> | 33 | #include <qcollection.h> |
34 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
35 | #include <qobjectlist.h> | 35 | #include <qobjectlist.h> |
36 | #include <qradiobutton.h> | 36 | #include <qradiobutton.h> |
37 | #include <qwhatsthis.h> | 37 | #include <qwhatsthis.h> |
38 | #include <qstringlist.h> | 38 | #include <qstringlist.h> |
39 | #include <klocale.h> | 39 | #include <klocale.h> |
40 | #include <kcolorbtn.h> | 40 | #include <kcolorbtn.h> |
41 | #include <qcombobox.h> | 41 | #include <qcombobox.h> |
42 | #include <kglobal.h> | 42 | #include <kglobal.h> |
43 | #include <qvbox.h> | 43 | #include <qvbox.h> |
44 | #include <qspinbox.h> | 44 | #include <qspinbox.h> |
45 | #include <kfontdialog.h> | 45 | #include <kfontdialog.h> |
46 | 46 | ||
47 | #include "../document/katedocument.h" | 47 | #include "../document/katedocument.h" |
48 | #include "kateviewdialog.h" | 48 | #include "kateviewdialog.h" |
49 | #include <opie/ofontselector.h> | 49 | #include <opie2/ofontselector.h> |
50 | 50 | ||
51 | 51 | ||
52 | SearchDialog::SearchDialog( QWidget *parent, QStringList &searchFor, QStringList &replaceWith, int flags ) | 52 | SearchDialog::SearchDialog( QWidget *parent, QStringList &searchFor, QStringList &replaceWith, int flags ) |
53 | : KDialogBase( parent, 0L, true, i18n( "Find Text" ), Ok | Cancel, Ok ) | 53 | : KDialogBase( parent, 0L, true, i18n( "Find Text" ), Ok | Cancel, Ok ) |
54 | , m_replace( 0L ) | 54 | , m_replace( 0L ) |
55 | { | 55 | { |
56 | QWidget *page = new QWidget( this ); | 56 | QWidget *page = new QWidget( this ); |
57 | setMainWidget( page ); | 57 | setMainWidget( page ); |
58 | 58 | ||
59 | QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); | 59 | QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); |
60 | 60 | ||
61 | m_search = new QComboBox( true, page ); | 61 | m_search = new QComboBox( true, page ); |
62 | m_search->insertStringList( searchFor ); | 62 | m_search->insertStringList( searchFor ); |
63 | m_search->setMinimumWidth( m_search->sizeHint().width() ); | 63 | m_search->setMinimumWidth( m_search->sizeHint().width() ); |
64 | m_search->lineEdit()->selectAll(); | 64 | m_search->lineEdit()->selectAll(); |
65 | QLabel *label = new QLabel( m_search, i18n( "&Text To Find:" ), page ); | 65 | QLabel *label = new QLabel( m_search, i18n( "&Text To Find:" ), page ); |
66 | m_optRegExp = new QCheckBox( i18n( "Regular Expression" ), page ); | 66 | m_optRegExp = new QCheckBox( i18n( "Regular Expression" ), page ); |
67 | topLayout->addWidget( label ); | 67 | topLayout->addWidget( label ); |
68 | topLayout->addWidget( m_search ); | 68 | topLayout->addWidget( m_search ); |
69 | topLayout->addWidget( m_optRegExp ); | 69 | topLayout->addWidget( m_optRegExp ); |
70 | 70 | ||
71 | if( flags & KateView::sfReplace ) | 71 | if( flags & KateView::sfReplace ) |
72 | { | 72 | { |
73 | // make it a replace dialog | 73 | // make it a replace dialog |
74 | setCaption( i18n( "Replace Text" ) ); | 74 | setCaption( i18n( "Replace Text" ) ); |
75 | m_replace = new QComboBox( true, page ); | 75 | m_replace = new QComboBox( true, page ); |
76 | m_replace->insertStringList( replaceWith ); | 76 | m_replace->insertStringList( replaceWith ); |
77 | m_replace->setMinimumWidth( m_search->sizeHint().width() ); | 77 | m_replace->setMinimumWidth( m_search->sizeHint().width() ); |
78 | label = new QLabel( m_replace, i18n( "&Replace With:" ), page ); | 78 | label = new QLabel( m_replace, i18n( "&Replace With:" ), page ); |
79 | //m_optPlaceholders = new QCheckBox( i18n( "&Use Placeholders" ), page ); | 79 | //m_optPlaceholders = new QCheckBox( i18n( "&Use Placeholders" ), page ); |
80 | topLayout->addWidget( label ); | 80 | topLayout->addWidget( label ); |
81 | topLayout->addWidget( m_replace ); | 81 | topLayout->addWidget( m_replace ); |
82 | //topLayout->addWidget( m_optPlaceholders ); | 82 | //topLayout->addWidget( m_optPlaceholders ); |
83 | } | 83 | } |
84 | 84 | ||
85 | QGroupBox *group = new QGroupBox( i18n( "Options" ), page ); | 85 | QGroupBox *group = new QGroupBox( i18n( "Options" ), page ); |
86 | topLayout->addWidget( group, 10 ); | 86 | topLayout->addWidget( group, 10 ); |
87 | 87 | ||
88 | QGridLayout *gbox = new QGridLayout( group, 5, 2, spacingHint() ); | 88 | QGridLayout *gbox = new QGridLayout( group, 5, 2, spacingHint() ); |
89 | gbox->addRowSpacing( 0, fontMetrics().lineSpacing() ); | 89 | gbox->addRowSpacing( 0, fontMetrics().lineSpacing() ); |
90 | gbox->setRowStretch( 4, 10 ); | 90 | gbox->setRowStretch( 4, 10 ); |
91 | 91 | ||
92 | m_opt1 = new QCheckBox( i18n( "C&ase Sensitive" ), group ); | 92 | m_opt1 = new QCheckBox( i18n( "C&ase Sensitive" ), group ); |
93 | gbox->addWidget( m_opt1, 1, 0 ); | 93 | gbox->addWidget( m_opt1, 1, 0 ); |
94 | 94 | ||
95 | m_opt2 = new QCheckBox(i18n("&Whole Words Only" ), group ); | 95 | m_opt2 = new QCheckBox(i18n("&Whole Words Only" ), group ); |
96 | gbox->addWidget( m_opt2, 2, 0 ); | 96 | gbox->addWidget( m_opt2, 2, 0 ); |
97 | 97 | ||
98 | m_opt3 = new QCheckBox(i18n("&From Beginning" ), group ); | 98 | m_opt3 = new QCheckBox(i18n("&From Beginning" ), group ); |
99 | gbox->addWidget( m_opt3, 3, 0 ); | 99 | gbox->addWidget( m_opt3, 3, 0 ); |
100 | 100 | ||
101 | m_opt4 = new QCheckBox(i18n("Find &Backwards" ), group ); | 101 | m_opt4 = new QCheckBox(i18n("Find &Backwards" ), group ); |
102 | gbox->addWidget( m_opt4, 1, 1 ); | 102 | gbox->addWidget( m_opt4, 1, 1 ); |
103 | 103 | ||
104 | m_opt5 = new QCheckBox(i18n("&Selected Text" ), group ); | 104 | m_opt5 = new QCheckBox(i18n("&Selected Text" ), group ); |
105 | gbox->addWidget( m_opt5, 2, 1 ); | 105 | gbox->addWidget( m_opt5, 2, 1 ); |
106 | 106 | ||
107 | m_opt1->setChecked( flags & KateView::sfCaseSensitive ); | 107 | m_opt1->setChecked( flags & KateView::sfCaseSensitive ); |
108 | m_opt2->setChecked( flags & KateView::sfWholeWords ); | 108 | m_opt2->setChecked( flags & KateView::sfWholeWords ); |
109 | m_opt3->setChecked( flags & KateView::sfFromBeginning ); | 109 | m_opt3->setChecked( flags & KateView::sfFromBeginning ); |
110 | m_optRegExp->setChecked( flags & KateView::sfRegularExpression ); | 110 | m_optRegExp->setChecked( flags & KateView::sfRegularExpression ); |
111 | m_opt4->setChecked( flags & KateView::sfBackward ); | 111 | m_opt4->setChecked( flags & KateView::sfBackward ); |
112 | m_opt5->setChecked( flags & KateView::sfSelected ); | 112 | m_opt5->setChecked( flags & KateView::sfSelected ); |
113 | 113 | ||
114 | if( m_replace ) | 114 | if( m_replace ) |
115 | { | 115 | { |
116 | m_opt6 = new QCheckBox( i18n( "&Prompt On Replace" ), group ); | 116 | m_opt6 = new QCheckBox( i18n( "&Prompt On Replace" ), group ); |
117 | m_opt6->setChecked( flags & KateView::sfPrompt ); | 117 | m_opt6->setChecked( flags & KateView::sfPrompt ); |
118 | gbox->addWidget( m_opt6, 3, 1 ); | 118 | gbox->addWidget( m_opt6, 3, 1 ); |
119 | } | 119 | } |
120 | 120 | ||
121 | m_search->setFocus(); | 121 | m_search->setFocus(); |
122 | } | 122 | } |
123 | 123 | ||
124 | QString SearchDialog::getSearchFor() | 124 | QString SearchDialog::getSearchFor() |
125 | { | 125 | { |
126 | return m_search->currentText(); | 126 | return m_search->currentText(); |
127 | } | 127 | } |
128 | 128 | ||
129 | QString SearchDialog::getReplaceWith() | 129 | QString SearchDialog::getReplaceWith() |
130 | { | 130 | { |
131 | return m_replace->currentText(); | 131 | return m_replace->currentText(); |
132 | } | 132 | } |
133 | 133 | ||
134 | int SearchDialog::getFlags() | 134 | int SearchDialog::getFlags() |
135 | { | 135 | { |
136 | int flags = 0; | 136 | int flags = 0; |
137 | 137 | ||
138 | if( m_opt1->isChecked() ) flags |= KateView::sfCaseSensitive; | 138 | if( m_opt1->isChecked() ) flags |= KateView::sfCaseSensitive; |
139 | if( m_opt2->isChecked() ) flags |= KateView::sfWholeWords; | 139 | if( m_opt2->isChecked() ) flags |= KateView::sfWholeWords; |
140 | if( m_opt3->isChecked() ) flags |= KateView::sfFromBeginning; | 140 | if( m_opt3->isChecked() ) flags |= KateView::sfFromBeginning; |
141 | if( m_opt4->isChecked() ) flags |= KateView::sfBackward; | 141 | if( m_opt4->isChecked() ) flags |= KateView::sfBackward; |
142 | if( m_opt5->isChecked() ) flags |= KateView::sfSelected; | 142 | if( m_opt5->isChecked() ) flags |= KateView::sfSelected; |
143 | if( m_optRegExp->isChecked() ) flags |= KateView::sfRegularExpression; | 143 | if( m_optRegExp->isChecked() ) flags |= KateView::sfRegularExpression; |
144 | if( m_replace ) | 144 | if( m_replace ) |
145 | { | 145 | { |
146 | if( m_opt6->isChecked() ) | 146 | if( m_opt6->isChecked() ) |
147 | flags |= KateView::sfPrompt; | 147 | flags |= KateView::sfPrompt; |
148 | 148 | ||
149 | flags |= KateView::sfReplace; | 149 | flags |= KateView::sfReplace; |
150 | } | 150 | } |
151 | 151 | ||
152 | return flags; | 152 | return flags; |
153 | } | 153 | } |
154 | 154 | ||
155 | void SearchDialog::slotOk() | 155 | void SearchDialog::slotOk() |
156 | { | 156 | { |
157 | if ( !m_search->currentText().isEmpty() ) | 157 | if ( !m_search->currentText().isEmpty() ) |
158 | { | 158 | { |
159 | if ( !m_optRegExp->isChecked() ) | 159 | if ( !m_optRegExp->isChecked() ) |
160 | { | 160 | { |
161 | accept(); | 161 | accept(); |
162 | } | 162 | } |
163 | else | 163 | else |
164 | { | 164 | { |
165 | // Check for a valid regular expression. | 165 | // Check for a valid regular expression. |
166 | 166 | ||
167 | QRegExp regExp( m_search->currentText() ); | 167 | QRegExp regExp( m_search->currentText() ); |
168 | 168 | ||
169 | if ( regExp.isValid() ) | 169 | if ( regExp.isValid() ) |
170 | accept(); | 170 | accept(); |
171 | } | 171 | } |
172 | } | 172 | } |
173 | } | 173 | } |
174 | 174 | ||
175 | void SearchDialog::setSearchText( const QString &searchstr ) | 175 | void SearchDialog::setSearchText( const QString &searchstr ) |
176 | { | 176 | { |
177 | m_search->insertItem( searchstr, 0 ); | 177 | m_search->insertItem( searchstr, 0 ); |
178 | m_search->setCurrentItem( 0 ); | 178 | m_search->setCurrentItem( 0 ); |
179 | m_search->lineEdit()->selectAll(); | 179 | m_search->lineEdit()->selectAll(); |
180 | } | 180 | } |
181 | 181 | ||
182 | // this dialog is not modal | 182 | // this dialog is not modal |
183 | ReplacePrompt::ReplacePrompt( QWidget *parent ) | 183 | ReplacePrompt::ReplacePrompt( QWidget *parent ) |
184 | : KDialogBase(parent, 0L, false, i18n( "Replace Text" ), | 184 | : KDialogBase(parent, 0L, false, i18n( "Replace Text" ), |
185 | User3 | User2 | User1 | Close, User3, true, | 185 | User3 | User2 | User1 | Close, User3, true, |
186 | i18n("&All"), i18n("&No"), i18n("&Yes")) { | 186 | i18n("&All"), i18n("&No"), i18n("&Yes")) { |
187 | 187 | ||
188 | QWidget *page = new QWidget(this); | 188 | QWidget *page = new QWidget(this); |
189 | setMainWidget(page); | 189 | setMainWidget(page); |
190 | 190 | ||
191 | QBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); | 191 | QBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); |
192 | QLabel *label = new QLabel(i18n("Replace this occurence?"),page); | 192 | QLabel *label = new QLabel(i18n("Replace this occurence?"),page); |
193 | topLayout->addWidget(label ); | 193 | topLayout->addWidget(label ); |
194 | } | 194 | } |
195 | 195 | ||
196 | void ReplacePrompt::slotUser1( void ) { // All | 196 | void ReplacePrompt::slotUser1( void ) { // All |
197 | done(KateView::srAll); | 197 | done(KateView::srAll); |
198 | } | 198 | } |
199 | 199 | ||
200 | void ReplacePrompt::slotUser2( void ) { // No | 200 | void ReplacePrompt::slotUser2( void ) { // No |
201 | done(KateView::srNo); | 201 | done(KateView::srNo); |
202 | } | 202 | } |
203 | 203 | ||
204 | void ReplacePrompt::slotUser3( void ) { // Yes | 204 | void ReplacePrompt::slotUser3( void ) { // Yes |
205 | accept(); | 205 | accept(); |
206 | } | 206 | } |
207 | 207 | ||
208 | void ReplacePrompt::done(int r) { | 208 | void ReplacePrompt::done(int r) { |
209 | setResult(r); | 209 | setResult(r); |
210 | emit clicked(); | 210 | emit clicked(); |
211 | } | 211 | } |
212 | 212 | ||
213 | void ReplacePrompt::closeEvent(QCloseEvent *) { | 213 | void ReplacePrompt::closeEvent(QCloseEvent *) { |
214 | reject(); | 214 | reject(); |
215 | } | 215 | } |
216 | 216 | ||
217 | GotoLineDialog::GotoLineDialog(QWidget *parent, int line, int max) | 217 | GotoLineDialog::GotoLineDialog(QWidget *parent, int line, int max) |
218 | : KDialogBase(parent, 0L, true, i18n("Goto Line"), Ok | Cancel, Ok) { | 218 | : KDialogBase(parent, 0L, true, i18n("Goto Line"), Ok | Cancel, Ok) { |
219 | 219 | ||
220 | QWidget *page = new QWidget(this); | 220 | QWidget *page = new QWidget(this); |
221 | setMainWidget(page); | 221 | setMainWidget(page); |
222 | 222 | ||
223 | QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); | 223 | QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); |
224 | e1 = new QSpinBox(page); | 224 | e1 = new QSpinBox(page); |
225 | e1->setMinValue(1); | 225 | e1->setMinValue(1); |
226 | e1->setMaxValue(max); | 226 | e1->setMaxValue(max); |
227 | e1->setValue((int)line); | 227 | e1->setValue((int)line); |
228 | 228 | ||
229 | QLabel *label = new QLabel( e1,i18n("&Goto Line:"), page ); | 229 | QLabel *label = new QLabel( e1,i18n("&Goto Line:"), page ); |
230 | topLayout->addWidget(label); | 230 | topLayout->addWidget(label); |
231 | topLayout->addWidget(e1); | 231 | topLayout->addWidget(e1); |
232 | topLayout->addSpacing(spacingHint()); // A little bit extra space | 232 | topLayout->addSpacing(spacingHint()); // A little bit extra space |
233 | topLayout->addStretch(10); | 233 | topLayout->addStretch(10); |
234 | e1->setFocus(); | 234 | e1->setFocus(); |
235 | } | 235 | } |
236 | 236 | ||
237 | int GotoLineDialog::getLine() { | 237 | int GotoLineDialog::getLine() { |
238 | return e1->value(); | 238 | return e1->value(); |
239 | } | 239 | } |
240 | 240 | ||
241 | const int IndentConfigTab::flags[] = {KateView::cfAutoIndent, KateView::cfSpaceIndent, | 241 | const int IndentConfigTab::flags[] = {KateView::cfAutoIndent, KateView::cfSpaceIndent, |
242 | KateView::cfBackspaceIndents,KateView::cfTabIndents, KateView::cfKeepIndentProfile, KateView::cfKeepExtraSpaces}; | 242 | KateView::cfBackspaceIndents,KateView::cfTabIndents, KateView::cfKeepIndentProfile, KateView::cfKeepExtraSpaces}; |
243 | 243 | ||
244 | IndentConfigTab::IndentConfigTab(QWidget *parent, KateView *view) | 244 | IndentConfigTab::IndentConfigTab(QWidget *parent, KateView *view) |
245 | : QWidget(parent, 0L) | 245 | : QWidget(parent, 0L) |
246 | { | 246 | { |
247 | QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() ); | 247 | QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() ); |
248 | int configFlags = view->config(); | 248 | int configFlags = view->config(); |
249 | 249 | ||
250 | opt[0] = new QCheckBox(i18n("&Auto Indent"), this); | 250 | opt[0] = new QCheckBox(i18n("&Auto Indent"), this); |
251 | layout->addWidget(opt[0], 0, AlignLeft); | 251 | layout->addWidget(opt[0], 0, AlignLeft); |
252 | opt[0]->setChecked(configFlags & flags[0]); | 252 | opt[0]->setChecked(configFlags & flags[0]); |
253 | 253 | ||
254 | opt[1] = new QCheckBox(i18n("Indent With &Spaces"), this); | 254 | opt[1] = new QCheckBox(i18n("Indent With &Spaces"), this); |
255 | layout->addWidget(opt[1], 0, AlignLeft); | 255 | layout->addWidget(opt[1], 0, AlignLeft); |
256 | opt[1]->setChecked(configFlags & flags[1]); | 256 | opt[1]->setChecked(configFlags & flags[1]); |
257 | 257 | ||
258 | opt[2] = new QCheckBox(i18n("&Backspace Key Indents"), this); | 258 | opt[2] = new QCheckBox(i18n("&Backspace Key Indents"), this); |
259 | layout->addWidget(opt[2], 0, AlignLeft); | 259 | layout->addWidget(opt[2], 0, AlignLeft); |
260 | opt[2]->setChecked(configFlags & flags[2]); | 260 | opt[2]->setChecked(configFlags & flags[2]); |
261 | 261 | ||
262 | opt[3] = new QCheckBox(i18n("&Tab Key Indents"), this); | 262 | opt[3] = new QCheckBox(i18n("&Tab Key Indents"), this); |
263 | layout->addWidget(opt[3], 0, AlignLeft); | 263 | layout->addWidget(opt[3], 0, AlignLeft); |
264 | opt[3]->setChecked(configFlags & flags[3]); | 264 | opt[3]->setChecked(configFlags & flags[3]); |
265 | 265 | ||
266 | opt[4] = new QCheckBox(i18n("Keep Indent &Profile"), this); | 266 | opt[4] = new QCheckBox(i18n("Keep Indent &Profile"), this); |
267 | layout->addWidget(opt[4], 0, AlignLeft); | 267 | layout->addWidget(opt[4], 0, AlignLeft); |
268 | // opt[4]->setChecked(configFlags & flags[4]); | 268 | // opt[4]->setChecked(configFlags & flags[4]); |
269 | opt[4]->setChecked(true); | 269 | opt[4]->setChecked(true); |
270 | opt[4]->hide(); | 270 | opt[4]->hide(); |
271 | 271 | ||
272 | opt[5] = new QCheckBox(i18n("&Keep Extra Spaces"), this); | 272 | opt[5] = new QCheckBox(i18n("&Keep Extra Spaces"), this); |
273 | layout->addWidget(opt[5], 0, AlignLeft); | 273 | layout->addWidget(opt[5], 0, AlignLeft); |
274 | opt[5]->setChecked(configFlags & flags[5]); | 274 | opt[5]->setChecked(configFlags & flags[5]); |
275 | 275 | ||
276 | layout->addStretch(); | 276 | layout->addStretch(); |
277 | 277 | ||
278 | // What is this? help | 278 | // What is this? help |
279 | QWhatsThis::add(opt[0], i18n("When <b>Auto indent</b> is on, KateView will indent new lines to equal the indent on the previous line.<p>If the previous line is blank, the nearest line above with text is used")); | 279 | QWhatsThis::add(opt[0], i18n("When <b>Auto indent</b> is on, KateView will indent new lines to equal the indent on the previous line.<p>If the previous line is blank, the nearest line above with text is used")); |
280 | QWhatsThis::add(opt[1], i18n("Check this if you want to indent with spaces rather than tabs.<br>A Tab will be converted to <u>Tab-width</u> as set in the <b>edit</b> options")); | 280 | QWhatsThis::add(opt[1], i18n("Check this if you want to indent with spaces rather than tabs.<br>A Tab will be converted to <u>Tab-width</u> as set in the <b>edit</b> options")); |
281 | QWhatsThis::add(opt[2], i18n("This allows the <b>backspace</b> key to be used to indent.")); | 281 | QWhatsThis::add(opt[2], i18n("This allows the <b>backspace</b> key to be used to indent.")); |
282 | QWhatsThis::add(opt[3], i18n("This allows the <b>tab</b> key to be used to indent.")); | 282 | QWhatsThis::add(opt[3], i18n("This allows the <b>tab</b> key to be used to indent.")); |
283 | QWhatsThis::add(opt[4], i18n("This retains current indentation settings for future documents.")); | 283 | QWhatsThis::add(opt[4], i18n("This retains current indentation settings for future documents.")); |
284 | QWhatsThis::add(opt[5], i18n("Indentations of more than the selected number of spaces will not be shortened.")); | 284 | QWhatsThis::add(opt[5], i18n("Indentations of more than the selected number of spaces will not be shortened.")); |
285 | } | 285 | } |
286 | 286 | ||
287 | void IndentConfigTab::getData(KateView *view) { | 287 | void IndentConfigTab::getData(KateView *view) { |
288 | int configFlags, z; | 288 | int configFlags, z; |
289 | 289 | ||
290 | configFlags = view->config(); | 290 | configFlags = view->config(); |
291 | for (z = 0; z < numFlags; z++) { | 291 | for (z = 0; z < numFlags; z++) { |
292 | configFlags &= ~flags[z]; | 292 | configFlags &= ~flags[z]; |
293 | if (opt[z]->isChecked()) configFlags |= flags[z]; | 293 | if (opt[z]->isChecked()) configFlags |= flags[z]; |
294 | } | 294 | } |
295 | view->setConfig(configFlags); | 295 | view->setConfig(configFlags); |
296 | } | 296 | } |
297 | 297 | ||
298 | const int SelectConfigTab::flags[] = {KateView::cfPersistent, KateView::cfDelOnInput, | 298 | const int SelectConfigTab::flags[] = {KateView::cfPersistent, KateView::cfDelOnInput, |
299 | KateView::cfMouseAutoCopy, KateView::cfSingleSelection, KateView::cfVerticalSelect, KateView::cfXorSelect}; | 299 | KateView::cfMouseAutoCopy, KateView::cfSingleSelection, KateView::cfVerticalSelect, KateView::cfXorSelect}; |
300 | 300 | ||
301 | SelectConfigTab::SelectConfigTab(QWidget *parent, KateView *view) | 301 | SelectConfigTab::SelectConfigTab(QWidget *parent, KateView *view) |
302 | : QWidget(parent, 0L) | 302 | : QWidget(parent, 0L) |
303 | { | 303 | { |
304 | QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() ); | 304 | QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() ); |
305 | int configFlags = view->config(); | 305 | int configFlags = view->config(); |
306 | 306 | ||
307 | opt[0] = new QCheckBox(i18n("&Persistent Selections"), this); | 307 | opt[0] = new QCheckBox(i18n("&Persistent Selections"), this); |
308 | layout->addWidget(opt[0], 0, AlignLeft); | 308 | layout->addWidget(opt[0], 0, AlignLeft); |
309 | opt[0]->setChecked(configFlags & flags[0]); | 309 | opt[0]->setChecked(configFlags & flags[0]); |
310 | 310 | ||
311 | opt[1] = new QCheckBox(i18n("&Overwrite Selections"), this); | 311 | opt[1] = new QCheckBox(i18n("&Overwrite Selections"), this); |
312 | layout->addWidget(opt[1], 0, AlignLeft); | 312 | layout->addWidget(opt[1], 0, AlignLeft); |
313 | opt[1]->setChecked(configFlags & flags[1]); | 313 | opt[1]->setChecked(configFlags & flags[1]); |
314 | 314 | ||
315 | opt[2] = new QCheckBox(i18n("Mouse &Autocopy"), this); | 315 | opt[2] = new QCheckBox(i18n("Mouse &Autocopy"), this); |
316 | layout->addWidget(opt[2], 0, AlignLeft); | 316 | layout->addWidget(opt[2], 0, AlignLeft); |
317 | opt[2]->setChecked(configFlags & flags[2]); | 317 | opt[2]->setChecked(configFlags & flags[2]); |
318 | 318 | ||
319 | opt[3] = new QCheckBox(i18n("&X11-like Single Selection"), this); | 319 | opt[3] = new QCheckBox(i18n("&X11-like Single Selection"), this); |
320 | layout->addWidget(opt[3], 0, AlignLeft); | 320 | layout->addWidget(opt[3], 0, AlignLeft); |
321 | opt[3]->setChecked(configFlags & flags[3]); | 321 | opt[3]->setChecked(configFlags & flags[3]); |
322 | 322 | ||
323 | opt[4] = new QCheckBox(i18n("&Vertical Selections"), this); | 323 | opt[4] = new QCheckBox(i18n("&Vertical Selections"), this); |
324 | layout->addWidget(opt[4], 0, AlignLeft); | 324 | layout->addWidget(opt[4], 0, AlignLeft); |
325 | opt[4]->setChecked(configFlags & flags[4]); | 325 | opt[4]->setChecked(configFlags & flags[4]); |
326 | 326 | ||
327 | opt[5] = new QCheckBox(i18n("&Toggle Old"), this); | 327 | opt[5] = new QCheckBox(i18n("&Toggle Old"), this); |
328 | layout->addWidget(opt[5], 0, AlignLeft); | 328 | layout->addWidget(opt[5], 0, AlignLeft); |
329 | opt[5]->setChecked(configFlags & flags[5]); | 329 | opt[5]->setChecked(configFlags & flags[5]); |
330 | 330 | ||
331 | layout->addStretch(); | 331 | layout->addStretch(); |
332 | 332 | ||
333 | // What is this? help | 333 | // What is this? help |
334 | QWhatsThis::add(opt[0], i18n("Enabling this prevents key input or cursor movement by way of the arrow keys from causing the elimination of text selection.<p><b>Note:</b> If the Overwrite Selections option is activated then any typed character input or paste operation will replace the selected text.")); | 334 | QWhatsThis::add(opt[0], i18n("Enabling this prevents key input or cursor movement by way of the arrow keys from causing the elimination of text selection.<p><b>Note:</b> If the Overwrite Selections option is activated then any typed character input or paste operation will replace the selected text.")); |
335 | QWhatsThis::add(opt[1], i18n("When this is on, any keyed character input or paste operation will replace the selected text.")); | 335 | QWhatsThis::add(opt[1], i18n("When this is on, any keyed character input or paste operation will replace the selected text.")); |
336 | QWhatsThis::add(opt[2], i18n("When this is on, any text selected with the mouse will be automatically copied to the clipboard.")); | 336 | QWhatsThis::add(opt[2], i18n("When this is on, any text selected with the mouse will be automatically copied to the clipboard.")); |
337 | QWhatsThis::add(opt[3], i18n("Not implemented yet.")); | 337 | QWhatsThis::add(opt[3], i18n("Not implemented yet.")); |
338 | QWhatsThis::add(opt[4], i18n("Enabling this allows you to make vertical selections.")); | 338 | QWhatsThis::add(opt[4], i18n("Enabling this allows you to make vertical selections.")); |
339 | QWhatsThis::add(opt[5], i18n("Not yet implemented.")); | 339 | QWhatsThis::add(opt[5], i18n("Not yet implemented.")); |
340 | } | 340 | } |
341 | 341 | ||
342 | void SelectConfigTab::getData(KateView *view) { | 342 | void SelectConfigTab::getData(KateView *view) { |
343 | int configFlags, z; | 343 | int configFlags, z; |
344 | 344 | ||
345 | configFlags = view->config(); | 345 | configFlags = view->config(); |
346 | for (z = 0; z < numFlags; z++) { | 346 | for (z = 0; z < numFlags; z++) { |
347 | configFlags &= ~flags[z]; // clear flag | 347 | configFlags &= ~flags[z]; // clear flag |
348 | if (opt[z]->isChecked()) configFlags |= flags[z]; // set flag if checked | 348 | if (opt[z]->isChecked()) configFlags |= flags[z]; // set flag if checked |
349 | } | 349 | } |
350 | view->setConfig(configFlags); | 350 | view->setConfig(configFlags); |
351 | } | 351 | } |
352 | 352 | ||
353 | const int EditConfigTab::flags[] = {KateView::cfWordWrap, KateView::cfReplaceTabs, KateView::cfRemoveSpaces, | 353 | const int EditConfigTab::flags[] = {KateView::cfWordWrap, KateView::cfReplaceTabs, KateView::cfRemoveSpaces, |
354 | KateView::cfAutoBrackets, KateView::cfGroupUndo, KateView::cfShowTabs, KateView::cfSmartHome, | 354 | KateView::cfAutoBrackets, KateView::cfGroupUndo, KateView::cfShowTabs, KateView::cfSmartHome, |
355 | KateView::cfPageUDMovesCursor, KateView::cfWrapCursor}; | 355 | KateView::cfPageUDMovesCursor, KateView::cfWrapCursor}; |
356 | 356 | ||
357 | EditConfigTab::EditConfigTab(QWidget *parent, KateView *view) | 357 | EditConfigTab::EditConfigTab(QWidget *parent, KateView *view) |
358 | : QWidget(parent, 0L) { | 358 | : QWidget(parent, 0L) { |
359 | 359 | ||
360 | QHBoxLayout *mainLayout; | 360 | QHBoxLayout *mainLayout; |
361 | QVBoxLayout *cbLayout, *leLayout; | 361 | QVBoxLayout *cbLayout, *leLayout; |
362 | int configFlags; | 362 | int configFlags; |
363 | 363 | ||
364 | mainLayout = new QHBoxLayout(this, 0, KDialog::spacingHint() ); | 364 | mainLayout = new QHBoxLayout(this, 0, KDialog::spacingHint() ); |
365 | 365 | ||
366 | // checkboxes | 366 | // checkboxes |
367 | cbLayout = new QVBoxLayout( mainLayout ); | 367 | cbLayout = new QVBoxLayout( mainLayout ); |
368 | configFlags = view->config(); | 368 | configFlags = view->config(); |
369 | 369 | ||
370 | opt[0] = new QCheckBox(i18n("&Word wrap"), this); | 370 | opt[0] = new QCheckBox(i18n("&Word wrap"), this); |
371 | cbLayout->addWidget(opt[0], 0, AlignLeft); | 371 | cbLayout->addWidget(opt[0], 0, AlignLeft); |
372 | opt[0]->setChecked(view->doc()->wordWrap()); | 372 | opt[0]->setChecked(view->doc()->wordWrap()); |
373 | 373 | ||
374 | opt[1] = new QCheckBox(i18n("Replace &tabs with spaces"), this); | 374 | opt[1] = new QCheckBox(i18n("Replace &tabs with spaces"), this); |
375 | cbLayout->addWidget(opt[1], 0, AlignLeft); | 375 | cbLayout->addWidget(opt[1], 0, AlignLeft); |
376 | opt[1]->setChecked(configFlags & flags[1]); | 376 | opt[1]->setChecked(configFlags & flags[1]); |
377 | 377 | ||
378 | opt[2] = new QCheckBox(i18n("&Remove trailing spaces"), this); | 378 | opt[2] = new QCheckBox(i18n("&Remove trailing spaces"), this); |
379 | cbLayout->addWidget(opt[2], 0, AlignLeft); | 379 | cbLayout->addWidget(opt[2], 0, AlignLeft); |
380 | opt[2]->setChecked(configFlags & flags[2]); | 380 | opt[2]->setChecked(configFlags & flags[2]); |
381 | 381 | ||
382 | opt[3] = new QCheckBox(i18n("&Auto brackets"), this); | 382 | opt[3] = new QCheckBox(i18n("&Auto brackets"), this); |
383 | cbLayout->addWidget(opt[3], 0, AlignLeft); | 383 | cbLayout->addWidget(opt[3], 0, AlignLeft); |
384 | opt[3]->setChecked(configFlags & flags[3]); | 384 | opt[3]->setChecked(configFlags & flags[3]); |
385 | 385 | ||
386 | opt[4] = new QCheckBox(i18n("Group &undos"), this); | 386 | opt[4] = new QCheckBox(i18n("Group &undos"), this); |
387 | cbLayout->addWidget(opt[4], 0, AlignLeft); | 387 | cbLayout->addWidget(opt[4], 0, AlignLeft); |
388 | opt[4]->setChecked(configFlags & flags[4]); | 388 | opt[4]->setChecked(configFlags & flags[4]); |
389 | 389 | ||
390 | opt[5] = new QCheckBox(i18n("&Show tabs"), this); | 390 | opt[5] = new QCheckBox(i18n("&Show tabs"), this); |
391 | cbLayout->addWidget(opt[5], 0, AlignLeft); | 391 | cbLayout->addWidget(opt[5], 0, AlignLeft); |
392 | opt[5]->setChecked(configFlags & flags[5]); | 392 | opt[5]->setChecked(configFlags & flags[5]); |
393 | 393 | ||
394 | opt[6] = new QCheckBox(i18n("Smart &home"), this); | 394 | opt[6] = new QCheckBox(i18n("Smart &home"), this); |
395 | cbLayout->addWidget(opt[6], 0, AlignLeft); | 395 | cbLayout->addWidget(opt[6], 0, AlignLeft); |
396 | opt[6]->setChecked(configFlags & flags[6]); | 396 | opt[6]->setChecked(configFlags & flags[6]); |
397 | 397 | ||
398 | opt[7] = new QCheckBox(i18n("&Page up/down moves cursor"), this); | 398 | opt[7] = new QCheckBox(i18n("&Page up/down moves cursor"), this); |
399 | cbLayout->addWidget(opt[7], 0, AlignLeft); | 399 | cbLayout->addWidget(opt[7], 0, AlignLeft); |
400 | opt[7]->setChecked(configFlags & flags[7]); | 400 | opt[7]->setChecked(configFlags & flags[7]); |
401 | 401 | ||
402 | opt[8] = new QCheckBox(i18n("Wrap &cursor"), this); | 402 | opt[8] = new QCheckBox(i18n("Wrap &cursor"), this); |
403 | cbLayout->addWidget(opt[8], 0, AlignLeft); | 403 | cbLayout->addWidget(opt[8], 0, AlignLeft); |
404 | opt[8]->setChecked(configFlags & flags[8]); | 404 | opt[8]->setChecked(configFlags & flags[8]); |
405 | 405 | ||
406 | cbLayout->addStretch(); | 406 | cbLayout->addStretch(); |
407 | 407 | ||
408 | // edit lines | 408 | // edit lines |
409 | leLayout = new QVBoxLayout(); | 409 | leLayout = new QVBoxLayout(); |
410 | mainLayout->addLayout(leLayout,10); | 410 | mainLayout->addLayout(leLayout,10); |
411 | 411 | ||
412 | e1 = new QSpinBox(this); | 412 | e1 = new QSpinBox(this); |
413 | e1->setMinValue(20); | 413 | e1->setMinValue(20); |
414 | e1->setMaxValue( 200); | 414 | e1->setMaxValue( 200); |
415 | e1->setValue((int)(view->doc()->wordWrapAt())); | 415 | e1->setValue((int)(view->doc()->wordWrapAt())); |
416 | #warning fixme e1->setLabel(i18n("Wrap Words At:")); | 416 | #warning fixme e1->setLabel(i18n("Wrap Words At:")); |
417 | 417 | ||
418 | e2 = new QSpinBox(this); | 418 | e2 = new QSpinBox(this); |
419 | e2->setMinValue(1); | 419 | e2->setMinValue(1); |
420 | e2->setMaxValue(16); | 420 | e2->setMaxValue(16); |
421 | e2->setValue((int)view->tabWidth()); | 421 | e2->setValue((int)view->tabWidth()); |
422 | 422 | ||
423 | #warning fixme e2->setLabel(i18n("Tab/Indent Width:")); | 423 | #warning fixme e2->setLabel(i18n("Tab/Indent Width:")); |
424 | 424 | ||
425 | e3 = new QSpinBox(this); | 425 | e3 = new QSpinBox(this); |
426 | e3->setMinValue(5); | 426 | e3->setMinValue(5); |
427 | e3->setMaxValue( 30000); | 427 | e3->setMaxValue( 30000); |
428 | #warning fixme e3->setLabel(i18n("Undo steps:")); | 428 | #warning fixme e3->setLabel(i18n("Undo steps:")); |
429 | e3->setValue((int)view->undoSteps()); | 429 | e3->setValue((int)view->undoSteps()); |
430 | 430 | ||
431 | leLayout->addWidget(e1, 0, AlignLeft); | 431 | leLayout->addWidget(e1, 0, AlignLeft); |
432 | leLayout->addWidget(e2, 0, AlignLeft); | 432 | leLayout->addWidget(e2, 0, AlignLeft); |
433 | leLayout->addWidget(e3, 0, AlignLeft); | 433 | leLayout->addWidget(e3, 0, AlignLeft); |
434 | 434 | ||
435 | 435 | ||
436 | QVBox *box = new QVBox (this); | 436 | QVBox *box = new QVBox (this); |
437 | leLayout->addWidget (box, 0, AlignLeft); | 437 | leLayout->addWidget (box, 0, AlignLeft); |
438 | 438 | ||
439 | new QLabel (i18n("Encoding:"), box); | 439 | new QLabel (i18n("Encoding:"), box); |
440 | 440 | ||
441 | encoding = new QComboBox(box); | 441 | encoding = new QComboBox(box); |
442 | #warning fixme | 442 | #warning fixme |
443 | #if 0 | 443 | #if 0 |
444 | encoding->insertStringList (KGlobal::charsets()->availableEncodingNames()); | 444 | encoding->insertStringList (KGlobal::charsets()->availableEncodingNames()); |
445 | encoding->setCurrentItem (KGlobal::charsets()->availableEncodingNames().findIndex(view->doc()->encoding())); | 445 | encoding->setCurrentItem (KGlobal::charsets()->availableEncodingNames().findIndex(view->doc()->encoding())); |
446 | #endif | 446 | #endif |
447 | leLayout->addStretch(); | 447 | leLayout->addStretch(); |
448 | 448 | ||
449 | // What is this? help | 449 | // What is this? help |
450 | QWhatsThis::add(opt[0], i18n("Word wrap is a feature that causes the editor to automatically start a new line of text and move (wrap) the cursor to the beginning of that new line. KateView will automatically start a new line of text when the current line reaches the length specified by the Wrap Words At: option.<p><b>NOTE:<b> Word Wrap will not change existing lines or wrap them for easy reading as in some applications.")); | 450 | QWhatsThis::add(opt[0], i18n("Word wrap is a feature that causes the editor to automatically start a new line of text and move (wrap) the cursor to the beginning of that new line. KateView will automatically start a new line of text when the current line reaches the length specified by the Wrap Words At: option.<p><b>NOTE:<b> Word Wrap will not change existing lines or wrap them for easy reading as in some applications.")); |
451 | QWhatsThis::add(e1, i18n("If the Word Wrap option is selected this entry determines the length (in characters) at which the editor will automatically start a new line.")); | 451 | QWhatsThis::add(e1, i18n("If the Word Wrap option is selected this entry determines the length (in characters) at which the editor will automatically start a new line.")); |
452 | QWhatsThis::add(opt[1], i18n("KateView will replace any tabs with the number of spaces indicated in the Tab Width: entry.")); | 452 | QWhatsThis::add(opt[1], i18n("KateView will replace any tabs with the number of spaces indicated in the Tab Width: entry.")); |
453 | QWhatsThis::add(e2, i18n("If the Replace Tabs By Spaces option is selected this entry determines the number of spaces with which the editor will automatically replace tabs.")); | 453 | QWhatsThis::add(e2, i18n("If the Replace Tabs By Spaces option is selected this entry determines the number of spaces with which the editor will automatically replace tabs.")); |
454 | QWhatsThis::add(opt[2], i18n("KateView will automatically eliminate extra spaces at the ends of lines of text.")); | 454 | QWhatsThis::add(opt[2], i18n("KateView will automatically eliminate extra spaces at the ends of lines of text.")); |
455 | QWhatsThis::add(opt[3], i18n("When the user types a left bracket ([,(, or {) KateView automatically enters the right bracket (}, ), or ]) to the right of the cursor.")); | 455 | QWhatsThis::add(opt[3], i18n("When the user types a left bracket ([,(, or {) KateView automatically enters the right bracket (}, ), or ]) to the right of the cursor.")); |
456 | QWhatsThis::add(opt[4], i18n("Checking this will cause sequences of similar actions to be undone at once.")); | 456 | QWhatsThis::add(opt[4], i18n("Checking this will cause sequences of similar actions to be undone at once.")); |
457 | QWhatsThis::add(opt[5], i18n("The editor will display a symbol to indicate the presence of a tab in the text.")); | 457 | QWhatsThis::add(opt[5], i18n("The editor will display a symbol to indicate the presence of a tab in the text.")); |
458 | QWhatsThis::add(opt[6], i18n("Not yet implemented.")); | 458 | QWhatsThis::add(opt[6], i18n("Not yet implemented.")); |
459 | QWhatsThis::add(opt[7], i18n("If this is selected, the insertion cursor will be moved to the first/last line when pressing the page up/down buttons.<p>If not selected, it will remain at it's relative position in the visible text.")); | 459 | QWhatsThis::add(opt[7], i18n("If this is selected, the insertion cursor will be moved to the first/last line when pressing the page up/down buttons.<p>If not selected, it will remain at it's relative position in the visible text.")); |
460 | QWhatsThis::add(e3, i18n("Sets the number of undo/redo steps to record. More steps uses more memory.")); | 460 | QWhatsThis::add(e3, i18n("Sets the number of undo/redo steps to record. More steps uses more memory.")); |
461 | QWhatsThis::add(opt[8], i18n("When on, moving the insertion cursor using the <b>Left</b> and <b>Right</b> keys will go on to previous/next line at beginning/end of the line, similar to most editors.<p>When off, the insertion cursor cannot be moved left of the line start, but it can be moved off the line end, which can be very handy for programmers.")); | 461 | QWhatsThis::add(opt[8], i18n("When on, moving the insertion cursor using the <b>Left</b> and <b>Right</b> keys will go on to previous/next line at beginning/end of the line, similar to most editors.<p>When off, the insertion cursor cannot be moved left of the line start, but it can be moved off the line end, which can be very handy for programmers.")); |
462 | } | 462 | } |
463 | 463 | ||
464 | void EditConfigTab::getData(KateView *view) | 464 | void EditConfigTab::getData(KateView *view) |
465 | { | 465 | { |
466 | int configFlags, z; | 466 | int configFlags, z; |
467 | 467 | ||
468 | configFlags = view->config(); | 468 | configFlags = view->config(); |
469 | for (z = 1; z < numFlags; z++) { | 469 | for (z = 1; z < numFlags; z++) { |
470 | configFlags &= ~flags[z]; | 470 | configFlags &= ~flags[z]; |
471 | if (opt[z]->isChecked()) configFlags |= flags[z]; | 471 | if (opt[z]->isChecked()) configFlags |= flags[z]; |
472 | } | 472 | } |
473 | view->setConfig(configFlags); | 473 | view->setConfig(configFlags); |
474 | 474 | ||
475 | view->setEncoding (encoding->currentText()); | 475 | view->setEncoding (encoding->currentText()); |
476 | view->doc()->setWordWrapAt(e1->value()); | 476 | view->doc()->setWordWrapAt(e1->value()); |
477 | view->doc()->setWordWrap (opt[0]->isChecked()); | 477 | view->doc()->setWordWrap (opt[0]->isChecked()); |
478 | view->setTabWidth(e2->value()); | 478 | view->setTabWidth(e2->value()); |
479 | view->setUndoSteps(e3->value()); | 479 | view->setUndoSteps(e3->value()); |
480 | } | 480 | } |
481 | 481 | ||
482 | ColorConfig::ColorConfig( QWidget *parent, char *name ) | 482 | ColorConfig::ColorConfig( QWidget *parent, char *name ) |
483 | : QWidget( parent, name ) | 483 | : QWidget( parent, name ) |
484 | { | 484 | { |
485 | QGridLayout *glay = new QGridLayout( this, 6, 2, 0, KDialog::spacingHint()); | 485 | QGridLayout *glay = new QGridLayout( this, 6, 2, 0, KDialog::spacingHint()); |
486 | glay->setColStretch(1,1); | 486 | glay->setColStretch(1,1); |
487 | glay->setRowStretch(5,1); | 487 | glay->setRowStretch(5,1); |
488 | 488 | ||
489 | QLabel *label; | 489 | QLabel *label; |
490 | 490 | ||
491 | label = new QLabel( i18n("Background:"), this); | 491 | label = new QLabel( i18n("Background:"), this); |
492 | label->setAlignment( AlignRight|AlignVCenter ); | 492 | label->setAlignment( AlignRight|AlignVCenter ); |
493 | m_back = new KColorButton( this ); | 493 | m_back = new KColorButton( this ); |
494 | glay->addWidget( label, 0, 0 ); | 494 | glay->addWidget( label, 0, 0 ); |
495 | glay->addWidget( m_back, 0, 1 ); | 495 | glay->addWidget( m_back, 0, 1 ); |
496 | 496 | ||
497 | label = new QLabel( i18n("Selected:"), this); | 497 | label = new QLabel( i18n("Selected:"), this); |
498 | label->setAlignment( AlignRight|AlignVCenter ); | 498 | label->setAlignment( AlignRight|AlignVCenter ); |
499 | m_selected = new KColorButton( this ); | 499 | m_selected = new KColorButton( this ); |
500 | glay->addWidget( label, 2, 0 ); | 500 | glay->addWidget( label, 2, 0 ); |
501 | glay->addWidget( m_selected, 2, 1 ); | 501 | glay->addWidget( m_selected, 2, 1 ); |
502 | 502 | ||
503 | // QWhatsThis help | 503 | // QWhatsThis help |
504 | QWhatsThis::add(m_back, i18n("Sets the background color of the editing area")); | 504 | QWhatsThis::add(m_back, i18n("Sets the background color of the editing area")); |
505 | QWhatsThis::add(m_selected, i18n("Sets the background color of the selection. To set the text color for selected text, use the "<b>Configure Highlighting</b>" dialog.")); | 505 | QWhatsThis::add(m_selected, i18n("Sets the background color of the selection. To set the text color for selected text, use the "<b>Configure Highlighting</b>" dialog.")); |
506 | } | 506 | } |
507 | 507 | ||
508 | 508 | ||
509 | ColorConfig::~ColorConfig() | 509 | ColorConfig::~ColorConfig() |
510 | { | 510 | { |
511 | } | 511 | } |
512 | 512 | ||
513 | void ColorConfig::setColors(QColor *colors) | 513 | void ColorConfig::setColors(QColor *colors) |
514 | { | 514 | { |
515 | m_back->setColor( colors[0] ); | 515 | m_back->setColor( colors[0] ); |
516 | m_selected->setColor( colors[1] ); | 516 | m_selected->setColor( colors[1] ); |
517 | } | 517 | } |
518 | 518 | ||
519 | void ColorConfig::getColors(QColor *colors) | 519 | void ColorConfig::getColors(QColor *colors) |
520 | { | 520 | { |
521 | colors[0] = m_back->color(); | 521 | colors[0] = m_back->color(); |
522 | colors[1] = m_selected->color(); | 522 | colors[1] = m_selected->color(); |
523 | } | 523 | } |
524 | 524 | ||
525 | FontConfig::FontConfig( QWidget *parent, char *name ) | 525 | FontConfig::FontConfig( QWidget *parent, char *name ) |
526 | : QWidget( parent, name ) | 526 | : QWidget( parent, name ) |
527 | { | 527 | { |
528 | // sizemanagment | 528 | // sizemanagment |
529 | QGridLayout *grid = new QGridLayout( this, 1, 1 ); | 529 | QGridLayout *grid = new QGridLayout( this, 1, 1 ); |
530 | // QString familyStr = cfg. readEntry ( "FontFamily", "Helvetica" ); | 530 | // QString familyStr = cfg. readEntry ( "FontFamily", "Helvetica" ); |
531 | // QString styleStr = cfg. readEntry ( "FontStyle", "Regular" ); | 531 | // QString styleStr = cfg. readEntry ( "FontStyle", "Regular" ); |
532 | // int size = cfg. readNumEntry ( "FontSize", 10 ); | 532 | // int size = cfg. readNumEntry ( "FontSize", 10 ); |
533 | // OFontSelector *m_fontselect; | 533 | // OFontSelector *m_fontselect; |
534 | 534 | ||
535 | m_fontselect = new OFontSelector ( false, this, "FontTab" ); | 535 | m_fontselect = new OFontSelector ( false, this, "FontTab" ); |
536 | // m_fontselect-> setSelectedFont ( familyStr, styleStr, size ); | 536 | // m_fontselect-> setSelectedFont ( familyStr, styleStr, size ); |
537 | // QWhatsThis::add( m_fontselect, | 537 | // QWhatsThis::add( m_fontselect, |
538 | // tr( "Select the desired name, style and size of the default font applications will use." ) ); | 538 | // tr( "Select the desired name, style and size of the default font applications will use." ) ); |
539 | 539 | ||
540 | connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), | 540 | connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), |
541 | this, SLOT( slotFontSelected( const QFont & ))); | 541 | this, SLOT( slotFontSelected( const QFont & ))); |
542 | grid->addWidget( m_fontselect, 0, 0); | 542 | grid->addWidget( m_fontselect, 0, 0); |
543 | 543 | ||
544 | 544 | ||
545 | // #if 0 | 545 | // #if 0 |
546 | // m_fontchooser = new KFontChooser ( this ); | 546 | // m_fontchooser = new KFontChooser ( this ); |
547 | // m_fontchooser->enableColumn(KFontChooser::StyleList, false); | 547 | // m_fontchooser->enableColumn(KFontChooser::StyleList, false); |
548 | // grid->addWidget( m_fontchooser, 0, 0); | 548 | // grid->addWidget( m_fontchooser, 0, 0); |
549 | 549 | ||
550 | // connect (m_fontchooser, SIGNAL (fontSelected( const QFont & )), this, SLOT (slotFontSelected( const QFont & ))); | 550 | // connect (m_fontchooser, SIGNAL (fontSelected( const QFont & )), this, SLOT (slotFontSelected( const QFont & ))); |
551 | // #endif | 551 | // #endif |
552 | } | 552 | } |
553 | 553 | ||
554 | FontConfig::~FontConfig() | 554 | FontConfig::~FontConfig() |
555 | { | 555 | { |
556 | } | 556 | } |
557 | 557 | ||
558 | void FontConfig::setFont ( const QFont &font ) | 558 | void FontConfig::setFont ( const QFont &font ) |
559 | { | 559 | { |
560 | //#if 0 | 560 | //#if 0 |
561 | m_fontselect->setFont (font); | 561 | m_fontselect->setFont (font); |
562 | myFont = font; | 562 | myFont = font; |
563 | //#endif | 563 | //#endif |
564 | } | 564 | } |
565 | 565 | ||
566 | void FontConfig::slotFontSelected( const QFont &font ) | 566 | void FontConfig::slotFontSelected( const QFont &font ) |
567 | { | 567 | { |
568 | myFont = font; | 568 | myFont = font; |
569 | } | 569 | } |
570 | 570 | ||
571 | 571 | ||
572 | 572 | ||
573 | 573 | ||
diff --git a/noncore/apps/tinykate/main.cpp b/noncore/apps/tinykate/main.cpp index e21c040..e62930c 100644 --- a/noncore/apps/tinykate/main.cpp +++ b/noncore/apps/tinykate/main.cpp | |||
@@ -1,22 +1,22 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | main.cpp | 2 | main.cpp |
3 | ------------------- | 3 | ------------------- |
4 | begin : November 2002 | 4 | begin : November 2002 |
5 | copyright : (C) 2002 by Joseph Wenninger <jowenn@kde.org> | 5 | copyright : (C) 2002 by Joseph Wenninger <jowenn@kde.org> |
6 | ***************************************************************************/ | 6 | ***************************************************************************/ |
7 | 7 | ||
8 | /*************************************************************************** | 8 | /*************************************************************************** |
9 | * * | 9 | * * |
10 | * This program is free software; you can redistribute it and/or modify * | 10 | * This program is free software; you can redistribute it and/or modify * |
11 | * it under the terms of the GNU General Public License as published by * | 11 | * it under the terms of the GNU General Public License as published by * |
12 | * the Free Software Foundation. * | 12 | * the Free Software Foundation. * |
13 | * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE * | 13 | * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE * |
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | #include <qmainwindow.h> | ||
17 | #include "tinykate.h" | ||
18 | 16 | ||
19 | #include <opie/oapplicationfactory.h> | 17 | #include <opie2/oapplicationfactory.h> |
18 | |||
19 | #include "tinykate.h" | ||
20 | 20 | ||
21 | OPIE_EXPORT_APP( OApplicationFactory<TinyKate> ) | 21 | OPIE_EXPORT_APP( OApplicationFactory<TinyKate> ) |
22 | 22 | ||
diff --git a/noncore/apps/tinykate/opie-tinykate.control b/noncore/apps/tinykate/opie-tinykate.control index 66e17ad..fd806cc 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: plugins/application/libkate.so* bin/kate apps/Applications/tinykate.desktop pics/tinykate lib/libtinykate.so.1.0.0 lib/libtinykate.so.1.0 lib/libtinykate.so.1 | 2 | Files: plugins/application/libkate.so* bin/kate apps/Applications/tinykate.desktop pics/tinykate lib/libtinykate.so.1.0.0 lib/libtinykate.so.1.0 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 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal, libopiecore2, libopieui2 |
8 | Description: Kate for Opie | 8 | Description: Kate for Opie |
9 | Version: $QPE_VERSION$EXTRAVERSION | 9 | Version: $QPE_VERSION$EXTRAVERSION |
diff --git a/noncore/apps/tinykate/tinykate.cpp b/noncore/apps/tinykate/tinykate.cpp index f470645..bbf80ce 100644 --- a/noncore/apps/tinykate/tinykate.cpp +++ b/noncore/apps/tinykate/tinykate.cpp | |||
@@ -1,283 +1,283 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | tinykate.cpp | 2 | tinykate.cpp |
3 | Tiny KATE mainwindow | 3 | Tiny KATE mainwindow |
4 | ------------------- | 4 | ------------------- |
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 softwaSre; 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 <qtoolbutton.h> | 20 | #include <qtoolbutton.h> |
21 | #include <qmenubar.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 <opie2/ofiledialog.h> |
27 | 27 | ||
28 | #include "tinykate.h" | 28 | #include "tinykate.h" |
29 | 29 | ||
30 | #include <katedocument.h> | 30 | #include <katedocument.h> |
31 | #include <katehighlight.h> | 31 | #include <katehighlight.h> |
32 | #include <kateview.h> | 32 | #include <kateview.h> |
33 | #include <kglobal.h> | 33 | #include <kglobal.h> |
34 | 34 | ||
35 | TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | 35 | TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : |
36 | QMainWindow( parent, name, f ) | 36 | QMainWindow( parent, name, f ) |
37 | { | 37 | { |
38 | shutDown=false; | 38 | shutDown=false; |
39 | nextUnnamed=0; | 39 | nextUnnamed=0; |
40 | currentView=0; | 40 | currentView=0; |
41 | viewCount=0; | 41 | viewCount=0; |
42 | setCaption(tr("TinyKATE")); | 42 | setCaption(tr("TinyKATE")); |
43 | KGlobal::setAppName("TinyKATE"); | 43 | KGlobal::setAppName("TinyKATE"); |
44 | 44 | ||
45 | QMenuBar *mb = new QMenuBar( this ); | 45 | QMenuBar *mb = new QMenuBar( this ); |
46 | mb->setMargin( 0 ); | 46 | mb->setMargin( 0 ); |
47 | 47 | ||
48 | tabwidget=new OTabWidget(this); | 48 | tabwidget=new OTabWidget(this); |
49 | setCentralWidget(tabwidget); | 49 | setCentralWidget(tabwidget); |
50 | connect(tabwidget,SIGNAL(currentChanged( QWidget *)),this,SLOT(slotCurrentChanged(QWidget *))); | 50 | connect(tabwidget,SIGNAL(currentChanged( QWidget *)),this,SLOT(slotCurrentChanged(QWidget *))); |
51 | 51 | ||
52 | //FILE ACTIONS | 52 | //FILE ACTIONS |
53 | QPopupMenu *popup = new QPopupMenu( this ); | 53 | QPopupMenu *popup = new QPopupMenu( this ); |
54 | 54 | ||
55 | // Action for creating a new document | 55 | // Action for creating a new document |
56 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); | 56 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); |
57 | a->addTo( popup ); | 57 | a->addTo( popup ); |
58 | connect(a, SIGNAL(activated()), this, SLOT(slotNew())); | 58 | connect(a, SIGNAL(activated()), this, SLOT(slotNew())); |
59 | 59 | ||
60 | // Action for opening an exisiting document | 60 | // Action for opening an exisiting document |
61 | a = new QAction( tr( "Open" ),Resource::loadPixmap( "fileopen" ) , QString::null, 0, this, 0 ); | 61 | a = new QAction( tr( "Open" ),Resource::loadPixmap( "fileopen" ) , QString::null, 0, this, 0 ); |
62 | a->addTo(popup); | 62 | a->addTo(popup); |
63 | connect(a, SIGNAL(activated()), this, SLOT(slotOpen())); | 63 | connect(a, SIGNAL(activated()), this, SLOT(slotOpen())); |
64 | 64 | ||
65 | 65 | ||
66 | // Action for saving document | 66 | // Action for saving document |
67 | a = new QAction( tr( "Save" ), Resource::loadPixmap( "save" ) , QString::null, 0, this, 0 ); | 67 | a = new QAction( tr( "Save" ), Resource::loadPixmap( "save" ) , QString::null, 0, this, 0 ); |
68 | a->addTo(popup); | 68 | a->addTo(popup); |
69 | connect(a, SIGNAL(activated()), this, SLOT(slotSave())); | 69 | connect(a, SIGNAL(activated()), this, SLOT(slotSave())); |
70 | 70 | ||
71 | // Action for saving document to a new name | 71 | // Action for saving document to a new name |
72 | 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 ); |
73 | a->addTo(popup); | 73 | a->addTo(popup); |
74 | connect(a, SIGNAL(activated()), this, SLOT(slotSaveAs())); | 74 | connect(a, SIGNAL(activated()), this, SLOT(slotSaveAs())); |
75 | 75 | ||
76 | // Action for closing the currently active document | 76 | // Action for closing the currently active document |
77 | a = new QAction( tr( "Close" ), Resource::loadPixmap( "quit_icon" ) , QString::null, 0, this, 0 ); | 77 | a = new QAction( tr( "Close" ), Resource::loadPixmap( "quit_icon" ) , QString::null, 0, this, 0 ); |
78 | a->addTo(popup); | 78 | a->addTo(popup); |
79 | connect(a, SIGNAL(activated()), this, SLOT(slotClose())); | 79 | connect(a, SIGNAL(activated()), this, SLOT(slotClose())); |
80 | 80 | ||
81 | 81 | ||
82 | mb->insertItem(tr("File"),popup); | 82 | mb->insertItem(tr("File"),popup); |
83 | 83 | ||
84 | //EDIT ACTIONS | 84 | //EDIT ACTIONS |
85 | 85 | ||
86 | // Action for cutting text | 86 | // Action for cutting text |
87 | editCut = new QToolButton( 0 ); | 87 | editCut = new QToolButton( 0 ); |
88 | editCut->setAutoRaise( true ); | 88 | editCut->setAutoRaise( true ); |
89 | editCut->setIconSet( Resource::loadPixmap( "cut" ) ); | 89 | editCut->setIconSet( Resource::loadPixmap( "cut" ) ); |
90 | 90 | ||
91 | // Action for Copying text | 91 | // Action for Copying text |
92 | editCopy = new QToolButton( 0 ); | 92 | editCopy = new QToolButton( 0 ); |
93 | editCopy->setAutoRaise( true ); | 93 | editCopy->setAutoRaise( true ); |
94 | editCopy->setIconSet( Resource::loadPixmap( "copy" ) ); | 94 | editCopy->setIconSet( Resource::loadPixmap( "copy" ) ); |
95 | 95 | ||
96 | // Action for pasting text | 96 | // Action for pasting text |
97 | editPaste = new QToolButton( 0 ); | 97 | editPaste = new QToolButton( 0 ); |
98 | editPaste->setAutoRaise( true ); | 98 | editPaste->setAutoRaise( true ); |
99 | editPaste->setIconSet( Resource::loadPixmap( "paste" ) ); | 99 | editPaste->setIconSet( Resource::loadPixmap( "paste" ) ); |
100 | 100 | ||
101 | // Action for finding / replacing text | 101 | // Action for finding / replacing text |
102 | editFindReplace = new QToolButton( 0 ); | 102 | editFindReplace = new QToolButton( 0 ); |
103 | editFindReplace->setAutoRaise( true ); | 103 | editFindReplace->setAutoRaise( true ); |
104 | editFindReplace->setIconSet( Resource::loadPixmap("find") ); | 104 | editFindReplace->setIconSet( Resource::loadPixmap("find") ); |
105 | 105 | ||
106 | // Action for undo | 106 | // Action for undo |
107 | editUndo = new QToolButton( 0 ); | 107 | editUndo = new QToolButton( 0 ); |
108 | editUndo->setAutoRaise( true ); | 108 | editUndo->setAutoRaise( true ); |
109 | editUndo->setIconSet( Resource::loadPixmap( "undo" ) ); | 109 | editUndo->setIconSet( Resource::loadPixmap( "undo" ) ); |
110 | 110 | ||
111 | // Action for redo | 111 | // Action for redo |
112 | editRedo = new QToolButton( 0 ); | 112 | editRedo = new QToolButton( 0 ); |
113 | editRedo->setAutoRaise( true ); | 113 | editRedo->setAutoRaise( true ); |
114 | editRedo->setIconSet( Resource::loadPixmap( "redo" ) ); | 114 | editRedo->setIconSet( Resource::loadPixmap( "redo" ) ); |
115 | 115 | ||
116 | //VIEW ACITONS | 116 | //VIEW ACITONS |
117 | popup = new QPopupMenu( this ); | 117 | popup = new QPopupMenu( this ); |
118 | 118 | ||
119 | viewIncFontSizes = new QAction( tr( "Font +" ), QString::null, 0, this, 0 ); | 119 | viewIncFontSizes = new QAction( tr( "Font +" ), QString::null, 0, this, 0 ); |
120 | viewIncFontSizes->addTo( popup ); | 120 | viewIncFontSizes->addTo( popup ); |
121 | 121 | ||
122 | viewDecFontSizes = new QAction( tr( "Font -" ), QString::null, 0, this, 0 ); | 122 | viewDecFontSizes = new QAction( tr( "Font -" ), QString::null, 0, this, 0 ); |
123 | viewDecFontSizes->addTo( popup ); | 123 | viewDecFontSizes->addTo( popup ); |
124 | 124 | ||
125 | mb->insertItem(tr("View"),popup); | 125 | mb->insertItem(tr("View"),popup); |
126 | 126 | ||
127 | popup = new QPopupMenu( this ); | 127 | popup = new QPopupMenu( this ); |
128 | mb->insertItem(tr("Utils"),popup); | 128 | mb->insertItem(tr("Utils"),popup); |
129 | 129 | ||
130 | 130 | ||
131 | mb->insertItem( editCut ); | 131 | mb->insertItem( editCut ); |
132 | mb->insertItem( editCopy ); | 132 | mb->insertItem( editCopy ); |
133 | mb->insertItem( editPaste ); | 133 | mb->insertItem( editPaste ); |
134 | mb->insertItem( editFindReplace ); | 134 | mb->insertItem( editFindReplace ); |
135 | mb->insertItem( editUndo ); | 135 | mb->insertItem( editUndo ); |
136 | mb->insertItem( editRedo ); | 136 | mb->insertItem( editRedo ); |
137 | 137 | ||
138 | 138 | ||
139 | //Highlight management | 139 | //Highlight management |
140 | hlmenu=new QPopupMenu(this); | 140 | hlmenu=new QPopupMenu(this); |
141 | HlManager *hlm=HlManager::self(); | 141 | HlManager *hlm=HlManager::self(); |
142 | for (int i=0;i<hlm->highlights();i++) | 142 | for (int i=0;i<hlm->highlights();i++) |
143 | { | 143 | { |
144 | hlmenu->insertItem(hlm->hlName(i),i); | 144 | hlmenu->insertItem(hlm->hlName(i),i); |
145 | } | 145 | } |
146 | popup->insertItem(tr("Highlighting"),hlmenu); | 146 | popup->insertItem(tr("Highlighting"),hlmenu); |
147 | 147 | ||
148 | 148 | ||
149 | utilSettings = new QAction( tr( "Settings" ), QString::null, 0, this, 0 ); | 149 | utilSettings = new QAction( tr( "Settings" ), QString::null, 0, this, 0 ); |
150 | utilSettings->addTo( popup); | 150 | utilSettings->addTo( popup); |
151 | 151 | ||
152 | if( qApp->argc() > 1) open(qApp->argv()[1]); | 152 | if( qApp->argc() > 1) open(qApp->argv()[1]); |
153 | else slotNew(); | 153 | else slotNew(); |
154 | 154 | ||
155 | } | 155 | } |
156 | 156 | ||
157 | TinyKate::~TinyKate( ) | 157 | TinyKate::~TinyKate( ) |
158 | { | 158 | { |
159 | qWarning("TinyKate destructor\n"); | 159 | qWarning("TinyKate destructor\n"); |
160 | 160 | ||
161 | shutDown=true; | 161 | shutDown=true; |
162 | while (currentView!=0) { | 162 | while (currentView!=0) { |
163 | slotClose(); | 163 | slotClose(); |
164 | } | 164 | } |
165 | 165 | ||
166 | if( KGlobal::config() != 0 ) { | 166 | if( KGlobal::config() != 0 ) { |
167 | qWarning("deleting KateConfig object..\n"); | 167 | qWarning("deleting KateConfig object..\n"); |
168 | delete KGlobal::config(); | 168 | delete KGlobal::config(); |
169 | } | 169 | } |
170 | } | 170 | } |
171 | 171 | ||
172 | void TinyKate::slotOpen( ) | 172 | void TinyKate::slotOpen( ) |
173 | { | 173 | { |
174 | QString filename = OFileDialog::getOpenFileName( OFileSelector::EXTENDED_ALL, | 174 | QString filename = Opie::OFileDialog::getOpenFileName( OFileSelector::EXTENDED_ALL, |
175 | QString::null); | 175 | QString::null); |
176 | if (!filename.isEmpty()) { | 176 | if (!filename.isEmpty()) { |
177 | open(filename); | 177 | open(filename); |
178 | } | 178 | } |
179 | } | 179 | } |
180 | 180 | ||
181 | void TinyKate::open(const QString & filename) | 181 | void TinyKate::open(const QString & filename) |
182 | { | 182 | { |
183 | KateDocument *kd= new KateDocument(false, false, this,0,this); | 183 | KateDocument *kd= new KateDocument(false, false, this,0,this); |
184 | KTextEditor::View *kv; | 184 | KTextEditor::View *kv; |
185 | QFileInfo fi(filename); | 185 | QFileInfo fi(filename); |
186 | QString filenamed = fi.fileName(); | 186 | QString filenamed = fi.fileName(); |
187 | tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed ); | 187 | tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed ); |
188 | qDebug(filename); | 188 | qDebug(filename); |
189 | 189 | ||
190 | kd->setDocName( filenamed); | 190 | kd->setDocName( filenamed); |
191 | kd->open( filename ); | 191 | kd->open( filename ); |
192 | viewCount++; | 192 | viewCount++; |
193 | } | 193 | } |
194 | 194 | ||
195 | void TinyKate::setDocument(const QString& fileref) | 195 | void TinyKate::setDocument(const QString& fileref) |
196 | { | 196 | { |
197 | open( fileref ); | 197 | open( fileref ); |
198 | } | 198 | } |
199 | 199 | ||
200 | void TinyKate::slotCurrentChanged( QWidget * view) | 200 | void TinyKate::slotCurrentChanged( QWidget * view) |
201 | { | 201 | { |
202 | if (currentView) { | 202 | if (currentView) { |
203 | 203 | ||
204 | disconnect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); | 204 | disconnect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); |
205 | disconnect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); | 205 | disconnect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); |
206 | disconnect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); | 206 | disconnect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); |
207 | disconnect(editUndo,SIGNAL(activated()),currentView,SLOT(undo())); | 207 | disconnect(editUndo,SIGNAL(activated()),currentView,SLOT(undo())); |
208 | disconnect(editRedo,SIGNAL(activated()),currentView,SLOT(redo())); | 208 | disconnect(editRedo,SIGNAL(activated()),currentView,SLOT(redo())); |
209 | disconnect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); | 209 | disconnect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); |
210 | disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); | 210 | disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); |
211 | disconnect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); | 211 | disconnect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); |
212 | disconnect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog())); | 212 | disconnect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog())); |
213 | } | 213 | } |
214 | 214 | ||
215 | currentView=(KTextEditor::View*)view; | 215 | currentView=(KTextEditor::View*)view; |
216 | 216 | ||
217 | connect(editCopy,SIGNAL(clicked()),currentView,SLOT(copy())); | 217 | connect(editCopy,SIGNAL(clicked()),currentView,SLOT(copy())); |
218 | connect(editCut,SIGNAL(clicked()),currentView,SLOT(cut())); | 218 | connect(editCut,SIGNAL(clicked()),currentView,SLOT(cut())); |
219 | connect(editPaste,SIGNAL(clicked()),currentView,SLOT(paste())); | 219 | connect(editPaste,SIGNAL(clicked()),currentView,SLOT(paste())); |
220 | connect(editUndo,SIGNAL(clicked()),currentView,SLOT(undo())); | 220 | connect(editUndo,SIGNAL(clicked()),currentView,SLOT(undo())); |
221 | connect(editRedo,SIGNAL(clicked()),currentView,SLOT(redo())); | 221 | connect(editRedo,SIGNAL(clicked()),currentView,SLOT(redo())); |
222 | connect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); | 222 | connect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); |
223 | connect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); | 223 | connect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); |
224 | connect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); | 224 | connect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); |
225 | connect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog())); | 225 | connect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog())); |
226 | 226 | ||
227 | } | 227 | } |
228 | 228 | ||
229 | void TinyKate::slotNew( ) | 229 | void TinyKate::slotNew( ) |
230 | { | 230 | { |
231 | KateDocument *kd= new KateDocument(false, false, this,0,this); | 231 | KateDocument *kd= new KateDocument(false, false, this,0,this); |
232 | KTextEditor::View *kv; | 232 | KTextEditor::View *kv; |
233 | tabwidget->addTab(kv=kd->createView(tabwidget,"BLAH"), | 233 | tabwidget->addTab(kv=kd->createView(tabwidget,"BLAH"), |
234 | "tinykate/tinykate", | 234 | "tinykate/tinykate", |
235 | tr("Unnamed %1").arg(nextUnnamed++)); | 235 | tr("Unnamed %1").arg(nextUnnamed++)); |
236 | viewCount++; | 236 | viewCount++; |
237 | } | 237 | } |
238 | 238 | ||
239 | void TinyKate::slotClose( ) | 239 | void TinyKate::slotClose( ) |
240 | { | 240 | { |
241 | if (currentView==0) return; | 241 | if (currentView==0) return; |
242 | KTextEditor::View *dv=currentView; | 242 | KTextEditor::View *dv=currentView; |
243 | currentView=0; | 243 | currentView=0; |
244 | tabwidget->removePage(dv); | 244 | tabwidget->removePage(dv); |
245 | delete dv->document(); | 245 | delete dv->document(); |
246 | viewCount--; | 246 | viewCount--; |
247 | if ((!viewCount) && (!shutDown)) slotNew(); | 247 | if ((!viewCount) && (!shutDown)) slotNew(); |
248 | } | 248 | } |
249 | 249 | ||
250 | void TinyKate::slotSave() { | 250 | void TinyKate::slotSave() { |
251 | // feel free to make this how you want | 251 | // feel free to make this how you want |
252 | if (currentView==0) return; | 252 | if (currentView==0) return; |
253 | 253 | ||
254 | // KateView *kv = (KateView*) currentView; | 254 | // KateView *kv = (KateView*) currentView; |
255 | KateDocument *kd = (KateDocument*) currentView->document(); | 255 | KateDocument *kd = (KateDocument*) currentView->document(); |
256 | // qDebug("saving file "+kd->docName()); | 256 | // qDebug("saving file "+kd->docName()); |
257 | if( kd->docName().isEmpty()) | 257 | if( kd->docName().isEmpty()) |
258 | slotSaveAs(); | 258 | slotSaveAs(); |
259 | else | 259 | else |
260 | kd->saveFile(); | 260 | kd->saveFile(); |
261 | // kv->save(); | 261 | // kv->save(); |
262 | // kd->saveFile(); | 262 | // kd->saveFile(); |
263 | } | 263 | } |
264 | 264 | ||
265 | void TinyKate::slotSaveAs() { | 265 | void TinyKate::slotSaveAs() { |
266 | if (currentView==0) return; | 266 | if (currentView==0) return; |
267 | KateDocument *kd = (KateDocument*) currentView->document(); | 267 | KateDocument *kd = (KateDocument*) currentView->document(); |
268 | 268 | ||
269 | QString filename=OFileDialog::getSaveFileName(OFileSelector::EXTENDED_ALL, | 269 | QString filename= Opie::OFileDialog::getSaveFileName(OFileSelector::EXTENDED_ALL, |
270 | QString::null); | 270 | QString::null); |
271 | if (!filename.isEmpty()) { | 271 | if (!filename.isEmpty()) { |
272 | qDebug("saving file "+filename); | 272 | qDebug("saving file "+filename); |
273 | QFileInfo fi(filename); | 273 | QFileInfo fi(filename); |
274 | QString filenamed = fi.fileName(); | 274 | QString filenamed = fi.fileName(); |
275 | kd->setDocFile( filename); | 275 | kd->setDocFile( filename); |
276 | kd->setDocName( filenamed); | 276 | kd->setDocName( filenamed); |
277 | kd->saveFile(); | 277 | kd->saveFile(); |
278 | // KTextEditor::View *dv = currentView; | 278 | // KTextEditor::View *dv = currentView; |
279 | // tabwidget->changeTab( dv, filenamed); | 279 | // tabwidget->changeTab( dv, filenamed); |
280 | // need to change tab label here | 280 | // need to change tab label here |
281 | } | 281 | } |
282 | 282 | ||
283 | } | 283 | } |
diff --git a/noncore/apps/tinykate/tinykate.h b/noncore/apps/tinykate/tinykate.h index a5ee9b9..f844c55 100644 --- a/noncore/apps/tinykate/tinykate.h +++ b/noncore/apps/tinykate/tinykate.h | |||
@@ -1,66 +1,66 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | tinykate.h | 2 | tinykate.h |
3 | Tiny KATE mainwindow | 3 | Tiny KATE mainwindow |
4 | ------------------- | 4 | ------------------- |
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 software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation. * | 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 | 17 | ||
18 | #ifndef __TINYKATE_H__ | 18 | #ifndef __TINYKATE_H__ |
19 | #define __TINYKATE_H__ | 19 | #define __TINYKATE_H__ |
20 | 20 | ||
21 | 21 | ||
22 | #include <qmainwindow.h> | 22 | #include <qmainwindow.h> |
23 | #include <opie/otabwidget.h> | 23 | #include <opie2/otabwidget.h> |
24 | #include <ktexteditor.h> | 24 | #include <ktexteditor.h> |
25 | 25 | ||
26 | class QToolButton; | 26 | class QToolButton; |
27 | class QAction; | 27 | class QAction; |
28 | class QPopupMenu; | 28 | class QPopupMenu; |
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 | static QString appName() { return QString::fromLatin1( "kate" ); }; | 36 | static QString appName() { return QString::fromLatin1( "kate" ); }; |
37 | 37 | ||
38 | 38 | ||
39 | public slots: | 39 | public slots: |
40 | void slotNew(); | 40 | void slotNew(); |
41 | void setDocument(const QString& fileref); | 41 | void setDocument(const QString& fileref); |
42 | 42 | ||
43 | protected slots: | 43 | protected slots: |
44 | void slotOpen(); | 44 | void slotOpen(); |
45 | void slotClose(); | 45 | void slotClose(); |
46 | void slotCurrentChanged(QWidget *); | 46 | void slotCurrentChanged(QWidget *); |
47 | void slotSave(); | 47 | void slotSave(); |
48 | void slotSaveAs(); | 48 | void slotSaveAs(); |
49 | protected: | 49 | protected: |
50 | void open(const QString&); | 50 | void open(const QString&); |
51 | private: | 51 | private: |
52 | QString currentFileName; | 52 | QString currentFileName; |
53 | OTabWidget *tabwidget; | 53 | OTabWidget *tabwidget; |
54 | KTextEditor::View *currentView; | 54 | KTextEditor::View *currentView; |
55 | bool shutDown; | 55 | bool shutDown; |
56 | 56 | ||
57 | QToolButton *editCopy, *editCut, *editPaste, *editUndo, *editRedo, *editFindReplace; | 57 | QToolButton *editCopy, *editCut, *editPaste, *editUndo, *editRedo, *editFindReplace; |
58 | QAction *viewIncFontSizes, *viewDecFontSizes, *utilSettings; | 58 | QAction *viewIncFontSizes, *viewDecFontSizes, *utilSettings; |
59 | 59 | ||
60 | QPopupMenu *hlmenu; | 60 | QPopupMenu *hlmenu; |
61 | uint nextUnnamed; | 61 | uint nextUnnamed; |
62 | uint viewCount; | 62 | uint viewCount; |
63 | }; | 63 | }; |
64 | 64 | ||
65 | 65 | ||
66 | #endif // __TINYKATE_H__ | 66 | #endif // __TINYKATE_H__ |
diff --git a/noncore/apps/tinykate/tinykate.pro b/noncore/apps/tinykate/tinykate.pro index 91d4230..ce22f8e 100644 --- a/noncore/apps/tinykate/tinykate.pro +++ b/noncore/apps/tinykate/tinykate.pro | |||
@@ -1,22 +1,22 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE = app |
2 | CONFIG = qt warn_on release quick-app | 2 | CONFIG = qt warn_on release quick-app |
3 | DESTDIR = $(OPIEDIR)/bin | 3 | DESTDIR = $(OPIEDIR)/bin |
4 | HEADERS = tinykate.h | 4 | HEADERS = tinykate.h |
5 | SOURCES = tinykate.cpp main.cpp | 5 | SOURCES = tinykate.cpp main.cpp |
6 | INTERFACES= | 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 \ |
13 | $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \ | 13 | $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \ |
14 | $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back | 14 | $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back |
15 | 15 | ||
16 | DEPENDPATH+= $(OPIEDIR)/include | 16 | DEPENDPATH += $(OPIEDIR)/include |
17 | LIBS += -lqpe -ltinykate -lopie | 17 | LIBS += -lqpe -ltinykate -lopiecore2 -lopieui2 |
18 | TARGET = kate | 18 | TARGET = kate |
19 | 19 | ||
20 | 20 | ||
21 | 21 | ||
22 | include ( $(OPIEDIR)/include.pro ) | 22 | include ( $(OPIEDIR)/include.pro ) |