netctlgui  1.2.0
Qt library which interacts with netctl
 All Classes Files Functions
Public Slots | Public Member Functions | List of all members
Netctl Class Reference

The Netctl class interacts with netctl. More...

Inheritance diagram for Netctl:

Public Slots

bool enableProfile (const QString profile)
 method which sets profile disabled or enabled More...
 
bool restartProfile (const QString profile)
 method which restarts profile More...
 
bool startProfile (const QString profile)
 method which starts or stops profile More...
 
bool autoDisableAllProfiles ()
 method which sets all profiles disabled (netctl-auto) More...
 
bool autoEnableProfile (const QString profile)
 method which sets profile disabled or enabled (netctl-auto) More...
 
bool autoEnableAllProfiles ()
 method which sets all profiles enabled (netctl-auto) More...
 
bool autoStartProfile (const QString profile)
 method which switchs to profile (netctl-auto) More...
 
bool autoEnableService ()
 method which sets netctl-auto service enabled or disabled More...
 
bool autoRestartService ()
 method which restarted netctl-auto service More...
 
bool autoStartService ()
 method which starts or stops netctl-auto service More...
 

Public Member Functions

 Netctl (const bool debugCmd=false, const QMap< QString, QString > settings=QMap< QString, QString >())
 Netctl class constructor. More...
 
 ~Netctl ()
 Netctl class destructor. More...
 
QStringList getInterfaceList ()
 method which gets interface list from PREFERED_IFACE and IFACE_DIR More...
 
QList< QStringList > getProfileList ()
 method which returns profile informations from netctl More...
 
QList< QStringList > getProfileListFromNetctlAuto ()
 method which returns profile informations from netctl-auto More...
 
QString getProfileDescription (const QString profile)
 method which gets description from profile More...
 
QStringList getProfileDescriptions (const QStringList profileList)
 method which gets descriptions from profile list More...
 
QString getProfileStatus (const QString profile)
 method which gets profile status More...
 
QStringList getProfileStatuses (const QStringList profileList)
 method which gets statuses of profile list More...
 
bool isProfileActive (const QString profile)
 method which checks if profile is active More...
 
bool isProfileEnabled (const QString profile)
 method which checks if profile is enabled More...
 
bool autoIsProfileActive (const QString profile)
 method which checks if profile is active (netctl-auto) More...
 
bool autoIsProfileEnabled (const QString profile)
 method which checks if profile is enabled (netctl-auto) More...
 
bool isNetctlAutoEnabled ()
 method which checks netctl-auto autoload status More...
 
bool isNetctlAutoRunning ()
 method which checks netctl-auto status More...
 

Detailed Description

The Netctl class interacts with netctl.

Constructor & Destructor Documentation

Netctl::Netctl ( const bool  debugCmd = false,
const QMap< QString, QString >  settings = QMap< QString, QString >() 
)
explicit

Netctl class constructor.

Parameters
debugCmdshow debug messages
settingsdefault settings. Needed keys are IFACE_DIR (path to directory with interfaces), PREFERED_IFACE (prefered interface for WiFi), NETCTL_PATH (path to netctl command), NETCTLAUTO_PATH (path to netctl-auto command), NETCTLAUTO_SERVICE (netctl-auto service name), PROFILE_DIR (path to directory which contains profiles), SUDO_PATH (path to sudo command), SYSTEMCTL_PATH (path to systemctl command)
Netctl::~Netctl ( )

Netctl class destructor.

Member Function Documentation

bool Netctl::autoDisableAllProfiles ( )
slot

method which sets all profiles disabled (netctl-auto)

Returns
false if components are not found or command exit code is not equal to 0
true if the method was completed without errors
bool Netctl::autoEnableAllProfiles ( )
slot

method which sets all profiles enabled (netctl-auto)

Returns
false if components are not found or command exit code is not equal to 0
true if the method was completed without errors
bool Netctl::autoEnableProfile ( const QString  profile)
slot

method which sets profile disabled or enabled (netctl-auto)

Parameters
profileprofile name
Returns
false if components are not found or command exit code is not equal to 0
true if the method was completed without errors
bool Netctl::autoEnableService ( )
slot

