author | harlekin <harlekin> | 2003-04-26 19:12:45 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-04-26 19:12:45 (UTC) |
commit | 64c48b637c1bd1bef679bff500f3e0ce5365358d (patch) (side-by-side diff) | |
tree | ef7405ffc95384e52daa12af13a9e55f484d19a8 | |
parent | 9dfeb5f74c0d7f9611ec440e6e7760d2f19f73ae (diff) | |
download | opie-64c48b637c1bd1bef679bff500f3e0ce5365358d.zip opie-64c48b637c1bd1bef679bff500f3e0ce5365358d.tar.gz opie-64c48b637c1bd1bef679bff500f3e0ce5365358d.tar.bz2 |
added a setDocuments method
-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 @@ -164,48 +164,53 @@ TinyKate::~TinyKate( ) void TinyKate::slotOpen( ) { QString filename = OFileDialog::getOpenFileName( OFileSelector::EXTENDED_ALL, QPEApplication::documentDir()); if (!filename.isEmpty()) { open(filename); } } void TinyKate::open(const QString & filename) { KateDocument *kd= new KateDocument(false, false, this,0,this); KTextEditor::View *kv; QFileInfo fi(filename); QString filenamed = fi.fileName(); tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed ); qDebug(filename); kd->setDocName( filenamed); kd->open( filename ); viewCount++; } +void TinyKate::setDocument(const QString& fileref) +{ + open( fileref ); +} + void TinyKate::slotCurrentChanged( QWidget * view) { if (currentView) { disconnect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); disconnect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); disconnect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); disconnect(editUndo,SIGNAL(activated()),currentView,SLOT(undo())); disconnect(editRedo,SIGNAL(activated()),currentView,SLOT(redo())); disconnect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); disconnect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); disconnect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog())); } currentView=(KTextEditor::View*)view; connect(editCopy,SIGNAL(clicked()),currentView,SLOT(copy())); connect(editCut,SIGNAL(clicked()),currentView,SLOT(cut())); connect(editPaste,SIGNAL(clicked()),currentView,SLOT(paste())); connect(editUndo,SIGNAL(clicked()),currentView,SLOT(undo())); connect(editRedo,SIGNAL(clicked()),currentView,SLOT(redo())); connect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); connect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); 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 @@ -15,48 +15,49 @@ * * ***************************************************************************/ #ifndef __TINYKATE_H__ #define __TINYKATE_H__ #include <qmainwindow.h> #include <opie/otabwidget.h> #include <ktexteditor.h> class QToolButton; class QAction; class QPopupMenu; class TinyKate : public QMainWindow { Q_OBJECT public: TinyKate( QWidget *parent=0, const char *name=0, WFlags f = 0); ~TinyKate( ); public slots: void slotNew(); + void setDocument(const QString& fileref); protected slots: void slotOpen(); void slotClose(); void slotCurrentChanged(QWidget *); void slotSave(); void slotSaveAs(); protected: void open(const QString&); private: QString currentFileName; OTabWidget *tabwidget; KTextEditor::View *currentView; QToolButton *editCopy, *editCut, *editPaste, *editUndo, *editRedo, *editFindReplace; QAction *viewIncFontSizes, *viewDecFontSizes, *utilSettings; QPopupMenu *hlmenu; uint nextUnnamed; uint viewCount; }; #endif // __TINYKATE_H__ |