aboutsummaryrefslogtreecommitdiffstats
path: root/textedit.h
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-01-01 23:53:51 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-01-01 23:53:51 +0000
commit6ce7b92a92cc6785a2d155bb25024ffbd15958ae (patch)
tree688ed2b0c3e2160e2ab414fb436caa12f56c2d70 /textedit.h
parentadded GPL to textedit-files (diff)
downloadgpg4usb-6ce7b92a92cc6785a2d155bb25024ffbd15958ae.tar.gz
gpg4usb-6ce7b92a92cc6785a2d155bb25024ffbd15958ae.zip
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
Diffstat (limited to 'textedit.h')
-rw-r--r--textedit.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/textedit.h b/textedit.h
index d2c6197..58bcaab 100644
--- a/textedit.h
+++ b/textedit.h
@@ -30,35 +30,55 @@
#include <QFileInfo>
#include <QApplication>
#include <QFile>
+#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