added netctl-auto support to profiles

This commit is contained in:
arcan1s 2014-07-12 13:36:06 +04:00
parent ec6834d90e
commit ae001b4d7f
3 changed files with 73 additions and 18 deletions

View File

@ -69,7 +69,6 @@ Additional information
TODO (wish list)
----------------
* netctl-auto support to profiles
* netctl-auto support to dataengine
* man pages
* code review

View File

@ -204,6 +204,7 @@ void MainWindow::createActions()
connect(ui->pushButton_mainRefresh, SIGNAL(clicked(bool)), this, SLOT(updateMainTab()));
connect(ui->pushButton_mainRestart, SIGNAL(clicked(bool)), this, SLOT(mainTabRestartProfile()));
connect(ui->pushButton_mainStart, SIGNAL(clicked(bool)), this, SLOT(mainTabStartProfile()));
connect(ui->pushButton_netctlAuto, SIGNAL(clicked(bool)), netctlAutoWin, SLOT(showWindow()));
connect(ui->tableWidget_main, SIGNAL(itemActivated(QTableWidgetItem *)), this, SLOT(mainTabStartProfile()));
connect(ui->tableWidget_main, SIGNAL(currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)), this, SLOT(mainTabRefreshButtons(QTableWidgetItem *, QTableWidgetItem *)));
connect(ui->tableWidget_main, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(mainTabContextualMenu(QPoint)));
@ -321,7 +322,12 @@ void MainWindow::updateMainTab()
}
ui->tabWidget->setDisabled(true);
QList<QStringList> profiles = netctlCommand->getProfileList();;
QList<QStringList> profiles = netctlCommand->getProfileList();
if (netctlCommand->isNetctlAutoRunning())
ui->widget_netctlAuto->setHidden(false);
else
ui->widget_netctlAuto->setHidden(true);
ui->tableWidget_main->setSortingEnabled(false);
ui->tableWidget_main->selectRow(-1);

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>483</width>
<height>511</height>
<width>481</width>
<height>509</height>
</rect>
</property>
<property name="windowTitle">
@ -25,6 +25,32 @@
<string>Connect to profile</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="widget_netctlAuto" native="true">
<layout class="QHBoxLayout" name="layout_netctlAuto">
<item>
<widget class="QLabel" name="label_netctlAuto">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>netctl-auto is running</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_netctlAuto">
<property name="text">
<string>Show</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QTableWidget" name="tableWidget_main">
<property name="contextMenuPolicy">
@ -180,7 +206,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>451</width>
<width>449</width>
<height>353</height>
</rect>
</property>
@ -341,7 +367,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>483</width>
<width>481</width>
<height>22</height>
</rect>
</property>
@ -404,7 +430,9 @@
</action>
<action name="actionMainRefresh">
<property name="icon">
<iconset theme="stock-refresh"/>
<iconset theme="stock-refresh">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Refresh</string>
@ -412,7 +440,9 @@
</action>
<action name="actionMainStart">
<property name="icon">
<iconset theme="dialog-apply"/>
<iconset theme="dialog-apply">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Start profile</string>
@ -420,7 +450,9 @@
</action>
<action name="actionMainRestart">
<property name="icon">
<iconset theme="stock-refresh"/>
<iconset theme="stock-refresh">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Restart profile</string>
@ -428,7 +460,9 @@
</action>
<action name="actionMainEnable">
<property name="icon">
<iconset theme="edit-add"/>
<iconset theme="edit-add">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Enable profile</string>
@ -436,7 +470,9 @@
</action>
<action name="actionMainEdit">
<property name="icon">
<iconset theme="edit"/>
<iconset theme="edit">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Edit profile</string>
@ -444,7 +480,9 @@
</action>
<action name="actionMainRemove">
<property name="icon">
<iconset theme="edit-delete"/>
<iconset theme="edit-delete">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Remove profile</string>
@ -452,7 +490,9 @@
</action>
<action name="actionProfileClear">
<property name="icon">
<iconset theme="edit-clear"/>
<iconset theme="edit-clear">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Clear</string>
@ -460,7 +500,9 @@
</action>
<action name="actionWifiRefresh">
<property name="icon">
<iconset theme="stock-refresh"/>
<iconset theme="stock-refresh">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Refresh</string>
@ -468,7 +510,9 @@
</action>
<action name="actionProfileLoad">
<property name="icon">
<iconset theme="document-open"/>
<iconset theme="document-open">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Load profile</string>
@ -476,7 +520,9 @@
</action>
<action name="actionProfileSave">
<property name="icon">
<iconset theme="document-save"/>
<iconset theme="document-save">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Save profile</string>
@ -484,7 +530,9 @@
</action>
<action name="actionWifiStart">
<property name="icon">
<iconset theme="dialog-apply"/>
<iconset theme="dialog-apply">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Start Wi-Fi</string>
@ -492,7 +540,9 @@
</action>
<action name="actionProfileRemove">
<property name="icon">
<iconset theme="edit-delete"/>
<iconset theme="edit-delete">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Remove profile</string>