diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-09-06 13:43:24 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-09-06 13:43:24 +0000 |
commit | 465e6dc6b65e9173764b7815bd449afa8bab11a6 (patch) | |
tree | e675be052893d6ec87d594e0b3532a1e8d8a2bcd | |
parent | try to fix 'not stealth on windows' bug by setting environment variable, need... (diff) | |
download | gpg4usb-465e6dc6b65e9173764b7815bd449afa8bab11a6.tar.gz gpg4usb-465e6dc6b65e9173764b7815bd449afa8bab11a6.zip |
minor changes in verify-method and some doxygen documenation
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@526 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r-- | TODO | 4 | ||||
-rw-r--r-- | editorpage.cpp | 4 | ||||
-rw-r--r-- | gpgwin.cpp | 11 | ||||
-rw-r--r-- | textedit.cpp | 13 | ||||
-rw-r--r-- | textedit.h | 172 |
5 files changed, 136 insertions, 68 deletions
@@ -8,12 +8,13 @@ Release 0.3.1 - show keys which verified message in different colour - css - set gpgme error language to chosen language (context.cpp:49) -- in verifycation dialog import multiple keys +- in verifycation dialog import multiple keys - inform user about verification errors - enum for verify status [DONE] - put sign/verify to toolbar and add shortcuts [DONE] - umlaute are not handled correctly in signing [DONE] - beautify icons for verify and sign +- check class / includes [DONE] BUGS: - Sometimes two or more stars are shown at modified documents @@ -24,7 +25,6 @@ Release 0.3.2 - check and add missing statusbar messages - set mainwindow-statusbar text via signal - more doku on building gpg4usb (especially on windows) -- check class / includes - clear cache nach Programmende (siehe kbasket) - check pointer usage (const/references) - add posibility to change password of key diff --git a/editorpage.cpp b/editorpage.cpp index dd34948..2f47f11 100644 --- a/editorpage.cpp +++ b/editorpage.cpp @@ -26,13 +26,9 @@ EditorPage::EditorPage(const QString &filePath, QWidget *parent) : QWidget(paren fullFilePath(filePath) { textPage = new QPlainTextEdit(); - - //notificationWidget = new QWidget(this); - //this->showVerifyLabel(false); mainLayout = new QVBoxLayout(); mainLayout->setSpacing(0); mainLayout->addWidget(textPage); - //mainLayout->addWidget(notificationWidget); mainLayout->setContentsMargins(0,0,0,0); setLayout(mainLayout); setAttribute(Qt::WA_DeleteOnClose); @@ -56,6 +56,7 @@ GpgWin::GpgWin() mKeyList->addMenuAction(appendSelectedKeysAct); mKeyList->addMenuAction(copyMailAddressToClipboardAct); mKeyList->addMenuAction(showKeyDetailsAct); + restoreSettings(); // open filename if provided as first command line parameter @@ -66,7 +67,6 @@ GpgWin::GpgWin() edit->loadFile(args[1]); } } - edit->curTextPage()->setFocus(); this->setWindowTitle(qApp->applicationName()); } @@ -626,7 +626,6 @@ void GpgWin::openKeyManagement() { if (!keyMgmt) { keyMgmt = new KeyMgmt(mCtx, iconPath); -// keyMgmt->resize(800, 400); } keyMgmt->show(); keyMgmt->raise(); @@ -756,7 +755,9 @@ void GpgWin::verify() while (sign) { timestamp.setTime_t(sign->timestamp); - if (gpg_err_code(sign->status) == 9) { + switch (gpg_err_code(sign->status)) + { + case GPG_ERR_NO_PUBKEY: verifyStatus=VERIFY_ERROR_WARN; verifyLabelText.append(tr("Key not present with Fingerprint: ")+QString(sign->fpr)); @@ -765,7 +766,8 @@ void GpgWin::verify() unknownKeyFound=true; verifyDetailText->append(tr("Key not present:")); //verifyDetailText->append(tr("Signature status: ")+gpg_strerror(sign->status)+"\nsig validity reason: "+QString(gpgme_strerror(sign->validity_reason))+"\n"); - } else { + break; + default: QString name = mKeyList->getKeyNameByFpr(sign->fpr); QString email =mKeyList->getKeyEmailByFpr(sign->fpr); qDebug() << email; @@ -775,6 +777,7 @@ void GpgWin::verify() verifyLabelText.append("<"+email+">"); } vn->setProperty("keyFound", true); + break; } verifyDetailText->append(tr("\nFingerprint: ")+QString(sign->fpr)+"\n\n"); verifyLabelText.append("\n"); diff --git a/textedit.cpp b/textedit.cpp index 68e5ad9..d7d4ad6 100644 --- a/textedit.cpp +++ b/textedit.cpp @@ -150,10 +150,6 @@ bool TextEdit::saveAs() return saveFile(fileName); } - -/** - * close current tab - */ void TextEdit::closeTab() { removeTab(tabWidget->currentIndex()); @@ -232,13 +228,6 @@ bool TextEdit::maybeSaveCurrentTab(bool askToSave) { return true; } -/** - * Checks if there are unsaved documents in any tab, - * which may need to be saved. Call this function before - * closing the programme or all tabs. - * - * If it returns false, the close event should be aborted. - */ bool TextEdit::maybeSaveAnyTab() { // get a list of all unsaved documents and their tabids @@ -372,8 +361,6 @@ void TextEdit::print() #endif } -/** put a * in front of every modified document tab - */ void TextEdit::showModified() { int index=tabWidget->currentIndex(); QString title= tabWidget->tabText(index); @@ -39,44 +39,48 @@ class QWidget; class QString; class QTabWidget; +/** + * @brief TextEdit class + * @copyright GNU Public License 2 + */ class TextEdit : public QWidget { Q_OBJECT public: + /** + * @brief + * + * @param iconPath + */ TextEdit(QString iconPath); - /**************************************************************************************** - * Name: loadFile - * Description: Load the content of file into the current textpage - * Parameters: Qstring containg the filename - * Return Values: the pointer to the currently activated textpage - * Change on members: textpage is filles with filecontents - */ + /** + * @brief Load the content of file into the current textpage + * + * @param fileName QString containing the filename to load + * @return nothing + */ void loadFile(const QString &fileName); - /**************************************************************************************** - * Name: maybeSaveAnyTab - * Description: ask if tabs should be saved - * Parameters: none - * Return Values false, if the close event should be aborted. - * Change on members: none - */ + + /** + * @details Checks if there are unsaved documents in any tab, + * which may need to be saved. Call this function before + * closing the programme or all tabs. + * @return \li false, if the close event should be aborted. + * \li true, otherwise + */ bool maybeSaveAnyTab(); - /**************************************************************************************** - * Name: curTextPage - * Description: The currently activated Page - * Parameters: none - * Return Values: the pointer to the currently activated textpage - * Change on members: - */ + + /** + * @details textpage of the currently activated tab + */ QPlainTextEdit* curTextPage(); - /**************************************************************************************** - * Name: unsavedDocuments - * Description: List of currently unsaved tabs - * Parameters: none - * Return Values: a hash of tabindexes and title of unsaved tabs - * Change on members: - */ + + /** + * @details List of currently unsaved tabs + * @returns QHash<int, QString> Hash of tabindexes and title of unsaved tabs + */ QHash<int, QString> unsavedDocuments(); public slots: @@ -87,6 +91,10 @@ public slots: * Return Values: none * Change on members: */ + /** + * @brief + * + */ void quote(); /**************************************************************************************** @@ -97,6 +105,10 @@ public slots: * Return Values: none * Change on members: */ + /** + * @brief + * + */ void save(); /**************************************************************************************** @@ -106,6 +118,10 @@ public slots: * Return Values: just returns the return value of the saveFile method * Change on members: none */ + /** + * @brief + * + */ bool saveAs(); /**************************************************************************************** @@ -117,6 +133,10 @@ public slots: * Return Values: none * Change on members: none */ + /** + * @brief + * + */ void open(); /**************************************************************************************** @@ -126,6 +146,10 @@ public slots: * Return Values: none * Change on members: none */ + /** + * @brief + * + */ void print(); /**************************************************************************************** @@ -136,23 +160,21 @@ public slots: * Return Values: none * Change on members: increases countPage per 1 */ + /** + * @details Adds a new tab with the title "untitled"+countpage+".txt" + * Sets the focus to the new tab. Increase Tab-Count by one + */ void newTab(); - /**************************************************************************************** - * Name: showModified - * Description: show an "*" in tabtitle, if textedit is modified - * Parameters: none - * Return Values: none - * Change on members: add "*" to title of current tab, if current textedit is modified - */ + /** + * @details put a * in front of current tabs title, if current textedit is modified + */ void showModified(); - /**************************************************************************************** - * Name: closeTab - * Description: closes the tab choosen - * Parameters: none - * Return Values: none - * Change on members: decreases countPage per 1 - */ + + /** + * @details close the current tab and decrease TabWidget->count by \a 1 + * + */ void closeTab(); /**************************************************************************************** * Name: switchTabUp @@ -161,6 +183,10 @@ public slots: * Return Values: none * Change on members: increase tabWidget->count() per 1 */ + /** + * @brief + * + */ void switchTabUp(); /**************************************************************************************** * Name: switchTabDown @@ -169,6 +195,10 @@ public slots: * Return Values: none * Change on members: decrease tabWidget->count() per 1 */ + /** + * @brief + * + */ void switchTabDown(); /**************************************************************************************** * Name: curPage @@ -177,6 +207,10 @@ public slots: * Return Values: pointer to the currently activated tabpage * Change on members: none */ + /** + * @brief + * + */ EditorPage *curPage(); private: @@ -187,17 +221,31 @@ private: * Return Values: QStirng containig the filename * Change on members: none */ + /** + * @brief + * + * @param fullFileName + */ QString strippedName(const QString &fullFileName); + /** + * @brief + * + */ bool maybeSaveFile(); + /** + * @brief + * + * @param askToSave + */ bool maybeSaveCurrentTab(bool askToSave); - QString mIconPath; + QString mIconPath; /**< TODO */ /**************************************************************************************** * Name: countPage * Description: int cotaining the number of added tabs */ - int countPage; - QTabWidget *tabWidget; + int countPage; /**< TODO */ + QTabWidget *tabWidget; /**< TODO */ private slots: /**************************************************************************************** @@ -207,6 +255,11 @@ private slots: * Return Values: none * Change on members: none */ + /** + * @brief + * + * @param index + */ void removeTab(int index); /**************************************************************************************** @@ -216,6 +269,10 @@ private slots: * Return Values: none * Change on members: none */ + /** + * @brief + * + */ void cut(); /**************************************************************************************** @@ -225,6 +282,10 @@ private slots: * Return Values: none * Change on members: none */ + /** + * @brief + * + */ void copy(); /**************************************************************************************** @@ -234,6 +295,10 @@ private slots: * Return Values: none * Change on members: none */ + /** + * @brief + * + */ void paste(); /**************************************************************************************** @@ -244,6 +309,10 @@ private slots: * Change on members: none */ + /** + * @brief + * + */ void undo(); /**************************************************************************************** * Name: redo @@ -252,6 +321,10 @@ private slots: * Return Values: none * Change on members: none */ + /** + * @brief + * + */ void redo(); /**************************************************************************************** @@ -261,6 +334,10 @@ private slots: * Return Values: none * Change on members: none */ + /** + * @brief + * + */ void selectAll(); protected: @@ -274,6 +351,11 @@ protected: * false, if parameter filename is empty or the saving failed * Change on members: sets isModified of the current tab to false */ + /** + * @brief + * + * @param fileName + */ bool saveFile(const QString &fileName); }; #endif // TEXTEDIT |