diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-01-23 18:18:36 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-01-23 18:18:36 +0000 |
commit | 0680d30d56b60fe7b26409d71c6757aba3c07983 (patch) | |
tree | cc938be951738e36f1ebbbef53bcb31b602c47b2 /textedit.h | |
parent | cleaned up a little (diff) | |
download | gpg4usb-0680d30d56b60fe7b26409d71c6757aba3c07983.tar.gz gpg4usb-0680d30d56b60fe7b26409d71c6757aba3c07983.zip |
now there's no asking to save every single document, if multiple documents are saved. Furthermore a lot of cleaning
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@443 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'textedit.h')
-rw-r--r-- | textedit.h | 69 |
1 files changed, 68 insertions, 1 deletions
@@ -43,17 +43,68 @@ public: TextEdit(QString iconPath); void loadFile(const QString &fileName); bool maybeSaveAnyTab(); - bool maybeSaveCurrentTab(); QPlainTextEdit* curTextPage(); QHash<int, QString> unsavedDocuments(); public slots: void quote(); + + /**************************************************************************************** + * Name: save + * Description: Saves the content of the current tab, if it has a filepath + * otherwise it calls saveAs for the current tab + * Parameters: none + * Return Values: none + * Change on members: + */ void save(); + + /**************************************************************************************** + * Name: SaveAs + * Description: Opens a savefiledialog and calls saveFile with the choosen filename + * Parameters: none + * Return Values: just returns the return value of the saveFile method + * Change on members: none + */ bool saveAs(); + + /**************************************************************************************** + * Name: open + * Description: shows an OpenFileDoalog and opens the file in a new tab + * shows an error dialog, if the open fails + * sets the focus to the tab of the opened file + * Parameters: none + * Return Values: none + * Change on members: none + */ void open(); + + /**************************************************************************************** + * Name: print + * Description: opens print dialog for the current tab + * Parameters: none + * Return Values: none + * Change on members: none + */ void print(); + + /**************************************************************************************** + * Name: newTab() + * Description: Adds a new tab with the title "untitled"+countpage+".txt" + * Sets the focus to the new tab + * Parameters: none + * Return Values: none + * Change on members: increases countPage per 1 + */ void newTab(); + + /**************************************************************************************** + * Name: + * Description: + * Parameters: + * Return Values: + * Change on members: + */ void showModified(); void closeTab(); void switchTabUp(); @@ -67,8 +118,16 @@ private: QString mIconPath; int countPage; QTabWidget *tabWidget; + bool maybeSaveCurrentTab(bool askToSave); private slots: + /**************************************************************************************** + * Name: removeTab + * Description: Removes the tab on index + * Parameters: int index, shows the index of the tab to remove + * Return Values: none + * Change on members: none + */ void removeTab(int index); void cut(); void copy(); @@ -80,6 +139,14 @@ private slots: protected: // void dragEnterEvent(QDragEnterEvent *event); // void dropEvent(QDropEvent* event); + /**************************************************************************************** + * Name: saveFile + * Description: Saves the content of currentTab to the file filename + * Parameters: QString filename contains the full path of the file to save + * Return Values: true, if the file was saved succesfully + * false, if parameter filename is empty or the saving failed + * Change on members: sets isModified of the current tab to false + */ bool saveFile(const QString &fileName); }; #endif // TEXTEDIT |