shutdown-environment
Last change
on this file was
98db196,
checked in by Vadim Troshchinskiy Shmelev <vtroshchinskiy@…>, 2 months ago
|
Use DBus to command browser to quit or change URL
|
-
Property mode set to
100644
|
File size:
493 bytes
|
Line | |
---|
1 | #include "dbusinterface.h" |
---|
2 | #include <QCoreApplication> |
---|
3 | #include <QDebug> |
---|
4 | #include <QUrl> |
---|
5 | |
---|
6 | |
---|
7 | DBusInterface::DBusInterface(QObject *parent) : QObject{parent} { |
---|
8 | |
---|
9 | |
---|
10 | } |
---|
11 | |
---|
12 | void DBusInterface::quit() { |
---|
13 | qInfo() << "Quitting"; |
---|
14 | QCoreApplication::quit(); |
---|
15 | } |
---|
16 | |
---|
17 | |
---|
18 | void DBusInterface::setURL(const QString &url) { |
---|
19 | if (_mainWindow) { |
---|
20 | qInfo() << "Setting URL to" << url; |
---|
21 | _mainWindow->slotSetUrl(QUrl(url)); |
---|
22 | } else { |
---|
23 | qWarning() << "Can't set URL, no window reference"; |
---|
24 | } |
---|
25 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.