34
34
#include "../krmainwindow.h"
36
36
#include <klocale.h>
37
#include <ktoggleaction.h>
38
39
ViewActions::ViewActions(QObject *parent, KrMainWindow *mainWindow) :
39
40
ActionsBase(parent, mainWindow)
55
56
actUnselect = action(i18n("&Unselect Group..."), "kr_unselect", Qt::CTRL + Qt::Key_Minus, SLOT(unmarkGroup()), "unselect group");
56
57
actUnselectAll = action(i18n("U&nselect All"), "kr_unselectall", Qt::ALT + Qt::Key_Minus, SLOT(unmarkAll()), "unselect all");
57
58
actInvert = action(i18n("&Invert Selection"), "kr_invert", Qt::ALT + Qt::Key_Asterisk, SLOT(invertSelection()), "invert");
59
actRestoreSelection = action(i18n("Restore Selection"), 0, 0, SLOT(restoreSelection()), "restore_selection");
60
62
action(i18n("Show View Options Menu"), 0, 0, SLOT(showOptionsMenu()), "show_view_options_menu");
61
63
action(i18n("Set Focus to the Panel"), 0, Qt::Key_Escape, SLOT(focusPanel()), "focus_panel");
62
64
action(i18n("Apply settings to other tabs"), 0, 0, SLOT(applySettingsToOthers()), "view_apply_settings_to_others");
63
65
action(i18n("QuickFilter"), 0, Qt::CTRL + Qt::Key_I, SLOT(quickFilter()), "quick_filter");
66
actTogglePreviews = toggleAction(i18n("Show Previews"), 0, 0, SLOT(togglePreviews(bool)), "toggle previews");
64
67
KAction *actSaveaveDefaultSettings = action(i18n("Save settings as default"), 0, 0, SLOT(saveDefaultSettings()), "view_save_default_settings");
163
171
view()->op()->startQuickFilter();
174
void ViewActions::togglePreviews(bool show)
176
view()->showPreviews(show);
166
179
void ViewActions::refreshActions()
168
181
actDefaultZoom->setEnabled(view()->defaultFileIconSize() != view()->fileIconSize());
169
182
int idx = KrView::iconSizes.indexOf(view()->fileIconSize());
170
183
actZoomOut->setEnabled(idx > 0);
171
184
actZoomIn->setEnabled(idx < (KrView::iconSizes.count() - 1));
185
actRestoreSelection->setEnabled(view()->canRestoreSelection());
186
actTogglePreviews->setChecked(view()->previewsShown());