Changeset View
Changeset View
Standalone View
Standalone View
src/bugzillaintegration/reportassistantpages_base.cpp
Show First 20 Lines • Show All 124 Lines • ▼ Show 20 Line(s) | 124 | } else { | |||
---|---|---|---|---|---|
125 | return true; | 125 | return true; | ||
126 | } | 126 | } | ||
127 | } | 127 | } | ||
128 | 128 | | |||
129 | //END CrashInformationPage | 129 | //END CrashInformationPage | ||
130 | 130 | | |||
131 | //BEGIN BugAwarenessPage | 131 | //BEGIN BugAwarenessPage | ||
132 | 132 | | |||
133 | static QHash<int, ReportInterface::Reproducible> s_reproducibleIndex { | ||||
134 | { 0, ReportInterface::ReproducibleUnsure }, | ||||
135 | { 1, ReportInterface::ReproducibleNever }, | ||||
136 | { 2, ReportInterface::ReproducibleSometimes }, | ||||
137 | { 3, ReportInterface::ReproducibleEverytime } | ||||
138 | }; | ||||
139 | | ||||
133 | BugAwarenessPage::BugAwarenessPage(ReportAssistantDialog * parent) | 140 | BugAwarenessPage::BugAwarenessPage(ReportAssistantDialog * parent) | ||
134 | : ReportAssistantPage(parent) | 141 | : ReportAssistantPage(parent) | ||
135 | { | 142 | { | ||
136 | ui.setupUi(this); | 143 | ui.setupUi(this); | ||
137 | 144 | | |||
138 | ui.m_actionsInsideApp->setText(i18nc("@option:check kind of information the user can provide " | 145 | ui.m_actionsInsideApp->setText(i18nc("@option:check kind of information the user can provide " | ||
139 | "about the crash, %1 is the application name", | 146 | "about the crash, %1 is the application name", | ||
140 | "What I was doing when the application \"%1\" crashed", | 147 | "What I was doing when the application \"%1\" crashed", | ||
141 | DrKonqi::crashedApplication()->name())); | 148 | DrKonqi::crashedApplication()->name())); | ||
142 | 149 | | |||
143 | connect(ui.m_rememberGroup, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &BugAwarenessPage::updateCheckBoxes); | 150 | connect(ui.m_rememberGroup, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &BugAwarenessPage::updateCheckBoxes); | ||
144 | // Also listen to toggle so radio buttons are covered. | 151 | // Also listen to toggle so radio buttons are covered. | ||
145 | connect(ui.m_rememberGroup, static_cast<void (QButtonGroup::*)(int, bool)>(&QButtonGroup::buttonToggled), this, &BugAwarenessPage::updateCheckBoxes); | 152 | connect(ui.m_rememberGroup, static_cast<void (QButtonGroup::*)(int, bool)>(&QButtonGroup::buttonToggled), this, &BugAwarenessPage::updateCheckBoxes); | ||
146 | 153 | | |||
147 | ui.m_appSpecificDetailsExamples->setVisible(reportInterface()->appDetailsExamples()->hasExamples()); | 154 | ui.m_appSpecificDetailsExamples->setVisible(reportInterface()->appDetailsExamples()->hasExamples()); | ||
148 | ui.m_appSpecificDetailsExamples->setContextMenuPolicy(Qt::NoContextMenu); | 155 | ui.m_appSpecificDetailsExamples->setContextMenuPolicy(Qt::NoContextMenu); | ||
149 | 156 | | |||
150 | connect(ui.m_appSpecificDetailsExamples, &QLabel::linkActivated, this, &BugAwarenessPage::showApplicationDetailsExamples); | 157 | connect(ui.m_appSpecificDetailsExamples, &QLabel::linkActivated, this, &BugAwarenessPage::showApplicationDetailsExamples); | ||
158 | | ||||
159 | if (qEnvironmentVariableIsSet("DRKONQI_TEST_MODE")) { | ||||
160 | ui.m_rememberCrashSituationYes->setChecked(true); | ||||
161 | ui.m_reproducibleBox->setCurrentIndex( | ||||
162 | s_reproducibleIndex.key(ReportInterface::ReproducibleEverytime)); | ||||
163 | } | ||||
151 | } | 164 | } | ||
152 | 165 | | |||
153 | void BugAwarenessPage::aboutToShow() | 166 | void BugAwarenessPage::aboutToShow() | ||
154 | { | 167 | { | ||
155 | updateCheckBoxes(); | 168 | updateCheckBoxes(); | ||
156 | } | 169 | } | ||
157 | 170 | | |||
158 | void BugAwarenessPage::aboutToHide() | 171 | void BugAwarenessPage::aboutToHide() | ||
159 | { | 172 | { | ||
160 | //Save data | 173 | //Save data | ||
161 | ReportInterface::Reproducible reproducible = ReportInterface::ReproducibleUnsure; | 174 | ReportInterface::Reproducible reproducible = ReportInterface::ReproducibleUnsure; | ||
162 | switch(ui.m_reproducibleBox->currentIndex()) { | 175 | reproducible = s_reproducibleIndex.value(ui.m_reproducibleBox->currentIndex()); | ||
163 | case 0: { | | |||
164 | reproducible = ReportInterface::ReproducibleUnsure; | | |||
165 | break; | | |||
166 | } | | |||
167 | case 1: { | | |||
168 | reproducible = ReportInterface::ReproducibleNever; | | |||
169 | break; | | |||
170 | } | | |||
171 | case 2: { | | |||
172 | reproducible = ReportInterface::ReproducibleSometimes; | | |||
173 | break; | | |||
174 | } | | |||
175 | case 3: { | | |||
176 | reproducible = ReportInterface::ReproducibleEverytime; | | |||
177 | break; | | |||
178 | } | | |||
179 | } | | |||
180 | 176 | | |||
181 | reportInterface()->setBugAwarenessPageData(ui.m_rememberCrashSituationYes->isChecked(), | 177 | reportInterface()->setBugAwarenessPageData(ui.m_rememberCrashSituationYes->isChecked(), | ||
182 | reproducible, | 178 | reproducible, | ||
183 | ui.m_actionsInsideApp->isChecked(), | 179 | ui.m_actionsInsideApp->isChecked(), | ||
184 | ui.m_unusualSituation->isChecked(), | 180 | ui.m_unusualSituation->isChecked(), | ||
185 | ui.m_appSpecificDetails->isChecked()); | 181 | ui.m_appSpecificDetails->isChecked()); | ||
186 | } | 182 | } | ||
187 | 183 | | |||
▲ Show 20 Lines • Show All 282 Lines • Show Last 20 Lines |