source: SMSSender/gateways/Schoolnet/gui/ui/widgets/questionbox.h @ 385:5f0e735f46e1

separation-frontend-backend
Last change on this file since 385:5f0e735f46e1 was 385:5f0e735f46e1, checked in by Sämy Zehnder <saemy.zehnder@…>, 5 years ago
  • Fixes crash when switching to another question in the Schoolnet send-integration and then providing the answer for it.
File size: 1.8 KB
Line 
1/*
2 Schoolnet gateway plugin - The smssender plugin for the Schoolnet sms platform.
3 Copyright (C) 2010-2014, gorrión. See http://smssender.gorrion.ch
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 */
18#ifndef SCHOOLNET_GUI_UI_WIDGETS_QUESTIONBOX_H
19#define SCHOOLNET_GUI_UI_WIDGETS_QUESTIONBOX_H
20
21#include <QDialog>
22#include <QWidget>
23
24#include "ui_questionbox.h"
25
26#include "gateways/Schoolnet/business/deepthought/datatypes.h"
27
28class QRadioButton;
29
30namespace Schoolnet {
31namespace DeepThought {
32namespace UI {
33
34class QuestionBox : public QWidget {
35    Q_OBJECT
36
37public:
38    QuestionBox(const Question *question, QWidget *parent);
39    ~QuestionBox();
40
41    enum DialogCode { NextQuestion = QDialog::Accepted+1 };
42
43    void loadQuestion(const Question *question);
44
45signals:
46    void answerProvided(DeepThought::Answer *answer);
47    void rejected();
48    void nextQuestionRequested();
49
50private:
51    ::Ui::QuestionBoxClass ui; // TODO: Fix namespace
52
53    const Question *m_question;
54
55    QLabel *m_hintLabel;
56    QList<QRadioButton*> m_radios;
57
58
59private slots:
60    void on_answerRadioToggled(bool checked);
61    void on_btnsNavigation_clicked(QAbstractButton *button);
62
63};
64
65} // namespace UI
66} // namespace DeepThought
67} // namespace Schoolnet
68
69#endif // SCHOOLNET_GUI_UI_WIDGETS_QUESTIONBOX_H
Note: See TracBrowser for help on using the repository browser.