-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmaindbus.cpp
More file actions
26 lines (21 loc) · 762 Bytes
/
maindbus.cpp
File metadata and controls
26 lines (21 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "cefhandler.h"
#include "theweb_adaptor.h"
extern CefHandler* handler;
MainDBus::MainDBus(QObject *parent) : QObject(parent)
{
new ThewebAdaptor(this);
QDBusConnection::sessionBus().registerService("org.thesuite.theweb");
QDBusConnection::sessionBus().registerObject("/org/thesuite/theweb", this);
}
void MainDBus::newWindow() {
MainWindow* window = new MainWindow();
window->show();
}
void MainDBus::newWindow(QString url) {
Browser browser = CefBrowserHost::CreateBrowserSync(CefWindowInfo(), handler, url.toStdString(), CefBrowserSettings(), CefRefPtr<CefRequestContext>());
MainWindow* window = new MainWindow(browser);
window->show();
}
uint MainDBus::processID() {
return QApplication::applicationPid();
}