56 Commits

Author SHA1 Message Date
bb7af8da40 update russian translation 2014-07-15 21:26:38 +04:00
81ff9340cc fix build 2014-07-15 21:23:03 +04:00
3d040e9bab small text update / prerelease 1.2.0 2014-07-15 20:56:46 +04:00
3542901781 added flag --config
updated translations
2014-07-15 20:40:20 +04:00
8b91f43f0b added doxygen documentation building 2014-07-15 20:01:19 +04:00
7e622ad33b added all documentation 2014-07-15 17:31:29 +04:00
48a879bd71 added documentation to wpasupinteract 2014-07-15 15:08:55 +04:00
bc8655aaeb add documentation to netctlprofile 2014-07-15 13:32:22 +04:00
05f9759d47 small edit of about.ui 2014-07-15 13:05:16 +04:00
51659c7a42 added --set-opts 2014-07-15 06:11:22 +04:00
39b8ff834f added man page 2014-07-14 22:43:17 +04:00
ea522b3864 added flags 2014-07-14 21:57:29 +04:00
79fc70efa1 rewrite errorwindow 2014-07-14 20:37:46 +04:00
5e1a4be134 add openProfile 2014-07-14 19:36:14 +04:00
63ae04cd8d edit changelog 2014-07-14 19:11:22 +04:00
4fb02058b1 added workarounds 2014-07-14 19:07:17 +04:00
e02a6a8ce1 update plasmoid translations 2014-07-14 18:35:15 +04:00
2f40ae7913 added about window 2014-07-14 18:31:35 +04:00
2e35cd356e edited cmake files 2014-07-14 14:22:04 +04:00
341a19a955 fix profile reading 2014-07-14 14:03:38 +04:00
f7e39c7834 edited profile reading 2014-07-13 15:51:44 +04:00
7660deb787 end of refactoring 2014-07-13 11:45:20 +04:00
3fb847a7b6 edited main.cpp 2014-07-13 11:26:42 +04:00
dbb9ba70c4 end of refactoring of the widgets
refactoring of settingswindow
2014-07-13 10:48:46 +04:00
ceb7f3bd0f edited configuration interface 2014-07-13 09:56:07 +04:00
8ce4b03399 end of refactoring of the library 2014-07-13 09:44:20 +04:00
44f0b6a06a refactoring of netctlprofile 2014-07-13 00:13:24 +04:00
b37272d875 refactoring of netctlinteract 2014-07-12 23:41:52 +04:00
ea91aa4ca4 refactoring of dataengine and plasmoid
update plasmoid translations
2014-07-12 23:00:59 +04:00
cc250a643a small update of documentation 2014-07-12 22:31:08 +04:00
9b01fcd4e1 refactoring of the configuration interface 2014-07-12 22:15:39 +04:00
021a870220 add support of netctl-auto to plasmoid and dataengine 2014-07-12 18:19:19 +04:00
ae001b4d7f added netctl-auto support to profiles 2014-07-12 13:36:06 +04:00
ec6834d90e edited todo list 2014-07-12 13:25:40 +04:00
de22663156 add gui for netctl-auto 2014-07-12 13:23:43 +04:00
c3f090d9a0 intermediate commit 2014-07-11 23:31:27 +04:00
d17543a075 add null translation file 2014-07-11 20:59:01 +04:00
ace3a141e4 change lineEdit to comboBox
add clear() function to profile tab
2014-07-11 11:06:01 +04:00
06bd1ce198 remove soversioned 2014-07-11 10:26:16 +04:00
9852fb8f68 detached backend from frontend 2014-07-11 09:56:48 +04:00
eccb6b6578 fix settings 2014-07-11 07:03:53 +04:00
c1457d3ef0 add language class 2014-07-11 07:00:16 +04:00
6dab355d87 added all icons 2014-07-10 14:33:04 +04:00
e81f7714f9 added icons
changes in the project architecture
2014-07-10 13:48:21 +04:00
2a3011bdef edited configuration interface of the plasmoid 2014-07-10 10:44:33 +04:00
bf799ce061 add contextual actions to wifi tab 2014-07-10 10:30:26 +04:00
a845e32960 add contextual actions to the main table 2014-07-10 10:15:11 +04:00
028546540c add debug flug 2014-07-10 09:44:23 +04:00
2bf1d0f78e update pkgbuilds 2014-06-20 02:22:44 +04:00
cce4ef4811 add support of hidden network (test) 2014-06-04 00:18:04 +04:00
4051d2f2c8 add support of macvlan
add support of profile removal
2014-06-02 00:43:13 +04:00
8a031f2183 added todo list 2014-05-28 10:17:10 +04:00
7c013310ab fix default tabnumber 2014-05-22 01:29:13 +04:00
d5f0bbc3bf release 1.1.0 2014-05-21 19:50:12 +04:00
cb033140ac added menu title 2014-05-17 08:46:55 +04:00
d582445597 release 1.1.0 2014-05-14 23:55:13 +04:00
93 changed files with 14047 additions and 3495 deletions

3
.gitignore vendored
View File

@ -15,11 +15,12 @@
# Source archive
*.tar.xz
*.tar.gz
*.sig
# Build directory
build/
sources/build/
tmp/
usr/
# translations
*.qm

View File

@ -1,3 +1,38 @@
Ver.1.2.0:
+ [all] added icons
+ [all] added support of netctl-auto
+ [gui] added suppoort of macvlan
+ [gui] added ability to remove profile
+ [gui] added support of hidden wifi network
+ [gui] added contextual menu to tables
+ [gui] added actions menu
+ [gui] added clear() function to profileTab
+ [gui] added about window
+ [gui] more command line options
+ [gui] added workaround for wireless-wep example
+ [lib] detached backend from frontend
+ [lib] added error checking
+ [lib] added doxygen documentation
+ [plasmoid] added dataengine configuration
+ [plasmoid] added about window
* [all] changes in the project architecture
* [all] refactoring
* [gui] more debug information
* [gui] changed lineEdit_profile to comboBox
* [gui] refactoring of configuration interface
* [gui] changed setting of the interface to profile tab
* [gui] rewrited ErrorWindow class
* [lib] more debug information
* [lib] rewrited getSettingsFromProfile() function
* [plasmoid] edited configuration interface
* [plasmoid] changed double click event to click event
Ver.1.1.0 (netctl-1.7 update):
+ [gui] added frequency
+ [plasmoid] added menu title
* [dataengine] changed definition if profile is enabled
* [gui] changed definition if profile is enabled
Ver.1.0.6:
* [gui] fix error checking

86
PKGBUILD Normal file
View File

@ -0,0 +1,86 @@
# Maintainer: Evgeniy "arcanis" Alexeev <arcanis.arch at gmail dot com>
pkgbase=netctl-gui
pkgname=('netctl-gui' 'netctl-gui-qt4' 'kdeplasma-applets-netctl-gui')
pkgver=1.2.0
pkgrel=1
pkgdesc="Qt4/Qt5 GUI for netctl. Also provides a widget for KDE"
arch=('i686' 'x86_64')
url="http://arcanis.name/projects/netctl-gui"
license=('GPL3')
makedepends=('automoc4' 'cmake' 'kdelibs' 'qt5-base' 'qt5-tools')
optdepends=('kdebase-runtime: sudo support'
'kdeplasma-applets-netctl-gui: KDE widget'
'sudo: sudo support'
'wpa_actiond: netctl-auto support'
'wpa_supplicant: wifi support')
source=("https://github.com/arcan1s/netctl-gui/releases/download/V.${pkgver}/${pkgbase}-${pkgver}-src.tar.xz")
install="${pkgbase}.install"
md5sums=('5b3105a64bc162d30a41a2b3bcb06f0a')
prepare() {
rm -rf "${srcdir}/"{build-plasmoid,build-qt4,build-qt5}
mkdir "${srcdir}/"{build-plasmoid,build-qt4,build-qt5}
}
build() {
cd "${srcdir}/build-plasmoid"
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_DOCS:BOOL=0 \
-DBUILD_GUI:BOOL=0 \
-DBUILD_LIBRARY:BOOL=0 \
"../${pkgbase}"
make
cd "${srcdir}/build-qt4"
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_DOCS:BOOL=0 \
-DBUILD_DATAENGINE:BOOL=0 \
-DBUILD_PLASMOID:BOOL=0 \
-DUSE_QT5:BOOL=0 \
"../${pkgbase}"
make
cd "${srcdir}/build-qt5"
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_DOCS:BOOL=0 \
-DBUILD_DATAENGINE:BOOL=0 \
-DBUILD_PLASMOID:BOOL=0 \
"../${pkgbase}"
make
}
package_kdeplasma-applets-netctl-gui() {
pkgdesc="A plasmoid, which interacts with netctl. A part of netctl-gui"
depends=('netctl' 'kdebase-workspace')
optdepends=('kdebase-runtime: sudo support'
'netctl-gui: graphical front-end'
'netctl-gui-qt4: graphical front-end'
'sudo: sudo support')
cd "${srcdir}/build-plasmoid"
make DESTDIR="${pkgdir}" install
}
package_netctl-gui() {
pkgdesc="Qt5 graphical front-end for netctl. A part of netctl-gui"
depends=('netctl' 'qt5-base' 'xdg-utils')
provides=('netctl-gui-qt4')
conflicts=('netctl-gui-qt4')
cd "${srcdir}/build-qt5"
make DESTDIR="${pkgdir}" install
}
package_netctl-gui-qt4() {
pkgdesc="Qt4 graphical front-end for netctl. A part of netctl-gui"
depends=('netctl' 'qt4')
provides=('netctl-gui')
conflicts=('netctl-gui')
cd "${srcdir}/build-qt4"
make DESTDIR="${pkgdir}" install
}

View File

@ -1,39 +0,0 @@
# Maintainer: Evgeniy "arcanis" Alexeev <arcanis.arch at gmail dot com>
pkgname=netctl-gui-qt4
_pkgname=netctl-gui
pkgver=1.0.6
pkgrel=1
pkgdesc="Qt4 graphical front-end for netctl. A part of netctl-gui"
arch=('i686' 'x86_64')
url="http://arcanis.name/projects/netctl-gui"
license=('GPLv3')
depends=('netctl' 'qt4')
makedepends=('automoc4' 'cmake' 'desktop-file-utils')
optdepends=('kdebase-runtime: sudo support'
'kdeplasma-applets-netctl-gui: KDE widget'
'sudo: sudo support'
'wpa_supplicant: wifi support')
provides=('netctl-gui')
conflicts=('netctl-gui')
source=("https://github.com/arcan1s/netctl-gui/releases/download/V.${pkgver}/${_pkgname}-${pkgver}-src.tar.xz")
install="${_pkgname}.install"
md5sums=('dc0e2f22f658d0c0ff159c95eb4fa413')
_cmakekeys="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DUSE_QT5:BOOL=0 -DBUILD_DATAENGINE:BOOL=0 -DBUILD_PLASMOID:BOOL=0"
prepare() {
rm -rf "${srcdir}/build"
mkdir "${srcdir}/build"
}
build() {
cd "${srcdir}/build"
cmake ${_cmakekeys} "../${_pkgname}"
make
}
package() {
cd "${srcdir}/build"
make DESTDIR="${pkgdir}" install
}

View File

@ -1,36 +0,0 @@
# Maintainer: Evgeniy "arcanis" Alexeev <arcanis.arch at gmail dot com>
pkgname=netctl-gui
pkgver=1.0.6
pkgrel=1
pkgdesc="Qt5 graphical front-end for netctl. A part of netctl-gui"
arch=('i686' 'x86_64')
url="http://arcanis.name/projects/netctl-gui"
license=('GPLv3')
depends=('netctl' 'qt5-base' 'xdg-utils')
makedepends=('automoc4' 'cmake' 'qt5-tools')
optdepends=('kdebase-runtime: sudo support'
'kdeplasma-applets-netctl-gui: KDE widget'
'sudo: sudo support'
'wpa_supplicant: wifi support')
source=("https://github.com/arcan1s/netctl-gui/releases/download/V.${pkgver}/${pkgname}-${pkgver}-src.tar.xz")
install="${pkgname}.install"
md5sums=('dc0e2f22f658d0c0ff159c95eb4fa413')
_cmakekeys="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_DATAENGINE:BOOL=0 -DBUILD_PLASMOID:BOOL=0"
prepare() {
rm -rf "${srcdir}/build"
mkdir "${srcdir}/build"
}
build() {
cd "${srcdir}/build"
cmake ${_cmakekeys} "../${pkgname}"
make
}
package() {
cd "${srcdir}/build"
make DESTDIR="${pkgdir}" install
}

View File

@ -1,37 +0,0 @@
# Maintainer: Evgeniy "arcanis" Alexeev <arcanis.arch at gmail dot com>
pkgname=kdeplasma-applets-netctl-gui
_pkgname=netctl-gui
pkgver=1.0.6
pkgrel=1
pkgdesc="A plasmoid, which interacts with netctl. A part of netctl-gui"
arch=('i686' 'x86_64')
url="http://arcanis.name/projects/netctl-gui"
license=('GPLv3')
depends=('netctl' 'kdebase-workspace')
makedepends=('automoc4' 'cmake')
optdepends=('kdebase-runtime: sudo support'
'netctl-gui: graphical front-end'
'netctl-gui-qt4: graphical front-end'
'sudo: sudo support')
source=("https://github.com/arcan1s/netctl-gui/releases/download/V.${pkgver}/${_pkgname}-${pkgver}-src.tar.xz")
install="${_pkgname}.install"
md5sums=('dc0e2f22f658d0c0ff159c95eb4fa413')
_cmakekeys="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI:BOOL=0"
prepare() {
rm -rf "${srcdir}/build"
mkdir "${srcdir}/build"
}
build() {
cd "${srcdir}/build"
cmake ${_cmakekeys} "../${_pkgname}"
make
}
package() {
cd "${srcdir}/build"
make DESTDIR="${pkgdir}" install
}

View File

@ -3,44 +3,43 @@ Netctl GUI
Information
-----------
Qt4/Qt5 graphical interface for netctl. It may work with profiles and may create new profiles. Also it may create a connection to WiFi. Moreover, it provides a widget and DataEngine for KDE.
**NOTE** LOOKING FOR TRANSLATORS!
**NOTE** [LOOKING FOR TRANSLATORS!](https://github.com/arcan1s/netctl-gui/issues/3)
Configuration
-------------
It is recommended to use graphical interface for widget configuration. DataEngine settings are stored in `/usr/share/config/netctl.conf`:
* `CMD` - netctl command. Default value is `/usr/bin/netctl`.
* `IPCMD` - ip command. `/usr/bin/ip` by default.
* `NETDIR` - a directory, which contains subdirectories with names of network interfaces. Default is `/sys/class/net/`.
* `EXTIPCMD` - a command, which returns external IP address. Default value is `wget -qO- http://ifconfig.me/ip`.
* `EXTIP` - `true` will enable external IP definition. Default is `false`.
All settings of GUI are stored in `$HOME/.config/netctl-gui.conf`. It is highly recommended to edit it from graphical interface.
It is recommended to use graphical interface for widget and DataEngine configuration. All settings of GUI are stored in `$HOME/.config/netctl-gui.conf`. It is highly recommended to edit it from graphical interface.
Instruction
===========
Dependencies
------------
* netctl
* qt5-base (if Qt5 is used) or qt4 (if Qt4 is used)
Optional dependencies
---------------------
* kdebase-workspace (widget)
* sudo (sudo support)
* wpa_actiond (netctl-auto support)
* wpa_supplicant (WiFi support)
Make dependencies
-----------------
* automoc4
* cmake
* qt5-tools (if Qt5 is used)
Installation
------------
* download sources
* extract it and install the application:
@ -53,15 +52,21 @@ Installation
Available cmake flags:
* `-DBUILD_DATAENGINE:BOOL=0` - do not build DataEngine
* `-DBUILD_DOCS:BOOL=0` - do not build developer documentation
* `-DBUILD_GUI:BOOL=0` - do not build GUI
* `-DBUILD_LIBRARY:BOOL=0` - do not build library
* `-DBUILD_PLASMOID:BOOL=0` - do not build Plasmoid
* `-DUSE_QT5:BOOL=0` - use Qt4 instead of Qt5 for GUI
Additional information
======================
TODO (wish list)
----------------
Links
-----
* [Homepage](http://arcanis.name/projects/netctl-gui)
* Page on [kde-apps](http://kde-apps.org/content/show.php?content=164490)
* Archlinux [AUR](https://aur.archlinux.org/packages/netctl-gui) package
* Archlinux [AUR](https://aur.archlinux.org/pkgbase/netctl-gui/) package

View File

@ -3,7 +3,7 @@
ARCHIVE="netctl-gui"
SRCDIR="sources"
FILES="AUTHORS CHANGELOG COPYING README.md"
IGNORELIST="build gui/resources/translations/english.qm gui/resources/translations/russian.qm dataengine/dataengine.cppcheck gui/src/gui.cppcheck plasmoid/plasmoid.cppcheck"
IGNORELIST="build en.qm ru.qm netctl-gui.qm *.cppcheck"
VERSION=$(grep -m1 PROJECT_VERSION_MAJOR sources/CMakeLists.txt | awk '{print $3}' | cut -c 1).\
$(grep -m1 PROJECT_VERSION_MINOR sources/CMakeLists.txt | awk '{print $3}' | cut -c 1).\
$(grep -m1 PROJECT_VERSION_PATCH sources/CMakeLists.txt | awk '{print $3}' | cut -c 1)
@ -12,14 +12,10 @@ $(grep -m1 PROJECT_VERSION_PATCH sources/CMakeLists.txt | awk '{print $3}' | cut
[[ -d ${ARCHIVE} ]] && rm -rf "${ARCHIVE}"
cp -r "${SRCDIR}" "${ARCHIVE}"
for FILE in ${FILES[*]}; do cp -r "$FILE" "${ARCHIVE}"; done
for FILE in ${IGNORELIST[*]}; do rm -rf "${ARCHIVE}/${FILE}"; done
for FILE in ${IGNORELIST[*]}; do find "${ARCHIVE}" -name "${FILE}" -exec rm -rf {} \;; done
tar cJf "${ARCHIVE}-${VERSION}-src.tar.xz" "${ARCHIVE}"
rm -rf "${ARCHIVE}"
# update md5sum
MD5SUMS=$(md5sum ${ARCHIVE}-${VERSION}-src.tar.xz | awk '{print $1}')
sed -i "/md5sums=('[0-9A-Fa-f]*/s/[^'][^)]*/md5sums=('${MD5SUMS}'/" PKGBUILD-qt4
sed -i "s/pkgver=[0-9.]*/pkgver=${VERSION}/" PKGBUILD-qt4
sed -i "/md5sums=('[0-9A-Fa-f]*/s/[^'][^)]*/md5sums=('${MD5SUMS}'/" PKGBUILD-qt5
sed -i "s/pkgver=[0-9.]*/pkgver=${VERSION}/" PKGBUILD-qt5
sed -i "/md5sums=('[0-9A-Fa-f]*/s/[^'][^)]*/md5sums=('${MD5SUMS}'/" PKGBUILD-widget
sed -i "s/pkgver=[0-9.]*/pkgver=${VERSION}/" PKGBUILD-widget
sed -i "/md5sums=('[0-9A-Fa-f]*/s/[^'][^)]*/md5sums=('${MD5SUMS}'/" PKGBUILD
sed -i "s/pkgver=[0-9.]*/pkgver=${VERSION}/" PKGBUILD

View File

@ -6,42 +6,66 @@ cmake_policy (SET CMP0011 NEW)
cmake_policy (SET CMP0015 NEW)
project (netctl-gui)
set (PROJECT_AUTHOR "Evgeniy Alekseev")
set (PROJECT_CONTACT "esalexeev@gmail.com")
set (PROJECT_LICENSE "GPLv3")
set (PROJECT_VERSION_MAJOR 1)
set (PROJECT_VERSION_MINOR 0)
set (PROJECT_VERSION_PATCH 6)
set (PROJECT_VERSION_MINOR 2)
set (PROJECT_VERSION_PATCH 0)
set (PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
configure_file (${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
string (TIMESTAMP CURRENT_DATE "%Y-%m-%d %H:%M" UTC)
string (TIMESTAMP CURRENT_YEAR "%Y")
message (STATUS "Project: ${PROJECT_NAME}")
message (STATUS "Version: ${PROJECT_VERSION}")
message (STATUS "Build date: ${CURRENT_DATE}")
# install options
option (USE_QT5 "Use Qt5 instead of Qt4" ON)
# components
option (BUILD_GUI "Build GUI" ON)
option (BUILD_LIBRARY "Build library" ON)
option (BUILD_DATAENGINE "Build data engine" ON)
option (BUILD_PLASMOID "Build plasmoid" ON)
if (BUILD_GUI)
set (BUILD_LIBRARY ON)
endif ()
if (BUILD_PLASMOID)
set (BUILD_DATAENGINE ON)
endif ()
# documentation
option (BUILD_DOCS "Build documentation and install headers" ON)
if (BUILD_DOCS)
set (BUILD_LIBRARY ON)
endif ()
# flags
if (CMAKE_COMPILER_IS_GNUCXX)
set (ADD_CXX_FLAGS "-Wall")
set (CMAKE_CXX_FLAGS "-O0 ${ADD_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS_DEBUG "-g -O0")
set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
set (ADD_CXX_FLAGS "-Wall")
set (CMAKE_CXX_FLAGS "-O0 ${ADD_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS_DEBUG "-g -O0")
set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
else ()
message (STATUS "Unknown compiler")
message (STATUS "Unknown compiler")
endif ()
add_subdirectory (icons)
configure_file (${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
if (BUILD_PLASMOID)
set (BUILD_DATAENGINE ON)
endif ()
# resources
set (PROJECT_LIBRARY netctlgui)
set (PROJECT_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources)
add_subdirectory (${PROJECT_RESOURCE_DIR})
# components
if (BUILD_LIBRARY)
add_subdirectory (${PROJECT_LIBRARY})
endif()
if (BUILD_GUI)
add_subdirectory (gui)
add_subdirectory (gui)
endif ()
if (BUILD_DATAENGINE)
add_subdirectory (dataengine)
add_subdirectory (dataengine)
endif ()
if (BUILD_PLASMOID)
add_subdirectory (plasmoid)
add_subdirectory (plasmoid)
endif ()

View File

@ -3,6 +3,8 @@
## Commands
# command
CMD=/usr/bin/netctl
# netctl-auto command
NETCTLAUTOCMD=/usr/bin/netctl-auto
# ip command
IPCMD=/usr/bin/ip

View File

@ -17,9 +17,9 @@
#include "netctl.h"
#include <KGlobal>
#include <KStandardDirs>
#include <Plasma/DataContainer>
#include <KDE/KGlobal>
#include <KDE/KStandardDirs>
#include <QDir>
#include <QFile>
#include <QProcess>
@ -61,11 +61,11 @@ void Netctl::readConfiguration()
rawConfig[QString("EXTIPCMD")] = QString("wget -qO- http://ifconfig.me/ip");
rawConfig[QString("IPCMD")] = QString("/usr/bin/ip");
rawConfig[QString("NETDIR")] = QString("/sys/class/net/");
rawConfig[QString("NETCTLAUTOCMD")] = QString("/usr/bin/netctl-auto");
QString fileName = KGlobal::dirs()->findResource("config", "netctl.conf");
QFile confFile(fileName);
bool ok = confFile.open(QIODevice::ReadOnly);
if (!ok) {
if (!confFile.open(QIODevice::ReadOnly)) {
configuration = updateConfiguration(rawConfig);
return;
}
@ -75,12 +75,11 @@ void Netctl::readConfiguration()
fileStr = QString(confFile.readLine()).trimmed();
if (fileStr[0] == QChar('#')) continue;
if (fileStr[0] == QChar(';')) continue;
if (fileStr.contains(QChar('='))) {
value.clear();
for (int i=1; i<fileStr.split(QChar('=')).count(); i++)
value.append(fileStr.split(QChar('='))[i]);
rawConfig[fileStr.split(QChar('='))[0]] = value.join(QChar('='));
}
if (!fileStr.contains(QChar('='))) continue;
value.clear();
for (int i=1; i<fileStr.split(QChar('=')).count(); i++)
value.append(fileStr.split(QChar('='))[i]);
rawConfig[fileStr.split(QChar('='))[0]] = value.join(QChar('='));
if (confFile.atEnd())
break;
}
@ -101,7 +100,8 @@ QMap<QString, QString> Netctl::updateConfiguration(const QMap<QString, QString>
key.remove(QChar(' '));
if ((key != QString("CMD")) &&
(key != QString("EXTIPCMD")) &&
(key != QString("IPCMD")))
(key != QString("IPCMD")) &&
(key != QString("NETCTLAUTOCMD")))
value.remove(QChar(' '));
config[key] = value;
}
@ -196,21 +196,20 @@ bool Netctl::getProfileStatus(const QString cmd)
}
QString Netctl::getProfileStringStatus(const QString cmd)
QString Netctl::getProfileStringStatus(const QString cmdNetctl, const QString cmdNetctlAuto)
{
QProcess command;
QString status = QString("static");
QString profile = getCurrentProfile(cmd);
command.start(cmd + QString(" status ") + profile);
command.waitForFinished(-1);
QString cmdOutput = QTextCodec::codecForMib(106)->toUnicode(command.readAllStandardOutput());
QStringList profileStatus = cmdOutput.split(QChar('\n'), QString::SkipEmptyParts);
for (int i=0; i<profileStatus.count(); i++)
if (profileStatus[i].split(QChar(' '), QString::SkipEmptyParts)[0] == QString("Loaded:")) {
if (profileStatus[i].contains(QString("enabled")))
status = QString("enabled");
break;
}
// check netctl-auto
if (!getCurrentProfile(cmdNetctlAuto).isEmpty())
status = QString("netctl-auto");
else {
// check netctl
command.start(cmdNetctl + QString(" is-enabled ") + getCurrentProfile(cmdNetctl));
command.waitForFinished(-1);
if (command.exitCode() == 0)
status = QString("enabled");
}
return status;
}
@ -220,7 +219,9 @@ bool Netctl::updateSourceEvent(const QString &source)
QString key = QString("value");
QString value = QString("");
if (source == QString("currentProfile")) {
value = getCurrentProfile(configuration[QString("CMD")]);
value = getCurrentProfile(configuration[QString("NETCTLAUTOCMD")]);
if (value.isEmpty())
value = getCurrentProfile(configuration[QString("CMD")]);
}
else if (source == QString("extIp")) {
if (configuration[QString("EXTIP")] == QString("true"))
@ -233,16 +234,21 @@ bool Netctl::updateSourceEvent(const QString &source)
value = getIntIp(configuration[QString("IPCMD")], configuration[QString("NETDIR")]);
}
else if (source == QString("profiles")) {
value = getProfileList(configuration[QString("CMD")]).join(QChar(','));
value = getProfileList(configuration[QString("NETCTLAUTOCMD")]).join(QChar(','));
if (value.isEmpty())
value = getProfileList(configuration[QString("CMD")]).join(QChar(','));
}
else if (source == QString("statusBool")) {
if (getProfileStatus(configuration[QString("CMD")]))
if (getProfileStatus(configuration[QString("NETCTLAUTOCMD")]))
value = QString("true");
else if (getProfileStatus(configuration[QString("CMD")]))
value = QString("true");
else
value = QString("false");
}
else if (source == QString("statusString")) {
value = getProfileStringStatus(configuration[QString("CMD")]);
value = getProfileStringStatus(configuration[QString("CMD")],
configuration[QString("NETCTLAUTOCMD")]);
}
setData(source, key, value);
return true;

View File

@ -33,7 +33,7 @@ public:
QString getIntIp(const QString cmd, const QString dir);
QStringList getProfileList(const QString cmd);
bool getProfileStatus(const QString cmd);
QString getProfileStringStatus(const QString cmd);
QString getProfileStringStatus(const QString cmdNetctl, const QString cmdNetctlAuto);
protected:
bool sourceRequestEvent(const QString &name);
@ -41,6 +41,7 @@ protected:
QStringList sources() const;
private:
bool isNetctlAutoRunning();
// configuration
QMap<QString, QString> configuration;
void readConfiguration();

View File

@ -5,7 +5,7 @@ message (STATUS "Subproject ${SUBPROJECT}")
# set directories
set (SUBPROJECT_BINARY_DIR bin)
set (SUBPROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set (SUBPROJECT_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources)
set (SUBPROJECT_RESOURCE_DIR ${PROJECT_RESOURCE_DIR})
set (SUBPROJECT_TRANSLATION_DIR ${SUBPROJECT_RESOURCE_DIR}/translations)
# executable path
set (EXECUTABLE_OUTPUT_PATH ${SUBPROJECT_BINARY_DIR})
@ -15,5 +15,10 @@ set (TARGETS "")
set (HEADERS "")
add_subdirectory (${SUBPROJECT_SOURCE_DIR})
# build man
file (GLOB SUBPROJECT_MAN_IN *.1)
file (RELATIVE_PATH SUBPROJECT_MAN ${CMAKE_SOURCE_DIR} ${SUBPROJECT_MAN_IN})
configure_file (${SUBPROJECT_MAN_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_MAN})
install (FILES ${SUBPROJECT}.desktop DESTINATION share/applications/)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_MAN} DESTINATION share/man/man1/)

64
sources/gui/netctl-gui.1 Normal file
View File

@ -0,0 +1,64 @@
.TH netctl-gui 1 "@CURRENT_DATE@" "version @PROJECT_VERSION@" "USER COMMANDS"
.SH NAME
netctl-gui is a graphical interface for netctl
.SH SYNOPSIS
.B netctl-gui
[ --about ] [ --netctl-auto ] [ --settings ]
[ -e ESSID | --essid ESSID ] [ -o PROFILE | --open PROFILE ]
[ -s PROFILE | --select PROFILE ]
[ --config FILE ] [ -d | --debug ] [ --default ]
[ --set-opts OPTIONS ] [ -t NUM | --tab NUM ]
[ -v | --version ] [ -i | --info ] [ -h | --help]
.SH DESCRIPTION
Graphical user interface for netctl written on C++ using Qt toolkit. Provides shared library for interaction with netctl and Plasmoid and DataEngine for KDE.
.SH OPTIONS
.TP
--about
show about window
.TP
--netctl-auto
show netctl-auto window
.TP
--settings
show settings window
.TP
-e, --essid ESSID
select ESSID ESSID. This option will set tab to 3 automatically
.TP
-o, --open PROFILE
open profile PROFILE. This option will set tab to 2 automatically
.TP
-s, --select PROFILE
select profile PROFILE. This option will set tab to 1 automatically
.TP
--config FILE
read configuration from file FILE
.TP
-d, --debug
print debug information
.TP
--default
start with default settings
.TP
--set-opts OPTIONS
set options OPTIONS for this run, comma separated. Example "LANGUAGE=en,NETCTL_PATH=/usr/bin/netctl"
.TP
-t, --tab NUM
open a tab with number NUM
.TP
-v, --version
show version and exit
.TP
-i, --info
show build information and exit
.TP
-h, --help
show this help and exit
.SH FILES
.TP
$HOME/.config/netctl-gui.conf
Configuration file
.SH AUTHOR
@PROJECT_AUTHOR@ <\fI@PROJECT_CONTACT@\fR>
.SH LICENSE
This software is licensed under @PROJECT_LICENSE@

View File

@ -1,6 +0,0 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>translations/english.qm</file>
<file>translations/russian.qm</file>
</qresource>
</RCC>

View File

@ -3,16 +3,16 @@ file (GLOB SOURCES *.cpp)
file (GLOB HEADERS *.h)
file (GLOB FORMS *.ui)
set (LANGUAGES english
russian)
file (GLOB LANGUAGES ${SUBPROJECT_TRANSLATION_DIR}/*.ts)
set (RESOURCES ${SUBPROJECT_RESOURCE_DIR}/resources.qrc)
message (STATUS "${SUBPROJECT} Sources: ${SOURCES}")
message (STATUS "${SUBPROJECT} Headers: ${HEADERS}")
message (STATUS "${SUBPROJECT} Forms: ${FORMS}")
# include_path
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../)
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../../${PROJECT_LIBRARY}/include/
${CMAKE_CURRENT_BINARY_DIR}/../
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR})
link_directories (${PROJECT_LIBRARY}/src/lib)
if (USE_QT5)
find_package(Qt5Core REQUIRED)
@ -26,15 +26,14 @@ if (USE_QT5)
qt5_add_resources (QRC_SOURCES ${RESOURCES})
foreach (LANGUAGE ${LANGUAGES})
set (TS ${SUBPROJECT_TRANSLATION_DIR}/${LANGUAGE}.ts)
set (QM ${SUBPROJECT_TRANSLATION_DIR}/${LANGUAGE}.qm)
set (TS ${LANGUAGE})
string (REPLACE ".ts" ".qm" QM ${TS})
set (TRANSLATIONS ${TRANSLATIONS} ${TS})
set (TRANSLATIONS_BINARY ${TRANSLATIONS_BINARY} ${QM})
add_custom_command (OUTPUT ${QM} COMMAND ${Qt5_LRELEASE_EXECUTABLE} ${TS} MAIN_DEPENDENCY ${TS})
endforeach ()
add_custom_target (translations COMMAND ${Qt5_LUPDATE_EXECUTABLE} ${HEADERS} ${SOURCES} ${UI_HEADERS} -ts ${TRANSLATIONS})
add_custom_command (TARGET translations COMMAND ${Qt5_LRELEASE_EXECUTABLE} ${TRANSLATIONS})
message (STATUS "${SUBPROJECT} Translations: ${TRANSLATIONS_BINARY}")
source_group ("Header Files" FILES ${HEADERS})
source_group ("Source Files" FILES ${SOURCES})
@ -42,7 +41,7 @@ if (USE_QT5)
include_directories (${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
add_executable (${SUBPROJECT} ${UI_HEADERS} ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${QRC_SOURCES} ${TRANSLATIONS})
target_link_libraries (${SUBPROJECT} ${Qt5Widgets_LIBRARIES} ${Qt5Core_LIBRARIES})
target_link_libraries (${SUBPROJECT} ${PROJECT_LIBRARY} ${Qt5Widgets_LIBRARIES} ${Qt5Core_LIBRARIES})
else ()
find_package (Qt4 REQUIRED)
include (${QT_USE_FILE})
@ -51,22 +50,21 @@ else ()
qt4_add_resources (QRC_SOURCES ${RESOURCES})
foreach (LANGUAGE ${LANGUAGES})
set (TS ${SUBPROJECT_TRANSLATION_DIR}/${LANGUAGE}.ts)
set (QM ${SUBPROJECT_TRANSLATION_DIR}/${LANGUAGE}.qm)
set (TS ${LANGUAGE})
string (REPLACE ".ts" ".qm" QM ${TS})
set (TRANSLATIONS ${TRANSLATIONS} ${TS})
set (TRANSLATIONS_BINARY ${TRANSLATIONS_BINARY} ${QM})
add_custom_command (OUTPUT ${QM} COMMAND ${QT_LRELEASE_EXECUTABLE} ${TS} MAIN_DEPENDENCY ${TS})
endforeach ()
add_custom_target (translations COMMAND ${QT_LUPDATE_EXECUTABLE} ${HEADERS} ${SOURCES} ${UI_HEADERS} -ts ${TRANSLATIONS})
add_custom_command (TARGET translations COMMAND ${QT_LRELEASE_EXECUTABLE} ${TRANSLATIONS})
message (STATUS "${SUBPROJECT} Translations: ${TRANSLATIONS_BINARY}")
source_group ("Header Files" FILES ${HEADERS})
source_group ("Source Files" FILES ${SOURCES})
source_group ("Generated Files" FILES ${MOC_SOURCES})
add_executable (${SUBPROJECT} ${UI_HEADERS} ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${QRC_SOURCES} ${TRANSLATIONS})
target_link_libraries (${SUBPROJECT} ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
target_link_libraries (${SUBPROJECT} ${PROJECT_LIBRARY} ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
endif()
# install properties

105
sources/gui/src/about.ui Normal file
View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>About</class>
<widget class="QWidget" name="About">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>390</width>
<height>290</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<widget class="QLabel" name="label_description">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignJustify|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_name">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_version">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item row="5" column="0">
<spacer name="spacer_about">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_links">
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_license">
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,92 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "aboutwindow.h"
#include "ui_aboutwindow.h"
#include <QDebug>
#include <QDialogButtonBox>
#include <QPushButton>
#include "version.h"
AboutWindow::AboutWindow(QWidget *parent, const bool debugCmd)
: QMainWindow(parent),
ui(new Ui::AboutWindow),
debug(debugCmd)
{
ui->setupUi(this);
createUi();
}
AboutWindow::~AboutWindow()
{
if (debug) qDebug() << "[AboutWindow]" << "[~AboutWindow]";
delete uiAbout;
delete ui;
}
void AboutWindow::createText()
{
if (debug) qDebug() << "[AboutWindow]" << "[createText]";
uiAbout->label_name->setText(QString(NAME));
uiAbout->label_version->setText(QApplication::translate("AboutWindow", "Version %1\n(build date %2)")
.arg(QString(VERSION)).arg(QString(BUILD_DATE)));
uiAbout->label_description->setText(QApplication::translate("AboutWindow", "Qt-based graphical interface for netctl."));
uiAbout->label_links->setText(QApplication::translate("AboutWindow", "Links:") + QString("<br>") +
QString("<a href=\"%1\">%2</a><br>").arg(QString(HOMEPAGE)).arg(QApplication::translate("AboutWindow", "Homepage")) +
QString("<a href=\"%1\">%2</a><br>").arg(QString(REPOSITORY)).arg(QApplication::translate("AboutWindow", "Repository")) +
QString("<a href=\"%1\">%2</a><br>").arg(QString(BUGTRACKER)).arg(QApplication::translate("AboutWindow", "Bugtracker")) +
QString("<a href=\"%1\">%2</a><br>").arg(QString(TRANSLATION)).arg(QApplication::translate("AboutWindow", "Translation issue")) +\
QString("<a href=\"%1\">%2</a>").arg(QString(AUR_PACKAGES)).arg(QApplication::translate("AboutWindow", "AUR packages")));
uiAbout->label_license->setText(QString("<small>&copy; %1 <a href=\"mailto:%2\">%3</a><br>").arg(QString(DATE)).arg(QString(EMAIL)).arg(QString(AUTHOR)) +
QApplication::translate("AboutWindow", "This software is licensed under %1").arg(QString(LICENSE)) +
QString("</small>"));
}
void AboutWindow::createUi()
{
if (debug) qDebug() << "[AboutWindow]" << "[createUi]";
QWidget *aboutWidget = new QWidget();
uiAbout = new Ui::About;
uiAbout->setupUi(aboutWidget);
ui->verticalLayout->addWidget(aboutWidget);
createText();
QDialogButtonBox *buttonBox = new QDialogButtonBox;
buttonBox->addButton(QDialogButtonBox::Close);
ui->verticalLayout->addWidget(buttonBox);
connect(buttonBox->button(QDialogButtonBox::Close), SIGNAL(clicked(bool)), this, SLOT(close()));
}
// ESC press event
void AboutWindow::keyPressEvent(QKeyEvent *pressedKey)
{
if (debug) qDebug() << "[AboutWindow]" << "[keyPressEvent]";
if (pressedKey->key() == Qt::Key_Escape)
close();
}

View File

@ -15,33 +15,37 @@
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef NETCTLPROFILE_H
#define NETCTLPROFILE_H
#ifndef ABOUTWINDOW_H
#define ABOUTWINDOW_H
#include <QDir>
#include <QMap>
#include <QObject>
#include <QKeyEvent>
#include <QMainWindow>
#include "ui_about.h"
class MainWindow;
namespace Ui {
class AboutWindow;
}
class NetctlProfile : public QObject
class AboutWindow : public QMainWindow
{
Q_OBJECT
public:
explicit NetctlProfile(MainWindow *wid = 0,
const QMap<QString, QString> settings = QMap<QString, QString>());
~NetctlProfile();
bool copyProfile(const QString oldPath);
QString createProfile(const QString profile, const QMap<QString, QString> settings);
QMap<QString, QString> getSettingsFromProfile(const QString profile);
explicit AboutWindow(QWidget *parent = 0,
const bool debugCmd = false);
~AboutWindow();
private:
MainWindow *parent;
QDir *profileDirectory;
QString sudoCommand;
Ui::AboutWindow *ui;
Ui::About *uiAbout;
bool debug;
void createText();
void createUi();
// ESC pressed event
void keyPressEvent(QKeyEvent *pressedKey);
};
#endif /* NETCTLPROFILE_H */
#endif /* ABOUTWINDOW_H */

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AboutWindow</class>
<widget class="QMainWindow" name="AboutWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>380</width>
<height>307</height>
</rect>
</property>
<property name="windowTitle">
<string>About</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout"/>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -72,9 +72,10 @@ int BridgeWidget::isOk()
void BridgeWidget::setSettings(const QMap<QString, QString> settings)
{
clear();
QMap<QString, QString> bridgeSettings = settings;
if (bridgeSettings.contains(QString("SkipForwardingDelay")))
if (bridgeSettings[QString("SkipForwardingDelay")].remove(QString("'")) == QString("yes"))
if (bridgeSettings[QString("SkipForwardingDelay")] == QString("yes"))
ui->checkBox_skip->setCheckState(Qt::Checked);
}

View File

@ -16,81 +16,208 @@
***************************************************************************/
#include "errorwindow.h"
#include "ui_errorwindow.h"
#include <QApplication>
#include <QGridLayout>
#include <QSpacerItem>
#include <QDebug>
ErrorWindow::ErrorWindow(QWidget *parent, const int messageNumber)
: QMainWindow(parent),
ui(new Ui::ErrorWindow)
ErrorWindow::ErrorWindow(QWidget *parent, const bool debugCmd)
: debug(debugCmd)
{
ui->setupUi(this);
qDebug() << "[ErrorWindow]" << "[ErrorWindow]" << ":" << "Initializate with error code" << messageNumber;
setMessage(messageNumber);
}
ErrorWindow::~ErrorWindow()
{
delete ui;
if (debug) qDebug() << "[ErrorWindow]" << "[~ErrorWindow]";
}
void ErrorWindow::setMessage(const int mess)
QStringList ErrorWindow::getMessage(const int mess)
{
QString message;
if (debug) qDebug() << "[ErrorWindow]" << "[getMessage]";
if (debug) qDebug() << "[ErrorWindow]" << "[getMessage]" << ":" << "Message" << mess;
QString message, title;
switch(mess) {
case 1:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "Could not find components");
break;
case 2:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "Does not support yet");
break;
case 3:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "Profile name is not set");
break;
case 4:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "Bind interfaces are not set");
break;
case 5:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "Description is not set");
break;
case 6:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "Ip settings are not set");
break;
case 7:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "Configuration file does not exist");
break;
case 8:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "Key is not set");
break;
case 9:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "Wireless settings are not set");
break;
case 10:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "Configuration file is not set");
break;
case 11:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "ESSID is not set");
break;
case 12:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "MAC address is incorrect");
break;
case 13:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "Session ID is not set");
break;
case 14:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "APN is not set");
break;
case 15:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "APN is not set");
break;
case 16:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "Empty user/group name");
break;
case 17:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "Could not find profile");
break;
case 18:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "Could not find ESSID");
break;
default:
title = QApplication::translate("ErrorWindow", "Error!");
message = QApplication::translate("ErrorWindow", "Unknown error");
break;
}
ui->label->setText(message);
QStringList fullMessage;
fullMessage.append(title);
fullMessage.append(message);
return fullMessage;
}
QMessageBox::Icon ErrorWindow::getIcon(const int mess)
{
if (debug) qDebug() << "[ErrorWindow]" << "[getIcon]";
if (debug) qDebug() << "[ErrorWindow]" << "[getIcon]" << ":" << "Message" << mess;
QMessageBox::Icon icon;
switch(mess) {
case 1:
icon = QMessageBox::Critical;
break;
case 2:
icon = QMessageBox::Critical;
break;
case 3:
icon = QMessageBox::Critical;
break;
case 4:
icon = QMessageBox::Critical;
break;
case 5:
icon = QMessageBox::Critical;
break;
case 6:
icon = QMessageBox::Critical;
break;
case 7:
icon = QMessageBox::Critical;
break;
case 8:
icon = QMessageBox::Critical;
break;
case 9:
icon = QMessageBox::Critical;
break;
case 10:
icon = QMessageBox::Critical;
break;
case 11:
icon = QMessageBox::Critical;
break;
case 12:
icon = QMessageBox::Critical;
break;
case 13:
icon = QMessageBox::Critical;
break;
case 14:
icon = QMessageBox::Critical;
break;
case 15:
icon = QMessageBox::Critical;
break;
case 16:
icon = QMessageBox::Critical;
break;
case 17:
icon = QMessageBox::Critical;
break;
case 18:
icon = QMessageBox::Critical;
break;
default:
icon = QMessageBox::NoIcon;
break;
}
return icon;
}
void ErrorWindow::showWindow(const int mess, const QString sender)
{
if (debug) qDebug() << "[ErrorWindow]" << "[showWindow]";
if (debug) qDebug() << "[ErrorWindow]" << "[showWindow]" << ":" << "Message" << mess;
if (debug) qDebug() << "[ErrorWindow]" << "[showWindow]" << ":" << "Sender" << sender;
QStringList message = getMessage(mess);
QMessageBox messageBox;
messageBox.setText(message[0]);
messageBox.setInformativeText(message[1]);
if (debug)
messageBox.setDetailedText(QApplication::translate("ErrorWindow", "Sender : %1").
arg(sender));
messageBox.setIcon(getIcon(mess));
messageBox.setStandardButtons(QMessageBox::Ok);
messageBox.setDefaultButton(QMessageBox::Ok);
QSpacerItem *horizontalSpacer = new QSpacerItem(400, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
QGridLayout *layout = (QGridLayout *)messageBox.layout();
layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount());
messageBox.exec();
return;
}

View File

@ -18,25 +18,28 @@
#ifndef ERRORWINDOW_H
#define ERRORWINDOW_H
#include <QMainWindow>
#include <QMessageBox>
#include <QObject>
namespace Ui {
class ErrorWindow;
}
class ErrorWindow : public QMainWindow
class ErrorWindow : public QObject
{
Q_OBJECT
public:
explicit ErrorWindow(QWidget *parent = 0,
const int messageNumber = 0);
const bool debugCmd = false);
~ErrorWindow();
public slots:
void showWindow(const int mess = 0,
const QString sender = QString());
private:
Ui::ErrorWindow *ui;
void setMessage(const int mess);
bool debug;
QStringList getMessage(const int mess);
QMessageBox::Icon getIcon(const int mess);
};
#endif /* ERRORWINDOW_H */

View File

@ -1,123 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ErrorWindow</class>
<widget class="QMainWindow" name="ErrorWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>287</width>
<height>101</height>
</rect>
</property>
<property name="windowTitle">
<string>Error</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<spacer name="spacer2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="layout_main">
<item>
<widget class="QLabel" name="label">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>Error text</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="spacer1">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="layout_button">
<item>
<spacer name="spacer_button1">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Ok</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer_button2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections>
<connection>
<sender>pushButton</sender>
<signal>clicked(bool)</signal>
<receiver>ErrorWindow</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>143</x>
<y>83</y>
</hint>
<hint type="destinationlabel">
<x>252</x>
<y>80</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -141,19 +141,20 @@ int EthernetWidget::isOk()
void EthernetWidget::setSettings(const QMap<QString, QString> settings)
{
clear();
QMap<QString, QString> ethernetSettings = settings;
if (ethernetSettings.contains(QString("SkipNoCarrier")))
if (ethernetSettings[QString("SkipNoCarrier")].remove(QString("'")) == QString("yes"))
if (ethernetSettings[QString("SkipNoCarrier")] == QString("yes"))
ui->checkBox_skip->setCheckState(Qt::Checked);
if (ethernetSettings.contains(QString("Auth8021X")))
if (ethernetSettings[QString("Auth8021X")].remove(QString("'")) == QString("yes"))
if (ethernetSettings[QString("Auth8021X")] == QString("yes"))
ui->checkBox_8021x->setCheckState(Qt::Checked);
if (ethernetSettings.contains(QString("WPAConfigFile")))
ui->lineEdit_wpaConfig->setText(ethernetSettings[QString("WPAConfigFile")].remove(QString("'")));
ui->lineEdit_wpaConfig->setText(ethernetSettings[QString("WPAConfigFile")]);
if (ethernetSettings.contains(QString("WPADriver")))
for (int i=0; i<ui->comboBox_driver->count(); i++)
if (ethernetSettings[QString("WPADriver")].remove(QString("'")) == ui->comboBox_driver->itemText(i))
if (ethernetSettings[QString("WPADriver")] == ui->comboBox_driver->itemText(i))
ui->comboBox_driver->setCurrentIndex(i);
if (ethernetSettings.contains(QString("TimeoutCarrier")))
ui->spinBox_timeoutCarrier->setValue(ethernetSettings[QString("TimeoutCarrier")].toInt());

View File

@ -136,13 +136,13 @@ QMap<QString, QString> GeneralWidget::getSettings()
QStringList interfaces;
for (int i=0; i<ui->listWidget_bindto->count(); i++)
interfaces.append(ui->listWidget_bindto->item(i)->text());
generalSettings[QString("BindsToInterfaces")] = interfaces.join(QString(" "));
generalSettings[QString("BindsToInterfaces")] = interfaces.join(QChar(' '));
}
if (ui->listWidget_after->count() != 0) {
QStringList profiles;
for (int i=0; i<ui->listWidget_after->count(); i++)
profiles.append(ui->listWidget_after->item(i)->text());
generalSettings[QString("After")] = profiles.join(QString(" "));
generalSettings[QString("After")] = profiles.join(QChar(' '));
}
if (!ui->lineEdit_execUpPost->text().isEmpty())
generalSettings[QString("ExecUpPost")] = QString("'") + ui->lineEdit_execUpPost->text() + QString("'");
@ -175,30 +175,31 @@ int GeneralWidget::isOk()
void GeneralWidget::setSettings(const QMap<QString, QString> settings)
{
clear();
QMap<QString, QString> generalSettings = settings;
if (generalSettings.contains(QString("Description")))
ui->lineEdit_description->setText(generalSettings[QString("Description")].remove(QString("'")));
ui->lineEdit_description->setText(generalSettings[QString("Description")]);
if (generalSettings.contains(QString("Connection")))
for (int i=0; i<ui->comboBox_connection->count(); i++)
if (generalSettings[QString("Connection")].remove(QString("'")) == ui->comboBox_connection->itemText(i))
if (generalSettings[QString("Connection")] == ui->comboBox_connection->itemText(i))
ui->comboBox_connection->setCurrentIndex(i);
if (generalSettings.contains(QString("Interface")))
for (int i=0; i<ui->comboBox_interface->count(); i++)
if (generalSettings[QString("Interface")].remove(QString("'")) == ui->comboBox_interface->itemText(i))
ui->comboBox_interface->setCurrentIndex(i);
if (generalSettings.contains(QString("Interface"))) {
ui->comboBox_interface->addItem(generalSettings[QString("Interface")]);
ui->comboBox_interface->setCurrentIndex(ui->comboBox_interface->count()-1);
}
if (generalSettings.contains(QString("BindsToInterfaces")))
ui->listWidget_bindto->addItems(generalSettings[QString("BindsToInterfaces")].split(QString(" ")));
ui->listWidget_bindto->addItems(generalSettings[QString("BindsToInterfaces")].split(QChar('\n')));
if (generalSettings.contains(QString("After")))
ui->listWidget_after->addItems(generalSettings[QString("After")].split(QString(" ")));
ui->listWidget_after->addItems(generalSettings[QString("After")].split(QChar('\n')));
if (generalSettings.contains(QString("ExecUpPost")))
ui->lineEdit_execUpPost->setText(generalSettings[QString("ExecUpPost")].remove(QString("'")));
ui->lineEdit_execUpPost->setText(generalSettings[QString("ExecUpPost")]);
if (generalSettings.contains(QString("ExecDownPre")))
ui->lineEdit_execDownPre->setText(generalSettings[QString("ExecDownPre")].remove(QString("'")));
ui->lineEdit_execDownPre->setText(generalSettings[QString("ExecDownPre")]);
if (generalSettings.contains(QString("ForceConnect")))
if (generalSettings[QString("ForceConnect")].remove(QString("'")) == QString("yes"))
if (generalSettings[QString("ForceConnect")] == QString("yes"))
ui->checkBox_forceConnect->setCheckState(Qt::Checked);
if (generalSettings.contains(QString("NETCTL_DEBUG")))
if (generalSettings[QString("NETCTL_DEBUG")].remove(QString("'")) == QString("yes"))
if (generalSettings[QString("NETCTL_DEBUG")] == QString("yes"))
ui->checkBox_debug->setCheckState(Qt::Checked);
}

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>431</width>
<height>537</height>
<width>429</width>
<height>535</height>
</rect>
</property>
<property name="windowTitle">
@ -118,6 +118,11 @@
<string notr="true">vlan</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">macvlan</string>
</property>
</item>
</widget>
</item>
</layout>

View File

@ -18,7 +18,6 @@
#include "ipwidget.h"
#include "ui_ipwidget.h"
#include <QDebug>
#include <QKeyEvent>
@ -171,7 +170,7 @@ void IpWidget::keyPressEvent(QKeyEvent *pressedKey)
QString IpWidget::getIp(const QString rawIp)
{
QStringList ip = rawIp.split(QString("."));
QStringList ip = rawIp.split(QChar('.'));
// fix empty fields
if (ip[0].isEmpty())
@ -187,7 +186,7 @@ QString IpWidget::getIp(const QString rawIp)
if (ip[i].toInt() > 255)
ip[i] = QString("255");
return ip.join(QString("."));
return ip.join(QChar('.'));
}
@ -234,8 +233,8 @@ QString IpWidget::getPrefix6(const QString rawPrefix)
void IpWidget::addIp()
{
QString ip = getIp(ui->lineEdit_ipAddress->text().remove(" ").split(QString("/"))[0]);
QString prefix = getPrefix(ui->lineEdit_ipAddress->text().remove(" ").split(QString("/"))[1]);
QString ip = getIp(ui->lineEdit_ipAddress->text().remove(QChar(' ')).split(QChar('/'))[0]);
QString prefix = getPrefix(ui->lineEdit_ipAddress->text().remove(QChar(' ')).split(QChar('/'))[1]);
ui->listWidget_ipAddress->addItem(ip + QString("/") + prefix);
ui->lineEdit_ipAddress->clear();
@ -244,9 +243,9 @@ void IpWidget::addIp()
void IpWidget::addIpRoutes()
{
QString ip = getIp(ui->lineEdit_ipRoutes->text().remove(" ").split(QString("/"))[0]);
QString prefix = getPrefix(ui->lineEdit_ipRoutes->text().remove(" ").split(QString("/"))[1]);
QString ipVia = getIp(ui->lineEdit_ipRoutes2->text().remove(" "));
QString ip = getIp(ui->lineEdit_ipRoutes->text().remove(QChar(' ')).split(QChar('/'))[0]);
QString prefix = getPrefix(ui->lineEdit_ipRoutes->text().remove(QChar(' ')).split(QChar('/'))[1]);
QString ipVia = getIp(ui->lineEdit_ipRoutes2->text().remove(QChar(' ')));
ui->listWidget_ipRoutes->addItem(ip + QString("/") + prefix + QString(" via ") + ipVia);
ui->lineEdit_ipRoutes->clear();
@ -256,8 +255,8 @@ void IpWidget::addIpRoutes()
void IpWidget::addIp6()
{
QString ip = getIp6(ui->lineEdit_ipAddress6->text().remove(" ").split(QString("/"))[0]);
QString prefix = getPrefix6(ui->lineEdit_ipAddress6->text().remove(" ").split(QString("/"))[1]);
QString ip = getIp6(ui->lineEdit_ipAddress6->text().remove(QChar(' ')).split(QChar('/'))[0]);
QString prefix = getPrefix6(ui->lineEdit_ipAddress6->text().remove(QChar(' ')).split(QChar('/'))[1]);
ui->listWidget_ipAddress6->addItem(ip + QString("/") + prefix);
ui->lineEdit_ipAddress6->clear();
@ -266,9 +265,9 @@ void IpWidget::addIp6()
void IpWidget::addIpRoutes6()
{
QString ip = getIp6(ui->lineEdit_ipRoutes6->text().remove(" ").split(QString("/"))[0]);
QString prefix = getPrefix6(ui->lineEdit_ipRoutes6->text().remove(" ").split(QString("/"))[1]);
QString ipVia = getIp6(ui->lineEdit_ipRoutes62->text().remove(" "));
QString ip = getIp6(ui->lineEdit_ipRoutes6->text().remove(QChar(' ')).split(QChar('/'))[0]);
QString prefix = getPrefix6(ui->lineEdit_ipRoutes6->text().remove(QChar(' ')).split(QChar('/'))[1]);
QString ipVia = getIp6(ui->lineEdit_ipRoutes62->text().remove(QChar(' ')));
ui->listWidget_ipRoutes6->addItem(ip + QString("/") + prefix + QString(" via ") + ipVia);
ui->lineEdit_ipRoutes6->clear();
@ -286,7 +285,7 @@ void IpWidget::addCustom()
void IpWidget::addDns()
{
QString ip = getIp(ui->lineEdit_dns->text().remove(" "));
QString ip = getIp(ui->lineEdit_dns->text().remove(QChar(' ')));
ui->listWidget_dns->addItem(ip);
ui->lineEdit_dns->clear();
@ -390,14 +389,14 @@ QMap<QString, QString> IpWidget::getSettings()
QStringList addresses;
for (int i=0; i<ui->listWidget_ipAddress->count(); i++)
addresses.append(QString("'") + ui->listWidget_ipAddress->item(i)->text() + QString("'"));
ipSettings[QString("Address")] = addresses.join(QString(" "));
ipSettings[QString("Address")] = addresses.join(QChar(' '));
ipSettings[QString("Gateway")] = QString("'") + ui->lineEdit_gateway->text() + QString("'");
}
if (ui->listWidget_ipRoutes->count() > 0) {
QStringList routes;
for (int i=0; i<ui->listWidget_ipRoutes->count(); i++)
routes.append(QString("'") + ui->listWidget_ipRoutes->item(i)->text() + QString("'"));
ipSettings[QString("Routes")] = routes.join(QString(" "));
ipSettings[QString("Routes")] = routes.join(QChar(' '));
}
}
else
@ -409,14 +408,14 @@ QMap<QString, QString> IpWidget::getSettings()
QStringList addresses;
for (int i=0; i<ui->listWidget_ipAddress6->count(); i++)
addresses.append(QString("'") + ui->listWidget_ipAddress6->item(i)->text() + QString("'"));
ipSettings[QString("Address6")] = addresses.join(QString(" "));
ipSettings[QString("Address6")] = addresses.join(QChar(' '));
ipSettings[QString("Gateway6")] = QString("'") + ui->lineEdit_gateway6->text() + QString("'");
}
if (ui->listWidget_ipRoutes6->count() > 0) {
QStringList routes;
for (int i=0; i<ui->listWidget_ipRoutes6->count(); i++)
routes.append(QString("'") + ui->listWidget_ipRoutes6->item(i)->text() + QString("'"));
ipSettings[QString("Routes6")] = routes.join(QString(" "));
ipSettings[QString("Routes6")] = routes.join(QChar(' '));
}
}
else
@ -425,7 +424,7 @@ QMap<QString, QString> IpWidget::getSettings()
QStringList custom;
for (int i=0; i<ui->listWidget_custom->count(); i++)
custom.append(QString("'") + ui->listWidget_custom->item(i)->text() + QString("'"));
ipSettings[QString("IPCustom")] = custom.join(QString(" "));
ipSettings[QString("IPCustom")] = custom.join(QChar(' '));
}
if (!ui->lineEdit_hostname->text().isEmpty())
ipSettings[QString("Hostname")] = QString("'") + ui->lineEdit_hostname->text() + QString("'");
@ -450,7 +449,7 @@ QMap<QString, QString> IpWidget::getSettings()
QStringList dns;
for (int i=0; i<ui->listWidget_dns->count(); i++)
dns.append(QString("'") + ui->listWidget_dns->item(i)->text() + QString("'"));
ipSettings[QString("DNS")] = dns.join(QString(" "));
ipSettings[QString("DNS")] = dns.join(QChar(' '));
}
if (!ui->lineEdit_dnsDomain->text().isEmpty())
ipSettings[QString("DNSDomain")] = QString("'") + ui->lineEdit_dnsDomain->text() + QString("'");
@ -460,7 +459,7 @@ QMap<QString, QString> IpWidget::getSettings()
QStringList dnsOpt;
for (int i=0; i<ui->listWidget_dnsOptions->count(); i++)
dnsOpt.append(QString("'") + ui->listWidget_dnsOptions->item(i)->text() + QString("'"));
ipSettings[QString("DNSOptions")] = dnsOpt.join(QString(" "));
ipSettings[QString("DNSOptions")] = dnsOpt.join(QChar(' '));
}
return ipSettings;
@ -489,76 +488,71 @@ int IpWidget::isOk()
void IpWidget::setSettings(const QMap<QString, QString> settings)
{
clear();
QMap<QString, QString> ipSettings = settings;
if (ipSettings.contains(QString("IP"))) {
if (ipSettings[QString("IP")].remove(QString("'")) == QString("no"))
if (ipSettings[QString("IP")] == QString("no"))
ui->checkBox_ip->setCheckState(Qt::Unchecked);
else {
ui->checkBox_ip->setCheckState(Qt::Checked);
for (int i=0; i<ui->comboBox_ip->count(); i++)
if (ipSettings[QString("IP")].remove(QString("'")) == ui->comboBox_ip->itemText(i))
if (ipSettings[QString("IP")] == ui->comboBox_ip->itemText(i))
ui->comboBox_ip->setCurrentIndex(i);
}
}
if (ipSettings.contains(QString("Address")))
ui->listWidget_ipAddress->addItems(ipSettings[QString("Address")].remove(QString("'")).split(QString(" ")));
ui->listWidget_ipAddress->addItems(ipSettings[QString("Address")].split(QChar('\n')));
if (ipSettings.contains(QString("Gateway")))
ui->lineEdit_gateway->setText(ipSettings[QString("Gateway")].remove(QString("'")));
ui->lineEdit_gateway->setText(ipSettings[QString("Gateway")]);
if (ipSettings.contains(QString("Routes")))
ui->listWidget_ipRoutes->addItems(ipSettings[QString("Routes")].remove(QString("'")).split(QString(" ")));
ui->listWidget_ipRoutes->addItems(ipSettings[QString("Routes")].split(QChar('\n')));
if (ipSettings.contains(QString("IP6"))) {
if (ipSettings[QString("IP6")].remove(QString("'")) == QString("no"))
if (ipSettings[QString("IP6")] == QString("no"))
ui->checkBox_ip6->setCheckState(Qt::Unchecked);
else {
ui->checkBox_ip6->setCheckState(Qt::Checked);
for (int i=0; i<ui->comboBox_ip6->count(); i++)
if (ipSettings[QString("IP6")].remove(QString("'")) == ui->comboBox_ip6->itemText(i))
if (ipSettings[QString("IP6")] == ui->comboBox_ip6->itemText(i))
ui->comboBox_ip6->setCurrentIndex(i);
}
}
if (ipSettings.contains(QString("Address6")))
ui->listWidget_ipAddress6->addItems(ipSettings[QString("Address6")].remove(QString("'")).split(QString(" ")));
ui->listWidget_ipAddress6->addItems(ipSettings[QString("Address6")].split(QChar('\n')));
if (ipSettings.contains(QString("Gateway6")))
ui->lineEdit_gateway6->setText(ipSettings[QString("Gateway6")].remove(QString("'")));
ui->lineEdit_gateway6->setText(ipSettings[QString("Gateway6")]);
if (ipSettings.contains(QString("Routes6")))
ui->listWidget_ipRoutes6->addItems(ipSettings[QString("Routes6")].remove(QString("'")).split(QString(" ")));
if (ipSettings.contains(QString("IPCustom"))) {
QStringList custom;
if (ipSettings[QString("IPCustom")].contains(QString("\n")))
custom = ipSettings[QString("IPCustom")].split(QString("'\n'"));
else
custom = ipSettings[QString("IPCustom")].split(QString("' '"));
for (int i=0; i<custom.count(); i++)
ui->listWidget_custom->addItem(custom[i].remove(QString("'")));
}
ui->listWidget_ipRoutes6->addItems(ipSettings[QString("Routes6")].split(QChar('\n')));
if (ipSettings.contains(QString("IPCustom")))
ui->listWidget_custom->addItems(ipSettings[QString("IPCustom")].split(QChar('\n')));
if (ipSettings.contains(QString("Hostname")))
ui->lineEdit_hostname->setText(ipSettings[QString("Hostname")].remove(QString("'")));
ui->lineEdit_hostname->setText(ipSettings[QString("Hostname")]);
if (ipSettings.contains(QString("TimeoutDAD")))
ui->spinBox_timeoutDad->setValue(ipSettings[QString("TimeoutDAD")].toInt());
if (ipSettings.contains(QString("DHCPClient")))
for (int i=0; i<ui->comboBox_dhcp->count(); i++)
if (ipSettings[QString("DHCPClient")].remove(QString("'")) == ui->comboBox_dhcp->itemText(i))
if (ipSettings[QString("DHCPClient")] == ui->comboBox_dhcp->itemText(i))
ui->comboBox_dhcp->setCurrentIndex(i);
if (ipSettings.contains(QString("DhcpcdOptions")))
ui->lineEdit_dhcpcdOpt->setText(ipSettings[QString("DhcpcdOptions")].remove(QString("'")));
ui->lineEdit_dhcpcdOpt->setText(ipSettings[QString("DhcpcdOptions")]
.remove(QChar('\'')).remove(QChar('"')));
if (ipSettings.contains(QString("DhclientOptions")))
ui->lineEdit_dhclientOpt->setText(ipSettings[QString("DhclientOptions")].remove(QString("'")));
ui->lineEdit_dhclientOpt->setText(ipSettings[QString("DhclientOptions")]);
if (ipSettings.contains(QString("DhclientOptions6")))
ui->lineEdit_dhclientOpt6->setText(ipSettings[QString("DhclientOptions6")].remove(QString("'")));
ui->lineEdit_dhclientOpt6->setText(ipSettings[QString("DhclientOptions6")]);
if (ipSettings.contains(QString("TimeoutDHCP")))
ui->spinBox_timeoutDhcp->setValue(ipSettings[QString("TimeoutDHCP")].toInt());
if (ipSettings.contains(QString("DHCPReleaseOnStop")))
if (ipSettings[QString("DHCPReleaseOnStop")].remove(QString("'")) == QString("yes"))
if (ipSettings[QString("DHCPReleaseOnStop")] == QString("yes"))
ui->checkBox_dhcp->setCheckState(Qt::Checked);
if (ipSettings.contains(QString("DNS")))
ui->listWidget_dns->addItems(ipSettings[QString("DNS")].remove(QString("'")).split(QString(" ")));
ui->listWidget_dns->addItems(ipSettings[QString("DNS")].split(QChar('\n')));
if (ipSettings.contains(QString("DNSDomain")))
ui->lineEdit_dnsDomain->setText(ipSettings[QString("DNSDomain")].remove(QString("'")));
ui->lineEdit_dnsDomain->setText(ipSettings[QString("DNSDomain")]);
if (ipSettings.contains(QString("DNSSearch")))
ui->lineEdit_dnsSearch->setText(ipSettings[QString("DNSSearch")].remove(QString("'")));
ui->lineEdit_dnsSearch->setText(ipSettings[QString("DNSSearch")]);
if (ipSettings.contains(QString("DNSOptions")))
ui->listWidget_dnsOptions->addItems(ipSettings[QString("DNSOptions")].remove(QString("'")).split(QString(" ")));
ui->listWidget_dnsOptions->addItems(ipSettings[QString("DNSOptions")].split(QChar('\n')));
ipEnable(ui->checkBox_ip->checkState());
changeIpMode(ui->comboBox_ip->currentText());

View File

@ -0,0 +1,113 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "language.h"
#include <QFile>
#include <QLocale>
Language::Language()
{
}
QString Language::checkLanguage(const QString language, const QString defaultLanguage)
{
QStringList availableLanguages = getAvailableLanguages();
for (int i=0; i<availableLanguages.count(); i++)
if (language == availableLanguages[i])
return availableLanguages[i];
for (int i=0; i<availableLanguages.count(); i++)
if (language.contains(availableLanguages[i] + QChar('_')))
return availableLanguages[i];
return defaultLanguage;
}
QString Language::defineLanguage(const QString configPath, const QString options)
{
QMap<QString, QString> optionsDict = parseOptions(options);
if (optionsDict.contains(QString("LANGUAGE")))
if (getAvailableLanguages().contains(optionsDict[QString("LANGUAGE")]))
return optionsDict[QString("LANGUAGE")];
QString language;
language = defineLanguageFromFile(configPath);
if (language.isEmpty())
language = defineLanguageFromLocale();
language = checkLanguage(language, QString("en"));
return language;
}
QString Language::defineLanguageFromFile(const QString configPath)
{
QString language;
if (configPath.isEmpty())
return language;
QFile configFile(configPath);
QString fileStr;
if (!configFile.open(QIODevice::ReadOnly))
return language;
while (true) {
fileStr = QString(configFile.readLine());
if (fileStr[0] == QChar('#')) continue;
if (fileStr.contains(QString("LANGUAGE=")))
language = fileStr.split(QChar('='))[1]
.remove(QChar(' '))
.trimmed();
if (configFile.atEnd())
break;
}
configFile.close();
return language;
}
QString Language::defineLanguageFromLocale()
{
return QLocale::system().name();
}
QStringList Language::getAvailableLanguages()
{
QStringList languages;
languages.append(QString("en"));
languages.append(QString("ru"));
return languages;
}
QMap<QString, QString> Language::parseOptions(const QString options)
{
QMap<QString, QString> optionsDict;
for (int i=0; i<options.split(QChar(',')).count(); i++) {
if (options.split(QChar(','))[i].split(QChar('=')).count() < 2)
continue;
optionsDict[options.split(QChar(','))[i].split(QChar('='))[0]] =
options.split(QChar(','))[i].split(QChar('='))[1];
}
return optionsDict;
}

View File

@ -0,0 +1,43 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef LANGUAGE_H
#define LANGUAGE_H
#include <QStringList>
class Language : public QObject
{
Q_OBJECT
public:
explicit Language();
static QString checkLanguage(const QString language,
const QString defaultLanguage = QString("en"));
static QString defineLanguage(const QString configPath,
const QString options = QString("OPTIONS"));
static QString defineLanguageFromFile(const QString configPath);
static QString defineLanguageFromLocale();
static QStringList getAvailableLanguages();
private:
static QMap<QString, QString> parseOptions(const QString options);
};
#endif /* LANGUAGE_H */

View File

@ -0,0 +1,94 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "macvlanwidget.h"
#include "ui_macvlanwidget.h"
MacvlanWidget::MacvlanWidget(QWidget *parent)
: QWidget(parent),
ui(new Ui::MacvlanWidget)
{
ui->setupUi(this);
createFilter();
}
MacvlanWidget::~MacvlanWidget()
{
delete ui;
}
void MacvlanWidget::clear()
{
ui->comboBox_mode->setCurrentIndex(0);
ui->lineEdit_mac->clear();
}
void MacvlanWidget::setShown(const bool state)
{
if (state)
show();
else
hide();
}
void MacvlanWidget::createFilter()
{
// mac
ui->lineEdit_mac->setInputMask(QString(">HH:HH:HH:HH:HH:HH"));
}
QMap<QString, QString> MacvlanWidget::getSettings()
{
QMap<QString, QString> macvlanSettings;
if (isOk() != 0)
return macvlanSettings;
macvlanSettings[QString("Mode")] = ui->comboBox_mode->currentText();
if (!ui->lineEdit_mac->text().remove(QChar(':')).remove(QChar(' ')).isEmpty())
macvlanSettings[QString("MACAddress")] = ui->lineEdit_mac->text();
return macvlanSettings;
}
int MacvlanWidget::isOk()
{
// all fine
return 0;
}
void MacvlanWidget::setSettings(const QMap<QString, QString> settings)
{
clear();
QMap<QString, QString> macvlanSettings = settings;
if (macvlanSettings.contains(QString("Mode")))
for (int i=0; i<ui->comboBox_mode->count(); i++)
if (macvlanSettings[QString("Mode")] == ui->comboBox_mode->itemText(i))
ui->comboBox_mode->setCurrentIndex(i);
if (macvlanSettings.contains(QString("MACAddress")))
ui->lineEdit_mac->setText(macvlanSettings[QString("MACAddress")]);
}

View File

@ -15,51 +15,35 @@
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef WPASUPINTERACT_H
#define WPASUPINTERACT_H
#ifndef MACVLANWIDGET_H
#define MACVLANWIDGET_H
#include <QDir>
#include <QMap>
#include <QObject>
#include <QWidget>
class MainWindow;
namespace Ui {
class MacvlanWidget;
}
class WpaSup : public QObject
class MacvlanWidget : public QWidget
{
Q_OBJECT
public:
explicit WpaSup(MainWindow *wid = 0,
const QMap<QString, QString> settings = QMap<QString, QString>());
~WpaSup();
// general information
QString existentProfile(const QString profile);
QStringList getInterfaceList();
bool isProfileActive(const QString profile);
bool isProfileExists(const QString profile);
explicit MacvlanWidget(QWidget *parent = 0);
~MacvlanWidget();
QMap<QString, QString> getSettings();
int isOk();
void setSettings(const QMap<QString, QString> settings);
public slots:
// functions
QList<QStringList> scanWifi();
bool startWpaSupplicant();
bool stopWpaSupplicant();
void clear();
void setShown(const bool state);
private:
MainWindow *parent;
QString ctrlDir;
QString ctrlGroup;
QDir *ifaceDirectory;
QString mainInterface;
QString pidFile;
QString sudoCommand;
QString wpaCliPath;
QString wpaDrivers;
QString wpaSupPath;
// functions
bool wpaCliCall(const QString commandLine);
QString getWpaCliOutput(const QString commandLine);
Ui::MacvlanWidget *ui;
void createFilter();
};
#endif /* WPASUPINTERACT_H */
#endif /* MACVLANWIDGET_H */

View File

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MacvlanWidget</class>
<widget class="QWidget" name="MacvlanWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>396</width>
<height>101</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QDockWidget" name="dockWidget_macvlan">
<property name="features">
<set>QDockWidget::NoDockWidgetFeatures</set>
</property>
<property name="windowTitle">
<string>macvlan settings</string>
</property>
<widget class="QWidget" name="dockWidgetContents_macvlan">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QHBoxLayout" name="layout_mode">
<item>
<widget class="QLabel" name="label_mode">
<property name="text">
<string>Mode</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_mode">
<item>
<property name="text">
<string notr="true">bridge</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">vepa</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">private</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">passthru</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="layout_mac">
<item>
<widget class="QLabel" name="label_mac">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>MAC address</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_mac">
<property name="toolTip">
<string>Optional static MAC address</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -19,10 +19,10 @@
#include <QApplication>
#include <QDir>
#include <QTextStream>
#include <QTranslator>
#include <iostream>
#include "language.h"
#include "mainwindow.h"
#include "version.h"
@ -30,6 +30,15 @@
using namespace std;
QChar isParametrEnable(const bool parametr)
{
if (parametr)
return QChar('*');
else
return QChar(' ');
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
@ -37,59 +46,82 @@ int main(int argc, char *argv[])
// translation
QString configPath = QDir::homePath() + QDir::separator() + QString(".config") +
QDir::separator() + QString("netctl-gui.conf");
QFile configFile(configPath);
QString fileStr;
QString language = QString("english");
if (configFile.open(QIODevice::ReadOnly))
while (true) {
fileStr = QString(configFile.readLine());
if (fileStr[0] != '#') {
if (fileStr.contains(QString("LANGUAGE=")))
language = fileStr.split(QString("="))[1]
.remove(QString(" "))
.trimmed();
}
if (configFile.atEnd())
break;
}
configFile.close();
QString language = Language::defineLanguage(configPath);
QTranslator translator;
translator.load(QString(":/translations/") + language);
a.installTranslator(&translator);
QString helpMessage = QString("");
helpMessage += QApplication::translate("MainWindow", " Netctl GUI\n");
helpMessage += QApplication::translate("MainWindow", "Version : %1 License : GPLv3\n")
.arg(QString(VERSION));
helpMessage += QApplication::translate("MainWindow", " Evgeniy Alekseev aka arcanis\n");
helpMessage += QApplication::translate("MainWindow", " E-mail : esalexeev@gmail.com\n\n");
helpMessage += QApplication::translate("MainWindow", "Usage:\n");
helpMessage += QApplication::translate("MainWindow", "netctl-gui [ --default ] [ -t NUM | --tab NUM ] [ -h | --help]\n\n");
helpMessage += QApplication::translate("MainWindow", "Parametrs:\n");
helpMessage += QApplication::translate("MainWindow", " --default - start with default settings\n");
helpMessage += QApplication::translate("MainWindow", " -t NUM --tab NUM - open a tab with number NUM\n");
helpMessage += QApplication::translate("MainWindow", " -h --help - show this help and exit\n");
// reading command line flags
bool error = false;
// windows
bool showAbout = false;
bool showNetctlAuto = false;
bool showSettings = false;
// main functions
QString selectEssid = QString("ESSID");
QString openProfile = QString("PROFILE");
QString selectProfile = QString("PROFILE");
// additional functions
bool debug = false;
bool defaultSettings = false;
int tabNumber = 0;
QString options = QString("OPTIONS");
int tabNumber = 1;
// messages
bool showVersion = false;
bool showInfo = false;
bool showHelp = false;
// reading
for (int i=1; i<argc; i++) {
// help message
if (((argv[i][0] == '-') && (argv[i][1] == 'h') && (argv[i][2] == '\0')) ||
((argv[i][0] == '-') && (argv[i][1] == '-') && (argv[i][2] == 'h') && (argv[i][3] == 'e') &&
(argv[i][4] == 'l') && (argv[i][5] == 'p') && (argv[i][6] == '\0'))) {
cout << helpMessage.toUtf8().data();
return 0;
// windows
// about
if (QString(argv[i]) == QString("--about")) {
showAbout = true;
}
// netctl-auto
else if (QString(argv[i]) == QString("--netctl-auto")) {
showNetctlAuto = true;
}
// settings
else if (QString(argv[i]) == QString("--settings")) {
showSettings = true;
}
// main functions
// select ESSID
else if ((QString(argv[i]) == QString("-e")) || (QString(argv[i]) == QString("--essid"))) {
selectEssid = QString(argv[i+1]);
i++;
}
// open profile
else if ((QString(argv[i]) == QString("-o")) || (QString(argv[i]) == QString("--open"))) {
openProfile = QString(argv[i+1]);
i++;
}
// select profile
else if ((QString(argv[i]) == QString("-s")) || (QString(argv[i]) == QString("--select"))) {
selectProfile = QString(argv[i+1]);
i++;
}
// additional functions
// config path
else if (QString(argv[i]) == QString("--config")) {
configPath = QString(argv[i+1]);
i++;
}
// debug
else if ((QString(argv[i]) == QString("-d")) || (QString(argv[i]) == QString("--debug"))) {
debug = true;
}
// default settings
else if ((argv[i][0] == '-') && (argv[i][1] == '-') && (argv[i][2] == 'd') && (argv[i][3] == 'e') &&
(argv[i][4] == 'f') && (argv[i][5] == 'a') && (argv[i][6] == 'u') && (argv[i][7] == 'l') &&
(argv[i][8] == 't') && (argv[i][9] == '\0')) {
else if (QString(argv[i]) == QString("--default")) {
defaultSettings = true;
}
// options
else if (QString(argv[i]) == QString("--set-opts")) {
options = QString(argv[i+1]);
i++;
}
// tab number
else if (((argv[i][0] == '-') && (argv[i][1] == 't') && (argv[i][2] == '\0')) ||
((argv[i][0] == '-') && (argv[i][1] == '-') && (argv[i][2] == 't') &&
(argv[i][3] == 'a') && (argv[i][4] == 'b') && (argv[i][5] == '\0'))) {
else if ((QString(argv[i]) == QString("-t")) || (QString(argv[i]) == QString("--tab"))) {
if (atoi(argv[i+1]) > 3)
tabNumber = 3;
else if (atoi(argv[i+1]) < 1)
@ -98,9 +130,146 @@ int main(int argc, char *argv[])
tabNumber = atoi(argv[i+1]);
i++;
}
// messages
// version message
else if ((QString(argv[i]) == QString("-v")) || (QString(argv[i]) == QString("--version"))) {
showVersion = true;
}
// info message
else if ((QString(argv[i]) == QString("-i")) || (QString(argv[i]) == QString("--info"))) {
showInfo = true;
}
// help message
else if ((QString(argv[i]) == QString("-h")) || (QString(argv[i]) == QString("--help"))) {
showHelp = true;
}
else {
error = true;
}
}
if (selectEssid != QString("ESSID"))
tabNumber = 3;
if (openProfile != QString("PROFILE"))
tabNumber = 2;
if (selectProfile != QString("PROFILE"))
tabNumber = 1;
MainWindow w(0, defaultSettings, tabNumber);
// messages
QString errorMessage = QApplication::translate("MainWindow", "Unknown flag\n");
QString helpMessage = QString("");
helpMessage += QString("%1\n").arg(QApplication::translate("MainWindow", "Usage:"));
helpMessage += QString("netctl-gui [ --about ] [ --netctl-auto ] [ --settings ]\n");
helpMessage += QString(" [ -e ESSID | --essid ESSID ] [ -o PROFILE | --open PROFILE ]\n");
helpMessage += QString(" [ -s PROFILE | --select PROFILE ]\n");
helpMessage += QString(" [ --config FILE ] [ -d | --debug ] [ --default ]\n");
helpMessage += QString(" [ --set-opts OPTIONS ] [ -t NUM | --tab NUM ]\n");
helpMessage += QString(" [ -v | --version ] [ -i | --info ] [ -h | --help]\n\n");
helpMessage += QString("%1\n").arg(QApplication::translate("MainWindow", "Parametrs:"));
// windows
helpMessage += QString("%1\n").arg(QApplication::translate("MainWindow", "Open window:"));
helpMessage += QString("%1 --about - %2\n")
.arg(isParametrEnable(showAbout))
.arg(QApplication::translate("MainWindow", "show about window"));
helpMessage += QString("%1 --netctl-auto - %2\n")
.arg(isParametrEnable(showNetctlAuto))
.arg(QApplication::translate("MainWindow", "show netctl-auto window"));
helpMessage += QString("%1 --settings - %2\n")
.arg(isParametrEnable(showSettings))
.arg(QApplication::translate("MainWindow", "show settings window"));
// main functions
helpMessage += QString("%1\n").arg(QApplication::translate("MainWindow", "Functions:"));
helpMessage += QString(" -e %1 --essid %1 - %2\n")
.arg(selectEssid, -10)
.arg(QApplication::translate("MainWindow", "select ESSID %1").arg(selectEssid));
helpMessage += QString(" -o %1 --open %1 - %2\n")
.arg(openProfile, -10)
.arg(QApplication::translate("MainWindow", "open profile %1").arg(openProfile));
helpMessage += QString(" -s %1 --select %1 - %2\n")
.arg(selectProfile, -10)
.arg(QApplication::translate("MainWindow", "select profile %1").arg(selectProfile));
// additional functions
helpMessage += QString("%1\n").arg(QApplication::translate("MainWindow", "Additional flags:"));
helpMessage += QString(" --config %1\n")
.arg(configPath, -10);
helpMessage += QString(" - %1\n")
.arg(QApplication::translate("MainWindow", "read configuration from this file"));
helpMessage += QString("%1 -d --debug - %2\n")
.arg(isParametrEnable(debug))
.arg(QApplication::translate("MainWindow", "print debug information"));
helpMessage += QString("%1 --default - %2\n")
.arg(isParametrEnable(defaultSettings))
.arg(QApplication::translate("MainWindow", "start with default settings"));
helpMessage += QString(" --set-opts %1\n")
.arg(options, -10);
helpMessage += QString(" - %1\n")
.arg(QApplication::translate("MainWindow", "set options for this run, comma separated"));
helpMessage += QString(" -t %1 --tab %1 - %2\n")
.arg(QString::number(tabNumber), -3)
.arg(QApplication::translate("MainWindow", "open a tab with number %1").arg(QString::number(tabNumber)));
// messages
helpMessage += QString("%1\n").arg(QApplication::translate("MainWindow", "Show messages:"));
helpMessage += QString(" -v --version - %1\n")
.arg(QApplication::translate("MainWindow", "show version and exit"));
helpMessage += QString(" -i --info - %1\n")
.arg(QApplication::translate("MainWindow", "show build information and exit"));
helpMessage += QString(" -h --help - %1\n")
.arg(QApplication::translate("MainWindow", "show this help and exit"));
QString infoMessage = QString("");
infoMessage += QApplication::translate("MainWindow", "Build date: %1").
arg(QString(BUILD_DATE));
infoMessage += QString("\n%1\n").arg(QApplication::translate("MainWindow", "cmake flags:"));
infoMessage += QString("\t-DCMAKE_BUILD_TYPE=%1 \\\n").arg(QString(CMAKE_BUILD_TYPE));
infoMessage += QString("\t-DCMAKE_INSTALL_PREFIX=%1 \\\n").arg(QString(CMAKE_INSTALL_PREFIX));
infoMessage += QString("\t-DBUILD_DOCS=%1 \\\n").arg(QString(PROJECT_BUILD_DOCS));
infoMessage += QString("\t-DBUILD_LIBRARY=%1 \\\n").arg(QString(PROJECT_BUILD_LIBRARY));
infoMessage += QString("\t-DBUILD_GUI=%1 \\\n").arg(QString(PROJECT_BUILD_GUI));
infoMessage += QString("\t-DUSE_QT5=%1 \\\n").arg(QString(PROJECT_USE_QT5));
infoMessage += QString("\t-DBUILD_DATAENGINE=%1 \\\n").arg(QString(PROJECT_BUILD_DATAENGINE));
infoMessage += QString("\t-DBUILD_PLASMOID=%1\n").arg(QString(PROJECT_BUILD_PLASMOID));
QString versionMessage = QString("");
versionMessage += QString("%1\n").arg(QString(NAME));
versionMessage += QString("%1 : %2\n")
.arg(QApplication::translate("MainWindow", "Version"))
.arg(QString(VERSION));
versionMessage += QString("%1 : %2\n")
.arg(QApplication::translate("MainWindow", "Author"))
.arg(QString(AUTHOR));
versionMessage += QString("%1 : %2\n")
.arg(QApplication::translate("MainWindow", "License"))
.arg(QString(LICENSE));
// reread translations
a.removeTranslator(&translator);
language = Language::defineLanguage(configPath, options);
translator.load(QString(":/translations/") + language);
a.installTranslator(&translator);
// running
if (error) {
cout << errorMessage.toUtf8().data() << endl;
cout << helpMessage.toUtf8().data();
return 127;
}
if (showInfo) {
cout << versionMessage.toUtf8().data() << endl;
cout << infoMessage.toUtf8().data();
return 0;
}
if (showHelp) {
cout << helpMessage.toUtf8().data();
return 0;
}
if (showVersion) {
cout << versionMessage.toUtf8().data();
return 0;
}
MainWindow w(0,
showAbout, showNetctlAuto, showSettings,
selectEssid, openProfile, selectProfile,
configPath, debug, defaultSettings, options, tabNumber);
w.show();
return a.exec();
}

File diff suppressed because it is too large Load Diff

View File

@ -23,13 +23,16 @@
#include <QTableWidgetItem>
class AboutWindow;
class BridgeWidget;
class ErrorWindow;
class EthernetWidget;
class GeneralWidget;
class IpWidget;
class MacvlanWidget;
class MobileWidget;
class Netctl;
class NetctlAutoWindow;
class NetctlProfile;
class PasswdWidget;
class PppoeWidget;
@ -50,34 +53,52 @@ class MainWindow : public QMainWindow
public:
explicit MainWindow(QWidget *parent = 0,
const bool showAbout = false,
const bool showNetctlAuto = false,
const bool showSettings = false,
const QString selectEssid = QString("ESSID"),
const QString openProfile = QString("PROFILE"),
const QString selectProfile = QString("PROFILE"),
const QString configPath = QString(""),
const bool debugCmd = false,
const bool defaultSettings = false,
const QString options = QString("OPTIONS"),
const int tabNum = 1);
~MainWindow();
Netctl *netctlCommand;
NetctlProfile *netctlProfile;
WpaSup *wpaCommand;
public slots:
void updateTabs(const int tab);
void updateMenu(const int tab);
// wifi tab slots
void connectToUnknownEssid(const QString passwd);
void setHiddenName(const QString name);
private slots:
// menu update slots
void setMenuActionsShown(const bool state = true);
void updateMenuMain();
void updateMenuProfile();
void updateMenuWifi();
// tab update slots
void updateMainTab();
void updateProfileTab();
void updateWifiTab();
// main tab slots
void mainTabContextualMenu(const QPoint &pos);
void mainTabEditProfile();
void mainTabRemoveProfile();
void mainTabEnableProfile();
void mainTabRestartProfile();
void mainTabStartProfile();
void mainTabRefreshButtons(QTableWidgetItem *current, QTableWidgetItem *previous);
// profile tab slots
void profileTabBrowseProfile();
void profileTabChangeState(const QString current);
void profileTabClear();
void profileTabCreateProfile();
void profileTabLoadProfile();
void profileTabRemoveProfile();
// wifi tab slots
void wifiTabContextualMenu(const QPoint &pos);
void wifiTabSetEnabled(const bool state);
void wifiTabStart();
void wifiTabRefreshButtons(QTableWidgetItem *current, QTableWidgetItem *previous);
@ -85,10 +106,16 @@ private slots:
private:
// ui
Ui::MainWindow *ui;
AboutWindow *aboutWin;
ErrorWindow *errorWin;
NetctlAutoWindow *netctlAutoWin;
PasswdWidget *passwdWid;
SettingsWindow *settingsWin;
BridgeWidget *bridgeWid;
EthernetWidget *ethernetWid;
GeneralWidget *generalWid;
IpWidget *ipWid;
MacvlanWidget *macvlanWid;
MobileWidget *mobileWid;
PppoeWidget *pppoeWid;
TunnelWidget *tunnelWid;
@ -96,14 +123,19 @@ private:
VlanWidget *vlanWid;
WirelessWidget *wirelessWid;
// backend
ErrorWindow *errorWin;
PasswdWidget *passwdWid;
SettingsWindow *settingsWin;
Netctl *netctlCommand;
NetctlProfile *netctlProfile;
WpaSup *wpaCommand;
bool checkExternalApps(const QString apps);
bool checkState(const QString state, const QString item);
void createActions();
void keyPressEvent(QKeyEvent *pressedKey);
void setIconsToButtons();
bool debug;
bool hiddenNetwork;
// configuration
QMap<QString, QString> configuration;
QMap<QString, QString> parseOptions(const QString options);
};

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>491</width>
<height>519</height>
<width>479</width>
<height>507</height>
</rect>
</property>
<property name="windowTitle">
@ -25,8 +25,37 @@
<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">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
@ -99,19 +128,6 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_mainEnable">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Enable</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_mainRestart">
<property name="enabled">
@ -169,12 +185,12 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_profile"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_profile">
<property name="text">
<string>Browse</string>
<widget class="QComboBox" name="comboBox_profile">
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
@ -190,8 +206,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>98</width>
<height>28</height>
<width>96</width>
<height>26</height>
</rect>
</property>
<property name="sizePolicy">
@ -213,13 +229,6 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_profileLoad">
<property name="text">
<string>Load</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer_newProfileButtons">
<property name="orientation">
@ -261,6 +270,9 @@
</item>
<item>
<widget class="QTableWidget" name="tableWidget_wifi">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
@ -355,21 +367,54 @@
<rect>
<x>0</x>
<y>0</y>
<width>491</width>
<height>20</height>
<width>479</width>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuMenu">
<property name="title">
<string>Menu</string>
</property>
<addaction name="actionNetctlAuto"/>
<addaction name="actionSettings"/>
<addaction name="actionQuit"/>
</widget>
<widget class="QMenu" name="menuActions">
<property name="title">
<string>Actions</string>
</property>
<addaction name="actionMainRefresh"/>
<addaction name="actionWifiRefresh"/>
<addaction name="actionProfileClear"/>
<addaction name="separator"/>
<addaction name="actionMainStart"/>
<addaction name="actionMainRestart"/>
<addaction name="actionMainEnable"/>
<addaction name="actionProfileLoad"/>
<addaction name="actionProfileSave"/>
<addaction name="actionWifiStart"/>
<addaction name="separator"/>
<addaction name="actionMainEdit"/>
<addaction name="actionMainRemove"/>
<addaction name="actionProfileRemove"/>
</widget>
<widget class="QMenu" name="menuHelp">
<property name="title">
<string>Help</string>
</property>
<addaction name="actionAbout"/>
</widget>
<addaction name="menuMenu"/>
<addaction name="menuActions"/>
<addaction name="menuHelp"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<action name="actionSettings">
<property name="icon">
<iconset theme="configure">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Settings</string>
</property>
@ -378,6 +423,11 @@
</property>
</action>
<action name="actionQuit">
<property name="icon">
<iconset theme="exit">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Quit</string>
</property>
@ -385,19 +435,148 @@
<string>Ctrl+Q</string>
</property>
</action>
<action name="actionMainRefresh">
<property name="icon">
<iconset theme="stock-refresh">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Refresh</string>
</property>
</action>
<action name="actionMainStart">
<property name="icon">
<iconset theme="dialog-apply">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Start profile</string>
</property>
</action>
<action name="actionMainRestart">
<property name="icon">
<iconset theme="stock-refresh">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Restart profile</string>
</property>
</action>
<action name="actionMainEnable">
<property name="icon">
<iconset theme="edit-add">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Enable profile</string>
</property>
</action>
<action name="actionMainEdit">
<property name="icon">
<iconset theme="edit">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Edit profile</string>
</property>
</action>
<action name="actionMainRemove">
<property name="icon">
<iconset theme="edit-delete">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Remove profile</string>
</property>
</action>
<action name="actionProfileClear">
<property name="icon">
<iconset theme="edit-clear">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Clear</string>
</property>
</action>
<action name="actionWifiRefresh">
<property name="icon">
<iconset theme="stock-refresh">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Refresh</string>
</property>
</action>
<action name="actionProfileLoad">
<property name="icon">
<iconset theme="document-open">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Load profile</string>
</property>
</action>
<action name="actionProfileSave">
<property name="icon">
<iconset theme="document-save">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Save profile</string>
</property>
</action>
<action name="actionWifiStart">
<property name="icon">
<iconset theme="dialog-apply">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Start Wi-Fi</string>
</property>
</action>
<action name="actionProfileRemove">
<property name="icon">
<iconset theme="edit-delete">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Remove profile</string>
</property>
</action>
<action name="actionNetctlAuto">
<property name="text">
<string>netctl-auto</string>
</property>
</action>
<action name="actionAbout">
<property name="icon">
<iconset theme="help-about"/>
</property>
<property name="text">
<string>About</string>
</property>
</action>
</widget>
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>tableWidget_main</tabstop>
<tabstop>pushButton_mainRefresh</tabstop>
<tabstop>pushButton_mainEnable</tabstop>
<tabstop>pushButton_mainRestart</tabstop>
<tabstop>pushButton_mainStart</tabstop>
<tabstop>lineEdit_profile</tabstop>
<tabstop>pushButton_profile</tabstop>
<tabstop>scrollArea</tabstop>
<tabstop>pushButton_profileClear</tabstop>
<tabstop>pushButton_profileLoad</tabstop>
<tabstop>pushButton_profileSave</tabstop>
<tabstop>tableWidget_wifi</tabstop>
<tabstop>pushButton_wifiRefresh</tabstop>

View File

@ -143,28 +143,29 @@ int MobileWidget::isOk()
void MobileWidget::setSettings(const QMap<QString, QString> settings)
{
clear();
QMap<QString, QString> mobileSettings = settings;
if (mobileSettings.contains(QString("User")))
ui->lineEdit_username->setText(mobileSettings[QString("User")].remove(QString("'")));
ui->lineEdit_username->setText(mobileSettings[QString("User")]);
if (mobileSettings.contains(QString("Password")))
ui->lineEdit_password->setText(mobileSettings[QString("Password")].remove(QString("'")));
ui->lineEdit_password->setText(mobileSettings[QString("Password")]);
if (mobileSettings.contains(QString("AccessPointName")))
ui->lineEdit_apn->setText(mobileSettings[QString("AccessPointName")].remove(QString("'")));
ui->lineEdit_apn->setText(mobileSettings[QString("AccessPointName")]);
if (mobileSettings.contains(QString("PIN")))
ui->lineEdit_pin->setText(mobileSettings[QString("PIN")].remove(QString("'")));
ui->lineEdit_pin->setText(mobileSettings[QString("PIN")]);
if (mobileSettings.contains(QString("Mode")))
for (int i=0; i<ui->comboBox_mode->count(); i++)
if (mobileSettings[QString("Mode")].remove(QString("'")) == ui->comboBox_mode->itemText(i))
if (mobileSettings[QString("Mode")] == ui->comboBox_mode->itemText(i))
ui->comboBox_mode->setCurrentIndex(i);
if (mobileSettings.contains(QString("MaxFail")))
ui->spinBox_fail->setValue(mobileSettings[QString("MaxFail")].toInt());
if (mobileSettings.contains(QString("DefaultRoute")))
if (mobileSettings[QString("DefaultRoute")].remove(QString("'")) == QString("false"))
if (mobileSettings[QString("DefaultRoute")] == QString("false"))
ui->checkBox_route->setCheckState(Qt::Unchecked);
if (mobileSettings.contains(QString("UsePeerDNS")))
if (mobileSettings[QString("UsePeerDNS")].remove(QString("'")) == QString("false"))
if (mobileSettings[QString("UsePeerDNS")] == QString("false"))
ui->checkBox_dns->setCheckState(Qt::Unchecked);
if (mobileSettings.contains(QString("OptionsFile")))
ui->lineEdit_options->setText(mobileSettings[QString("OptionsFile")].remove(QString("'")));
ui->lineEdit_options->setText(mobileSettings[QString("OptionsFile")]);
}

View File

@ -0,0 +1,377 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "netctlautowindow.h"
#include "ui_netctlautowindow.h"
#include <QDebug>
#include <netctlgui/netctlinteract.h>
NetctlAutoWindow::NetctlAutoWindow(QWidget *parent, const bool debugCmd, const QMap<QString, QString> settings)
: QMainWindow(parent),
ui(new Ui::NetctlAutoWindow),
debug(debugCmd)
{
ui->setupUi(this);
netctlCommand = new Netctl(debug, settings);
createActions();
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Ready"));
}
NetctlAutoWindow::~NetctlAutoWindow()
{
if (debug) qDebug() << "[NetctlAutoWindow]" << "[~NetctlAutoWindow]";
delete ui;
delete netctlCommand;
}
void NetctlAutoWindow::createActions()
{
if (debug) qDebug() << "[NetctlAutoWindow]" << "[createActions]";
// menu actions
connect(ui->actionClose, SIGNAL(triggered(bool)), this, SLOT(close()));
connect(ui->actionDisableAll, SIGNAL(triggered(bool)), this, SLOT(netctlAutoDisableAllProfiles()));
connect(ui->actionEnable, SIGNAL(triggered(bool)), this, SLOT(netctlAutoEnableProfile()));
connect(ui->actionEnableAll, SIGNAL(triggered(bool)), this, SLOT(netctlAutoEnableAllProfiles()));\
connect(ui->actionRefresh, SIGNAL(triggered(bool)), this, SLOT(netctlAutoUpdateTable()));
connect(ui->actionSwitch, SIGNAL(triggered(bool)), this, SLOT(netctlAutoStartProfile()));
// service
connect(ui->actionEnableService, SIGNAL(triggered(bool)), this, SLOT(netctlAutoEnableService()));
connect(ui->actionRestartService, SIGNAL(triggered(bool)), this, SLOT(netctlAutoRestartService()));
connect(ui->actionStartService, SIGNAL(triggered(bool)), this, SLOT(netctlAutoStartService()));
// table actions
connect(ui->tableWidget, SIGNAL(itemActivated(QTableWidgetItem *)), this, SLOT(netctlAutoStartProfile()));
connect(ui->tableWidget, SIGNAL(currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)), this, SLOT(netctlAutoRefreshButtons(QTableWidgetItem *, QTableWidgetItem *)));
connect(ui->tableWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(netctlAutoContextualMenu(QPoint)));
// buttons
connect(ui->pushButton_enable, SIGNAL(clicked(bool)), this, SLOT(netctlAutoEnableProfile()));
connect(ui->pushButton_refresh, SIGNAL(clicked(bool)), this, SLOT(netctlAutoUpdateTable()));
connect(ui->pushButton_switch, SIGNAL(clicked(bool)), this, SLOT(netctlAutoStartProfile()));
}
void NetctlAutoWindow::showWindow()
{
if (debug) qDebug() << "[NetctlAutoWindow]" << "[showWindow]";
netctlAutoUpdateTable();
show();
}
void NetctlAutoWindow::netctlAutoUpdateTable()
{
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoUpdateTable]";
ui->tableWidget->setDisabled(true);
QList<QStringList> profiles = netctlCommand->getProfileListFromNetctlAuto();
// actions
if (netctlCommand->isNetctlAutoEnabled())
ui->actionEnableService->setText(QApplication::translate("NetctlAutoWindow", "Disable service"));
else
ui->actionEnableService->setText(QApplication::translate("NetctlAutoWindow", "Enable service"));
ui->actionEnableService->setVisible(true);
if (netctlCommand->isNetctlAutoRunning()) {
ui->label_info->setText(QApplication::translate("NetctlAutoWindow", "netctl-auto is running"));
ui->actionStartService->setText(QApplication::translate("NetctlAutoWindow", "Stop service"));
ui->actionRestartService->setVisible(true);
}
else {
ui->actionStartService->setText(QApplication::translate("NetctlAutoWindow", "Start service"));
ui->actionRestartService->setVisible(false);
ui->label_info->setText(QApplication::translate("NetctlAutoWindow", "netctl-auto is not running"));
netctlAutoRefreshButtons(0, 0);
return;
}
ui->tableWidget->setSortingEnabled(false);
ui->tableWidget->selectRow(-1);
ui->tableWidget->sortByColumn(0, Qt::AscendingOrder);
ui->tableWidget->clear();
ui->tableWidget->setRowCount(profiles.count());
// create header
QStringList headerList;
headerList.append(QApplication::translate("NetctlAutoWindow", "Name"));
headerList.append(QApplication::translate("NetctlAutoWindow", "Description"));
headerList.append(QApplication::translate("NetctlAutoWindow", "Active"));
headerList.append(QApplication::translate("NetctlAutoWindow", "Disabled"));
ui->tableWidget->setHorizontalHeaderLabels(headerList);
// create items
for (int i=0; i<profiles.count(); i++) {
// name
ui->tableWidget->setItem(i, 0, new QTableWidgetItem(profiles[i][0]));
ui->tableWidget->item(i, 0)->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter);
if (profiles[i][2] == QString("*")) {
QFont font;
font.setBold(true);
ui->tableWidget->item(i, 0)->setFont(font);
}
else if (profiles[i][2] == QString("!")) {
QFont font;
font.setItalic(true);
ui->tableWidget->item(i, 0)->setFont(font);
}
// description
ui->tableWidget->setItem(i, 1, new QTableWidgetItem(profiles[i][1]));
ui->tableWidget->item(i, 1)->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter);
if (profiles[i][2] == QString("*")) {
// active
ui->tableWidget->setItem(i, 2, new QTableWidgetItem(QApplication::translate("NetctlAutoWindow", "yes")));
ui->tableWidget->item(i, 2)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
}
else
ui->tableWidget->setItem(i, 2, new QTableWidgetItem(QString("")));
if (profiles[i][2] == QString("!")) {
// disabled
ui->tableWidget->setItem(i, 3, new QTableWidgetItem(QApplication::translate("NetctlAutoWindow", "yes")));
ui->tableWidget->item(i, 3)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
}
else
ui->tableWidget->setItem(i, 3, new QTableWidgetItem(QString("")));
}
ui->tableWidget->setSortingEnabled(true);
ui->tableWidget->resizeRowsToContents();
#if QT_VERSION >= 0x050000
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
#else
ui->tableWidget->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
#endif
ui->tableWidget->setEnabled(true);
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Updated"));
netctlAutoRefreshButtons(0, 0);
update();
}
void NetctlAutoWindow::netctlAutoContextualMenu(const QPoint &pos)
{
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoContextualMenu]";
if (ui->tableWidget->currentItem() == 0)
return;
// create menu
QMenu menu(this);
QAction *startProfile = menu.addAction(QApplication::translate("NetctlAutoWindow", "Switch to profile"));
startProfile->setIcon(QIcon::fromTheme("dialog-apply"));
QAction *enableProfile = menu.addAction(QApplication::translate("NetctlAutoWindow", "Enable profile"));
menu.addSeparator();
QAction *enableAllProfiles = menu.addAction(QApplication::translate("NetctlAutoWindow", "Enable all profiles"));
enableAllProfiles->setIcon(QIcon::fromTheme("edit-add"));
QAction *disableAllProfiles = menu.addAction(QApplication::translate("NetctlAutoWindow", "Disable all profiles"));
disableAllProfiles->setIcon(QIcon::fromTheme("edit-delete"));
// set text
if (ui->tableWidget->item(ui->tableWidget->currentItem()->row(), 2)->text() == QString("yes")) {
enableProfile->setVisible(false);
startProfile->setVisible(false);
}
else {
enableProfile->setVisible(true);
startProfile->setVisible(true);
if (ui->tableWidget->item(ui->tableWidget->currentItem()->row(), 3)->text() == QString("yes")) {
enableProfile->setText(QApplication::translate("NetctlAutoWindow", "Enable"));
enableProfile->setIcon(QIcon::fromTheme("edit-add"));
}
else {
enableProfile->setText(QApplication::translate("NetctlAutoWindow", "Disable"));
enableProfile->setIcon(QIcon::fromTheme("edit-delete"));
}
}
// actions
QAction *action = menu.exec(ui->tableWidget->viewport()->mapToGlobal(pos));
if (action == startProfile) {
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoContextualMenu]" << "Switch to profile";
netctlAutoStartProfile();
}
else if (action == enableProfile) {
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoContextualMenu]" << "Enable profile";
netctlAutoEnableProfile();
}
else if (action == enableAllProfiles) {
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoContextualMenu]" << "Enable all profiles";
netctlAutoEnableAllProfiles();
}
else if (action == disableAllProfiles) {
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoContextualMenu]" << "Disable all profiles";
netctlAutoDisableAllProfiles();
}
}
void NetctlAutoWindow::netctlAutoDisableAllProfiles()
{
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoDisableAllProfiles]";
ui->tableWidget->setDisabled(true);
if (netctlCommand->autoDisableAllProfiles())
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
else
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
netctlAutoUpdateTable();
}
void NetctlAutoWindow::netctlAutoEnableProfile()
{
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoEnableProfile]";
if (ui->tableWidget->currentItem() == 0)
return;
ui->tableWidget->setDisabled(true);
QString profile = ui->tableWidget->item(ui->tableWidget->currentItem()->row(), 0)->text();
if (netctlCommand->autoEnableProfile(profile))
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
else
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
netctlAutoUpdateTable();
}
void NetctlAutoWindow::netctlAutoEnableAllProfiles()
{
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoEnableAllProfiles]";
ui->tableWidget->setDisabled(true);
if (netctlCommand->autoEnableAllProfiles())
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
else
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
netctlAutoUpdateTable();
}
void NetctlAutoWindow::netctlAutoStartProfile()
{
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoStartProfile]";
if (ui->tableWidget->currentItem() == 0)
return;
ui->tableWidget->setDisabled(true);
QString profile = ui->tableWidget->item(ui->tableWidget->currentItem()->row(), 0)->text();
if (netctlCommand->autoStartProfile(profile))
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
else
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
netctlAutoUpdateTable();
}
void NetctlAutoWindow::netctlAutoEnableService()
{
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoEnableService]";
if (netctlCommand->autoEnableService())
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
else
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
netctlAutoUpdateTable();
}
void NetctlAutoWindow::netctlAutoRestartService()
{
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoRestartService]";
if (netctlCommand->autoRestartService())
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
else
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
netctlAutoUpdateTable();
}
void NetctlAutoWindow::netctlAutoStartService()
{
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoStartService]";
if (netctlCommand->autoStartService())
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
else
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
netctlAutoUpdateTable();
}
void NetctlAutoWindow::netctlAutoRefreshButtons(QTableWidgetItem *current, QTableWidgetItem *previous)
{
Q_UNUSED(previous);
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoRefreshButtons]";
if (current == 0) {
// buttons
ui->pushButton_enable->setDisabled(true);
ui->pushButton_switch->setDisabled(true);
// menu
ui->actionEnable->setVisible(false);
ui->actionSwitch->setVisible(false);
return;
}
if (ui->tableWidget->item(current->row(), 2)->text() == QString("yes")) {
// buttons
ui->pushButton_enable->setDisabled(true);
ui->pushButton_switch->setDisabled(true);
// menu
ui->actionEnable->setVisible(false);
ui->actionSwitch->setVisible(false);
}
else {
// buttons
ui->pushButton_enable->setEnabled(true);
ui->pushButton_switch->setEnabled(true);
// menu
ui->actionEnable->setVisible(true);
ui->actionSwitch->setVisible(true);
if (ui->tableWidget->item(current->row(), 3)->text() == QString("yes")) {
// buttons
ui->pushButton_enable->setText(QApplication::translate("NetctlAutoWindow", "Enable"));
ui->pushButton_enable->setIcon(QIcon::fromTheme("edit-add"));
// menu
ui->actionEnable->setText(QApplication::translate("NetctlAutoWindow", "Enable profile"));
ui->actionEnable->setIcon(QIcon::fromTheme("edit-add"));
}
else {
// buttons
ui->pushButton_enable->setText(QApplication::translate("NetctlAutoWindow", "Disable"));
ui->pushButton_enable->setIcon(QIcon::fromTheme("edit-delete"));
// menu
ui->actionEnable->setText(QApplication::translate("NetctlAutoWindow", "Disable profile"));
ui->actionEnable->setIcon(QIcon::fromTheme("edit-delete"));
}
}
}

View File

@ -15,47 +15,54 @@
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef NETCTLINTERACT_H
#define NETCTLINTERACT_H
#ifndef NETCTLAUTOWINDOW_H
#define NETCTLAUTOWINDOW_H
#include <QDir>
#include <QMap>
#include <QObject>
#include <QKeyEvent>
#include <QMainWindow>
#include <QTableWidgetItem>
class MainWindow;
class Netctl;
class Netctl : public QObject
namespace Ui {
class NetctlAutoWindow;
}
class NetctlAutoWindow : public QMainWindow
{
Q_OBJECT
public:
explicit Netctl(MainWindow *wid = 0,
const QMap<QString, QString> settings = QMap<QString, QString>());
~Netctl();
// general information
QList<QStringList> getProfileList();
QStringList getProfileDescriptions(const QStringList profileList);
QStringList getProfileStatuses(const QStringList profileList);
QString getSsidFromProfile(const QString profile);
bool isProfileActive(const QString profile);
bool isProfileEnabled(const QString profile);
explicit NetctlAutoWindow(QWidget *parent = 0,
const bool debugCmd = false,
const QMap<QString, QString> settings = QMap<QString, QString>());
~NetctlAutoWindow();
public slots:
// functions
bool enableProfile(const QString profile);
bool restartProfile(const QString profile);
bool startProfile(const QString profile);
void showWindow();
private slots:
// table
void netctlAutoContextualMenu(const QPoint &pos);
void netctlAutoUpdateTable();
// netctl-auto
void netctlAutoDisableAllProfiles();
void netctlAutoEnableProfile();
void netctlAutoEnableAllProfiles();
void netctlAutoStartProfile();
void netctlAutoRefreshButtons(QTableWidgetItem *current, QTableWidgetItem *previous);
// service
void netctlAutoEnableService();
void netctlAutoRestartService();
void netctlAutoStartService();
private:
MainWindow *parent;
QString netctlCommand;
QDir *profileDirectory;
QString sudoCommand;
// functions
QString getNetctlOutput(const bool sudo, const QString commandLine, const QString profile);
bool netctlCall(const bool sudo, const QString commandLine, const QString profile);
Netctl *netctlCommand;
Ui::NetctlAutoWindow *ui;
bool debug;
void createActions();
};
#endif /* NETCTLINTERACT_H */
#endif /* NETCTLAUTOWINDOW_H */

View File

@ -0,0 +1,240 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>NetctlAutoWindow</class>
<widget class="QMainWindow" name="NetctlAutoWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>432</width>
<height>343</height>
</rect>
</property>
<property name="windowTitle">
<string>netctl-auto</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_info">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QTableWidget" name="tableWidget">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<column>
<property name="text">
<string>Description</string>
</property>
</column>
<column>
<property name="text">
<string>Active</string>
</property>
</column>
<column>
<property name="text">
<string>Disabled</string>
</property>
</column>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="layout_buttons">
<item>
<widget class="QPushButton" name="pushButton_refresh">
<property name="text">
<string>Refresh</string>
</property>
<property name="icon">
<iconset theme="stock-refresh">
<normaloff/>
</iconset>
</property>
</widget>
</item>
<item>
<spacer name="spacer_buttons">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_enable">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Enable</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_switch">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Switch</string>
</property>
<property name="icon">
<iconset theme="dialog-apply">
<normaloff/>
</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>432</width>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuMenu">
<property name="title">
<string>Menu</string>
</property>
<addaction name="actionRefresh"/>
<addaction name="separator"/>
<addaction name="actionSwitch"/>
<addaction name="actionEnable"/>
<addaction name="separator"/>
<addaction name="actionEnableAll"/>
<addaction name="actionDisableAll"/>
<addaction name="separator"/>
<addaction name="actionStartService"/>
<addaction name="actionRestartService"/>
<addaction name="actionEnableService"/>
<addaction name="separator"/>
<addaction name="actionClose"/>
</widget>
<addaction name="menuMenu"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<action name="actionEnable">
<property name="icon">
<iconset theme="edit-add">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Enable profile</string>
</property>
</action>
<action name="actionSwitch">
<property name="icon">
<iconset theme="dialog-apply">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Switch to profile</string>
</property>
</action>
<action name="actionClose">
<property name="icon">
<iconset theme="exit">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Close</string>
</property>
<property name="shortcut">
<string>Esc</string>
</property>
</action>
<action name="actionEnableAll">
<property name="icon">
<iconset theme="edit-add">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Enable all profiles</string>
</property>
</action>
<action name="actionDisableAll">
<property name="icon">
<iconset theme="edit-delete">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Disable all profiles</string>
</property>
</action>
<action name="actionStartService">
<property name="text">
<string>Start service</string>
</property>
</action>
<action name="actionRestartService">
<property name="text">
<string>Restart service</string>
</property>
</action>
<action name="actionEnableService">
<property name="text">
<string>Enable service</string>
</property>
</action>
<action name="actionRefresh">
<property name="icon">
<iconset theme="stock-refresh">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Refresh</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,228 +0,0 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "netctlinteract.h"
#include <QDebug>
#include <QFile>
#include <QProcess>
#include "mainwindow.h"
Netctl::Netctl(MainWindow *wid, const QMap<QString, QString> settings)
: parent(wid)
{
netctlCommand = settings[QString("NETCTL_PATH")];
profileDirectory = new QDir(settings[QString("PROFILE_DIR")]);
sudoCommand = settings[QString("SUDO_PATH")];
}
Netctl::~Netctl()
{
delete profileDirectory;
}
// functions
QString Netctl::getNetctlOutput(const bool sudo, const QString commandLine, const QString profile)
{
QProcess command;
QString commandText;
if (sudo)
commandText = sudoCommand + QString(" ") + netctlCommand + QString(" ") + commandLine +
QString(" ") + profile;
else
commandText = netctlCommand + QString(" ") + commandLine + QString(" ") + profile;
qDebug() << "[Netctl]" << "[getNetctlOutput]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
return command.readAllStandardOutput();
}
bool Netctl::netctlCall(const bool sudo, const QString commandLine, const QString profile)
{
QProcess command;
QString commandText;
if (sudo)
commandText = sudoCommand + QString(" ") + netctlCommand + QString(" ") + commandLine +
QString(" ") + profile;
else
commandText = netctlCommand + QString(" ") + commandLine + QString(" ") + profile;
qDebug() << "[Netctl]" << "[netctlCall]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
qDebug() << "[Netctl]" << "[netctlCall]" << ":" << "Cmd returns" << command.exitCode();
if (command.exitCode() == 0)
return true;
else
return false;
}
// general information
QList<QStringList> Netctl::getProfileList()
{
QList<QStringList> fullProfilesInfo;
QStringList profiles = profileDirectory->entryList(QDir::Files);
QStringList descriptions = getProfileDescriptions(profiles);
QStringList statuses = getProfileStatuses(profiles);
for (int i=0; i<profiles.count(); i++) {
QStringList profileInfo;
profileInfo.append(profiles[i]);
profileInfo.append(descriptions[i]);
profileInfo.append(statuses[i]);
fullProfilesInfo.append(profileInfo);
}
return fullProfilesInfo;
}
QStringList Netctl::getProfileDescriptions(const QStringList profileList)
{
QStringList descriptions;
for (int i=0; i<profileList.count(); i++) {
QString profileUrl = profileDirectory->absolutePath() + QDir::separator() + profileList[i];
qDebug() << "[Netctl]" << "[getProfileDescriptions]" << ":" << "Check" << profileUrl;
QFile profile(profileUrl);
QString fileStr;
if (profile.open(QIODevice::ReadOnly))
while (true) {
fileStr = QString(profile.readLine());
if (fileStr[0] != '#')
if (fileStr.split(QString("="), QString::SkipEmptyParts).count() == 2)
if (fileStr.split(QString("="), QString::SkipEmptyParts)[0] == QString("Description"))
descriptions.append(fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed());
if (profile.atEnd())
break;
}
else
descriptions.append(QString("<unknown>"));
}
for (int i=0; i<profileList.count(); i++) {
descriptions[i].remove(QChar('\''));
descriptions[i].remove(QChar('"'));
}
return descriptions;
}
QStringList Netctl::getProfileStatuses(const QStringList profileList)
{
QStringList statuses;
for (int i=0; i<profileList.count(); i++) {
QString status;
if (isProfileActive(profileList[i]))
status = QString("active");
else
status = QString("inactive");
if (isProfileEnabled(profileList[i]))
status = status + QString(" (enabled)");
else
status = status + QString(" (static)");
statuses.append(status);
}
return statuses;
}
QString Netctl::getSsidFromProfile(const QString profile)
{
QString ssidName = QString("");
QString profileUrl = profileDirectory->absolutePath() + QDir::separator() + profile;
qDebug() << "[Netctl]" << "[getSsidFromProfile]" << ":" << "Check" << profileUrl;
QFile profileFile(profileUrl);
QString fileStr;
if (!profileFile.open(QIODevice::ReadOnly))
return ssidName;
while (true) {
fileStr = QString(profileFile.readLine());
if (fileStr[0] != '#') {
if (fileStr.split(QString("="), QString::SkipEmptyParts).count() == 2)
if (fileStr.split(QString("="), QString::SkipEmptyParts)[0] == QString("ESSID"))
ssidName = fileStr.split(QString("="), QString::SkipEmptyParts)[1].trimmed();
}
if (profileFile.atEnd())
break;
}
profileFile.close();
ssidName.remove(QChar('\''));
ssidName.remove(QChar('"'));
return ssidName;
}
bool Netctl::isProfileActive(const QString profile)
{
bool status = false;
QString cmdOutput = getNetctlOutput(false, QString("status"), profile);
if (!cmdOutput.isEmpty())
if (cmdOutput.contains(QString("Active: active")))
status = true;
return status;
}
bool Netctl::isProfileEnabled(const QString profile)
{
bool status = false;
QString cmdOutput = getNetctlOutput(false, QString("status"), profile);
if (!cmdOutput.isEmpty()) {
QStringList profileStatus = cmdOutput.split(QString("\n"), QString::SkipEmptyParts);
for (int i=0; i<profileStatus.count(); i++)
if (profileStatus[i].split(QString(" "), QString::SkipEmptyParts)[0] == QString("Loaded:"))
if (profileStatus[i].contains(QString("enabled")))
status = true;
}
return status;
}
// functions
bool Netctl::enableProfile(const QString profile)
{
if (isProfileEnabled(profile))
return netctlCall(true, QString("disable"), profile);
else
return netctlCall(true, QString("enable"), profile);
}
bool Netctl::restartProfile(const QString profile)
{
return netctlCall(true, QString("restart"), profile);
}
bool Netctl::startProfile(const QString profile)
{
if (isProfileActive(profile))
return netctlCall(true, QString("stop"), profile);
else
return netctlCall(true, QString("start"), profile);
}

View File

@ -1,156 +0,0 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "netctlprofile.h"
#include <QDebug>
#include <QFile>
#include <QFileInfo>
#include <QProcess>
#include <QTextStream>
#include "mainwindow.h"
NetctlProfile::NetctlProfile(MainWindow *wid, const QMap<QString, QString> settings)
: parent(wid)
{
profileDirectory = new QDir(settings[QString("PROFILE_DIR")]);
sudoCommand = settings[QString("SUDO_PATH")];
}
NetctlProfile::~NetctlProfile()
{
delete profileDirectory;
}
bool NetctlProfile::copyProfile(const QString oldPath)
{
QString newPath = profileDirectory->absolutePath() + QDir::separator() + QFileInfo(oldPath).fileName();
QProcess command;
QString commandText = sudoCommand + QString(" /usr/bin/mv ") + oldPath + QString(" ") + newPath;
qDebug() << "[NetctlProfile]" << "[copyProfile]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
if (command.exitCode() == 0)
return true;
else
return false;
}
QString NetctlProfile::createProfile(const QString profile, const QMap<QString, QString> settings)
{
QString profileTempName = QDir::homePath() + QDir::separator() +
QString(".cache") + QDir::separator() + QFileInfo(profile).fileName();
QFile profileFile(profileTempName);
qDebug() << "[NetctlProfile]" << "[createProfile]" << ":" << "Save to" << profileTempName;
if (!profileFile.open(QIODevice::WriteOnly | QIODevice::Text))
return profileTempName;
QTextStream out(&profileFile);
for (int i=0; i<settings.keys().count(); i++) {
out << settings.keys()[i] << QString("=");
if ((settings.keys()[i] == QString("BindsToInterfaces")) ||
(settings.keys()[i] == QString("After")) ||
(settings.keys()[i] == QString("Address")) ||
(settings.keys()[i] == QString("Routes")) ||
(settings.keys()[i] == QString("Address6")) ||
(settings.keys()[i] == QString("Routes6")) ||
(settings.keys()[i] == QString("IPCustom")) ||
(settings.keys()[i] == QString("DNS")) ||
(settings.keys()[i] == QString("DNSOptions")) ||
(settings.keys()[i] == QString("WPAConfigSection")) ||
(settings.keys()[i] == QString("WPAConfigSection")))
out << QString("(") + settings[settings.keys()[i]] << QString(")\n");
else
out << settings[settings.keys()[i]] << QString("\n");
}
profileFile.close();
return profileTempName;
}
QMap<QString, QString> NetctlProfile::getSettingsFromProfile(const QString profile)
{
QMap<QString, QString> settings;
QString fileStr, profileUrl;
if (profile[0] == QDir::separator())
profileUrl = profile;
else
profileUrl = profileDirectory->absolutePath() + QDir::separator() + profile;
QFile profileFile(profileUrl);
qDebug() << "[NetctlProfile]" << "[getSettingsFromProfile]" << ":" << "Read from" << profileUrl;
if (!profileFile.open(QIODevice::ReadOnly))
return settings;
while (true) {
fileStr = QString(profileFile.readLine());
if (fileStr[0] != '#') {
if (fileStr.split(QString("="), QString::SkipEmptyParts).count() == 2) {
if ((fileStr.split(QString("="))[1][0] == QChar('(')) &&
(fileStr.split(QString("="))[1][fileStr.split(QString("="))[1].size()-2] == QChar(')')))
settings[fileStr.split(QString("="))[0]] = fileStr.split(QString("="))[1]
.remove(QString("("))
.remove(QString(")"))
.trimmed();
else if (fileStr.split(QString("="))[1][0] == QChar('(')) {
QString parameterName = fileStr.split(QString("="))[0];
QStringList parameter;
if (!fileStr.split(QString("="))[1]
.remove(QString("("))
.remove(QString(")"))
.trimmed()
.isEmpty())
parameter.append(fileStr.split(QString("="))[1]
.remove(QString("("))
.remove(QString(")"))
.trimmed());
while(true) {
fileStr = QString(profileFile.readLine());
if (fileStr[fileStr.size()-2] == QChar(')'))
break;
if (!fileStr.remove(QString("("))
.remove(QString(")"))
.trimmed()
.isEmpty())
parameter.append(fileStr.remove(QString("("))
.remove(QString(")"))
.trimmed());
if (profileFile.atEnd())
break;
}
settings[parameterName] = parameter.join(QString("\n"));
}
else
settings[fileStr.split(QString("="))[0]] = fileStr.split(QString("="))[1]
.trimmed();
}
}
if (profileFile.atEnd())
break;
}
profileFile.close();
return settings;
}

View File

@ -18,6 +18,8 @@
#include "passwdwidget.h"
#include "ui_passwdwidget.h"
#include <QLineEdit>
#include "mainwindow.h"
@ -59,6 +61,19 @@ void PasswdWidget::setFocusToLineEdit()
}
void PasswdWidget::setPassword(const bool mode)
{
if (mode) {
ui->lineEdit->setEchoMode(QLineEdit::Password);
ui->label->setText(QApplication::translate("PasswdWidget", "Password"));
}
else {
ui->lineEdit->setEchoMode(QLineEdit::Normal);
ui->label->setText(QApplication::translate("PasswdWidget", "ESSID"));
}
}
void PasswdWidget::cancel()
{
hide();
@ -70,5 +85,8 @@ void PasswdWidget::cancel()
void PasswdWidget::passwdApply()
{
hide();
return parent->connectToUnknownEssid(ui->lineEdit->text());
if (ui->lineEdit->echoMode() == QLineEdit::Normal)
return parent->setHiddenName(ui->lineEdit->text());
else
return parent->connectToUnknownEssid(ui->lineEdit->text());
}

View File

@ -39,6 +39,7 @@ public:
public slots:
void setFocusToLineEdit();
void setPassword(const bool mode = true);
private slots:
void cancel();

View File

@ -157,9 +157,10 @@ QMap<QString, QString> PppoeWidget::getSettings()
pppoeSettings[QString("PPPoEService")] = QString("'") + ui->lineEdit_service->text() + QString("'");
if (!ui->lineEdit_ac->text().isEmpty())
pppoeSettings[QString("PPPoEAC")] = QString("'") + ui->lineEdit_ac->text() + QString("'");
if (!ui->lineEdit_session->text().split(QString(":")).join(QString("")).remove(QString(" ")).isEmpty())
pppoeSettings[QString("PPPoESession")] = QString("'") + ui->lineEdit_session->text().remove(QString(" ")) + QString("'");
if (!ui->lineEdit_mac->text().split(QString(":")).join(QString("")).remove(QString(" ")).isEmpty())
if (!ui->lineEdit_session->text().remove(QChar(':')).remove(QChar(' ')).isEmpty())
pppoeSettings[QString("PPPoESession")] = QString("'") + ui->lineEdit_session->text()
.remove(QChar('\'')).remove(QChar('"')) + QString("'");
if (!ui->lineEdit_mac->text().remove(QChar(':')).remove(QChar(' ')).isEmpty())
pppoeSettings[QString("PPPoEMAC")] = QString("'") + ui->lineEdit_mac->text() + QString("'");
if (ui->checkBox_ipv6->checkState() == Qt::Checked)
pppoeSettings[QString("PPPoEIP6")] = QString("yes");
@ -175,18 +176,18 @@ int PppoeWidget::isOk()
if (!QFile(ui->lineEdit_options->text()).exists())
return 1;
// mac address
if (!ui->lineEdit_mac->text().split(QString(":")).join(QString("")).remove(QString(" ")).isEmpty())
if (ui->lineEdit_mac->text().contains(QString(" ")))
if (!ui->lineEdit_mac->text().remove(QChar(':')).remove(QChar(' ')).isEmpty())
if (ui->lineEdit_mac->text().contains(QChar(' ')))
return 2;
// session id is not set
if (!ui->lineEdit_session->text().split(QString(":")).join(QString("")).remove(QString(" ")).isEmpty())
if (ui->lineEdit_session->text().split(QString(":"))[0].remove(QString(" ")).isEmpty())
if (!ui->lineEdit_session->text().remove(QChar(':')).remove(QChar(' ')).isEmpty())
if (ui->lineEdit_session->text().split(QChar(':'))[0].remove(QChar(' ')).isEmpty())
return 3;
// session mac address
if (!ui->lineEdit_session->text().split(QString(":")).join(QString("")).remove(QString(" ")).isEmpty()) {
QStringList item = ui->lineEdit_session->text().split(QString(":"));
if (!ui->lineEdit_session->text().remove(QChar(':')).remove(QChar(' ')).isEmpty()) {
QStringList item = ui->lineEdit_session->text().split(QChar(':'));
for (int i=1; i<7; i++)
if (item[i].contains(QString(" ")))
if (item[i].contains(QChar(' ')))
return 4;
}
// all fine
@ -196,25 +197,26 @@ int PppoeWidget::isOk()
void PppoeWidget::setSettings(const QMap<QString, QString> settings)
{
clear();
QMap<QString, QString> pppoeSettings = settings;
if (pppoeSettings.contains(QString("User")))
ui->lineEdit_username->setText(pppoeSettings[QString("User")].remove(QString("'")));
ui->lineEdit_username->setText(pppoeSettings[QString("User")]);
if (pppoeSettings.contains(QString("Password")))
ui->lineEdit_password->setText(pppoeSettings[QString("Password")].remove(QString("'")));
ui->lineEdit_password->setText(pppoeSettings[QString("Password")]);
if (pppoeSettings.contains(QString("ConnectionMode")))
for (int i=0; i<ui->comboBox_connection->count(); i++)
if (pppoeSettings[QString("ConnectionMode")].remove(QString("'")) == ui->comboBox_connection->itemText(i))
if (pppoeSettings[QString("ConnectionMode")] == ui->comboBox_connection->itemText(i))
ui->comboBox_connection->setCurrentIndex(i);
if (pppoeSettings.contains(QString("IdleTimeout")))
ui->spinBox_timeout->setValue(pppoeSettings[QString("IdleTimeout")].toInt());
if (pppoeSettings.contains(QString("MaxFail")))
ui->spinBox_fail->setValue(pppoeSettings[QString("MaxFail")].toInt());
if (pppoeSettings.contains(QString("DefaultRoute")))
if (pppoeSettings[QString("DefaultRoute")].remove(QString("'")) == QString("false"))
if (pppoeSettings[QString("DefaultRoute")] == QString("false"))
ui->checkBox_route->setCheckState(Qt::Unchecked);
if (pppoeSettings.contains(QString("UsePeerDNS")))
if (pppoeSettings[QString("UsePeerDNS")].remove(QString("'")) == QString("false"))
if (pppoeSettings[QString("UsePeerDNS")] == QString("false"))
ui->checkBox_dns->setCheckState(Qt::Unchecked);
if (pppoeSettings.contains(QString("PPPUnit")))
ui->lineEdit_unit->setText(pppoeSettings[QString("PPPUnit")]);
@ -223,15 +225,15 @@ void PppoeWidget::setSettings(const QMap<QString, QString> settings)
if (pppoeSettings.contains(QString("LCPEchoFailure")))
ui->spinBox_lcpFailure->setValue(pppoeSettings[QString("LCPEchoFailure")].toInt());
if (pppoeSettings.contains(QString("OptionsFile")))
ui->lineEdit_options->setText(pppoeSettings[QString("OptionsFile")].remove(QString("'")));
ui->lineEdit_options->setText(pppoeSettings[QString("OptionsFile")]);
if (pppoeSettings.contains(QString("PPPoEService")))
ui->lineEdit_service->setText(pppoeSettings[QString("PPPoEService")].remove(QString("'")));
ui->lineEdit_service->setText(pppoeSettings[QString("PPPoEService")]);
if (pppoeSettings.contains(QString("PPPoEAC")))
ui->lineEdit_ac->setText(pppoeSettings[QString("PPPoEAC")].remove(QString("'")));
ui->lineEdit_ac->setText(pppoeSettings[QString("PPPoEAC")]);
if (pppoeSettings.contains(QString("PPPoESession")))
ui->lineEdit_session->setText(pppoeSettings[QString("PPPoESession")].remove(QString("'")));
ui->lineEdit_session->setText(pppoeSettings[QString("PPPoESession")]);
if (pppoeSettings.contains(QString("PPPoEMAC")))
ui->lineEdit_mac->setText(pppoeSettings[QString("PPPoEMAC")].remove(QString("'")));
ui->lineEdit_mac->setText(pppoeSettings[QString("PPPoEMAC")]);
if (pppoeSettings.contains(QString("PPPoEIP6")))
if (pppoeSettings[QString("PPPoEIP6")] == QString("yes"))
ui->checkBox_dns->setCheckState(Qt::Checked);

View File

@ -23,12 +23,12 @@
#include <QFileDialog>
#include <QTextStream>
#include "mainwindow.h"
#include "language.h"
SettingsWindow::SettingsWindow(MainWindow *wid, const QString configFile)
: QMainWindow(wid),
parent(wid),
SettingsWindow::SettingsWindow(QWidget *parent, const bool debugCmd, const QString configFile)
: QMainWindow(parent),
debug(debugCmd),
file(configFile),
ui(new Ui::SettingsWindow)
{
@ -40,23 +40,32 @@ SettingsWindow::SettingsWindow(MainWindow *wid, const QString configFile)
SettingsWindow::~SettingsWindow()
{
if (debug) qDebug() << "[SettingsWindow]" << "[~SettingsWindow]";
delete ui;
}
void SettingsWindow::createActions()
{
connect(ui->comboBox_language, SIGNAL(currentIndexChanged(int)), ui->label_info, SLOT(show()));
if (debug) qDebug() << "[SettingsWindow]" << "[createActions]";
connect(ui->buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked(bool)), this, SLOT(close()));
connect(ui->buttonBox->button(QDialogButtonBox::Reset), SIGNAL(clicked(bool)), this, SLOT(setDefault()));
connect(ui->buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked(bool)), this, SLOT(saveSettings()));
connect(ui->buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked(bool)), this, SLOT(close()));
connect(ui->comboBox_language, SIGNAL(currentIndexChanged(int)), ui->label_info, SLOT(show()));
connect(ui->treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
this, SLOT(changePage(QTreeWidgetItem *, QTreeWidgetItem *)));
// buttons
connect(ui->pushButton_interfaceDir, SIGNAL(clicked(bool)), SLOT(selectIfaceDir()));
connect(ui->pushButton_netctlPath, SIGNAL(clicked(bool)), SLOT(selectNetctlPath()));
connect(ui->pushButton_netctlAutoPath, SIGNAL(clicked(bool)), SLOT(selectNetctlAutoPath()));
connect(ui->pushButton_profilePath, SIGNAL(clicked(bool)), SLOT(selectProfileDir()));
connect(ui->pushButton_rfkill, SIGNAL(clicked(bool)), SLOT(selectRfkillDir()));
connect(ui->pushButton_sudo, SIGNAL(clicked(bool)), SLOT(selectSudoPath()));
connect(ui->pushButton_systemctlPath, SIGNAL(clicked(bool)), SLOT(selectSystemctlPath()));
connect(ui->pushButton_wpaActiondPath, SIGNAL(clicked(bool)), SLOT(selectWpaActiondPath()));
connect(ui->pushButton_wpaCliPath, SIGNAL(clicked(bool)), SLOT(selectWpaCliPath()));
connect(ui->pushButton_wpaSupPath, SIGNAL(clicked(bool)), SLOT(selectWpaSupPath()));
}
@ -65,6 +74,8 @@ void SettingsWindow::createActions()
// ESC press event
void SettingsWindow::keyPressEvent(QKeyEvent *pressedKey)
{
if (debug) qDebug() << "[SettingsWindow]" << "[keyPressEvent]";
if (pressedKey->key() == Qt::Key_Escape)
close();
}
@ -72,27 +83,45 @@ void SettingsWindow::keyPressEvent(QKeyEvent *pressedKey)
void SettingsWindow::addLanguages()
{
ui->comboBox_language->addItem(QString("english"));
ui->comboBox_language->addItem(QString("russian"));
if (debug) qDebug() << "[SettingsWindow]" << "[addLanguages]";
ui->comboBox_language->clear();
ui->comboBox_language->addItems(Language::getAvailableLanguages());
}
void SettingsWindow::changePage(QTreeWidgetItem *current, QTreeWidgetItem *previous)
{
Q_UNUSED(previous)
if (debug) qDebug() << "[SettingsWindow]" << "[changePage]";
for (int i=0; i<ui->treeWidget->topLevelItemCount(); i++)
if (current == ui->treeWidget->topLevelItem(i)) {
ui->stackedWidget->setCurrentIndex(i);
break;
}
}
void SettingsWindow::saveSettings()
{
if (debug) qDebug() << "[SettingsWindow]" << "[saveSettings]";
QMap<QString, QString> settings = readSettings();
QFile configFile(file);
if (!configFile.open(QIODevice::WriteOnly | QIODevice::Text))
return;
QTextStream out(&configFile);
for (int i=0; i<settings.keys().count(); i++)
out << settings.keys()[i] << QString("=") << settings[settings.keys()[i]] << QString("\n");
out << settings.keys()[i] << QString("=") << settings[settings.keys()[i]] << endl;
configFile.close();
}
void SettingsWindow::setDefault()
{
if (debug) qDebug() << "[SettingsWindow]" << "[setDefault]";
setSettings(getDefault());
saveSettings();
}
@ -100,6 +129,8 @@ void SettingsWindow::setDefault()
void SettingsWindow::selectIfaceDir()
{
if (debug) qDebug() << "[SettingsWindow]" << "[selectIfaceDir]";
QString directory = QFileDialog::getExistingDirectory(
this,
QApplication::translate("SettingsWindow", "Select path to directory with interfaces"),
@ -111,6 +142,8 @@ void SettingsWindow::selectIfaceDir()
void SettingsWindow::selectNetctlPath()
{
if (debug) qDebug() << "[SettingsWindow]" << "[selectNetctlPath]";
QString filename = QFileDialog::getOpenFileName(
this,
QApplication::translate("SettingsWindow", "Select netctl command"),
@ -121,8 +154,24 @@ void SettingsWindow::selectNetctlPath()
}
void SettingsWindow::selectNetctlAutoPath()
{
if (debug) qDebug() << "[SettingsWindow]" << "[selectNetctlAutoPath]";
QString filename = QFileDialog::getOpenFileName(
this,
QApplication::translate("SettingsWindow", "Select netctl-auto command"),
QString("/usr/bin/"),
QApplication::translate("SettingsWindow", "All files (*)"));
if (!filename.isEmpty())
ui->lineEdit_netctlAutoPath->setText(filename);
}
void SettingsWindow::selectProfileDir()
{
if (debug) qDebug() << "[SettingsWindow]" << "[selectProfileDir]";
QString directory = QFileDialog::getExistingDirectory(
this,
QApplication::translate("SettingsWindow", "Select path to profile directory"),
@ -134,6 +183,8 @@ void SettingsWindow::selectProfileDir()
void SettingsWindow::selectRfkillDir()
{
if (debug) qDebug() << "[SettingsWindow]" << "[selectRfkillDir]";
QString directory = QFileDialog::getExistingDirectory(
this,
QApplication::translate("SettingsWindow", "Select path to directory with rfkill devices"),
@ -145,6 +196,8 @@ void SettingsWindow::selectRfkillDir()
void SettingsWindow::selectSudoPath()
{
if (debug) qDebug() << "[SettingsWindow]" << "[selectSudoPath]";
QString filename = QFileDialog::getOpenFileName(
this,
QApplication::translate("SettingsWindow", "Select sudo command"),
@ -155,8 +208,38 @@ void SettingsWindow::selectSudoPath()
}
void SettingsWindow::selectSystemctlPath()
{
if (debug) qDebug() << "[SettingsWindow]" << "[selectSystemctlPath]";
QString filename = QFileDialog::getOpenFileName(
this,
QApplication::translate("SettingsWindow", "Select systemctl command"),
QString("/usr/bin/"),
QApplication::translate("SettingsWindow", "All files (*)"));
if (!filename.isEmpty())
ui->lineEdit_systemctlPath->setText(filename);
}
void SettingsWindow::selectWpaActiondPath()
{
if (debug) qDebug() << "[SettingsWindow]" << "[selectWpaActiondPath]";
QString filename = QFileDialog::getOpenFileName(
this,
QApplication::translate("SettingsWindow", "Select wpa_actiond command"),
QString("/usr/bin/"),
QApplication::translate("SettingsWindow", "All files (*)"));
if (!filename.isEmpty())
ui->lineEdit_wpaActiondPath->setText(filename);
}
void SettingsWindow::selectWpaCliPath()
{
if (debug) qDebug() << "[SettingsWindow]" << "[selectWpaCliPath]";
QString filename = QFileDialog::getOpenFileName(
this,
QApplication::translate("SettingsWindow", "Select wpa_cli command"),
@ -169,6 +252,8 @@ void SettingsWindow::selectWpaCliPath()
void SettingsWindow::selectWpaSupPath()
{
if (debug) qDebug() << "[SettingsWindow]" << "[selectWpaSupPath]";
QString filename = QFileDialog::getOpenFileName(
this,
QApplication::translate("SettingsWindow", "Select wpa_supplicant command"),
@ -181,32 +266,39 @@ void SettingsWindow::selectWpaSupPath()
void SettingsWindow::showWindow()
{
if (debug) qDebug() << "[SettingsWindow]" << "[showWindow]";
setSettings(getSettings());
ui->label_info->hide();
show();
}
QMap<QString, QString> SettingsWindow::readSettings()
{
QMap<QString, QString> settings;
if (debug) qDebug() << "[SettingsWindow]" << "[readSettings]";
QMap<QString, QString> settings;
settings[QString("CTRL_DIR")] = ui->lineEdit_wpaDir->text();
settings[QString("CTRL_GROUP")] = ui->lineEdit_wpaGroup->text();
settings[QString("IFACE_DIR")] = ui->lineEdit_interfacesDir->text();
settings[QString("LANGUAGE")] = ui->comboBox_language->currentText();
settings[QString("NETCTL_PATH")] = ui->lineEdit_netctlPath->text();
settings[QString("NETCTLAUTO_PATH")] = ui->lineEdit_netctlAutoPath->text();
settings[QString("NETCTLAUTO_SERVICE")] = ui->lineEdit_netctlAutoService->text();
settings[QString("PID_FILE")] = ui->lineEdit_pid->text();
settings[QString("PREFERED_IFACE")] = ui->lineEdit_interface->text();
settings[QString("PROFILE_DIR")] = ui->lineEdit_profilePath->text();
settings[QString("RFKILL_DIR")] = ui->lineEdit_rfkill->text();
settings[QString("SUDO_PATH")] = ui->lineEdit_sudo->text();
settings[QString("SYSTEMCTL_PATH")] = ui->lineEdit_systemctlPath->text();
settings[QString("WPAACTIOND_PATH")] = ui->lineEdit_wpaActiondPath->text();
settings[QString("WPACLI_PATH")] = ui->lineEdit_wpaCliPath->text();
settings[QString("WPASUP_PATH")] = ui->lineEdit_wpaSupPath->text();
settings[QString("WPA_DRIVERS")] = ui->lineEdit_wpaSupDrivers->text();
for (int i=0; i<settings.keys().count(); i++)
qDebug() << "[SettingsWindow]" << "[readSettings]" << ":" <<
if (debug) qDebug() << "[SettingsWindow]" << "[readSettings]" << ":" <<
settings.keys()[i] + QString("=") + settings[settings.keys()[i]];
return settings;
@ -215,6 +307,8 @@ QMap<QString, QString> SettingsWindow::readSettings()
void SettingsWindow::setSettings(const QMap<QString, QString> settings)
{
if (debug) qDebug() << "[SettingsWindow]" << "[setSettings]";
ui->lineEdit_wpaDir->setText(settings[QString("CTRL_DIR")]);
ui->lineEdit_wpaGroup->setText(settings[QString("CTRL_GROUP")]);
ui->lineEdit_interfacesDir->setText(settings[QString("IFACE_DIR")]);
@ -223,41 +317,48 @@ void SettingsWindow::setSettings(const QMap<QString, QString> settings)
if (ui->comboBox_language->itemText(i) == settings[QString("LANGUAGE")])
ui->comboBox_language->setCurrentIndex(i);
ui->lineEdit_netctlPath->setText(settings[QString("NETCTL_PATH")]);
ui->lineEdit_netctlAutoPath->setText(settings[QString("NETCTLAUTO_PATH")]);
ui->lineEdit_netctlAutoService->setText(settings[QString("NETCTLAUTO_SERVICE")]);
ui->lineEdit_pid->setText(settings[QString("PID_FILE")]);
ui->lineEdit_interface->setText(settings[QString("PREFERED_IFACE")]);
ui->lineEdit_profilePath->setText(settings[QString("PROFILE_DIR")]);
ui->lineEdit_rfkill->setText(settings[QString("RFKILL_DIR")]);
ui->lineEdit_sudo->setText(settings[QString("SUDO_PATH")]);
ui->lineEdit_systemctlPath->setText(settings[QString("SYSTEMCTL_PATH")]);
ui->lineEdit_wpaActiondPath->setText(settings[QString("WPAACTIOND_PATH")]);
ui->lineEdit_wpaCliPath->setText(settings[QString("WPACLI_PATH")]);
ui->lineEdit_wpaSupPath->setText(settings[QString("WPASUP_PATH")]);
ui->lineEdit_wpaSupDrivers->setText(settings[QString("WPA_DRIVERS")]);
for (int i=0; i<settings.keys().count(); i++)
qDebug() << "[SettingsWindow]" << "[setSettings]" << ":" <<
if (debug) qDebug() << "[SettingsWindow]" << "[setSettings]" << ":" <<
settings.keys()[i] + QString("=") + settings[settings.keys()[i]];
}
QMap<QString, QString> SettingsWindow::getDefault()
{
QMap<QString, QString> settings;
if (debug) qDebug() << "[SettingsWindow]" << "[getDefault]";
QMap<QString, QString> settings;
settings[QString("CTRL_DIR")] = QString("/run/wpa_supplicant_netctl-gui");
settings[QString("CTRL_GROUP")] = QString("users");
settings[QString("IFACE_DIR")] = QString("/sys/class/net/");
settings[QString("LANGUAGE")] = QString("english");
settings[QString("LANGUAGE")] = QString("en");
settings[QString("NETCTL_PATH")] = QString("/usr/bin/netctl");
settings[QString("NETCTLAUTO_PATH")] = QString("/usr/bin/netctl-auto");
settings[QString("NETCTLAUTO_SERVICE")] = QString("netctl-auto");
settings[QString("PID_FILE")] = QString("/run/wpa_supplicant_netctl-gui.pid");
settings[QString("PREFERED_IFACE")] = QString("");
settings[QString("PROFILE_DIR")] = QString("/etc/netctl/");
settings[QString("RFKILL_DIR")] = QString("/sys/class/rfkill/");
settings[QString("SUDO_PATH")] = QString("/usr/bin/kdesu");
settings[QString("SYSTEMCTL_PATH")] = QString("/usr/bin/systemctl");
settings[QString("WPAACTIOND_PATH")] = QString("/usr/bin/wpa_actiond");
settings[QString("WPACLI_PATH")] = QString("/usr/bin/wpa_cli");
settings[QString("WPASUP_PATH")] = QString("/usr/bin/wpa_supplicant");
settings[QString("WPA_DRIVERS")] = QString("nl80211,wext");
for (int i=0; i<settings.keys().count(); i++)
qDebug() << "[SettingsWindow]" << "[getDefault]" << ":" <<
if (debug) qDebug() << "[SettingsWindow]" << "[getDefault]" << ":" <<
settings.keys()[i] + QString("=") + settings[settings.keys()[i]];
return settings;
@ -266,28 +367,25 @@ QMap<QString, QString> SettingsWindow::getDefault()
QMap<QString, QString> SettingsWindow::getSettings()
{
QMap<QString, QString> settings;
if (debug) qDebug() << "[SettingsWindow]" << "[getSettings]";
QMap<QString, QString> settings = getDefault();
QFile configFile(file);
QString fileStr;
if (!configFile.open(QIODevice::ReadOnly))
return getDefault();
return settings;
while (true) {
fileStr = QString(configFile.readLine());
if (fileStr[0] != '#') {
if (fileStr.contains(QString("=")))
settings[fileStr.split(QString("="))[0]] = fileStr.split(QString("="))[1]
.remove(QString(" "))
.trimmed();
}
fileStr = QString(configFile.readLine()).trimmed();
if (fileStr[0] == QChar('#')) continue;
if (fileStr[0] == QChar(';')) continue;
if (!fileStr.contains(QChar('='))) continue;
settings[fileStr.split(QChar('='))[0]] = fileStr.split(QChar('='))[1];
if (configFile.atEnd())
break;
}
configFile.close();
for (int i=0; i<settings.keys().count(); i++)
qDebug() << "[SettingsWindow]" << "[getSettings]" << ":" <<
if (debug) qDebug() << "[SettingsWindow]" << "[getSettings]" << ":" <<
settings.keys()[i] + QString("=") + settings[settings.keys()[i]];
return settings;

View File

@ -20,6 +20,7 @@
#include <QKeyEvent>
#include <QMainWindow>
#include <QTreeWidgetItem>
class MainWindow;
@ -33,7 +34,8 @@ class SettingsWindow : public QMainWindow
Q_OBJECT
public:
explicit SettingsWindow(MainWindow *wid = 0,
explicit SettingsWindow(QWidget *parent = 0,
const bool debugCmd = false,
const QString configFile = QString(""));
~SettingsWindow();
QMap<QString, QString> getDefault();
@ -45,18 +47,22 @@ public slots:
private slots:
void addLanguages();
void changePage(QTreeWidgetItem *current, QTreeWidgetItem *previous);
void saveSettings();
// buttons
void selectIfaceDir();
void selectNetctlPath();
void selectNetctlAutoPath();
void selectProfileDir();
void selectRfkillDir();
void selectSudoPath();
void selectSystemctlPath();
void selectWpaActiondPath();
void selectWpaCliPath();
void selectWpaSupPath();
private:
MainWindow *parent;
bool debug;
QString file;
Ui::SettingsWindow *ui;
void createActions();

File diff suppressed because it is too large Load Diff

View File

@ -63,7 +63,7 @@ void TunnelWidget::createFilter()
QString TunnelWidget::getIp(const QString rawIp)
{
QStringList ip = rawIp.split(QString("."));
QStringList ip = rawIp.split(QChar('.'));
// fix empty fields
if (ip[0].isEmpty())
@ -79,7 +79,7 @@ QString TunnelWidget::getIp(const QString rawIp)
if (ip[i].toInt() > 255)
ip[i] = QString("255");
return ip.join(QString("."));
return ip.join(QChar('.'));
}
@ -91,10 +91,10 @@ QMap<QString, QString> TunnelWidget::getSettings()
return tunnelSettings;
tunnelSettings[QString("Mode")] = QString("'") + ui->comboBox_mode->currentText() + QString("'");
if (!ui->lineEdit_local->text().split(QString(".")).join(QString("")).remove(QString(" ")).isEmpty())
tunnelSettings[QString("Local")] = QString("'") + getIp(ui->lineEdit_local->text().remove(QString(" "))) + QString("'");
if (!ui->lineEdit_remote->text().split(QString(".")).join(QString("")).remove(QString(" ")).isEmpty())
tunnelSettings[QString("Remote")] = QString("'") + getIp(ui->lineEdit_remote->text().remove(QString(" "))) + QString("'");
if (!ui->lineEdit_local->text().remove(QChar('.')).remove(QChar(' ')).isEmpty())
tunnelSettings[QString("Local")] = QString("'") + getIp(ui->lineEdit_local->text().remove(QChar(' '))) + QString("'");
if (!ui->lineEdit_remote->text().remove(QChar('.')).remove(QChar(' ')).isEmpty())
tunnelSettings[QString("Remote")] = QString("'") + getIp(ui->lineEdit_remote->text().remove(QChar(' '))) + QString("'");
return tunnelSettings;
}
@ -109,14 +109,15 @@ int TunnelWidget::isOk()
void TunnelWidget::setSettings(const QMap<QString, QString> settings)
{
clear();
QMap<QString, QString> tunnelSettings = settings;
if (tunnelSettings.contains(QString("Mode")))
for (int i=0; i<ui->comboBox_mode->count(); i++)
if (tunnelSettings[QString("Mode")].remove(QString("'")) == ui->comboBox_mode->itemText(i))
if (tunnelSettings[QString("Mode")] == ui->comboBox_mode->itemText(i))
ui->comboBox_mode->setCurrentIndex(i);
if (tunnelSettings.contains(QString("Local")))
ui->lineEdit_local->setText(tunnelSettings[QString("Local")].remove(QString("'")));
ui->lineEdit_local->setText(tunnelSettings[QString("Local")]);
if (tunnelSettings.contains(QString("Remote")))
ui->lineEdit_remote->setText(tunnelSettings[QString("Remote")].remove(QString("'")));
ui->lineEdit_remote->setText(tunnelSettings[QString("Remote")]);
}

View File

@ -81,14 +81,15 @@ int TuntapWidget::isOk()
void TuntapWidget::setSettings(const QMap<QString, QString> settings)
{
clear();
QMap<QString, QString> tuntapSettings = settings;
if (tuntapSettings.contains(QString("Mode")))
for (int i=0; i<ui->comboBox_mode->count(); i++)
if (tuntapSettings[QString("Mode")].remove(QString("'")) == ui->comboBox_mode->itemText(i))
if (tuntapSettings[QString("Mode")] == ui->comboBox_mode->itemText(i))
ui->comboBox_mode->setCurrentIndex(i);
if (tuntapSettings.contains(QString("User")))
ui->lineEdit_user->setText(tuntapSettings[QString("User")].remove(QString("'")));
ui->lineEdit_user->setText(tuntapSettings[QString("User")]);
if (tuntapSettings.contains(QString("Group")))
ui->lineEdit_group->setText(tuntapSettings[QString("Group")].remove(QString("'")));
ui->lineEdit_group->setText(tuntapSettings[QString("Group")]);
}

View File

@ -71,6 +71,7 @@ int VlanWidget::isOk()
void VlanWidget::setSettings(const QMap<QString, QString> settings)
{
clear();
QMap<QString, QString> vlanSettings = settings;
if (vlanSettings.contains(QString("VLANID")))

View File

@ -56,6 +56,7 @@ void WirelessWidget::clear()
ui->spinBox_freq->setValue(2412);
ui->listWidget_freq->setCurrentRow(-1);
ui->listWidget_freq->clear();
ui->spinBox_frequency->setValue(2000);
ui->spinBox_priority->setValue(0);
ui->lineEdit_country->clear();
ui->lineEdit_wpaGroup->setText(QString("wheel"));
@ -70,7 +71,7 @@ void WirelessWidget::clear()
QDir::separator() + QString("name"));
QString deviceName;
if (device.open(QIODevice::ReadOnly))
deviceName = QString(device.readLine()).remove(QString("\n"));
deviceName = QString(device.readLine()).trimmed();
ui->comboBox_rfkill->addItem(deviceName);
}
}
@ -226,7 +227,7 @@ QMap<QString, QString> WirelessWidget::getSettings()
QStringList section;
for (int i=0; i<ui->listWidget_wpaConfigSection->count(); i++)
section.append(QString("'") + ui->listWidget_wpaConfigSection->item(i)->text() + QString("'"));
wirelessSettings[QString("WPAConfigSection")] = QString("\n") + section.join(QString("\n")) + QString("\n");
wirelessSettings[QString("WPAConfigSection")] = QString("\n") + section.join(QChar('\n')) + QString("\n");
}
if (ui->comboBox_security->currentText() == QString("wpa-config"))
wirelessSettings[QString("WPAConfigFile")] = QString("'") + ui->lineEdit_wpaConfig->text() + QString("'");
@ -238,8 +239,10 @@ QMap<QString, QString> WirelessWidget::getSettings()
QStringList freqs;
for (int i=0; i<ui->listWidget_freq->count(); i++)
freqs.append(ui->listWidget_freq->item(i)->text());
wirelessSettings[QString("ScanFrequencies")] = freqs.join(QString(" "));
wirelessSettings[QString("ScanFrequencies")] = freqs.join(QChar(' '));
}
if (ui->spinBox_frequency->value() != 2000)
wirelessSettings[QString("Frequency")] = QString::number(ui->spinBox_frequency->value());
if (ui->spinBox_priority->value() != 0)
wirelessSettings[QString("Priority")] = QString::number(ui->spinBox_priority->value());
if (!ui->lineEdit_country->text().isEmpty())
@ -250,7 +253,7 @@ QMap<QString, QString> WirelessWidget::getSettings()
QStringList drivers;
for (int i=0; i<ui->listWidget_drivers->count(); i++)
drivers.append(ui->listWidget_drivers->item(i)->text());
wirelessSettings[QString("WPADriver")] = QString("'") + drivers.join(QString(",")) + QString("'");
wirelessSettings[QString("WPADriver")] = QString("'") + drivers.join(QChar(',')) + QString("'");
}
if (ui->comboBox_rfkill->currentText() != QString("auto"))
wirelessSettings[QString("RFKill")] = ui->comboBox_rfkill->currentText();
@ -295,51 +298,53 @@ int WirelessWidget::isOk()
void WirelessWidget::setSettings(const QMap<QString, QString> settings)
{
clear();
QMap<QString, QString> wirelessSettings = settings;
if (wirelessSettings.contains(QString("Security")))
for (int i=0; i<ui->comboBox_security->count(); i++)
if (wirelessSettings[QString("Security")].remove(QString("'")) == ui->comboBox_security->itemText(i))
if (wirelessSettings[QString("Security")] == ui->comboBox_security->itemText(i))
ui->comboBox_security->setCurrentIndex(i);
if (wirelessSettings.contains(QString("ESSID")))
ui->lineEdit_essid->setText(wirelessSettings[QString("ESSID")].remove(QString("'")));
if (wirelessSettings.contains(QString("Key")))
ui->lineEdit_key->setText(wirelessSettings[QString("Key")].remove(QString("'")));
if (wirelessSettings.contains(QString("WPAConfigSection"))) {
QStringList custom;
if (wirelessSettings[QString("WPAConfigSection")].contains(QString("\n")))
custom = wirelessSettings[QString("WPAConfigSection")].split(QString("'\n'"));
else
custom = wirelessSettings[QString("WPAConfigSection")].split(QString("' '"));
for (int i=0; i<custom.count(); i++)
ui->listWidget_wpaConfigSection->addItem(custom[i].remove(QString("'")));
ui->lineEdit_essid->setText(wirelessSettings[QString("ESSID")]);
if (wirelessSettings.contains(QString("Key"))) {
// workaround for wireless-wep example
if (wirelessSettings.contains(QString("Security")))
if ((wirelessSettings[QString("Security")] == QString("wep")) &&
(wirelessSettings[QString("Key")][0] == QChar('"')))
wirelessSettings[QString("Key")] = QChar('\\') + wirelessSettings[QString("Key")];
ui->lineEdit_key->setText(wirelessSettings[QString("Key")]);
}
if (wirelessSettings.contains(QString("WPAConfigSection")))
ui->listWidget_wpaConfigSection->addItems(wirelessSettings[QString("WPAConfigSection")].split(QChar('\n')));
if (wirelessSettings.contains(QString("WPAConfigFile")))
ui->lineEdit_wpaConfig->setText(wirelessSettings[QString("WPAConfigFile")].remove(QString("'")));
ui->lineEdit_wpaConfig->setText(wirelessSettings[QString("WPAConfigFile")]);
if (wirelessSettings.contains(QString("Hidden")))
if (wirelessSettings[QString("Hidden")].remove(QString("'")) == QString("yes"))
if (wirelessSettings[QString("Hidden")] == QString("yes"))
ui->checkBox_hidden->setCheckState(Qt::Checked);
if (wirelessSettings.contains(QString("AdHoc")))
if (wirelessSettings[QString("AdHoc")].remove(QString("'")) == QString("yes"))
if (wirelessSettings[QString("AdHoc")] == QString("yes"))
ui->checkBox_adhoc->setCheckState(Qt::Checked);
if (wirelessSettings.contains(QString("ScanFrequencies")))
ui->listWidget_freq->addItems(wirelessSettings[QString("ScanFrequencies")].split(QString("\n")));
ui->listWidget_freq->addItems(wirelessSettings[QString("ScanFrequencies")].split(QChar('\n')));
if (wirelessSettings.contains(QString("Frequency")))
ui->spinBox_frequency->setValue(wirelessSettings[QString("Frequency")].toInt());
if (wirelessSettings.contains(QString("Priority")))
ui->spinBox_priority->setValue(wirelessSettings[QString("Priority")].toInt());
if (wirelessSettings.contains(QString("Country")))
ui->lineEdit_country->setText(wirelessSettings[QString("Country")].remove(QString("'")));
ui->lineEdit_country->setText(wirelessSettings[QString("Country")]);
if (wirelessSettings.contains(QString("WPAGroup")))
ui->lineEdit_wpaGroup->setText(wirelessSettings[QString("WPAGroup")].remove(QString("'")));
ui->lineEdit_wpaGroup->setText(wirelessSettings[QString("WPAGroup")]);
if (wirelessSettings.contains(QString("WPADriver")))
ui->listWidget_drivers->addItems(wirelessSettings[QString("WPADriver")].split(QString(",")));
ui->listWidget_drivers->addItems(wirelessSettings[QString("WPADriver")].split(QChar(',')));
if (wirelessSettings.contains(QString("RFKill")))
for (int i=0; i<ui->comboBox_rfkill->count(); i++)
if (wirelessSettings[QString("RFKill")].remove(QString("'")) == ui->comboBox_rfkill->itemText(i))
if (wirelessSettings[QString("RFKill")] == ui->comboBox_rfkill->itemText(i))
ui->comboBox_rfkill->setCurrentIndex(i);
if (wirelessSettings.contains(QString("TimeoutWPA")))
ui->spinBox_timeoutWpa->setValue(wirelessSettings[QString("TimeoutWPA")].toInt());
if (wirelessSettings.contains(QString("ExcludeAuto")))
if (wirelessSettings[QString("ExcludeAuto")].remove(QString("'")) == QString("yes"))
if (wirelessSettings[QString("ExcludeAuto")] == QString("yes"))
ui->checkBox_exclude->setCheckState(Qt::Checked);
changeSecurity(ui->comboBox_security->currentText());

View File

@ -305,6 +305,36 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_frequency">
<item>
<widget class="QLabel" name="label_frequency">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Frequency</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_frequency">
<property name="toolTip">
<string>Priority group for the network</string>
</property>
<property name="minimum">
<number>2000</number>
</property>
<property name="maximum">
<number>6000</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_priority">
<item>
@ -525,6 +555,7 @@
<tabstop>spinBox_freq</tabstop>
<tabstop>pushButton_freq</tabstop>
<tabstop>listWidget_freq</tabstop>
<tabstop>spinBox_frequency</tabstop>
<tabstop>spinBox_priority</tabstop>
<tabstop>lineEdit_country</tabstop>
<tabstop>lineEdit_wpaGroup</tabstop>

View File

@ -1,231 +0,0 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "wpasupinteract.h"
#include <QDebug>
#include <QProcess>
#include "mainwindow.h"
#include "netctlinteract.h"
#include "sleepthread.h"
WpaSup::WpaSup(MainWindow *wid, const QMap<QString, QString> settings)
: parent(wid)
{
ctrlDir = settings[QString("CTRL_DIR")];
ctrlGroup = settings[QString("CTRL_GROUP")];
ifaceDirectory = new QDir(settings[QString("IFACE_DIR")]);
mainInterface = settings[QString("PREFERED_IFACE")];
pidFile = settings[QString("PID_FILE")];
sudoCommand = settings[QString("SUDO_PATH")];
wpaCliPath = settings[QString("WPACLI_PATH")];
wpaDrivers = settings[QString("WPA_DRIVERS")];
wpaSupPath = settings[QString("WPASUP_PATH")];
// terminate old loaded profile
if (QFile(pidFile).exists() || QDir(ctrlDir).exists())
stopWpaSupplicant();
}
WpaSup::~WpaSup()
{
delete ifaceDirectory;
}
// general information
QString WpaSup::existentProfile(const QString profile)
{
QString profileFile = QString("");
QList<QStringList> profileList = parent->netctlCommand->getProfileList();
for (int i=0; i<profileList.count(); i++)
if (profile == parent->netctlCommand->getSsidFromProfile(profileList[i][0]))
profileFile = profileList[i][0];
return profileFile;
}
QStringList WpaSup::getInterfaceList()
{
QStringList interfaces;
if (!mainInterface.isEmpty())
interfaces.append(mainInterface);
QStringList allInterfaces = ifaceDirectory->entryList(QDir::Dirs | QDir::NoDotAndDotDot);
for (int i=0; i<allInterfaces.count(); i++) {
qDebug() << "[WpaSup]" << "[getInterfaceList]" << ":" << "Check directory"
<< ifaceDirectory->path() + QDir::separator() + allInterfaces[i] + QDir::separator() + QString("wireless");
if (QDir(ifaceDirectory->path() + QDir::separator() + allInterfaces[i] +
QDir::separator() + QString("wireless")).exists())
interfaces.append(allInterfaces[i]);
}
return interfaces;
}
bool WpaSup::isProfileActive(const QString profile)
{
QString profileFile;
QList<QStringList> profileList = parent->netctlCommand->getProfileList();
for (int i=0; i<profileList.count(); i++)
if (profile == parent->netctlCommand->getSsidFromProfile(profileList[i][0]))
profileFile = profileList[i][0];
return parent->netctlCommand->isProfileActive(profileFile);
}
bool WpaSup::isProfileExists(const QString profile)
{
bool exists = false;
QList<QStringList> profileList = parent->netctlCommand->getProfileList();
for (int i=0; i<profileList.count(); i++)
if (profile == parent->netctlCommand->getSsidFromProfile(profileList[i][0]))
exists = true;
return exists;
}
// functions
bool WpaSup::wpaCliCall(const QString commandLine)
{
QString interface = getInterfaceList()[0];
QProcess command;
QString commandText = wpaCliPath + QString(" -i ") + interface + QString(" -p ") + ctrlDir +
QString(" -P ") + pidFile + QString(" ") + commandLine;
qDebug() << "[WpaSup]" << "[wpaCliCall]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
SleepThread::sleep(1);
qDebug() << "[WpaSup]" << "[wpaCliCall]" << ":" << "Cmd returns" << command.exitCode();
if (command.exitCode() == 0)
return true;
else
return false;
}
QString WpaSup::getWpaCliOutput(const QString commandLine)
{
QString interface = getInterfaceList()[0];
QProcess command;
QString commandText = wpaCliPath + QString(" -i ") + interface + QString(" -p ") + ctrlDir +
QString(" -P ") + pidFile + QString(" ") + commandLine;
qDebug() << "[WpaSup]" << "[getWpaCliOutput]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
return command.readAllStandardOutput();
}
QList<QStringList> WpaSup::scanWifi()
{
QList<QStringList> scanResults;
if (!startWpaSupplicant()) {
stopWpaSupplicant();
return scanResults;
}
if (!wpaCliCall(QString("scan")))
return scanResults;
SleepThread::sleep(3);
QStringList rawOutput = getWpaCliOutput(QString("scan_results")).split(QString("\n"), QString::SkipEmptyParts);
// remove table header
rawOutput.removeFirst();
// remove duplicates
QStringList rawList;
for (int i=0; i<rawOutput.count(); i++) {
bool exist = false;
if (rawOutput[i].split(QString("\t"), QString::SkipEmptyParts).count() > 4)
for (int j=0; j<rawList.count(); j++)
if (rawList[j].split(QString("\t"), QString::SkipEmptyParts).count() > 4)
if (rawOutput[i].split(QString("\t"), QString::SkipEmptyParts)[4] ==
rawList[j].split(QString("\t"), QString::SkipEmptyParts)[4])
exist = true;
if (!exist)
rawList.append(rawOutput[i]);
}
for (int i=0; i<rawList.count(); i++) {
QStringList wifiPoint;
// point name
if (rawList[i].split(QString("\t"), QString::SkipEmptyParts).count() > 4)
wifiPoint.append(rawList[i].split(QString("\t"), QString::SkipEmptyParts)[4]);
else
wifiPoint.append(QString("<hidden>"));
// profile status
QString status;
if (isProfileExists(wifiPoint[0])) {
status = QString("exists");
if (isProfileActive(wifiPoint[0]))
status = status + QString(" (active)");
else
status = status + QString(" (inactive)");
}
else
status = QString("new");
wifiPoint.append(status);
// point signal
wifiPoint.append(rawList[i].split(QString("\t"), QString::SkipEmptyParts)[2]);
// point security
QString security = rawList[i].split(QString("\t"), QString::SkipEmptyParts)[3];
if (security.contains(QString("WPA2")))
security = QString("WPA2");
else if (security.contains(QString("WPA")))
security = QString("WPA");
else if (security.contains(QString("WEP")))
security = QString("WEP");
else
security = QString("none");
wifiPoint.append(security);
scanResults.append(wifiPoint);
}
stopWpaSupplicant();
return scanResults;
}
bool WpaSup::startWpaSupplicant()
{
if (!QFile(pidFile).exists()) {
QString interface = getInterfaceList()[0];
QProcess command;
QString commandText = sudoCommand + QString(" ") + wpaSupPath + QString(" -B -P ") + pidFile +
QString(" -i ") + interface + QString(" -D ") + wpaDrivers +
QString(" -C \"DIR=") + ctrlDir + QString(" GROUP=") + ctrlGroup + QString("\"");
qDebug() << "[WpaSup]" << "[startWpaSupplicant]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
SleepThread::sleep(1);
qDebug() << "[WpaSup]" << "[startWpaSupplicant]" << ":" << "Cmd returns" << command.exitCode();
if (command.exitCode() != 0)
return false;
}
return true;
}
bool WpaSup::stopWpaSupplicant()
{
return wpaCliCall(QString("terminate"));
}

View File

@ -0,0 +1,19 @@
# set project name
set (SUBPROJECT ${PROJECT_LIBRARY})
message (STATUS "Subproject ${SUBPROJECT}")
# set directories
set (SUBPROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set (SUBPROJECT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
# additional targets
set (TARGETS "")
set (HEADERS "")
add_subdirectory (${SUBPROJECT_SOURCE_DIR})
# headers
install (DIRECTORY ${SUBPROJECT_INCLUDE_DIR}/ DESTINATION include/)
# documentation
if (BUILD_DOCS)
include (docs.cmake)
endif ()

View File

@ -0,0 +1,19 @@
# doxygen documentation
find_package (Doxygen)
if (NOT DOXYGEN_FOUND)
message (STATUS "WARNING: Doxygen not found - Reference manual will not be created")
return ()
endif ()
configure_file (doxygen.conf.in ${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf)
add_custom_target (oxygen-docs ALL COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf)
# man pages
# workaround for man pages
set (MAN_DIR ${CMAKE_CURRENT_BINARY_DIR}/docs/man/man3)
install (FILES ${MAN_DIR}/Netctl.3 DESTINATION share/man/man3 RENAME ${SUBPROJECT}_Netctl.3)
install (FILES ${MAN_DIR}/NetctlProfile.3 DESTINATION share/man/man3 RENAME ${SUBPROJECT}_NetctlProfile.3)
install (FILES ${MAN_DIR}/SleepThread.3 DESTINATION share/man/man3 RENAME ${SUBPROJECT}_SleepThread.3)
install (FILES ${MAN_DIR}/WpaSup.3 DESTINATION share/man/man3 RENAME ${SUBPROJECT}_WpaSup.3)
# html docs
install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs/html DESTINATION share/doc/${SUBPROJECT})

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,302 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
/**
* @file netctlinteract.h
* Header of netctlgui library
* @author Evgeniy Alekseev
* @copyright GPLv3
* @bug https://github.com/arcan1s/netctl-gui/issues
*/
#ifndef NETCTLINTERACT_H
#define NETCTLINTERACT_H
#include <QDir>
#include <QMap>
#include <QObject>
/**
* @brief The Netctl class interacts with netctl
*/
class Netctl : public QObject
{
Q_OBJECT
public:
/**
* @brief Netctl class constructor
* @param debugCmd show debug messages
* @param settings default settings. Needed keys are
* IFACE_DIR (path to directory with interfaces),
* PREFERED_IFACE (prefered interface for WiFi),
* NETCTL_PATH (path to netctl command),
* NETCTLAUTO_PATH (path to netctl-auto command),
* NETCTLAUTO_SERVICE (netctl-auto service name),
* PROFILE_DIR (path to directory which contains profiles),
* SUDO_PATH (path to sudo command),
* SYSTEMCTL_PATH (path to systemctl command)
*/
explicit Netctl(const bool debugCmd = false,
const QMap<QString, QString> settings = QMap<QString, QString>());
/**
* @brief Netctl class destructor
*/
~Netctl();
// general information
/**
* @brief method which returns profile informations from netctl
* @return list of profiles. Available information is [NAME, DESCRIPTION, STATUS]:
* NAME is a profile name,
* DESCRIPTION is a profile description (see more details below),
* STATUS is a profile status (see more details below)
*/
QList<QStringList> getProfileList();
/**
* @brief method which returns profile informations from netctl-auto
* @return list of profiles. Available information is [NAME, DESCRIPTION, STATUS]:
* NAME is a profile name,
* DESCRIPTION is a profile description (see more details below),
* STATUS is a profile status (see more details below)
*/
QList<QStringList> getProfileListFromNetctlAuto();
/**
* @brief method which gets description from profile
* @param profile profile name
* @return profile description or "<unknown>"
*/
QString getProfileDescription(const QString profile);
/**
* @brief method which gets descriptions from profile list
* @param profileList profile names
* @return list of profile descriptions (if description is not available return "<unknown>")
*/
QStringList getProfileDescriptions(const QStringList profileList);
/**
* @brief method which gets profile status
* @param profile profile name
* @return profile status. It may be "active (enabled)", "active (static)",
* "inactive (enabled)", "inactive (static)"
*/
QString getProfileStatus(const QString profile);
/**
* @brief method which gets statuses of profile list
* @param profileList profile names
* @return list of profile statuses. It may be "active (enabled)", "active (static)",
* "inactive (enabled)", "inactive (static)"
*/
QStringList getProfileStatuses(const QStringList profileList);
/**
* @brief method which gets ESSID from profile
* @param profile profile name
* @return ESSID name or null string
*/
QString getSsidFromProfile(const QString profile);
/**
* @brief method which checks if profile is active
* @param profile profile name
* @return false if profile is inactive
* @return true if profile is active
*/
bool isProfileActive(const QString profile);
/**
* @brief method which checks if profile is enabled
* @param profile profile name
* @return false if profile is disabled
* @return true if profile is enabled
*/
bool isProfileEnabled(const QString profile);
/**
* @brief method which checks if profile is active (netctl-auto)
* @param profile profile name
* @return false if profile is inactive
* @return true if profile is active
*/
bool autoIsProfileActive(const QString profile);
/**
* @brief method which checks if profile is enabled (netctl-auto)
* @param profile profile name
* @return false if profile is disabled
* @return true if profile is enabled
*/
bool autoIsProfileEnabled(const QString profile);
/**
* @brief method which checks netctl-auto autoload status
* @return false if netctl-auto is disabled
* @return true if netctl-auto is enabled
*/
bool isNetctlAutoEnabled();
/**
* @brief method which checks netctl-auto status
* @return false if netctl-auto is inactive
* @return true if netctl-auto is active
*/
bool isNetctlAutoRunning();
public slots:
// functions
// netctl
/**
* @brief method which sets profile disabled or enabled
* @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 enableProfile(const QString profile);
/**
* @brief method which restarts 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 restartProfile(const QString profile);
/**
* @brief method which starts or 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 startProfile(const QString profile);
// netctl-auto
/**
* @brief method which sets all profiles disabled (netctl-auto)
* @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 autoDisableAllProfiles();
/**
* @brief method which sets profile disabled or enabled (netctl-auto)
* @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 autoEnableProfile(const QString profile);
/**
* @brief method which sets all profiles enabled (netctl-auto)
* @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 autoEnableAllProfiles();
/**
* @brief method which switchs to profile (netctl-auto)
* @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 autoStartProfile(const QString profile);
// netctl-auto service
/**
* @brief method which sets netctl-auto service enabled or disabled
* @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 autoEnableService();
/**
* @brief method which restarted netctl-auto service
* @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 autoRestartService();
/**
* @brief method which starts or stops netctl-auto service
* @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 autoStartService();
private:
/**
* @brief show debug messages
*/
bool debug;
/**
* @brief directory with interfaces. Default is "/sys/class/net/"
*/
QDir *ifaceDirectory;
/**
* @brief prefered interface for WiFi. Default is ""
*/
QString mainInterface;
/**
* @brief path to netctl command. Default is "/usr/bin/netctl"
*/
QString netctlCommand;
/**
* @brief path to netctl-auto command. Default is "/usr/bin/netctl-auto"
*/
QString netctlAutoCommand;
/**
* @brief netctl-auto service name. Default is "netctl-auto"
*/
QString netctlAutoService;
/**
* @brief directory which contains profiles. Default is "/etc/netctl"
*/
QDir *profileDirectory;
/**
* @brief path to sudo command. Default is "/usr/bin/kdesu"
*/
QString sudoCommand;
/**
* @brief path to systemctl command. Default is "/usr/bin/systemctl"
*/
QString systemctlCommand;
// functions
/**
* @brief method which calls netctl and returns its output
* @param sudo set true if sudo is needed
* @param commandLine command which will be passed to netctl
* @param profile profile name
* @return netctl output
*/
QString getNetctlOutput(const bool sudo, const QString commandLine, const QString profile = 0);
/**
* @brief method which gets interface list from PREFERED_IFACE and IFACE_DIR
* @return first element from interface list. If PREFERED_IFACE is not empty it will be first element
*/
QString getWifiInterface();
/**
* @brief method which calls netctl
* @param sudo set true if sudo is needed
* @param commandLine command which will be passed to netctl
* @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 netctlCall(const bool sudo, const QString commandLine, const QString profile = 0);
/**
* @brief method which calls netctl-auto
* @param sudo set true if sudo is needed
* @param commandLine command which will be passed to netctl-auto
* @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 netctlAutoCall(const bool sudo, const QString commandLine, const QString profile = 0);
/**
* @brief method which calls systemctl associated with netctl-auto
* @param sudo set true if sudo is needed
* @param commandLine command which will be passed to systemctl
* @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 systemctlCall(const bool sudo, const QString commandLine);
};
#endif /* NETCTLINTERACT_H */

View File

@ -0,0 +1,99 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
/**
* @file netctlprofile.h
* Header of netctlgui library
* @author Evgeniy Alekseev
* @copyright GPLv3
* @bug https://github.com/arcan1s/netctl-gui/issues
*/
#ifndef NETCTLPROFILE_H
#define NETCTLPROFILE_H
#include <QDir>
#include <QMap>
#include <QObject>
/**
* @brief The NetctlProfile class interacts with netctl profiles
*/
class NetctlProfile : public QObject
{
Q_OBJECT
public:
/**
* @brief NetctlProfile class constructor
* @param debugCmd show debug messages
* @param settings default settings. Needed keys are
* PROFILE_DIR (path to directory which contains profiles),
* SUDO_PATH (path to sudo command)
*/
explicit NetctlProfile(const bool debugCmd = false,
const QMap<QString, QString> settings = QMap<QString, QString>());
/**
* @brief Netctl class destructor
*/
~NetctlProfile();
/**
* @brief method which copies temporary profile to PROFILE_DIR
* @param oldPath path to temprorary profile
* @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 copyProfile(const QString oldPath);
/**
* @brief method which creates temporary profile
* @param profile profile name
* @param settings profile configuration. All available keys will be printed to the profile
* @return temporary profile name
*/
QString createProfile(const QString profile, const QMap<QString, QString> settings);
/**
* @brief method which reads settings from profile
* @param profile profile name
* @return settings from profile
*/
QMap<QString, QString> getSettingsFromProfile(const QString profile);
/**
* @brief method which removes 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 removeProfile(const QString profile);
private:
/**
* @brief show debug messages
*/
bool debug;
/**
* @brief directory which contains profiles. Default is "/etc/netctl"
*/
QDir *profileDirectory;
/**
* @brief path to sudo command. Default is "/usr/bin/kdesu"
*/
QString sudoCommand;
};
#endif /* NETCTLPROFILE_H */

View File

@ -0,0 +1,67 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
/**
* @file sleepthread.h
* Header of netctlgui library
* @author Evgeniy Alekseev
* @copyright GPLv3
* @bug https://github.com/arcan1s/netctl-gui/issues
*/
#ifndef SLEEPTHREAD_H
#define SLEEPTHREAD_H
#include <QThread>
/**
* @brief The SleepThread class is used for sleep current thread in WpaSup class
*/
class SleepThread : public QThread
{
Q_OBJECT
public:
/**
* @brief method which forces the current thread to sleep for usecs microseconds
* @param iSleepTime time in microseconds
*/
static void usleep(long iSleepTime)
{
QThread::usleep(iSleepTime);
}
/**
* @brief method which forces the current thread to sleep for usecs seconds
* @param iSleepTime time in seconds
*/
static void sleep(long iSleepTime)
{
QThread::sleep(iSleepTime);
}
/**
* @brief method which forces the current thread to sleep for usecs milliseconds
* @param iSleepTime time in milliseconds
*/
static void msleep(long iSleepTime)
{
QThread::msleep(iSleepTime);
}
};
#endif /* SLEEPTHREAD_H */

View File

@ -0,0 +1,177 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
/**
* @file wpasupinteract.h
* Header of netctlgui library
* @author Evgeniy Alekseev
* @copyright GPLv3
* @bug https://github.com/arcan1s/netctl-gui/issues
*/
#ifndef WPASUPINTERACT_H
#define WPASUPINTERACT_H
#include <QDir>
#include <QMap>
#include <QObject>
class Netctl;
/**
* @brief The WpaSup class interacts with wpa_supplicant
*/
class WpaSup : public QObject
{
Q_OBJECT
public:
/**
* @brief WpaSup class constructor
* @param debugCmd show debug messages
* @param settings default settings. Needed keys are
* CTRL_DIR (path to ctrl_directory),
* CTRL_GROUP (group which is owner of CTRL_DIR),
* IFACE_DIR (path to directory with interfaces),
* PREFERED_IFACE (prefered interface for WiFi),
* PID_FILE (wpa_supplicant PID file),
* SUDO_PATH (path to sudo command),
* WPACLI_PATH (path to wpa_cli command),
* WPA_DRIVERS (wpa_supplicant drivers comma separated),
* WPASUP_PATH (path to wpa_supplicant command)
*/
explicit WpaSup(const bool debugCmd = false,
const QMap<QString, QString> settings = QMap<QString, QString>());
/**
* @brief WpaSup class destructor
*/
~WpaSup();
// general information
/**
* @brief method which gets profile name by ESSID
* @param essid ESSID name
* @return profile name
*/
QString existentProfile(const QString essid);
/**
* @brief method which gets interface list from PREFERED_IFACE and IFACE_DIR
* @return interface list. If PREFERED_IFACE is not empty it will be first element
*/
QStringList getInterfaceList();
/**
* @brief method which checks profile status by ESSID
* @param essid ESSID name
* @return false if profile is inactive
* @return true if profile is active
*/
bool isProfileActive(const QString essid);
/**
* @brief method which checks profile existence by ESSID
* @param essid ESSID name
* @return false if profile does not exist
* @return true if profile exists
*/
bool isProfileExists(const QString essid);
public slots:
// functions
/**
* @brief method which scans WiFi networks
* @return list of essids. Available information is [NAME, NETCTL_STATUS, SIGNAL, SECUITY]:
* NAME is WiFi point name or "<hidden>",
* NETCTL_STATUS may be "new", "exist (active)", "exist (inactive)",
* SIGNAL is Wifi point signal,
* SECURITY may be "WPA2", "WEP", "WEP", "none"
*/
QList<QStringList> scanWifi();
/**
* @brief method which calls wpa_supplicant
* @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 startWpaSupplicant();
/**
* @brief method which send TERMINATE signal to wpa_supplicant
* @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 stopWpaSupplicant();
private:
/**
* @brief Netctl class
*/
Netctl *netctlCommand;
/**
* @brief show debug messages
*/
bool debug;
/**
* @brief path to ctrl_directory. Defaults is "/run/wpa_supplicant_netctl-gui"
*/
QString ctrlDir;
/**
* @brief group which is owner of CTRL_DIR. Default is "users"
*/
QString ctrlGroup;
/**
* @brief directory with interfaces. Default is "/sys/class/net/"
*/
QDir *ifaceDirectory;
/**
* @brief prefered interface for WiFi. Default is ""
*/
QString mainInterface;
/**
* @brief wpa_supplicant PID file. Default is "/run/wpa_supplicant_netctl-gui.pid"
*/
QString pidFile;
/**
* @brief path to sudo command. Default is "/usr/bin/kdesu"
*/
QString sudoCommand;
/**
* @brief path to wpa_cli command. Default is "/usr/bin/wpa_cli"
*/
QString wpaCliPath;
/**
* @brief wpa_supplicant drivers comma separated. Default is "nl80211,wext"
*/
QString wpaDrivers;
/**
* @brief path to wpa_supplicant command. Default is "/usr/bin/wpa_supplicant"
*/
QString wpaSupPath;
// functions
/**
* @brief method which calls wpa_cli and returns its output
* @param commandLine command which will be passed to wpa_cli
* @return wpa_cli output
*/
QString getWpaCliOutput(const QString commandLine);
/**
* @brief method which calls wpa_cli
* @param commandLine command which will be passed to wpa_cli
* @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 wpaCliCall(const QString commandLine);
};
#endif /* WPASUPINTERACT_H */

View File

@ -0,0 +1,40 @@
# set files
file (GLOB SOURCES *.cpp)
file (GLOB HEADERS ${SUBPROJECT_INCLUDE_DIR}/${SUBPROJECT}/*.h)
# include_path
include_directories (${SUBPROJECT_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR})
if (USE_QT5)
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
add_definitions(${Qt5Core_DEFINITIONS})
add_definitions(${Qt5Widgets_DEFINITIONS})
qt5_wrap_cpp (MOC_SOURCES ${HEADERS})
source_group ("Header Files" FILES ${HEADERS})
source_group ("Source Files" FILES ${SOURCES})
source_group ("Generated Files" FILES ${MOC_SOURCES})
include_directories (${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
add_library (${SUBPROJECT} SHARED ${SOURCES} ${HEADERS} ${MOC_SOURCES})
target_link_libraries (${SUBPROJECT} ${Qt5Widgets_LIBRARIES} ${Qt5Core_LIBRARIES})
else ()
find_package (Qt4 REQUIRED)
include (${QT_USE_FILE})
qt4_wrap_cpp (MOC_SOURCES ${HEADERS})
source_group ("Header Files" FILES ${HEADERS})
source_group ("Source Files" FILES ${SOURCES})
source_group ("Generated Files" FILES ${MOC_SOURCES})
add_library (${SUBPROJECT} SHARED ${SOURCES} ${HEADERS} ${MOC_SOURCES})
target_link_libraries (${SUBPROJECT} ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
endif()
# install properties
install (TARGETS ${SUBPROJECT} DESTINATION lib)

View File

@ -14,33 +14,28 @@
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef SLEEPTHREAD_H
#define SLEEPTHREAD_H
#include <QThread>
/**
* @file main.cpp
* Source code of netctlgui library
* @author Evgeniy Alekseev
* @copyright GPLv3
* @bug https://github.com/arcan1s/netctl-gui/issues
*/
class SleepThread : public QThread
#include <netctlgui/netctlinteract.h>
#include <netctlgui/netctlprofile.h>
#include <netctlgui/sleepthread.h>
#include <netctlgui/wpasupinteract.h>
/**
* @fn main
*/
int main(int argc, char *argv[])
/**
* @return 0 - exit without errors
*/
{
Q_OBJECT
public:
static void usleep(long iSleepTime)
{
QThread::usleep(iSleepTime);
}
static void sleep(long iSleepTime)
{
QThread::sleep(iSleepTime);
}
static void msleep(long iSleepTime)
{
QThread::msleep(iSleepTime);
}
};
#endif /* SLEEPTHREAD_H */
return 0;
}

View File

@ -0,0 +1,747 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
/**
* @file netctlinteract.cpp
* Source code of netctlgui library
* @author Evgeniy Alekseev
* @copyright GPLv3
* @bug https://github.com/arcan1s/netctl-gui/issues
*/
#include <QDebug>
#include <QFile>
#include <QProcess>
#include <netctlgui/netctlinteract.h>
/**
* @class Netctl
*/
/**
* @fn Netctl
*/
Netctl::Netctl(const bool debugCmd, const QMap<QString, QString> settings)
: debug(debugCmd)
{
if (settings.contains(QString("IFACE_DIR")))
ifaceDirectory = new QDir(settings[QString("IFACE_DIR")]);
else
ifaceDirectory = new QDir(QString("/sys/class/net/"));
if (settings.contains(QString("PREFERED_IFACE")))
mainInterface = settings[QString("PREFERED_IFACE")];
else
mainInterface = QString("");
if (settings.contains(QString("NETCTL_PATH")))
netctlCommand = settings[QString("NETCTL_PATH")];
else
netctlCommand = QString("/usr/bin/netctl");
if (settings.contains(QString("NETCTLAUTO_PATH")))
netctlAutoCommand = settings[QString("NETCTLAUTO_PATH")];
else
netctlAutoCommand = QString("/usr/bin/netctl-auto");
if (settings.contains(QString("NETCTLAUTO_SERVICE")))
netctlAutoService = settings[QString("NETCTLAUTO_SERVICE")];
else
netctlAutoService = QString("netctl-auto");
if (settings.contains(QString("PROFILE_DIR")))
profileDirectory = new QDir(settings[QString("PROFILE_DIR")]);
else
profileDirectory = new QDir(QString("/etc/netctl/"));
if (settings.contains(QString("SUDO_PATH")))
sudoCommand = settings[QString("SUDO_PATH")];
else
sudoCommand = QString("/usr/bin/kdesu");
if (settings.contains(QString("SYSTEMCTL_PATH")))
systemctlCommand = settings[QString("SYSTEMCTL_PATH")];
else
systemctlCommand = QString("/usr/bin/systemctl");
}
/**
* @fn ~Netctl
*/
Netctl::~Netctl()
{
if (debug) qDebug() << "[Netctl]" << "[~Netctl]";
if (ifaceDirectory != 0)
delete ifaceDirectory;
if (profileDirectory != 0)
delete profileDirectory;
}
// functions
/**
* @fn getNetctlOutput
*/
QString Netctl::getNetctlOutput(const bool sudo, const QString commandLine, const QString profile)
{
if (debug) qDebug() << "[Netctl]" << "[getNetctlOutput]";
if (debug) qDebug() << "[Netctl]" << "[getNetctlOutput]" << ":" << "Command" << commandLine;
if (debug) qDebug() << "[Netctl]" << "[getNetctlOutput]" << ":" << "Profile" << profile;
if (netctlCommand == 0) {
if (debug) qDebug() << "[Netctl]" << "[getNetctlOutput]" << ":" << "Could not find netctl";
return QString();
}
if ((sudo) && (sudoCommand == 0)) {
if (debug) qDebug() << "[Netctl]" << "[getNetctlOutput]" << ":" << "Could not find sudo";
return QString();
}
QProcess command;
QString commandText;
if (sudo)
commandText = sudoCommand + QString(" ") + netctlCommand + QString(" ") + commandLine +
QString(" ") + profile;
else
commandText = netctlCommand + QString(" ") + commandLine + QString(" ") + profile;
if (debug) qDebug() << "[Netctl]" << "[getNetctlOutput]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
return command.readAllStandardOutput();
}
/**
* @fn getWifiInterface
*/
QString Netctl::getWifiInterface()
{
if (debug) qDebug() << "[Netctl]" << "[getInterfaceList]";
if (ifaceDirectory == 0) {
if (debug) qDebug() << "[Netctl]" << "[getInterfaceList]" << ":" << "Could not find directory";
return QString();
}
QStringList interfaces;
if (!mainInterface.isEmpty())
interfaces.append(mainInterface);
QStringList allInterfaces = ifaceDirectory->entryList(QDir::Dirs | QDir::NoDotAndDotDot);
for (int i=0; i<allInterfaces.count(); i++) {
if (debug) qDebug() << "[Netctl]" << "[getInterfaceList]" << ":" << "Check directory"
<< ifaceDirectory->path() + QDir::separator() + allInterfaces[i] + QDir::separator() + QString("wireless");
if (QDir(ifaceDirectory->path() + QDir::separator() + allInterfaces[i] +
QDir::separator() + QString("wireless")).exists())
interfaces.append(allInterfaces[i]);
}
return interfaces[0];
}
/**
* @fn netctlCall
*/
bool Netctl::netctlCall(const bool sudo, const QString commandLine, const QString profile)
{
if (debug) qDebug() << "[Netctl]" << "[netctlCall]";
if (debug) qDebug() << "[Netctl]" << "[netctlCall]" << ":" << "Command" << commandLine;
if (debug) qDebug() << "[Netctl]" << "[netctlCall]" << ":" << "Profile" << profile;
if (netctlCommand == 0) {
if (debug) qDebug() << "[Netctl]" << "[netctlCall]" << ":" << "Could not find netctl";
return false;
}
if ((sudo) && (sudoCommand == 0)) {
if (debug) qDebug() << "[Netctl]" << "[netctlCall]" << ":" << "Could not find sudo";
return false;
}
QProcess command;
QString commandText;
if (sudo)
commandText = sudoCommand + QString(" ") + netctlCommand + QString(" ") + commandLine +
QString(" ") + profile;
else
commandText = netctlCommand + QString(" ") + commandLine + QString(" ") + profile;
if (debug) qDebug() << "[Netctl]" << "[netctlCall]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
if (debug) qDebug() << "[Netctl]" << "[netctlCall]" << ":" << "Cmd returns" << command.exitCode();
if (command.exitCode() == 0)
return true;
else
return false;
}
/**
* @fn netctlAutoCall
*/
bool Netctl::netctlAutoCall(const bool sudo, const QString commandLine, const QString profile)
{
if (debug) qDebug() << "[Netctl]" << "[netctlAutoCall]";
if (debug) qDebug() << "[Netctl]" << "[netctlAutoCall]" << ":" << "Command" << commandLine;
if (debug) qDebug() << "[Netctl]" << "[netctlAutoCall]" << ":" << "Profile" << profile;
if (netctlAutoCommand == 0) {
if (debug) qDebug() << "[Netctl]" << "[netctlAutoCall]" << ":" << "Could not find netctl-auto";
return false;
}
if ((sudo) && (sudoCommand == 0)) {
if (debug) qDebug() << "[Netctl]" << "[netctlAutoCall]" << ":" << "Could not find sudo";
return false;
}
QProcess command;
QString commandText;
if (sudo)
commandText = sudoCommand + QString(" ") + netctlAutoCommand + QString(" ") + commandLine;
else
commandText = netctlAutoCommand + QString(" ") + commandLine;
if (profile != 0)
commandText = commandText + QString(" ") + profile;
if (debug) qDebug() << "[Netctl]" << "[netctlAutoCall]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
if (debug) qDebug() << "[Netctl]" << "[netctlAutoCall]" << ":" << "Cmd returns" << command.exitCode();
if (command.exitCode() == 0)
return true;
else
return false;
}
/**
* @fn systemctlCall
*/
bool Netctl::systemctlCall(const bool sudo, const QString commandLine)
{
if (debug) qDebug() << "[Netctl]" << "[systemctlCall]";
if (debug) qDebug() << "[Netctl]" << "[systemctlCall]" << ":" << "Command" << commandLine;
if (netctlAutoService == 0) {
if (debug) qDebug() << "[Netctl]" << "[systemctlCall]" << ":" << "Could not find service";
return false;
}
if ((sudo) && (sudoCommand == 0)) {
if (debug) qDebug() << "[Netctl]" << "[systemctlCall]" << ":" << "Could not find sudo";
return false;
}
if (systemctlCommand == 0) {
if (debug) qDebug() << "[Netctl]" << "[systemctlCall]" << ":" << "Could not find systemctl";
return false;
}
QProcess command;
QString commandText;
QString interface = getWifiInterface();
if (sudo)
commandText = sudoCommand + QString(" ") + systemctlCommand + QString(" ") + commandLine +
QString(" ") + netctlAutoService + QString("@") + interface + QString(".service");
else
commandText = systemctlCommand + QString(" ") + commandLine + QString(" ") + netctlAutoService +
QString("@") + interface + QString(".service");
if (debug) qDebug() << "[Netctl]" << "[systemctlCall]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
if (debug) qDebug() << "[Netctl]" << "[systemctlCall]" << ":" << "Cmd returns" << command.exitCode();
if (command.exitCode() == 0)
return true;
else
return false;
}
// general information
/**
* @fn getProfileList
*/
QList<QStringList> Netctl::getProfileList()
{
if (debug) qDebug() << "[Netctl]" << "[getProfileList]";
if (profileDirectory == 0) {
if (debug) qDebug() << "[Netctl]" << "[getProfileList]" << ":" << "Could not find directory";
return QList<QStringList>();
}
QList<QStringList> fullProfilesInfo;
QStringList profiles = profileDirectory->entryList(QDir::Files);
QStringList descriptions = getProfileDescriptions(profiles);
QStringList statuses = getProfileStatuses(profiles);
for (int i=0; i<profiles.count(); i++) {
QStringList profileInfo;
profileInfo.append(profiles[i]);
profileInfo.append(descriptions[i]);
profileInfo.append(statuses[i]);
fullProfilesInfo.append(profileInfo);
}
return fullProfilesInfo;
}
/**
* @fn getProfileListFromNetctlAuto
*/
QList<QStringList> Netctl::getProfileListFromNetctlAuto()
{
if (debug) qDebug() << "[Netctl]" << "[getProfileListFromNetctlAuto]";
if (netctlAutoCommand == 0) {
if (debug) qDebug() << "[Netctl]" << "[getProfileListFromNetctlAuto]" << ":" << "Could not find netctl-auto";
return QList<QStringList>();
}
QProcess command;
QString commandText = netctlAutoCommand + QString(" list");
if (debug) qDebug() << "[Netctl]" << "[getProfileListFromNetctlAuto]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
QStringList output = QString(command.readAllStandardOutput()).split(QChar('\n'), QString::SkipEmptyParts);
QList<QStringList> fullProfilesInfo;
for (int i=0; i<output.count(); i++) {
QStringList profileInfo;
profileInfo.append(output[i].mid(2, -1));
profileInfo.append(getProfileDescription(profileInfo[0]));
profileInfo.append(output[i].left(1));
fullProfilesInfo.append(profileInfo);
}
return fullProfilesInfo;
}
/**
* @fn getProfileDescription
*/
QString Netctl::getProfileDescription(const QString profileName)
{
if (debug) qDebug() << "[Netctl]" << "[getProfileDescription]";
if (debug) qDebug() << "[Netctl]" << "[getProfileDescription]" << ":" << "Profile" << profileName;
if (profileDirectory == 0) {
if (debug) qDebug() << "[Netctl]" << "[getProfileDescription]" << ":" << "Could not find directory";
return QString();
}
QString description = QString("<unknown>");
QString profileUrl = profileDirectory->absolutePath() + QDir::separator() + profileName;
if (debug) qDebug() << "[Netctl]" << "[getProfileDescription]" << ":" << "Check" << profileUrl;
QFile profile(profileUrl);
QString fileStr;
if (!profile.open(QIODevice::ReadOnly))
return description;
while (true) {
fileStr = QString(profile.readLine());
if (fileStr[0] == QChar('#')) continue;
if (fileStr.split(QChar('='), QString::SkipEmptyParts).count() == 2)
if (fileStr.split(QChar('='), QString::SkipEmptyParts)[0] == QString("Description"))
description = fileStr.split(QChar('='), QString::SkipEmptyParts)[1].trimmed();
if (profile.atEnd())
break;
}
description.remove(QChar('\'')).remove(QChar('"'));
return description;
}
/**
* @fn getProfileDescriptions
*/
QStringList Netctl::getProfileDescriptions(const QStringList profileList)
{
if (debug) qDebug() << "[Netctl]" << "[getProfileDescriptions]";
if (debug) qDebug() << "[Netctl]" << "[getProfileDescriptions]" << ":" << "Profile list" << profileList;
if (profileDirectory == 0) {
if (debug) qDebug() << "[Netctl]" << "[getProfileDescriptions]" << ":" << "Could not find directory";
return QStringList();
}
QStringList descriptions;
for (int i=0; i<profileList.count(); i++) {
QString description = QString("<unknown>");
QString profileUrl = profileDirectory->absolutePath() + QDir::separator() + profileList[i];
if (debug) qDebug() << "[Netctl]" << "[getProfileDescriptions]" << ":" << "Check" << profileUrl;
QFile profile(profileUrl);
QString fileStr;
if (!profile.open(QIODevice::ReadOnly)) {
descriptions.append(description);
continue;
}
while (true) {
fileStr = QString(profile.readLine());
if (fileStr[0] == QChar('#')) continue;
if (fileStr.split(QChar('='), QString::SkipEmptyParts).count() == 2)
if (fileStr.split(QChar('='), QString::SkipEmptyParts)[0] == QString("Description"))
description = fileStr.split(QChar('='), QString::SkipEmptyParts)[1].trimmed();
if (profile.atEnd())
break;
}
description.remove(QChar('\'')).remove(QChar('"'));
descriptions.append(description);
}
return descriptions;
}
/**
* @fn getProfileStatus
*/
QString Netctl::getProfileStatus(const QString profile)
{
if (debug) qDebug() << "[Netctl]" << "[getProfileStatus]";
if (debug) qDebug() << "[Netctl]" << "[getProfileStatus]" << ":" << "Profile" << profile;
QString status;
if (isProfileActive(profile))
status = QString("active");
else
status = QString("inactive");
if (isProfileEnabled(profile))
status = status + QString(" (enabled)");
else
status = status + QString(" (static)");
return status;
}
/**
* @fn getProfileStatuses
*/
QStringList Netctl::getProfileStatuses(const QStringList profileList)
{
if (debug) qDebug() << "[Netctl]" << "[getProfileStatuses]";
if (debug) qDebug() << "[Netctl]" << "[getProfileStatuses]" << ":" << "Profile list" << profileList;
QStringList statuses;
for (int i=0; i<profileList.count(); i++) {
QString status;
if (isProfileActive(profileList[i]))
status = QString("active");
else
status = QString("inactive");
if (isProfileEnabled(profileList[i]))
status = status + QString(" (enabled)");
else
status = status + QString(" (static)");
statuses.append(status);
}
return statuses;
}
/**
* @fn getSsidFromProfile
*/
QString Netctl::getSsidFromProfile(const QString profile)
{
if (debug) qDebug() << "[Netctl]" << "[getSsidFromProfile]";
if (debug) qDebug() << "[Netctl]" << "[getSsidFromProfile]" << ":" << "Profile" << profile;
if (profileDirectory == 0) {
if (debug) qDebug() << "[Netctl]" << "[getSsidFromProfile]" << ":" << "Could not find directory";
return QString();
}
QString ssidName;
QString profileUrl = profileDirectory->absolutePath() + QDir::separator() + profile;
if (debug) qDebug() << "[Netctl]" << "[getSsidFromProfile]" << ":" << "Check" << profileUrl;
QFile profileFile(profileUrl);
QString fileStr;
if (!profileFile.open(QIODevice::ReadOnly))
return ssidName;
while (true) {
fileStr = QString(profileFile.readLine());
if (fileStr[0] == QChar('#')) continue;
if (fileStr.split(QChar('='), QString::SkipEmptyParts).count() == 2)
if (fileStr.split(QChar('='), QString::SkipEmptyParts)[0] == QString("ESSID"))
ssidName = fileStr.split(QChar('='), QString::SkipEmptyParts)[1].trimmed();
if (profileFile.atEnd())
break;
}
profileFile.close();
ssidName.remove(QChar('\'')).remove(QChar('"'));
return ssidName;
}
/**
* @fn isProfileActive
*/
bool Netctl::isProfileActive(const QString profile)
{
if (debug) qDebug() << "[Netctl]" << "[isProfileActive]";
if (debug) qDebug() << "[Netctl]" << "[isProfileActive]" << ":" << "Profile" << profile;
bool status = false;
QString cmdOutput = getNetctlOutput(false, QString("status"), profile);
if (cmdOutput.contains(QString("Active: active")))
status = true;
return status;
}
/**
* @fn isProfileEnabled
*/
bool Netctl::isProfileEnabled(const QString profile)
{
if (debug) qDebug() << "[Netctl]" << "[isProfileEnabled]";
if (debug) qDebug() << "[Netctl]" << "[isProfileEnabled]" << ":" << "Profile" << profile;
return netctlCall(false, QString("is-enabled"), profile);
}
/**
* @fn autoIsProfileActive
*/
bool Netctl::autoIsProfileActive(const QString profile)
{
if (debug) qDebug() << "[Netctl]" << "[autoIsProfileActive]";
if (debug) qDebug() << "[Netctl]" << "[autoIsProfileActive]" << ":" << "Profile" << profile;
bool status = false;
QList<QStringList> profiles = getProfileListFromNetctlAuto();
for (int i=0; i<profiles.count(); i++)
if ((profiles[i][0] == profile) && (profiles[i][2] == QString("*"))) {
status = true;
break;
}
return status;
}
/**
* @fn autoIsProfileEnabled
*/
bool Netctl::autoIsProfileEnabled(const QString profile)
{
if (debug) qDebug() << "[Netctl]" << "[autoIsProfileEnabled]";
if (debug) qDebug() << "[Netctl]" << "[autoIsProfileEnabled]" << ":" << "Profile" << profile;
bool status = true;
QList<QStringList> profiles = getProfileListFromNetctlAuto();
for (int i=0; i<profiles.count(); i++)
if ((profiles[i][0] == profile) && (profiles[i][2] == QString("!"))) {
status = false;
break;
}
return status;
}
/**
* @fn isNetctlAutoEnabled
*/
bool Netctl::isNetctlAutoEnabled()
{
if (debug) qDebug() << "[Netctl]" << "[isNetctlAutoEnabled]";
if (netctlAutoService == 0) {
if (debug) qDebug() << "[Netctl]" << "[isNetctlAutoEnabled]" << ":" << "Could not find service";
return false;
}
if (systemctlCommand == 0) {
if (debug) qDebug() << "[Netctl]" << "[isNetctlAutoEnabled]" << ":" << "Could not find systemctl";
return false;
}
QProcess command;
QString interface = getWifiInterface();
QString commandText = systemctlCommand + QString(" is-enabled ") + netctlAutoService + QString("@") +
interface + QString(".service");
if (debug) qDebug() << "[Netctl]" << "[isNetctlAutoEnabled]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
if (debug) qDebug() << "[Netctl]" << "[isNetctlAutoEnabled]" << ":" << "Cmd returns" << command.exitCode();
QString output = command.readAllStandardOutput().trimmed();
if (output == QString("enabled"))
return true;
else
return false;
}
/**
* @fn isNetctlAutoRunning
*/
bool Netctl::isNetctlAutoRunning()
{
if (debug) qDebug() << "[Netctl]" << "[isNetctlAutoRunning]";
if (netctlAutoService == 0) {
if (debug) qDebug() << "[Netctl]" << "[isNetctlAutoRunning]" << ":" << "Could not find service";
return false;
}
if (systemctlCommand == 0) {
if (debug) qDebug() << "[Netctl]" << "[isNetctlAutoRunning]" << ":" << "Could not find systemctl";
return false;
}
QString interface = getWifiInterface();
QProcess command;
QString commandText = systemctlCommand + QString(" is-active ") + netctlAutoService + QString("@") +
interface + QString(".service");
if (debug) qDebug() << "[Netctl]" << "[isNetctlAutoRunning]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
if (debug) qDebug() << "[Netctl]" << "[isNetctlAutoRunning]" << ":" << "Cmd returns" << command.exitCode();
QString output = command.readAllStandardOutput().trimmed();
if (output == QString("active"))
return true;
else
return false;
}
// functions
/**
* @fn enableProfile
*/
bool Netctl::enableProfile(const QString profile)
{
if (debug) qDebug() << "[Netctl]" << "[enableProfile]";
if (debug) qDebug() << "[Netctl]" << "[enableProfile]" << ":" << "Profile" << profile;
if (isProfileEnabled(profile))
return netctlCall(true, QString("disable"), profile);
else
return netctlCall(true, QString("enable"), profile);
}
/**
* @fn restartProfile
*/
bool Netctl::restartProfile(const QString profile)
{
if (debug) qDebug() << "[Netctl]" << "[restartProfile]";
if (debug) qDebug() << "[Netctl]" << "[restartProfile]" << ":" << "Profile" << profile;
return netctlCall(true, QString("restart"), profile);
}
/**
* @fn startProfile
*/
bool Netctl::startProfile(const QString profile)
{
if (debug) qDebug() << "[Netctl]" << "[startProfile]";
if (debug) qDebug() << "[Netctl]" << "[startProfile]" << ":" << "Profile" << profile;
if (isProfileActive(profile))
return netctlCall(true, QString("stop"), profile);
else
return netctlCall(true, QString("start"), profile);
}
/**
* @fn autoDisableAllProfiles
*/
bool Netctl::autoDisableAllProfiles()
{
if (debug) qDebug() << "[Netctl]" << "[autoDisableAllProfiles]";
return netctlAutoCall(false, QString("disable-all"));
}
/**
* @fn autoEnableProfile
*/
bool Netctl::autoEnableProfile(const QString profile)
{
if (debug) qDebug() << "[Netctl]" << "[autoEnableProfile]";
if (debug) qDebug() << "[Netctl]" << "[autoEnableProfile]" << ":" << "Profile" << profile;
if (autoIsProfileEnabled(profile))
return netctlAutoCall(false, QString("disable"), profile);
else
return netctlAutoCall(false, QString("enable"), profile);
}
/**
* @fn autoEnableAllProfiles
*/
bool Netctl::autoEnableAllProfiles()
{
if (debug) qDebug() << "[Netctl]" << "[autoEnableAllProfiles]";
return netctlAutoCall(false, QString("enable-all"));
}
/**
* @fn autoStartProfile
*/
bool Netctl::autoStartProfile(const QString profile)
{
if (debug) qDebug() << "[Netctl]" << "[autoStartProfile]";
if (debug) qDebug() << "[Netctl]" << "[autoStartProfile]" << ":" << "Profile" << profile;
if (autoIsProfileActive(profile))
return true;
else
return netctlAutoCall(false, QString("switch-to"), profile);
}
/**
* @fn autoEnableService
*/
bool Netctl::autoEnableService()
{
if (debug) qDebug() << "[Netctl]" << "[autoEnableService]";
if (isNetctlAutoEnabled())
return systemctlCall(true, QString("disable"));
else
return systemctlCall(true, QString("enable"));
}
/**
* @fn autoRestartService
*/
bool Netctl::autoRestartService()
{
if (debug) qDebug() << "[Netctl]" << "[autoRestartService]";
if (isNetctlAutoRunning())
return systemctlCall(true, QString("restart"));
else
return true;
}
/**
* @fn autoStartService
*/
bool Netctl::autoStartService()
{
if (debug) qDebug() << "[Netctl]" << "[autoStartService]";
if (isNetctlAutoRunning())
return systemctlCall(true, QString("stop"));
else
return systemctlCall(true, QString("start"));
}

View File

@ -0,0 +1,216 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
/**
* @file netctlprofile.cpp
* Source code of netctlgui library
* @author Evgeniy Alekseev
* @copyright GPLv3
* @bug https://github.com/arcan1s/netctl-gui/issues
*/
#include <QDebug>
#include <QFile>
#include <QFileInfo>
#include <QProcess>
#include <QTextStream>
#include <netctlgui/netctlprofile.h>
/**
* @class NetctlProfile
*/
/**
* @fn NetctlProfile
*/
NetctlProfile::NetctlProfile(const bool debugCmd, const QMap<QString, QString> settings)
: debug(debugCmd)
{
if (settings.contains(QString("PROFILE_DIR")))
profileDirectory = new QDir(settings[QString("PROFILE_DIR")]);
else
profileDirectory = new QDir(QString("/etc/netctl/"));
if (settings.contains(QString("SUDO_PATH")))
sudoCommand = settings[QString("SUDO_PATH")];
else
sudoCommand = QString("/usr/bin/kdesu");
}
/**
* @fn ~NetctlProfile
*/
NetctlProfile::~NetctlProfile()
{
if (debug) qDebug() << "[NetctlProfile]" << "[~NetctlProfile]";
if (profileDirectory != 0)
delete profileDirectory;
}
/**
* @fn copyProfile
*/
bool NetctlProfile::copyProfile(const QString oldPath)
{
if (debug) qDebug() << "[NetctlProfile]" << "[copyProfile]";
if (debug) qDebug() << "[NetctlProfile]" << "[copyProfile]" << ":" << "Path" << oldPath;
if (profileDirectory == 0) {
if (debug) qDebug() << "[NetctlProfile]" << "[profileDirectory]" << ":" << "Could not find directory";
return false;
}
if (sudoCommand == 0) {
if (debug) qDebug() << "[NetctlProfile]" << "[profileDirectory]" << ":" << "Could not find sudo";
return false;
}
QProcess command;
QString newPath = profileDirectory->absolutePath() + QDir::separator() + QFileInfo(oldPath).fileName();
QString commandText = sudoCommand + QString(" /usr/bin/mv ") + oldPath + QString(" ") + newPath;
if (debug) qDebug() << "[NetctlProfile]" << "[copyProfile]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
if (command.exitCode() == 0)
return true;
else
return false;
}
/**
* @fn createProfile
*/
QString NetctlProfile::createProfile(const QString profile, const QMap<QString, QString> settings)
{
if (debug) qDebug() << "[NetctlProfile]" << "[createProfile]";
if (debug) qDebug() << "[NetctlProfile]" << "[createProfile]" << ":" << "Profile" << profile;
QString profileTempName = QDir::homePath() + QDir::separator() +
QString(".cache") + QDir::separator() + QFileInfo(profile).fileName();
QFile profileFile(profileTempName);
if (debug) qDebug() << "[NetctlProfile]" << "[createProfile]" << ":" << "Save to" << profileTempName;
if (!profileFile.open(QIODevice::WriteOnly | QIODevice::Text))
return profileTempName;
QTextStream out(&profileFile);
for (int i=0; i<settings.keys().count(); i++) {
out << settings.keys()[i] << QString("=");
if ((settings.keys()[i] == QString("BindsToInterfaces")) ||
(settings.keys()[i] == QString("After")) ||
(settings.keys()[i] == QString("Address")) ||
(settings.keys()[i] == QString("Routes")) ||
(settings.keys()[i] == QString("Address6")) ||
(settings.keys()[i] == QString("Routes6")) ||
(settings.keys()[i] == QString("IPCustom")) ||
(settings.keys()[i] == QString("DNS")) ||
(settings.keys()[i] == QString("DNSOptions")) ||
(settings.keys()[i] == QString("ScanFrequencies")) ||
(settings.keys()[i] == QString("WPAConfigSection")))
out << QString("(") + settings[settings.keys()[i]] << QString(")") << endl;
else
out << settings[settings.keys()[i]] << endl;
}
profileFile.close();
return profileTempName;
}
/**
* @fn getSettingsFromProfile
*/
QMap<QString, QString> NetctlProfile::getSettingsFromProfile(const QString profile)
{
if (debug) qDebug() << "[NetctlProfile]" << "[getSettingsFromProfile]";
if (debug) qDebug() << "[NetctlProfile]" << "[getSettingsFromProfile]" << ":" << "Profile" << profile;
if (profileDirectory == 0) {
if (debug) qDebug() << "[NetctlProfile]" << "[getSettingsFromProfile]" << ":" << "Could not find directory";
return QMap<QString, QString>();
}
// getting variables list
// system variables
QProcess shell;
QString cmd = QString("env -i bash -c \"set\"");
if (debug) qDebug() << "[NetctlProfile]" << "[getSettingsFromProfile]" << ":" << "Run cmd" << cmd;
shell.start(cmd);
shell.waitForFinished(-1);
if (debug) qDebug() << "[NetctlProfile]" << "[getSettingsFromProfile]" << ":" << "Cmd returns" << shell.exitCode();
QStringList output = QString(shell.readAllStandardOutput()).trimmed().split(QChar('\n'));
QStringList systemVariables;
systemVariables.append(QString("PIPESTATUS"));
for (int i=0; i<output.count(); i++)
systemVariables.append(output[i].split(QChar('='))[0]);
// profile variables
QMap<QString, QString> settings;
QString profileUrl = profileDirectory->absolutePath() + QDir::separator() + QFileInfo(profile).fileName();
cmd = QString("env -i bash -c \"source ") + profileUrl + QString("; set\"");
if (debug) qDebug() << "[NetctlProfile]" << "[getSettingsFromProfile]" << ":" << "Run cmd" << cmd;
shell.start(cmd);
shell.waitForFinished(-1);
if (debug) qDebug() << "[NetctlProfile]" << "[getSettingsFromProfile]" << ":" << "Cmd returns" << shell.exitCode();
output = QString(shell.readAllStandardOutput()).trimmed().split(QChar('\n'));
// gettings variables
QStringList keys;
for (int i=0; i<output.count(); i++)
if (!systemVariables.contains(output[i].split(QChar('='))[0]))
keys.append(output[i].split(QChar('='))[0]);
for (int i=0; i<keys.count(); i++){
cmd = QString("env -i bash -c \"source ") + profileUrl +
QString("; for i in ${!") + keys[i] + QString("[@]}; do echo ${") +
keys[i] + QString("[$i]}; done\"");
shell.start(cmd);
shell.waitForFinished(-1);
settings[keys[i]] = shell.readAllStandardOutput().trimmed();
if (debug) qDebug() << "[NetctlProfile]" << "[getSettingsFromProfile]" << ":" << keys[i] << "=" << settings[keys[i]];
}
return settings;
}
/**
* @fn removeProfile
*/
bool NetctlProfile::removeProfile(const QString profile)
{
if (debug) qDebug() << "[NetctlProfile]" << "[removeProfile]";
if (debug) qDebug() << "[NetctlProfile]" << "[removeProfile]" << ":" << "Profile" << profile;
if (profileDirectory == 0) {
if (debug) qDebug() << "[NetctlProfile]" << "[removeProfile]" << ":" << "Could not find directory";
return false;
}
if (sudoCommand == 0) {
if (debug) qDebug() << "[NetctlProfile]" << "[removeProfile]" << ":" << "Could not find sudo";
return false;
}
QProcess command;
QString profilePath = profileDirectory->absolutePath() + QDir::separator() + QFileInfo(profile).fileName();
QString commandText = sudoCommand + QString(" /usr/bin/rm ") + profilePath;
if (debug) qDebug() << "[NetctlProfile]" << "[removeProfile]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
if (command.exitCode() == 0)
return true;
else
return false;
}

View File

@ -0,0 +1,389 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
/**
* @file wpasupinteract.cpp
* Source code of netctlgui library
* @author Evgeniy Alekseev
* @copyright GPLv3
* @bug https://github.com/arcan1s/netctl-gui/issues
*/
#include <QDebug>
#include <QProcess>
#include <netctlgui/netctlinteract.h>
#include <netctlgui/sleepthread.h>
#include <netctlgui/wpasupinteract.h>
/**
* @class WpaSup
*/
/**
* @fn WpaSup
*/
WpaSup::WpaSup(const bool debugCmd, const QMap<QString, QString> settings)
: debug(debugCmd)
{
netctlCommand = new Netctl(debug, settings);
if (settings.contains(QString("CTRL_DIR")))
ctrlDir = settings[QString("CTRL_DIR")];
else
ctrlDir = QString("/run/wpa_supplicant_netctl-gui");
if (settings.contains(QString("CTRL_GROUP")))
ctrlGroup = settings[QString("CTRL_GROUP")];
else
ctrlGroup = QString("users");
if (settings.contains(QString("IFACE_DIR")))
ifaceDirectory = new QDir(settings[QString("IFACE_DIR")]);
else
ifaceDirectory = new QDir(QString("/sys/class/net/"));
if (settings.contains(QString("PREFERED_IFACE")))
mainInterface = settings[QString("PREFERED_IFACE")];
else
mainInterface = QString("");
if (settings.contains(QString("PID_FILE")))
pidFile = settings[QString("PID_FILE")];
else
pidFile = QString("/run/wpa_supplicant_netctl-gui.pid");
if (settings.contains(QString("SUDO_PATH")))
sudoCommand = settings[QString("SUDO_PATH")];
else
sudoCommand = QString("/usr/bin/kdesu");
if (settings.contains(QString("WPACLI_PATH")))
wpaCliPath = settings[QString("WPACLI_PATH")];
else
wpaCliPath = QString("/usr/bin/wpa_cli");
if (settings.contains(QString("WPA_DRIVERS")))
wpaDrivers = settings[QString("WPA_DRIVERS")];
else
wpaDrivers = QString("nl80211,wext");
if (settings.contains(QString("WPASUP_PATH")))
wpaSupPath = settings[QString("WPASUP_PATH")];
else
wpaSupPath = QString("/usr/bin/wpa_supplicant");
// terminate old loaded profile
if (QFile(pidFile).exists() || QDir(ctrlDir).exists())
stopWpaSupplicant();
}
/**
* @fn ~WpaSup
*/
WpaSup::~WpaSup()
{
if (debug) qDebug() << "[WpaSup]" << "[~WpaSup]";
delete netctlCommand;
if (ifaceDirectory != 0)
delete ifaceDirectory;
}
// general information
/**
* @fn existentProfile
*/
QString WpaSup::existentProfile(const QString essid)
{
if (debug) qDebug() << "[WpaSup]" << "[existentProfile]";
if (debug) qDebug() << "[WpaSup]" << "[existentProfile]" << ":" << "ESSID" << essid;
QString profileFile = QString("");
QList<QStringList> profileList = netctlCommand->getProfileList();
for (int i=0; i<profileList.count(); i++)
if (essid == netctlCommand->getSsidFromProfile(profileList[i][0]))
profileFile = profileList[i][0];
return profileFile;
}
/**
* @fn getInterfaceList
*/
QStringList WpaSup::getInterfaceList()
{
if (debug) qDebug() << "[WpaSup]" << "[getInterfaceList]";
if (ifaceDirectory == 0) {
if (debug) qDebug() << "[WpaSup]" << "[getInterfaceList]" << ":" << "Could not find directory";
return QStringList();
}
QStringList interfaces;
if (!mainInterface.isEmpty())
interfaces.append(mainInterface);
QStringList allInterfaces = ifaceDirectory->entryList(QDir::Dirs | QDir::NoDotAndDotDot);
for (int i=0; i<allInterfaces.count(); i++) {
if (debug) qDebug() << "[WpaSup]" << "[getInterfaceList]" << ":" << "Check directory"
<< ifaceDirectory->path() + QDir::separator() + allInterfaces[i] + QDir::separator() + QString("wireless");
if (QDir(ifaceDirectory->path() + QDir::separator() + allInterfaces[i] +
QDir::separator() + QString("wireless")).exists())
interfaces.append(allInterfaces[i]);
}
return interfaces;
}
/**
* @fn isProfileActive
*/
bool WpaSup::isProfileActive(const QString essid)
{
if (debug) qDebug() << "[WpaSup]" << "[isProfileActive]";
if (debug) qDebug() << "[WpaSup]" << "[isProfileActive]" << ":" << "ESSID" << essid;
QString profileFile;
QList<QStringList> profileList = netctlCommand->getProfileList();
for (int i=0; i<profileList.count(); i++)
if (essid == netctlCommand->getSsidFromProfile(profileList[i][0])) {
profileFile = profileList[i][0];
break;
}
return netctlCommand->isProfileActive(profileFile);
}
/**
* @fn isProfileExists
*/
bool WpaSup::isProfileExists(const QString essid)
{
if (debug) qDebug() << "[WpaSup]" << "[isProfileExists]";
if (debug) qDebug() << "[WpaSup]" << "[isProfileExists]" << ":" << "ESSID" << essid;
bool exists = false;
QList<QStringList> profileList = netctlCommand->getProfileList();
for (int i=0; i<profileList.count(); i++)
if (essid == netctlCommand->getSsidFromProfile(profileList[i][0])) {
exists = true;
break;
}
return exists;
}
/**
* @fn scanWifi
*/
QList<QStringList> WpaSup::scanWifi()
{
if (debug) qDebug() << "[WpaSup]" << "[scanWifi]";
QList<QStringList> scanResults;
if (!startWpaSupplicant()) {
stopWpaSupplicant();
return scanResults;
}
if (!wpaCliCall(QString("scan")))
return scanResults;
SleepThread::sleep(3);
QStringList rawOutput = getWpaCliOutput(QString("scan_results")).split(QChar('\n'), QString::SkipEmptyParts);
// remove table header
rawOutput.removeFirst();
// remove duplicates
QStringList rawList;
for (int i=0; i<rawOutput.count(); i++) {
bool exist = false;
if (rawOutput[i].split(QChar('\t'), QString::SkipEmptyParts).count() > 4)
for (int j=0; j<rawList.count(); j++)
if (rawList[j].split(QChar('\t'), QString::SkipEmptyParts).count() > 4)
if (rawOutput[i].split(QChar('\t'), QString::SkipEmptyParts)[4] ==
rawList[j].split(QChar('\t'), QString::SkipEmptyParts)[4])
exist = true;
if (!exist)
rawList.append(rawOutput[i]);
}
for (int i=0; i<rawList.count(); i++) {
QStringList wifiPoint;
// point name
if (rawList[i].split(QChar('\t'), QString::SkipEmptyParts).count() > 4)
wifiPoint.append(rawList[i].split(QChar('\t'), QString::SkipEmptyParts)[4]);
else
wifiPoint.append(QString("<hidden>"));
// profile status
QString status;
if (isProfileExists(wifiPoint[0])) {
status = QString("exists");
if (isProfileActive(wifiPoint[0]))
status = status + QString(" (active)");
else
status = status + QString(" (inactive)");
}
else
status = QString("new");
wifiPoint.append(status);
// point signal
wifiPoint.append(rawList[i].split(QChar('\t'), QString::SkipEmptyParts)[2]);
// point security
QString security = rawList[i].split(QChar('\t'), QString::SkipEmptyParts)[3];
if (security.contains(QString("WPA2")))
security = QString("WPA2");
else if (security.contains(QString("WPA")))
security = QString("WPA");
else if (security.contains(QString("WEP")))
security = QString("WEP");
else
security = QString("none");
wifiPoint.append(security);
scanResults.append(wifiPoint);
}
stopWpaSupplicant();
return scanResults;
}
/**
* @fn startWpaSupplicant
*/
bool WpaSup::startWpaSupplicant()
{
if (debug) qDebug() << "[WpaSup]" << "[startWpaSupplicant]";
if (ctrlDir == 0) {
if (debug) qDebug() << "[WpaSup]" << "[startWpaSupplicant]" << ":" << "Could not find directory";
return false;
}
if (ctrlGroup == 0) {
if (debug) qDebug() << "[WpaSup]" << "[startWpaSupplicant]" << ":" << "Could not find group";
return false;
}
if (pidFile == 0) {
if (debug) qDebug() << "[WpaSup]" << "[startWpaSupplicant]" << ":" << "Could not find PID file";
return false;
}
if (sudoCommand == 0) {
if (debug) qDebug() << "[WpaSup]" << "[startWpaSupplicant]" << ":" << "Could not find sudo";
return false;
}
if (wpaDrivers == 0) {
if (debug) qDebug() << "[WpaSup]" << "[startWpaSupplicant]" << ":" << "Could not find drivers";
return false;
}
if (wpaSupPath == 0) {
if (debug) qDebug() << "[WpaSup]" << "[startWpaSupplicant]" << ":" << "Could not find wpa_supplicant";
return false;
}
if (QFile(pidFile).exists())
return true;
QProcess command;
QString interface = getInterfaceList()[0];
QString commandText = sudoCommand + QString(" ") + wpaSupPath + QString(" -B -P ") + pidFile +
QString(" -i ") + interface + QString(" -D ") + wpaDrivers +
QString(" -C \"DIR=") + ctrlDir + QString(" GROUP=") + ctrlGroup + QString("\"");
if (debug) qDebug() << "[WpaSup]" << "[startWpaSupplicant]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
SleepThread::sleep(1);
if (debug) qDebug() << "[WpaSup]" << "[startWpaSupplicant]" << ":" << "Cmd returns" << command.exitCode();
if (command.exitCode() == 0)
return true;
else
return false;
}
/**
* @fn stopWpaSupplicant
*/
bool WpaSup::stopWpaSupplicant()
{
if (debug) qDebug() << "[WpaSup]" << "[stopWpaSupplicant]";
return wpaCliCall(QString("terminate"));
}
// functions
/**
* @fn getWpaCliOutput
*/
QString WpaSup::getWpaCliOutput(const QString commandLine)
{
if (debug) qDebug() << "[WpaSup]" << "[getWpaCliOutput]";
if (debug) qDebug() << "[WpaSup]" << "[getWpaCliOutput]" << ":" << "Command" << commandLine;
if (ctrlDir == 0) {
if (debug) qDebug() << "[WpaSup]" << "[getWpaCliOutput]" << ":" << "Could not find directory";
return QString();
}
if (pidFile == 0) {
if (debug) qDebug() << "[WpaSup]" << "[getWpaCliOutput]" << ":" << "Could not find PID file";
return QString();
}
if (wpaCliPath == 0) {
if (debug) qDebug() << "[WpaSup]" << "[getWpaCliOutput]" << ":" << "Could not find wpa_cli";
return QString();
}
QProcess command;
QString interface = getInterfaceList()[0];
QString commandText = wpaCliPath + QString(" -i ") + interface + QString(" -p ") + ctrlDir +
QString(" -P ") + pidFile + QString(" ") + commandLine;
if (debug) qDebug() << "[WpaSup]" << "[getWpaCliOutput]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
return command.readAllStandardOutput();
}
/**
* @fn wpaCliCall
*/
bool WpaSup::wpaCliCall(const QString commandLine)
{
if (debug) qDebug() << "[WpaSup]" << "[wpaCliCall]";
if (debug) qDebug() << "[WpaSup]" << "[wpaCliCall]" << ":" << "Command" << commandLine;
if (ctrlDir == 0) {
if (debug) qDebug() << "[WpaSup]" << "[wpaCliCall]" << ":" << "Could not find directory";
return false;
}
if (pidFile == 0) {
if (debug) qDebug() << "[WpaSup]" << "[wpaCliCall]" << ":" << "Could not find PID file";
return false;
}
if (wpaCliPath == 0) {
if (debug) qDebug() << "[WpaSup]" << "[wpaCliCall]" << ":" << "Could not find wpa_cli";
return false;
}
QProcess command;
QString interface = getInterfaceList()[0];
QString commandText = wpaCliPath + QString(" -i ") + interface + QString(" -p ") + ctrlDir +
QString(" -P ") + pidFile + QString(" ") + commandLine;
if (debug) qDebug() << "[WpaSup]" << "[wpaCliCall]" << ":" << "Run cmd" << commandText;
command.start(commandText);
command.waitForFinished(-1);
SleepThread::sleep(1);
if (debug) qDebug() << "[WpaSup]" << "[wpaCliCall]" << ":" << "Cmd returns" << command.exitCode();
if (command.exitCode() == 0)
return true;
else
return false;
}

View File

@ -1,6 +1,8 @@
# set project name
set (SUBPROJECT plasma_applet_netctl)
message (STATUS "Subproject ${SUBPROJECT}")
# find resources
set (RESOURCES ${PROJECT_RESOURCE_DIR}/resources-plasmoid.qrc)
# find required libaries
find_package (KDE4 REQUIRED)
@ -23,8 +25,9 @@ file (GLOB SUBPROJECT_UI *.ui)
configure_file (${SUBPROJECT_DESKTOP_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP})
# make
qt4_add_resources (QRC_SOURCES ${RESOURCES})
kde4_add_ui_files (SUBPROJECT_SOURCE ${SUBPROJECT_UI})
kde4_add_plugin (${PLUGIN_NAME} ${SUBPROJECT_SOURCE})
kde4_add_plugin (${PLUGIN_NAME} ${SUBPROJECT_SOURCE} ${QRC_SOURCES})
target_link_libraries (${PLUGIN_NAME} ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS})
# install

1
sources/plasmoid/about.ui Symbolic link
View File

@ -0,0 +1 @@
../gui/src/about.ui

View File

@ -0,0 +1,419 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AppearanceWindow</class>
<widget class="QWidget" name="AppearanceWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>480</width>
<height>341</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>480</width>
<height>320</height>
</size>
</property>
<property name="windowTitle">
<string notr="true">Configuration Window</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="8" column="0">
<spacer name="verticalSpacer_appearance">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_inactiveIcon">
<item>
<widget class="QLabel" name="label_inactiveIcon">
<property name="minimumSize">
<size>
<width>80</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Inactive icon</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_inactiveIcon"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_inactiveIcon">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="layout_fontColor">
<item>
<widget class="QLabel" name="label_fontColor">
<property name="minimumSize">
<size>
<width>80</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Font color</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontColor">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KColorCombo" name="kcolorcombo_fontColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="toolTip">
<string>Set font color</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="0">
<widget class="Line" name="line_appearance">
<property name="lineWidth">
<number>5</number>
</property>
<property name="midLineWidth">
<number>5</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="layout_fontSize">
<item>
<widget class="QLabel" name="label_fontSize">
<property name="minimumSize">
<size>
<width>80</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Font size</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontSize">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox_fontSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="toolTip">
<string>Set font size</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>7</number>
</property>
<property name="maximum">
<number>48</number>
</property>
<property name="value">
<number>12</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="layout_fontWeight">
<item>
<widget class="QLabel" name="label_fontWeight">
<property name="minimumSize">
<size>
<width>80</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Font weight</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontWeight">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox_fontWeight">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="toolTip">
<string>Set font weight</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>300</number>
</property>
<property name="maximum">
<number>600</number>
</property>
<property name="singleStep">
<number>50</number>
</property>
<property name="value">
<number>400</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0">
<layout class="QHBoxLayout" name="layout_fontStyle">
<item>
<widget class="QLabel" name="label_fontStyle">
<property name="minimumSize">
<size>
<width>80</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Font style</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontStyle">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="comboBox_fontStyle">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="toolTip">
<string>Set font style</string>
</property>
<item>
<property name="text">
<string>normal</string>
</property>
</item>
<item>
<property name="text">
<string>italic</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="layout_font">
<item>
<widget class="QLabel" name="label_font">
<property name="minimumSize">
<size>
<width>80</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Font</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_font">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QFontComboBox" name="fontComboBox_font">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>180</width>
<height>23</height>
</size>
</property>
<property name="toolTip">
<string>Set font family</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="6" column="0">
<layout class="QHBoxLayout" name="layout_activeIcon">
<item>
<widget class="QLabel" name="label_activeIcon">
<property name="minimumSize">
<size>
<width>80</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Active icon</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_activeIcon"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_activeIcon">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KColorCombo</class>
<extends>QComboBox</extends>
<header>kcolorcombo.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>fontComboBox_font</tabstop>
<tabstop>spinBox_fontSize</tabstop>
<tabstop>kcolorcombo_fontColor</tabstop>
<tabstop>spinBox_fontWeight</tabstop>
<tabstop>comboBox_fontStyle</tabstop>
<tabstop>lineEdit_activeIcon</tabstop>
<tabstop>pushButton_activeIcon</tabstop>
<tabstop>lineEdit_inactiveIcon</tabstop>
<tabstop>pushButton_inactiveIcon</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@ -1,715 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ConfigWindow</class>
<widget class="QWidget" name="ConfigWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>480</width>
<height>343</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>480</width>
<height>320</height>
</size>
</property>
<property name="windowTitle">
<string notr="true">Configuration Window</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tabConfiguration">
<attribute name="title">
<string>Configuration</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_info">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="layout_autoUpdate">
<item>
<widget class="QLabel" name="label_autoUpdate">
<property name="minimumSize">
<size>
<width>150</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Auto update interval, msec</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_autoUpdate">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox_autoUpdate">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>333</number>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="singleStep">
<number>500</number>
</property>
<property name="value">
<number>1000</number>
</property>
</widget>
</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>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_netctl">
<item>
<widget class="QLabel" name="label_netctl">
<property name="minimumSize">
<size>
<width>80</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Path to netctl</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_netctl"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_netctl">
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_sudo">
<item>
<widget class="QCheckBox" name="checkBox_sudo">
<property name="minimumSize">
<size>
<width>150</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Use sudo for netctl</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_sudo"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_sudo">
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_wifi">
<item>
<widget class="QCheckBox" name="checkBox_wifi">
<property name="minimumSize">
<size>
<width>150</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Show 'Start WiFi menu'</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_wifi"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_wifi">
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBox_showBigInterface">
<property name="text">
<string>Show more detailed interface</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_showNetDev">
<property name="text">
<string>Show network devices</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_showExtIp">
<property name="text">
<string>Show external IP</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_showIntIp">
<property name="text">
<string>Show internal IP</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_configuration">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabAppearance">
<attribute name="title">
<string>Appearance</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="layout_font">
<item>
<widget class="QLabel" name="label_font">
<property name="minimumSize">
<size>
<width>80</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Font</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_font">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QFontComboBox" name="fontComboBox_font">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>180</width>
<height>23</height>
</size>
</property>
<property name="toolTip">
<string>Set font family</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_fontSize">
<item>
<widget class="QLabel" name="label_fontSize">
<property name="minimumSize">
<size>
<width>80</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Font size</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontSize">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox_fontSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="toolTip">
<string>Set font size</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>7</number>
</property>
<property name="maximum">
<number>48</number>
</property>
<property name="value">
<number>12</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_fontColor">
<item>
<widget class="QLabel" name="label_fontColor">
<property name="minimumSize">
<size>
<width>80</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Font color</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontColor">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KColorCombo" name="kcolorcombo_fontColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="toolTip">
<string>Set font color</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_fontWeight">
<item>
<widget class="QLabel" name="label_fontWeight">
<property name="minimumSize">
<size>
<width>80</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Font weight</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontWeight">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox_fontWeight">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="toolTip">
<string>Set font weight</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>300</number>
</property>
<property name="maximum">
<number>600</number>
</property>
<property name="singleStep">
<number>50</number>
</property>
<property name="value">
<number>400</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_fontStyle">
<item>
<widget class="QLabel" name="label_fontStyle">
<property name="minimumSize">
<size>
<width>80</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Font style</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_fontStyle">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="comboBox_fontStyle">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="toolTip">
<string>Set font style</string>
</property>
<item>
<property name="text">
<string>normal</string>
</property>
</item>
<item>
<property name="text">
<string>italic</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_appearance">
<property name="lineWidth">
<number>5</number>
</property>
<property name="midLineWidth">
<number>5</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="layout_activeIcon">
<item>
<widget class="QLabel" name="label_activeIcon">
<property name="minimumSize">
<size>
<width>80</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Active icon</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_activeIcon"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_activeIcon">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_inactiveIcon">
<item>
<widget class="QLabel" name="label_inactiveIcon">
<property name="minimumSize">
<size>
<width>80</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Inactive icon</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_inactiveIcon"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_inactiveIcon">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_appearance">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KColorCombo</class>
<extends>QComboBox</extends>
<header>kcolorcombo.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>spinBox_autoUpdate</tabstop>
<tabstop>lineEdit_gui</tabstop>
<tabstop>pushButton_gui</tabstop>
<tabstop>lineEdit_netctl</tabstop>
<tabstop>pushButton_netctl</tabstop>
<tabstop>checkBox_sudo</tabstop>
<tabstop>lineEdit_sudo</tabstop>
<tabstop>pushButton_sudo</tabstop>
<tabstop>checkBox_wifi</tabstop>
<tabstop>lineEdit_wifi</tabstop>
<tabstop>pushButton_wifi</tabstop>
<tabstop>checkBox_showBigInterface</tabstop>
<tabstop>checkBox_showNetDev</tabstop>
<tabstop>checkBox_showExtIp</tabstop>
<tabstop>checkBox_showIntIp</tabstop>
<tabstop>fontComboBox_font</tabstop>
<tabstop>spinBox_fontSize</tabstop>
<tabstop>kcolorcombo_fontColor</tabstop>
<tabstop>spinBox_fontWeight</tabstop>
<tabstop>comboBox_fontStyle</tabstop>
<tabstop>lineEdit_activeIcon</tabstop>
<tabstop>pushButton_activeIcon</tabstop>
<tabstop>lineEdit_inactiveIcon</tabstop>
<tabstop>pushButton_inactiveIcon</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,216 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DataEngineWindow</class>
<widget class="QWidget" name="DataEngineWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>480</width>
<height>337</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>480</width>
<height>320</height>
</size>
</property>
<property name="windowTitle">
<string notr="true">Configuration Window</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="layout_netctl">
<item>
<widget class="QLabel" name="label_netctl">
<property name="minimumSize">
<size>
<width>150</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Path to netctl</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_netctl"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_netctl">
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_netctlAuto">
<item>
<widget class="QLabel" name="label_netctlAuto">
<property name="minimumSize">
<size>
<width>150</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Path to netctl-auto</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_netctlAuto"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_netctlAuto">
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_ip">
<item>
<widget class="QLabel" name="label_ip">
<property name="minimumSize">
<size>
<width>150</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Path to ip</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_ip"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_ip">
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_interface">
<item>
<widget class="QLabel" name="label_interface">
<property name="minimumSize">
<size>
<width>150</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Path to interface list</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_interface"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_interface">
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_extIp">
<item>
<widget class="QCheckBox" name="checkBox_extIp">
<property name="minimumSize">
<size>
<width>150</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Check external IP</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_extIp"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_extIp">
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_dataengine">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<tabstops>
<tabstop>lineEdit_ip</tabstop>
<tabstop>lineEdit_netctl</tabstop>
<tabstop>pushButton_netctl</tabstop>
<tabstop>checkBox_extIp</tabstop>
<tabstop>lineEdit_extIp</tabstop>
<tabstop>pushButton_extIp</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@ -16,11 +16,14 @@
***************************************************************************/
#include "netctl.h"
#include "ui_configwindow.h"
#include <ui_appearance.h>
#include <ui_widget.h>
#include <KConfigDialog>
#include <KFileDialog>
#include <KGlobal>
#include <KNotification>
#include <KStandardDirs>
#include <KUrl>
#include <plasma/theme.h>
@ -44,13 +47,9 @@ Netctl::Netctl(QObject *parent, const QVariantList &args)
Netctl::~Netctl()
{
// delete startProfileMenu;
// delete startProfile;
// delete stopProfile;
// delete restartProfile;
// delete enableProfile;
// delete switchToProfileMenu;
// delete iconWidget;
// delete textLabel;
// delete netctlEngine;
}
@ -75,7 +74,7 @@ void Netctl::init()
// icon
iconWidget = new Plasma::IconWidget(KIcon(""), QString(), this);
iconWidget->setPreferredSize(30, 30);
connect(iconWidget, SIGNAL(doubleClicked()), this, SLOT(showGui()));
connect(iconWidget, SIGNAL(clicked()), this, SLOT(showGui()));
fullSpaceLayout->addItem(iconWidget);
// text
textLabel = new Plasma::Label();
@ -87,6 +86,74 @@ void Netctl::init()
}
QMap<QString, QString> Netctl::readDataEngineConfiguration()
{
QMap<QString, QString> rawConfig;
rawConfig[QString("CMD")] = QString("/usr/bin/netctl");
rawConfig[QString("EXTIP")] = QString("false");
rawConfig[QString("EXTIPCMD")] = QString("wget -qO- http://ifconfig.me/ip");
rawConfig[QString("IPCMD")] = QString("/usr/bin/ip");
rawConfig[QString("NETDIR")] = QString("/sys/class/net/");
rawConfig[QString("NETCTLAUTOCMD")] = QString("/usr/bin/netctl-auto");
QString fileName = KGlobal::dirs()->findResource("config", "netctl.conf");
QFile confFile(fileName);
if (!confFile.open(QIODevice::ReadOnly))
return updateConfiguration(rawConfig);
QString fileStr;
QStringList value;
while (true) {
fileStr = QString(confFile.readLine()).trimmed();
if (fileStr[0] == QChar('#')) continue;
if (fileStr[0] == QChar(';')) continue;
if (!fileStr.contains(QChar('='))) continue;
value.clear();
for (int i=1; i<fileStr.split(QChar('=')).count(); i++)
value.append(fileStr.split(QChar('='))[i]);
rawConfig[fileStr.split(QChar('='))[0]] = value.join(QChar('='));
if (confFile.atEnd())
break;
}
confFile.close();
return updateConfiguration(rawConfig);
}
void Netctl::writeDataEngineConfiguration(const QMap<QString, QString> settings)
{
QMap<QString, QString> config = updateConfiguration(settings);
QString fileName = KGlobal::dirs()->locateLocal("config", "netctl.conf");
QFile confFile(fileName);
if (!confFile.open(QIODevice::WriteOnly))
return;
for (int i=0; i<config.keys().count(); i++) {
QByteArray string = (config.keys()[i] + QString("=") + config[config.keys()[i]] + QString("\n")).toUtf8();
confFile.write(string);
}
confFile.close();
}
QMap<QString, QString> Netctl::updateConfiguration(const QMap<QString, QString> rawConfig)
{
QMap<QString, QString> config;
QString key, value;
// remove spaces and copy source map
for (int i=0; i<rawConfig.keys().count(); i++) {
key = rawConfig.keys()[i];
value = rawConfig[key];
key.remove(QChar(' '));
if ((key != QString("CMD")) &&
(key != QString("EXTIPCMD")) &&
(key != QString("IPCMD")) &&
(key != QString("NETCTLAUTOCMD")))
value.remove(QChar(' '));
config[key] = value;
}
return config;
}
void Netctl::updateInterface(bool setShown)
{
if (setShown) {
@ -126,21 +193,31 @@ void Netctl::enableProfileSlot()
void Netctl::startProfileSlot(QAction *profile)
{
bool ready = true;
QProcess command;
QString commandLine;
commandLine = QString("");
sendNotification(QString("Info"), i18n("Start profile %1", profile->text().remove(QString("&"))));
if (status)
commandLine = paths[QString("netctl")] + QString(" stop ") +
info[QString("name")] + QString(" && ");
if (useSudo)
commandLine = paths[QString("sudo")] + QString(" ") + commandLine +
paths[QString("netctl")] + QString(" start ") +
profile->text().remove(QString("&"));
else
commandLine = commandLine + paths[QString("netctl")] + QString(" start ") +
profile->text().remove(QString("&"));
command.startDetached(commandLine);
sendNotification(QString("Info"), i18n("Start profile %1", profile->text().remove(QChar('&'))));
if (status) {
if (useSudo)
commandLine = paths[QString("sudo")] + QString(" ") + paths[QString("netctl")] +
QString(" stop ") + info[QString("name")];
else
commandLine = paths[QString("netctl")] + QString(" stop ") + info[QString("name")];
command.start(commandLine);
command.waitForFinished(-1);
if (command.exitCode() != 0)
ready = false;
}
if (ready) {
if (useSudo)
commandLine = paths[QString("sudo")] + QString(" ") + paths[QString("netctl")] +
QString(" start ") + profile->text().remove(QChar('&'));
else
commandLine = paths[QString("netctl")] + QString(" start ") +
profile->text().remove(QChar('&'));
command.startDetached(commandLine);
}
}
@ -158,6 +235,18 @@ void Netctl::stopProfileSlot()
}
void Netctl::switchToProfileSlot(QAction *profile)
{
QProcess command;
QString commandLine;
commandLine = QString("");
sendNotification(QString("Info"), i18n("Switch to profile %1", profile->text().remove(QChar('&'))));
commandLine = paths[QString("netctl-auto")] + QString(" switch-to ") +
profile->text().remove(QChar('&'));
command.startDetached(commandLine);
}
void Netctl::restartProfileSlot()
{
QProcess command;
@ -174,35 +263,62 @@ void Netctl::restartProfileSlot()
QList<QAction*> Netctl::contextualActions()
{
if (status) {
contextMenu[QString("start")]->setText(i18n("Start another profile"));
contextMenu[QString("stop")]->setVisible(true);
contextMenu[QString("stop")]->setText(i18n("Stop ") + info[QString("name")]);
contextMenu[QString("restart")]->setVisible(true);
contextMenu[QString("restart")]->setText(i18n("Restart ") + info[QString("name")]);
contextMenu[QString("enable")]->setVisible(true);
if (info[QString("status")].contains(QString("enabled")))
contextMenu[QString("enable")]->setText(i18n("Disable ") + info[QString("name")]);
else
contextMenu[QString("enable")]->setText(i18n("Enable ") + info[QString("name")]);
}
else {
contextMenu[QString("start")]->setText(i18n("Start profile"));
if (status)
contextMenu[QString("title")]->setIcon(QIcon(paths[QString("active")]));
else
contextMenu[QString("title")]->setIcon(QIcon(paths[QString("inactive")]));
contextMenu[QString("title")]->setText(info[QString("name")] + QString(" ") + info[QString("status")]);
if (info[QString("status")] == QString("(netctl-auto)")) {
contextMenu[QString("start")]->setVisible(false);
contextMenu[QString("stop")]->setVisible(false);
contextMenu[QString("switch")]->setVisible(true);
contextMenu[QString("restart")]->setVisible(false);
contextMenu[QString("enable")]->setVisible(false);
switchToProfileMenu->clear();
for (int i=0; i<profileList.count(); i++) {
QAction *profile = new QAction(profileList[i], this);
switchToProfileMenu->addAction(profile);
}
}
else {
contextMenu[QString("start")]->setVisible(true);
contextMenu[QString("stop")]->setVisible(true);
contextMenu[QString("switch")]->setVisible(false);
contextMenu[QString("restart")]->setVisible(true);
contextMenu[QString("enable")]->setVisible(true);
if (status) {
contextMenu[QString("start")]->setText(i18n("Start another profile"));
contextMenu[QString("stop")]->setVisible(true);
contextMenu[QString("stop")]->setText(i18n("Stop %1", info[QString("name")]));
contextMenu[QString("restart")]->setVisible(true);
contextMenu[QString("restart")]->setText(i18n("Restart %1", info[QString("name")]));
contextMenu[QString("enable")]->setVisible(true);
if (info[QString("status")].contains(QString("enabled")))
contextMenu[QString("enable")]->setText(i18n("Disable %1", info[QString("name")]));
else
contextMenu[QString("enable")]->setText(i18n("Enable %1", info[QString("name")]));
}
else {
contextMenu[QString("start")]->setText(i18n("Start profile"));
contextMenu[QString("stop")]->setVisible(false);
contextMenu[QString("restart")]->setVisible(false);
contextMenu[QString("enable")]->setVisible(false);
}
startProfileMenu->clear();
for (int i=0; i<profileList.count(); i++) {
QAction *profile = new QAction(profileList[i], this);
startProfileMenu->addAction(profile);
}
}
if (useWifi)
contextMenu[QString("wifi")]->setVisible(true);
else
contextMenu[QString("wifi")]->setVisible(false);
startProfileMenu->clear();
for (int i=0; i<profileList.count(); i++) {
QAction *profile = new QAction(profileList[i], this);
startProfileMenu->addAction(profile);
}
return menuActions;
}
@ -211,7 +327,11 @@ void Netctl::createActions()
{
menuActions.clear();
contextMenu[QString("title")] = new QAction(QString("netctl-gui"), this);
menuActions.append(contextMenu[QString("title")]);
contextMenu[QString("start")] = new QAction(i18n("Start profile"), this);
contextMenu[QString("start")]->setIcon(QIcon::fromTheme("dialog-apply"));
startProfileMenu = new QMenu(NULL);
contextMenu[QString("start")]->setMenu(startProfileMenu);
connect(startProfileMenu, SIGNAL(triggered(QAction *)), this,
@ -219,10 +339,20 @@ void Netctl::createActions()
menuActions.append(contextMenu[QString("start")]);
contextMenu[QString("stop")] = new QAction(i18n("Stop profile"), this);
contextMenu[QString("stop")]->setIcon(QIcon::fromTheme("dialog-close"));
connect(contextMenu[QString("stop")], SIGNAL(triggered(bool)), this, SLOT(stopProfileSlot()));
menuActions.append(contextMenu[QString("stop")]);
contextMenu[QString("switch")] = new QAction(i18n("Switch to profile"), this);
contextMenu[QString("switch")]->setIcon(QIcon::fromTheme("dialog-apply"));
switchToProfileMenu = new QMenu(NULL);
contextMenu[QString("switch")]->setMenu(switchToProfileMenu);
connect(switchToProfileMenu, SIGNAL(triggered(QAction *)), this,
SLOT(switchToProfileSlot(QAction *)));
menuActions.append(contextMenu[QString("switch")]);
contextMenu[QString("restart")] = new QAction(i18n("Restart profile"), this);
contextMenu[QString("restart")]->setIcon(QIcon::fromTheme("stock-refresh"));
connect(contextMenu[QString("restart")], SIGNAL(triggered(bool)), this, SLOT(restartProfileSlot()));
menuActions.append(contextMenu[QString("restart")]);
@ -231,6 +361,7 @@ void Netctl::createActions()
menuActions.append(contextMenu[QString("enable")]);
contextMenu[QString("wifi")] = new QAction(i18n("Show WiFi menu"), this);
contextMenu[QString("wifi")]->setIcon(QIcon(":wifi"));
connect(contextMenu[QString("wifi")], SIGNAL(triggered(bool)), this, SLOT(showWifi()));
menuActions.append(contextMenu[QString("wifi")]);
}
@ -317,11 +448,11 @@ void Netctl::dataUpdated(const QString &sourceName, const Plasma::DataEngine::Da
info[QString("interfaces")] = value;
}
else if (sourceName == QString("profiles")) {
profileList = value.split(QString(","));
profileList = value.split(QChar(','));
}
else if (sourceName == QString("statusBool")) {
if (value == QString("true")) {
if (! status)
if (!status)
sendNotification(QString("Info"), i18n("Network is up"));
status = true;
iconWidget->setIcon(paths[QString("active")]);
@ -362,89 +493,143 @@ void Netctl::disconnectFromEngine()
// configuration interface
void Netctl::selectActiveIcon()
{
KUrl url = KFileDialog::getOpenUrl(KUrl(), "*");
KUrl url = KFileDialog::getOpenUrl(KUrl("/usr/bin"), "*");
if (!url.isEmpty())
uiConfig.lineEdit_activeIcon->setText(url.path());
uiAppConfig.lineEdit_activeIcon->setText(url.path());
}
void Netctl::selectGuiExe()
{
KUrl url = KFileDialog::getOpenUrl(KUrl(), "*");
KUrl url = KFileDialog::getOpenUrl(KUrl("/usr/bin"), "*");
if (!url.isEmpty())
uiConfig.lineEdit_gui->setText(url.path());
uiWidConfig.lineEdit_gui->setText(url.path());
}
void Netctl::selectInactiveIcon()
{
KUrl url = KFileDialog::getOpenUrl(KUrl(), "*");
KUrl url = KFileDialog::getOpenUrl(KUrl("/usr/bin"), "*");
if (!url.isEmpty())
uiConfig.lineEdit_inactiveIcon->setText(url.path());
uiAppConfig.lineEdit_inactiveIcon->setText(url.path());
}
void Netctl::selectNetctlExe()
{
KUrl url = KFileDialog::getOpenUrl(KUrl(), "*");
KUrl url = KFileDialog::getOpenUrl(KUrl("/usr/bin"), "*");
if (!url.isEmpty())
uiConfig.lineEdit_netctl->setText(url.path());
uiWidConfig.lineEdit_netctl->setText(url.path());
}
void Netctl::selectNetctlAutoExe()
{
KUrl url = KFileDialog::getOpenUrl(KUrl("/usr/bin"), "*");
if (!url.isEmpty())
uiWidConfig.lineEdit_netctlAuto->setText(url.path());
}
void Netctl::selectSudoExe()
{
KUrl url = KFileDialog::getOpenUrl(KUrl(), "*");
KUrl url = KFileDialog::getOpenUrl(KUrl("/usr/bin"), "*");
if (!url.isEmpty())
uiConfig.lineEdit_sudo->setText(url.path());
uiWidConfig.lineEdit_sudo->setText(url.path());
}
void Netctl::selectWifiExe()
{
KUrl url = KFileDialog::getOpenUrl(KUrl(), "*");
KUrl url = KFileDialog::getOpenUrl(KUrl("/usr/bin"), "*");
if (!url.isEmpty())
uiConfig.lineEdit_wifi->setText(url.path());
uiWidConfig.lineEdit_wifi->setText(url.path());
}
void Netctl::selectDataEngineExternalIpExe()
{
KUrl url = KFileDialog::getOpenUrl(KUrl("/usr/bin"), "*");
if (!url.isEmpty())
uiDEConfig.lineEdit_extIp->setText(url.path());
}
void Netctl::selectDataEngineInterfacesDirectory()
{
KUrl url = KFileDialog::getExistingDirectoryUrl(KUrl("/"));
if (!url.isEmpty())
uiDEConfig.lineEdit_interface->setText(url.path());
}
void Netctl::selectDataEngineIpExe()
{
KUrl url = KFileDialog::getOpenUrl(KUrl("/usr/bin"), "*");
if (!url.isEmpty())
uiDEConfig.lineEdit_ip->setText(url.path());
}
void Netctl::selectDataEngineNetctlExe()
{
KUrl url = KFileDialog::getOpenUrl(KUrl("/usr/bin"), "*");
if (!url.isEmpty())
uiDEConfig.lineEdit_netctl->setText(url.path());
}
void Netctl::selectDataEngineNetctlAutoExe()
{
KUrl url = KFileDialog::getOpenUrl(KUrl("/usr/bin"), "*");
if (!url.isEmpty())
uiDEConfig.lineEdit_netctlAuto->setText(url.path());
}
void Netctl::createConfigurationInterface(KConfigDialog *parent)
{
QWidget *configwin = new QWidget;
uiConfig.setupUi(configwin);
QString text = QString(NAME) + " - " + QString(VERSION) + "\n" + "(c) " +
QString(DATE) + " " + QString(AUTHOR);
uiConfig.label_info->setText(text);
QWidget *configWidget = new QWidget;
uiWidConfig.setupUi(configWidget);
QWidget *appWidget = new QWidget;
uiAppConfig.setupUi(appWidget);
QWidget *deWidget = new QWidget;
uiDEConfig.setupUi(deWidget);
QWidget *aboutWidget = new QWidget;
uiAboutConfig.setupUi(aboutWidget);
uiConfig.spinBox_autoUpdate->setValue(autoUpdateInterval);
uiConfig.lineEdit_gui->setText(paths[QString("gui")]);
uiConfig.lineEdit_netctl->setText(paths[QString("netctl")]);
uiWidConfig.spinBox_autoUpdate->setValue(autoUpdateInterval);
uiWidConfig.lineEdit_gui->setText(paths[QString("gui")]);
uiWidConfig.lineEdit_netctl->setText(paths[QString("netctl")]);
uiWidConfig.lineEdit_netctlAuto->setText(paths[QString("netctlAuto")]);
if (useSudo)
uiConfig.checkBox_sudo->setCheckState(Qt::Checked);
uiWidConfig.checkBox_sudo->setCheckState(Qt::Checked);
else
uiConfig.checkBox_sudo->setCheckState(Qt::Unchecked);
uiConfig.lineEdit_sudo->setText(paths[QString("sudo")]);
uiWidConfig.checkBox_sudo->setCheckState(Qt::Unchecked);
uiWidConfig.lineEdit_sudo->setText(paths[QString("sudo")]);
setSudo();
if (useWifi)
uiConfig.checkBox_wifi->setCheckState(Qt::Checked);
uiWidConfig.checkBox_wifi->setCheckState(Qt::Checked);
else
uiConfig.checkBox_wifi->setCheckState(Qt::Unchecked);
uiConfig.lineEdit_wifi->setText(paths[QString("wifi")]);
uiWidConfig.checkBox_wifi->setCheckState(Qt::Unchecked);
uiWidConfig.lineEdit_wifi->setText(paths[QString("wifi")]);
setWifi();
if (bigInterface[QString("main")])
uiConfig.checkBox_showBigInterface->setCheckState(Qt::Checked);
uiWidConfig.checkBox_showBigInterface->setCheckState(Qt::Checked);
else
uiConfig.checkBox_showBigInterface->setCheckState(Qt::Unchecked);
uiWidConfig.checkBox_showBigInterface->setCheckState(Qt::Unchecked);
if (bigInterface[QString("netDev")])
uiConfig.checkBox_showNetDev->setCheckState(Qt::Checked);
uiWidConfig.checkBox_showNetDev->setCheckState(Qt::Checked);
else
uiConfig.checkBox_showNetDev->setCheckState(Qt::Unchecked);
uiWidConfig.checkBox_showNetDev->setCheckState(Qt::Unchecked);
if (bigInterface[QString("extIp")])
uiConfig.checkBox_showExtIp->setCheckState(Qt::Checked);
uiWidConfig.checkBox_showExtIp->setCheckState(Qt::Checked);
else
uiConfig.checkBox_showExtIp->setCheckState(Qt::Unchecked);
uiWidConfig.checkBox_showExtIp->setCheckState(Qt::Unchecked);
if (bigInterface[QString("intIp")])
uiConfig.checkBox_showIntIp->setCheckState(Qt::Checked);
uiWidConfig.checkBox_showIntIp->setCheckState(Qt::Checked);
else
uiConfig.checkBox_showIntIp->setCheckState(Qt::Unchecked);
uiWidConfig.checkBox_showIntIp->setCheckState(Qt::Unchecked);
setBigInterface();
KConfigGroup cg = config();
@ -454,30 +639,65 @@ void Netctl::createConfigurationInterface(KConfigDialog *parent)
int fontWeight = cg.readEntry("fontWeight", 400);
QString fontStyle = cg.readEntry("fontStyle", "normal");
QFont font = QFont(fontFamily, 12, 400, FALSE);
uiConfig.fontComboBox_font->setCurrentFont(font);
uiConfig.spinBox_fontSize->setValue(fontSize);
uiConfig.kcolorcombo_fontColor->setColor(fontColor);
uiConfig.spinBox_fontWeight->setValue(fontWeight);
uiAppConfig.fontComboBox_font->setCurrentFont(font);
uiAppConfig.spinBox_fontSize->setValue(fontSize);
uiAppConfig.kcolorcombo_fontColor->setColor(fontColor);
uiAppConfig.spinBox_fontWeight->setValue(fontWeight);
if (fontStyle == "normal")
uiConfig.comboBox_fontStyle->setCurrentIndex(0);
uiAppConfig.comboBox_fontStyle->setCurrentIndex(0);
else if (fontStyle == "italic")
uiConfig.comboBox_fontStyle->setCurrentIndex(1);
uiConfig.lineEdit_activeIcon->setText(paths[QString("active")]);
uiConfig.lineEdit_inactiveIcon->setText(paths[QString("inactive")]);
uiAppConfig.comboBox_fontStyle->setCurrentIndex(1);
uiAppConfig.lineEdit_activeIcon->setText(paths[QString("active")]);
uiAppConfig.lineEdit_inactiveIcon->setText(paths[QString("inactive")]);
parent->addPage(configwin, i18n("Netctl plasmoid"), Applet::icon());
QMap<QString, QString> deSettings = readDataEngineConfiguration();
uiDEConfig.lineEdit_netctl->setText(deSettings[QString("CMD")]);
uiDEConfig.lineEdit_netctlAuto->setText(deSettings[QString("NETCTLAUTOCMD")]);
uiDEConfig.lineEdit_ip->setText(deSettings[QString("IPCMD")]);
uiDEConfig.lineEdit_interface->setText(deSettings[QString("NETDIR")]);
if (deSettings[QString("EXTIP")] == QString("true"))
uiDEConfig.checkBox_extIp->setCheckState(Qt::Checked);
else
uiDEConfig.checkBox_extIp->setCheckState(Qt::Unchecked);
uiDEConfig.lineEdit_extIp->setText(deSettings[QString("EXTIPCMD")]);
setDataEngineExternalIp();
connect(uiConfig.checkBox_showBigInterface, SIGNAL(stateChanged(int)), this,
uiAboutConfig.label_name->setText(QString(NAME));
uiAboutConfig.label_version->setText(i18n("Version %1\n(build date %2)", QString(VERSION), QString(BUILD_DATE)));
uiAboutConfig.label_description->setText(i18n("KDE widget which interacts with netctl."));
uiAboutConfig.label_links->setText(i18n("Links:") + QString("<br>") +
QString("<a href=\"%1\">%2</a><br>").arg(QString(HOMEPAGE)).arg(i18n("Homepage")) +
QString("<a href=\"%1\">%2</a><br>").arg(QString(REPOSITORY)).arg(i18n("Repository")) +
QString("<a href=\"%1\">%2</a><br>").arg(QString(BUGTRACKER)).arg(i18n("Bugtracker")) +
QString("<a href=\"%1\">%2</a><br>").arg(QString(TRANSLATION)).arg(i18n("Translation issue")) +
QString("<a href=\"%1\">%2</a>").arg(QString(AUR_PACKAGES)).arg(i18n("AUR packages")));
uiAboutConfig.label_license->setText(QString("<small>&copy; %1 <a href=\"mailto:%2\">%3</a><br>").arg(QString(DATE)).arg(QString(EMAIL)).arg(QString(AUTHOR)) +
i18n("This software is licensed under %1", QString(LICENSE)) +
QString("</small>"));
parent->addPage(configWidget, i18n("Netctl plasmoid"), Applet::icon());
parent->addPage(appWidget, i18n("Appearance"), QString("preferences-desktop-theme"));
parent->addPage(deWidget, i18n("DataEngine"), Applet::icon());
parent->addPage(aboutWidget, i18n("About"), QString("help-about"));
connect(uiWidConfig.checkBox_showBigInterface, SIGNAL(stateChanged(int)), this,
SLOT(setBigInterface()));
connect(uiConfig.checkBox_sudo, SIGNAL(stateChanged(int)), this, SLOT(setSudo()));
connect(uiConfig.checkBox_wifi, SIGNAL(stateChanged(int)), this, SLOT(setWifi()));
connect(uiWidConfig.checkBox_sudo, SIGNAL(stateChanged(int)), this, SLOT(setSudo()));
connect(uiWidConfig.checkBox_wifi, SIGNAL(stateChanged(int)), this, SLOT(setWifi()));
connect(uiDEConfig.checkBox_extIp, SIGNAL(stateChanged(int)), this, SLOT(setDataEngineExternalIp()));
connect(uiConfig.pushButton_gui, SIGNAL(clicked()), this, SLOT(selectGuiExe()));
connect(uiConfig.pushButton_netctl, SIGNAL(clicked()), this, SLOT(selectNetctlExe()));
connect(uiConfig.pushButton_sudo, SIGNAL(clicked()), this, SLOT(selectSudoExe()));
connect(uiConfig.pushButton_wifi, SIGNAL(clicked()), this, SLOT(selecWifiExe()));
connect(uiConfig.pushButton_activeIcon, SIGNAL(clicked()), this, SLOT(selectActiveIcon()));
connect(uiConfig.pushButton_inactiveIcon, SIGNAL(clicked()), this, SLOT(selectInactiveIcon()));
connect(uiWidConfig.pushButton_gui, SIGNAL(clicked()), this, SLOT(selectGuiExe()));
connect(uiWidConfig.pushButton_netctl, SIGNAL(clicked()), this, SLOT(selectNetctlExe()));
connect(uiWidConfig.pushButton_netctlAuto, SIGNAL(clicked()), this, SLOT(selectNetctlAutoExe()));
connect(uiWidConfig.pushButton_sudo, SIGNAL(clicked()), this, SLOT(selectSudoExe()));
connect(uiWidConfig.pushButton_wifi, SIGNAL(clicked()), this, SLOT(selectWifiExe()));
connect(uiAppConfig.pushButton_activeIcon, SIGNAL(clicked()), this, SLOT(selectActiveIcon()));
connect(uiAppConfig.pushButton_inactiveIcon, SIGNAL(clicked()), this, SLOT(selectInactiveIcon()));
connect(uiDEConfig.pushButton_extIp, SIGNAL(clicked()), this, SLOT(selectDataEngineExternalIpExe()));
connect(uiDEConfig.pushButton_interface, SIGNAL(clicked()), this, SLOT(selectDataEngineInterfacesDirectory()));
connect(uiDEConfig.pushButton_ip, SIGNAL(clicked()), this, SLOT(selectDataEngineIpExe()));
connect(uiDEConfig.pushButton_netctl, SIGNAL(clicked()), this, SLOT(selectDataEngineNetctlExe()));
connect(uiDEConfig.pushButton_netctlAuto, SIGNAL(clicked()), this, SLOT(selectDataEngineNetctlAutoExe()));
connect(parent, SIGNAL(okClicked()), this, SLOT(configAccepted()));
connect(parent, SIGNAL(applyClicked()), this, SLOT(configAccepted()));
@ -489,43 +709,56 @@ void Netctl::configAccepted()
disconnectFromEngine();
KConfigGroup cg = config();
cg.writeEntry("autoUpdateInterval", uiConfig.spinBox_autoUpdate->value());
cg.writeEntry("guiPath", uiConfig.lineEdit_gui->text());
cg.writeEntry("netctlPath", uiConfig.lineEdit_netctl->text());
if (uiConfig.checkBox_sudo->checkState() == 0)
cg.writeEntry("autoUpdateInterval", uiWidConfig.spinBox_autoUpdate->value());
cg.writeEntry("guiPath", uiWidConfig.lineEdit_gui->text());
cg.writeEntry("netctlPath", uiWidConfig.lineEdit_netctl->text());
cg.writeEntry("netctlAutoPath", uiWidConfig.lineEdit_netctlAuto->text());
if (uiWidConfig.checkBox_sudo->checkState() == 0)
cg.writeEntry("useSudo", false);
else
cg.writeEntry("useSudo", true);
cg.writeEntry("sudoPath", uiConfig.lineEdit_sudo->text());
if (uiConfig.checkBox_wifi->checkState() == 0)
cg.writeEntry("sudoPath", uiWidConfig.lineEdit_sudo->text());
if (uiWidConfig.checkBox_wifi->checkState() == 0)
cg.writeEntry("useWifi", false);
else
cg.writeEntry("useWifi", true);
cg.writeEntry("wifiPath", uiConfig.lineEdit_wifi->text());
if (uiConfig.checkBox_showBigInterface->checkState() == 0)
cg.writeEntry("wifiPath", uiWidConfig.lineEdit_wifi->text());
if (uiWidConfig.checkBox_showBigInterface->checkState() == 0)
cg.writeEntry("showBigInterface", false);
else
cg.writeEntry("showBigInterface", true);
if (uiConfig.checkBox_showNetDev->checkState() == 0)
if (uiWidConfig.checkBox_showNetDev->checkState() == 0)
cg.writeEntry("showNetDev", false);
else
cg.writeEntry("showNetDev", true);
if (uiConfig.checkBox_showExtIp->checkState() == 0)
if (uiWidConfig.checkBox_showExtIp->checkState() == 0)
cg.writeEntry("showExtIp", false);
else
cg.writeEntry("showExtIp", true);
if (uiConfig.checkBox_showIntIp->checkState() == 0)
if (uiWidConfig.checkBox_showIntIp->checkState() == 0)
cg.writeEntry("showIntIp", false);
else
cg.writeEntry("showIntIp", true);
cg.writeEntry("fontFamily", uiConfig.fontComboBox_font->currentFont().family());
cg.writeEntry("fontSize", uiConfig.spinBox_fontSize->value());
cg.writeEntry("fontColor", uiConfig.kcolorcombo_fontColor->color().name());
cg.writeEntry("fontWeight", uiConfig.spinBox_fontWeight->value());
cg.writeEntry("fontStyle", uiConfig.comboBox_fontStyle->currentText());
cg.writeEntry("activeIconPath", uiConfig.lineEdit_activeIcon->text());
cg.writeEntry("inactiveIconPath", uiConfig.lineEdit_inactiveIcon->text());
cg.writeEntry("fontFamily", uiAppConfig.fontComboBox_font->currentFont().family());
cg.writeEntry("fontSize", uiAppConfig.spinBox_fontSize->value());
cg.writeEntry("fontColor", uiAppConfig.kcolorcombo_fontColor->color().name());
cg.writeEntry("fontWeight", uiAppConfig.spinBox_fontWeight->value());
cg.writeEntry("fontStyle", uiAppConfig.comboBox_fontStyle->currentText());
cg.writeEntry("activeIconPath", uiAppConfig.lineEdit_activeIcon->text());
cg.writeEntry("inactiveIconPath", uiAppConfig.lineEdit_inactiveIcon->text());
QMap<QString, QString> deSettings;
deSettings[QString("CMD")] = uiDEConfig.lineEdit_netctl->text();
deSettings[QString("NETCTLAUTOCMD")] = uiDEConfig.lineEdit_netctlAuto->text();
deSettings[QString("IPCMD")] = uiDEConfig.lineEdit_ip->text();
deSettings[QString("NETDIR")] = uiDEConfig.lineEdit_interface->text();
if (uiDEConfig.checkBox_extIp->checkState() == 0)
deSettings[QString("EXTIP")] = QString("false");
else
deSettings[QString("EXTIP")] = QString("true");
deSettings[QString("EXTIPCMD")] = uiDEConfig.lineEdit_extIp->text();
writeDataEngineConfiguration(deSettings);
}
@ -536,6 +769,7 @@ void Netctl::configChanged()
autoUpdateInterval = cg.readEntry("autoUpdateInterval", 1000);
paths[QString("gui")] = cg.readEntry("guiPath", "/usr/bin/netctl-gui");
paths[QString("netctl")] = cg.readEntry("netctlPath", "/usr/bin/netctl");
paths[QString("netctlAuto")] = cg.readEntry("netctlAutoPath", "/usr/bin/netctl-auto");
paths[QString("sudo")] = cg.readEntry("sudoPath", "/usr/bin/kdesu");
paths[QString("wifi")] = cg.readEntry("wifiPath", "/usr/bin/netctl-gui -t 3");
useSudo = cg.readEntry("useSudo", true);
@ -568,34 +802,55 @@ void Netctl::configChanged()
void Netctl::setBigInterface()
{
if (uiConfig.checkBox_showBigInterface->checkState() == 0) {
uiConfig.checkBox_showNetDev->setDisabled(true);
uiConfig.checkBox_showExtIp->setDisabled(true);
uiConfig.checkBox_showIntIp->setDisabled(true);
if (uiWidConfig.checkBox_showBigInterface->checkState() == 0) {
uiWidConfig.checkBox_showNetDev->setDisabled(true);
uiWidConfig.checkBox_showExtIp->setDisabled(true);
uiWidConfig.checkBox_showIntIp->setDisabled(true);
}
else if (uiConfig.checkBox_showBigInterface->checkState() == 2) {
uiConfig.checkBox_showNetDev->setEnabled(true);
uiConfig.checkBox_showExtIp->setEnabled(true);
uiConfig.checkBox_showIntIp->setEnabled(true);
else if (uiWidConfig.checkBox_showBigInterface->checkState() == 2) {
uiWidConfig.checkBox_showNetDev->setEnabled(true);
uiWidConfig.checkBox_showExtIp->setEnabled(true);
uiWidConfig.checkBox_showIntIp->setEnabled(true);
}
}
void Netctl::setDataEngineExternalIp()
{
if (uiDEConfig.checkBox_extIp->checkState() == 0) {
uiDEConfig.lineEdit_extIp->setDisabled(true);
uiDEConfig.pushButton_extIp->setDisabled(true);
}
else if (uiDEConfig.checkBox_extIp->checkState() == 2) {
uiDEConfig.lineEdit_extIp->setEnabled(true);
uiDEConfig.pushButton_extIp->setEnabled(true);
}
}
void Netctl::setSudo()
{
if (uiConfig.checkBox_sudo->checkState() == 0)
uiConfig.lineEdit_sudo->setDisabled(true);
else if (uiConfig.checkBox_sudo->checkState() == 2)
uiConfig.lineEdit_sudo->setEnabled(true);
if (uiWidConfig.checkBox_sudo->checkState() == 0) {
uiWidConfig.lineEdit_sudo->setDisabled(true);
uiWidConfig.pushButton_sudo->setDisabled(true);
}
else if (uiWidConfig.checkBox_sudo->checkState() == 2) {
uiWidConfig.lineEdit_sudo->setEnabled(true);
uiWidConfig.pushButton_sudo->setEnabled(true);
}
}
void Netctl::setWifi()
{
if (uiConfig.checkBox_wifi->checkState() == 0)
uiConfig.lineEdit_wifi->setDisabled(true);
else if (uiConfig.checkBox_wifi->checkState() == 2)
uiConfig.checkBox_wifi->setEnabled(true);
if (uiWidConfig.checkBox_wifi->checkState() == 0) {
uiWidConfig.lineEdit_wifi->setDisabled(true);
uiWidConfig.pushButton_wifi->setDisabled(true);
}
else if (uiWidConfig.checkBox_wifi->checkState() == 2) {
uiWidConfig.lineEdit_wifi->setEnabled(true);
uiWidConfig.pushButton_wifi->setEnabled(true);
}
}

View File

@ -25,7 +25,10 @@
#include <Plasma/Label>
#include <QProcess>
#include <ui_configwindow.h>
#include <ui_about.h>
#include <ui_appearance.h>
#include <ui_dataengine.h>
#include <ui_widget.h>
class QGraphicsLinearLayout;
@ -38,6 +41,9 @@ public:
Netctl(QObject *parent, const QVariantList &args);
~Netctl();
void init();
QMap<QString, QString> readDataEngineConfiguration();
void writeDataEngineConfiguration(const QMap<QString, QString> settings);
QMap<QString, QString> updateConfiguration(const QMap<QString, QString> rawConfig);
public slots:
// events
@ -50,6 +56,7 @@ public slots:
void configAccepted();
void configChanged();
void setBigInterface();
void setDataEngineExternalIp();
void setSudo();
void setWifi();
@ -61,12 +68,20 @@ private slots:
void selectGuiExe();
void selectInactiveIcon();
void selectNetctlExe();
void selectNetctlAutoExe();
void selectSudoExe();
void selectWifiExe();
// dataengine
void selectDataEngineExternalIpExe();
void selectDataEngineInterfacesDirectory();
void selectDataEngineIpExe();
void selectDataEngineNetctlExe();
void selectDataEngineNetctlAutoExe();
// context menu
void enableProfileSlot();
void startProfileSlot(QAction *profile);
void stopProfileSlot();
void switchToProfileSlot(QAction *profile);
void restartProfileSlot();
protected:
@ -87,13 +102,17 @@ private:
void createActions();
QList<QAction*> menuActions;
QMenu *startProfileMenu;
QMenu *switchToProfileMenu;
QMap<QString, QAction*> contextMenu;
// data engine
Plasma::DataEngine *netctlEngine;
void connectToEngine();
void disconnectFromEngine();
// configuration interface
Ui::ConfigWindow uiConfig;
Ui::AppearanceWindow uiAppConfig;
Ui::DataEngineWindow uiDEConfig;
Ui::ConfigWindow uiWidConfig;
Ui::About uiAboutConfig;
// configuration
int autoUpdateInterval;
QMap<QString, bool> bigInterface;

View File

@ -1,15 +0,0 @@
#!/bin/sh
WDIR=`pwd` # working dir
SATELLITE_LIST=satellite.list
BACKGROUND_LIST=background.list
# Background list
cd "$WDIR"
cd ../images
ls -1 background_* | sed -e "s/background_//g" | sed -e "s/_/ /g" | sed -e "s/\.jpg//g" | sed -e "s/\.png//g" | sed -e "s/\.gif//g" | grep -v '^$' | sort --unique --ignore-leading-blanks > "$WDIR/background.list"
# Satellite list
cd "$WDIR"
cd ../data
cat satellite_images.xml | grep image\ name | sed -e "s/.*<image name=\"\([^\"]*\).*/\1/" | sed -e "s/\&amp;/\&/g" | sed -e "s/\&apos;/'/g" | sed -e "s/\&quot;/\"/g" | sed -e "s/\&lt;/</g" | sed -e "s/\&gt;/>/g" | grep -v '^$' | sort --unique --ignore-leading-blanks > "$WDIR/satellite.list"

View File

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: http://kde-look.org/content/show.php?content=98925\n"
"POT-Creation-Date: 2014-04-12 18:56+0400\n"
"PO-Revision-Date: 2014-04-12 18:56+0400\n"
"POT-Creation-Date: 2014-07-14 18:33+0400\n"
"PO-Revision-Date: 2014-07-14 18:32+0400\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: Russian <kde-russian@lists.kde.ru>\n"
"Language: ru\n"
@ -18,272 +18,385 @@ msgstr ""
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 1.5\n"
#: netctl.cpp:112
#: netctl.cpp:179
msgid "Set profile %1 disabled"
msgstr "Set profile %1 disabled"
#: netctl.cpp:116
#: netctl.cpp:183
msgid "Set profile %1 enabled"
msgstr "Set profile %1 enabled"
#: netctl.cpp:132
#: netctl.cpp:200
msgid "Start profile %1"
msgstr "Start profile %1"
#: netctl.cpp:151
#: netctl.cpp:228
msgid "Stop profile %1"
msgstr "Stop profile %1"
#: netctl.cpp:165
#: netctl.cpp:243
msgid "Switch to profile %1"
msgstr "Switch to profile %1"
#: netctl.cpp:254
msgid "Restart profile %1"
msgstr "Restart profile %1"
#: netctl.cpp:178
#: netctl.cpp:293
msgid "Start another profile"
msgstr "Start another profile"
#: netctl.cpp:180
msgid "Stop "
msgstr "Stop "
#: netctl.cpp:295
msgid "Stop %1"
msgstr "Stop %1"
#: netctl.cpp:182
msgid "Restart "
msgstr "Restart "
#: netctl.cpp:297
msgid "Restart %1"
msgstr "Restart %1"
#: netctl.cpp:185
msgid "Disable "
msgstr "Disable "
#: netctl.cpp:300
msgid "Disable %1"
msgstr "Disable %1"
#: netctl.cpp:187
msgid "Enable "
msgstr "Enable "
#: netctl.cpp:302
msgid "Enable %1"
msgstr "Enable %1"
#: netctl.cpp:190 netctl.cpp:214
#: netctl.cpp:305 netctl.cpp:333
msgid "Start profile"
msgstr "Start profile"
#: netctl.cpp:221
#: netctl.cpp:341
msgid "Stop profile"
msgstr "Stop profile"
#: netctl.cpp:225
#: netctl.cpp:346
msgid "Switch to profile"
msgstr "Switch to profile"
#: netctl.cpp:354
msgid "Restart profile"
msgstr "Restart profile"
#: netctl.cpp:229
#: netctl.cpp:359
msgid "Enable profile"
msgstr "Enable profile"
#: netctl.cpp:233
#: netctl.cpp:363
msgid "Show WiFi menu"
msgstr "Show WiFi menu"
#: netctl.cpp:253
#: netctl.cpp:384
msgid "Start GUI"
msgstr "Start GUI"
#: netctl.cpp:261
#: netctl.cpp:392
msgid "Start WiFi menu"
msgstr "Start WiFi menu"
#: netctl.cpp:325
#: netctl.cpp:456
msgid "Network is up"
msgstr "Network is up"
#: netctl.cpp:331
#: netctl.cpp:462
msgid "Network is down"
msgstr "Network is down"
#: netctl.cpp:468
#: netctl.cpp:666
msgid ""
"Version %1\n"
"(build date %2)"
msgstr ""
"Version %1\n"
"(build date %2)"
#: netctl.cpp:667
msgid "KDE widget which interacts with netctl."
msgstr "KDE widget which interacts with netctl."
#: netctl.cpp:668
msgid "Links:"
msgstr "Links:"
#: netctl.cpp:669
msgid "Homepage"
msgstr "Homepage"
#: netctl.cpp:670
msgid "Repository"
msgstr "Repository"
#: netctl.cpp:671
msgid "Bugtracker"
msgstr "Bugtracker"
#: netctl.cpp:672
msgid "Translation issue"
msgstr "Translation issue"
#: netctl.cpp:673
msgid "AUR packages"
msgstr "AUR packages"
#: netctl.cpp:675
msgid "This software is licensed under %1"
msgstr "This software is licensed under %1"
#: netctl.cpp:678
msgid "Netctl plasmoid"
msgstr "Netctl plasmoid"
#. i18n: file: configwindow.ui:30
#. i18n: ectx: attribute (title), widget (QWidget, tabConfiguration)
#: po/rc.cpp:3 rc.cpp:3
msgid "Configuration"
msgstr "Configuration"
#. i18n: file: configwindow.ui:54
#. i18n: ectx: property (text), widget (QLabel, label_autoUpdate)
#: po/rc.cpp:6 rc.cpp:6
msgid "Auto update interval, msec"
msgstr "Auto update interval, msec"
#. i18n: file: configwindow.ui:112
#. i18n: ectx: property (text), widget (QLabel, label_gui)
#: po/rc.cpp:9 rc.cpp:9
msgid "Path to GUI"
msgstr "Path to GUI"
#. i18n: file: configwindow.ui:128
#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui)
#. i18n: file: configwindow.ui:161
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: configwindow.ui:197
#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo)
#. i18n: file: configwindow.ui:233
#. i18n: ectx: property (text), widget (QPushButton, pushButton_wifi)
#. i18n: file: configwindow.ui:621
#. i18n: ectx: property (text), widget (QPushButton, pushButton_activeIcon)
#. i18n: file: configwindow.ui:654
#. i18n: ectx: property (text), widget (QPushButton, pushButton_inactiveIcon)
#. i18n: file: configwindow.ui:128
#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui)
#. i18n: file: configwindow.ui:161
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: configwindow.ui:197
#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo)
#. i18n: file: configwindow.ui:233
#. i18n: ectx: property (text), widget (QPushButton, pushButton_wifi)
#. i18n: file: configwindow.ui:621
#. i18n: ectx: property (text), widget (QPushButton, pushButton_activeIcon)
#. i18n: file: configwindow.ui:654
#. i18n: ectx: property (text), widget (QPushButton, pushButton_inactiveIcon)
#: po/rc.cpp:12 po/rc.cpp:18 po/rc.cpp:24 po/rc.cpp:30 po/rc.cpp:87
#: po/rc.cpp:93 rc.cpp:12 rc.cpp:18 rc.cpp:24 rc.cpp:30 rc.cpp:87 rc.cpp:93
msgid "Browse"
msgstr "Browse"
#. i18n: file: configwindow.ui:145
#. i18n: ectx: property (text), widget (QLabel, label_netctl)
#: po/rc.cpp:15 rc.cpp:15
msgid "Path to netctl"
msgstr "Path to netctl"
#. i18n: file: configwindow.ui:178
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_sudo)
#: po/rc.cpp:21 rc.cpp:21
msgid "Use sudo for netctl"
msgstr "Use sudo for netctl"
#. i18n: file: configwindow.ui:214
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_wifi)
#: po/rc.cpp:27 rc.cpp:27
msgid "Show 'Start WiFi menu'"
msgstr "Show 'Start WiFi menu'"
#. i18n: file: configwindow.ui:242
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showBigInterface)
#: po/rc.cpp:33 rc.cpp:33
msgid "Show more detailed interface"
msgstr "Show more detailed interface"
#. i18n: file: configwindow.ui:252
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showNetDev)
#: po/rc.cpp:36 rc.cpp:36
msgid "Show network devices"
msgstr "Show network devices"
#. i18n: file: configwindow.ui:262
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showExtIp)
#: po/rc.cpp:39 rc.cpp:39
msgid "Show external IP"
msgstr "Show external IP"
#. i18n: file: configwindow.ui:272
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showIntIp)
#: po/rc.cpp:42 rc.cpp:42
msgid "Show internal IP"
msgstr "Show internal IP"
#. i18n: file: configwindow.ui:296
#. i18n: ectx: attribute (title), widget (QWidget, tabAppearance)
#: po/rc.cpp:45 rc.cpp:45
#: netctl.cpp:679
msgid "Appearance"
msgstr "Appearance"
#. i18n: file: configwindow.ui:310
#. i18n: ectx: property (text), widget (QLabel, label_font)
#: po/rc.cpp:48 rc.cpp:48
msgid "Font"
msgstr "Font"
#: netctl.cpp:680
msgid "DataEngine"
msgstr "DataEngine"
#. i18n: file: configwindow.ui:342
#. i18n: ectx: property (toolTip), widget (QFontComboBox, fontComboBox_font)
#: po/rc.cpp:51 rc.cpp:51
msgid "Set font family"
msgstr "Set font family"
#: netctl.cpp:681
msgid "About"
msgstr "About"
#. i18n: file: configwindow.ui:359
#. i18n: ectx: property (text), widget (QLabel, label_fontSize)
#: po/rc.cpp:54 rc.cpp:54
msgid "Font size"
msgstr "Font size"
#. i18n: file: configwindow.ui:391
#. i18n: ectx: property (toolTip), widget (QSpinBox, spinBox_fontSize)
#: po/rc.cpp:57 rc.cpp:57
msgid "Set font size"
msgstr "Set font size"
#. i18n: file: configwindow.ui:420
#. i18n: ectx: property (text), widget (QLabel, label_fontColor)
#: po/rc.cpp:60 rc.cpp:60
msgid "Font color"
msgstr "Font color"
#. i18n: file: configwindow.ui:452
#. i18n: ectx: property (toolTip), widget (KColorCombo, kcolorcombo_fontColor)
#: po/rc.cpp:63 rc.cpp:63
msgid "Set font color"
msgstr "Set font color"
#. i18n: file: configwindow.ui:469
#. i18n: ectx: property (text), widget (QLabel, label_fontWeight)
#: po/rc.cpp:66 rc.cpp:66
msgid "Font weight"
msgstr "Font weight"
#. i18n: file: configwindow.ui:501
#. i18n: ectx: property (toolTip), widget (QSpinBox, spinBox_fontWeight)
#: po/rc.cpp:69 rc.cpp:69
msgid "Set font weight"
msgstr "Set font weight"
#. i18n: file: configwindow.ui:533
#. i18n: ectx: property (text), widget (QLabel, label_fontStyle)
#: po/rc.cpp:72 rc.cpp:72
msgid "Font style"
msgstr "Font style"
#. i18n: file: configwindow.ui:565
#. i18n: ectx: property (toolTip), widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:75 rc.cpp:75
msgid "Set font style"
msgstr "Set font style"
#. i18n: file: configwindow.ui:569
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:78 rc.cpp:78
msgid "normal"
msgstr "normal"
#. i18n: file: configwindow.ui:574
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:81 rc.cpp:81
msgid "italic"
msgstr "italic"
#. i18n: file: configwindow.ui:605
#. i18n: ectx: property (text), widget (QLabel, label_activeIcon)
#: po/rc.cpp:84 rc.cpp:84
msgid "Active icon"
msgstr "Active icon"
#. i18n: file: configwindow.ui:638
#. i18n: file: appearance.ui:47
#. i18n: ectx: property (text), widget (QLabel, label_inactiveIcon)
#: po/rc.cpp:90 rc.cpp:90
#: po/rc.cpp:3 rc.cpp:3
msgid "Inactive icon"
msgstr "Inactive icon"
#: po/rc.cpp:94 rc.cpp:94
#. i18n: file: appearance.ui:63
#. i18n: ectx: property (text), widget (QPushButton, pushButton_inactiveIcon)
#. i18n: file: appearance.ui:391
#. i18n: ectx: property (text), widget (QPushButton, pushButton_activeIcon)
#. i18n: file: dataengine.ui:50
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: dataengine.ui:83
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto)
#. i18n: file: dataengine.ui:116
#. i18n: ectx: property (text), widget (QPushButton, pushButton_ip)
#. i18n: file: dataengine.ui:149
#. i18n: ectx: property (text), widget (QPushButton, pushButton_interface)
#. i18n: file: dataengine.ui:185
#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp)
#. i18n: file: widget.ui:118
#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui)
#. i18n: file: widget.ui:151
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: widget.ui:184
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto)
#. i18n: file: widget.ui:220
#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo)
#. i18n: file: widget.ui:256
#. i18n: ectx: property (text), widget (QPushButton, pushButton_wifi)
#. i18n: file: appearance.ui:63
#. i18n: ectx: property (text), widget (QPushButton, pushButton_inactiveIcon)
#. i18n: file: appearance.ui:391
#. i18n: ectx: property (text), widget (QPushButton, pushButton_activeIcon)
#. i18n: file: dataengine.ui:50
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: dataengine.ui:83
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto)
#. i18n: file: dataengine.ui:116
#. i18n: ectx: property (text), widget (QPushButton, pushButton_ip)
#. i18n: file: dataengine.ui:149
#. i18n: ectx: property (text), widget (QPushButton, pushButton_interface)
#. i18n: file: dataengine.ui:185
#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp)
#. i18n: file: widget.ui:118
#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui)
#. i18n: file: widget.ui:151
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: widget.ui:184
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto)
#. i18n: file: widget.ui:220
#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo)
#. i18n: file: widget.ui:256
#. i18n: ectx: property (text), widget (QPushButton, pushButton_wifi)
#: po/rc.cpp:6 po/rc.cpp:48 po/rc.cpp:54 po/rc.cpp:60 po/rc.cpp:66
#: po/rc.cpp:72 po/rc.cpp:78 po/rc.cpp:87 po/rc.cpp:93 po/rc.cpp:99
#: po/rc.cpp:105 po/rc.cpp:111 rc.cpp:6 rc.cpp:48 rc.cpp:54 rc.cpp:60
#: rc.cpp:66 rc.cpp:72 rc.cpp:78 rc.cpp:87 rc.cpp:93 rc.cpp:99 rc.cpp:105
#: rc.cpp:111
msgid "Browse"
msgstr "Browse"
#. i18n: file: appearance.ui:80
#. i18n: ectx: property (text), widget (QLabel, label_fontColor)
#: po/rc.cpp:9 rc.cpp:9
msgid "Font color"
msgstr "Font color"
#. i18n: file: appearance.ui:112
#. i18n: ectx: property (toolTip), widget (KColorCombo, kcolorcombo_fontColor)
#: po/rc.cpp:12 rc.cpp:12
msgid "Set font color"
msgstr "Set font color"
#. i18n: file: appearance.ui:142
#. i18n: ectx: property (text), widget (QLabel, label_fontSize)
#: po/rc.cpp:15 rc.cpp:15
msgid "Font size"
msgstr "Font size"
#. i18n: file: appearance.ui:174
#. i18n: ectx: property (toolTip), widget (QSpinBox, spinBox_fontSize)
#: po/rc.cpp:18 rc.cpp:18
msgid "Set font size"
msgstr "Set font size"
#. i18n: file: appearance.ui:203
#. i18n: ectx: property (text), widget (QLabel, label_fontWeight)
#: po/rc.cpp:21 rc.cpp:21
msgid "Font weight"
msgstr "Font weight"
#. i18n: file: appearance.ui:235
#. i18n: ectx: property (toolTip), widget (QSpinBox, spinBox_fontWeight)
#: po/rc.cpp:24 rc.cpp:24
msgid "Set font weight"
msgstr "Set font weight"
#. i18n: file: appearance.ui:267
#. i18n: ectx: property (text), widget (QLabel, label_fontStyle)
#: po/rc.cpp:27 rc.cpp:27
msgid "Font style"
msgstr "Font style"
#. i18n: file: appearance.ui:299
#. i18n: ectx: property (toolTip), widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:30 rc.cpp:30
msgid "Set font style"
msgstr "Set font style"
#. i18n: file: appearance.ui:303
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:33 rc.cpp:33
msgid "normal"
msgstr "normal"
#. i18n: file: appearance.ui:308
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:36 rc.cpp:36
msgid "italic"
msgstr "italic"
#. i18n: file: appearance.ui:326
#. i18n: ectx: property (text), widget (QLabel, label_font)
#: po/rc.cpp:39 rc.cpp:39
msgid "Font"
msgstr "Font"
#. i18n: file: appearance.ui:358
#. i18n: ectx: property (toolTip), widget (QFontComboBox, fontComboBox_font)
#: po/rc.cpp:42 rc.cpp:42
msgid "Set font family"
msgstr "Set font family"
#. i18n: file: appearance.ui:375
#. i18n: ectx: property (text), widget (QLabel, label_activeIcon)
#: po/rc.cpp:45 rc.cpp:45
msgid "Active icon"
msgstr "Active icon"
#. i18n: file: dataengine.ui:34
#. i18n: ectx: property (text), widget (QLabel, label_netctl)
#. i18n: file: widget.ui:135
#. i18n: ectx: property (text), widget (QLabel, label_netctl)
#. i18n: file: dataengine.ui:34
#. i18n: ectx: property (text), widget (QLabel, label_netctl)
#. i18n: file: widget.ui:135
#. i18n: ectx: property (text), widget (QLabel, label_netctl)
#: po/rc.cpp:51 po/rc.cpp:90 rc.cpp:51 rc.cpp:90
msgid "Path to netctl"
msgstr "Path to netctl"
#. i18n: file: dataengine.ui:67
#. i18n: ectx: property (text), widget (QLabel, label_netctlAuto)
#. i18n: file: widget.ui:168
#. i18n: ectx: property (text), widget (QLabel, label_netctlAuto)
#. i18n: file: dataengine.ui:67
#. i18n: ectx: property (text), widget (QLabel, label_netctlAuto)
#. i18n: file: widget.ui:168
#. i18n: ectx: property (text), widget (QLabel, label_netctlAuto)
#: po/rc.cpp:57 po/rc.cpp:96 rc.cpp:57 rc.cpp:96
msgid "Path to netctl-auto"
msgstr "Path to netctl-auto"
#. i18n: file: dataengine.ui:100
#. i18n: ectx: property (text), widget (QLabel, label_ip)
#: po/rc.cpp:63 rc.cpp:63
msgid "Path to ip"
msgstr "Path to ip"
#. i18n: file: dataengine.ui:133
#. i18n: ectx: property (text), widget (QLabel, label_interface)
#: po/rc.cpp:69 rc.cpp:69
msgid "Path to interface list"
msgstr "Path to interface list"
#. i18n: file: dataengine.ui:166
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_extIp)
#: po/rc.cpp:75 rc.cpp:75
msgid "Check external IP"
msgstr "Check external IP"
#. i18n: file: widget.ui:44
#. i18n: ectx: property (text), widget (QLabel, label_autoUpdate)
#: po/rc.cpp:81 rc.cpp:81
msgid "Auto update interval, msec"
msgstr "Auto update interval, msec"
#. i18n: file: widget.ui:102
#. i18n: ectx: property (text), widget (QLabel, label_gui)
#: po/rc.cpp:84 rc.cpp:84
msgid "Path to GUI"
msgstr "Path to GUI"
#. i18n: file: widget.ui:201
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_sudo)
#: po/rc.cpp:102 rc.cpp:102
msgid "Use sudo for netctl"
msgstr "Use sudo for netctl"
#. i18n: file: widget.ui:237
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_wifi)
#: po/rc.cpp:108 rc.cpp:108
msgid "Show 'Start WiFi menu'"
msgstr "Show 'Start WiFi menu'"
#. i18n: file: widget.ui:265
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showBigInterface)
#: po/rc.cpp:114 rc.cpp:114
msgid "Show more detailed interface"
msgstr "Show more detailed interface"
#. i18n: file: widget.ui:275
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showNetDev)
#: po/rc.cpp:117 rc.cpp:117
msgid "Show network devices"
msgstr "Show network devices"
#. i18n: file: widget.ui:285
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showExtIp)
#: po/rc.cpp:120 rc.cpp:120
msgid "Show external IP"
msgstr "Show external IP"
#. i18n: file: widget.ui:295
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showIntIp)
#: po/rc.cpp:123 rc.cpp:123
msgid "Show internal IP"
msgstr "Show internal IP"
#: po/rc.cpp:124 rc.cpp:124
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Evgeniy Alekseev"
#: po/rc.cpp:95 rc.cpp:95
#: po/rc.cpp:125 rc.cpp:125
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "esalexeev@gmail.com"
#~ msgid "Configuration"
#~ msgstr "Configuration"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://kde-look.org/content/show.php?content=98925\n"
"POT-Creation-Date: 2014-04-12 18:56+0400\n"
"POT-Creation-Date: 2014-07-14 18:33+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,271 +17,380 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: netctl.cpp:112
#: netctl.cpp:179
msgid "Set profile %1 disabled"
msgstr ""
#: netctl.cpp:116
#: netctl.cpp:183
msgid "Set profile %1 enabled"
msgstr ""
#: netctl.cpp:132
#: netctl.cpp:200
msgid "Start profile %1"
msgstr ""
#: netctl.cpp:151
#: netctl.cpp:228
msgid "Stop profile %1"
msgstr ""
#: netctl.cpp:165
#: netctl.cpp:243
msgid "Switch to profile %1"
msgstr ""
#: netctl.cpp:254
msgid "Restart profile %1"
msgstr ""
#: netctl.cpp:178
#: netctl.cpp:293
msgid "Start another profile"
msgstr ""
#: netctl.cpp:180
msgid "Stop "
#: netctl.cpp:295
msgid "Stop %1"
msgstr ""
#: netctl.cpp:182
msgid "Restart "
#: netctl.cpp:297
msgid "Restart %1"
msgstr ""
#: netctl.cpp:185
msgid "Disable "
#: netctl.cpp:300
msgid "Disable %1"
msgstr ""
#: netctl.cpp:187
msgid "Enable "
#: netctl.cpp:302
msgid "Enable %1"
msgstr ""
#: netctl.cpp:190 netctl.cpp:214
#: netctl.cpp:305 netctl.cpp:333
msgid "Start profile"
msgstr ""
#: netctl.cpp:221
#: netctl.cpp:341
msgid "Stop profile"
msgstr ""
#: netctl.cpp:225
#: netctl.cpp:346
msgid "Switch to profile"
msgstr ""
#: netctl.cpp:354
msgid "Restart profile"
msgstr ""
#: netctl.cpp:229
#: netctl.cpp:359
msgid "Enable profile"
msgstr ""
#: netctl.cpp:233
#: netctl.cpp:363
msgid "Show WiFi menu"
msgstr ""
#: netctl.cpp:253
#: netctl.cpp:384
msgid "Start GUI"
msgstr ""
#: netctl.cpp:261
#: netctl.cpp:392
msgid "Start WiFi menu"
msgstr ""
#: netctl.cpp:325
#: netctl.cpp:456
msgid "Network is up"
msgstr ""
#: netctl.cpp:331
#: netctl.cpp:462
msgid "Network is down"
msgstr ""
#: netctl.cpp:468
#: netctl.cpp:666
msgid ""
"Version %1\n"
"(build date %2)"
msgstr ""
#: netctl.cpp:667
msgid "KDE widget which interacts with netctl."
msgstr ""
#: netctl.cpp:668
msgid "Links:"
msgstr ""
#: netctl.cpp:669
msgid "Homepage"
msgstr ""
#: netctl.cpp:670
msgid "Repository"
msgstr ""
#: netctl.cpp:671
msgid "Bugtracker"
msgstr ""
#: netctl.cpp:672
msgid "Translation issue"
msgstr ""
#: netctl.cpp:673
msgid "AUR packages"
msgstr ""
#: netctl.cpp:675
msgid "This software is licensed under %1"
msgstr ""
#: netctl.cpp:678
msgid "Netctl plasmoid"
msgstr ""
#. i18n: file: configwindow.ui:30
#. i18n: ectx: attribute (title), widget (QWidget, tabConfiguration)
#: po/rc.cpp:3 rc.cpp:3
msgid "Configuration"
msgstr ""
#. i18n: file: configwindow.ui:54
#. i18n: ectx: property (text), widget (QLabel, label_autoUpdate)
#: po/rc.cpp:6 rc.cpp:6
msgid "Auto update interval, msec"
msgstr ""
#. i18n: file: configwindow.ui:112
#. i18n: ectx: property (text), widget (QLabel, label_gui)
#: po/rc.cpp:9 rc.cpp:9
msgid "Path to GUI"
msgstr ""
#. i18n: file: configwindow.ui:128
#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui)
#. i18n: file: configwindow.ui:161
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: configwindow.ui:197
#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo)
#. i18n: file: configwindow.ui:233
#. i18n: ectx: property (text), widget (QPushButton, pushButton_wifi)
#. i18n: file: configwindow.ui:621
#. i18n: ectx: property (text), widget (QPushButton, pushButton_activeIcon)
#. i18n: file: configwindow.ui:654
#. i18n: ectx: property (text), widget (QPushButton, pushButton_inactiveIcon)
#. i18n: file: configwindow.ui:128
#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui)
#. i18n: file: configwindow.ui:161
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: configwindow.ui:197
#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo)
#. i18n: file: configwindow.ui:233
#. i18n: ectx: property (text), widget (QPushButton, pushButton_wifi)
#. i18n: file: configwindow.ui:621
#. i18n: ectx: property (text), widget (QPushButton, pushButton_activeIcon)
#. i18n: file: configwindow.ui:654
#. i18n: ectx: property (text), widget (QPushButton, pushButton_inactiveIcon)
#: po/rc.cpp:12 po/rc.cpp:18 po/rc.cpp:24 po/rc.cpp:30 po/rc.cpp:87
#: po/rc.cpp:93 rc.cpp:12 rc.cpp:18 rc.cpp:24 rc.cpp:30 rc.cpp:87 rc.cpp:93
msgid "Browse"
msgstr ""
#. i18n: file: configwindow.ui:145
#. i18n: ectx: property (text), widget (QLabel, label_netctl)
#: po/rc.cpp:15 rc.cpp:15
msgid "Path to netctl"
msgstr ""
#. i18n: file: configwindow.ui:178
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_sudo)
#: po/rc.cpp:21 rc.cpp:21
msgid "Use sudo for netctl"
msgstr ""
#. i18n: file: configwindow.ui:214
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_wifi)
#: po/rc.cpp:27 rc.cpp:27
msgid "Show 'Start WiFi menu'"
msgstr ""
#. i18n: file: configwindow.ui:242
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showBigInterface)
#: po/rc.cpp:33 rc.cpp:33
msgid "Show more detailed interface"
msgstr ""
#. i18n: file: configwindow.ui:252
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showNetDev)
#: po/rc.cpp:36 rc.cpp:36
msgid "Show network devices"
msgstr ""
#. i18n: file: configwindow.ui:262
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showExtIp)
#: po/rc.cpp:39 rc.cpp:39
msgid "Show external IP"
msgstr ""
#. i18n: file: configwindow.ui:272
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showIntIp)
#: po/rc.cpp:42 rc.cpp:42
msgid "Show internal IP"
msgstr ""
#. i18n: file: configwindow.ui:296
#. i18n: ectx: attribute (title), widget (QWidget, tabAppearance)
#: po/rc.cpp:45 rc.cpp:45
#: netctl.cpp:679
msgid "Appearance"
msgstr ""
#. i18n: file: configwindow.ui:310
#. i18n: ectx: property (text), widget (QLabel, label_font)
#: po/rc.cpp:48 rc.cpp:48
msgid "Font"
#: netctl.cpp:680
msgid "DataEngine"
msgstr ""
#. i18n: file: configwindow.ui:342
#. i18n: ectx: property (toolTip), widget (QFontComboBox, fontComboBox_font)
#: po/rc.cpp:51 rc.cpp:51
msgid "Set font family"
#: netctl.cpp:681
msgid "About"
msgstr ""
#. i18n: file: configwindow.ui:359
#. i18n: ectx: property (text), widget (QLabel, label_fontSize)
#: po/rc.cpp:54 rc.cpp:54
msgid "Font size"
msgstr ""
#. i18n: file: configwindow.ui:391
#. i18n: ectx: property (toolTip), widget (QSpinBox, spinBox_fontSize)
#: po/rc.cpp:57 rc.cpp:57
msgid "Set font size"
msgstr ""
#. i18n: file: configwindow.ui:420
#. i18n: ectx: property (text), widget (QLabel, label_fontColor)
#: po/rc.cpp:60 rc.cpp:60
msgid "Font color"
msgstr ""
#. i18n: file: configwindow.ui:452
#. i18n: ectx: property (toolTip), widget (KColorCombo, kcolorcombo_fontColor)
#: po/rc.cpp:63 rc.cpp:63
msgid "Set font color"
msgstr ""
#. i18n: file: configwindow.ui:469
#. i18n: ectx: property (text), widget (QLabel, label_fontWeight)
#: po/rc.cpp:66 rc.cpp:66
msgid "Font weight"
msgstr ""
#. i18n: file: configwindow.ui:501
#. i18n: ectx: property (toolTip), widget (QSpinBox, spinBox_fontWeight)
#: po/rc.cpp:69 rc.cpp:69
msgid "Set font weight"
msgstr ""
#. i18n: file: configwindow.ui:533
#. i18n: ectx: property (text), widget (QLabel, label_fontStyle)
#: po/rc.cpp:72 rc.cpp:72
msgid "Font style"
msgstr ""
#. i18n: file: configwindow.ui:565
#. i18n: ectx: property (toolTip), widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:75 rc.cpp:75
msgid "Set font style"
msgstr ""
#. i18n: file: configwindow.ui:569
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:78 rc.cpp:78
msgid "normal"
msgstr ""
#. i18n: file: configwindow.ui:574
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:81 rc.cpp:81
msgid "italic"
msgstr ""
#. i18n: file: configwindow.ui:605
#. i18n: ectx: property (text), widget (QLabel, label_activeIcon)
#: po/rc.cpp:84 rc.cpp:84
msgid "Active icon"
msgstr ""
#. i18n: file: configwindow.ui:638
#. i18n: file: appearance.ui:47
#. i18n: ectx: property (text), widget (QLabel, label_inactiveIcon)
#: po/rc.cpp:90 rc.cpp:90
#: po/rc.cpp:3 rc.cpp:3
msgid "Inactive icon"
msgstr ""
#: po/rc.cpp:94 rc.cpp:94
#. i18n: file: appearance.ui:63
#. i18n: ectx: property (text), widget (QPushButton, pushButton_inactiveIcon)
#. i18n: file: appearance.ui:391
#. i18n: ectx: property (text), widget (QPushButton, pushButton_activeIcon)
#. i18n: file: dataengine.ui:50
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: dataengine.ui:83
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto)
#. i18n: file: dataengine.ui:116
#. i18n: ectx: property (text), widget (QPushButton, pushButton_ip)
#. i18n: file: dataengine.ui:149
#. i18n: ectx: property (text), widget (QPushButton, pushButton_interface)
#. i18n: file: dataengine.ui:185
#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp)
#. i18n: file: widget.ui:118
#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui)
#. i18n: file: widget.ui:151
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: widget.ui:184
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto)
#. i18n: file: widget.ui:220
#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo)
#. i18n: file: widget.ui:256
#. i18n: ectx: property (text), widget (QPushButton, pushButton_wifi)
#. i18n: file: appearance.ui:63
#. i18n: ectx: property (text), widget (QPushButton, pushButton_inactiveIcon)
#. i18n: file: appearance.ui:391
#. i18n: ectx: property (text), widget (QPushButton, pushButton_activeIcon)
#. i18n: file: dataengine.ui:50
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: dataengine.ui:83
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto)
#. i18n: file: dataengine.ui:116
#. i18n: ectx: property (text), widget (QPushButton, pushButton_ip)
#. i18n: file: dataengine.ui:149
#. i18n: ectx: property (text), widget (QPushButton, pushButton_interface)
#. i18n: file: dataengine.ui:185
#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp)
#. i18n: file: widget.ui:118
#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui)
#. i18n: file: widget.ui:151
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: widget.ui:184
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto)
#. i18n: file: widget.ui:220
#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo)
#. i18n: file: widget.ui:256
#. i18n: ectx: property (text), widget (QPushButton, pushButton_wifi)
#: po/rc.cpp:6 po/rc.cpp:48 po/rc.cpp:54 po/rc.cpp:60 po/rc.cpp:66
#: po/rc.cpp:72 po/rc.cpp:78 po/rc.cpp:87 po/rc.cpp:93 po/rc.cpp:99
#: po/rc.cpp:105 po/rc.cpp:111 rc.cpp:6 rc.cpp:48 rc.cpp:54 rc.cpp:60
#: rc.cpp:66 rc.cpp:72 rc.cpp:78 rc.cpp:87 rc.cpp:93 rc.cpp:99 rc.cpp:105
#: rc.cpp:111
msgid "Browse"
msgstr ""
#. i18n: file: appearance.ui:80
#. i18n: ectx: property (text), widget (QLabel, label_fontColor)
#: po/rc.cpp:9 rc.cpp:9
msgid "Font color"
msgstr ""
#. i18n: file: appearance.ui:112
#. i18n: ectx: property (toolTip), widget (KColorCombo, kcolorcombo_fontColor)
#: po/rc.cpp:12 rc.cpp:12
msgid "Set font color"
msgstr ""
#. i18n: file: appearance.ui:142
#. i18n: ectx: property (text), widget (QLabel, label_fontSize)
#: po/rc.cpp:15 rc.cpp:15
msgid "Font size"
msgstr ""
#. i18n: file: appearance.ui:174
#. i18n: ectx: property (toolTip), widget (QSpinBox, spinBox_fontSize)
#: po/rc.cpp:18 rc.cpp:18
msgid "Set font size"
msgstr ""
#. i18n: file: appearance.ui:203
#. i18n: ectx: property (text), widget (QLabel, label_fontWeight)
#: po/rc.cpp:21 rc.cpp:21
msgid "Font weight"
msgstr ""
#. i18n: file: appearance.ui:235
#. i18n: ectx: property (toolTip), widget (QSpinBox, spinBox_fontWeight)
#: po/rc.cpp:24 rc.cpp:24
msgid "Set font weight"
msgstr ""
#. i18n: file: appearance.ui:267
#. i18n: ectx: property (text), widget (QLabel, label_fontStyle)
#: po/rc.cpp:27 rc.cpp:27
msgid "Font style"
msgstr ""
#. i18n: file: appearance.ui:299
#. i18n: ectx: property (toolTip), widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:30 rc.cpp:30
msgid "Set font style"
msgstr ""
#. i18n: file: appearance.ui:303
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:33 rc.cpp:33
msgid "normal"
msgstr ""
#. i18n: file: appearance.ui:308
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:36 rc.cpp:36
msgid "italic"
msgstr ""
#. i18n: file: appearance.ui:326
#. i18n: ectx: property (text), widget (QLabel, label_font)
#: po/rc.cpp:39 rc.cpp:39
msgid "Font"
msgstr ""
#. i18n: file: appearance.ui:358
#. i18n: ectx: property (toolTip), widget (QFontComboBox, fontComboBox_font)
#: po/rc.cpp:42 rc.cpp:42
msgid "Set font family"
msgstr ""
#. i18n: file: appearance.ui:375
#. i18n: ectx: property (text), widget (QLabel, label_activeIcon)
#: po/rc.cpp:45 rc.cpp:45
msgid "Active icon"
msgstr ""
#. i18n: file: dataengine.ui:34
#. i18n: ectx: property (text), widget (QLabel, label_netctl)
#. i18n: file: widget.ui:135
#. i18n: ectx: property (text), widget (QLabel, label_netctl)
#. i18n: file: dataengine.ui:34
#. i18n: ectx: property (text), widget (QLabel, label_netctl)
#. i18n: file: widget.ui:135
#. i18n: ectx: property (text), widget (QLabel, label_netctl)
#: po/rc.cpp:51 po/rc.cpp:90 rc.cpp:51 rc.cpp:90
msgid "Path to netctl"
msgstr ""
#. i18n: file: dataengine.ui:67
#. i18n: ectx: property (text), widget (QLabel, label_netctlAuto)
#. i18n: file: widget.ui:168
#. i18n: ectx: property (text), widget (QLabel, label_netctlAuto)
#. i18n: file: dataengine.ui:67
#. i18n: ectx: property (text), widget (QLabel, label_netctlAuto)
#. i18n: file: widget.ui:168
#. i18n: ectx: property (text), widget (QLabel, label_netctlAuto)
#: po/rc.cpp:57 po/rc.cpp:96 rc.cpp:57 rc.cpp:96
msgid "Path to netctl-auto"
msgstr ""
#. i18n: file: dataengine.ui:100
#. i18n: ectx: property (text), widget (QLabel, label_ip)
#: po/rc.cpp:63 rc.cpp:63
msgid "Path to ip"
msgstr ""
#. i18n: file: dataengine.ui:133
#. i18n: ectx: property (text), widget (QLabel, label_interface)
#: po/rc.cpp:69 rc.cpp:69
msgid "Path to interface list"
msgstr ""
#. i18n: file: dataengine.ui:166
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_extIp)
#: po/rc.cpp:75 rc.cpp:75
msgid "Check external IP"
msgstr ""
#. i18n: file: widget.ui:44
#. i18n: ectx: property (text), widget (QLabel, label_autoUpdate)
#: po/rc.cpp:81 rc.cpp:81
msgid "Auto update interval, msec"
msgstr ""
#. i18n: file: widget.ui:102
#. i18n: ectx: property (text), widget (QLabel, label_gui)
#: po/rc.cpp:84 rc.cpp:84
msgid "Path to GUI"
msgstr ""
#. i18n: file: widget.ui:201
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_sudo)
#: po/rc.cpp:102 rc.cpp:102
msgid "Use sudo for netctl"
msgstr ""
#. i18n: file: widget.ui:237
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_wifi)
#: po/rc.cpp:108 rc.cpp:108
msgid "Show 'Start WiFi menu'"
msgstr ""
#. i18n: file: widget.ui:265
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showBigInterface)
#: po/rc.cpp:114 rc.cpp:114
msgid "Show more detailed interface"
msgstr ""
#. i18n: file: widget.ui:275
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showNetDev)
#: po/rc.cpp:117 rc.cpp:117
msgid "Show network devices"
msgstr ""
#. i18n: file: widget.ui:285
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showExtIp)
#: po/rc.cpp:120 rc.cpp:120
msgid "Show external IP"
msgstr ""
#. i18n: file: widget.ui:295
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showIntIp)
#: po/rc.cpp:123 rc.cpp:123
msgid "Show internal IP"
msgstr ""
#: po/rc.cpp:124 rc.cpp:124
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr ""
#: po/rc.cpp:95 rc.cpp:95
#: po/rc.cpp:125 rc.cpp:125
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr ""

View File

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: http://kde-look.org/content/show.php?content=98925\n"
"POT-Creation-Date: 2014-04-12 18:56+0400\n"
"PO-Revision-Date: 2014-04-12 18:58+0400\n"
"POT-Creation-Date: 2014-07-14 18:33+0400\n"
"PO-Revision-Date: 2014-07-14 18:35+0400\n"
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
"Language-Team: Russian <kde-russian@lists.kde.ru>\n"
"Language: ru\n"
@ -18,272 +18,385 @@ msgstr ""
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 1.5\n"
#: netctl.cpp:112
#: netctl.cpp:179
msgid "Set profile %1 disabled"
msgstr "Выключение автозагрузки профиля %1"
#: netctl.cpp:116
#: netctl.cpp:183
msgid "Set profile %1 enabled"
msgstr "Включение автозагрузки профиля %1"
#: netctl.cpp:132
#: netctl.cpp:200
msgid "Start profile %1"
msgstr "Запуск профиля %1"
#: netctl.cpp:151
#: netctl.cpp:228
msgid "Stop profile %1"
msgstr "Остановка профиля %1"
#: netctl.cpp:165
#: netctl.cpp:243
msgid "Switch to profile %1"
msgstr "Переключиться на профиль %1"
#: netctl.cpp:254
msgid "Restart profile %1"
msgstr "Перезапуск профиля %1"
#: netctl.cpp:178
#: netctl.cpp:293
msgid "Start another profile"
msgstr "Запустить другой профиль"
#: netctl.cpp:180
msgid "Stop "
msgstr "Остановить "
#: netctl.cpp:295
msgid "Stop %1"
msgstr "Остановить %1"
#: netctl.cpp:182
msgid "Restart "
msgstr "Перезапустить "
#: netctl.cpp:297
msgid "Restart %1"
msgstr "Перезапустить %1"
#: netctl.cpp:185
msgid "Disable "
msgstr "Отключить "
#: netctl.cpp:300
msgid "Disable %1"
msgstr "Отключить %1"
#: netctl.cpp:187
msgid "Enable "
msgstr "Включить "
#: netctl.cpp:302
msgid "Enable %1"
msgstr "Включить %1"
#: netctl.cpp:190 netctl.cpp:214
#: netctl.cpp:305 netctl.cpp:333
msgid "Start profile"
msgstr "Запустить профиль"
#: netctl.cpp:221
#: netctl.cpp:341
msgid "Stop profile"
msgstr "Остановить профиль"
#: netctl.cpp:225
#: netctl.cpp:346
msgid "Switch to profile"
msgstr "Переключить профиль"
#: netctl.cpp:354
msgid "Restart profile"
msgstr "Перезапустить профиль"
#: netctl.cpp:229
#: netctl.cpp:359
msgid "Enable profile"
msgstr "Включить профиль"
#: netctl.cpp:233
#: netctl.cpp:363
msgid "Show WiFi menu"
msgstr "Запустить WiFi-menu"
#: netctl.cpp:253
#: netctl.cpp:384
msgid "Start GUI"
msgstr "Запуск GUI"
#: netctl.cpp:261
#: netctl.cpp:392
msgid "Start WiFi menu"
msgstr "Запуск WiFi-menu"
#: netctl.cpp:325
#: netctl.cpp:456
msgid "Network is up"
msgstr "Сеть работает"
#: netctl.cpp:331
#: netctl.cpp:462
msgid "Network is down"
msgstr "Сеть не работает"
#: netctl.cpp:468
#: netctl.cpp:666
msgid ""
"Version %1\n"
"(build date %2)"
msgstr ""
"Версия %1\n"
"(дата сборки %2)"
#: netctl.cpp:667
msgid "KDE widget which interacts with netctl."
msgstr "Виджет KDE, который взаимодействует с netctl."
#: netctl.cpp:668
msgid "Links:"
msgstr "Ссылки:"
#: netctl.cpp:669
msgid "Homepage"
msgstr "Домашняя страница"
#: netctl.cpp:670
msgid "Repository"
msgstr "Репозиторий"
#: netctl.cpp:671
msgid "Bugtracker"
msgstr "Багтрекер"
#: netctl.cpp:672
msgid "Translation issue"
msgstr "Тикет перевода"
#: netctl.cpp:673
msgid "AUR packages"
msgstr "Пакеты в AUR"
#: netctl.cpp:675
msgid "This software is licensed under %1"
msgstr "Данное программное обеспечение лицензировано под %1"
#: netctl.cpp:678
msgid "Netctl plasmoid"
msgstr "Netctl plasmoid"
#. i18n: file: configwindow.ui:30
#. i18n: ectx: attribute (title), widget (QWidget, tabConfiguration)
#: po/rc.cpp:3 rc.cpp:3
msgid "Configuration"
msgstr "Настройка"
#. i18n: file: configwindow.ui:54
#. i18n: ectx: property (text), widget (QLabel, label_autoUpdate)
#: po/rc.cpp:6 rc.cpp:6
msgid "Auto update interval, msec"
msgstr "Интервал автообновления, мсек"
#. i18n: file: configwindow.ui:112
#. i18n: ectx: property (text), widget (QLabel, label_gui)
#: po/rc.cpp:9 rc.cpp:9
msgid "Path to GUI"
msgstr "Путь к GUI"
#. i18n: file: configwindow.ui:128
#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui)
#. i18n: file: configwindow.ui:161
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: configwindow.ui:197
#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo)
#. i18n: file: configwindow.ui:233
#. i18n: ectx: property (text), widget (QPushButton, pushButton_wifi)
#. i18n: file: configwindow.ui:621
#. i18n: ectx: property (text), widget (QPushButton, pushButton_activeIcon)
#. i18n: file: configwindow.ui:654
#. i18n: ectx: property (text), widget (QPushButton, pushButton_inactiveIcon)
#. i18n: file: configwindow.ui:128
#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui)
#. i18n: file: configwindow.ui:161
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: configwindow.ui:197
#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo)
#. i18n: file: configwindow.ui:233
#. i18n: ectx: property (text), widget (QPushButton, pushButton_wifi)
#. i18n: file: configwindow.ui:621
#. i18n: ectx: property (text), widget (QPushButton, pushButton_activeIcon)
#. i18n: file: configwindow.ui:654
#. i18n: ectx: property (text), widget (QPushButton, pushButton_inactiveIcon)
#: po/rc.cpp:12 po/rc.cpp:18 po/rc.cpp:24 po/rc.cpp:30 po/rc.cpp:87
#: po/rc.cpp:93 rc.cpp:12 rc.cpp:18 rc.cpp:24 rc.cpp:30 rc.cpp:87 rc.cpp:93
msgid "Browse"
msgstr "Обзор"
#. i18n: file: configwindow.ui:145
#. i18n: ectx: property (text), widget (QLabel, label_netctl)
#: po/rc.cpp:15 rc.cpp:15
msgid "Path to netctl"
msgstr "Путь к netctl"
#. i18n: file: configwindow.ui:178
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_sudo)
#: po/rc.cpp:21 rc.cpp:21
msgid "Use sudo for netctl"
msgstr "Использовать sudo для netctl"
#. i18n: file: configwindow.ui:214
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_wifi)
#: po/rc.cpp:27 rc.cpp:27
msgid "Show 'Start WiFi menu'"
msgstr "Показать 'Запустить WiFi-menu'"
#. i18n: file: configwindow.ui:242
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showBigInterface)
#: po/rc.cpp:33 rc.cpp:33
msgid "Show more detailed interface"
msgstr "Показать более детальный интерфейс"
#. i18n: file: configwindow.ui:252
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showNetDev)
#: po/rc.cpp:36 rc.cpp:36
msgid "Show network devices"
msgstr "Показать сетевые устройства"
#. i18n: file: configwindow.ui:262
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showExtIp)
#: po/rc.cpp:39 rc.cpp:39
msgid "Show external IP"
msgstr "Показать внешний IP"
#. i18n: file: configwindow.ui:272
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showIntIp)
#: po/rc.cpp:42 rc.cpp:42
msgid "Show internal IP"
msgstr "Показать внутренний IP"
#. i18n: file: configwindow.ui:296
#. i18n: ectx: attribute (title), widget (QWidget, tabAppearance)
#: po/rc.cpp:45 rc.cpp:45
#: netctl.cpp:679
msgid "Appearance"
msgstr "Внешний вид"
#. i18n: file: configwindow.ui:310
#. i18n: ectx: property (text), widget (QLabel, label_font)
#: po/rc.cpp:48 rc.cpp:48
msgid "Font"
msgstr "Шрифт"
#: netctl.cpp:680
msgid "DataEngine"
msgstr "DataEngine"
#. i18n: file: configwindow.ui:342
#. i18n: ectx: property (toolTip), widget (QFontComboBox, fontComboBox_font)
#: po/rc.cpp:51 rc.cpp:51
msgid "Set font family"
msgstr "Укажите шрифт"
#: netctl.cpp:681
msgid "About"
msgstr "О программе"
#. i18n: file: configwindow.ui:359
#. i18n: ectx: property (text), widget (QLabel, label_fontSize)
#: po/rc.cpp:54 rc.cpp:54
msgid "Font size"
msgstr "Размер шрифта"
#. i18n: file: configwindow.ui:391
#. i18n: ectx: property (toolTip), widget (QSpinBox, spinBox_fontSize)
#: po/rc.cpp:57 rc.cpp:57
msgid "Set font size"
msgstr "Укажите размер шрифта"
#. i18n: file: configwindow.ui:420
#. i18n: ectx: property (text), widget (QLabel, label_fontColor)
#: po/rc.cpp:60 rc.cpp:60
msgid "Font color"
msgstr "Цвет шрифта"
#. i18n: file: configwindow.ui:452
#. i18n: ectx: property (toolTip), widget (KColorCombo, kcolorcombo_fontColor)
#: po/rc.cpp:63 rc.cpp:63
msgid "Set font color"
msgstr "Укажите цвет шрифта"
#. i18n: file: configwindow.ui:469
#. i18n: ectx: property (text), widget (QLabel, label_fontWeight)
#: po/rc.cpp:66 rc.cpp:66
msgid "Font weight"
msgstr "Толщина шрифта"
#. i18n: file: configwindow.ui:501
#. i18n: ectx: property (toolTip), widget (QSpinBox, spinBox_fontWeight)
#: po/rc.cpp:69 rc.cpp:69
msgid "Set font weight"
msgstr "Укажите ширину шрифта"
#. i18n: file: configwindow.ui:533
#. i18n: ectx: property (text), widget (QLabel, label_fontStyle)
#: po/rc.cpp:72 rc.cpp:72
msgid "Font style"
msgstr "Стиль шрифта"
#. i18n: file: configwindow.ui:565
#. i18n: ectx: property (toolTip), widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:75 rc.cpp:75
msgid "Set font style"
msgstr "Укажите стиль шрифта"
#. i18n: file: configwindow.ui:569
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:78 rc.cpp:78
msgid "normal"
msgstr "normal"
#. i18n: file: configwindow.ui:574
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:81 rc.cpp:81
msgid "italic"
msgstr "italic"
#. i18n: file: configwindow.ui:605
#. i18n: ectx: property (text), widget (QLabel, label_activeIcon)
#: po/rc.cpp:84 rc.cpp:84
msgid "Active icon"
msgstr "Иконка активного подключения"
#. i18n: file: configwindow.ui:638
#. i18n: file: appearance.ui:47
#. i18n: ectx: property (text), widget (QLabel, label_inactiveIcon)
#: po/rc.cpp:90 rc.cpp:90
#: po/rc.cpp:3 rc.cpp:3
msgid "Inactive icon"
msgstr "Иконка неактивного подключения"
#: po/rc.cpp:94 rc.cpp:94
#. i18n: file: appearance.ui:63
#. i18n: ectx: property (text), widget (QPushButton, pushButton_inactiveIcon)
#. i18n: file: appearance.ui:391
#. i18n: ectx: property (text), widget (QPushButton, pushButton_activeIcon)
#. i18n: file: dataengine.ui:50
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: dataengine.ui:83
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto)
#. i18n: file: dataengine.ui:116
#. i18n: ectx: property (text), widget (QPushButton, pushButton_ip)
#. i18n: file: dataengine.ui:149
#. i18n: ectx: property (text), widget (QPushButton, pushButton_interface)
#. i18n: file: dataengine.ui:185
#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp)
#. i18n: file: widget.ui:118
#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui)
#. i18n: file: widget.ui:151
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: widget.ui:184
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto)
#. i18n: file: widget.ui:220
#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo)
#. i18n: file: widget.ui:256
#. i18n: ectx: property (text), widget (QPushButton, pushButton_wifi)
#. i18n: file: appearance.ui:63
#. i18n: ectx: property (text), widget (QPushButton, pushButton_inactiveIcon)
#. i18n: file: appearance.ui:391
#. i18n: ectx: property (text), widget (QPushButton, pushButton_activeIcon)
#. i18n: file: dataengine.ui:50
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: dataengine.ui:83
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto)
#. i18n: file: dataengine.ui:116
#. i18n: ectx: property (text), widget (QPushButton, pushButton_ip)
#. i18n: file: dataengine.ui:149
#. i18n: ectx: property (text), widget (QPushButton, pushButton_interface)
#. i18n: file: dataengine.ui:185
#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp)
#. i18n: file: widget.ui:118
#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui)
#. i18n: file: widget.ui:151
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl)
#. i18n: file: widget.ui:184
#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto)
#. i18n: file: widget.ui:220
#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo)
#. i18n: file: widget.ui:256
#. i18n: ectx: property (text), widget (QPushButton, pushButton_wifi)
#: po/rc.cpp:6 po/rc.cpp:48 po/rc.cpp:54 po/rc.cpp:60 po/rc.cpp:66
#: po/rc.cpp:72 po/rc.cpp:78 po/rc.cpp:87 po/rc.cpp:93 po/rc.cpp:99
#: po/rc.cpp:105 po/rc.cpp:111 rc.cpp:6 rc.cpp:48 rc.cpp:54 rc.cpp:60
#: rc.cpp:66 rc.cpp:72 rc.cpp:78 rc.cpp:87 rc.cpp:93 rc.cpp:99 rc.cpp:105
#: rc.cpp:111
msgid "Browse"
msgstr "Обзор"
#. i18n: file: appearance.ui:80
#. i18n: ectx: property (text), widget (QLabel, label_fontColor)
#: po/rc.cpp:9 rc.cpp:9
msgid "Font color"
msgstr "Цвет шрифта"
#. i18n: file: appearance.ui:112
#. i18n: ectx: property (toolTip), widget (KColorCombo, kcolorcombo_fontColor)
#: po/rc.cpp:12 rc.cpp:12
msgid "Set font color"
msgstr "Укажите цвет шрифта"
#. i18n: file: appearance.ui:142
#. i18n: ectx: property (text), widget (QLabel, label_fontSize)
#: po/rc.cpp:15 rc.cpp:15
msgid "Font size"
msgstr "Размер шрифта"
#. i18n: file: appearance.ui:174
#. i18n: ectx: property (toolTip), widget (QSpinBox, spinBox_fontSize)
#: po/rc.cpp:18 rc.cpp:18
msgid "Set font size"
msgstr "Укажите размер шрифта"
#. i18n: file: appearance.ui:203
#. i18n: ectx: property (text), widget (QLabel, label_fontWeight)
#: po/rc.cpp:21 rc.cpp:21
msgid "Font weight"
msgstr "Толщина шрифта"
#. i18n: file: appearance.ui:235
#. i18n: ectx: property (toolTip), widget (QSpinBox, spinBox_fontWeight)
#: po/rc.cpp:24 rc.cpp:24
msgid "Set font weight"
msgstr "Укажите ширину шрифта"
#. i18n: file: appearance.ui:267
#. i18n: ectx: property (text), widget (QLabel, label_fontStyle)
#: po/rc.cpp:27 rc.cpp:27
msgid "Font style"
msgstr "Стиль шрифта"
#. i18n: file: appearance.ui:299
#. i18n: ectx: property (toolTip), widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:30 rc.cpp:30
msgid "Set font style"
msgstr "Укажите стиль шрифта"
#. i18n: file: appearance.ui:303
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:33 rc.cpp:33
msgid "normal"
msgstr "normal"
#. i18n: file: appearance.ui:308
#. i18n: ectx: property (text), item, widget (QComboBox, comboBox_fontStyle)
#: po/rc.cpp:36 rc.cpp:36
msgid "italic"
msgstr "italic"
#. i18n: file: appearance.ui:326
#. i18n: ectx: property (text), widget (QLabel, label_font)
#: po/rc.cpp:39 rc.cpp:39
msgid "Font"
msgstr "Шрифт"
#. i18n: file: appearance.ui:358
#. i18n: ectx: property (toolTip), widget (QFontComboBox, fontComboBox_font)
#: po/rc.cpp:42 rc.cpp:42
msgid "Set font family"
msgstr "Укажите шрифт"
#. i18n: file: appearance.ui:375
#. i18n: ectx: property (text), widget (QLabel, label_activeIcon)
#: po/rc.cpp:45 rc.cpp:45
msgid "Active icon"
msgstr "Иконка активного подключения"
#. i18n: file: dataengine.ui:34
#. i18n: ectx: property (text), widget (QLabel, label_netctl)
#. i18n: file: widget.ui:135
#. i18n: ectx: property (text), widget (QLabel, label_netctl)
#. i18n: file: dataengine.ui:34
#. i18n: ectx: property (text), widget (QLabel, label_netctl)
#. i18n: file: widget.ui:135
#. i18n: ectx: property (text), widget (QLabel, label_netctl)
#: po/rc.cpp:51 po/rc.cpp:90 rc.cpp:51 rc.cpp:90
msgid "Path to netctl"
msgstr "Путь к netctl"
#. i18n: file: dataengine.ui:67
#. i18n: ectx: property (text), widget (QLabel, label_netctlAuto)
#. i18n: file: widget.ui:168
#. i18n: ectx: property (text), widget (QLabel, label_netctlAuto)
#. i18n: file: dataengine.ui:67
#. i18n: ectx: property (text), widget (QLabel, label_netctlAuto)
#. i18n: file: widget.ui:168
#. i18n: ectx: property (text), widget (QLabel, label_netctlAuto)
#: po/rc.cpp:57 po/rc.cpp:96 rc.cpp:57 rc.cpp:96
msgid "Path to netctl-auto"
msgstr "Путь к netctl-auto"
#. i18n: file: dataengine.ui:100
#. i18n: ectx: property (text), widget (QLabel, label_ip)
#: po/rc.cpp:63 rc.cpp:63
msgid "Path to ip"
msgstr "Путь к ip"
#. i18n: file: dataengine.ui:133
#. i18n: ectx: property (text), widget (QLabel, label_interface)
#: po/rc.cpp:69 rc.cpp:69
msgid "Path to interface list"
msgstr "Путь к интерфейсам"
#. i18n: file: dataengine.ui:166
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_extIp)
#: po/rc.cpp:75 rc.cpp:75
msgid "Check external IP"
msgstr "Проверять внешний IP"
#. i18n: file: widget.ui:44
#. i18n: ectx: property (text), widget (QLabel, label_autoUpdate)
#: po/rc.cpp:81 rc.cpp:81
msgid "Auto update interval, msec"
msgstr "Интервал автообновления, мсек"
#. i18n: file: widget.ui:102
#. i18n: ectx: property (text), widget (QLabel, label_gui)
#: po/rc.cpp:84 rc.cpp:84
msgid "Path to GUI"
msgstr "Путь к GUI"
#. i18n: file: widget.ui:201
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_sudo)
#: po/rc.cpp:102 rc.cpp:102
msgid "Use sudo for netctl"
msgstr "Использовать sudo для netctl"
#. i18n: file: widget.ui:237
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_wifi)
#: po/rc.cpp:108 rc.cpp:108
msgid "Show 'Start WiFi menu'"
msgstr "Показать 'Запустить WiFi-menu'"
#. i18n: file: widget.ui:265
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showBigInterface)
#: po/rc.cpp:114 rc.cpp:114
msgid "Show more detailed interface"
msgstr "Показать более детальный интерфейс"
#. i18n: file: widget.ui:275
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showNetDev)
#: po/rc.cpp:117 rc.cpp:117
msgid "Show network devices"
msgstr "Показать сетевые устройства"
#. i18n: file: widget.ui:285
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showExtIp)
#: po/rc.cpp:120 rc.cpp:120
msgid "Show external IP"
msgstr "Показать внешний IP"
#. i18n: file: widget.ui:295
#. i18n: ectx: property (text), widget (QCheckBox, checkBox_showIntIp)
#: po/rc.cpp:123 rc.cpp:123
msgid "Show internal IP"
msgstr "Показать внутренний IP"
#: po/rc.cpp:124 rc.cpp:124
msgctxt "NAME OF TRANSLATORS"
msgid "Your names"
msgstr "Evgeniy Alekseev"
#: po/rc.cpp:95 rc.cpp:95
#: po/rc.cpp:125 rc.cpp:125
msgctxt "EMAIL OF TRANSLATORS"
msgid "Your emails"
msgstr "esalexeev@gmail.com"
#~ msgid "Configuration"
#~ msgstr "Настройка"

332
sources/plasmoid/widget.ui Normal file
View File

@ -0,0 +1,332 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ConfigWindow</class>
<widget class="QWidget" name="ConfigWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>480</width>
<height>339</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>480</width>
<height>320</height>
</size>
</property>
<property name="windowTitle">
<string notr="true">Configuration Window</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_info">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="layout_autoUpdate">
<item>
<widget class="QLabel" name="label_autoUpdate">
<property name="minimumSize">
<size>
<width>150</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Auto update interval, msec</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_autoUpdate">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBox_autoUpdate">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>333</number>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="singleStep">
<number>500</number>
</property>
<property name="value">
<number>1000</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_gui">
<item>
<widget class="QLabel" name="label_gui">
<property name="minimumSize">
<size>
<width>150</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>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_netctl">
<item>
<widget class="QLabel" name="label_netctl">
<property name="minimumSize">
<size>
<width>150</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Path to netctl</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_netctl"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_netctl">
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_netctlAuto">
<item>
<widget class="QLabel" name="label_netctlAuto">
<property name="minimumSize">
<size>
<width>150</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Path to netctl-auto</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_netctlAuto"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_netctlAuto">
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_sudo">
<item>
<widget class="QCheckBox" name="checkBox_sudo">
<property name="minimumSize">
<size>
<width>150</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Use sudo for netctl</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_sudo"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_sudo">
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_wifi">
<item>
<widget class="QCheckBox" name="checkBox_wifi">
<property name="minimumSize">
<size>
<width>150</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Show 'Start WiFi menu'</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_wifi"/>
</item>
<item>
<widget class="QPushButton" name="pushButton_wifi">
<property name="minimumSize">
<size>
<width>100</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBox_showBigInterface">
<property name="text">
<string>Show more detailed interface</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_showNetDev">
<property name="text">
<string>Show network devices</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_showExtIp">
<property name="text">
<string>Show external IP</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_showIntIp">
<property name="text">
<string>Show internal IP</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_configuration">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<tabstops>
<tabstop>spinBox_autoUpdate</tabstop>
<tabstop>lineEdit_gui</tabstop>
<tabstop>pushButton_gui</tabstop>
<tabstop>lineEdit_netctl</tabstop>
<tabstop>pushButton_netctl</tabstop>
<tabstop>checkBox_sudo</tabstop>
<tabstop>lineEdit_sudo</tabstop>
<tabstop>pushButton_sudo</tabstop>
<tabstop>checkBox_wifi</tabstop>
<tabstop>lineEdit_wifi</tabstop>
<tabstop>pushButton_wifi</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@ -1,5 +1,5 @@
# set project name
set (SUBPROJECT netctl-gui-icons)
set (SUBPROJECT netctl-gui-resources)
message (STATUS "Subproject ${SUBPROJECT}")
if (BUILD_GUI)

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -0,0 +1,7 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<!-- icons -->
<file>icon.png</file>
<file>wifi.png</file>
</qresource>
</RCC>

View File

@ -0,0 +1,10 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<!-- gui translations -->
<file>translations/en.qm</file>
<file>translations/ru.qm</file>
<!-- icons -->
<file>icon.png</file>
<file>wifi.png</file>
</qresource>
</RCC>

View File

@ -1,6 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="en">
<context>
<name>AboutWindow</name>
<message>
<source>Version %1
(build date %2)</source>
<translation>Version %1
(build date %2)</translation>
</message>
<message>
<source>Qt-based graphical interface for netctl.</source>
<translation>Qt-based graphical interface for netctl.</translation>
</message>
<message>
<source>Links:</source>
<translation>Links:</translation>
</message>
<message>
<source>Homepage</source>
<translation>Homepage</translation>
</message>
<message>
<source>Repository</source>
<translation>Repository</translation>
</message>
<message>
<source>Bugtracker</source>
<translation>Bugtracker</translation>
</message>
<message>
<source>Translation issue</source>
<translation>Translation issue</translation>
</message>
<message>
<source>AUR packages</source>
<translation>AUR packages</translation>
</message>
<message>
<source>This software is licensed under %1</source>
<translation>This software is licensed under %1</translation>
</message>
<message>
<source>About</source>
<translation>About</translation>
</message>
</context>
<context>
<name>BridgeWidget</name>
<message>
@ -88,15 +133,31 @@
</message>
<message>
<source>Error</source>
<translation>Error</translation>
<translation type="obsolete">Error</translation>
</message>
<message>
<source>Error text</source>
<translation>Error text</translation>
<translation type="obsolete">Error text</translation>
</message>
<message>
<source>Ok</source>
<translation>Ok</translation>
<translation type="obsolete">Ok</translation>
</message>
<message>
<source>Error!</source>
<translation>Error!</translation>
</message>
<message>
<source>Could not find profile</source>
<translation>Could not find profile</translation>
</message>
<message>
<source>Could not find ESSID</source>
<translation>Could not find ESSID</translation>
</message>
<message>
<source>Sender : %1</source>
<translation>Sender : %1</translation>
</message>
</context>
<context>
@ -484,6 +545,33 @@
<translation>Maximum time, in seconds, to wait for IPv6s Duplicate Address Detection to succeed</translation>
</message>
</context>
<context>
<name>MacvlanWidget</name>
<message>
<source>Form</source>
<translation>Form</translation>
</message>
<message>
<source>macvlan settings</source>
<translation>macvlan settings</translation>
</message>
<message>
<source>Mode</source>
<translation>Mode</translation>
</message>
<message>
<source>MAC address</source>
<translation>MAC address</translation>
</message>
<message>
<source>Only connect to specified MAC address</source>
<translation type="obsolete">Only connect to specified MAC address</translation>
</message>
<message>
<source>Optional static MAC address</source>
<translation>Optional static MAC address</translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
@ -512,82 +600,82 @@
</message>
<message>
<source>Disable</source>
<translation>Disable</translation>
<translation type="obsolete">Disable</translation>
</message>
<message>
<source>Enable</source>
<translation>Enable</translation>
<translation type="obsolete">Enable</translation>
</message>
<message>
<source>Save profile as...</source>
<translation>Save profile as...</translation>
<translation type="obsolete">Save profile as...</translation>
</message>
<message>
<source>Profile (*)</source>
<translation>Profile (*)</translation>
<translation type="obsolete">Profile (*)</translation>
</message>
<message>
<source> Netctl GUI
</source>
<translation> Netctl GUI
<translation type="obsolete"> Netctl GUI
</translation>
</message>
<message>
<source>Version : %1 License : GPLv3
</source>
<translation>Version : %1 License : GPLv3
<translation type="obsolete">Version : %1 License : GPLv3
</translation>
</message>
<message>
<source> Evgeniy Alekseev aka arcanis
</source>
<translation> Evgeniy Alekseev aka arcanis
<translation type="obsolete"> Evgeniy Alekseev aka arcanis
</translation>
</message>
<message>
<source> E-mail : esalexeev@gmail.com
</source>
<translation> E-mail : esalexeev@gmail.com
<translation type="obsolete"> E-mail : esalexeev@gmail.com
</translation>
</message>
<message>
<source>Usage:
</source>
<translation>Usage:
<translation type="obsolete">Usage:
</translation>
</message>
<message>
<source>netctl-gui [ --default ] [ -t NUM | --tab NUM ] [ -h | --help]
</source>
<translation>netctl-gui [ --default ] [ -t NUM | --tab NUM ] [ -h | --help]
<translation type="obsolete">netctl-gui [ --default ] [ -t NUM | --tab NUM ] [ -h | --help]
</translation>
</message>
<message>
<source>Parametrs:
</source>
<translation>Parametrs:
<translation type="obsolete">Parametrs:
</translation>
</message>
<message>
<source> --default - start with default settings
</source>
<translation> --default - start with default settings
<translation type="obsolete"> --default - start with default settings
</translation>
</message>
<message>
<source> -t NUM --tab NUM - open a tab with number NUM
</source>
<translation> -t NUM --tab NUM - open a tab with number NUM
<translation type="obsolete"> -t NUM --tab NUM - open a tab with number NUM
</translation>
</message>
<message>
<source> -h --help - show this help and exit
</source>
<translation> -h --help - show this help and exit
<translation type="obsolete"> -h --help - show this help and exit
</translation>
</message>
<message>
@ -644,7 +732,7 @@
</message>
<message>
<source>Browse</source>
<translation>Browse</translation>
<translation type="obsolete">Browse</translation>
</message>
<message>
<source>Clear</source>
@ -652,7 +740,7 @@
</message>
<message>
<source>Load</source>
<translation>Load</translation>
<translation type="obsolete">Load</translation>
</message>
<message>
<source>Save</source>
@ -684,11 +772,223 @@
</message>
<message>
<source>Name Status Signal Security</source>
<translation>Name Status Signal Security</translation>
<translation type="obsolete">Name Status Signal Security</translation>
</message>
<message>
<source>Name Description Status</source>
<translation>Name Description Status</translation>
<translation type="obsolete">Name Description Status</translation>
</message>
<message>
<source>Remove</source>
<translation type="obsolete">Remove</translation>
</message>
<message>
<source>Stop profile</source>
<translation>Stop profile</translation>
</message>
<message>
<source>Start profile</source>
<translation>Start profile</translation>
</message>
<message>
<source>Disable profile</source>
<translation>Disable profile</translation>
</message>
<message>
<source>Enable profile</source>
<translation>Enable profile</translation>
</message>
<message>
<source>Stop WiFi</source>
<translation>Stop WiFi</translation>
</message>
<message>
<source>Start WiFi</source>
<translation>Start WiFi</translation>
</message>
<message>
<source>Restart profile</source>
<translation>Restart profile</translation>
</message>
<message>
<source>Edit profile</source>
<translation>Edit profile</translation>
</message>
<message>
<source>Remove profile</source>
<translation>Remove profile</translation>
</message>
<message>
<source>Load profile</source>
<translation>Load profile</translation>
</message>
<message>
<source>Save profile</source>
<translation>Save profile</translation>
</message>
<message>
<source>Start Wi-Fi</source>
<translation>Start Wi-Fi</translation>
</message>
<message>
<source>netctl-auto</source>
<translation>netctl-auto</translation>
</message>
<message>
<source>Actions</source>
<translation>Actions</translation>
</message>
<message>
<source>Name==Description==Status</source>
<translation type="obsolete">Name==Description==Status</translation>
</message>
<message>
<source>Name==Status==Signal==Security</source>
<translation type="obsolete">Name==Status==Signal==Security</translation>
</message>
<message>
<source>Unknown flag
</source>
<translation>Unknown flag
</translation>
</message>
<message>
<source>Usage:</source>
<translation>Usage:</translation>
</message>
<message>
<source>Parametrs:</source>
<translation>Parametrs:</translation>
</message>
<message>
<source>Open window:</source>
<translation>Open window:</translation>
</message>
<message>
<source>show about window</source>
<translation>show about window</translation>
</message>
<message>
<source>show netctl-auto window</source>
<translation>show netctl-auto window</translation>
</message>
<message>
<source>show settings window</source>
<translation>show settings window</translation>
</message>
<message>
<source>Functions:</source>
<translation>Functions:</translation>
</message>
<message>
<source>select ESSID %1</source>
<translation>select ESSID %1</translation>
</message>
<message>
<source>open profile %1</source>
<translation>open profile %1</translation>
</message>
<message>
<source>select profile %1</source>
<translation>select profile %1</translation>
</message>
<message>
<source>Additional flags:</source>
<translation>Additional flags:</translation>
</message>
<message>
<source>print debug information</source>
<translation>print debug information</translation>
</message>
<message>
<source>start with default settings</source>
<translation>start with default settings</translation>
</message>
<message>
<source>set options for this run, comma separated</source>
<translation>set options for this run, comma separated</translation>
</message>
<message>
<source>open a tab with number %1</source>
<translation>open a tab with number %1</translation>
</message>
<message>
<source>Show messages:</source>
<translation>Show messages:</translation>
</message>
<message>
<source>show version and exit</source>
<translation>show version and exit</translation>
</message>
<message>
<source>show build information and exit</source>
<translation>show build information and exit</translation>
</message>
<message>
<source>show this help and exit</source>
<translation>show this help and exit</translation>
</message>
<message>
<source>Build date: %1</source>
<translation>Build date: %1</translation>
</message>
<message>
<source>cmake flags:</source>
<translation>cmake flags:</translation>
</message>
<message>
<source>Version : %1
</source>
<translation type="obsolete">Version : %1
</translation>
</message>
<message>
<source>Author : %1
</source>
<translation type="obsolete">Author : %1
</translation>
</message>
<message>
<source>License : %1
</source>
<translation type="obsolete">License : %1
</translation>
</message>
<message>
<source>About</source>
<translation>About</translation>
</message>
<message>
<source>netctl-auto is running</source>
<translation>netctl-auto is running</translation>
</message>
<message>
<source>Show</source>
<translation>Show</translation>
</message>
<message>
<source>Help</source>
<translation>Help</translation>
</message>
<message>
<source>read configuration from file %1</source>
<translation type="obsolete">read configuration from file %1</translation>
</message>
<message>
<source>Version</source>
<translation>Version</translation>
</message>
<message>
<source>Author</source>
<translation>Author</translation>
</message>
<message>
<source>License</source>
<translation>License</translation>
</message>
<message>
<source>read configuration from this file</source>
<translation>read configuration from this file</translation>
</message>
</context>
<context>
@ -810,6 +1110,133 @@
<translation>Browse</translation>
</message>
</context>
<context>
<name>NetctlAutoWindow</name>
<message>
<source>MainWindow</source>
<translation type="obsolete">MainWindow</translation>
</message>
<message>
<source>Enable profile</source>
<translation>Enable profile</translation>
</message>
<message>
<source>Switch to profile</source>
<translation>Switch to profile</translation>
</message>
<message>
<source>Close</source>
<translation>Close</translation>
</message>
<message>
<source>Menu</source>
<translation>Menu</translation>
</message>
<message>
<source>Ready</source>
<translation>Ready</translation>
</message>
<message>
<source>Disable service</source>
<translation>Disable service</translation>
</message>
<message>
<source>Enable service</source>
<translation>Enable service</translation>
</message>
<message>
<source>netctl-auto is running</source>
<translation>netctl-auto is running</translation>
</message>
<message>
<source>Stop service</source>
<translation>Stop service</translation>
</message>
<message>
<source>Start service</source>
<translation>Start service</translation>
</message>
<message>
<source>netctl-auto is not running</source>
<translation>netctl-auto is not running</translation>
</message>
<message>
<source>Name==Description==Active==Disabled</source>
<translation type="obsolete">Name==Description==Active==Disabled</translation>
</message>
<message>
<source>yes</source>
<translation>yes</translation>
</message>
<message>
<source>Updated</source>
<translation>Updated</translation>
</message>
<message>
<source>Enable all profiles</source>
<translation>Enable all profiles</translation>
</message>
<message>
<source>Disable all profiles</source>
<translation>Disable all profiles</translation>
</message>
<message>
<source>Enable</source>
<translation>Enable</translation>
</message>
<message>
<source>Disable</source>
<translation>Disable</translation>
</message>
<message>
<source>Done</source>
<translation>Done</translation>
</message>
<message>
<source>Error</source>
<translation>Error</translation>
</message>
<message>
<source>Disable profile</source>
<translation>Disable profile</translation>
</message>
<message>
<source>Esc</source>
<translation>Esc</translation>
</message>
<message>
<source>Restart service</source>
<translation>Restart service</translation>
</message>
<message>
<source>Refresh</source>
<translation>Refresh</translation>
</message>
<message>
<source>Name</source>
<translation>Name</translation>
</message>
<message>
<source>Description</source>
<translation>Description</translation>
</message>
<message>
<source>Active</source>
<translation>Active</translation>
</message>
<message>
<source>Disabled</source>
<translation>Disabled</translation>
</message>
<message>
<source>Switch</source>
<translation>Switch</translation>
</message>
<message>
<source>netctl-auto</source>
<translation>netctl-auto</translation>
</message>
</context>
<context>
<name>PasswdWidget</name>
<message>
@ -820,6 +1247,10 @@
<source>Password</source>
<translation>Password</translation>
</message>
<message>
<source>ESSID</source>
<translation>ESSID</translation>
</message>
</context>
<context>
<name>PppoeWidget</name>
@ -1146,6 +1577,50 @@
<source>Other</source>
<translation>Other</translation>
</message>
<message>
<source>Select netctl-auto command</source>
<translation>Select netctl-auto command</translation>
</message>
<message>
<source>Select systemctl command</source>
<translation>Select systemctl command</translation>
</message>
<message>
<source>Select wpa_actiond command</source>
<translation>Select wpa_actiond command</translation>
</message>
<message>
<source>systemctl path</source>
<translation>systemctl path</translation>
</message>
<message>
<source>Path to systemctl</source>
<translation>Path to systemctl</translation>
</message>
<message>
<source>netctl-auto path</source>
<translation>netctl-auto path</translation>
</message>
<message>
<source>Path to netctl-auto</source>
<translation>Path to netctl-auto</translation>
</message>
<message>
<source>netctl-auto service</source>
<translation>netctl-auto service</translation>
</message>
<message>
<source>Name of netctl-auto systemd service</source>
<translation>Name of netctl-auto systemd service</translation>
</message>
<message>
<source>wpa_actiond path</source>
<translation>wpa_actiond path</translation>
</message>
<message>
<source>Path to wpa_actiond</source>
<translation>Path to wpa_actiond</translation>
</message>
</context>
<context>
<name>TunnelWidget</name>
@ -1450,5 +1925,9 @@
<source>Exclude auto</source>
<translation>Exclude auto</translation>
</message>
<message>
<source>Frequency</source>
<translation>Frequency</translation>
</message>
</context>
</TS>

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="ru">
<TS version="2.1" language="ru">
<context>
<name>AboutWindow</name>
<message>
<source>Version %1
(build date %2)</source>
<translation>Версия: %1
(дата сборки %2)</translation>
</message>
<message>
<source>Qt-based graphical interface for netctl.</source>
<translation>Графический интерфейс для netctl, использующий Qt.</translation>
</message>
<message>
<source>Links:</source>
<translation>Ссылки:</translation>
</message>
<message>
<source>Homepage</source>
<translation>Домашняя страница</translation>
</message>
<message>
<source>Repository</source>
<translation>Репозиторий</translation>
</message>
<message>
<source>Bugtracker</source>
<translation>Багтрекер</translation>
</message>
<message>
<source>Translation issue</source>
<translation>Тикет перевода</translation>
</message>
<message>
<source>AUR packages</source>
<translation>Пакеты в AUR</translation>
</message>
<message>
<source>This software is licensed under %1</source>
<translation>Данной программное обеспечение лицензировано под %1</translation>
</message>
<message>
<source>About</source>
<translation>О программе</translation>
</message>
</context>
<context>
<name>BridgeWidget</name>
<message>
@ -88,15 +133,31 @@
</message>
<message>
<source>Error</source>
<translation>Ошибка</translation>
<translation type="obsolete">Ошибка</translation>
</message>
<message>
<source>Error text</source>
<translation>Error text</translation>
<translation type="obsolete">Error text</translation>
</message>
<message>
<source>Ok</source>
<translation>Ok</translation>
<translation type="obsolete">Ok</translation>
</message>
<message>
<source>Error!</source>
<translation>Ошибка!</translation>
</message>
<message>
<source>Could not find profile</source>
<translation>Не могу найти профиль</translation>
</message>
<message>
<source>Could not find ESSID</source>
<translation>Не могу найти ESSID</translation>
</message>
<message>
<source>Sender : %1</source>
<translation>Отправитель : %1</translation>
</message>
</context>
<context>
@ -133,7 +194,7 @@
<source>Skip no carrier</source>
<translation>Пропустить отсутствие оператора</translation>
</message>
<message utf8="true">
<message>
<source>Set to yes to use 802.1x authentication</source>
<translation>Установить &quot;да&quot;, чтобы использовать 802.1x авторизацию</translation>
</message>
@ -268,7 +329,7 @@
<source>A command that is executed before a connection is brought down</source>
<translation>Команда, которая будет запущена перед отключением</translation>
</message>
<message utf8="true">
<message>
<source>Set to yes to force connecting even if the interface is up</source>
<translation>Установить &quot;да&quot;, чтобы запустить соединение, даже если интерфейс уже поднят</translation>
</message>
@ -319,7 +380,7 @@
<source>Add</source>
<translation>Добавить</translation>
</message>
<message utf8="true">
<message>
<source>An array of IP addresses suffixed with /&lt;netmask&gt;</source>
<translation>Массив IP адресов с суффиксом /&lt;netmask&gt;</translation>
</message>
@ -399,7 +460,7 @@
<source>Timeout DAD</source>
<translation>Таймаут DAD</translation>
</message>
<message utf8="true">
<message>
<source>Set to yes to release the DHCP lease when the profile is stopped</source>
<translation>Установить &quot;да&quot;, чтобы оставить выделенный DHCP, когда профиль отключен</translation>
</message>
@ -459,7 +520,7 @@
<source>DNS domain</source>
<translation>DNS домен</translation>
</message>
<message utf8="true">
<message>
<source>A domain line for /etc/resolv.conf</source>
<translation>Строка domain в /etc/resolv.conf</translation>
</message>
@ -467,7 +528,7 @@
<source>DNS search</source>
<translation>Поиск DNS</translation>
</message>
<message utf8="true">
<message>
<source>A search line for /etc/resolv.conf</source>
<translation>Строка search в /etc/resolv.conf</translation>
</message>
@ -475,15 +536,42 @@
<source>DNS options</source>
<translation>Опции DNS</translation>
</message>
<message utf8="true">
<message>
<source>An array of options lines for /etc/resolv.conf</source>
<translation>Массив строк options в /etc/resolv.conf</translation>
</message>
<message utf8="true">
<message>
<source>Maximum time, in seconds, to wait for IPv6s Duplicate Address Detection to succeed</source>
<translation>Максимальное время в секундах для ожидания выполнения детектирования дубликации IPv6 адресов</translation>
</message>
</context>
<context>
<name>MacvlanWidget</name>
<message>
<source>Form</source>
<translation>Form</translation>
</message>
<message>
<source>macvlan settings</source>
<translation>Опции macvlan</translation>
</message>
<message>
<source>Mode</source>
<translation>Режим</translation>
</message>
<message>
<source>MAC address</source>
<translation>MAC адрес</translation>
</message>
<message>
<source>Only connect to specified MAC address</source>
<translation type="obsolete">Подключаться только к указанному MAC адресу</translation>
</message>
<message>
<source>Optional static MAC address</source>
<translation>Статический MAC адрес, если нужно</translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
@ -512,82 +600,82 @@
</message>
<message>
<source>Disable</source>
<translation>Отключить</translation>
<translation type="obsolete">Отключить</translation>
</message>
<message>
<source>Enable</source>
<translation>Включить</translation>
<translation type="obsolete">Включить</translation>
</message>
<message>
<source>Save profile as...</source>
<translation>Сохранить профиль как...</translation>
<translation type="obsolete">Сохранить профиль как...</translation>
</message>
<message>
<source>Profile (*)</source>
<translation>Профиль (*)</translation>
<translation type="obsolete">Профиль (*)</translation>
</message>
<message>
<source> Netctl GUI
</source>
<translation> Netctl GUI
<translation type="obsolete"> Netctl GUI
</translation>
</message>
<message>
<source>Version : %1 License : GPLv3
</source>
<translation>Версия : %1 Лицензия : GPLv3
<translation type="obsolete">Версия : %1 Лицензия : GPLv3
</translation>
</message>
<message>
<source> Evgeniy Alekseev aka arcanis
</source>
<translation> Евгений Алексеев aka arcanis
<translation type="obsolete"> Евгений Алексеев aka arcanis
</translation>
</message>
<message>
<source> E-mail : esalexeev@gmail.com
</source>
<translation> E-mail : esalexeev@gmail.com
<translation type="obsolete"> E-mail : esalexeev@gmail.com
</translation>
</message>
<message>
<source>Usage:
</source>
<translation>Использование:
<translation type="obsolete">Использование:
</translation>
</message>
<message>
<source>netctl-gui [ --default ] [ -t NUM | --tab NUM ] [ -h | --help]
</source>
<translation>netctl-gui [ --default ] [ -t NUM | --tab NUM ] [ -h | --help]
<translation type="obsolete">netctl-gui [ --default ] [ -t NUM | --tab NUM ] [ -h | --help]
</translation>
</message>
<message>
<source>Parametrs:
</source>
<translation>Параметры:
<translation type="obsolete">Параметры:
</translation>
</message>
<message>
<source> --default - start with default settings
</source>
<translation> --default - запустить со стандартными настройками
<translation type="obsolete"> --default - запустить со стандартными настройками
</translation>
</message>
<message>
<source> -t NUM --tab NUM - open a tab with number NUM
</source>
<translation> -t NUM --tab NUM - открыть вкладку с номером NUM
<translation type="obsolete"> -t NUM --tab NUM - открыть вкладку с номером NUM
</translation>
</message>
<message>
<source> -h --help - show this help and exit
</source>
<translation> -h --help - показать эту справку и выход
<translation type="obsolete"> -h --help - показать эту справку и выход
</translation>
</message>
<message>
@ -644,7 +732,7 @@
</message>
<message>
<source>Browse</source>
<translation>Обзор</translation>
<translation type="obsolete">Обзор</translation>
</message>
<message>
<source>Clear</source>
@ -652,7 +740,7 @@
</message>
<message>
<source>Load</source>
<translation>Загрузить</translation>
<translation type="obsolete">Загрузить</translation>
</message>
<message>
<source>Save</source>
@ -684,11 +772,222 @@
</message>
<message>
<source>Name Status Signal Security</source>
<translation>Имя Статус Сигнал Безопасность</translation>
<translation type="obsolete">Имя Статус Сигнал Безопасность</translation>
</message>
<message>
<source>Name Description Status</source>
<translation>Имя Описание Статус</translation>
<translation type="obsolete">Имя Описание Статус</translation>
</message>
<message>
<source>Remove</source>
<translation type="obsolete">Удалить</translation>
</message>
<message>
<source>Stop profile</source>
<translation>Остановить профиль</translation>
</message>
<message>
<source>Start profile</source>
<translation>Запустить профиль</translation>
</message>
<message>
<source>Disable profile</source>
<translation>Отключить профиль</translation>
</message>
<message>
<source>Enable profile</source>
<translation>Включить профиль</translation>
</message>
<message>
<source>Stop WiFi</source>
<translation>Остановить WiFi</translation>
</message>
<message>
<source>Start WiFi</source>
<translation>Подключить WiFi</translation>
</message>
<message>
<source>Restart profile</source>
<translation>Перезапустить профиль</translation>
</message>
<message>
<source>Edit profile</source>
<translation>Отредактировать профиль</translation>
</message>
<message>
<source>Remove profile</source>
<translation>Удалить профиль</translation>
</message>
<message>
<source>Load profile</source>
<translation>Загрузить профиль</translation>
</message>
<message>
<source>Save profile</source>
<translation>Сохранить профиль</translation>
</message>
<message>
<source>Start Wi-Fi</source>
<translation>Подключить WiFi</translation>
</message>
<message>
<source>netctl-auto</source>
<translation>netctl-auto</translation>
</message>
<message>
<source>Actions</source>
<translation>Действия</translation>
</message>
<message>
<source>Name==Description==Status</source>
<translation type="obsolete">Имя==Описание==Статус</translation>
</message>
<message>
<source>Name==Status==Signal==Security</source>
<translation type="obsolete">Имя==Статус==Сигнал==Безопасность</translation>
</message>
<message>
<source>Unknown flag
</source>
<translation>Неизвестный флаг</translation>
</message>
<message>
<source>Usage:</source>
<translation>Использование:</translation>
</message>
<message>
<source>Parametrs:</source>
<translation>Параметры:</translation>
</message>
<message>
<source>Open window:</source>
<translation>Открыть окно:</translation>
</message>
<message>
<source>show about window</source>
<translation>показать окно &quot;О программе&quot;</translation>
</message>
<message>
<source>show netctl-auto window</source>
<translation>показать окно netctl-auto</translation>
</message>
<message>
<source>show settings window</source>
<translation>показать окно настроек</translation>
</message>
<message>
<source>Functions:</source>
<translation>Функции:</translation>
</message>
<message>
<source>select ESSID %1</source>
<translation>выбрать ESSID %1</translation>
</message>
<message>
<source>open profile %1</source>
<translation>открыть профиль %1</translation>
</message>
<message>
<source>select profile %1</source>
<translation>выбрать профиль %1</translation>
</message>
<message>
<source>Additional flags:</source>
<translation>Дополнительные флаги:</translation>
</message>
<message>
<source>print debug information</source>
<translation>показать отладочную информацию</translation>
</message>
<message>
<source>start with default settings</source>
<translation>запустить со стандартными настройками</translation>
</message>
<message>
<source>set options for this run, comma separated</source>
<translation>установить опции для данного запуска, разделенные запятыми</translation>
</message>
<message>
<source>open a tab with number %1</source>
<translation>открыть вкладку с номером %1</translation>
</message>
<message>
<source>Show messages:</source>
<translation>Показать сообщения:</translation>
</message>
<message>
<source>show version and exit</source>
<translation>показать версию и выход</translation>
</message>
<message>
<source>show build information and exit</source>
<translation>показать информацию о сборке и выход</translation>
</message>
<message>
<source>show this help and exit</source>
<translation>показать справку и выход</translation>
</message>
<message>
<source>Build date: %1</source>
<translation>Дата сборки: %1</translation>
</message>
<message>
<source>cmake flags:</source>
<translation>Флаги cmake:</translation>
</message>
<message>
<source>Version : %1
</source>
<translation type="obsolete">Версия : %1
</translation>
</message>
<message>
<source>Author : %1
</source>
<translation type="obsolete">Автор : %1
</translation>
</message>
<message>
<source>License : %1
</source>
<translation type="obsolete">Лицензия : %1
</translation>
</message>
<message>
<source>About</source>
<translation>О программе</translation>
</message>
<message>
<source>netctl-auto is running</source>
<translation>netctl-auto запущен</translation>
</message>
<message>
<source>Show</source>
<translation>Показать</translation>
</message>
<message>
<source>Help</source>
<translation>Справка</translation>
</message>
<message>
<source>read configuration from file %1</source>
<translation type="obsolete">прочитать настройки из файла %1</translation>
</message>
<message>
<source>Version</source>
<translation>Версия</translation>
</message>
<message>
<source>Author</source>
<translation>Автор</translation>
</message>
<message>
<source>License</source>
<translation>Лицензия</translation>
</message>
<message>
<source>read configuration from this file</source>
<translation>прочитать настройки из данного файла</translation>
</message>
</context>
<context>
@ -810,6 +1109,133 @@
<translation>Обзор</translation>
</message>
</context>
<context>
<name>NetctlAutoWindow</name>
<message>
<source>MainWindow</source>
<translation type="obsolete">MainWindow</translation>
</message>
<message>
<source>Enable profile</source>
<translation>Включить профиль</translation>
</message>
<message>
<source>Switch to profile</source>
<translation>Переключиться на профиль</translation>
</message>
<message>
<source>Close</source>
<translation>Закрыть</translation>
</message>
<message>
<source>Menu</source>
<translation>Меню</translation>
</message>
<message>
<source>Ready</source>
<translation>Готов</translation>
</message>
<message>
<source>Disable service</source>
<translation>Отключить сервис</translation>
</message>
<message>
<source>Enable service</source>
<translation>Включить сервис</translation>
</message>
<message>
<source>netctl-auto is running</source>
<translation>netctl-auto запущен</translation>
</message>
<message>
<source>Stop service</source>
<translation>Остановить сервис</translation>
</message>
<message>
<source>Start service</source>
<translation>Запустить сервис</translation>
</message>
<message>
<source>netctl-auto is not running</source>
<translation>netctl-auto не запущен</translation>
</message>
<message>
<source>Name==Description==Active==Disabled</source>
<translation type="obsolete">Имя==Описание==Активен==Отключен</translation>
</message>
<message>
<source>yes</source>
<translation>да</translation>
</message>
<message>
<source>Updated</source>
<translation>Обновлено</translation>
</message>
<message>
<source>Enable all profiles</source>
<translation>Включить все профили</translation>
</message>
<message>
<source>Disable all profiles</source>
<translation>Отключить все профили</translation>
</message>
<message>
<source>Enable</source>
<translation>Включить</translation>
</message>
<message>
<source>Disable</source>
<translation>Отключить</translation>
</message>
<message>
<source>Done</source>
<translation>Выполнено</translation>
</message>
<message>
<source>Error</source>
<translation>Ошибка</translation>
</message>
<message>
<source>Disable profile</source>
<translation>Отключить профиль</translation>
</message>
<message>
<source>Esc</source>
<translation>Esc</translation>
</message>
<message>
<source>Restart service</source>
<translation>Перезапустить сервис</translation>
</message>
<message>
<source>Refresh</source>
<translation>Обновить</translation>
</message>
<message>
<source>Name</source>
<translation>Имя</translation>
</message>
<message>
<source>Description</source>
<translation>Описание</translation>
</message>
<message>
<source>Active</source>
<translation>Активен</translation>
</message>
<message>
<source>Disabled</source>
<translation>Отключен</translation>
</message>
<message>
<source>Switch</source>
<translation>Переключить</translation>
</message>
<message>
<source>netctl-auto</source>
<translation>netctl-auto</translation>
</message>
</context>
<context>
<name>PasswdWidget</name>
<message>
@ -820,6 +1246,10 @@
<source>Password</source>
<translation>Пароль</translation>
</message>
<message>
<source>ESSID</source>
<translation>ESSID</translation>
</message>
</context>
<context>
<name>PppoeWidget</name>
@ -879,7 +1309,7 @@
<source>Idle timeout</source>
<translation>Таймаут простоя</translation>
</message>
<message utf8="true">
<message>
<source>This option specifies the idle time (in seconds) after which pppd should disconnect</source>
<translation>Указывает таймаут простоя в секундах, после чего &apos;pppd&apos; будет отключен</translation>
</message>
@ -919,7 +1349,7 @@
<source>LCP echo interval</source>
<translation>LCP echo интервал</translation>
</message>
<message utf8="true">
<message>
<source>These options override default LCP parameters from /etc/ppp/options</source>
<translation>Эти опции заместят стандартные опции LCP из /etc/ppp/options</translation>
</message>
@ -1146,6 +1576,50 @@
<source>Other</source>
<translation>Прочее</translation>
</message>
<message>
<source>Select netctl-auto command</source>
<translation>Путь к команде netctl-auto</translation>
</message>
<message>
<source>Select systemctl command</source>
<translation>Путь к команде systemctl</translation>
</message>
<message>
<source>Select wpa_actiond command</source>
<translation>Путь к команде wpa_actiond</translation>
</message>
<message>
<source>systemctl path</source>
<translation>Путь к systemctl</translation>
</message>
<message>
<source>Path to systemctl</source>
<translation>Путь к systemctl</translation>
</message>
<message>
<source>netctl-auto path</source>
<translation>Путь к netctl-auto</translation>
</message>
<message>
<source>Path to netctl-auto</source>
<translation>Путь к netctl-auto</translation>
</message>
<message>
<source>netctl-auto service</source>
<translation>Имя сервиса netctl-auto</translation>
</message>
<message>
<source>Name of netctl-auto systemd service</source>
<translation>Имя сервиса systemd для netctl-auto</translation>
</message>
<message>
<source>wpa_actiond path</source>
<translation>Путь к wpa_actiond</translation>
</message>
<message>
<source>Path to wpa_actiond</source>
<translation>Путь к wpa_actiond</translation>
</message>
</context>
<context>
<name>TunnelWidget</name>
@ -1236,7 +1710,7 @@
<source>tap</source>
<translation>tap</translation>
</message>
<message utf8="true">
<message>
<source>Either tun, or tap</source>
<translation>tun или tap</translation>
</message>
@ -1450,5 +1924,9 @@
<source>Exclude auto</source>
<translation>Исключить профиль</translation>
</message>
<message>
<source>Frequency</source>
<translation>Частота</translation>
</message>
</context>
</TS>

BIN
sources/resources/wifi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -1,9 +1,28 @@
#ifndef VERSION_H
#define VERSION_H
#define AUTHOR "Evgeniy Alekseev"
#define DATE "2014-2014"
#define NAME "Netctl plasmoid"
#define NAME "Netctl Graphical Interface"
#define VERSION "@PROJECT_VERSION@"
#define AUTHOR "@PROJECT_AUTHOR@"
#define EMAIL "@PROJECT_CONTACT@"
#define LICENSE "@PROJECT_LICENSE@"
#define HOMEPAGE "http://arcanis.name/projects/netctl-gui/"
#define REPOSITORY "https://github.com/arcan1s/netctl-gui"
#define BUGTRACKER "https://github.com/arcan1s/netctl-gui/issues"
#define TRANSLATION "https://github.com/arcan1s/netctl-gui/issues/3"
#define AUR_PACKAGES "https://aur.archlinux.org/pkgbase/netctl-gui/"
#define BUILD_DATE "@CURRENT_DATE@"
#define DATE "2014-@CURRENT_YEAR@"
#define CMAKE_BUILD_TYPE "@CMAKE_BUILD_TYPE@"
#define CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
#define PROJECT_BUILD_DATAENGINE "@BUILD_DATAENGINE@"
#define PROJECT_BUILD_DOCS "@BUILD_DOCS@"
#define PROJECT_BUILD_GUI "@BUILD_GUI@"
#define PROJECT_BUILD_LIBRARY "@BUILD_LIBRARY@"
#define PROJECT_BUILD_PLASMOID "@BUILD_PLASMOID@"
#define PROJECT_USE_QT5 "@USE_QT5@"
#endif /* VERSION_H */