mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-12 21:35:51 +00:00
rewrite mainwindow.cpp to use helper
This commit is contained in:
@ -39,7 +39,7 @@ NetctlAdaptor::~NetctlAdaptor()
|
||||
// netctlCommand
|
||||
QString NetctlAdaptor::ActiveProfile()
|
||||
{
|
||||
if (netctlCommand->isNetctlAutoRunning())
|
||||
if (isNetctlAutoActive())
|
||||
return netctlCommand->autoGetActiveProfile();
|
||||
else
|
||||
return netctlCommand->getActiveProfile();
|
||||
@ -48,7 +48,7 @@ QString NetctlAdaptor::ActiveProfile()
|
||||
|
||||
QString NetctlAdaptor::ActiveProfileStatus()
|
||||
{
|
||||
if (netctlCommand->isNetctlAutoRunning())
|
||||
if (isNetctlAutoActive())
|
||||
return QString("netctl-auto");
|
||||
else
|
||||
return netctlCommand->getProfileStatus(ActiveProfile());
|
||||
@ -70,13 +70,19 @@ bool NetctlAdaptor::autoIsProfileEnabled(const QString profile)
|
||||
QStringList NetctlAdaptor::Information()
|
||||
{
|
||||
QStringList output;
|
||||
output.append(QString("Profile: %1").arg(ActiveProfile()));
|
||||
output.append(QString("Status: %1").arg(ActiveProfileStatus()));
|
||||
output.append(ActiveProfile());
|
||||
output.append(ActiveProfileStatus());
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
bool NetctlAdaptor::isNetctlAutoActive()
|
||||
{
|
||||
return netctlCommand->isNetctlAutoRunning();
|
||||
}
|
||||
|
||||
|
||||
bool NetctlAdaptor::isProfileActive(const QString profile)
|
||||
{
|
||||
return netctlCommand->isProfileActive(profile);
|
||||
@ -92,7 +98,7 @@ bool NetctlAdaptor::isProfileEnabled(const QString profile)
|
||||
QStringList NetctlAdaptor::ProfileList()
|
||||
{
|
||||
QList<netctlProfileInfo> profilesInfo;
|
||||
if (netctlCommand->isNetctlAutoRunning())
|
||||
if (isNetctlAutoActive())
|
||||
profilesInfo = netctlCommand->getProfileListFromNetctlAuto();
|
||||
else
|
||||
profilesInfo = netctlCommand->getProfileList();
|
||||
|
@ -41,6 +41,7 @@ public slots:
|
||||
bool autoIsProfileActive(const QString profile);
|
||||
bool autoIsProfileEnabled(const QString profile);
|
||||
QStringList Information();
|
||||
bool isNetctlAutoActive();
|
||||
bool isProfileActive(const QString profile);
|
||||
bool isProfileEnabled(const QString profile);
|
||||
QStringList ProfileList();
|
||||
|
Reference in New Issue
Block a user