~ubuntu-branches/ubuntu/trusty/krusader/trusty

« back to all changes in this revision

Viewing changes to krusader/Panel/viewactions.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-08-08 13:47:36 UTC
  • mfrom: (1.2.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20110808134736-8e630ivgd2c3sgg5
Tags: 1:2.4.0~beta1-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#include "../krmainwindow.h"
35
35
 
36
36
#include <klocale.h>
 
37
#include <ktoggleaction.h>
37
38
 
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");
58
60
 
59
61
    // other stuff
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");
65
68
 
66
69
    // tooltips
141
144
    view()->invertSelection();
142
145
}
143
146
 
 
147
void ViewActions::restoreSelection()
 
148
{
 
149
    view()->restoreSelection();
 
150
}
 
151
 
144
152
// other stuff
145
153
 
146
154
void ViewActions::saveDefaultSettings()
163
171
    view()->op()->startQuickFilter();
164
172
}
165
173
 
 
174
void ViewActions::togglePreviews(bool show)
 
175
{
 
176
    view()->showPreviews(show);
 
177
}
 
178
 
166
179
void ViewActions::refreshActions()
167
180
{
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());
172
187
}