1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-10 21:18:19 +03:00

viewsdialog:provide paste action

This commit is contained in:
Michail Vourlakos 2021-04-26 13:16:56 +03:00
parent c6aadab090
commit ddd25a0215
2 changed files with 11 additions and 0 deletions

View File

@ -118,6 +118,7 @@ void Views::init()
m_pasteAction = new QAction(QIcon::fromTheme("edit-paste"), i18n("Paste"), m_view);
m_pasteAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_V));
connect(m_pasteAction, &QAction::triggered, this, &Views::pasteSelectedViews);
m_duplicateAction = new QAction(QIcon::fromTheme("edit-copy"), i18n("Duplicate Here"), m_view);
m_duplicateAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_D));
@ -225,6 +226,15 @@ void Views::copySelectedViews()
m_handler->layoutsController()->templatesKeeper()->setClipboardContents(clipboardviews);
}
void Views::pasteSelectedViews()
{
Data::ViewsTable clipboardviews = m_handler->layoutsController()->templatesKeeper()->clipboardContents();
for(int i=0; i<clipboardviews.rowCount(); ++i) {
appendViewFromViewTemplate(clipboardviews[i]);
}
}
void Views::duplicateSelectedViews()
{
qDebug() << Q_FUNC_INFO;

View File

@ -86,6 +86,7 @@ public:
public slots:
void copySelectedViews();
void duplicateSelectedViews();
void pasteSelectedViews();
void removeSelectedViews();
signals: