# netctlgui: netctlinteract.h Source File

All Classes Files Functions
netctlinteract.h
Go to the documentation of this file.
/***************************************************************************
* 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/ *
***************************************************************************/
#ifndef NETCTLINTERACT_H
#define NETCTLINTERACT_H
#include <QDir>
#include <QMap>
#include <QObject>
class NetctlProfile;
class Netctl : public QObject
{
Q_OBJECT
public:
explicit Netctl(const bool debugCmd = false,
const QMap<QString, QString> settings = QMap<QString, QString>());
~Netctl();
// general information
QStringList getInterfaceList();
QList<QStringList> getProfileList();
QList<QStringList> getProfileListFromNetctlAuto();
QString getProfileDescription(const QString profile);
QStringList getProfileDescriptions(const QStringList profileList);
QString getProfileStatus(const QString profile);
QStringList getProfileStatuses(const QStringList profileList);
bool isProfileActive(const QString profile);
bool isProfileEnabled(const QString profile);
bool autoIsProfileActive(const QString profile);
bool autoIsProfileEnabled(const QString profile);
bool isNetctlAutoEnabled();
bool isNetctlAutoRunning();
public slots:
// functions
// netctl
bool enableProfile(const QString profile);
bool restartProfile(const QString profile);
bool startProfile(const QString profile);
// netctl-auto
bool autoDisableAllProfiles();
bool autoEnableProfile(const QString profile);
bool autoEnableAllProfiles();
bool autoStartProfile(const QString profile);
// netctl-auto service
bool autoEnableService();
bool autoRestartService();
bool autoStartService();
private:
NetctlProfile *netctlProfile;
bool debug;
QDir *ifaceDirectory;
QString mainInterface;
QString netctlCommand;
QString netctlAutoCommand;
QString netctlAutoService;
QDir *profileDirectory;
QString sudoCommand;
QString systemctlCommand;
// functions
QString getNetctlOutput(const bool sudo, const QString commandLine, const QString profile = 0);
bool netctlCall(const bool sudo, const QString commandLine, const QString profile = 0);
bool netctlAutoCall(const bool sudo, const QString commandLine, const QString profile = 0);
bool systemctlCall(const bool sudo, const QString commandLine);
};
#endif /* NETCTLINTERACT_H */
Netctl::getProfileStatus
QString getProfileStatus(const QString profile)
method which gets profile status
Netctl::autoIsProfileActive
bool autoIsProfileActive(const QString profile)
method which checks if profile is active (netctl-auto)
Netctl::getProfileStatuses
QStringList getProfileStatuses(const QStringList profileList)
method which gets statuses of profile list
Netctl::autoEnableProfile
bool autoEnableProfile(const QString profile)
method which sets profile disabled or enabled (netctl-auto)
Netctl::restartProfile
bool restartProfile(const QString profile)
method which restarts profile
Netctl::getProfileListFromNetctlAuto
QList< QStringList > getProfileListFromNetctlAuto()
method which returns profile informations from netctl-auto
Netctl::autoEnableAllProfiles
bool autoEnableAllProfiles()
method which sets all profiles enabled (netctl-auto)
Netctl::autoStartProfile
bool autoStartProfile(const QString profile)
method which switchs to profile (netctl-auto)
Netctl::~Netctl
~Netctl()
Netctl class destructor.
Netctl::enableProfile
bool enableProfile(const QString profile)
method which sets profile disabled or enabled
NetctlProfile
The NetctlProfile class interacts with netctl profiles.
Definition: netctlprofile.h:37
Netctl::isProfileActive
bool isProfileActive(const QString profile)
method which checks if profile is active
Netctl::isProfileEnabled
bool isProfileEnabled(const QString profile)
method which checks if profile is enabled
Netctl
The Netctl class interacts with netctl.
Definition: netctlinteract.h:39
Netctl::autoEnableService
bool autoEnableService()
method which sets netctl-auto service enabled or disabled
Netctl::getProfileDescription
QString getProfileDescription(const QString profile)
method which gets description from profile
Netctl::isNetctlAutoEnabled
bool isNetctlAutoEnabled()
method which checks netctl-auto autoload status
Netctl::startProfile
bool startProfile(const QString profile)
method which starts or stops profile
Netctl::getInterfaceList
QStringList getInterfaceList()
method which gets interface list from PREFERED_IFACE and IFACE_DIR
Netctl::isNetctlAutoRunning
bool isNetctlAutoRunning()
method which checks netctl-auto status
Netctl::autoRestartService
bool autoRestartService()
method which restarted netctl-auto service
Netctl::Netctl
Netctl(const bool debugCmd=false, const QMap< QString, QString > settings=QMap< QString, QString >())
Netctl class constructor.
Netctl::getProfileList
QList< QStringList > getProfileList()
method which returns profile informations from netctl
Netctl::getProfileDescriptions
QStringList getProfileDescriptions(const QStringList profileList)
method which gets descriptions from profile list
Netctl::autoStartService
bool autoStartService()
method which starts or stops netctl-auto service
Netctl::autoIsProfileEnabled
bool autoIsProfileEnabled(const QString profile)
method which checks if profile is enabled (netctl-auto)
Netctl::autoDisableAllProfiles
bool autoDisableAllProfiles()
method which sets all profiles disabled (netctl-auto)