aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gpg4usb.pro6
-rw-r--r--helppage.cpp17
-rw-r--r--helppage.h20
-rw-r--r--mainwindow.cpp3
-rw-r--r--textedit.cpp9
-rw-r--r--textedit.h9
6 files changed, 61 insertions, 3 deletions
diff --git a/gpg4usb.pro b/gpg4usb.pro
index c7917db..772dda1 100644
--- a/gpg4usb.pro
+++ b/gpg4usb.pro
@@ -35,7 +35,8 @@ HEADERS += attachments.h \
verifynotification.h \
verifydetailsdialog.h \
verifykeydetailbox.h \
- wizard.h
+ wizard.h \
+ helppage.h
SOURCES += attachments.cpp \
gpgcontext.cpp \
@@ -58,7 +59,8 @@ SOURCES += attachments.cpp \
verifynotification.cpp \
verifydetailsdialog.cpp \
verifykeydetailbox.cpp \
- wizard.cpp
+ wizard.cpp \
+ helppage.cpp
RC_FILE = gpg4usb.rc
diff --git a/helppage.cpp b/helppage.cpp
new file mode 100644
index 0000000..144b044
--- /dev/null
+++ b/helppage.cpp
@@ -0,0 +1,17 @@
+#include "helppage.h"
+
+HelpPage::HelpPage(const QString path, QWidget *parent) :
+ QWidget(parent)
+{
+
+ QTextBrowser* browser = new QTextBrowser();
+ QVBoxLayout* mainLayout = new QVBoxLayout();
+ mainLayout->setSpacing(0);
+ mainLayout->addWidget(browser);
+ mainLayout->setContentsMargins(0,0,0,0);
+ setLayout(mainLayout);
+ //setAttribute(Qt::WA_DeleteOnClose);
+ browser->setSource(path);
+ browser->setFocus();
+
+}
diff --git a/helppage.h b/helppage.h
new file mode 100644
index 0000000..c5bdc49
--- /dev/null
+++ b/helppage.h
@@ -0,0 +1,20 @@
+#ifndef HELPPAGE_H
+#define HELPPAGE_H
+
+#include <QWidget>
+#include <QTextBrowser>
+#include <QVBoxLayout>
+
+class HelpPage : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit HelpPage(const QString path, QWidget *parent = 0);
+
+signals:
+
+public slots:
+
+};
+
+#endif // HELPPAGE_H
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 75879f8..f1c56bb 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -564,7 +564,8 @@ void MainWindow::openTranslate() {
}
void MainWindow::openTutorial() {
- QDesktopServices::openUrl(QUrl("http://gpg4usb.cpunk.de/docu.html"));
+ //QDesktopServices::openUrl(QUrl("http://gpg4usb.cpunk.de/docu.html"));
+ edit->newHelpTab("help", "http://gpg4usb.cpunk.de/docu.html");
}
void MainWindow::startWizard()
diff --git a/textedit.cpp b/textedit.cpp
index 064fa94..5ad8976 100644
--- a/textedit.cpp
+++ b/textedit.cpp
@@ -53,6 +53,15 @@ void TextEdit::newTab()
connect(page->getTextPage(), SIGNAL(modificationChanged(bool)), this, SLOT(showModified()));
}
+void TextEdit::newHelpTab(QString title, QString path)
+{
+
+ HelpPage *page = new HelpPage(path);
+ tabWidget->addTab(page, title);
+ tabWidget->setCurrentIndex(tabWidget->count() - 1);
+
+}
+
void TextEdit::open()
{
QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Open file"),
diff --git a/textedit.h b/textedit.h
index 8c162c1..67efd7e 100644
--- a/textedit.h
+++ b/textedit.h
@@ -23,6 +23,7 @@
#define __TEXTEDIT_H__
#include "editorpage.h"
+#include "helppage.h"
#include "quitdialog.h"
QT_BEGIN_NAMESPACE
@@ -129,6 +130,14 @@ public slots:
void newTab();
/**
+ * @details Adds a new tab with the given title and opens given html file.
+ * Increase Tab-Count by one
+ * @param title title for the tab
+ * @param path path for html file to show
+ */
+ void newHelpTab(QString title, QString path);
+
+ /**
* @details put a * in front of current tabs title, if current textedit is modified
*/
void showModified();