Skip to content

Commit 8cf641d

Browse files
Added dbus capture (flameshot-org#4605)
1 parent 5a31152 commit 8cf641d

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

data/dbus/org.flameshot.Flameshot.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
<node>
33
<interface name="org.flameshot.Flameshot">
44

5+
<!--
6+
captureScreen:
7+
8+
Open the GUI screenshot capture tool.
9+
-->
10+
<method name="captureScreen"/>
11+
512
<!--
613
attachPin:
714
@data: Byte array containing the screenshot and geometry information.

src/core/flameshotdbusadapter.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-FileCopyrightText: 2017-2019 Alejandro Sirgo Rica & Contributors
33

44
#include "flameshotdbusadapter.h"
5+
#include "core/flameshot.h"
56
#include "core/flameshotdaemon.h"
67

78
FlameshotDBusAdapter::FlameshotDBusAdapter(QObject* parent)
@@ -10,6 +11,11 @@ FlameshotDBusAdapter::FlameshotDBusAdapter(QObject* parent)
1011

1112
FlameshotDBusAdapter::~FlameshotDBusAdapter() = default;
1213

14+
void FlameshotDBusAdapter::captureScreen()
15+
{
16+
Flameshot::instance()->gui(CaptureRequest(CaptureRequest::GRAPHICAL_MODE));
17+
}
18+
1319
void FlameshotDBusAdapter::attachScreenshotToClipboard(const QByteArray& data)
1420
{
1521
FlameshotDaemon::instance()->attachScreenshotToClipboard(data);

src/core/flameshotdbusadapter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class FlameshotDBusAdapter : public QDBusAbstractAdaptor
1515
virtual ~FlameshotDBusAdapter();
1616

1717
public slots:
18+
Q_NOREPLY void captureScreen();
1819
Q_NOREPLY void attachScreenshotToClipboard(const QByteArray& data);
1920
Q_NOREPLY void attachTextToClipboard(const QString& text,
2021
const QString& notification);

0 commit comments

Comments
 (0)