add new API to the helper

This commit is contained in:
arcan1s 2014-08-13 07:53:22 +04:00
parent fea0bedef0
commit 1d34a65f38
5 changed files with 26 additions and 2 deletions

View File

@ -107,6 +107,11 @@ 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 Reenable(QString profile)</td>
<td>reenables the profile. Returns <code>true</code> if action has been performed successfully</td>
<td>yes</td>
</tr>
<tr> <tr>
<td>bool Restart(QString profile)</td> <td>bool Restart(QString profile)</td>
<td>restarts the profile. Returns <code>true</code> if action has been performed successfully</td> <td>restarts the profile. Returns <code>true</code> if action has been performed successfully</td>
@ -117,6 +122,11 @@ th.sub {
<td>starts or stops the profile. Returns <code>true</code> if action has been performed successfully</td> <td>starts or stops the profile. Returns <code>true</code> if action has been performed successfully</td>
<td>yes</td> <td>yes</td>
</tr> </tr>
<tr>
<td>bool StopAll()</td>
<td>stops all active profiles. Returns <code>true</code> if action has been performed successfully</td>
<td>yes</td>
</tr>
<tr> <tr>
<td>bool SwitchTo(QString profile)</td> <td>bool SwitchTo(QString profile)</td>
<td>switchs to the profile. Returns <code>true</code> if action has been performed successfully</td> <td>switchs to the profile. Returns <code>true</code> if action has been performed successfully</td>

View File

@ -30,7 +30,7 @@
<ul> <ul>
<li>Netctl control module</li> <li>Netctl control module</li>
<ul> <ul>
<li><code>netctl start|stop|restart|switch-to|enable|disable &lt;profile&gt;</code>. They are commands which provide a general control to netctl.</li> <li><code>netctl stop-all|start|stop|restart|switch-to|enable|disable|reenable &lt;profile&gt;</code>. They are commands which provide a general control to netctl.</li>
<li><code>systemctl start|restart|enable &lt;netctl-auto@service&gt;</code>. They are commands which provide ability to control netctl-auto systemd service.</li> <li><code>systemctl start|restart|enable &lt;netctl-auto@service&gt;</code>. They are commands which provide ability to control netctl-auto systemd service.</li>
</ul> </ul>
<li>Netctl profiles module</li> <li>Netctl profiles module</li>

View File

@ -161,6 +161,12 @@ bool ControlAdaptor::Enable(const QString profile)
} }
bool ControlAdaptor::Reenable(const QString profile)
{
return netctlCommand->reenableProfile(profile);
}
bool ControlAdaptor::Restart(const QString profile) bool ControlAdaptor::Restart(const QString profile)
{ {
return netctlCommand->restartProfile(profile); return netctlCommand->restartProfile(profile);
@ -173,6 +179,12 @@ bool ControlAdaptor::Start(const QString profile)
} }
bool ControlAdaptor::StopAll()
{
return netctlCommand->stopAllProfiles();
}
bool ControlAdaptor::SwitchTo(const QString profile) bool ControlAdaptor::SwitchTo(const QString profile)
{ {
return netctlCommand->switchToProfile(profile); return netctlCommand->switchToProfile(profile);

View File

@ -56,8 +56,10 @@ public slots:
bool autoServiceRestart(); bool autoServiceRestart();
bool autoServiceStart(); bool autoServiceStart();
bool Enable(const QString profile); bool Enable(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);
bool StopAll();
bool SwitchTo(const QString profile); bool SwitchTo(const QString profile);
// netctlProfile // netctlProfile
bool Create(const QString profile, const QStringList settingsList); bool Create(const QString profile, const QStringList settingsList);

View File

@ -475,7 +475,7 @@ bool Netctl::stopAllProfiles()
{ {
if (debug) qDebug() << PDEBUG; if (debug) qDebug() << PDEBUG;
return cmdCall(true, netctlCommand, QString("restart")); return cmdCall(true, netctlCommand, QString("stop-all"));
} }