Commit 58522608 authored by Boudewijn Rempt's avatar Boudewijn Rempt

BUG:328332: Add a menu entry to open a file manager on the resources folder

parent 3abeca40
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd" ><kpartgui name="Krita" version="48">
<?xml version="1.0"?>
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="Krita" version="50">
<MenuBar>
<Menu name="file"><text>&amp;File</text>
......@@ -27,6 +29,8 @@
<Action name="revert"/>
<Separator/>
<Menu name="Resources"><text>&amp;Resources</text>
<Action name="open_resources_directory"/>
<Separator/>
<Action name="add_palette"/>
<Action name="edit_palette"/>
<Action name="edit_blacklist_cleanup"/>
......@@ -51,21 +55,21 @@
<Action name="view_ruler"/>
<!--Action name="view_guidelines"/-->
<Separator/>
<Action name="view_grid" />
<Action name="view_snap_to_grid" />
<Action name="view_grid"/>
<Action name="view_snap_to_grid"/>
<Menu name="view_fast_grid_config"><text>Grid Spacing</text>
<Action name="view_fast_grid_1x1" />
<Action name="view_fast_grid_2x2" />
<Action name="view_fast_grid_5x5" />
<Action name="view_fast_grid_10x10" />
<Action name="view_fast_grid_20x20" />
<Action name="view_fast_grid_40x40" />
<Action name="view_fast_grid_1x1"/>
<Action name="view_fast_grid_2x2"/>
<Action name="view_fast_grid_5x5"/>
<Action name="view_fast_grid_10x10"/>
<Action name="view_fast_grid_20x20"/>
<Action name="view_fast_grid_40x40"/>
</Menu>
<Separator/>
<Action name="view_toggle_perspective_grid" />
<Action name="view_clear_perspective_grid" />
<Action name="view_toggle_perspective_grid"/>
<Action name="view_clear_perspective_grid"/>
<Separator/>
<Action name="view_toggle_painting_assistants" />
<Action name="view_toggle_painting_assistants"/>
<Separator/>
<Action name="view_palette_action_menu"/>
<Separator/>
......@@ -110,7 +114,7 @@
<Action name="mirrorNodeY"/>
<DefineGroup name="layer_transform_merge" append="layer_transform_merge"/>
<Separator/>
<DefineGroup name="layer_properties_merge" />
<DefineGroup name="layer_properties_merge"/>
<Separator/>
<Action name="merge_layer"/>
<Action name="flatten_layer"/>
......@@ -127,7 +131,7 @@
<Action name="convert_to_vector_selection"/>
<Separator/>
<Action name="feather"/>
<Action name = "similar"/>
<Action name="similar"/>
<Separator/>
<Action name="toggle_display_selection"/>
</Menu>
......@@ -154,11 +158,12 @@
<Menu name="settings"><text>Settings</text>
<!--Action name="view_fullscreen" group="settings_show"/-->
<!--Action name="view_toggledockers" group="settings_show"/-->
<!--Action name="showStatusBar" group="settings_show"/-->
<Action name="view_toggledockers" group="settings_show"/>
<Action name="showStatusBar" group="settings_show"/>
<Action name="settings_active_author" group="settings_configure"/>
<Action name="preferences" group="settings_configure"/>
<Action name="theme_menu" />
<Action name="theme_menu"/>
<Action name="palette_manager"/>
</Menu>
</MenuBar>
......@@ -179,8 +184,6 @@
<Separator/>
<Action name="mirror_actions"/>
<Separator/>
<Action name="palette_manager"/>
<Separator/>
<Action name="workspaces"/>
</ToolBar>
......
......@@ -109,6 +109,7 @@ KisPaintopBox::KisPaintopBox(KisView2 * view, QWidget *parent, const char * name
m_eraseModeButton = new QToolButton(this);
m_eraseModeButton->setFixedSize(32, 32);
m_eraseModeButton->setCheckable(true);
KAction* eraseAction = new KAction(i18n("Set eraser mode"), m_eraseModeButton);
eraseAction->setIcon(koIcon("draw-eraser"));
eraseAction->setShortcut(Qt::Key_E);
......@@ -176,9 +177,6 @@ KisPaintopBox::KisPaintopBox(KisView2 * view, QWidget *parent, const char * name
m_cmbCompositeOp = new KisCompositeOpComboBox();
m_cmbCompositeOp->setFixedHeight(30);
m_paletteButton = new QPushButton(i18n("Save to Palette"));
m_paletteButton->setFixedHeight(30);
m_workspaceWidget = new KisPopupButton(view);
m_workspaceWidget->setIcon(koIcon("document-multiple"));
m_workspaceWidget->setToolTip(i18n("Choose workspace"));
......@@ -190,7 +188,7 @@ KisPaintopBox::KisPaintopBox(KisView2 * view, QWidget *parent, const char * name
baseLayout->addWidget(m_paintopWidget);
baseLayout->setContentsMargins(0, 0, 0, 0);
KAction* action;
m_layout = new QHBoxLayout(m_paintopWidget);
m_layout->addWidget(m_settingsWidget);
m_layout->addWidget(m_presetWidget);
......@@ -203,6 +201,9 @@ KisPaintopBox::KisPaintopBox(KisView2 * view, QWidget *parent, const char * name
compositeLayout->addWidget(m_eraseModeButton);
compositeLayout->addWidget(m_alphaLockButton);
compositeLayout->setContentsMargins(0, 0, 0, 0);
KAction* action;
action = new KAction(i18n("Brush composite"), this);
view->actionCollection()->addAction("composite_actions", action);
action->setDefaultWidget(compositeActions);
......@@ -237,6 +238,10 @@ KisPaintopBox::KisPaintopBox(KisView2 * view, QWidget *parent, const char * name
action->setShortcut(KShortcut(Qt::Key_Slash));
connect(action, SIGNAL(triggered()), this, SLOT(slotSwitchToPreviousPreset()));
action = new KAction(i18n("Save to Brush Palette"), this);
view->actionCollection()->addAction("palette_manager", action);
connect(action, SIGNAL(triggered()), this, SLOT(slotSaveToFavouriteBrushes()));
QWidget* mirrorActions = new QWidget(this);
QHBoxLayout* mirrorLayout = new QHBoxLayout(mirrorActions);
mirrorLayout->addWidget(hMirrorButton);
......@@ -246,10 +251,6 @@ KisPaintopBox::KisPaintopBox(KisView2 * view, QWidget *parent, const char * name
view->actionCollection()->addAction("mirror_actions", action);
action->setDefaultWidget(mirrorActions);
action = new KAction(i18n("Add to palette"), this);
view->actionCollection()->addAction("palette_manager", action);
action->setDefaultWidget(m_paletteButton);
action = new KAction(i18n("Workspaces"), this);
view->actionCollection()->addAction("workspaces", action);
action->setDefaultWidget(m_workspaceWidget);
......@@ -275,7 +276,6 @@ KisPaintopBox::KisPaintopBox(KisView2 * view, QWidget *parent, const char * name
connect(m_presetsPopup , SIGNAL(signalResourceSelected(KoResource*)), SLOT(resourceSelected(KoResource*)));
connect(m_presetsChooserPopup, SIGNAL(resourceSelected(KoResource*)) , SLOT(resourceSelected(KoResource*)));
connect(m_resourceProvider , SIGNAL(sigNodeChanged(const KisNodeSP)) , SLOT(slotNodeChanged(const KisNodeSP)));
connect(m_paletteButton , SIGNAL(clicked()) , SLOT(slotSaveToFavouriteBrushes()));
connect(m_cmbCompositeOp , SIGNAL(activated(int)) , SLOT(slotSetCompositeMode(int)));
connect(eraseAction , SIGNAL(triggered(bool)) , SLOT(slotToggleEraseMode(bool)));
connect(alphaLockAction , SIGNAL(triggered(bool)) , SLOT(slotToggleAlphaLockMode(bool)));
......
......@@ -149,7 +149,6 @@ private:
KisPaintOpPresetsPopup* m_presetsPopup;
KisPaintOpPresetsChooserPopup* m_presetsChooserPopup;
KisView2* m_view;
QPushButton* m_paletteButton;
KisPopupButton* m_workspaceWidget;
KisWidgetChooser* m_sliderChooser[3];
QMap<KoID,KisPaintOpSettingsWidget*> m_paintopOptionWidgets;
......
......@@ -29,6 +29,7 @@
#include "kis_view2.h"
#include <QPrinter>
#include <QDesktopServices>
#include <QDesktopWidget>
#include <QGridLayout>
#include <QRect>
......@@ -207,6 +208,7 @@ public:
KAction *createTemplate;
KAction *saveIncremental;
KAction *saveIncrementalBackup;
KAction *openResourcesDirectory;
KisSelectionManager *selectionManager;
KisControlFrame *controlFrame;
KisNodeManager *nodeManager;
......@@ -319,6 +321,12 @@ KisView2::KisView2(KoPart *part, KisDoc2 * doc, QWidget * parent)
m_d->mirrorCanvas->setShortcut(QKeySequence(Qt::Key_M));
connect(m_d->mirrorCanvas, SIGNAL(toggled(bool)),m_d->canvasController, SLOT(mirrorCanvas(bool)));
m_d->openResourcesDirectory = new KAction(i18n("Open Resources Folder"), this);
m_d->openResourcesDirectory->setToolTip(i18n("Opens a file browser at the location Krita saves resources such as brushes to."));
m_d->openResourcesDirectory->setWhatsThis(i18n("Opens a file browser at the location Krita saves resources such as brushes to."));
actionCollection()->addAction("open_resources_directory", m_d->openResourcesDirectory);
connect(m_d->openResourcesDirectory, SIGNAL(triggered()), SLOT(openResourcesDirectory()));
KAction *rotateCanvasRight = new KAction(i18n("Rotate Canvas Right"), this);
actionCollection()->addAction("rotate_canvas_right", rotateCanvasRight);
rotateCanvasRight->setShortcut(QKeySequence("Ctrl+]"));
......@@ -1436,6 +1444,12 @@ void KisView2::toggleTabletLogger()
m_d->canvas->toggleTabletLogger();
}
void KisView2::openResourcesDirectory()
{
QString dir = KStandardDirs::locateLocal("data", "krita");
QDesktopServices::openUrl(QUrl::fromLocalFile(dir));
}
void KisView2::showFloatingMessage(const QString message, const QIcon& icon)
{
// Yes, the @return is correct. But only for widget based KDE apps, not QML based ones
......
......@@ -217,6 +217,7 @@ private slots:
void showStatusBar(bool toggled);
void showJustTheCanvas(bool toggled);
void toggleTabletLogger();
void openResourcesDirectory();
private:
void createActions();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment