Changeset View
Changeset View
Standalone View
Standalone View
krusader/Panel/listpanelactions.cpp
Show All 20 Lines | |||||
21 | #include "listpanelactions.h" | 21 | #include "listpanelactions.h" | ||
22 | 22 | | |||
23 | #include "listpanel.h" | 23 | #include "listpanel.h" | ||
24 | #include "panelfunc.h" | 24 | #include "panelfunc.h" | ||
25 | #include "PanelView/krviewfactory.h" | 25 | #include "PanelView/krviewfactory.h" | ||
26 | #include "../krmainwindow.h" | 26 | #include "../krmainwindow.h" | ||
27 | #include "../Dialogs/krdialogs.h" | 27 | #include "../Dialogs/krdialogs.h" | ||
28 | #include "../KViewer/krviewer.h" | 28 | #include "../KViewer/krviewer.h" | ||
29 | #include "../icon.h" | ||||
29 | 30 | | |||
30 | // QtCore | 31 | // QtCore | ||
31 | #include <QSignalMapper> | 32 | #include <QSignalMapper> | ||
32 | // QtWidgets | 33 | // QtWidgets | ||
33 | #include <QActionGroup> | 34 | #include <QActionGroup> | ||
34 | 35 | | |||
35 | #include <KI18n/KLocalizedString> | 36 | #include <KI18n/KLocalizedString> | ||
36 | #include <KXmlGui/KActionCollection> | 37 | #include <KXmlGui/KActionCollection> | ||
37 | 38 | | |||
38 | 39 | | |||
39 | ListPanelActions::ListPanelActions(QObject *parent, KrMainWindow *mainWindow) : | 40 | ListPanelActions::ListPanelActions(QObject *parent, KrMainWindow *mainWindow) : | ||
40 | ActionsBase(parent, mainWindow) | 41 | ActionsBase(parent, mainWindow) | ||
41 | { | 42 | { | ||
42 | // set view type | 43 | // set view type | ||
43 | QSignalMapper *mapper = new QSignalMapper(this); | 44 | QSignalMapper *mapper = new QSignalMapper(this); | ||
44 | connect(mapper, SIGNAL(mapped(int)), SLOT(setView(int))); | 45 | connect(mapper, SIGNAL(mapped(int)), SLOT(setView(int))); | ||
45 | QActionGroup *group = new QActionGroup(this); | 46 | QActionGroup *group = new QActionGroup(this); | ||
46 | group->setExclusive(true); | 47 | group->setExclusive(true); | ||
47 | QList<KrViewInstance*> views = KrViewFactory::registeredViews(); | 48 | QList<KrViewInstance*> views = KrViewFactory::registeredViews(); | ||
48 | for(int i = 0; i < views.count(); i++) { | 49 | for(int i = 0; i < views.count(); i++) { | ||
49 | KrViewInstance *inst = views[i]; | 50 | KrViewInstance *inst = views[i]; | ||
50 | QAction *action = new QAction(QIcon::fromTheme(inst->icon()), inst->description(), group); | 51 | QAction *action = new QAction(Icon(inst->icon()), inst->description(), group); | ||
51 | action->setCheckable(true); | 52 | action->setCheckable(true); | ||
52 | connect(action, SIGNAL(triggered()), mapper, SLOT(map())); | 53 | connect(action, SIGNAL(triggered()), mapper, SLOT(map())); | ||
53 | mapper->setMapping(action, inst->id()); | 54 | mapper->setMapping(action, inst->id()); | ||
54 | _mainWindow->actions()->addAction("view" + QString::number(i), action); | 55 | _mainWindow->actions()->addAction("view" + QString::number(i), action); | ||
55 | _mainWindow->actions()->setDefaultShortcut(action, inst->shortcut()); | 56 | _mainWindow->actions()->setDefaultShortcut(action, inst->shortcut()); | ||
56 | setViewActions.insert(inst->id(), action); | 57 | setViewActions.insert(inst->id(), action); | ||
57 | } | 58 | } | ||
58 | 59 | | |||
▲ Show 20 Lines • Show All 157 Lines • Show Last 20 Lines |