From 6ce7b92a92cc6785a2d155bb25024ffbd15958ae Mon Sep 17 00:00:00 2001 From: nils Date: Sat, 1 Jan 2011 23:53:51 +0000 Subject: added tabs to editor, but VERY buggy till now git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@418 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- textedit.h | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'textedit.h') diff --git a/textedit.h b/textedit.h index d2c6197..58bcaab 100644 --- a/textedit.h +++ b/textedit.h @@ -30,35 +30,55 @@ #include #include #include +#include "editorpage.h" class QWidget; class QString; +class QTabWidget; -class TextEdit : public QPlainTextEdit +class TextEdit : public QWidget { Q_OBJECT public: - TextEdit(QWidget *parent=0); + TextEdit(); void setCurrentFile(const QString &fileName); void loadFile(const QString &fileName); bool maybeSave(); + QPlainTextEdit* curTextPage(); public slots: void quote(); - bool save(); + void save(); bool saveAs(); void open(); void print(); private: bool isKey(QString key); - bool saveFile(const QString &fileName); QString strippedName(const QString &fullFileName); QString curFile; + int countPage; + QTabWidget *tabWidget; + bool maybeSaveFile(); + EditorPage *curPage(); + void setCursorPosition(); + +private slots: + void removeTab(int index); + void cut(); + void copy(); + void paste(); + void undo(); + void redo(); + void selectAll(); protected: void dragEnterEvent(QDragEnterEvent *event); void dropEvent(QDropEvent* event); + void newFile(); + bool saveFile(const QString &fileName); + bool closeFile(); + }; #endif // TEXTEDIT -- cgit v1.2.3