added gui path configuration

This commit is contained in:
arcan1s 2014-01-31 11:33:59 +04:00
parent 7a6f24910f
commit ef5d319337
3 changed files with 42 additions and 0 deletions

View File

@ -88,6 +88,42 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_gui">
<item>
<widget class="QLabel" name="label_gui">
<property name="minimumSize">
<size>
<width>80</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Path to GUI</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_gui"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_gui">
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBox_showBigInterface">
<property name="text">
@ -538,6 +574,8 @@
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>spinBox_autoUpdate</tabstop>
<tabstop>lineEdit_gui</tabstop>
<tabstop>pushButton_gui</tabstop>
<tabstop>checkBox_showBigInterface</tabstop>
<tabstop>checkBox_showNetDev</tabstop>
<tabstop>checkBox_showExtIp</tabstop>

View File

@ -107,6 +107,7 @@ void Netctl::createConfigurationInterface(KConfigDialog *parent)
uiConfig.setupUi(configwin);
uiConfig.spinBox_autoUpdate->setValue(autoUpdateInterval);
uiConfig.lineEdit_gui->setText(guiPath);
if (showBigInterface)
uiConfig.checkBox_showBigInterface->setCheckState(Qt::Checked);
else
@ -148,6 +149,7 @@ void Netctl::configAccepted()
KConfigGroup cg = config();
cg.writeEntry("autoUpdateInterval", uiConfig.spinBox_autoUpdate->value());
cg.writeEntry("guiPath", uiConfig.lineEdit_gui->text());
if (uiConfig.checkBox_showBigInterface->checkState() == 0)
cg.writeEntry("showBigInterface", false);
else
@ -180,6 +182,7 @@ void Netctl::configChanged()
KConfigGroup cg = config();
autoUpdateInterval = cg.readEntry("autoUpdateInterval", 1000);
guiPath = cg.readEntry("guiPath", "/usr/bin/netctl-gui");
showBigInterface = cg.readEntry("showBigInterface", true);
showNetDev = cg.readEntry("showNetDev", true);
showExtIp = cg.readEntry("showExtIp", true);

View File

@ -53,6 +53,7 @@ private:
QStringList formatLine;
// configuration
int autoUpdateInterval;
QString guiPath;
bool showBigInterface;
bool showNetDev;
bool showExtIp;