Online help and bugfixes. Version bump
[someplayer] / src / aboutform.cpp
index ab1ddf3..2edb7dd 100644 (file)
@@ -1,6 +1,8 @@
 #include "aboutform.h"
 #include "ui_aboutform.h"
 #include "config.h"
+#include <QWebView>
+#include <QDebug>
 
 using namespace SomePlayer::Storage;
 
@@ -13,6 +15,8 @@ AboutForm::AboutForm(QWidget *parent) :
        updateTranslations();
        setAttribute(Qt::WA_Maemo5StackedWindow);
        setWindowFlags(Qt::Window | windowFlags());
+       connect(ui->onlineHelpButton, SIGNAL(clicked()), this, SLOT(onlineHelp()));
+       ui->donateButton->hide();
 }
 
 AboutForm::~AboutForm()
@@ -29,3 +33,23 @@ void AboutForm::updateIcons() {
 void AboutForm::updateTranslations() {
        ui->retranslateUi(this);
 }
+
+void AboutForm::onlineHelp() {
+       Config config;
+       QWebView *view = new QWebView(this);
+       view->setAttribute(Qt::WA_Maemo5StackedWindow);
+       view->setWindowFlags(Qt::Window | view->windowFlags());
+       QString lang = config.getValue("ui/language").toString();
+       QString icons_theme = config.getValue("ui/iconstheme").toString();
+       QColor background = palette().color(QPalette::Active, QPalette::Background);
+       QColor text = palette().color(QPalette::Active, QPalette::Text);
+       QString paramBg = QString("%1:%2:%3").arg(background.red()).arg(background.blue()).arg(background.green());
+       QString paramText = QString("%1:%2:%3").arg(text.red()).arg(text.blue()).arg(text.green());
+       QString url = QString("http://someplayer.some-body.ru/help.php?bg=%1&text=%2&lang=%3&iconstheme=%4")
+                     .arg(paramBg).arg(paramText).arg(lang).arg(icons_theme);
+       view->load(QUrl(url));
+       view->show();
+}
+
+void AboutForm::donate() {
+}