Commit bb947d44 authored by Volker Krause's avatar Volker Krause
Browse files

Move feedback config dialog to the client widget library.

parent 1ff2739d
......@@ -4,7 +4,6 @@ set(analyzer_srcs
chart.cpp
connectdialog.cpp
datamodel.cpp
feedbackconfigdialog.cpp
main.cpp
mainwindow.cpp
product.cpp
......
......@@ -24,7 +24,6 @@
#include "chart.h"
#include "connectdialog.h"
#include "datamodel.h"
#include "feedbackconfigdialog.h"
#include "productmodel.h"
#include "restclient.h"
#include "serverinfo.h"
......@@ -32,7 +31,8 @@
#include "surveymodel.h"
#include "timeaggregationmodel.h"
#include "provider/core/provider.h"
#include <provider/widgets/feedbackconfigdialog.h>
#include <provider/core/provider.h>
#include <QApplication>
#include <QDebug>
......
set(userfeedback_widgets_srcs
feedbackconfigdialog.cpp
notificationwidget.cpp
)
......
......@@ -25,7 +25,7 @@
#include <QPushButton>
#include <QUrl>
using namespace UserFeedback::Analyzer;
using namespace UserFeedback;
FeedbackConfigDialog::FeedbackConfigDialog(QWidget *parent) :
QDialog(parent),
......
......@@ -18,6 +18,7 @@
#ifndef USERFEEDBACK_ANALYZER_FEEDBACKCONFIGDIALOG_H
#define USERFEEDBACK_ANALYZER_FEEDBACKCONFIGDIALOG_H
#include "userfeedbackwidgets_export.h"
#include <QDialog>
#include <memory>
......@@ -26,15 +27,13 @@ namespace UserFeedback {
class Provider;
namespace Analyzer {
namespace Ui
{
class FeedbackConfigDialog;
}
/** Configure which feedback a user wants to provide. */
class FeedbackConfigDialog : public QDialog
class USERFEEDBACKWIDGETS_EXPORT FeedbackConfigDialog : public QDialog
{
Q_OBJECT
public:
......@@ -52,7 +51,6 @@ private:
UserFeedback::Provider *m_provider;
};
}
}
#endif // USERFEEDBACK_ANALYZER_FEEDBACKCONFIGDIALOG_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>UserFeedback::Analyzer::FeedbackConfigDialog</class>
<widget class="QDialog" name="UserFeedback::Analyzer::FeedbackConfigDialog">
<class>UserFeedback::FeedbackConfigDialog</class>
<widget class="QDialog" name="UserFeedback::FeedbackConfigDialog">
<property name="geometry">
<rect>
<x>0</x>
......@@ -114,7 +114,7 @@
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>UserFeedback::Analyzer::FeedbackConfigDialog</receiver>
<receiver>UserFeedback::FeedbackConfigDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
......@@ -130,7 +130,7 @@
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>UserFeedback::Analyzer::FeedbackConfigDialog</receiver>
<receiver>UserFeedback::FeedbackConfigDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
......
......@@ -18,6 +18,7 @@
#include "orwell.h"
#include "ui_orwell.h"
#include <provider/widgets/feedbackconfigdialog.h>
#include <provider/core/provider.h>
#include <provider/core/surveyinfo.h>
......@@ -50,6 +51,12 @@ Orwell::Orwell(QWidget* parent) :
provider->setSurveyInterval(value);
});
connect(ui->actionContribute, &QAction::triggered, this, [this]() {
UserFeedback::FeedbackConfigDialog dlg(this);
dlg.setFeedbackProvider(provider.get());
dlg.exec();
});
connect(ui->actionQuit, &QAction::triggered, qApp, &QCoreApplication::quit);
}
......@@ -87,8 +94,6 @@ int main(int argc, char** argv)
provider.reset(new UserFeedback::Provider);
provider->setFeedbackServer(QUrl(QStringLiteral("https://feedback.volkerkrause.eu")));
provider->setSubmissionInterval(1);
provider->setSurveyInterval(0);
provider->setStatisticsCollectionMode(UserFeedback::Provider::AllStatistics);
Orwell mainWindow;
mainWindow.show();
......
......@@ -148,7 +148,14 @@
</property>
<addaction name="actionQuit"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
<string>&amp;Help</string>
</property>
<addaction name="actionContribute"/>
</widget>
<addaction name="menu_File"/>
<addaction name="menu_Help"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="actionQuit">
......@@ -156,6 +163,11 @@
<string>&amp;Quit</string>
</property>
</action>
<action name="actionContribute">
<property name="text">
<string>&amp;Contribute...</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment