Changeset View
Changeset View
Standalone View
Standalone View
app/mainwindow.cpp
Show First 20 Lines • Show All 394 Lines • ▼ Show 20 Line(s) | 348 | { | |||
---|---|---|---|---|---|
395 | 395 | | |||
396 | QAction * leaveFullScreenAction = view->addAction("leave_fullscreen", q, SLOT(leaveFullScreen())); | 396 | QAction * leaveFullScreenAction = view->addAction("leave_fullscreen", q, SLOT(leaveFullScreen())); | ||
397 | leaveFullScreenAction->setIcon(QIcon::fromTheme("view-restore")); | 397 | leaveFullScreenAction->setIcon(QIcon::fromTheme("view-restore")); | ||
398 | leaveFullScreenAction->setPriority(QAction::LowPriority); | 398 | leaveFullScreenAction->setPriority(QAction::LowPriority); | ||
399 | leaveFullScreenAction->setText(i18nc("@action", "Leave Fullscreen Mode")); | 399 | leaveFullScreenAction->setText(i18nc("@action", "Leave Fullscreen Mode")); | ||
400 | 400 | | |||
401 | mGoToPreviousAction = view->addAction("go_previous", q, SLOT(goToPrevious())); | 401 | mGoToPreviousAction = view->addAction("go_previous", q, SLOT(goToPrevious())); | ||
402 | mGoToPreviousAction->setPriority(QAction::LowPriority); | 402 | mGoToPreviousAction->setPriority(QAction::LowPriority); | ||
403 | mGoToPreviousAction->setIcon(QIcon::fromTheme("media-skip-backward")); | 403 | mGoToPreviousAction->setIcon(QIcon::fromTheme("go-previous-view")); | ||
404 | mGoToPreviousAction->setText(i18nc("@action Go to previous image", "Previous")); | 404 | mGoToPreviousAction->setText(i18nc("@action Go to previous image", "Previous")); | ||
405 | mGoToPreviousAction->setToolTip(i18nc("@info:tooltip", "Go to previous image")); | 405 | mGoToPreviousAction->setToolTip(i18nc("@info:tooltip", "Go to previous image")); | ||
406 | actionCollection->setDefaultShortcut(mGoToPreviousAction, Qt::Key_Backspace); | 406 | actionCollection->setDefaultShortcut(mGoToPreviousAction, Qt::Key_Backspace); | ||
407 | installDisabledActionShortcutMonitor(mGoToPreviousAction, SLOT(showFirstDocumentReached())); | 407 | installDisabledActionShortcutMonitor(mGoToPreviousAction, SLOT(showFirstDocumentReached())); | ||
408 | 408 | | |||
409 | mGoToNextAction = view->addAction("go_next", q, SLOT(goToNext())); | 409 | mGoToNextAction = view->addAction("go_next", q, SLOT(goToNext())); | ||
410 | mGoToNextAction->setPriority(QAction::LowPriority); | 410 | mGoToNextAction->setPriority(QAction::LowPriority); | ||
411 | mGoToNextAction->setIcon(QIcon::fromTheme("media-skip-forward")); | 411 | mGoToNextAction->setIcon(QIcon::fromTheme("go-next-view")); | ||
412 | mGoToNextAction->setText(i18nc("@action Go to next image", "Next")); | 412 | mGoToNextAction->setText(i18nc("@action Go to next image", "Next")); | ||
413 | mGoToNextAction->setToolTip(i18nc("@info:tooltip", "Go to next image")); | 413 | mGoToNextAction->setToolTip(i18nc("@info:tooltip", "Go to next image")); | ||
414 | actionCollection->setDefaultShortcut(mGoToNextAction, Qt::Key_Space); | 414 | actionCollection->setDefaultShortcut(mGoToNextAction, Qt::Key_Space); | ||
415 | installDisabledActionShortcutMonitor(mGoToNextAction, SLOT(showLastDocumentReached())); | 415 | installDisabledActionShortcutMonitor(mGoToNextAction, SLOT(showLastDocumentReached())); | ||
416 | 416 | | |||
417 | mGoToFirstAction = view->addAction("go_first", q, SLOT(goToFirst())); | 417 | mGoToFirstAction = view->addAction("go_first", q, SLOT(goToFirst())); | ||
418 | mGoToFirstAction->setPriority(QAction::LowPriority); | 418 | mGoToFirstAction->setPriority(QAction::LowPriority); | ||
419 | mGoToFirstAction->setIcon(QIcon::fromTheme("go-first-view")); | ||||
419 | mGoToFirstAction->setText(i18nc("@action Go to first image", "First")); | 420 | mGoToFirstAction->setText(i18nc("@action Go to first image", "First")); | ||
420 | mGoToFirstAction->setToolTip(i18nc("@info:tooltip", "Go to first image")); | 421 | mGoToFirstAction->setToolTip(i18nc("@info:tooltip", "Go to first image")); | ||
421 | actionCollection->setDefaultShortcut(mGoToFirstAction, Qt::Key_Home); | 422 | actionCollection->setDefaultShortcut(mGoToFirstAction, Qt::Key_Home); | ||
422 | 423 | | |||
423 | mGoToLastAction = view->addAction("go_last", q, SLOT(goToLast())); | 424 | mGoToLastAction = view->addAction("go_last", q, SLOT(goToLast())); | ||
424 | mGoToLastAction->setPriority(QAction::LowPriority); | 425 | mGoToLastAction->setPriority(QAction::LowPriority); | ||
426 | mGoToLastAction->setIcon(QIcon::fromTheme("go-last-view")); | ||||
425 | mGoToLastAction->setText(i18nc("@action Go to last image", "Last")); | 427 | mGoToLastAction->setText(i18nc("@action Go to last image", "Last")); | ||
426 | mGoToLastAction->setToolTip(i18nc("@info:tooltip", "Go to last image")); | 428 | mGoToLastAction->setToolTip(i18nc("@info:tooltip", "Go to last image")); | ||
427 | actionCollection->setDefaultShortcut(mGoToLastAction, Qt::Key_End); | 429 | actionCollection->setDefaultShortcut(mGoToLastAction, Qt::Key_End); | ||
428 | 430 | | |||
429 | mPreloadDirectionIsForward = true; | 431 | mPreloadDirectionIsForward = true; | ||
430 | 432 | | |||
431 | mGoUpAction = view->addAction(KStandardAction::Up, q, SLOT(goUp())); | 433 | mGoUpAction = view->addAction(KStandardAction::Up, q, SLOT(goUp())); | ||
432 | 434 | | |||
▲ Show 20 Lines • Show All 985 Lines • ▼ Show 20 Line(s) | |||||
1418 | { | 1420 | { | ||
1419 | saveConfig(); | 1421 | saveConfig(); | ||
1420 | QList<QUrl> list = DocumentFactory::instance()->modifiedDocumentList(); | 1422 | QList<QUrl> list = DocumentFactory::instance()->modifiedDocumentList(); | ||
1421 | if (list.size() == 0) { | 1423 | if (list.size() == 0) { | ||
1422 | return true; | 1424 | return true; | ||
1423 | } | 1425 | } | ||
1424 | 1426 | | |||
1425 | KGuiItem yes(i18n("Save All Changes"), "document-save-all"); | 1427 | KGuiItem yes(i18n("Save All Changes"), "document-save-all"); | ||
1426 | KGuiItem no(i18n("Discard Changes")); | 1428 | KGuiItem no(i18n("Discard Changes"), "delete"); | ||
1427 | QString msg = i18np("One image has been modified.", "%1 images have been modified.", list.size()) | 1429 | QString msg = i18np("One image has been modified.", "%1 images have been modified.", list.size()) | ||
1428 | + '\n' | 1430 | + '\n' | ||
1429 | + i18n("If you quit now, your changes will be lost."); | 1431 | + i18n("If you quit now, your changes will be lost."); | ||
1430 | int answer = KMessageBox::warningYesNoCancel( | 1432 | int answer = KMessageBox::warningYesNoCancel( | ||
1431 | this, | 1433 | this, | ||
1432 | msg, | 1434 | msg, | ||
1433 | QString() /* caption */, | 1435 | QString() /* caption */, | ||
1434 | yes, | 1436 | yes, | ||
▲ Show 20 Lines • Show All 214 Lines • Show Last 20 Lines |