add force* slots

This commit is contained in:
arcan1s 2014-08-24 13:08:13 +04:00
parent e21b2201ab
commit 999914926a
7 changed files with 65 additions and 0 deletions

2
.gitignore vendored
View File

@ -25,3 +25,5 @@ usr/
# translations # translations
*.qm *.qm
# temporary bckps
*~

View File

@ -36,6 +36,7 @@ Ver.1.3.0
+ add slot stopAllProfiles() + add slot stopAllProfiles()
+ add slot reenableProfile() + add slot reenableProfile()
+ add slots getRecommendedConfiguration() + add slots getRecommendedConfiguration()
+ add slots forceStartProfile() and forceStopProfile()
+ add double quotes to profile names + add double quotes to profile names
+ add tests + add tests
* rewrite to use [tasks](https://github.com/mhogomchungu/tasks) (see #7) * rewrite to use [tasks](https://github.com/mhogomchungu/tasks) (see #7)

View File

@ -112,6 +112,16 @@ th.sub {
<td>enables or disables the profile. Returns <code>true</code> if action has been performed successfully</td> <td>enables or disables the profile. Returns <code>true</code> if action has been performed successfully</td>
<td>yes</td> <td>yes</td>
</tr> </tr>
<tr>
<td>bool forceStart(QString profile)</td>
<td>force starts the profile. Returns <code>true</code> if action has been performed successfully</td>
<td>yes</td>
</tr>
<tr>
<td>bool forceStop(QString profile)</td>
<td>force stops the profile. Returns <code>true</code> if action has been performed successfully</td>
<td>yes</td>
</tr>
<tr> <tr>
<td>bool Reenable(QString profile)</td> <td>bool Reenable(QString profile)</td>
<td>reenables the profile. Returns <code>true</code> if action has been performed successfully</td> <td>reenables the profile. Returns <code>true</code> if action has been performed successfully</td>

View File

@ -186,6 +186,18 @@ bool ControlAdaptor::Enable(const QString profile)
} }
bool ControlAdaptor::forceStart(const QString profile)
{
return netctlCommand->forceStartProfile(profile);
}
bool ControlAdaptor::forceStop(const QString profile)
{
return netctlCommand->forceStopProfile(profile);
}
bool ControlAdaptor::Reenable(const QString profile) bool ControlAdaptor::Reenable(const QString profile)
{ {
return netctlCommand->reenableProfile(profile); return netctlCommand->reenableProfile(profile);

View File

@ -57,6 +57,8 @@ public slots:
bool autoServiceRestart(); bool autoServiceRestart();
bool autoServiceStart(); bool autoServiceStart();
bool Enable(const QString profile); bool Enable(const QString profile);
bool forceStart(const QString profile);
bool forceStop(const QString profile);
bool Reenable(const QString profile); bool Reenable(const QString profile);
bool Restart(const QString profile); bool Restart(const QString profile);
bool Start(const QString profile); bool Start(const QString profile);

View File

@ -176,6 +176,20 @@ public slots:
* @return true if the method was completed without errors * @return true if the method was completed without errors
*/ */
bool enableProfile(const QString profile); bool enableProfile(const QString profile);
/**
* @brief method which force starts profile
* @param profile profile name
* @return false if components are not found or command exit code is not equal to 0
* @return true if the method was completed without errors
*/
bool forceStartProfile(const QString profile);
/**
* @brief method which force stops profile
* @param profile profile name
* @return false if components are not found or command exit code is not equal to 0
* @return true if the method was completed without errors
*/
bool forceStopProfile(const QString profile);
/** /**
* @brief method which reenables profile * @brief method which reenables profile
* @param profile profile name * @param profile profile name

View File

@ -542,6 +542,30 @@ bool Netctl::enableProfile(const QString profile)
} }
/**
* @fn forceStartProfile
*/
bool Netctl::forceStartProfile(const QString profile)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Profile" << profile;
return cmdCall(true, netctlCommand, QString("start"), profile);
}
/**
* @fn forceStopProfile
*/
bool Netctl::forceStopProfile(const QString profile)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Profile" << profile;
return cmdCall(true, netctlCommand, QString("stop"), profile);
}
/** /**
* @fn reenableProfile * @fn reenableProfile
*/ */