mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-12-16 07:23:41 +00:00
add dbus interface proto
This commit is contained in:
@ -18,6 +18,7 @@
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
#include <QDBusConnection>
|
||||
#include <QDebug>
|
||||
#include <QDesktopServices>
|
||||
#include <QFileDialog>
|
||||
@ -36,6 +37,7 @@
|
||||
#include "macvlanwidget.h"
|
||||
#include "mobilewidget.h"
|
||||
#include "netctlautowindow.h"
|
||||
#include "netctlguiadaptor.h"
|
||||
#include "passwdwidget.h"
|
||||
#include "pppoewidget.h"
|
||||
#include "settingswindow.h"
|
||||
@ -87,6 +89,7 @@ MainWindow::MainWindow(QWidget *parent,
|
||||
configuration[optionsDict.keys()[i]] = optionsDict[optionsDict.keys()[i]];
|
||||
|
||||
// backend
|
||||
createDBusSession();
|
||||
netctlCommand = new Netctl(debug, configuration);
|
||||
netctlProfile = new NetctlProfile(debug, configuration);
|
||||
wpaCommand = new WpaSup(debug, configuration);
|
||||
@ -346,6 +349,19 @@ void MainWindow::createActions()
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::createDBusSession()
|
||||
{
|
||||
if (debug) qDebug() << "[MainWindow]" << "[createDBusSession]";
|
||||
|
||||
new NetctlGuiAdaptor(this, debug);
|
||||
QDBusConnection bus = QDBusConnection::sessionBus();
|
||||
if (!bus.registerService(QString(DBUS_SERVICE)))
|
||||
if (debug) qDebug() << "[MainWindow]" << "[createDBusSession]" << ":" << "Could not register service";
|
||||
if (!bus.registerObject(QString(DBUS_OBJECT_PATH), this))
|
||||
if (debug) qDebug() << "[MainWindow]" << "[createDBusSession]" << ":" << "Could not register object";
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::keyPressEvent(QKeyEvent *pressedKey)
|
||||
{
|
||||
if (debug) qDebug() << "[MainWindow]" << "[keyPressEvent]";
|
||||
|
||||
Reference in New Issue
Block a user