method which sets netctl-auto service enabled or disabled

Returns
false if components are not found or command exit code is not equal to 0
true if the method was completed without errors
bool Netctl::autoIsProfileActive ( const QString  profile)

method which checks if profile is active (netctl-auto)

Parameters
profileprofile name
Returns
false if profile is inactive
true if profile is active
bool Netctl::autoIsProfileEnabled ( const QString  profile)

method which checks if profile is enabled (netctl-auto)

Parameters
profileprofile name
Returns
false if profile is disabled
true if profile is enabled
bool Netctl::autoRestartService ( )
slot

method which restarted netctl-auto service

Returns
false if components are not found or command exit code is not equal to 0
true if the method was completed without errors
bool Netctl::autoStartProfile ( const QString  profile)
slot

method which switchs to profile (netctl-auto)

Parameters
profileprofile name
Returns
false if components are not found or command exit code is not equal to 0
true if the method was completed without errors
bool Netctl::autoStartService ( )
slot

method which starts or stops netctl-auto service

Returns
false if components are not found or command exit code is not equal to 0
true if the method was completed without errors
bool Netctl::enableProfile ( const QString  profile)
slot

method which sets profile disabled or enabled

Parameters
profileprofile name
Returns
false if components are not found or command exit code is not equal to 0
true if the method was completed without errors
QStringList Netctl::getInterfaceList ( )

method which gets interface list from PREFERED_IFACE and IFACE_DIR

Returns
interface list. If PREFERED_IFACE is not empty it will be first element
QString Netctl::getProfileDescription ( const QString  profile)

method which gets description from profile

Parameters
profileprofile name
Returns
profile description or ""
QStringList Netctl::getProfileDescriptions ( const QStringList  profileList)

method which gets descriptions from profile list

Parameters
profileListprofile names
Returns
list of profile descriptions (if description is not available returns "")
QList<QStringList> Netctl::getProfileList ( )

method which returns profile informations from netctl

Returns
list of profiles. Available information is [NAME, DESCRIPTION, STATUS]: NAME is a profile name, DESCRIPTION is a profile description (see more details below), STATUS is a profile status (see more details below)
QList<QStringList> Netctl::getProfileListFromNetctlAuto ( )

method which returns profile informations from netctl-auto

Returns
list of profiles. Available information is [NAME, DESCRIPTION, STATUS]: NAME is a profile name, DESCRIPTION is a profile description (see more details below), STATUS is a profile status (see more details below)
QString Netctl::getProfileStatus ( const QString  profile)

method which gets profile status

Parameters
profileprofile name
Returns
profile status. It may be "active (enabled)", "active (static)", "inactive (enabled)", "inactive (static)"
QStringList Netctl::getProfileStatuses ( const QStringList  profileList)

method which gets statuses of profile list

Parameters
profileListprofile names
Returns
list of profile statuses. It may be "active (enabled)", "active (static)", "inactive (enabled)", "inactive (static)"
bool Netctl::isNetctlAutoEnabled ( )

method which checks netctl-auto autoload status

Returns
false if netctl-auto is disabled
true if netctl-auto is enabled
bool Netctl::isNetctlAutoRunning ( )

method which checks netctl-auto status

Returns
false if netctl-auto is inactive
true if netctl-auto is active
bool Netctl::isProfileActive ( const QString  profile)

method which checks if profile is active

Parameters
profileprofile name
Returns
false if profile is inactive
true if profile is active
bool Netctl::isProfileEnabled ( const QString  profile)

method which checks if profile is enabled

Parameters
profileprofile name
Returns
false if profile is disabled
true if profile is enabled
bool Netctl::restartProfile ( const QString  profile)
slot

method which restarts profile

Parameters
profileprofile name
Returns
false if components are not found or command exit code is not equal to 0
true if the method was completed without errors
bool Netctl::startProfile ( const QString  profile)
slot

method which starts or stops profile

Parameters
profileprofile name
Returns
false if components are not found or command exit code is not equal to 0
true if the method was completed without errors

The documentation for this class was generated from the following file: