-rw-r--r-- | noncore/apps/tinykate/tinykate.cpp | 5 | ||||
-rw-r--r-- | noncore/apps/tinykate/tinykate.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/noncore/apps/tinykate/tinykate.cpp b/noncore/apps/tinykate/tinykate.cpp index 694efc6..ea7ea45 100644 --- a/noncore/apps/tinykate/tinykate.cpp +++ b/noncore/apps/tinykate/tinykate.cpp | |||
@@ -172,32 +172,37 @@ void TinyKate::slotOpen( ) | |||
172 | } | 172 | } |
173 | 173 | ||
174 | void TinyKate::open(const QString & filename) | 174 | void TinyKate::open(const QString & filename) |
175 | { | 175 | { |
176 | KateDocument *kd= new KateDocument(false, false, this,0,this); | 176 | KateDocument *kd= new KateDocument(false, false, this,0,this); |
177 | KTextEditor::View *kv; | 177 | KTextEditor::View *kv; |
178 | QFileInfo fi(filename); | 178 | QFileInfo fi(filename); |
179 | QString filenamed = fi.fileName(); | 179 | QString filenamed = fi.fileName(); |
180 | tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed ); | 180 | tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed ); |
181 | qDebug(filename); | 181 | qDebug(filename); |
182 | 182 | ||
183 | kd->setDocName( filenamed); | 183 | kd->setDocName( filenamed); |
184 | kd->open( filename ); | 184 | kd->open( filename ); |
185 | viewCount++; | 185 | viewCount++; |
186 | } | 186 | } |
187 | 187 | ||
188 | void TinyKate::setDocument(const QString& fileref) | ||
189 | { | ||
190 | open( fileref ); | ||
191 | } | ||
192 | |||
188 | void TinyKate::slotCurrentChanged( QWidget * view) | 193 | void TinyKate::slotCurrentChanged( QWidget * view) |
189 | { | 194 | { |
190 | if (currentView) { | 195 | if (currentView) { |
191 | 196 | ||
192 | disconnect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); | 197 | disconnect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); |
193 | disconnect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); | 198 | disconnect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); |
194 | disconnect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); | 199 | disconnect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); |
195 | disconnect(editUndo,SIGNAL(activated()),currentView,SLOT(undo())); | 200 | disconnect(editUndo,SIGNAL(activated()),currentView,SLOT(undo())); |
196 | disconnect(editRedo,SIGNAL(activated()),currentView,SLOT(redo())); | 201 | disconnect(editRedo,SIGNAL(activated()),currentView,SLOT(redo())); |
197 | disconnect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); | 202 | disconnect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); |
198 | disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); | 203 | disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); |
199 | disconnect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); | 204 | disconnect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); |
200 | disconnect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog())); | 205 | disconnect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog())); |
201 | } | 206 | } |
202 | 207 | ||
203 | currentView=(KTextEditor::View*)view; | 208 | currentView=(KTextEditor::View*)view; |
diff --git a/noncore/apps/tinykate/tinykate.h b/noncore/apps/tinykate/tinykate.h index cdd8f43..2e8ca74 100644 --- a/noncore/apps/tinykate/tinykate.h +++ b/noncore/apps/tinykate/tinykate.h | |||
@@ -23,32 +23,33 @@ | |||
23 | #include <opie/otabwidget.h> | 23 | #include <opie/otabwidget.h> |
24 | #include <ktexteditor.h> | 24 | #include <ktexteditor.h> |
25 | 25 | ||
26 | class QToolButton; | 26 | class 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 | 36 | ||
37 | public slots: | 37 | public slots: |
38 | void slotNew(); | 38 | void slotNew(); |
39 | void setDocument(const QString& fileref); | ||
39 | 40 | ||
40 | protected slots: | 41 | protected slots: |
41 | void slotOpen(); | 42 | void slotOpen(); |
42 | void slotClose(); | 43 | void slotClose(); |
43 | void slotCurrentChanged(QWidget *); | 44 | void slotCurrentChanged(QWidget *); |
44 | void slotSave(); | 45 | void slotSave(); |
45 | void slotSaveAs(); | 46 | void slotSaveAs(); |
46 | protected: | 47 | protected: |
47 | void open(const QString&); | 48 | void open(const QString&); |
48 | private: | 49 | private: |
49 | QString currentFileName; | 50 | QString currentFileName; |
50 | OTabWidget *tabwidget; | 51 | OTabWidget *tabwidget; |
51 | KTextEditor::View *currentView; | 52 | KTextEditor::View *currentView; |
52 | 53 | ||
53 | QToolButton *editCopy, *editCut, *editPaste, *editUndo, *editRedo, *editFindReplace; | 54 | QToolButton *editCopy, *editCut, *editPaste, *editUndo, *editRedo, *editFindReplace; |
54 | QAction *viewIncFontSizes, *viewDecFontSizes, *utilSettings; | 55 | QAction *viewIncFontSizes, *viewDecFontSizes, *utilSettings; |