|
@@ -0,0 +1,127 @@
|
|
1
|
+@* The Feedback Wizard.
|
|
2
|
+
|
|
3
|
+\noindent While the About Typica window includes a link for sending email, this
|
|
4
|
+is not as obvious as a Send Feedback option from the Help menu. It also does
|
|
5
|
+not provide an adequate amount of prompting for feedback to be useful.
|
|
6
|
+
|
|
7
|
+This functionality is provided in the form of a |QWizard| and five
|
|
8
|
+|QWizardPage|s to guide people through the feedback process.
|
|
9
|
+
|
|
10
|
+@(feedback.h@>=
|
|
11
|
+#include <QWizard>
|
|
12
|
+#include <QComboBox>
|
|
13
|
+#include <QTextEdit>
|
|
14
|
+#include <QLabel>
|
|
15
|
+
|
|
16
|
+#ifndef FeedbackHeader
|
|
17
|
+#define FeedbackHeader
|
|
18
|
+
|
|
19
|
+class FeedbackWizard : public QWizard
|
|
20
|
+{
|
|
21
|
+ Q_OBJECT
|
|
22
|
+ public:
|
|
23
|
+ FeedbackWizard();
|
|
24
|
+ private slots:
|
|
25
|
+ void setCommentInstructions(int index);
|
|
26
|
+ private:
|
|
27
|
+ QComboBox *feedbackType;
|
|
28
|
+ QLabel *commentInstructions;
|
|
29
|
+ QTextEdit *comment;
|
|
30
|
+};
|
|
31
|
+
|
|
32
|
+#endif
|
|
33
|
+
|
|
34
|
+@ Implementation is in a separate file.
|
|
35
|
+
|
|
36
|
+@(feedback.cpp@>=
|
|
37
|
+#include "feedback.h"
|
|
38
|
+#include <QLabel>
|
|
39
|
+#include <QVBoxLayout>
|
|
40
|
+#include <QWizardPage>
|
|
41
|
+
|
|
42
|
+@<Feedback wizard implementation@>@;
|
|
43
|
+
|
|
44
|
+@ The feedback wizard constructor is responsible for setting up its appearance,
|
|
45
|
+adding pages, and ensuring connections for properly responding to input are set
|
|
46
|
+up.
|
|
47
|
+
|
|
48
|
+@<Feedback wizard implementation@>=
|
|
49
|
+FeedbackWizard::FeedbackWizard() : QWizard()
|
|
50
|
+{
|
|
51
|
+ @<Set wizard graphics@>@;
|
|
52
|
+ @<Set feedback wizard pages@>@;
|
|
53
|
+}
|
|
54
|
+
|
|
55
|
+@ At present we do not have any custom graphics for wizards. If we did, they
|
|
56
|
+would go here.
|
|
57
|
+
|
|
58
|
+@<Set wizard graphics@>=
|
|
59
|
+/* Nothing needs to be done here. */
|
|
60
|
+
|
|
61
|
+@ The first page presented is an introduction page where we would like to know
|
|
62
|
+what sort of feedback is going to be provided. This is selected in a
|
|
63
|
+|QComboBox| which wil be used to update information on later pages.
|
|
64
|
+
|
|
65
|
+@<Set feedback wizard pages@>=
|
|
66
|
+QWizardPage *introPage = new QWizardPage;
|
|
67
|
+introPage->setTitle(tr("Send Feedback"));
|
|
68
|
+introPage->setSubTitle("Select the type of feedback you wish to provide");
|
|
69
|
+setPixmap(QWizard::LogoPixmap, QPixmap(":/resources/icons/appicons/logo48.png"));
|
|
70
|
+QLabel *page1prompt = new QLabel(tr("What sort of feedback would you like to provide?"));
|
|
71
|
+feedbackType = new QComboBox;
|
|
72
|
+feedbackType->addItem(tr("Bug Report"));
|
|
73
|
+feedbackType->addItem(tr("Comment"));
|
|
74
|
+feedbackType->addItem(tr("Feature Request"));
|
|
75
|
+feedbackType->addItem(tr("Question"));
|
|
76
|
+QVBoxLayout *page1layout = new QVBoxLayout;
|
|
77
|
+page1layout->addStretch();
|
|
78
|
+page1layout->addWidget(page1prompt);
|
|
79
|
+page1layout->addWidget(feedbackType);
|
|
80
|
+page1layout->addStretch();
|
|
81
|
+introPage->setLayout(page1layout);
|
|
82
|
+addPage(introPage);
|
|
83
|
+connect(feedbackType, SIGNAL(currentIndexChanged(int)), this, SLOT(setCommentInstructions(int)));
|
|
84
|
+commentInstructions = new QLabel;
|
|
85
|
+commentInstructions->setWordWrap(true);
|
|
86
|
+setCommentInstructions(0);
|
|
87
|
+
|
|
88
|
+@ The selection on the first page influences the instructions provided on the
|
|
89
|
+second page.
|
|
90
|
+
|
|
91
|
+@<Feedback wizard implementation@>=
|
|
92
|
+void FeedbackWizard::setCommentInstructions(int index)
|
|
93
|
+{
|
|
94
|
+ switch(index)
|
|
95
|
+ {
|
|
96
|
+ case 0:
|
|
97
|
+ commentInstructions->setText(tr("Please provide as complete a description of the issue as possible. Useful information includes step by step instructions for replicating the issue, the resulting behavior, and what you expected."));
|
|
98
|
+ break;
|
|
99
|
+ case 1:
|
|
100
|
+ commentInstructions->setText(tr("If you would like action to occur based on your comment, please be specific."));
|
|
101
|
+ break;
|
|
102
|
+ case 2:
|
|
103
|
+ commentInstructions->setText(tr("Please try to be as clear as possible about what you want, where you believe this would fit in with what is already provided, and provide a description of why this would be useful."));
|
|
104
|
+ break;
|
|
105
|
+ case 3:
|
|
106
|
+ commentInstructions->setText(tr("Please be specific and provide any information that you think might be useful in answering your question."));
|
|
107
|
+ break;
|
|
108
|
+ default:
|
|
109
|
+ commentInstructions->setText("");
|
|
110
|
+ break;
|
|
111
|
+ }
|
|
112
|
+}
|
|
113
|
+
|
|
114
|
+@ The second page provides both guidance on writing feedback and an area for typing this.
|
|
115
|
+
|
|
116
|
+@<Set feedback wizard pages@>=
|
|
117
|
+QWizardPage *commentPage = new QWizardPage;
|
|
118
|
+commentPage->setTitle(tr("Send Feedback"));
|
|
119
|
+commentPage->setSubTitle(tr("Your feedback is appreciated"));
|
|
120
|
+comment = new QTextEdit;
|
|
121
|
+QVBoxLayout *page2layout = new QVBoxLayout;
|
|
122
|
+page2layout->addStretch();
|
|
123
|
+page2layout->addWidget(commentInstructions);
|
|
124
|
+page2layout->addWidget(comment);
|
|
125
|
+page2layout->addStretch();
|
|
126
|
+commentPage->setLayout(page2layout);
|
|
127
|
+addPage(commentPage);
|