add dbus interface proto

This commit is contained in:
arcan1s
2014-08-06 19:01:03 +04:00
parent e8a7865e99
commit 447bcf8a0e
10 changed files with 147 additions and 5 deletions

View File

@ -0,0 +1,53 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include <QDebug>
#include "mainwindow.h"
#include "netctlguiadaptor.h"
NetctlGuiAdaptor::NetctlGuiAdaptor(MainWindow *parent, const bool debugCmd)
: QDBusAbstractAdaptor(parent),
debug(debugCmd),
mainWindow(parent)
{
}
NetctlGuiAdaptor::~NetctlGuiAdaptor()
{
if (debug) qDebug() << "[NetctlGuiAdaptor]" << "[~NetctlGuiAdaptor]";
}
QString NetctlGuiAdaptor::Information()
{
if (debug) qDebug() << "[NetctlGuiAdaptor]" << "[RestoreWindow]";
return mainWindow->getInformation();
}
bool NetctlGuiAdaptor::RestoreWindow()
{
if (debug) qDebug() << "[NetctlGuiAdaptor]" << "[RestoreWindow]";
mainWindow->show();
return true;
}