mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-08-12 20:39:57 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
7529cd7af0 | |||
7e85f1f933 | |||
c4c407542f | |||
cc2b3faf85 | |||
b983f4424e | |||
72782a40c2 |
@ -1,3 +1,8 @@
|
||||
Ver.1.0.4:
|
||||
+ [gui] added Qt5 gui (by default)
|
||||
+ [plasmoid] added notifications
|
||||
* [plasmoid] fix run command with sudo from plasmoid
|
||||
|
||||
Ver.1.0.3:
|
||||
+ [plasmoid] edited russian translation
|
||||
* [all] refactoring
|
||||
|
18
PKGBUILD
18
PKGBUILD
@ -1,29 +1,35 @@
|
||||
# Maintainer: Evgeniy "arcanis" Alexeev <arcanis.arch at gmail dot com>
|
||||
|
||||
# comment out needed line if you dont need this component
|
||||
#_use_qt5=0
|
||||
#_build_gui=0
|
||||
#_build_plasmoid=0
|
||||
|
||||
pkgname=netctl-gui
|
||||
pkgver=1.0.3
|
||||
pkgver=1.0.4
|
||||
pkgrel=1
|
||||
pkgdesc="Qt4 GUI for netctl. Provides a plasmoid for KDE4"
|
||||
pkgdesc="Qt4/Qt5 GUI for netctl. Provides a plasmoid for KDE4"
|
||||
arch=('i686' 'x86_64')
|
||||
url="http://arcanis.name/projects/netctl-gui"
|
||||
license=('GPLv3')
|
||||
depends=('netctl' 'qt4')
|
||||
makedepends=('automoc4' 'cmake' 'desktop-file-utils' 'xdg-utils')
|
||||
depends=('netctl' 'qt5-base')
|
||||
makedepends=('automoc4' 'cmake' 'qt5-tools')
|
||||
optdepends=('kdebase-runtime: sudo support'
|
||||
'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=('46371fb9aa75a63499d804b500adaadb')
|
||||
md5sums=('1e790c31d135b91c7ec80791508e6e92')
|
||||
|
||||
# flags
|
||||
_cmakekeys="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
|
||||
if [[ ${_use_qt5} == 0 ]]; then
|
||||
_cmakekeys=${_cmakekeys}" -DUSE_QT5:BOOL=0"
|
||||
depends=('netctl' 'qt4')
|
||||
makedepends=('automoc4' 'cmake' 'desktop-file-utils' 'xdg-utils')
|
||||
fi
|
||||
[[ ${_build_gui} == 0 ]] && _cmakekeys=${_cmakekeys}" -DBUILD_GUI:BOOL=0"
|
||||
[[ ${_build_plasmoid} == 0 ]] && _cmakekeys=${_cmakekeys}" -DBUILD_DATAENGINE:BOOL=0 -DBUILD_PLASMOID:BOOL=0" || depends[1]='kdebase-workspace'
|
||||
[[ ${_build_plasmoid} == 0 ]] && _cmakekeys=${_cmakekeys}" -DBUILD_DATAENGINE:BOOL=0 -DBUILD_PLASMOID:BOOL=0" || depends+=('kdebase-workspace')
|
||||
|
||||
prepare() {
|
||||
rm -rf "${srcdir}/build"
|
||||
|
@ -8,13 +8,14 @@ cmake_policy (SET CMP0015 NEW)
|
||||
project (netctl-gui)
|
||||
set (PROJECT_VERSION_MAJOR 1)
|
||||
set (PROJECT_VERSION_MINOR 0)
|
||||
set (PROJECT_VERSION_PATCH 3)
|
||||
set (PROJECT_VERSION_PATCH 4)
|
||||
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)
|
||||
|
||||
message (STATUS "Version: ${PROJECT_VERSION}")
|
||||
|
||||
# install options
|
||||
option (USE_QT5 "Use Qt5 instead of Qt4" ON)
|
||||
option (BUILD_GUI "Build GUI" ON)
|
||||
option (BUILD_DATAENGINE "Build data engine" ON)
|
||||
option (BUILD_PLASMOID "Build plasmoid" ON)
|
||||
@ -29,11 +30,12 @@ else ()
|
||||
message (STATUS "Unknown compiler")
|
||||
endif ()
|
||||
|
||||
add_subdirectory (icons)
|
||||
|
||||
if (BUILD_PLASMOID)
|
||||
set (BUILD_DATAENGINE ON)
|
||||
endif ()
|
||||
|
||||
add_subdirectory (icons)
|
||||
if (BUILD_GUI)
|
||||
add_subdirectory (gui)
|
||||
endif ()
|
||||
|
@ -14,29 +14,60 @@ message (STATUS "${SUBPROJECT} Forms: ${FORMS}")
|
||||
# include_path
|
||||
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../)
|
||||
|
||||
find_package (Qt4 REQUIRED)
|
||||
include (${QT_USE_FILE})
|
||||
qt4_wrap_cpp (MOC_SOURCES ${HEADERS})
|
||||
qt4_wrap_ui (UI_HEADERS ${FORMS})
|
||||
qt4_add_resources (QRC_SOURCES ${RESOURCES})
|
||||
if (USE_QT5)
|
||||
find_package(Qt5Core REQUIRED)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt5LinguistTools REQUIRED)
|
||||
add_definitions(${Qt5Core_DEFINITIONS})
|
||||
add_definitions(${Qt5Widgets_DEFINITIONS})
|
||||
add_definitions(${Qt5LinguistTools_DEFINITIONS})
|
||||
qt5_wrap_cpp (MOC_SOURCES ${HEADERS})
|
||||
qt5_wrap_ui (UI_HEADERS ${FORMS})
|
||||
qt5_add_resources (QRC_SOURCES ${RESOURCES})
|
||||
|
||||
foreach (LANGUAGE ${LANGUAGES})
|
||||
set (TS ${SUBPROJECT_TRANSLATION_DIR}/${LANGUAGE}.ts)
|
||||
set (QM ${SUBPROJECT_TRANSLATION_DIR}/${LANGUAGE}.qm)
|
||||
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}")
|
||||
foreach (LANGUAGE ${LANGUAGES})
|
||||
set (TS ${SUBPROJECT_TRANSLATION_DIR}/${LANGUAGE}.ts)
|
||||
set (QM ${SUBPROJECT_TRANSLATION_DIR}/${LANGUAGE}.qm)
|
||||
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})
|
||||
source_group ("Generated Files" FILES ${MOC_SOURCES})
|
||||
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})
|
||||
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})
|
||||
else ()
|
||||
find_package (Qt4 REQUIRED)
|
||||
include (${QT_USE_FILE})
|
||||
qt4_wrap_cpp (MOC_SOURCES ${HEADERS})
|
||||
qt4_wrap_ui (UI_HEADERS ${FORMS})
|
||||
qt4_add_resources (QRC_SOURCES ${RESOURCES})
|
||||
|
||||
foreach (LANGUAGE ${LANGUAGES})
|
||||
set (TS ${SUBPROJECT_TRANSLATION_DIR}/${LANGUAGE}.ts)
|
||||
set (QM ${SUBPROJECT_TRANSLATION_DIR}/${LANGUAGE}.qm)
|
||||
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})
|
||||
endif()
|
||||
|
||||
# install properties
|
||||
install (TARGETS ${SUBPROJECT} DESTINATION bin)
|
||||
|
@ -86,7 +86,7 @@ void EthernetWidget::selectWpaConfig()
|
||||
void EthernetWidget::showAdvanced()
|
||||
{
|
||||
if (ui->pushButton_ethernetAdvanced->isChecked()) {
|
||||
ui->widget_ethernetAdvanced->setShown(true);
|
||||
ui->widget_ethernetAdvanced->setHidden(false);
|
||||
ui->pushButton_ethernetAdvanced->setText(QApplication::translate("EthernetWidget", "Hide advanced"));
|
||||
}
|
||||
else {
|
||||
@ -101,7 +101,7 @@ void EthernetWidget::showWpa(const int state)
|
||||
if (state == 0)
|
||||
ui->widget_wpa->setHidden(true);
|
||||
else
|
||||
ui->widget_wpa->setShown(true);
|
||||
ui->widget_wpa->setHidden(false);
|
||||
}
|
||||
|
||||
|
||||
|
@ -112,7 +112,7 @@ void GeneralWidget::keyPressEvent(QKeyEvent *pressedKey)
|
||||
void GeneralWidget::showAdvanced()
|
||||
{
|
||||
if (ui->pushButton_generalAdvanced->isChecked()) {
|
||||
ui->widget_generalAdvanced->setShown(true);
|
||||
ui->widget_generalAdvanced->setHidden(false);
|
||||
ui->pushButton_generalAdvanced->setText(QApplication::translate("GeneralWidget", "Hide advanced"));
|
||||
}
|
||||
else {
|
||||
|
@ -306,7 +306,7 @@ void IpWidget::changeIpMode(const QString currentText)
|
||||
if (currentText == QString("dhcp"))
|
||||
ui->widget_ip->setHidden(true);
|
||||
else if (currentText == QString("static"))
|
||||
ui->widget_ip->setShown(true);
|
||||
ui->widget_ip->setHidden(false);
|
||||
}
|
||||
|
||||
|
||||
@ -332,7 +332,7 @@ void IpWidget::changeIp6Mode(const QString currentText)
|
||||
ui->widget_ip6->setHidden(true);
|
||||
else if ((currentText == QString("static")) ||
|
||||
(currentText == QString("stateless")))
|
||||
ui->widget_ip6->setShown(true);
|
||||
ui->widget_ip6->setHidden(false);
|
||||
}
|
||||
|
||||
|
||||
@ -354,12 +354,12 @@ void IpWidget::ip6Enable(const int state)
|
||||
void IpWidget::changeDhcpClient(const QString currentText)
|
||||
{
|
||||
if (currentText == QString("dhcpcd")) {
|
||||
ui->widget_dhcpcdOpt->setShown(true);
|
||||
ui->widget_dhcpcdOpt->setHidden(false);
|
||||
ui->widget_dhclientOpt->setHidden(true);
|
||||
}
|
||||
else if (currentText == QString("dhclient")) {
|
||||
ui->widget_dhcpcdOpt->setHidden(true);
|
||||
ui->widget_dhclientOpt->setShown(true);
|
||||
ui->widget_dhclientOpt->setHidden(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -367,7 +367,7 @@ void IpWidget::changeDhcpClient(const QString currentText)
|
||||
void IpWidget::showAdvanced()
|
||||
{
|
||||
if (ui->pushButton_ipAdvanced->isChecked()) {
|
||||
ui->widget_ipAdvanced->setShown(true);
|
||||
ui->widget_ipAdvanced->setHidden(false);
|
||||
ui->pushButton_ipAdvanced->setText(QApplication::translate("IpWidget", "Hide advanced"));
|
||||
}
|
||||
else {
|
||||
|
@ -224,7 +224,11 @@ void MainWindow::updateMainTab()
|
||||
|
||||
ui->tableWidget_main->setSortingEnabled(true);
|
||||
ui->tableWidget_main->resizeRowsToContents();
|
||||
#if QT_VERSION >= 0x050000
|
||||
ui->tableWidget_main->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
#else
|
||||
ui->tableWidget_main->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
|
||||
#endif
|
||||
ui->tabWidget->setEnabled(true);
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Updated"));
|
||||
|
||||
@ -284,7 +288,11 @@ void MainWindow::updateWifiTab()
|
||||
|
||||
ui->tableWidget_wifi->setSortingEnabled(true);
|
||||
ui->tableWidget_wifi->resizeRowsToContents();
|
||||
#if QT_VERSION >= 0x050000
|
||||
ui->tableWidget_wifi->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
#else
|
||||
ui->tableWidget_wifi->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
|
||||
#endif
|
||||
ui->tabWidget->setEnabled(true);
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Updated"));
|
||||
|
||||
|
@ -87,7 +87,7 @@ void MobileWidget::selectOptionsFile()
|
||||
void MobileWidget::showAdvanced()
|
||||
{
|
||||
if (ui->pushButton_mobileAdvanced->isChecked()) {
|
||||
ui->widget_mobileAdvanced->setShown(true);
|
||||
ui->widget_mobileAdvanced->setHidden(false);
|
||||
ui->pushButton_mobileAdvanced->setText(QApplication::translate("MobileWidget", "Hide advanced"));
|
||||
}
|
||||
else {
|
||||
|
@ -96,7 +96,7 @@ void PppoeWidget::changeMode(const QString currentText)
|
||||
if (currentText == QString("persist"))
|
||||
ui->widget_timeout->setHidden(true);
|
||||
else if (currentText == QString("demand"))
|
||||
ui->widget_timeout->setShown(true);
|
||||
ui->widget_timeout->setHidden(false);
|
||||
}
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@ void PppoeWidget::selectOptionsFile()
|
||||
void PppoeWidget::showAdvanced()
|
||||
{
|
||||
if (ui->pushButton_pppoeAdvanced->isChecked()) {
|
||||
ui->widget_pppoeAdvanced->setShown(true);
|
||||
ui->widget_pppoeAdvanced->setHidden(false);
|
||||
ui->pushButton_pppoeAdvanced->setText(QApplication::translate("PppoeWidget", "Hide advanced"));
|
||||
}
|
||||
else {
|
||||
|
@ -153,28 +153,28 @@ void WirelessWidget::addOption()
|
||||
void WirelessWidget::changeSecurity(const QString currentText)
|
||||
{
|
||||
if (currentText == QString("none")) {
|
||||
ui->widget_essid->setShown(true);
|
||||
ui->widget_essid->setHidden(false);
|
||||
ui->widget_wpaConfigSection->setHidden(true);
|
||||
ui->widget_wpaConfig->setHidden(true);
|
||||
ui->widget_key->setHidden(true);
|
||||
}
|
||||
else if ((currentText == QString("wep")) ||
|
||||
(currentText == QString("wpa"))) {
|
||||
ui->widget_essid->setShown(true);
|
||||
ui->widget_essid->setHidden(false);
|
||||
ui->widget_wpaConfigSection->setHidden(true);
|
||||
ui->widget_wpaConfig->setHidden(true);
|
||||
ui->widget_key->setShown(true);
|
||||
ui->widget_key->setHidden(false);
|
||||
}
|
||||
else if (currentText == QString("wpa-configsection")) {
|
||||
ui->widget_essid->setHidden(true);
|
||||
ui->widget_wpaConfigSection->setShown(true);
|
||||
ui->widget_wpaConfigSection->setHidden(false);
|
||||
ui->widget_wpaConfig->setHidden(true);
|
||||
ui->widget_key->setHidden(true);
|
||||
}
|
||||
else if (currentText == QString("wpa-config")) {
|
||||
ui->widget_essid->setHidden(true);
|
||||
ui->widget_wpaConfigSection->setHidden(true);
|
||||
ui->widget_wpaConfig->setShown(true);
|
||||
ui->widget_wpaConfig->setHidden(false);
|
||||
ui->widget_key->setHidden(true);
|
||||
}
|
||||
}
|
||||
@ -195,7 +195,7 @@ void WirelessWidget::selectWpaConfig()
|
||||
void WirelessWidget::showAdvanced()
|
||||
{
|
||||
if (ui->pushButton_wirelessAdvanced->isChecked()) {
|
||||
ui->widget_wirelessAdvanced->setShown(true);
|
||||
ui->widget_wirelessAdvanced->setHidden(false);
|
||||
ui->pushButton_wirelessAdvanced->setText(QApplication::translate("WirelessWidget", "Hide advanced"));
|
||||
}
|
||||
else {
|
||||
|
@ -47,7 +47,7 @@ Netctl::~Netctl()
|
||||
// delete startProfile;
|
||||
// delete stopProfile;
|
||||
// delete restartProfile;
|
||||
// delete enableProfileAutoload;
|
||||
// delete enableProfile;
|
||||
|
||||
// delete iconWidget;
|
||||
|
||||
@ -103,17 +103,21 @@ void Netctl::updateInterface(bool setShown)
|
||||
|
||||
|
||||
// context menu
|
||||
void Netctl::enableProfileAutoloadSlot()
|
||||
void Netctl::enableProfileSlot()
|
||||
{
|
||||
QProcess command;
|
||||
QString commandLine, enableStatus;
|
||||
if (info[QString("status")].contains(QString("enabled")))
|
||||
if (info[QString("status")].contains(QString("enabled"))) {
|
||||
enableStatus = QString(" disable ");
|
||||
else
|
||||
sendNotification(QString("Info"), i18n("Set profile %1 disabled", info[QString("name")]));
|
||||
}
|
||||
else {
|
||||
enableStatus = QString(" enable ");
|
||||
sendNotification(QString("Info"), i18n("Set profile %1 enabled", info[QString("name")]));
|
||||
}
|
||||
if (useSudo)
|
||||
commandLine = paths[QString("sudo")] + QString(" \"") + paths[QString("netctl")] +
|
||||
enableStatus + info[QString("name")] + QString("\"");
|
||||
commandLine = paths[QString("sudo")] + QString(" ") + paths[QString("netctl")] +
|
||||
enableStatus + info[QString("name")];
|
||||
else
|
||||
commandLine = paths[QString("netctl")] + enableStatus + info[QString("name")];
|
||||
command.startDetached(commandLine);
|
||||
@ -125,13 +129,14 @@ void Netctl::startProfileSlot(QAction *profile)
|
||||
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 +
|
||||
commandLine = paths[QString("sudo")] + QString(" ") + commandLine +
|
||||
paths[QString("netctl")] + QString(" start ") +
|
||||
profile->text().remove(QString("&")) + QString("\"");
|
||||
profile->text().remove(QString("&"));
|
||||
else
|
||||
commandLine = commandLine + paths[QString("netctl")] + QString(" start ") +
|
||||
profile->text().remove(QString("&"));
|
||||
@ -143,9 +148,10 @@ void Netctl::stopProfileSlot()
|
||||
{
|
||||
QProcess command;
|
||||
QString commandLine;
|
||||
sendNotification(QString("Info"), i18n("Stop profile %1", info[QString("name")]));
|
||||
if (useSudo)
|
||||
commandLine = paths[QString("sudo")] + QString(" \"") + paths[QString("netctl")] +
|
||||
QString(" stop ") + info[QString("name")] + QString("\"");
|
||||
commandLine = paths[QString("sudo")] + QString(" ") + paths[QString("netctl")] +
|
||||
QString(" stop ") + info[QString("name")];
|
||||
else
|
||||
commandLine = paths[QString("netctl")] + QString(" stop ") + info[QString("name")];
|
||||
command.startDetached(commandLine);
|
||||
@ -156,9 +162,10 @@ void Netctl::restartProfileSlot()
|
||||
{
|
||||
QProcess command;
|
||||
QString commandLine;
|
||||
sendNotification(QString("Info"), i18n("Restart profile %1", info[QString("name")]));
|
||||
if (useSudo)
|
||||
commandLine = paths[QString("sudo")] + QString(" \"") + paths[QString("netctl")] +
|
||||
QString(" restart ") + info[QString("name")] + QString("\"");
|
||||
commandLine = paths[QString("sudo")] + QString(" ") + paths[QString("netctl")] +
|
||||
QString(" restart ") + info[QString("name")];
|
||||
else
|
||||
commandLine = paths[QString("netctl")] + QString(" restart ") + info[QString("name")];
|
||||
command.startDetached(commandLine);
|
||||
@ -173,17 +180,17 @@ QList<QAction*> Netctl::contextualActions()
|
||||
stopProfile->setText(i18n("Stop ") + info[QString("name")]);
|
||||
restartProfile->setVisible(true);
|
||||
restartProfile->setText(i18n("Restart ") + info[QString("name")]);
|
||||
enableProfileAutoload->setVisible(true);
|
||||
enableProfile->setVisible(true);
|
||||
if (info[QString("status")].contains(QString("enabled")))
|
||||
enableProfileAutoload->setText(i18n("Disable ") + info[QString("name")]);
|
||||
enableProfile->setText(i18n("Disable ") + info[QString("name")]);
|
||||
else
|
||||
enableProfileAutoload->setText(i18n("Enable ") + info[QString("name")]);
|
||||
enableProfile->setText(i18n("Enable ") + info[QString("name")]);
|
||||
}
|
||||
else {
|
||||
startProfile->setText(i18n("Start profile"));
|
||||
stopProfile->setVisible(false);
|
||||
restartProfile->setVisible(false);
|
||||
enableProfileAutoload->setVisible(false);
|
||||
enableProfile->setVisible(false);
|
||||
}
|
||||
|
||||
startProfileMenu->clear();
|
||||
@ -215,10 +222,9 @@ void Netctl::createActions()
|
||||
connect(restartProfile, SIGNAL(triggered(bool)), this, SLOT(restartProfileSlot()));
|
||||
menuActions.append(restartProfile);
|
||||
|
||||
enableProfileAutoload = new QAction(i18n("Enable profile"), this);
|
||||
connect(enableProfileAutoload, SIGNAL(triggered(bool)), this,
|
||||
SLOT(enableProfileAutoloadSlot()));
|
||||
menuActions.append(enableProfileAutoload);
|
||||
enableProfile = new QAction(i18n("Enable profile"), this);
|
||||
connect(enableProfile, SIGNAL(triggered(bool)), this, SLOT(enableProfileSlot()));
|
||||
menuActions.append(enableProfile);
|
||||
}
|
||||
|
||||
|
||||
@ -227,7 +233,7 @@ void Netctl::sendNotification(const QString eventId, const QString message)
|
||||
{
|
||||
KNotification *notification = new KNotification(eventId);
|
||||
notification->setComponentData(KComponentData("plasma_applet_netctl"));
|
||||
notification->setTitle(eventId);
|
||||
notification->setTitle(QString("Netctl ::: ") + eventId);
|
||||
notification->setText(message);
|
||||
notification->sendEvent();
|
||||
delete notification;
|
||||
@ -236,6 +242,7 @@ void Netctl::sendNotification(const QString eventId, const QString message)
|
||||
|
||||
void Netctl::showGui()
|
||||
{
|
||||
sendNotification(QString("Info"), i18n("Start GUI"));
|
||||
QProcess command;
|
||||
command.startDetached(paths[QString("gui")]);
|
||||
}
|
||||
@ -298,12 +305,16 @@ void Netctl::dataUpdated(const QString &sourceName, const Plasma::DataEngine::Da
|
||||
}
|
||||
else if (sourceName == QString("statusBool")) {
|
||||
if (value == QString("true")) {
|
||||
if (! status)
|
||||
sendNotification(QString("Info"), i18n("Network is up"));
|
||||
status = true;
|
||||
iconWidget->setIcon(paths[QString("active")]);
|
||||
}
|
||||
else {
|
||||
iconWidget->setIcon(paths[QString("inactive")]);
|
||||
if (status)
|
||||
sendNotification(QString("Info"), i18n("Network is down"));
|
||||
status = false;
|
||||
iconWidget->setIcon(paths[QString("inactive")]);
|
||||
}
|
||||
}
|
||||
else if (sourceName == QString("statusString")) {
|
||||
@ -481,7 +492,7 @@ void Netctl::configChanged()
|
||||
paths[QString("gui")] = cg.readEntry("guiPath", "/usr/bin/netctl-gui");
|
||||
paths[QString("netctl")] = cg.readEntry("netctlPath", "/usr/bin/netctl");
|
||||
useSudo = cg.readEntry("useSudo", true);
|
||||
paths[QString("sudo")] = cg.readEntry("sudoPath", "/usr/bin/kdesu -c");
|
||||
paths[QString("sudo")] = cg.readEntry("sudoPath", "/usr/bin/kdesu");
|
||||
bigInterface[QString("main")] = cg.readEntry("showBigInterface", true);
|
||||
bigInterface[QString("extIp")] = cg.readEntry("showExtIp", false);
|
||||
bigInterface[QString("netDev")] = cg.readEntry("showNetDev", true);
|
||||
|
@ -60,7 +60,7 @@ private slots:
|
||||
void selectInactiveIcon();
|
||||
void selectNetctlExe();
|
||||
// context menu
|
||||
void enableProfileAutoloadSlot();
|
||||
void enableProfileSlot();
|
||||
void startProfileSlot(QAction *profile);
|
||||
void stopProfileSlot();
|
||||
void restartProfileSlot();
|
||||
@ -83,7 +83,7 @@ private:
|
||||
void createActions();
|
||||
QList<QAction*> menuActions;
|
||||
QMenu *startProfileMenu;
|
||||
QAction *enableProfileAutoload;
|
||||
QAction *enableProfile;
|
||||
QAction *startProfile;
|
||||
QAction *stopProfile;
|
||||
QAction *restartProfile;
|
||||
|
@ -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-06 18:45+0400\n"
|
||||
"PO-Revision-Date: 2014-04-06 12:33+0400\n"
|
||||
"POT-Creation-Date: 2014-04-07 00:27+0400\n"
|
||||
"PO-Revision-Date: 2014-04-07 00:28+0400\n"
|
||||
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
|
||||
"Language-Team: Russian <kde-russian@lists.kde.ru>\n"
|
||||
"Language: ru\n"
|
||||
@ -18,43 +18,75 @@ msgstr ""
|
||||
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
"X-Generator: Lokalize 1.5\n"
|
||||
|
||||
#: netctl.cpp:171
|
||||
#: netctl.cpp:112
|
||||
msgid "Set profile %1 disabled"
|
||||
msgstr "Set profile %1 disabled"
|
||||
|
||||
#: netctl.cpp:116
|
||||
msgid "Set profile %1 enabled"
|
||||
msgstr "Set profile %1 enabled"
|
||||
|
||||
#: netctl.cpp:132
|
||||
msgid "Start profile %1"
|
||||
msgstr "Start profile %1"
|
||||
|
||||
#: netctl.cpp:151
|
||||
msgid "Stop profile %1"
|
||||
msgstr "Stop profile %1"
|
||||
|
||||
#: netctl.cpp:165
|
||||
msgid "Restart profile %1"
|
||||
msgstr "Restart profile %1"
|
||||
|
||||
#: netctl.cpp:178
|
||||
msgid "Start another profile"
|
||||
msgstr "Start another profile"
|
||||
|
||||
#: netctl.cpp:173
|
||||
#: netctl.cpp:180
|
||||
msgid "Stop "
|
||||
msgstr "Stop "
|
||||
|
||||
#: netctl.cpp:175
|
||||
#: netctl.cpp:182
|
||||
msgid "Restart "
|
||||
msgstr "Restart "
|
||||
|
||||
#: netctl.cpp:178
|
||||
#: netctl.cpp:185
|
||||
msgid "Disable "
|
||||
msgstr "Disable "
|
||||
|
||||
#: netctl.cpp:180
|
||||
#: netctl.cpp:187
|
||||
msgid "Enable "
|
||||
msgstr "Enable "
|
||||
|
||||
#: netctl.cpp:183 netctl.cpp:203
|
||||
#: netctl.cpp:190 netctl.cpp:210
|
||||
msgid "Start profile"
|
||||
msgstr "Start profile"
|
||||
|
||||
#: netctl.cpp:210
|
||||
#: netctl.cpp:217
|
||||
msgid "Stop profile"
|
||||
msgstr "Stop profile"
|
||||
|
||||
#: netctl.cpp:214
|
||||
#: netctl.cpp:221
|
||||
msgid "Restart profile"
|
||||
msgstr "Restart profile"
|
||||
|
||||
#: netctl.cpp:218
|
||||
#: netctl.cpp:225
|
||||
msgid "Enable profile"
|
||||
msgstr "Enable profile"
|
||||
|
||||
#: netctl.cpp:420
|
||||
#: netctl.cpp:245
|
||||
msgid "Start GUI"
|
||||
msgstr "Start GUI"
|
||||
|
||||
#: netctl.cpp:309
|
||||
msgid "Network is up"
|
||||
msgstr "Network is up"
|
||||
|
||||
#: netctl.cpp:315
|
||||
msgid "Network is down"
|
||||
msgstr "Network is down"
|
||||
|
||||
#: netctl.cpp:431
|
||||
msgid "Netctl plasmoid"
|
||||
msgstr "Netctl plasmoid"
|
||||
|
||||
@ -232,3 +264,4 @@ msgstr "Evgeniy Alekseev"
|
||||
msgctxt "EMAIL OF TRANSLATORS"
|
||||
msgid "Your emails"
|
||||
msgstr "esalexeev@gmail.com"
|
||||
|
||||
|
@ -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-06 18:45+0400\n"
|
||||
"POT-Creation-Date: 2014-04-07 00:27+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,43 +17,75 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: netctl.cpp:171
|
||||
msgid "Start another profile"
|
||||
#: netctl.cpp:112
|
||||
msgid "Set profile %1 disabled"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:173
|
||||
msgid "Stop "
|
||||
#: netctl.cpp:116
|
||||
msgid "Set profile %1 enabled"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:175
|
||||
msgid "Restart "
|
||||
#: netctl.cpp:132
|
||||
msgid "Start profile %1"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:151
|
||||
msgid "Stop profile %1"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:165
|
||||
msgid "Restart profile %1"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:178
|
||||
msgid "Disable "
|
||||
msgid "Start another profile"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:180
|
||||
msgid "Stop "
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:182
|
||||
msgid "Restart "
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:185
|
||||
msgid "Disable "
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:187
|
||||
msgid "Enable "
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:183 netctl.cpp:203
|
||||
#: netctl.cpp:190 netctl.cpp:210
|
||||
msgid "Start profile"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:210
|
||||
#: netctl.cpp:217
|
||||
msgid "Stop profile"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:214
|
||||
#: netctl.cpp:221
|
||||
msgid "Restart profile"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:218
|
||||
#: netctl.cpp:225
|
||||
msgid "Enable profile"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:420
|
||||
#: netctl.cpp:245
|
||||
msgid "Start GUI"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:309
|
||||
msgid "Network is up"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:315
|
||||
msgid "Network is down"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:431
|
||||
msgid "Netctl plasmoid"
|
||||
msgstr ""
|
||||
|
||||
|
@ -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-06 18:45+0400\n"
|
||||
"PO-Revision-Date: 2014-04-06 12:32+0400\n"
|
||||
"POT-Creation-Date: 2014-04-07 00:27+0400\n"
|
||||
"PO-Revision-Date: 2014-04-07 00:28+0400\n"
|
||||
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
|
||||
"Language-Team: Russian <kde-russian@lists.kde.ru>\n"
|
||||
"Language: ru\n"
|
||||
@ -18,43 +18,75 @@ msgstr ""
|
||||
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
"X-Generator: Lokalize 1.5\n"
|
||||
|
||||
#: netctl.cpp:171
|
||||
#: netctl.cpp:112
|
||||
msgid "Set profile %1 disabled"
|
||||
msgstr "Выключение автозагрузки профиля %1"
|
||||
|
||||
#: netctl.cpp:116
|
||||
msgid "Set profile %1 enabled"
|
||||
msgstr "Включение автозагрузки профиля %1"
|
||||
|
||||
#: netctl.cpp:132
|
||||
msgid "Start profile %1"
|
||||
msgstr "Запуск профиля %1"
|
||||
|
||||
#: netctl.cpp:151
|
||||
msgid "Stop profile %1"
|
||||
msgstr "Остановка профиля %1"
|
||||
|
||||
#: netctl.cpp:165
|
||||
msgid "Restart profile %1"
|
||||
msgstr "Перезапуск профиля %1"
|
||||
|
||||
#: netctl.cpp:178
|
||||
msgid "Start another profile"
|
||||
msgstr "Запустить другой профиль"
|
||||
|
||||
#: netctl.cpp:173
|
||||
#: netctl.cpp:180
|
||||
msgid "Stop "
|
||||
msgstr "Остановить "
|
||||
|
||||
#: netctl.cpp:175
|
||||
#: netctl.cpp:182
|
||||
msgid "Restart "
|
||||
msgstr "Перезапустить "
|
||||
|
||||
#: netctl.cpp:178
|
||||
#: netctl.cpp:185
|
||||
msgid "Disable "
|
||||
msgstr "Отключить "
|
||||
|
||||
#: netctl.cpp:180
|
||||
#: netctl.cpp:187
|
||||
msgid "Enable "
|
||||
msgstr "Включить "
|
||||
|
||||
#: netctl.cpp:183 netctl.cpp:203
|
||||
#: netctl.cpp:190 netctl.cpp:210
|
||||
msgid "Start profile"
|
||||
msgstr "Запустить профиль"
|
||||
|
||||
#: netctl.cpp:210
|
||||
#: netctl.cpp:217
|
||||
msgid "Stop profile"
|
||||
msgstr "Остановить профиль"
|
||||
|
||||
#: netctl.cpp:214
|
||||
#: netctl.cpp:221
|
||||
msgid "Restart profile"
|
||||
msgstr "Перезапустить профиль"
|
||||
|
||||
#: netctl.cpp:218
|
||||
#: netctl.cpp:225
|
||||
msgid "Enable profile"
|
||||
msgstr "Включить профиль"
|
||||
|
||||
#: netctl.cpp:420
|
||||
#: netctl.cpp:245
|
||||
msgid "Start GUI"
|
||||
msgstr "Запуск GUI"
|
||||
|
||||
#: netctl.cpp:309
|
||||
msgid "Network is up"
|
||||
msgstr "Сеть работает"
|
||||
|
||||
#: netctl.cpp:315
|
||||
msgid "Network is down"
|
||||
msgstr "Сеть не работает"
|
||||
|
||||
#: netctl.cpp:431
|
||||
msgid "Netctl plasmoid"
|
||||
msgstr "Netctl plasmoid"
|
||||
|
||||
@ -232,3 +264,4 @@ msgstr "Evgeniy Alekseev"
|
||||
msgctxt "EMAIL OF TRANSLATORS"
|
||||
msgid "Your emails"
|
||||
msgstr "esalexeev@gmail.com"
|
||||
|
||||
|
Reference in New Issue
Block a user