Browse Source

WIP: Feedback wizard

Neal Wilson 10 years ago
parent
commit
c086af39bb
4 changed files with 147 additions and 2 deletions
  1. 4
    2
      src/Typica.pro
  2. 127
    0
      src/feedback.w
  3. 15
    0
      src/helpmenu.w
  4. 1
    0
      src/resources.qrc

+ 4
- 2
src/Typica.pro View File

@@ -24,7 +24,8 @@ HEADERS += moc_typica.cpp \
24 24
     webelement.h \
25 25
     scale.h \
26 26
     draglabel.h \
27
-    daterangeselector.h
27
+    daterangeselector.h \
28
+    feedback.h
28 29
 SOURCES += typica.cpp \
29 30
     helpmenu.cpp \
30 31
     abouttypica.cpp \
@@ -33,7 +34,8 @@ SOURCES += typica.cpp \
33 34
     webelement.cpp \
34 35
     scale.cpp \
35 36
     draglabel.cpp \
36
-    daterangeselector.cpp
37
+    daterangeselector.cpp \
38
+    feedback.cpp
37 39
 
38 40
 RESOURCES += \
39 41
     resources.qrc

+ 127
- 0
src/feedback.w View File

@@ -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);

+ 15
- 0
src/helpmenu.w View File

@@ -26,6 +26,7 @@ class HelpMenu : public QMenu
26 26
 		HelpMenu();
27 27
 	public slots:
28 28
 		void displayAboutTypica();
29
+		void displayFeedbackWizard();
29 30
 };
30 31
 
31 32
 #endif
@@ -35,6 +36,7 @@ class HelpMenu : public QMenu
35 36
 @(helpmenu.cpp@>=
36 37
 #include "helpmenu.h"
37 38
 #include "abouttypica.h"
39
+#include "feedback.h"
38 40
 
39 41
 @<Help menu implementation@>@;
40 42
 
@@ -53,6 +55,10 @@ HelpMenu::HelpMenu() : QMenu()
53 55
 	aboutTypicaAction->setObjectName("aboutTypicaAction");
54 56
 	addAction(aboutTypicaAction);
55 57
 	connect(aboutTypicaAction, SIGNAL(triggered()), this, SLOT(displayAboutTypica()));
58
+	QAction *sendFeedbackAction = new QAction(tr("Send Feedback"), this);
59
+	sendFeedbackAction->setObjectName("sendFeedback");
60
+	addAction(sendFeedbackAction);
61
+	connect(sendFeedbackAction, SIGNAL(triggered()), this, SLOT(displayFeedbackWizard()));
56 62
 }
57 63
 
58 64
 @ When "About Typica" is selected from the menu, we display an about box. This
@@ -65,3 +71,12 @@ void HelpMenu::displayAboutTypica()
65 71
 	aboutBox->show();
66 72
 }
67 73
 
74
+@ A feedback wizard is also available from the Help menu.
75
+
76
+@<Help menu implementation@>=
77
+void HelpMenu::displayFeedbackWizard()
78
+{
79
+	FeedbackWizard *window = new FeedbackWizard;
80
+	window->show();
81
+}
82
+

+ 1
- 0
src/resources.qrc View File

@@ -11,6 +11,7 @@
11 11
         <file>resources/icons/tango/scalable/actions/list-remove.svg</file>
12 12
         <file>resources/icons/tango/index.theme</file>
13 13
         <file>resources/icons/appicons/logo.svg</file>
14
+        <file>resources/icons/appicons/logo48.png</file>
14 15
         <file>resources/icons/appicons/logo96.png</file>
15 16
         <file>resources/html/about.html</file>
16 17
         <file>resources/html/style.css</file>

Loading…
Cancel
Save