Changeset View
Changeset View
Standalone View
Standalone View
src/libkdepim/progresswidget/statusbarprogresswidget.cpp
Show First 20 Lines • Show All 252 Lines • ▼ Show 20 Line(s) | 247 | case Clean: | |||
---|---|---|---|---|---|
253 | mStackedWidget->show(); | 253 | mStackedWidget->show(); | ||
254 | mStackedWidget->setCurrentWidget(mLabel); | 254 | mStackedWidget->setCurrentWidget(mLabel); | ||
255 | break; | 255 | break; | ||
256 | case Progress: | 256 | case Progress: | ||
257 | mStackedWidget->show(); | 257 | mStackedWidget->show(); | ||
258 | mStackedWidget->setCurrentWidget(mProgressBar); | 258 | mStackedWidget->setCurrentWidget(mProgressBar); | ||
259 | if (mShowButton) { | 259 | if (mShowButton) { | ||
260 | mShowDetailedProgress = mProgressDialog->wasLastShown(); | 260 | mShowDetailedProgress = mProgressDialog->wasLastShown(); | ||
261 | updateProgressButton(); | 261 | updateProgressButton(mShowDetailedProgress); | ||
262 | mButton->show(); | 262 | mButton->show(); | ||
263 | } | 263 | } | ||
264 | mSslLabel->setState(mSslLabel->lastState()); | 264 | mSslLabel->setState(mSslLabel->lastState()); | ||
265 | break; | 265 | break; | ||
266 | } | 266 | } | ||
267 | } | 267 | } | ||
268 | 268 | | |||
269 | void StatusbarProgressWidget::slotClean() | 269 | void StatusbarProgressWidget::slotClean() | ||
Show All 15 Lines | 283 | if (e->button() == Qt::LeftButton && mMode == Progress) { // toggle view on left mouse button | |||
285 | // clicks anywhere in the small one. | 285 | // clicks anywhere in the small one. | ||
286 | slotProgressButtonClicked(); | 286 | slotProgressButtonClicked(); | ||
287 | return true; | 287 | return true; | ||
288 | } | 288 | } | ||
289 | } | 289 | } | ||
290 | return QFrame::eventFilter(obj, ev); | 290 | return QFrame::eventFilter(obj, ev); | ||
291 | } | 291 | } | ||
292 | 292 | | |||
293 | void StatusbarProgressWidget::updateProgressButton() | 293 | void StatusbarProgressWidget::updateProgressButton(bool showingProgress) | ||
294 | { | 294 | { | ||
295 | if (!mShowDetailedProgress) { | 295 | if (!showingProgress) { | ||
296 | mButton->setIcon(QIcon::fromTheme(QStringLiteral("go-up"))); | 296 | mButton->setIcon(QIcon::fromTheme(QStringLiteral("go-up"))); | ||
297 | mButton->setToolTip(i18n("Show detailed progress window")); | 297 | mButton->setToolTip(i18n("Show detailed progress window")); | ||
298 | } else { | 298 | } else { | ||
299 | mButton->setIcon(QIcon::fromTheme(QStringLiteral("go-down"))); | 299 | mButton->setIcon(QIcon::fromTheme(QStringLiteral("go-down"))); | ||
300 | mButton->setToolTip(i18n("Hide detailed progress window")); | 300 | mButton->setToolTip(i18n("Hide detailed progress window")); | ||
301 | } | 301 | } | ||
302 | } | 302 | } | ||
303 | 303 | | |||
304 | void StatusbarProgressWidget::slotProgressButtonClicked() | 304 | void StatusbarProgressWidget::slotProgressButtonClicked() | ||
305 | { | 305 | { | ||
306 | mProgressDialog->slotToggleVisibility(); | 306 | mProgressDialog->slotToggleVisibility(); | ||
307 | mShowDetailedProgress = !mProgressDialog->isHidden(); | 307 | mShowDetailedProgress = !mProgressDialog->isHidden(); | ||
308 | updateProgressButton(); | | |||
309 | setFixedWidth(qMax(600, mProgressDialog->width())); | 308 | setFixedWidth(qMax(600, mProgressDialog->width())); | ||
310 | } | 309 | } | ||
311 | 310 | | |||
312 | void StatusbarProgressWidget::slotProgressDialogVisible(bool b) | 311 | void StatusbarProgressWidget::slotProgressDialogVisible(bool b) | ||
313 | { | 312 | { | ||
314 | // Show the hide/show button (mButton) as soon as the progress dialog is shown | 313 | // Show the hide/show button (mButton) as soon as the progress dialog is shown | ||
315 | // (StatusbarProgressWidget::slotShowItemDelayed happens later) | 314 | // (StatusbarProgressWidget::slotShowItemDelayed happens later) | ||
316 | if (b && mMode != Progress) { | 315 | if (b && mMode != Progress) { | ||
317 | setMode(Progress); | 316 | setMode(Progress); | ||
318 | } | 317 | } | ||
318 | | ||||
319 | updateProgressButton(b); | ||||
319 | } | 320 | } |