diff --git a/sources/CMakeLists.txt b/sources/CMakeLists.txt index 04abd88..65088fa 100644 --- a/sources/CMakeLists.txt +++ b/sources/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.12) cmake_policy (SET CMP0003 OLD) cmake_policy (SET CMP0002 OLD) @@ -29,21 +29,22 @@ option (BUILD_HELPER "Build helper" ON) option (BUILD_LIBRARY "Build library" ON) option (BUILD_DATAENGINE "Build DataEngine" ON) option (BUILD_PLASMOID "Build plasmoid" ON) +option (BUILD_KDE4 "Build on KDE4" OFF) if (BUILD_GUI OR BUILD_HELPER) - set (BUILD_LIBRARY ON) + set (BUILD_LIBRARY ON) endif () if (BUILD_PLASMOID) - set (BUILD_DATAENGINE ON) + set (BUILD_DATAENGINE ON) endif () # documentation option (BUILD_DOCS "Build Doxygen documentation" OFF) if (BUILD_DOCS) - set (BUILD_LIBRARY ON) + set (BUILD_LIBRARY ON) endif () # test option (BUILD_TEST "Build unit tests" OFF) if (BUILD_TEST) - set (BUILD_LIBRARY ON) + set (BUILD_LIBRARY ON) endif () # FIXME: dbus path set (DBUS_SYSTEMCONF_PATH "/etc/dbus-1/system.d/" CACHE STRING "Path to dbus system configuration files") @@ -51,11 +52,11 @@ set (SYSTEMD_SERVICE_PATH "lib/systemd/system" CACHE STRING "Path to systemd ser # flags if (CMAKE_COMPILER_IS_GNUCXX) - set (CMAKE_CXX_FLAGS "-Wall -std=c++11") - set (CMAKE_CXX_FLAGS_DEBUG "-g -O0") - set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") + set (CMAKE_CXX_FLAGS "-Wall -std=c++11") + set (CMAKE_CXX_FLAGS_DEBUG "-g -O0") + set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") else () - message (STATUS "Unknown compiler") + message (STATUS "Unknown compiler") endif () configure_file (${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h) @@ -68,21 +69,25 @@ add_subdirectory (${PROJECT_RESOURCE_DIR}) # components if (BUILD_LIBRARY) - add_subdirectory (${PROJECT_LIBRARY}) + add_subdirectory (${PROJECT_LIBRARY}) endif () if (BUILD_HELPER) - add_subdirectory (helper) + add_subdirectory (helper) endif () if (BUILD_TEST) - enable_testing () - add_subdirectory (test) + enable_testing () + add_subdirectory (test) 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) + if (BUILD_KDE4) + add_subdirectory (plasmoid-kde4) + else () + add_subdirectory (plasmoid-kf5) + endif (BUILD_KDE4) endif () diff --git a/sources/dataengine/CMakeLists.txt b/sources/dataengine/CMakeLists.txt index 8712186..95933f6 100644 --- a/sources/dataengine/CMakeLists.txt +++ b/sources/dataengine/CMakeLists.txt @@ -3,16 +3,37 @@ set (SUBPROJECT plasma_engine_netctl) message (STATUS "Subproject ${SUBPROJECT}") # find required libaries -find_package (KDE4 REQUIRED) -include (KDE4Defaults) +if (BUILD_KDE4) + find_package (KDE4 REQUIRED) + include (KDE4Defaults) + + add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) +else () + find_package (Qt5 REQUIRED COMPONENTS Widgets Network) + find_package (ECM 0.0.11 REQUIRED NO_MODULE) + set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) + find_package(KF5 REQUIRED COMPONENTS Plasma Service) + + include (KDEInstallDirs) + include (KDECMakeSettings) + include (KDECompilerSettings) + add_definitions (${Qt5Core_DEFINITIONS} ${Qt5Network_DEFINITIONS}) + + set (Qt_INCLUDE ${Qt5Core_INCLUDE_DIRS} + ${Qt5Network_INCLUDE_DIRS}) + set (KDE_INCLUDE ${ConfigCore_INCLUDE_DIR} + ${CoreAddons_INCLUDE_DIR} + ${Plasma_INCLUDE_DIR} + ${Service_INCLUDE_DIR}) +endif () -add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} - ${KDE4_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../ - ${PROJECT_TRDPARTY_DIR}) + ${PROJECT_TRDPARTY_DIR} + ${Qt_INCLUDE} + ${KDE_INCLUDE}) set (PLUGIN_NAME ${SUBPROJECT}) file (GLOB SUBPROJECT_DESKTOP_IN *.desktop) @@ -25,11 +46,22 @@ file (GLOB SUBPROJECT_CONF *.conf) configure_file (${SUBPROJECT_DESKTOP_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP}) # make -qt4_wrap_cpp (TASK_MOC_SOURCE ${TASK_HEADER}) -kde4_add_plugin (${PLUGIN_NAME} ${SUBPROJECT_SOURCE} ${TASK_MOC_SOURCE}) -target_link_libraries (${PLUGIN_NAME} ${KDE4_KDECORE_LIBS} ${KDE4_PLASMA_LIBS} ${QT_QTNETWORK_LIBRARY}) +if (BUILD_KDE4) + qt4_wrap_cpp (TASK_MOC_SOURCE ${TASK_HEADER}) + kde4_add_plugin (${PLUGIN_NAME} ${SUBPROJECT_SOURCE} ${TASK_MOC_SOURCE}) + target_link_libraries (${PLUGIN_NAME} ${KDE4_KDECORE_LIBS} ${KDE4_PLASMA_LIBS} ${QT_QTNETWORK_LIBRARY}) +else () + qt5_wrap_cpp (TASK_MOC_SOURCE ${TASK_HEADER}) + add_library (${PLUGIN_NAME} MODULE ${SUBPROJECT_SOURCE} ${TASK_MOC_SOURCE}) + target_link_libraries (${PLUGIN_NAME} ${Plasma_LIBRARIES} ${Qt5Network_LIBRARIES}) + kcoreaddons_desktop_to_json (${PLUGIN_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP}) +endif () # install -install (TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGIN_INSTALL_DIR}) +if (BUILD_KDE4) + install (TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGIN_INSTALL_DIR}) +else () + install (TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGIN_INSTALL_DIR}/plasma/dataengine) +endif () install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR}) install (FILES ${SUBPROJECT_CONF} DESTINATION ${CONFIG_INSTALL_DIR}) diff --git a/sources/dataengine/netctl.cpp b/sources/dataengine/netctl.cpp index f37bcc2..0ff6816 100644 --- a/sources/dataengine/netctl.cpp +++ b/sources/dataengine/netctl.cpp @@ -17,8 +17,6 @@ #include "netctl.h" -#include -#include #include #include @@ -29,6 +27,15 @@ #include #include +#include + +// KF5-KDE4 compability +#ifdef BUILD_KDE4 +#include +#include +#else +#include +#endif /* BUILD_KDE4 */ Netctl::Netctl(QObject *parent, const QVariantList &args) @@ -89,7 +96,12 @@ void Netctl::readConfiguration() rawConfig[QString("NETCTLCMD")] = QString("/usr/bin/netctl"); rawConfig[QString("NETCTLAUTOCMD")] = QString("/usr/bin/netctl-auto"); - QString fileName = KGlobal::dirs()->findResource("config", "netctl.conf"); + QString fileName; +#ifdef BUILD_KDE4 + fileName = KGlobal::dirs()->findResource("config", "netctl.conf"); +#else + fileName = QStandardPaths::locate(QStandardPaths::ConfigLocation, QString("netctl.conf")); +#endif /* BUILD_KDE4 */ if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << fileName; QFile configFile(fileName); if (!configFile.open(QIODevice::ReadOnly)) { @@ -388,6 +400,10 @@ bool Netctl::updateSourceEvent(const QString &source) } +#ifdef BUILD_KDE4 K_EXPORT_PLASMA_DATAENGINE(netctl, Netctl) +#else +K_EXPORT_PLASMA_DATAENGINE_WITH_JSON(netctl, Netctl, "plasma-dataengine-netctl.json") +#endif /* BUILD_KDE4 */ #include "netctl.moc" diff --git a/sources/dataengine/plasma-engine-netctl.desktop b/sources/dataengine/plasma-dataengine-netctl.desktop similarity index 79% rename from sources/dataengine/plasma-engine-netctl.desktop rename to sources/dataengine/plasma-dataengine-netctl.desktop index 00b6fb2..9f6521c 100644 --- a/sources/dataengine/plasma-engine-netctl.desktop +++ b/sources/dataengine/plasma-dataengine-netctl.desktop @@ -10,11 +10,11 @@ X-KDE-ServiceTypes=Plasma/DataEngine X-KDE-Library=plasma_engine_netctl X-Plasma-EngineName=netctl -X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis +X-KDE-PluginInfo-Author=Evgeniy Alekseev X-KDE-PluginInfo-Email=esalexeev@gmail.com X-KDE-PluginInfo-Name=netctl X-KDE-PluginInfo-Version=@PROJECT_VERSION@ -X-KDE-PluginInfo-Website=http://arcan1s.github.io/projects/netctlplasmoid +X-KDE-PluginInfo-Website=http://arcanis.name/ru/projects/netctl-gui/ X-KDE-PluginInfo-Category=Network X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPLv3 diff --git a/sources/plasmoid/CMakeLists.txt b/sources/plasmoid-kde4/CMakeLists.txt similarity index 100% rename from sources/plasmoid/CMakeLists.txt rename to sources/plasmoid-kde4/CMakeLists.txt diff --git a/sources/plasmoid/appearance.ui b/sources/plasmoid-kde4/appearance.ui similarity index 100% rename from sources/plasmoid/appearance.ui rename to sources/plasmoid-kde4/appearance.ui diff --git a/sources/plasmoid/dataengine.ui b/sources/plasmoid-kde4/dataengine.ui similarity index 100% rename from sources/plasmoid/dataengine.ui rename to sources/plasmoid-kde4/dataengine.ui diff --git a/sources/plasmoid/netctl.cpp b/sources/plasmoid-kde4/netctl.cpp similarity index 100% rename from sources/plasmoid/netctl.cpp rename to sources/plasmoid-kde4/netctl.cpp diff --git a/sources/plasmoid/netctl.h b/sources/plasmoid-kde4/netctl.h similarity index 100% rename from sources/plasmoid/netctl.h rename to sources/plasmoid-kde4/netctl.h diff --git a/sources/plasmoid/plasma-applet-netctl.desktop b/sources/plasmoid-kde4/plasma-applet-netctl.desktop similarity index 78% rename from sources/plasmoid/plasma-applet-netctl.desktop rename to sources/plasmoid-kde4/plasma-applet-netctl.desktop index ef2656a..2bb2549 100644 --- a/sources/plasmoid/plasma-applet-netctl.desktop +++ b/sources/plasmoid-kde4/plasma-applet-netctl.desktop @@ -8,11 +8,11 @@ Icon=netctl-gui-widget X-KDE-ServiceTypes=Plasma/Applet,Plasma/PopupApplet X-KDE-Library=plasma_applet_netctl -X-KDE-PluginInfo-Author=Evgeniy Alekseev aka arcanis +X-KDE-PluginInfo-Author=Evgeniy Alekseev X-KDE-PluginInfo-Email=esalexeev@gmail.com X-KDE-PluginInfo-Name=netctl X-KDE-PluginInfo-Version=@PROJECT_VERSION@ -X-KDE-PluginInfo-Website=http://arcan1s.github.io/projects/netctlplasmoid +X-KDE-PluginInfo-Website=http://arcanis.name/ru/projects/netctl-gui/ X-KDE-PluginInfo-Category=Network X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPLv3 diff --git a/sources/plasmoid/plasma_applet_netctl.notifyrc b/sources/plasmoid-kde4/plasma_applet_netctl.notifyrc similarity index 100% rename from sources/plasmoid/plasma_applet_netctl.notifyrc rename to sources/plasmoid-kde4/plasma_applet_netctl.notifyrc diff --git a/sources/plasmoid/plasmoid.cppcheck b/sources/plasmoid-kde4/plasmoid.cppcheck similarity index 100% rename from sources/plasmoid/plasmoid.cppcheck rename to sources/plasmoid-kde4/plasmoid.cppcheck diff --git a/sources/plasmoid/po/CMakeLists.txt b/sources/plasmoid-kde4/po/CMakeLists.txt similarity index 100% rename from sources/plasmoid/po/CMakeLists.txt rename to sources/plasmoid-kde4/po/CMakeLists.txt diff --git a/sources/plasmoid/po/en.po b/sources/plasmoid-kde4/po/en.po similarity index 100% rename from sources/plasmoid/po/en.po rename to sources/plasmoid-kde4/po/en.po diff --git a/sources/plasmoid/po/extract_messages.sh b/sources/plasmoid-kde4/po/extract_messages.sh similarity index 100% rename from sources/plasmoid/po/extract_messages.sh rename to sources/plasmoid-kde4/po/extract_messages.sh diff --git a/sources/plasmoid/po/ja.po b/sources/plasmoid-kde4/po/ja.po similarity index 100% rename from sources/plasmoid/po/ja.po rename to sources/plasmoid-kde4/po/ja.po diff --git a/sources/plasmoid/po/plasma_applet_netctl.pot b/sources/plasmoid-kde4/po/plasma_applet_netctl.pot similarity index 100% rename from sources/plasmoid/po/plasma_applet_netctl.pot rename to sources/plasmoid-kde4/po/plasma_applet_netctl.pot diff --git a/sources/plasmoid/po/ru.po b/sources/plasmoid-kde4/po/ru.po similarity index 100% rename from sources/plasmoid/po/ru.po rename to sources/plasmoid-kde4/po/ru.po diff --git a/sources/plasmoid/widget.ui b/sources/plasmoid-kde4/widget.ui similarity index 100% rename from sources/plasmoid/widget.ui rename to sources/plasmoid-kde4/widget.ui diff --git a/sources/plasmoid-kf5/CMakeLists.txt b/sources/plasmoid-kf5/CMakeLists.txt new file mode 100644 index 0000000..192f1e3 --- /dev/null +++ b/sources/plasmoid-kf5/CMakeLists.txt @@ -0,0 +1,85 @@ +# 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) +# include (KDE4Defaults) +# +# add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) +# include_directories (${CMAKE_SOURCE_DIR} +# ${CMAKE_BINARY_DIR} +# ${KDE4_INCLUDES} +# ${CMAKE_CURRENT_BINARY_DIR} +# ${CMAKE_CURRENT_BINARY_DIR}/../ +# ${PROJECT_TRDPARTY_DIR}) +# +# # add_subdirectory (po) +# +# # set sources +# set (PLUGIN_NAME ${SUBPROJECT}) +# file (GLOB SUBPROJECT_DESKTOP_IN *.desktop) +# file (RELATIVE_PATH SUBPROJECT_DESKTOP ${CMAKE_SOURCE_DIR} ${SUBPROJECT_DESKTOP_IN}) +# file (GLOB SUBPROJECT_NOTIFY *.notifyrc) +# file (GLOB SUBPROJECT_SOURCE *.cpp) +# file (GLOB_RECURSE SUBPROJECT_UI *.ui ${PROJECT_TRDPARTY_DIR}/about/*.ui) +# +# # prepare +# 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} ${QRC_SOURCES}) +# target_link_libraries (${PLUGIN_NAME} ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS}) +# +# # install +# install (TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGIN_INSTALL_DIR}) +# install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR}) +# install (FILES ${SUBPROJECT_NOTIFY} DESTINATION ${DATA_INSTALL_DIR}/${PLUGIN_NAME}) +# plasma_install_package(plasmoid org.kde.plasma.netctl) +find_package (Qt5 REQUIRED COMPONENTS Core DBus Qml Widgets) +find_package (ECM 0.0.12 REQUIRED NO_MODULE) +set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) +find_package(KF5 REQUIRED COMPONENTS I18n Service WidgetsAddons KIO CoreAddons Notifications Plasma) +find_package(KF5I18n CONFIG REQUIRED) + +include (KDEInstallDirs) +include (KDECMakeSettings) +include (KDECompilerSettings) +add_definitions (${Qt5Core_DEFINITIONS} ${Qt5DBus_DEFINITIONS} ${Qt5Qml_DEFINITIONS}) + +set (Qt_INCLUDE ${Qt5Core_INCLUDE_DIRS} + ${Qt5DBus_INCLUDE_DIRS} + ${Qt5Qml_INCLUDE_DIRS}) +set (Kf5_INCLUDE ${ConfigCore_INCLUDE_DIR} + ${CoreAddons_INCLUDE_DIR} + ${I18n_INCLUDE_DIR} + ${INTERFACE_INCLUDE_DIRECTORIES} + ${Notifications_INCLUDE_DIR} + ${Plasma_INCLUDE_DIR} + ${Service_INCLUDE_DIR}) + +set (PLUGIN_NAME netctlplugin) +add_subdirectory (plugin) + +# set(dir plasmoid) +# set(component org.kde.plasma.netctl) +# set(root ${ARGV2}) +# set(type ${ARGV3}) +# if(NOT root) +# set(root plasmoids) +# endif() +# if(NOT type) +# set(type applet) +# endif() +# install(DIRECTORY ${dir}/ DESTINATION ${PLASMA_DATA_INSTALL_DIR}/${root}/${component} +# PATTERN CMakeLists.txt EXCLUDE +# PATTERN README.txt EXCLUDE +# PATTERN Messages.sh EXCLUDE +# PATTERN dummydata EXCLUDE) +# +# install(FILES ${dir}/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME plasma-${type}-${component}.desktop) +plasma_install_package (plasmoid org.kde.plasma.netctl) diff --git a/sources/plasmoid-kf5/dataengine.ui b/sources/plasmoid-kf5/dataengine.ui new file mode 100644 index 0000000..019f720 --- /dev/null +++ b/sources/plasmoid-kf5/dataengine.ui @@ -0,0 +1,185 @@ + + + DataEngineWindow + + + + 0 + 0 + 480 + 333 + + + + + 480 + 320 + + + + Configuration Window + + + + + + + + + 150 + 23 + + + + Path to netctl + + + + + + + + + + + 100 + 23 + + + + Browse + + + + + + + + + + + + 150 + 23 + + + + Path to netctl-auto + + + + + + + + + + + 100 + 23 + + + + Browse + + + + + + + + + + + + 150 + 23 + + + + Check external IPv4 + + + true + + + + + + + + + + + 100 + 23 + + + + Browse + + + + + + + + + + + + 150 + 23 + + + + Check external IPv6 + + + true + + + + + + + + + + + 100 + 23 + + + + Browse + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + lineEdit_netctl + pushButton_netctl + checkBox_extIp4 + lineEdit_extIp4 + pushButton_extIp4 + + + + diff --git a/sources/plasmoid-kf5/netctl.cpp b/sources/plasmoid-kf5/netctl.cpp new file mode 100644 index 0000000..a9689d0 --- /dev/null +++ b/sources/plasmoid-kf5/netctl.cpp @@ -0,0 +1,1035 @@ +/*************************************************************************** + * 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 +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "netctl.h" +#include "ui_about.h" +#include "ui_appearance.h" +#include "ui_dataengine.h" +#include "ui_widget.h" +#include "version.h" + + +IconLabel::IconLabel(Netctl *wid, const bool debugCmd) + : QLabel(), + debug(debugCmd), + widget(wid) +{ +} + + +IconLabel::~IconLabel() +{ +} + + +void IconLabel::mousePressEvent(QMouseEvent *event) +{ + if (debug) qDebug() << PDEBUG; + + if (event->button() == Qt::LeftButton) + widget->showGui(); +} + + +Netctl::Netctl(QObject *parent, const QVariantList &args) + : Plasma::PopupApplet(parent, args) +{ + // debug + QProcessEnvironment environment = QProcessEnvironment::systemEnvironment(); + QString debugEnv = environment.value(QString("NETCTLGUI_DEBUG"), QString("no")); + if (debugEnv == QString("yes")) + debug = true; + else + debug = false; + + setBackgroundHints(DefaultBackground); + setAspectRatioMode(Plasma::IgnoreAspectRatio); + setHasConfigurationInterface(true); + // text format init + formatLine.append(QString("")); + formatLine.append(QString("")); +} + + +Netctl::~Netctl() +{ + if (debug) qDebug() << PDEBUG; + +// // actions +// delete startProfileMenu; +// delete switchToProfileMenu; +// // dataengine +// disconnectFromEngine(); +// delete netctlEngine; +// // ui +// delete iconWidget; +// delete textLabel; +// delete layout; +// delete graphicsWidget; +} + + +void Netctl::init() +{ + if (debug) qDebug() << PDEBUG; + + info[QString("current")] = QString("N\\A"); + info[QString("extip4")] = QString("N\\A"); + info[QString("extip6")] = QString("N\\A"); + info[QString("interfaces")] = QString("N\\A"); + info[QString("info")] = QString("N\\A (N\\A)"); + info[QString("intip4")] = QString("N\\A"); + info[QString("intip6")] = QString("N\\A"); + info[QString("profiles")] = QString("N\\A"); + info[QString("status")] = QString("N\\A"); + + netctlEngine = dataEngine(QString("netctl")); + createActions(); + // generate ui + graphicsWidget = new QWidget(); + graphicsWidget->setAttribute(Qt::WA_TranslucentBackground, true); + setWidget(graphicsWidget); + // layouts + layout = new QHBoxLayout(graphicsWidget); + layout->setContentsMargins(1, 1, 1, 1); + iconLabel = new IconLabel(this, debug); + layout->addWidget(iconLabel); + textLabel = new QLabel(graphicsWidget); + layout->addWidget(textLabel); + // read variables + configChanged(); +} + + +QString Netctl::parsePattern(const QString rawLine) +{ + if (debug) qDebug() << PDEBUG; + + QString line = rawLine; + for (int i=0; i Netctl::readDataEngineConfiguration() +{ + if (debug) qDebug() << PDEBUG; + + QMap rawConfig; + rawConfig[QString("EXTIP4")] = QString("false"); + rawConfig[QString("EXTIP4CMD")] = QString("curl ip4.telize.com"); + rawConfig[QString("EXTIP6")] = QString("false"); + rawConfig[QString("EXTIP6CMD")] = QString("curl ip6.telize.com"); + rawConfig[QString("NETCTLCMD")] = QString("/usr/bin/netctl"); + rawConfig[QString("NETCTLAUTOCMD")] = QString("/usr/bin/netctl-auto"); + + QString fileName = KGlobal::dirs()->findResource("config", "netctl.conf"); + if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << fileName; + QFile configFile(fileName); + if (!configFile.open(QIODevice::ReadOnly)) + return updateDataEngineConfiguration(rawConfig); + QString fileStr; + QStringList value; + while (true) { + fileStr = QString(configFile.readLine()).trimmed(); + if ((fileStr.isEmpty()) && (!configFile.atEnd())) continue; + if ((fileStr[0] == QChar('#')) && (!configFile.atEnd())) continue; + if ((fileStr[0] == QChar(';')) && (!configFile.atEnd())) continue; + if (fileStr.contains(QChar('='))) { + value.clear(); + for (int i=1; i settings) +{ + if (debug) qDebug() << PDEBUG; + + QMap config = updateDataEngineConfiguration(settings); + QString fileName = KGlobal::dirs()->locateLocal("config", "netctl.conf"); + if (debug) qDebug() << PDEBUG << ":" << "Configuration file" << fileName; + QFile configFile(fileName); + if (!configFile.open(QIODevice::WriteOnly)) return; + for (int i=0; i Netctl::updateDataEngineConfiguration(const QMap rawConfig) +{ + if (debug) qDebug() << PDEBUG; + + QMap config; + QString key, value; + // remove spaces and copy source map + for (int i=0; isetPixmap(iconPixmap); +} + + +void Netctl::updateInterface(bool setShown) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "State" << setShown; + + if (setShown) + layout->addWidget(textLabel); + else + layout->removeWidget(textLabel); + graphicsWidget->adjustSize(); + resize(1, 1); +} + + +// context menu +void Netctl::enableProfileSlot() +{ + if (debug) qDebug() << PDEBUG; + + QString enableStatus = QString(""); + if (info[QString("status")].contains(QString("enabled"))) { + enableStatus = QString(" disable "); + sendNotification(QString("Info"), i18n("Set profile %1 disabled", info[QString("current")])); + } else { + enableStatus = QString(" enable "); + sendNotification(QString("Info"), i18n("Set profile %1 enabled", info[QString("current")])); + } + if (useHelper) { + QList args; + args.append(info[QString("current")]); + sendDBusRequest(QString("Enable"), args); + } else { + QProcess command; + QString commandLine = QString(""); + if (useSudo) + commandLine = paths[QString("sudo")] + QString(" "); + commandLine += paths[QString("netctl")] + enableStatus + info[QString("current")]; + command.startDetached(commandLine); + } +} + + +void Netctl::restartProfileSlot() +{ + if (debug) qDebug() << PDEBUG; + + sendNotification(QString("Info"), i18n("Restart profile %1", info[QString("current")])); + if (useHelper) { + QList args; + args.append(info[QString("current")]); + sendDBusRequest(QString("Restart"), args); + } else { + QProcess command; + QString commandLine = QString(""); + if (useSudo) + commandLine = paths[QString("sudo")] + QString(" "); + commandLine += paths[QString("netctl")] + QString(" restart ") + info[QString("current")]; + command.startDetached(commandLine); + } +} + + +void Netctl::startProfileSlot(QAction *profile) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Profile" << profile->text().remove(QChar('&')); + + sendNotification(QString("Info"), i18n("Start profile %1", profile->text().remove(QChar('&')))); + if (useHelper) { + QList args; + args.append(profile->text().remove(QChar('&'))); + if (status) + sendDBusRequest(QString("SwitchTo"), args); + else + sendDBusRequest(QString("Start"), args); + } else { + QProcess command; + QString commandLine = QString(""); + if (useSudo) + commandLine = paths[QString("sudo")] + QString(" "); + if (status) + commandLine += paths[QString("netctl")] + QString(" switch-to ") + profile->text().remove(QChar('&')); + else + commandLine += paths[QString("netctl")] + QString(" start ") + profile->text().remove(QChar('&')); + command.startDetached(commandLine); + } +} + + +void Netctl::stopProfileSlot() +{ + if (debug) qDebug() << PDEBUG; + + sendNotification(QString("Info"), i18n("Stop profile %1", info[QString("current")])); + if (useHelper) { + QList args; + args.append(info[QString("current")]); + sendDBusRequest(QString("Start"), args); + } else { + QProcess command; + QString commandLine = QString(""); + if (useSudo) + commandLine = paths[QString("sudo")] + QString(" "); + commandLine += paths[QString("netctl")] + QString(" stop ") + info[QString("current")]; + command.startDetached(commandLine); + } +} + + +void Netctl::stopAllProfilesSlot() +{ + if (debug) qDebug() << PDEBUG; + + sendNotification(QString("Info"), i18n("Stop all profiles")); + if (useHelper) + sendDBusRequest(QString("StopAll"), QList()); + else { + QProcess command; + QString commandLine = QString(""); + if (useSudo) + commandLine = paths[QString("sudo")] + QString(" "); + commandLine += paths[QString("netctl")] + QString(" stop-all "); + command.startDetached(commandLine); + } +} + + +void Netctl::switchToProfileSlot(QAction *profile) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Profile" << profile->text().remove(QChar('&')); + + + sendNotification(QString("Info"), i18n("Switch to profile %1", profile->text().remove(QChar('&')))); + if (useHelper) { + QList args; + args.append(profile->text().remove(QChar('&'))); + sendDBusRequest(QString("autoStart"), args); + } else { + QProcess command; + QString commandLine = paths[QString("netctlAuto")] + QString(" switch-to ") + + profile->text().remove(QChar('&')); + command.startDetached(commandLine); + } +} + + +void Netctl::startHelper() +{ + if (debug) qDebug() << PDEBUG; + + QProcess command; + QString commandLine = paths[QString("helper")]; + + command.startDetached(commandLine); +} + + +void Netctl::checkHelperStatus() +{ + if (debug) qDebug() << PDEBUG; + + if (useHelper) + useHelper = !sendDBusRequest(QString("Active"), QList()).isEmpty(); +} + + +QList Netctl::contextualActions() +{ + if (debug) qDebug() << PDEBUG; + + 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("current")] + QString(" ") + info[QString("status")]); + + if (info[QString("status")] == QString("(netctl-auto)")) { + contextMenu[QString("start")]->setVisible(false); + contextMenu[QString("stop")]->setVisible(false); + contextMenu[QString("stopall")]->setVisible(false); + contextMenu[QString("switch")]->setVisible(true); + contextMenu[QString("restart")]->setVisible(false); + contextMenu[QString("enable")]->setVisible(false); + switchToProfileMenu->clear(); + for (int i=0; iaddAction(profile); + } + } else { + if (info[QString("current")].contains(QChar('|'))) { + contextMenu[QString("start")]->setVisible(true); + contextMenu[QString("stop")]->setVisible(false); + contextMenu[QString("stopall")]->setVisible(true); + contextMenu[QString("switch")]->setVisible(false); + contextMenu[QString("restart")]->setVisible(false); + contextMenu[QString("enable")]->setVisible(false); + } else { + contextMenu[QString("start")]->setVisible(true); + contextMenu[QString("stop")]->setVisible(status); + contextMenu[QString("stopall")]->setVisible(false); + contextMenu[QString("switch")]->setVisible(false); + contextMenu[QString("restart")]->setVisible(status); + contextMenu[QString("enable")]->setVisible(status); + } + if (status) { + contextMenu[QString("start")]->setText(i18n("Start another profile")); + contextMenu[QString("stop")]->setText(i18n("Stop %1", info[QString("current")])); + contextMenu[QString("restart")]->setText(i18n("Restart %1", info[QString("current")])); + if (info[QString("status")].contains(QString("enabled"))) + contextMenu[QString("enable")]->setText(i18n("Disable %1", info[QString("current")])); + else + contextMenu[QString("enable")]->setText(i18n("Enable %1", info[QString("current")])); + } + else + contextMenu[QString("start")]->setText(i18n("Start profile")); + startProfileMenu->clear(); + for (int i=0; iaddAction(profile); + } + } + + contextMenu[QString("wifi")]->setVisible(useWifi); + + return menuActions; +} + + +void Netctl::createActions() +{ + if (debug) qDebug() << PDEBUG; + + 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, + SLOT(startProfileSlot(QAction *))); + 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("stopall")] = new QAction(i18n("Stop all profiles"), this); + contextMenu[QString("stopall")]->setIcon(QIcon::fromTheme("dialog-close")); + connect(contextMenu[QString("stopall")], SIGNAL(triggered(bool)), this, SLOT(stopAllProfilesSlot())); + menuActions.append(contextMenu[QString("stopall")]); + + 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")]); + + contextMenu[QString("enable")] = new QAction(i18n("Enable profile"), this); + connect(contextMenu[QString("enable")], SIGNAL(triggered(bool)), this, SLOT(enableProfileSlot())); + menuActions.append(contextMenu[QString("enable")]); + + contextMenu[QString("gui")] = new QAction(i18n("Show netctl-gui"), this); + contextMenu[QString("gui")]->setIcon(QIcon(":icon")); + connect(contextMenu[QString("gui")], SIGNAL(triggered(bool)), this, SLOT(showGui())); + menuActions.append(contextMenu[QString("gui")]); + + 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")]); +} + + +// events +void Netctl::sendNotification(const QString eventId, const QString message) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Event" << eventId; + if (debug) qDebug() << PDEBUG << ":" << "Message" << message; + + KNotification *notification = new KNotification(eventId); + notification->setComponentData(KComponentData("plasma_applet_netctl")); + notification->setTitle(QString("Netctl ::: ") + eventId); + notification->setText(message); + notification->sendEvent(); + delete notification; +} + + +void Netctl::showGui() +{ + if (debug) qDebug() << PDEBUG; + + sendNotification(QString("Info"), i18n("Start GUI")); + QProcess command; + + command.startDetached(paths[QString("gui")]); +} + + +void Netctl::showWifi() +{ + if (debug) qDebug() << PDEBUG; + + sendNotification(QString("Info"), i18n("Start WiFi menu")); + QProcess command; + + command.startDetached(paths[QString("wifi")]); +} + + +// data engine interaction +void Netctl::connectToEngine() +{ + if (debug) qDebug() << PDEBUG; + + netctlEngine->connectSource(QString("active"), this, autoUpdateInterval); + netctlEngine->connectSource(QString("current"), this, autoUpdateInterval); + netctlEngine->connectSource(QString("extip4"), this, autoUpdateInterval); + netctlEngine->connectSource(QString("extip6"), this, autoUpdateInterval); + netctlEngine->connectSource(QString("interfaces"), this, autoUpdateInterval); + netctlEngine->connectSource(QString("intip4"), this, autoUpdateInterval); + netctlEngine->connectSource(QString("intip6"), this, autoUpdateInterval); + netctlEngine->connectSource(QString("profiles"), this, autoUpdateInterval); + netctlEngine->connectSource(QString("status"), this, autoUpdateInterval); + updateInterface(bigInterface); +} + + +void Netctl::dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Source" << sourceName; + + if (isPopupShowing()) return; + if (isUserConfiguring()) return; + if (data.isEmpty()) return; + QString value = data[QString("value")].toString(); + if (value.isEmpty()) + value = QString("N\\A"); + + if (sourceName == QString("active")) { + if (value == QString("true")) { + if (!status) + sendNotification(QString("Info"), i18n("Network is up")); + status = true; + } else { + if (status) + sendNotification(QString("Info"), i18n("Network is down")); + status = false; + } + updateIcon(); + } else if (sourceName == QString("current")) { + info[QString("current")] = value; + QStringList profiles; + for (int i=0; isetText(formatLine[0] + parsePattern(textPattern) + formatLine[1]); + } else if (sourceName == QString("extip4")) { + info[QString("extip4")] = value; + } else if (sourceName == QString("extip6")) { + info[QString("extip6")] = value; + } else if (sourceName == QString("interfaces")) { + info[QString("interfaces")] = value; + } else if (sourceName == QString("intip4")) { + info[QString("intip4")] = value; + } else if (sourceName == QString("intip6")) { + info[QString("intip6")] = value; + } else if (sourceName == QString("profiles")) { + profileList = value.split(QChar(',')); + info[QString("profiles")] = profileList.join(QChar(',')); + } else if (sourceName == QString("status")) { + info[QString("status")] = value; + } + + update(); +} + + +void Netctl::disconnectFromEngine() +{ + if (debug) qDebug() << PDEBUG; + + netctlEngine->disconnectSource(QString("currentProfile"), this); + netctlEngine->disconnectSource(QString("extIp4"), this); + netctlEngine->disconnectSource(QString("extIp6"), this); + netctlEngine->disconnectSource(QString("interfaces"), this); + netctlEngine->disconnectSource(QString("intIp4"), this); + netctlEngine->disconnectSource(QString("intIp6"), this); + netctlEngine->disconnectSource(QString("profiles"), this); + netctlEngine->disconnectSource(QString("statusBool"), this); + netctlEngine->disconnectSource(QString("statusString"), this); + + updateInterface(false); +} + + +QList Netctl::sendDBusRequest(const QString cmd, const QList args) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd; + if (debug) qDebug() << PDEBUG << ":" << "args" << args; + + QDBusConnection bus = QDBusConnection::systemBus(); + QDBusMessage request = QDBusMessage::createMethodCall(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH, + DBUS_HELPER_INTERFACE, cmd); + if (!args.isEmpty()) + request.setArguments(args); + QDBusMessage response = bus.call(request, QDBus::BlockWithGui); + QList arguments = response.arguments(); + if (arguments.size() == 0) + if (debug) qDebug() << PDEBUG << ":" << "Error message" << response.errorMessage(); + + return arguments; +} + + +// configuration interface +void Netctl::selectAbstractSomething() +{ + if (debug) qDebug() << PDEBUG; + + QString path = QString("/usr/bin"); + QLineEdit *lineEdit = uiWidConfig.lineEdit_gui; + if (sender() == uiAppConfig.pushButton_activeIcon) { + path = QString("/usr/share/icons"); + lineEdit = uiAppConfig.lineEdit_activeIcon; + } else if (sender() == uiAppConfig.pushButton_inactiveIcon) { + path = QString("/usr/share/icons"); + lineEdit = uiAppConfig.lineEdit_inactiveIcon; + } else if (sender() == uiWidConfig.pushButton_gui) + lineEdit = uiWidConfig.lineEdit_gui; + else if (sender() == uiWidConfig.pushButton_helper) + lineEdit = uiWidConfig.lineEdit_helper; + else if (sender() == uiWidConfig.pushButton_netctl) + lineEdit = uiWidConfig.lineEdit_netctl; + else if (sender() == uiWidConfig.pushButton_netctlAuto) + lineEdit = uiWidConfig.lineEdit_netctlAuto; + else if (sender() == uiWidConfig.pushButton_sudo) + lineEdit = uiWidConfig.lineEdit_sudo; + else if (sender() == uiWidConfig.pushButton_wifi) + lineEdit = uiWidConfig.lineEdit_wifi; + else if (sender() == uiDEConfig.pushButton_extIp4) + lineEdit = uiDEConfig.lineEdit_extIp4; + else if (sender() == uiDEConfig.pushButton_extIp6) + lineEdit = uiDEConfig.lineEdit_extIp6; + else if (sender() == uiDEConfig.pushButton_netctl) + lineEdit = uiDEConfig.lineEdit_netctl; + else if (sender() == uiDEConfig.pushButton_netctlAuto) + lineEdit = uiDEConfig.lineEdit_netctlAuto; + + KUrl url = KFileDialog::getOpenUrl(KUrl(path), "*"); + lineEdit->setText(url.path()); +} + + +void Netctl::createConfigurationInterface(KConfigDialog *parent) +{ + if (debug) qDebug() << PDEBUG; + + 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); + + uiWidConfig.spinBox_autoUpdate->setValue(autoUpdateInterval); + uiWidConfig.lineEdit_gui->setText(paths[QString("gui")]); + if (useHelper) + uiWidConfig.checkBox_helper->setCheckState(Qt::Checked); + else + uiWidConfig.checkBox_helper->setCheckState(Qt::Unchecked); + uiWidConfig.lineEdit_helper->setText(paths[QString("helper")]); + setHelper(); + uiWidConfig.lineEdit_netctl->setText(paths[QString("netctl")]); + uiWidConfig.lineEdit_netctlAuto->setText(paths[QString("netctlAuto")]); + if (useSudo) + uiWidConfig.checkBox_sudo->setCheckState(Qt::Checked); + else + uiWidConfig.checkBox_sudo->setCheckState(Qt::Unchecked); + uiWidConfig.lineEdit_sudo->setText(paths[QString("sudo")]); + setSudo(); + if (useWifi) + uiWidConfig.checkBox_wifi->setCheckState(Qt::Checked); + else + uiWidConfig.checkBox_wifi->setCheckState(Qt::Unchecked); + uiWidConfig.lineEdit_wifi->setText(paths[QString("wifi")]); + setWifi(); + if (bigInterface) + uiWidConfig.checkBox_showBigInterface->setCheckState(Qt::Checked); + else + uiWidConfig.checkBox_showBigInterface->setCheckState(Qt::Unchecked); + QString pattern = textPattern; + uiWidConfig.textEdit->setPlainText(pattern.replace(QString("
"), QString("\n"))); + setBigInterface(); + + KConfigGroup cg = config(); + QString textAlign = cg.readEntry("textAlign", "center"); + QString fontFamily = cg.readEntry("fontFamily", "Terminus"); + int fontSize = cg.readEntry("fontSize", 10); + QString fontColor = cg.readEntry("fontColor", "#000000"); + int fontWeight = cg.readEntry("fontWeight", 400); + QString fontStyle = cg.readEntry("fontStyle", "normal"); + QFont font = QFont(fontFamily, 12, 400, FALSE); + uiAppConfig.comboBox_textAlign->setCurrentIndex(uiAppConfig.comboBox_textAlign->findText(textAlign)); + uiAppConfig.fontComboBox_font->setCurrentFont(font); + uiAppConfig.spinBox_fontSize->setValue(fontSize); + uiAppConfig.kcolorcombo_fontColor->setColor(fontColor); + uiAppConfig.spinBox_fontWeight->setValue(fontWeight); + uiAppConfig.comboBox_fontStyle->setCurrentIndex(uiAppConfig.comboBox_fontStyle->findText(fontStyle)); + uiAppConfig.lineEdit_activeIcon->setText(paths[QString("active")]); + uiAppConfig.lineEdit_inactiveIcon->setText(paths[QString("inactive")]); + + QMap deSettings = readDataEngineConfiguration(); + uiDEConfig.lineEdit_netctl->setText(deSettings[QString("NETCTLCMD")]); + uiDEConfig.lineEdit_netctlAuto->setText(deSettings[QString("NETCTLAUTOCMD")]); + if (deSettings[QString("EXTIP4")] == QString("true")) + uiDEConfig.checkBox_extIp4->setCheckState(Qt::Checked); + else + uiDEConfig.checkBox_extIp4->setCheckState(Qt::Unchecked); + uiDEConfig.lineEdit_extIp4->setText(deSettings[QString("EXTIP4CMD")]); + setDataEngineExternalIp4(); + if (deSettings[QString("EXTIP6")] == QString("true")) + uiDEConfig.checkBox_extIp6->setCheckState(Qt::Checked); + else + uiDEConfig.checkBox_extIp6->setCheckState(Qt::Unchecked); + uiDEConfig.lineEdit_extIp6->setText(deSettings[QString("EXTIP6CMD")]); + setDataEngineExternalIp6(); + + // 1st tab + 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("
") + + QString("%2
").arg(QString(HOMEPAGE)).arg(i18n("Homepage")) + + QString("%2
").arg(QString(REPOSITORY)).arg(i18n("Repository")) + + QString("%2
").arg(QString(BUGTRACKER)).arg(i18n("Bugtracker")) + + QString("%2
").arg(QString(TRANSLATION)).arg(i18n("Translation issue")) + + QString("%2").arg(QString(AUR_PACKAGES)).arg(i18n("AUR packages"))); + uiAboutConfig.label_license->setText(QString("© %1 %3
").arg(QString(DATE)).arg(QString(EMAIL)).arg(QString(AUTHOR)) + + i18n("This software is licensed under %1", QString(LICENSE)) + QString("
")); + // 2nd tab + QStringList trdPartyList = QString(TRDPARTY_LICENSE).split(QChar(';'), QString::SkipEmptyParts); + for (int i=0; i%1 (%2 license)") + .arg(trdPartyList[i].split(QChar(','))[0]) + .arg(trdPartyList[i].split(QChar(','))[1]) + .arg(trdPartyList[i].split(QChar(','))[2]); + uiAboutConfig.label_translators->setText(i18n("Translators: %1", QString(TRANSLATORS))); + uiAboutConfig.label_trdparty->setText(i18n("This software uses: %1", trdPartyList.join(QString(", ")))); + + 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_helper, SIGNAL(stateChanged(int)), this, SLOT(setHelper())); + connect(uiWidConfig.checkBox_showBigInterface, SIGNAL(stateChanged(int)), this, + SLOT(setBigInterface())); + connect(uiWidConfig.checkBox_sudo, SIGNAL(stateChanged(int)), this, SLOT(setSudo())); + connect(uiWidConfig.checkBox_wifi, SIGNAL(stateChanged(int)), this, SLOT(setWifi())); + connect(uiDEConfig.checkBox_extIp4, SIGNAL(stateChanged(int)), this, SLOT(setDataEngineExternalIp4())); + connect(uiDEConfig.checkBox_extIp6, SIGNAL(stateChanged(int)), this, SLOT(setDataEngineExternalIp6())); + + connect(uiWidConfig.pushButton_gui, SIGNAL(clicked()), this, SLOT(selectAbstractSomething())); + connect(uiWidConfig.pushButton_helper, SIGNAL(clicked()), this, SLOT(selectAbstractSomething())); + connect(uiWidConfig.pushButton_netctl, SIGNAL(clicked()), this, SLOT(selectAbstractSomething())); + connect(uiWidConfig.pushButton_netctlAuto, SIGNAL(clicked()), this, SLOT(selectAbstractSomething())); + connect(uiWidConfig.pushButton_sudo, SIGNAL(clicked()), this, SLOT(selectAbstractSomething())); + connect(uiWidConfig.pushButton_wifi, SIGNAL(clicked()), this, SLOT(selectAbstractSomething())); + connect(uiAppConfig.pushButton_activeIcon, SIGNAL(clicked()), this, SLOT(selectAbstractSomething())); + connect(uiAppConfig.pushButton_inactiveIcon, SIGNAL(clicked()), this, SLOT(selectAbstractSomething())); + connect(uiDEConfig.pushButton_extIp4, SIGNAL(clicked()), this, SLOT(selectAbstractSomething())); + connect(uiDEConfig.pushButton_extIp6, SIGNAL(clicked()), this, SLOT(selectAbstractSomething())); + connect(uiDEConfig.pushButton_netctl, SIGNAL(clicked()), this, SLOT(selectAbstractSomething())); + connect(uiDEConfig.pushButton_netctlAuto, SIGNAL(clicked()), this, SLOT(selectAbstractSomething())); + + connect(parent, SIGNAL(okClicked()), this, SLOT(configAccepted())); + connect(parent, SIGNAL(applyClicked()), this, SLOT(configAccepted())); +} + + +void Netctl::configAccepted() +{ + if (debug) qDebug() << PDEBUG; + + disconnectFromEngine(); + KConfigGroup cg = config(); + + cg.writeEntry("autoUpdateInterval", uiWidConfig.spinBox_autoUpdate->value()); + cg.writeEntry("guiPath", uiWidConfig.lineEdit_gui->text()); + if (uiWidConfig.checkBox_helper->checkState() == 0) + cg.writeEntry("useHelper", false); + else + cg.writeEntry("useHelper", true); + cg.writeEntry("helperPath", uiWidConfig.lineEdit_helper->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", uiWidConfig.lineEdit_sudo->text()); + if (uiWidConfig.checkBox_wifi->checkState() == 0) + cg.writeEntry("useWifi", false); + else + cg.writeEntry("useWifi", true); + cg.writeEntry("wifiPath", uiWidConfig.lineEdit_wifi->text()); + if (uiWidConfig.checkBox_showBigInterface->checkState() == 0) + cg.writeEntry("showBigInterface", false); + else + cg.writeEntry("showBigInterface", true); + QString pattern = uiWidConfig.textEdit->toPlainText(); + pattern.replace(QString("\n"), QString("
")); + cg.writeEntry("textPattern", pattern); + + cg.writeEntry("textAlign", uiAppConfig.comboBox_textAlign->currentText()); + 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 deSettings; + deSettings[QString("NETCTLCMD")] = uiDEConfig.lineEdit_netctl->text(); + deSettings[QString("NETCTLAUTOCMD")] = uiDEConfig.lineEdit_netctlAuto->text(); + if (uiDEConfig.checkBox_extIp4->checkState() == 0) + deSettings[QString("EXTIP4")] = QString("false"); + else + deSettings[QString("EXTIP4")] = QString("true"); + deSettings[QString("EXTIP4CMD")] = uiDEConfig.lineEdit_extIp4->text(); + if (uiDEConfig.checkBox_extIp6->checkState() == 0) + deSettings[QString("EXTIP6")] = QString("false"); + else + deSettings[QString("EXTIP6")] = QString("true"); + deSettings[QString("EXTIP6CMD")] = uiDEConfig.lineEdit_extIp6->text(); + writeDataEngineConfiguration(deSettings); +} + + +void Netctl::configChanged() +{ + if (debug) qDebug() << PDEBUG; + + KConfigGroup cg = config(); + + autoUpdateInterval = cg.readEntry("autoUpdateInterval", 1000); + paths[QString("gui")] = cg.readEntry("guiPath", "/usr/bin/netctl-gui"); + paths[QString("helper")] = cg.readEntry("helperPath", "/usr/bin/netctlgui-helper"); + 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); + useWifi = cg.readEntry("useWifi", false); + bigInterface = cg.readEntry("showBigInterface", true); + useHelper = cg.readEntry("useHelper", true); + textPattern = cg.readEntry("textPattern", "$info
IPv4: $intip4
IPv6: $intip6"); + + QString textAlign = cg.readEntry("textAlign", "center"); + QString fontFamily = cg.readEntry("fontFamily", "Terminus"); + int fontSize = cg.readEntry("fontSize", 10); + QString fontColor = cg.readEntry("fontColor", "#000000"); + int fontWeight = cg.readEntry("fontWeight", 400); + QString fontStyle = cg.readEntry("fontStyle", "normal"); + paths[QString("active")] = cg.readEntry("activeIconPath", + "/usr/share/icons/hicolor/64x64/apps/netctl-idle.png"); + paths[QString("inactive")] = cg.readEntry("inactiveIconPath", + "/usr/share/icons/hicolor/64x64/apps/netctl-offline.png"); + + formatLine[0] = QString("\ +\ +

") + .arg(textAlign) + .arg(fontFamily) + .arg(QString::number(fontSize)) + .arg(QString::number(fontWeight)) + .arg(fontStyle) + .arg(fontColor); + formatLine[1] = QString("

"); + + if (useHelper) startHelper(); + checkHelperStatus(); + connectToEngine(); +} + + +void Netctl::setBigInterface() +{ + if (debug) qDebug() << PDEBUG; + + if (uiWidConfig.checkBox_showBigInterface->checkState() == 0) + uiWidConfig.textEdit->setDisabled(true); + else if (uiWidConfig.checkBox_showBigInterface->checkState() == 2) + uiWidConfig.textEdit->setDisabled(false); +} + + +void Netctl::setDataEngineExternalIp4() +{ + if (debug) qDebug() << PDEBUG; + + if (uiDEConfig.checkBox_extIp4->checkState() == 0) { + uiDEConfig.lineEdit_extIp4->setDisabled(true); + uiDEConfig.pushButton_extIp4->setDisabled(true); + } else if (uiDEConfig.checkBox_extIp4->checkState() == 2) { + uiDEConfig.lineEdit_extIp4->setEnabled(true); + uiDEConfig.pushButton_extIp4->setEnabled(true); + } +} + + +void Netctl::setDataEngineExternalIp6() +{ + if (debug) qDebug() << PDEBUG; + + if (uiDEConfig.checkBox_extIp6->checkState() == 0) { + uiDEConfig.lineEdit_extIp6->setDisabled(true); + uiDEConfig.pushButton_extIp6->setDisabled(true); + } else if (uiDEConfig.checkBox_extIp6->checkState() == 2) { + uiDEConfig.lineEdit_extIp6->setEnabled(true); + uiDEConfig.pushButton_extIp6->setEnabled(true); + } +} + + +void Netctl::setHelper() +{ + if (uiWidConfig.checkBox_helper->checkState() == 0) { + uiWidConfig.lineEdit_helper->setDisabled(true); + uiWidConfig.pushButton_helper->setDisabled(true); + } else if (uiWidConfig.checkBox_helper->checkState() == 2) { + uiWidConfig.lineEdit_helper->setEnabled(true); + uiWidConfig.pushButton_helper->setEnabled(true); + } +} + + +void Netctl::setSudo() +{ + if (debug) qDebug() << PDEBUG; + + 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 (debug) qDebug() << PDEBUG; + + 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); + } +} + + +#include "netctl.moc" diff --git a/sources/plasmoid-kf5/netctl.h b/sources/plasmoid-kf5/netctl.h new file mode 100644 index 0000000..58a62de --- /dev/null +++ b/sources/plasmoid-kf5/netctl.h @@ -0,0 +1,112 @@ +/*************************************************************************** + * 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 NETCTL_PLASMOID_H +#define NETCTL_PLASMOID_H + + +class Netctl : public Plasma::PopupApplet +{ + Q_OBJECT + +public: + Netctl(QObject *parent, const QVariantList &args); + ~Netctl(); + void init(); + QString parsePattern(const QString rawLine); + QMap readDataEngineConfiguration(); + void writeDataEngineConfiguration(const QMap settings); + QMap updateDataEngineConfiguration(const QMap rawConfig); + +public slots: + // events + void sendNotification(const QString eventId, const QString message); + void showGui(); + void showWifi(); + // dataengine + void dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data); + // configuration interface + void configAccepted(); + void configChanged(); + void setBigInterface(); + void setDataEngineExternalIp4(); + void setDataEngineExternalIp6(); + void setHelper(); + void setSudo(); + void setWifi(); + +private slots: + // ui + void updateIcon(); + void updateInterface(bool setHidden); + // configuration interface + void selectAbstractSomething(); + // context menu + void enableProfileSlot(); + void restartProfileSlot(); + void startProfileSlot(QAction *profile); + void stopProfileSlot(); + void stopAllProfilesSlot(); + void switchToProfileSlot(QAction *profile); + // helper + void checkHelperStatus(); + void startHelper(); + +protected: + void createConfigurationInterface(KConfigDialog *parent); + QList contextualActions(); + +private: + // ui + QWidget *graphicsWidget; + QHBoxLayout *layout; + IconLabel *iconLabel; + QLabel *textLabel; + // information + bool status; + QMap info; + QStringList profileList; + // context menu + void createActions(); + QList menuActions; + QMenu *startProfileMenu; + QMenu *switchToProfileMenu; + QMap contextMenu; + // data engine + Plasma::DataEngine *netctlEngine; + void connectToEngine(); + void disconnectFromEngine(); + QList sendDBusRequest(const QString cmd, const QList args = QList()); + // configuration interface + Ui::AppearanceWindow uiAppConfig; + Ui::DataEngineWindow uiDEConfig; + Ui::ConfigWindow uiWidConfig; + Ui::About uiAboutConfig; + // configuration + int autoUpdateInterval; + bool bigInterface; + bool debug; + QString textPattern; + QStringList formatLine; + QMap paths; + bool useHelper, useSudo, useWifi; +}; + +K_EXPORT_PLASMA_APPLET(netctl, Netctl) + + +#endif /* NETCTL_PLASMOID_H */ diff --git a/sources/plasmoid-kf5/plasma_applet_netctl.notifyrc b/sources/plasmoid-kf5/plasma_applet_netctl.notifyrc new file mode 100644 index 0000000..9d50894 --- /dev/null +++ b/sources/plasmoid-kf5/plasma_applet_netctl.notifyrc @@ -0,0 +1,14 @@ +[Global] +IconName=netctl-gui-widget +Name=Netctl plasmoid +Comment=Netctl plasmoid popups + +[Event/Error] +Name=Error +Comment=There is an error from netctl plasmoid +Action=Popup + +[Event/Info] +Name=Information +Comment=There is an information from netctl plasmoid +Action=Popup diff --git a/sources/plasmoid-kf5/plasmoid/contents/config/config.qml b/sources/plasmoid-kf5/plasmoid/contents/config/config.qml new file mode 100644 index 0000000..6d931c9 --- /dev/null +++ b/sources/plasmoid-kf5/plasmoid/contents/config/config.qml @@ -0,0 +1,41 @@ +/*************************************************************************** + * 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/ * + ***************************************************************************/ + +import QtQuick 2.0 + +import org.kde.plasma.configuration 2.0 + + +ConfigModel { + ConfigCategory { + name: i18n("Widget") + icon: "/usr/share/pixmaps/netctl-gui-widget.png" + source: "widget.qml" + } + + ConfigCategory { + name: i18n("Appearance") + icon: "preferences-desktop-theme" + source: "appearance.qml" + } + + ConfigCategory { + name: i18n("About") + icon: "help-about" + source: "about.qml" + } +} diff --git a/sources/plasmoid-kf5/plasmoid/contents/config/main.xml b/sources/plasmoid-kf5/plasmoid/contents/config/main.xml new file mode 100644 index 0000000..e3af196 --- /dev/null +++ b/sources/plasmoid-kf5/plasmoid/contents/config/main.xml @@ -0,0 +1,75 @@ + + + + + + + + 100 + + + /usr/bin/netctl-gui + + + /usr/bin/netctlgui-helper + + + /usr/bin/netctl + + + /usr/bin/netctl-auto + + + /usr/bin/kdesu + + + /usr/bin/netctl-gui -t 3 + + + true + + + true + + + false + + + $info +IPv4: $intip4 +IPv6: $intip6 + + + + + + + center + + + Terminus + + + 12 + + + #000000 + + + normal + + + normal + + + /usr/share/icons/hicolor/64x64/apps/netctl-idle.png + + + /usr/share/icons/hicolor/64x64/apps/netctl-offline.png + + + + diff --git a/sources/plasmoid-kf5/plasmoid/contents/ui/about.qml b/sources/plasmoid-kf5/plasmoid/contents/ui/about.qml new file mode 100644 index 0000000..bdcd2a6 --- /dev/null +++ b/sources/plasmoid-kf5/plasmoid/contents/ui/about.qml @@ -0,0 +1,85 @@ +/*************************************************************************** + * 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/ * + ***************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Controls 1.3 as QtControls +import QtQuick.Layouts 1.0 as QtLayouts + +import org.kde.plasma.private.netctl 1.0 + + +Item { + id: aboutPage + width: childrenRect.width + height: childrenRect.height + + Grid { + QtControls.TabView { + QtControls.Tab { + title: i18n("About") + + QtLayouts.ColumnLayout { + QtControls.Label { + QtLayouts.Layout.fillWidth: true + horizontalAlignment: Text.AlignHCenter + text: NetctlAdds.getAboutText("header") + } + + QtControls.Label { + QtLayouts.Layout.fillWidth: true + horizontalAlignment: Text.AlignJustify + text: NetctlAdds.getAboutText("description") + } + + QtControls.Label { + QtLayouts.Layout.fillWidth: true + horizontalAlignment: Text.AlignLeft + textFormat: Text.RichText + text: NetctlAdds.getAboutText("links") + } + + QtControls.Label { + QtLayouts.Layout.fillWidth: true + font.capitalization: Font.SmallCaps + horizontalAlignment: Text.AlignHCenter + textFormat: Text.RichText + text: NetctlAdds.getAboutText("copy") + } + } + } + + QtControls.Tab { + title: i18n("Acknowledgment") + + QtLayouts.ColumnLayout { + QtControls.Label { + QtLayouts.Layout.fillWidth: true + horizontalAlignment: Text.AlignJustify + text: NetctlAdds.getAboutText("translators") + } + + QtControls.Label { + QtLayouts.Layout.fillWidth: true + horizontalAlignment: Text.AlignJustify + textFormat: Text.RichText + text: NetctlAdds.getAboutText("3rdparty") + } + } + } + } + } +} diff --git a/sources/plasmoid-kf5/plasmoid/contents/ui/appearance.qml b/sources/plasmoid-kf5/plasmoid/contents/ui/appearance.qml new file mode 100644 index 0000000..ac59fd6 --- /dev/null +++ b/sources/plasmoid-kf5/plasmoid/contents/ui/appearance.qml @@ -0,0 +1,272 @@ +/*************************************************************************** + * 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/ * + ***************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Controls 1.0 as QtControls +import QtQuick.Controls.Styles 1.3 as QtStyles +import QtQuick.Dialogs 1.1 as QtDialogs +import QtQuick.Layouts 1.0 as QtLayouts + + +Item { + id: appearancePage + width: childrenRect.width + height: childrenRect.height + + property variant weight: { + 25: 0, + 50: 1, + 63: 3, + 75: 4, + 87: 5 + } + + property string cfg_textAlign: textAlign.currentText + property alias cfg_fontFamily: selectFont.text + property alias cfg_fontSize: fontSize.value + property string cfg_fontWeight: fontWeight.currentText + property string cfg_fontStyle: fontStyle.currentText + property alias cfg_fontColor: selectColor.text + property alias cfg_activeIconPath: activeIcon.text + property alias cfg_inactiveIconPath: inactiveIcon.text + + + QtLayouts.ColumnLayout { + QtLayouts.RowLayout { + QtControls.Label { + text: i18n("Text align") + } + QtControls.ComboBox { + id: textAlign + textRole: "label" + model: [ + { + 'label': i18n("center"), + 'name': "center" + }, + { + 'label': i18n("right"), + 'name': "right" + }, + { + 'label': i18n("left"), + 'name': "left" + }, + { + 'label': i18n("justify"), + 'name': "justify" + } + ] + onCurrentIndexChanged: cfg_textAlign = model[currentIndex]["name"] + Component.onCompleted: { + for (var i = 0; i < model.length; i++) { + if (model[i]["name"] == plasmoid.configuration.textAlign) { + textAlign.currentIndex = i; + } + } + } + } + } + + QtLayouts.RowLayout { + QtControls.Label { + text: i18n("Font") + } + QtControls.Button { + id: selectFont + text: plasmoid.configuration.fontFamily + onClicked: fontDialog.visible = true + } + } + + QtLayouts.RowLayout { + QtControls.Label { + text: i18n("Font size") + } + QtControls.SpinBox { + id: fontSize + minimumValue: 8 + maximumValue: 24 + stepSize: 1 + value: plasmoid.configuration.fontSize + } + } + + QtLayouts.RowLayout { + QtControls.Label { + text: i18n("Font weight") + } + QtControls.ComboBox { + id: fontWeight + textRole: "label" + model: [ + { + 'label': i18n("light"), + 'name': "light" + }, + { + 'label': i18n("normal"), + 'name': "normal" + }, + { + 'label': i18n("demi bold"), + 'name': "demibold" + }, + { + 'label': i18n("bold"), + 'name': "bold" + }, + { + 'label': i18n("black"), + 'name': "black" + } + ] + onCurrentIndexChanged: cfg_fontWeight = model[currentIndex]["name"] + Component.onCompleted: { + for (var i = 0; i < model.length; i++) { + if (model[i]["name"] == plasmoid.configuration.fontWeight) { + fontWeight.currentIndex = i; + } + } + } + } + } + + QtLayouts.RowLayout { + QtControls.Label { + text: i18n("Font style") + } + QtControls.ComboBox { + id: fontStyle + textRole: "label" + model: [ + { + 'label': i18n("normal"), + 'name': "normal" + }, + { + 'label': i18n("italic"), + 'name': "italic" + } + ] + onCurrentIndexChanged: cfg_fontStyle = model[currentIndex]["name"] + Component.onCompleted: { + for (var i = 0; i < model.length; i++) { + if (model[i]["name"] == plasmoid.configuration.fontStyle) { + fontStyle.currentIndex = i; + } + } + } + } + } + + QtLayouts.RowLayout { + QtControls.Label { + text: i18n("Font color") + } + QtControls.Button { + id: selectColor + style: QtStyles.ButtonStyle { + background: Rectangle { + color: plasmoid.configuration.fontColor + } + } + text: plasmoid.configuration.fontColor + onClicked: colorDialog.visible = true + } + } + + QtLayouts.RowLayout { + QtControls.Label { + text: i18n("Active icon") + } + QtControls.TextField { + id: activeIcon + QtLayouts.Layout.fillWidth: true + text: plasmoid.configuration.activeIconPath + } + QtControls.Button { + text: i18n("Browse") + onClicked: { + // FIXME: more clean directory definition + var list = inactiveIcon.text.split('/') + list.pop() + activeFileDialog.folder = "/" + list.join('/') + activeFileDialog.visible = true + } + } + + QtDialogs.FileDialog { + id: activeFileDialog + title: i18n("Select a path") + nameFilters: [ "Image files (*.jpeg *.jpg *.png)", "All files (*)" ] + selectExisting: true + onAccepted: activeIcon.text = activeFileDialog.fileUrl + } + } + + QtLayouts.RowLayout { + QtControls.Label { + text: i18n("Inactive icon") + } + QtControls.TextField { + id: inactiveIcon + QtLayouts.Layout.fillWidth: true + text: plasmoid.configuration.inactiveIconPath + } + QtControls.Button { + text: i18n("Browse") + onClicked: { + // FIXME: more clean directory definition + var list = inactiveIcon.text.split('/') + list.pop() + inactiveFileDialog.folder = "/" + list.join('/') + inactiveFileDialog.visible = true + } + } + + QtDialogs.FileDialog { + id: inactiveFileDialog + title: i18n("Select a path") + nameFilters: [ "Image files (*.jpeg *.jpg *.png)", "All files (*)" ] + selectExisting: true + onAccepted: inactiveIcon.text = inactiveFileDialog.fileUrl + } + } + } + + QtDialogs.ColorDialog { + id: colorDialog + title: i18n("Select a color") + color: selectColor.text + onAccepted: { + selectColor.text = colorDialog.color + } + } + + QtDialogs.FontDialog { + id: fontDialog + title: i18n("Select a font") + font: Qt.font({ family: selectFont.text, pointSize: fontSize.value, weight: Font.Normal }) + onAccepted: { + selectFont.text = fontDialog.font.family + fontSize.value = fontDialog.font.pointSize + fontStyle.currentIndex = fontDialog.font.italic ? 1 : 0 + fontWeight.currentIndex = weight[fontDialog.font.weight] + } + } +} diff --git a/sources/plasmoid-kf5/plasmoid/contents/ui/main.qml b/sources/plasmoid-kf5/plasmoid/contents/ui/main.qml new file mode 100644 index 0000000..7227b2b --- /dev/null +++ b/sources/plasmoid-kf5/plasmoid/contents/ui/main.qml @@ -0,0 +1,143 @@ +/*************************************************************************** + * 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/ * + ***************************************************************************/ + +import QtQuick 2.2 +import QtQuick.Controls 1.3 as QtControls +import org.kde.plasma.plasmoid 2.0 +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.components 2.0 as PlasmaComponents + +import org.kde.plasma.private.netctl 1.0 + + +Item { + id: main + + // variables + // internal + property variant weight: { + "light": Font.Light, + "normal": Font.Normal, + "demibold": Font.DemiBold, + "bold": Font.Bold, + "black": Font.Black + } + property variant align: { + "left": Text.AlignLeft, + "center": Text.AlignHCenter, + "right": Text.AlignRight, + "justify": Text.AlignJustify + } + // external + property variant iconPath: { + "true": plasmoid.configuration.activeIconPath, + "false": plasmoid.configuration.inactiveIconPath + } + property variant info: { + "current": "N\\A", + "extip4": "127.0.0.1", + "extip6": "::1", + "intip4": "127.0.0.1", + "intip6": "::1", + "interfaces": "lo", + "profiles": "", + "status": "N\\A" + } + property int interval: plasmoid.configuration.autoUpdateInterval + property string pattern: plasmoid.configuration.textPattern + property variant paths: { + "netctl": plasmoid.configuration.netctlPath, + "sudo": plasmoid.configuration.sudoPath + } + property bool status: false + property bool useHelper: plasmoid.configuration.useHelper + + // init + Plasmoid.icon: icon.source + + PlasmaCore.DataSource { + id: mainData + engine: "netctl" + connectedSources: ["active", "current", "extip4", "extip6", "interfaces", "intip4", "intip6", "profiles", "status"] + interval: main.interval + + onNewData: { + if (data.isEmpty) return + if (sourceName == "active") { + main.status = data.value == "true" ? true : false + icon.source = iconPath[data.value] + } else if (sourceName == "current") { + info["current"] = data.value + // text update + info["info"] = NetctlAdds.getInfo(info["current"], info["status"]) + text.text = NetctlAdds.parsePattern(pattern, info) + } else if (sourceName == "extip4") { + info["extip4"] = data.value + } else if (sourceName == "extip6") { + info["extip6"] = data.value + } else if (sourceName == "interfaces") { + info["interfaces"] = data.value + } else if (sourceName == "intip4") { + info["intip4"] = data.value + } else if (sourceName == "intip6") { + info["intip6"] = data.value + } else if (sourceName == "profiles") { + info["profiles"] = data.value + } else if (sourceName == "status") { + info["status"] = data.value + } + } + } + + // ui + Grid { + id: mainGrid + columns: 2 + + Image { + id: icon + source: iconPath["false"] + } + Text { + id: text + color: plasmoid.configuration.fontColor + font.family: plasmoid.configuration.fontFamily + font.italic: plasmoid.configuration.fontStyle == "italic" ? true : false + font.pointSize: plasmoid.configuration.fontSize + font.weight: weight[plasmoid.configuration.fontWeight] + horizontalAlignment: align[plasmoid.configuration.textAlign] + textFormat: Text.RichText + text: "N\\A" + } + } + + QtControls.Action { + id: stopProfile + text: i18n("Stop profile") + iconSource: "dialog-close" + onTriggered: NetctlAdds.stopProfileSlot(info, useHelper, paths["netctl"], paths["sudo"]) + } + + Component.onCompleted: { + plasmoid.setAction("stopProfile", i18n("Stop profile"), "dialog-close") +// plasmoid.setAction("powerdevilkcm", i18n("&Configure Power Saving..."), "preferences-system-power-management"); + } + + function action_stopProfile() { + NetctlAdds.stopProfileSlot(info, useHelper, paths["netctl"], paths["sudo"]) + } +} diff --git a/sources/plasmoid-kf5/plasmoid/contents/ui/widget.qml b/sources/plasmoid-kf5/plasmoid/contents/ui/widget.qml new file mode 100644 index 0000000..c105a58 --- /dev/null +++ b/sources/plasmoid-kf5/plasmoid/contents/ui/widget.qml @@ -0,0 +1,215 @@ +/*************************************************************************** + * 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/ * + ***************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Controls 1.0 as QtControls +import QtQuick.Dialogs 1.1 as QtDialogs +import QtQuick.Layouts 1.0 as QtLayouts + + +Item { + id: widgetPage + width: childrenRect.width + height: childrenRect.height + + property alias cfg_autoUpdateInterval: autoUpdate.value + property alias cfg_guiPath: guiPath.text + property alias cfg_useHelper: useHelper.checked + property alias cfg_helperPath: helperPath.text + property alias cfg_netctlPath: netctlPath.text + property alias cfg_netctlPathAuto: netctlAutoPath.text + property alias cfg_useSudo: useSudo.checked + property alias cfg_sudoPath: sudoPath.text + property alias cfg_useWifi: useWifi.checked + property alias cfg_wifiPath: wifiPath.text + property alias cfg_textPattern: textPattern.text + + + QtLayouts.ColumnLayout { + QtLayouts.RowLayout { + QtControls.Label { + text: i18n("Auto update interval, msec") + } + QtControls.SpinBox { + id: autoUpdate + minimumValue: 1000 + maximumValue: 10000 + stepSize: 500 + value: plasmoid.configuration.autoUpdateInterval + } + } + + QtLayouts.RowLayout { + QtControls.Label { + text: i18n("Path to GUI") + } + QtControls.TextField { + id: guiPath + QtLayouts.Layout.fillWidth: true + text: plasmoid.configuration.guiPath + } + QtControls.Button { + text: i18n("Browse") + onClicked: guiFileDialog.visible = true + } + + QtDialogs.FileDialog { + id: guiFileDialog + title: i18n("Select a path") + folder: "/usr/bin" + nameFilters: [ "All files (*)" ] + selectExisting: true + onAccepted: guiPath.text = guiFileDialog.fileUrl + } + } + + QtLayouts.RowLayout { + QtControls.CheckBox { + id: useHelper + text: i18n("Use helper") + } + QtControls.TextField { + id: helperPath + enabled: useHelper.checked + QtLayouts.Layout.fillWidth: true + text: plasmoid.configuration.helperPath + } + QtControls.Button { + enabled: useHelper.checked + text: i18n("Browse") + onClicked: helperFileDialog.visible = true + } + + QtDialogs.FileDialog { + id: helperFileDialog + title: i18n("Select a path") + folder: "/usr/bin" + nameFilters: [ "All files (*)" ] + selectExisting: true + onAccepted: helperPath.text = helperFileDialog.fileUrl + } + } + + QtLayouts.RowLayout { + QtControls.Label { + text: i18n("Path to netctl") + } + QtControls.TextField { + id: netctlPath + QtLayouts.Layout.fillWidth: true + text: plasmoid.configuration.netctlPath + } + QtControls.Button { + text: i18n("Browse") + onClicked: netctlFileDialog.visible = true + } + + QtDialogs.FileDialog { + id: netctlFileDialog + title: i18n("Select a path") + folder: "/usr/bin" + nameFilters: [ "All files (*)" ] + selectExisting: true + onAccepted: netctlPath.text = netctlFileDialog.fileUrl + } + } + + QtLayouts.RowLayout { + QtControls.Label { + text: i18n("Path to netctl-auto") + } + QtControls.TextField { + id: netctlAutoPath + QtLayouts.Layout.fillWidth: true + text: plasmoid.configuration.netctlAutoPath + } + QtControls.Button { + text: i18n("Browse") + onClicked: netctlAutoFileDialog.visible = true + } + + QtDialogs.FileDialog { + id: netctlAutoFileDialog + title: i18n("Select a path") + folder: "/usr/bin" + nameFilters: [ "All files (*)" ] + selectExisting: true + onAccepted: netctlAutoPath.text = netctlAutoFileDialog.fileUrl + } + } + + QtLayouts.RowLayout { + QtControls.CheckBox { + id: useSudo + text: i18n("Use sudo for netctl") + } + QtControls.TextField { + id: sudoPath + enabled: useSudo.checked + QtLayouts.Layout.fillWidth: true + text: plasmoid.configuration.sudoPath + } + QtControls.Button { + enabled: useSudo.checked + text: i18n("Browse") + onClicked: sudoFileDialog.visible = true + } + + QtDialogs.FileDialog { + id: sudoFileDialog + title: i18n("Select a path") + folder: "/usr/bin" + nameFilters: [ "All files (*)" ] + selectExisting: true + onAccepted: sudoPath.text = sudoFileDialog.fileUrl + } + } + + QtLayouts.RowLayout { + QtControls.CheckBox { + id: useWifi + text: i18n("Show 'Start WiFi menu'") + } + QtControls.TextField { + id: wifiPath + enabled: useWifi.checked + QtLayouts.Layout.fillWidth: true + text: plasmoid.configuration.wifiPath + } + QtControls.Button { + enabled: useWifi.checked + text: i18n("Browse") + onClicked: wifiFileDialog.visible = true + } + + QtDialogs.FileDialog { + id: wifiFileDialog + title: i18n("Select a path") + folder: "/usr/bin" + nameFilters: [ "All files (*)" ] + selectExisting: true + onAccepted: wifiPath.text = wifiFileDialog.fileUrl + } + } + + QtControls.TextArea { + id: textPattern + QtLayouts.Layout.fillWidth: true + text: plasmoid.configuration.textPattern + } + } +} diff --git a/sources/plasmoid-kf5/plasmoid/metadata.desktop b/sources/plasmoid-kf5/plasmoid/metadata.desktop new file mode 100644 index 0000000..24ac2ea --- /dev/null +++ b/sources/plasmoid-kf5/plasmoid/metadata.desktop @@ -0,0 +1,22 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Netctl +Comment=Plasmoid for netctl +Type=Service +Icon=netctl-gui-widget + +X-KDE-ServiceTypes=Plasma/Applet +X-Plasma-API=declarativeappletscript +X-Plasma-MainScript=ui/main.qml +X-Plasma-NotificationArea=true +X-Plasma-RemoteLocation= + +X-KDE-PluginInfo-Author=Evgeniy Alekseev +X-KDE-PluginInfo-Email=esalexeev@gmail.com +X-KDE-PluginInfo-Name=org.kde.plasma.netctl +X-KDE-PluginInfo-Version=@PROJECT_VERSION@ +X-KDE-PluginInfo-Website=http://arcanis.name/projects/netctl-gui +X-KDE-PluginInfo-Category=Network +X-KDE-PluginInfo-Depends= +X-KDE-PluginInfo-License=GPLv3 +X-KDE-PluginInfo-EnabledByDefault=true diff --git a/sources/plasmoid-kf5/plugin/CMakeLists.txt b/sources/plasmoid-kf5/plugin/CMakeLists.txt new file mode 100644 index 0000000..bea8154 --- /dev/null +++ b/sources/plasmoid-kf5/plugin/CMakeLists.txt @@ -0,0 +1,16 @@ +include_directories (${CMAKE_SOURCE_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/../ + ${PROJECT_TRDPARTY_DIR} + ${Qt_INCLUDE} + ${Kf5_INCLUDE}) + +file (GLOB SUBPROJECT_SOURCE *.cpp) + +add_library (${PLUGIN_NAME} SHARED ${SUBPROJECT_SOURCE}) +target_link_libraries (${PLUGIN_NAME} ${Qt5Core_LIBRARIES} ${Qt5DBus_LIBRARIES} ${Qt5Qml_LIBRARIES} ${I18n_LIBRARIES} ${Plasma_LIBRARIES} + KF5::I18n KF5::Notifications) + +install (TARGETS ${PLUGIN_NAME} DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/netctl) +install (FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/netctl) diff --git a/sources/plasmoid-kf5/plugin/netctl.cpp b/sources/plasmoid-kf5/plugin/netctl.cpp new file mode 100644 index 0000000..4e17fb0 --- /dev/null +++ b/sources/plasmoid-kf5/plugin/netctl.cpp @@ -0,0 +1,38 @@ +/*************************************************************************** + * 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 + +#include "netctl.h" +#include "netctladds.h" + + +static QObject *netctl_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine) +{ + Q_UNUSED(engine) + Q_UNUSED(scriptEngine) + + return new NetctlAdds(); +} + + +void NetctlPlugin::registerTypes(const char *uri) +{ + Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.netctl")); + + qmlRegisterSingletonType(uri, 1, 0, "NetctlAdds", netctl_singletontype_provider); +} diff --git a/sources/plasmoid-kf5/plugin/netctl.h b/sources/plasmoid-kf5/plugin/netctl.h new file mode 100644 index 0000000..a77269e --- /dev/null +++ b/sources/plasmoid-kf5/plugin/netctl.h @@ -0,0 +1,37 @@ +/*************************************************************************** + * 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 NETCTLPLUGIN_H +#define NETCTLPLUGIN_H + +#include + + +class QQmlEngine; + +class NetctlPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") + +public: + void registerTypes(const char *uri); +}; + + +#endif /* NETCTLPLUGIN_H */ diff --git a/sources/plasmoid-kf5/plugin/netctladds.cpp b/sources/plasmoid-kf5/plugin/netctladds.cpp new file mode 100644 index 0000000..fe7c538 --- /dev/null +++ b/sources/plasmoid-kf5/plugin/netctladds.cpp @@ -0,0 +1,297 @@ +/*************************************************************************** + * 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 +#include + +#include +#include +#include +#include + +#include + +#include "netctladds.h" +#include "version.h" + + +NetctlAdds::NetctlAdds(QObject *parent) + : QObject(parent) +{ + // debug + QProcessEnvironment environment = QProcessEnvironment::systemEnvironment(); + QString debugEnv = environment.value(QString("NETCTLGUI_DEBUG"), QString("no")); + debug = (debugEnv == QString("yes")); +} + + +NetctlAdds::~NetctlAdds() +{ + if (debug) qDebug() << PDEBUG; +} + + +bool NetctlAdds::checkHelperStatus(const bool useHelper) +{ + if (debug) qDebug() << PDEBUG; + + if (useHelper) + return !sendDBusRequest(QString("Active"), QList()).isEmpty(); + else + return useHelper; +} + + +void NetctlAdds::startHelper(const QString cmd) +{ + if (debug) qDebug() << PDEBUG; + + QProcess command; + + command.startDetached(cmd); +} + + +QList NetctlAdds::sendDBusRequest(const QString cmd, const QList args) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd; + if (debug) qDebug() << PDEBUG << ":" << "args" << args; + + QDBusConnection bus = QDBusConnection::systemBus(); + QDBusMessage request = QDBusMessage::createMethodCall(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH, + DBUS_HELPER_INTERFACE, cmd); + if (!args.isEmpty()) + request.setArguments(args); + QDBusMessage response = bus.call(request, QDBus::BlockWithGui); + QList arguments = response.arguments(); + if (arguments.size() == 0) + if (debug) qDebug() << PDEBUG << ":" << "Error message" << response.errorMessage(); + + return arguments; +} + + +QString NetctlAdds::getAboutText(const QString type) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Type" << type; + + QString text; + if (type == QString("header")) + text = QString(NAME); + else if (type == QString("description")) + text = i18n("KDE widget which interacts with netctl."); + else if (type == QString("links")) + text = i18n("Links:") + QString("
") + + QString("%2
").arg(QString(HOMEPAGE)).arg(i18n("Homepage")) + + QString("%2
").arg(QString(REPOSITORY)).arg(i18n("Repository")) + + QString("%2
").arg(QString(BUGTRACKER)).arg(i18n("Bugtracker")) + + QString("%2
").arg(QString(TRANSLATION)).arg(i18n("Translation issue")) + + QString("%2").arg(QString(AUR_PACKAGES)).arg(i18n("AUR packages")); + else if (type == QString("copy")) + text = QString("© %1 %3
").arg(QString(DATE)).arg(QString(EMAIL)).arg(QString(AUTHOR)) + + i18n("This software is licensed under %1", QString(LICENSE)) + QString("
"); + else if (type == QString("translators")) + text = i18n("Translators: %1", QString(TRANSLATORS)); + else if (type == QString("3rdparty")) { + QStringList trdPartyList = QString(TRDPARTY_LICENSE).split(QChar(';'), QString::SkipEmptyParts); + for (int i=0; i%1 (%2 license)") + .arg(trdPartyList[i].split(QChar(','))[0]) + .arg(trdPartyList[i].split(QChar(','))[1]) + .arg(trdPartyList[i].split(QChar(','))[2]); + text = i18n("This software uses: %1", trdPartyList.join(QString(", "))); + } + + return text; +} + + +QString NetctlAdds::getInfo(const QString current, const QString status) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Current profiles" << current; + if (debug) qDebug() << PDEBUG << ":" << "Statuses" << status; + + QStringList profiles; + for (int i=0; i dict) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Dictionary" << dict; + + QString parsed = pattern; + for (int i=0; i")); + + return parsed; +} + + +void NetctlAdds::runCmd(const QString cmd) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Cmd" << cmd; + + QProcess command; + + command.startDetached(cmd); +} + + +void NetctlAdds::sendNotification(const QString eventId, const QString message) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Event" << eventId; + if (debug) qDebug() << PDEBUG << ":" << "Message" << message; + + KNotification::event(eventId, QString("Netctl ::: ") + eventId, message); +} + + +// context menu +void NetctlAdds::enableProfileSlot(const QMap dict, const bool useHelper, + const QString cmd, const QString sudoCmd) +{ + if (debug) qDebug() << PDEBUG; + + QString enableStatus = QString(""); + if (dict[QString("status")].toString().contains(QString("enabled"))) { + enableStatus = QString(" disable "); + sendNotification(QString("Info"), i18n("Set profile %1 disabled", dict[QString("current")].toString())); + } else { + enableStatus = QString(" enable "); + sendNotification(QString("Info"), i18n("Set profile %1 enabled", dict[QString("current")].toString())); + } + if (useHelper) { + QList args; + args.append(dict[QString("current")].toString()); + sendDBusRequest(QString("Enable"), args); + } else { + QProcess command; + QString commandLine = sudoCmd + QString(" ") + cmd + enableStatus + dict[QString("current")].toString(); + command.startDetached(commandLine); + } +} + + +void NetctlAdds::restartProfileSlot(const QMap dict, const bool useHelper, + const QString cmd, const QString sudoCmd) +{ + if (debug) qDebug() << PDEBUG; + + sendNotification(QString("Info"), i18n("Restart profile %1", dict[QString("current")].toString())); + if (useHelper) { + QList args; + args.append(dict[QString("current")].toString()); + sendDBusRequest(QString("Restart"), args); + } else { + QProcess command; + QString commandLine = sudoCmd + QString(" ") + cmd + QString(" restart ") + dict[QString("current")].toString(); + command.startDetached(commandLine); + } +} + + +void NetctlAdds::startProfileSlot(QString profile, const bool status, + const bool useHelper, const QString cmd, const QString sudoCmd) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Profile" << profile; + + profile.remove(QChar('&')); + sendNotification(QString("Info"), i18n("Start profile %1", profile)); + if (useHelper) { + QList args; + args.append(profile); + if (status) + sendDBusRequest(QString("SwitchTo"), args); + else + sendDBusRequest(QString("Start"), args); + } else { + QProcess command; + QString commandLine = sudoCmd + QString(" ") + cmd; + if (status) + commandLine += QString(" switch-to ") + profile; + else + commandLine += QString(" start ") + profile; + command.startDetached(commandLine); + } +} + + +void NetctlAdds::stopProfileSlot(const QMap dict, const bool useHelper, + const QString cmd, const QString sudoCmd) +{ + if (debug) qDebug() << PDEBUG; + + sendNotification(QString("Info"), i18n("Stop profile %1", dict[QString("current")].toString())); + if (useHelper) { + QList args; + args.append(dict[QString("current")].toString()); + sendDBusRequest(QString("Start"), args); + } else { + QProcess command; + QString commandLine = sudoCmd + QString(" ") + cmd + QString(" stop ") + dict[QString("current")].toString(); + command.startDetached(commandLine); + } +} + + +void NetctlAdds::stopAllProfilesSlot(const bool useHelper, const QString cmd, const QString sudoCmd) +{ + if (debug) qDebug() << PDEBUG; + + sendNotification(QString("Info"), i18n("Stop all profiles")); + if (useHelper) + sendDBusRequest(QString("StopAll"), QList()); + else { + QProcess command; + QString commandLine = sudoCmd + QString(" ") + cmd + QString(" stop-all"); + command.startDetached(commandLine); + } +} + + +void NetctlAdds::switchToProfileSlot(QString profile, const bool useHelper, + const QString cmd) +{ + if (debug) qDebug() << PDEBUG; + if (debug) qDebug() << PDEBUG << ":" << "Profile" << profile; + + profile.remove(QChar('&')); + sendNotification(QString("Info"), i18n("Switch to profile %1", profile)); + if (useHelper) { + QList args; + args.append(profile); + sendDBusRequest(QString("autoStart"), args); + } else { + QProcess command; + QString commandLine = cmd + QString(" switch-to ") + profile; + command.startDetached(commandLine); + } +} diff --git a/sources/plasmoid-kf5/plugin/netctladds.h b/sources/plasmoid-kf5/plugin/netctladds.h new file mode 100644 index 0000000..733aad9 --- /dev/null +++ b/sources/plasmoid-kf5/plugin/netctladds.h @@ -0,0 +1,74 @@ +/*************************************************************************** + * 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 NETCTLADDS_H +#define NETCTLADDS_H + +#include +#include +#include + + +class NetctlAdds : public QObject +{ + Q_OBJECT + +public: + NetctlAdds(QObject *parent = 0); + ~NetctlAdds(); + + Q_INVOKABLE QString getAboutText(const QString type = "header"); + Q_INVOKABLE QString getInfo(const QString current, const QString status); + Q_INVOKABLE QString parsePattern(const QString pattern, const QMap dict); + Q_INVOKABLE void runCmd(const QString cmd); + Q_INVOKABLE void sendNotification(const QString eventId, const QString message); + // context menu + Q_INVOKABLE void enableProfileSlot(const QMap dict, + const bool useHelper = true, + const QString cmd = QString("/usr/bin/netctl"), + const QString sudoCmd = QString("")); + Q_INVOKABLE void restartProfileSlot(const QMap dict, + const bool useHelper = true, + const QString cmd = QString("/usr/bin/netctl"), + const QString sudoCmd = QString("")); + Q_INVOKABLE void startProfileSlot(QString profile, const bool status, + const bool useHelper = true, + const QString cmd = QString("/usr/bin/netctl"), + const QString sudoCmd = QString("")); + Q_INVOKABLE void stopProfileSlot(const QMap dict, + const bool useHelper = true, + const QString cmd = QString("/usr/bin/netctl"), + const QString sudoCmd = QString("")); + Q_INVOKABLE void stopAllProfilesSlot(const bool useHelper = true, + const QString cmd = QString("/usr/bin/netctl"), + const QString sudoCmd = QString("")); + Q_INVOKABLE void switchToProfileSlot(QString profile, + const bool useHelper = true, + const QString cmd = QString("/usr/bin/netctl-auto")); + +private: + bool debug = false; + // helper + bool checkHelperStatus(const bool useHelper = true); + void startHelper(const QString cmd = QString("/usr/bin/netctlgui-helper")); + // dbus + QList sendDBusRequest(const QString cmd, const QList args = QList()); +}; + + +#endif /* NETCTLADDS_H */ diff --git a/sources/plasmoid-kf5/plugin/qmldir b/sources/plasmoid-kf5/plugin/qmldir new file mode 100644 index 0000000..38fdc11 --- /dev/null +++ b/sources/plasmoid-kf5/plugin/qmldir @@ -0,0 +1,3 @@ +module org.kde.plasma.private.netctl + +plugin netctlplugin diff --git a/sources/plasmoid-kf5/po/CMakeLists.txt b/sources/plasmoid-kf5/po/CMakeLists.txt new file mode 100644 index 0000000..43779b4 --- /dev/null +++ b/sources/plasmoid-kf5/po/CMakeLists.txt @@ -0,0 +1,24 @@ +find_package(KDE4 REQUIRED) +find_package(Gettext REQUIRED) + +if (NOT GETTEXT_MSGFMT_EXECUTABLE) + message(FATAL_ERROR "Please install the msgfmt binary") +endif (NOT GETTEXT_MSGFMT_EXECUTABLE) + +file (GLOB _po_files *.po) + +set (_gmoFiles) + +foreach (_current_PO_FILE ${_po_files}) + get_filename_component (_lang ${_current_PO_FILE} NAME_WE) + set (_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo) + add_custom_command (OUTPUT ${_gmoFile} + COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + DEPENDS ${_current_PO_FILE} + ) + + install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo DESTINATION ${LOCALE_INSTALL_DIR}/${_lang}/LC_MESSAGES/ RENAME plasma_applet_netctl.mo) + list (APPEND _gmoFiles ${_gmoFile}) +endforeach (_current_PO_FILE) +add_custom_target (pofiles ALL DEPENDS ${_gmoFiles}) diff --git a/sources/plasmoid-kf5/po/en.po b/sources/plasmoid-kf5/po/en.po new file mode 100644 index 0000000..976ec93 --- /dev/null +++ b/sources/plasmoid-kf5/po/en.po @@ -0,0 +1,448 @@ +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Evgeniy Alekseev , 2014. +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: https://github.com/arcan1s/netctl-gui/issues\n" +"POT-Creation-Date: 2014-08-24 16:44+0400\n" +"PO-Revision-Date: 2014-08-20 12:00+0400\n" +"Last-Translator: Evgeniy Alekseev \n" +"Language-Team: Russian \n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Lokalize 1.5\n" + +#: netctl.cpp:270 +msgid "Set profile %1 disabled" +msgstr "Set profile %1 disabled" + +#: netctl.cpp:273 +msgid "Set profile %1 enabled" +msgstr "Set profile %1 enabled" + +#: netctl.cpp:294 +msgid "Restart profile %1" +msgstr "Restart profile %1" + +#: netctl.cpp:315 +msgid "Start profile %1" +msgstr "Start profile %1" + +#: netctl.cpp:341 +msgid "Stop profile %1" +msgstr "Stop profile %1" + +#: netctl.cpp:361 netctl.cpp:499 +msgid "Stop all profiles" +msgstr "Stop all profiles" + +#: netctl.cpp:381 +msgid "Switch to profile %1" +msgstr "Switch to profile %1" + +#: netctl.cpp:454 +msgid "Start another profile" +msgstr "Start another profile" + +#: netctl.cpp:455 +msgid "Stop %1" +msgstr "Stop %1" + +#: netctl.cpp:456 +msgid "Restart %1" +msgstr "Restart %1" + +#: netctl.cpp:458 +msgid "Disable %1" +msgstr "Disable %1" + +#: netctl.cpp:460 +msgid "Enable %1" +msgstr "Enable %1" + +#: netctl.cpp:463 netctl.cpp:486 +msgid "Start profile" +msgstr "Start profile" + +#: netctl.cpp:494 +msgid "Stop profile" +msgstr "Stop profile" + +#: netctl.cpp:504 +msgid "Switch to profile" +msgstr "Switch to profile" + +#: netctl.cpp:512 +msgid "Restart profile" +msgstr "Restart profile" + +#: netctl.cpp:517 +msgid "Enable profile" +msgstr "Enable profile" + +#: netctl.cpp:521 +msgid "Show netctl-gui" +msgstr "Show netctl-gui" + +#: netctl.cpp:526 +msgid "Show WiFi menu" +msgstr "Show WiFi menu" + +#: netctl.cpp:553 +msgid "Start GUI" +msgstr "Start GUI" + +#: netctl.cpp:564 +msgid "Start WiFi menu" +msgstr "Start WiFi menu" + +#: netctl.cpp:604 +msgid "Network is up" +msgstr "Network is up" + +#: netctl.cpp:608 +msgid "Network is down" +msgstr "Network is down" + +#: netctl.cpp:798 +msgid "" +"Version %1\n" +"(build date %2)" +msgstr "" +"Version %1\n" +"(build date %2)" + +#: netctl.cpp:799 +msgid "KDE widget which interacts with netctl." +msgstr "KDE widget which interacts with netctl." + +#: netctl.cpp:800 +msgid "Links:" +msgstr "Links:" + +#: netctl.cpp:801 +msgid "Homepage" +msgstr "Homepage" + +#: netctl.cpp:802 +msgid "Repository" +msgstr "Repository" + +#: netctl.cpp:803 +msgid "Bugtracker" +msgstr "Bugtracker" + +#: netctl.cpp:804 +msgid "Translation issue" +msgstr "Translation issue" + +#: netctl.cpp:805 +msgid "AUR packages" +msgstr "AUR packages" + +#: netctl.cpp:807 +msgid "This software is licensed under %1" +msgstr "This software is licensed under %1" + +#: netctl.cpp:815 +msgid "Translators: %1" +msgstr "Translators: %1" + +#: netctl.cpp:816 +msgid "This software uses: %1" +msgstr "This software uses: %1" + +#: netctl.cpp:818 +msgid "Netctl plasmoid" +msgstr "Netctl plasmoid" + +#: netctl.cpp:819 +msgid "Appearance" +msgstr "Appearance" + +#: netctl.cpp:820 +msgid "DataEngine" +msgstr "DataEngine" + +#: netctl.cpp:821 +msgid "About" +msgstr "About" + +#. i18n: file: appearance.ui:47 +#. i18n: ectx: property (text), widget (QLabel, label_inactiveIcon) +#: po/rc.cpp:3 rc.cpp:3 +msgid "Inactive icon" +msgstr "Inactive icon" + +#. 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:119 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp4) +#. i18n: file: dataengine.ui:155 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp6) +#. i18n: file: widget.ui:108 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui) +#. i18n: file: widget.ui:144 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_helper) +#. i18n: file: widget.ui:177 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl) +#. i18n: file: widget.ui:210 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto) +#. i18n: file: widget.ui:246 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo) +#. i18n: file: widget.ui:282 +#. 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:119 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp4) +#. i18n: file: dataengine.ui:155 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp6) +#. i18n: file: widget.ui:108 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui) +#. i18n: file: widget.ui:144 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_helper) +#. i18n: file: widget.ui:177 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl) +#. i18n: file: widget.ui:210 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto) +#. i18n: file: widget.ui:246 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo) +#. i18n: file: widget.ui:282 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_wifi) +#: po/rc.cpp:6 po/rc.cpp:42 po/rc.cpp:54 po/rc.cpp:60 po/rc.cpp:66 +#: po/rc.cpp:72 po/rc.cpp:81 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:42 rc.cpp:54 rc.cpp:60 +#: rc.cpp:66 rc.cpp:72 rc.cpp:81 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:326 +#. i18n: ectx: property (text), widget (QLabel, label_font) +#: po/rc.cpp:33 rc.cpp:33 +msgid "Font" +msgstr "Font" + +#. i18n: file: appearance.ui:358 +#. i18n: ectx: property (toolTip), widget (QFontComboBox, fontComboBox_font) +#: po/rc.cpp:36 rc.cpp:36 +msgid "Set font family" +msgstr "Set font family" + +#. i18n: file: appearance.ui:375 +#. i18n: ectx: property (text), widget (QLabel, label_activeIcon) +#: po/rc.cpp:39 rc.cpp:39 +msgid "Active icon" +msgstr "Active icon" + +#. i18n: file: appearance.ui:408 +#. i18n: ectx: property (text), widget (QLabel, label_textAlign) +#: po/rc.cpp:45 rc.cpp:45 +msgid "Text align" +msgstr "Text align" + +#. i18n: file: appearance.ui:440 +#. i18n: ectx: property (toolTip), widget (QComboBox, comboBox_textAlign) +#: po/rc.cpp:48 rc.cpp:48 +msgid "Set text align" +msgstr "Set text align" + +#. i18n: file: dataengine.ui:34 +#. i18n: ectx: property (text), widget (QLabel, label_netctl) +#. i18n: file: widget.ui:161 +#. 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:161 +#. 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:194 +#. 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:194 +#. 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 (QCheckBox, checkBox_extIp4) +#: po/rc.cpp:63 rc.cpp:63 +msgid "Check external IPv4" +msgstr "Check external IPv4" + +#. i18n: file: dataengine.ui:136 +#. i18n: ectx: property (text), widget (QCheckBox, checkBox_extIp6) +#: po/rc.cpp:69 rc.cpp:69 +msgid "Check external IPv6" +msgstr "Check external IPv6" + +#. i18n: file: widget.ui:34 +#. i18n: ectx: property (text), widget (QLabel, label_autoUpdate) +#: po/rc.cpp:75 rc.cpp:75 +msgid "Auto update interval, msec" +msgstr "Auto update interval, msec" + +#. i18n: file: widget.ui:92 +#. i18n: ectx: property (text), widget (QLabel, label_gui) +#: po/rc.cpp:78 rc.cpp:78 +msgid "Path to GUI" +msgstr "Path to GUI" + +#. i18n: file: widget.ui:125 +#. i18n: ectx: property (text), widget (QCheckBox, checkBox_helper) +#: po/rc.cpp:84 rc.cpp:84 +msgid "Use helper" +msgstr "Use helper" + +#. i18n: file: widget.ui:227 +#. 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:263 +#. 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:291 +#. 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:309 +#. i18n: ectx: property (toolTip), widget (QPlainTextEdit, textEdit) +#: po/rc.cpp:117 rc.cpp:117 +msgid "" +"$info - active profile information\n" +"$current - current profile name\n" +"$extip4 - external IPv4\n" +"$extip6 - external IPv6\n" +"$interfaces - list of the network interfaces\n" +"$intip4 - internal IPv4\n" +"$intip6 - internal IPv6\n" +"$profiles - list of the netctl profiles\n" +"$status - current profile status (static/enabled)" +msgstr "" +"$info - active profile information\n" +"$current - current profile name\n" +"$extip4 - external IPv4\n" +"$extip6 - external IPv6\n" +"$interfaces - list of the network interfaces\n" +"$intip4 - internal IPv4\n" +"$intip6 - internal IPv6\n" +"$profiles - list of the netctl profiles\n" +"$status - current profile status (static/enabled)" + +#: po/rc.cpp:126 rc.cpp:126 +msgctxt "NAME OF TRANSLATORS" +msgid "Your names" +msgstr "Evgeniy Alekseev" + +#: po/rc.cpp:127 rc.cpp:127 +msgctxt "EMAIL OF TRANSLATORS" +msgid "Your emails" +msgstr "esalexeev@gmail.com" + +#~ msgid "Acknowledgement" +#~ msgstr "Acknowledgement" + +#~ msgid "normal" +#~ msgstr "normal" + +#~ msgid "italic" +#~ msgstr "italic" + +#~ msgid "Path to ip" +#~ msgstr "Path to ip" + +#~ msgid "Path to interface list" +#~ msgstr "Path to interface list" + +#~ msgid "Show network devices" +#~ msgstr "Show network devices" + +#~ msgid "Show external IP" +#~ msgstr "Show external IP" + +#~ msgid "Show internal IP" +#~ msgstr "Show internal IP" + +#~ msgid "Configuration" +#~ msgstr "Configuration" diff --git a/sources/plasmoid-kf5/po/extract_messages.sh b/sources/plasmoid-kf5/po/extract_messages.sh new file mode 100755 index 0000000..e210bd7 --- /dev/null +++ b/sources/plasmoid-kf5/po/extract_messages.sh @@ -0,0 +1,47 @@ +#!/bin/sh +# root of translatable sources +BASEDIR="../" +PROJECT="plasma_applet_netctl" +BUGADDR="https://github.com/arcan1s/netctl-gui/issues" +# working dir +WDIR=`pwd` + + +echo "Preparing rc files" +cd ${BASEDIR} +# we use simple sorting to make sure the lines do not jump around too much from system to system +find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort > ${WDIR}/rcfiles.list +xargs --arg-file=${WDIR}/rcfiles.list extractrc > ${WDIR}/rc.cpp +# additional string for KAboutData +echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/rc.cpp +echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/rc.cpp +cd ${WDIR} +echo "Done preparing rc files" + +echo "Extracting messages" +cd ${BASEDIR} +# see above on sorting +find . -name '*.cpp' -o -name '*.h' -o -name '*.c' | sort > ${WDIR}/infiles.list +echo "rc.cpp" >> ${WDIR}/infiles.list +cd ${WDIR} +xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \ +-kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \ +--msgid-bugs-address="${BUGADDR}" \ +--files-from=infiles.list -D ${BASEDIR} -D ${WDIR} -o ${PROJECT}.pot || { echo "Error while calling xgettext, aborting."; exit 1; } +echo "Done extracting messages" + +echo "Merging translations" +catalogs=`find . -name '*.po'` +for cat in $catalogs; do + echo $cat + msgmerge -o $cat.new $cat ${PROJECT}.pot + mv $cat.new $cat +done +echo "Done merging translations" + + +echo "Cleaning up" +cd ${WDIR} +rm -f rcfiles.list infiles.list rc.cpp +echo "Done" + diff --git a/sources/plasmoid-kf5/po/ja.po b/sources/plasmoid-kf5/po/ja.po new file mode 100644 index 0000000..ec438b7 --- /dev/null +++ b/sources/plasmoid-kf5/po/ja.po @@ -0,0 +1,422 @@ +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# NOGISAKA Sadata , 2014. +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: https://github.com/arcan1s/netctl-gui/issues\n" +"POT-Creation-Date: 2014-08-24 16:44+0400\n" +"PO-Revision-Date: 2014-10-13 16:37+0900\n" +"Last-Translator: NOGISAKA Sadata \n" +"Language-Team: Japanese \n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Lokalize 1.5\n" + +#: netctl.cpp:270 +msgid "Set profile %1 disabled" +msgstr "プロファイル %1 を無効にする" + +#: netctl.cpp:273 +msgid "Set profile %1 enabled" +msgstr "プロファイル %1 を有効にする" + +#: netctl.cpp:294 +msgid "Restart profile %1" +msgstr "プロファイル %1 の利用を再開" + +#: netctl.cpp:315 +msgid "Start profile %1" +msgstr "プロファイル %1 の利用を開始" + +#: netctl.cpp:341 +msgid "Stop profile %1" +msgstr "プロファイル %1 の利用を停止する" + +#: netctl.cpp:361 netctl.cpp:499 +msgid "Stop all profiles" +msgstr "全てのプロファイルの利用を停止する" + +#: netctl.cpp:381 +msgid "Switch to profile %1" +msgstr "プロファイルを %1 へ切り替える" + +#: netctl.cpp:454 +msgid "Start another profile" +msgstr "他のプロファイルの利用を開始" + +#: netctl.cpp:455 +msgid "Stop %1" +msgstr "%1 を停止" + +#: netctl.cpp:456 +msgid "Restart %1" +msgstr "%1 を再開" + +#: netctl.cpp:458 +msgid "Disable %1" +msgstr "%1 を無効にする" + +#: netctl.cpp:460 +msgid "Enable %1" +msgstr "%1 を有効にする" + +#: netctl.cpp:463 netctl.cpp:486 +msgid "Start profile" +msgstr "プロファイルの利用を開始" + +#: netctl.cpp:494 +msgid "Stop profile" +msgstr "プロファイルの利用を停止する" + +#: netctl.cpp:504 +msgid "Switch to profile" +msgstr "プロファイルを切り替える" + +#: netctl.cpp:512 +msgid "Restart profile" +msgstr "プロファイルの利用を再開" + +#: netctl.cpp:517 +msgid "Enable profile" +msgstr "プロファイルを有効にする" + +#: netctl.cpp:521 +msgid "Show netctl-gui" +msgstr "netctl-gui を表示" + +#: netctl.cpp:526 +msgid "Show WiFi menu" +msgstr "WiFi メニューを表示" + +#: netctl.cpp:553 +msgid "Start GUI" +msgstr "GUI を開始" + +#: netctl.cpp:564 +msgid "Start WiFi menu" +msgstr "WiFi メニューを開始" + +#: netctl.cpp:604 +msgid "Network is up" +msgstr "ネットワークは有効です" + +#: netctl.cpp:608 +msgid "Network is down" +msgstr "ネットワークは無効です" + +#: netctl.cpp:798 +msgid "" +"Version %1\n" +"(build date %2)" +msgstr "" +"バージョン:%1\n" +"(ビルド日時:%2)" + +#: netctl.cpp:799 +msgid "KDE widget which interacts with netctl." +msgstr "netctl と連携する KDE ウィジェット" + +#: netctl.cpp:800 +msgid "Links:" +msgstr "リンク:" + +#: netctl.cpp:801 +msgid "Homepage" +msgstr "ホームページ" + +#: netctl.cpp:802 +msgid "Repository" +msgstr "レポジトリ" + +#: netctl.cpp:803 +msgid "Bugtracker" +msgstr "バグトラッカ" + +#: netctl.cpp:804 +msgid "Translation issue" +msgstr "翻訳に関する issue" + +#: netctl.cpp:805 +msgid "AUR packages" +msgstr "AUR パッケージ" + +#: netctl.cpp:807 +msgid "This software is licensed under %1" +msgstr "このソフトウェアは %1 の下で許諾されます" + +#: netctl.cpp:815 +msgid "Translators: %1" +msgstr "翻訳者:%1" + +#: netctl.cpp:816 +msgid "This software uses: %1" +msgstr "このソフトウェアは次を利用しています:%1" + +#: netctl.cpp:818 +msgid "Netctl plasmoid" +msgstr "Netctl plasmoid" + +#: netctl.cpp:819 +msgid "Appearance" +msgstr "外観" + +#: netctl.cpp:820 +msgid "DataEngine" +msgstr "DataEngine" + +#: netctl.cpp:821 +msgid "About" +msgstr "概要" + +#. i18n: file: appearance.ui:47 +#. i18n: ectx: property (text), widget (QLabel, label_inactiveIcon) +#: po/rc.cpp:3 rc.cpp:3 +msgid "Inactive icon" +msgstr "非アクティブ時のアイコン" + +#. 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:119 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp4) +#. i18n: file: dataengine.ui:155 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp6) +#. i18n: file: widget.ui:108 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui) +#. i18n: file: widget.ui:144 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_helper) +#. i18n: file: widget.ui:177 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl) +#. i18n: file: widget.ui:210 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto) +#. i18n: file: widget.ui:246 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo) +#. i18n: file: widget.ui:282 +#. 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:119 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp4) +#. i18n: file: dataengine.ui:155 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp6) +#. i18n: file: widget.ui:108 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui) +#. i18n: file: widget.ui:144 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_helper) +#. i18n: file: widget.ui:177 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl) +#. i18n: file: widget.ui:210 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto) +#. i18n: file: widget.ui:246 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo) +#. i18n: file: widget.ui:282 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_wifi) +#: po/rc.cpp:6 po/rc.cpp:42 po/rc.cpp:54 po/rc.cpp:60 po/rc.cpp:66 +#: po/rc.cpp:72 po/rc.cpp:81 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:42 rc.cpp:54 rc.cpp:60 +#: rc.cpp:66 rc.cpp:72 rc.cpp:81 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:326 +#. i18n: ectx: property (text), widget (QLabel, label_font) +#: po/rc.cpp:33 rc.cpp:33 +msgid "Font" +msgstr "フォント" + +#. i18n: file: appearance.ui:358 +#. i18n: ectx: property (toolTip), widget (QFontComboBox, fontComboBox_font) +#: po/rc.cpp:36 rc.cpp:36 +msgid "Set font family" +msgstr "フォントを設定する" + +#. i18n: file: appearance.ui:375 +#. i18n: ectx: property (text), widget (QLabel, label_activeIcon) +#: po/rc.cpp:39 rc.cpp:39 +msgid "Active icon" +msgstr "アクティブ時のアイコン" + +#. i18n: file: appearance.ui:408 +#. i18n: ectx: property (text), widget (QLabel, label_textAlign) +#: po/rc.cpp:45 rc.cpp:45 +msgid "Text align" +msgstr "テキストの位置" + +#. i18n: file: appearance.ui:440 +#. i18n: ectx: property (toolTip), widget (QComboBox, comboBox_textAlign) +#: po/rc.cpp:48 rc.cpp:48 +msgid "Set text align" +msgstr "テキストの位置を設定する" + +#. i18n: file: dataengine.ui:34 +#. i18n: ectx: property (text), widget (QLabel, label_netctl) +#. i18n: file: widget.ui:161 +#. 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:161 +#. 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:194 +#. 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:194 +#. 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 (QCheckBox, checkBox_extIp4) +#: po/rc.cpp:63 rc.cpp:63 +msgid "Check external IPv4" +msgstr "外部 IPv4 アドレスを確認" + +#. i18n: file: dataengine.ui:136 +#. i18n: ectx: property (text), widget (QCheckBox, checkBox_extIp6) +#: po/rc.cpp:69 rc.cpp:69 +msgid "Check external IPv6" +msgstr "外部 IPv6 アドレスを確認" + +#. i18n: file: widget.ui:34 +#. i18n: ectx: property (text), widget (QLabel, label_autoUpdate) +#: po/rc.cpp:75 rc.cpp:75 +msgid "Auto update interval, msec" +msgstr "自動更新の間隔(ミリ秒)" + +#. i18n: file: widget.ui:92 +#. i18n: ectx: property (text), widget (QLabel, label_gui) +#: po/rc.cpp:78 rc.cpp:78 +msgid "Path to GUI" +msgstr "GUIへのパス" + +#. i18n: file: widget.ui:125 +#. i18n: ectx: property (text), widget (QCheckBox, checkBox_helper) +#: po/rc.cpp:84 rc.cpp:84 +msgid "Use helper" +msgstr "ヘルパを使用する" + +#. i18n: file: widget.ui:227 +#. i18n: ectx: property (text), widget (QCheckBox, checkBox_sudo) +#: po/rc.cpp:102 rc.cpp:102 +msgid "Use sudo for netctl" +msgstr "netctl に対して sudo を使用する" + +#. i18n: file: widget.ui:263 +#. i18n: ectx: property (text), widget (QCheckBox, checkBox_wifi) +#: po/rc.cpp:108 rc.cpp:108 +msgid "Show 'Start WiFi menu'" +msgstr "「Wifi メニューの開始」を表示" + +#. i18n: file: widget.ui:291 +#. 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:309 +#. i18n: ectx: property (toolTip), widget (QPlainTextEdit, textEdit) +#: po/rc.cpp:117 rc.cpp:117 +msgid "" +"$info - active profile information\n" +"$current - current profile name\n" +"$extip4 - external IPv4\n" +"$extip6 - external IPv6\n" +"$interfaces - list of the network interfaces\n" +"$intip4 - internal IPv4\n" +"$intip6 - internal IPv6\n" +"$profiles - list of the netctl profiles\n" +"$status - current profile status (static/enabled)" +msgstr "" +"$info - アクティブなプロファイルの情報\n" +"$current - 現在利用中プロファイルの情報\n" +"$extip4 - 外部 IPv4 アドレス\n" +"$extip6 - 外部 IPv6 アドレス\n" +"$interfaces - ネットワークインターフェースの一覧\n" +"$intip4 - 内部 IPv4 アドレス\n" +"$intip6 - 内部 IPv6 アドレス\n" +"$profiles - プロファイルの一覧\n" +"$status - 現在のプロファイルの状態(静的/有効)" + +#: po/rc.cpp:126 rc.cpp:126 +msgctxt "NAME OF TRANSLATORS" +msgid "Your names" +msgstr "NOGISAKA Sadata" + +#: po/rc.cpp:127 rc.cpp:127 +msgctxt "EMAIL OF TRANSLATORS" +msgid "Your emails" +msgstr "ngsksdt@gmail.com " + + diff --git a/sources/plasmoid-kf5/po/plasma_applet_netctl.pot b/sources/plasmoid-kf5/po/plasma_applet_netctl.pot new file mode 100644 index 0000000..35a438a --- /dev/null +++ b/sources/plasmoid-kf5/po/plasma_applet_netctl.pot @@ -0,0 +1,409 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: https://github.com/arcan1s/netctl-gui/issues\n" +"POT-Creation-Date: 2014-08-24 16:44+0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: netctl.cpp:270 +msgid "Set profile %1 disabled" +msgstr "" + +#: netctl.cpp:273 +msgid "Set profile %1 enabled" +msgstr "" + +#: netctl.cpp:294 +msgid "Restart profile %1" +msgstr "" + +#: netctl.cpp:315 +msgid "Start profile %1" +msgstr "" + +#: netctl.cpp:341 +msgid "Stop profile %1" +msgstr "" + +#: netctl.cpp:361 netctl.cpp:499 +msgid "Stop all profiles" +msgstr "" + +#: netctl.cpp:381 +msgid "Switch to profile %1" +msgstr "" + +#: netctl.cpp:454 +msgid "Start another profile" +msgstr "" + +#: netctl.cpp:455 +msgid "Stop %1" +msgstr "" + +#: netctl.cpp:456 +msgid "Restart %1" +msgstr "" + +#: netctl.cpp:458 +msgid "Disable %1" +msgstr "" + +#: netctl.cpp:460 +msgid "Enable %1" +msgstr "" + +#: netctl.cpp:463 netctl.cpp:486 +msgid "Start profile" +msgstr "" + +#: netctl.cpp:494 +msgid "Stop profile" +msgstr "" + +#: netctl.cpp:504 +msgid "Switch to profile" +msgstr "" + +#: netctl.cpp:512 +msgid "Restart profile" +msgstr "" + +#: netctl.cpp:517 +msgid "Enable profile" +msgstr "" + +#: netctl.cpp:521 +msgid "Show netctl-gui" +msgstr "" + +#: netctl.cpp:526 +msgid "Show WiFi menu" +msgstr "" + +#: netctl.cpp:553 +msgid "Start GUI" +msgstr "" + +#: netctl.cpp:564 +msgid "Start WiFi menu" +msgstr "" + +#: netctl.cpp:604 +msgid "Network is up" +msgstr "" + +#: netctl.cpp:608 +msgid "Network is down" +msgstr "" + +#: netctl.cpp:798 +msgid "" +"Version %1\n" +"(build date %2)" +msgstr "" + +#: netctl.cpp:799 +msgid "KDE widget which interacts with netctl." +msgstr "" + +#: netctl.cpp:800 +msgid "Links:" +msgstr "" + +#: netctl.cpp:801 +msgid "Homepage" +msgstr "" + +#: netctl.cpp:802 +msgid "Repository" +msgstr "" + +#: netctl.cpp:803 +msgid "Bugtracker" +msgstr "" + +#: netctl.cpp:804 +msgid "Translation issue" +msgstr "" + +#: netctl.cpp:805 +msgid "AUR packages" +msgstr "" + +#: netctl.cpp:807 +msgid "This software is licensed under %1" +msgstr "" + +#: netctl.cpp:815 +msgid "Translators: %1" +msgstr "" + +#: netctl.cpp:816 +msgid "This software uses: %1" +msgstr "" + +#: netctl.cpp:818 +msgid "Netctl plasmoid" +msgstr "" + +#: netctl.cpp:819 +msgid "Appearance" +msgstr "" + +#: netctl.cpp:820 +msgid "DataEngine" +msgstr "" + +#: netctl.cpp:821 +msgid "About" +msgstr "" + +#. i18n: file: appearance.ui:47 +#. i18n: ectx: property (text), widget (QLabel, label_inactiveIcon) +#: po/rc.cpp:3 rc.cpp:3 +msgid "Inactive icon" +msgstr "" + +#. 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:119 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp4) +#. i18n: file: dataengine.ui:155 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp6) +#. i18n: file: widget.ui:108 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui) +#. i18n: file: widget.ui:144 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_helper) +#. i18n: file: widget.ui:177 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl) +#. i18n: file: widget.ui:210 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto) +#. i18n: file: widget.ui:246 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo) +#. i18n: file: widget.ui:282 +#. 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:119 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp4) +#. i18n: file: dataengine.ui:155 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp6) +#. i18n: file: widget.ui:108 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui) +#. i18n: file: widget.ui:144 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_helper) +#. i18n: file: widget.ui:177 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl) +#. i18n: file: widget.ui:210 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto) +#. i18n: file: widget.ui:246 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo) +#. i18n: file: widget.ui:282 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_wifi) +#: po/rc.cpp:6 po/rc.cpp:42 po/rc.cpp:54 po/rc.cpp:60 po/rc.cpp:66 +#: po/rc.cpp:72 po/rc.cpp:81 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:42 rc.cpp:54 rc.cpp:60 +#: rc.cpp:66 rc.cpp:72 rc.cpp:81 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:326 +#. i18n: ectx: property (text), widget (QLabel, label_font) +#: po/rc.cpp:33 rc.cpp:33 +msgid "Font" +msgstr "" + +#. i18n: file: appearance.ui:358 +#. i18n: ectx: property (toolTip), widget (QFontComboBox, fontComboBox_font) +#: po/rc.cpp:36 rc.cpp:36 +msgid "Set font family" +msgstr "" + +#. i18n: file: appearance.ui:375 +#. i18n: ectx: property (text), widget (QLabel, label_activeIcon) +#: po/rc.cpp:39 rc.cpp:39 +msgid "Active icon" +msgstr "" + +#. i18n: file: appearance.ui:408 +#. i18n: ectx: property (text), widget (QLabel, label_textAlign) +#: po/rc.cpp:45 rc.cpp:45 +msgid "Text align" +msgstr "" + +#. i18n: file: appearance.ui:440 +#. i18n: ectx: property (toolTip), widget (QComboBox, comboBox_textAlign) +#: po/rc.cpp:48 rc.cpp:48 +msgid "Set text align" +msgstr "" + +#. i18n: file: dataengine.ui:34 +#. i18n: ectx: property (text), widget (QLabel, label_netctl) +#. i18n: file: widget.ui:161 +#. 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:161 +#. 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:194 +#. 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:194 +#. 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 (QCheckBox, checkBox_extIp4) +#: po/rc.cpp:63 rc.cpp:63 +msgid "Check external IPv4" +msgstr "" + +#. i18n: file: dataengine.ui:136 +#. i18n: ectx: property (text), widget (QCheckBox, checkBox_extIp6) +#: po/rc.cpp:69 rc.cpp:69 +msgid "Check external IPv6" +msgstr "" + +#. i18n: file: widget.ui:34 +#. i18n: ectx: property (text), widget (QLabel, label_autoUpdate) +#: po/rc.cpp:75 rc.cpp:75 +msgid "Auto update interval, msec" +msgstr "" + +#. i18n: file: widget.ui:92 +#. i18n: ectx: property (text), widget (QLabel, label_gui) +#: po/rc.cpp:78 rc.cpp:78 +msgid "Path to GUI" +msgstr "" + +#. i18n: file: widget.ui:125 +#. i18n: ectx: property (text), widget (QCheckBox, checkBox_helper) +#: po/rc.cpp:84 rc.cpp:84 +msgid "Use helper" +msgstr "" + +#. i18n: file: widget.ui:227 +#. 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:263 +#. 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:291 +#. 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:309 +#. i18n: ectx: property (toolTip), widget (QPlainTextEdit, textEdit) +#: po/rc.cpp:117 rc.cpp:117 +msgid "" +"$info - active profile information\n" +"$current - current profile name\n" +"$extip4 - external IPv4\n" +"$extip6 - external IPv6\n" +"$interfaces - list of the network interfaces\n" +"$intip4 - internal IPv4\n" +"$intip6 - internal IPv6\n" +"$profiles - list of the netctl profiles\n" +"$status - current profile status (static/enabled)" +msgstr "" + +#: po/rc.cpp:126 rc.cpp:126 +msgctxt "NAME OF TRANSLATORS" +msgid "Your names" +msgstr "" + +#: po/rc.cpp:127 rc.cpp:127 +msgctxt "EMAIL OF TRANSLATORS" +msgid "Your emails" +msgstr "" diff --git a/sources/plasmoid-kf5/po/ru.po b/sources/plasmoid-kf5/po/ru.po new file mode 100644 index 0000000..76a0a54 --- /dev/null +++ b/sources/plasmoid-kf5/po/ru.po @@ -0,0 +1,448 @@ +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Evgeniy Alekseev , 2014. +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: https://github.com/arcan1s/netctl-gui/issues\n" +"POT-Creation-Date: 2014-08-24 16:44+0400\n" +"PO-Revision-Date: 2014-08-20 12:00+0400\n" +"Last-Translator: Evgeniy Alekseev \n" +"Language-Team: Russian \n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Lokalize 1.5\n" + +#: netctl.cpp:270 +msgid "Set profile %1 disabled" +msgstr "Выключение автозагрузки профиля %1" + +#: netctl.cpp:273 +msgid "Set profile %1 enabled" +msgstr "Включение автозагрузки профиля %1" + +#: netctl.cpp:294 +msgid "Restart profile %1" +msgstr "Перезапуск профиля %1" + +#: netctl.cpp:315 +msgid "Start profile %1" +msgstr "Запуск профиля %1" + +#: netctl.cpp:341 +msgid "Stop profile %1" +msgstr "Остановка профиля %1" + +#: netctl.cpp:361 netctl.cpp:499 +msgid "Stop all profiles" +msgstr "Остановить все профили" + +#: netctl.cpp:381 +msgid "Switch to profile %1" +msgstr "Переключение на профиль %1" + +#: netctl.cpp:454 +msgid "Start another profile" +msgstr "Запустить другой профиль" + +#: netctl.cpp:455 +msgid "Stop %1" +msgstr "Остановить %1" + +#: netctl.cpp:456 +msgid "Restart %1" +msgstr "Перезапустить %1" + +#: netctl.cpp:458 +msgid "Disable %1" +msgstr "Отключить %1" + +#: netctl.cpp:460 +msgid "Enable %1" +msgstr "Включить %1" + +#: netctl.cpp:463 netctl.cpp:486 +msgid "Start profile" +msgstr "Запустить профиль" + +#: netctl.cpp:494 +msgid "Stop profile" +msgstr "Остановить профиль" + +#: netctl.cpp:504 +msgid "Switch to profile" +msgstr "Переключить профиль" + +#: netctl.cpp:512 +msgid "Restart profile" +msgstr "Перезапустить профиль" + +#: netctl.cpp:517 +msgid "Enable profile" +msgstr "Включить профиль" + +#: netctl.cpp:521 +msgid "Show netctl-gui" +msgstr "Показать netctl-gui" + +#: netctl.cpp:526 +msgid "Show WiFi menu" +msgstr "Запустить WiFi-menu" + +#: netctl.cpp:553 +msgid "Start GUI" +msgstr "Запуск GUI" + +#: netctl.cpp:564 +msgid "Start WiFi menu" +msgstr "Запуск WiFi-menu" + +#: netctl.cpp:604 +msgid "Network is up" +msgstr "Сеть работает" + +#: netctl.cpp:608 +msgid "Network is down" +msgstr "Сеть не работает" + +#: netctl.cpp:798 +msgid "" +"Version %1\n" +"(build date %2)" +msgstr "" +"Версия %1\n" +"(дата сборки %2)" + +#: netctl.cpp:799 +msgid "KDE widget which interacts with netctl." +msgstr "Виджет KDE, который взаимодействует с netctl." + +#: netctl.cpp:800 +msgid "Links:" +msgstr "Ссылки:" + +#: netctl.cpp:801 +msgid "Homepage" +msgstr "Домашняя страница" + +#: netctl.cpp:802 +msgid "Repository" +msgstr "Репозиторий" + +#: netctl.cpp:803 +msgid "Bugtracker" +msgstr "Багтрекер" + +#: netctl.cpp:804 +msgid "Translation issue" +msgstr "Тикет перевода" + +#: netctl.cpp:805 +msgid "AUR packages" +msgstr "Пакеты в AUR" + +#: netctl.cpp:807 +msgid "This software is licensed under %1" +msgstr "Данное приложение лицензировано под %1" + +#: netctl.cpp:815 +msgid "Translators: %1" +msgstr "Переводчики: %1" + +#: netctl.cpp:816 +msgid "This software uses: %1" +msgstr "Данное приложение использует: %1" + +#: netctl.cpp:818 +msgid "Netctl plasmoid" +msgstr "Netctl plasmoid" + +#: netctl.cpp:819 +msgid "Appearance" +msgstr "Внешний вид" + +#: netctl.cpp:820 +msgid "DataEngine" +msgstr "DataEngine" + +#: netctl.cpp:821 +msgid "About" +msgstr "О программе" + +#. i18n: file: appearance.ui:47 +#. i18n: ectx: property (text), widget (QLabel, label_inactiveIcon) +#: po/rc.cpp:3 rc.cpp:3 +msgid "Inactive icon" +msgstr "Иконка неактивного подключения" + +#. 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:119 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp4) +#. i18n: file: dataengine.ui:155 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp6) +#. i18n: file: widget.ui:108 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui) +#. i18n: file: widget.ui:144 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_helper) +#. i18n: file: widget.ui:177 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl) +#. i18n: file: widget.ui:210 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto) +#. i18n: file: widget.ui:246 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo) +#. i18n: file: widget.ui:282 +#. 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:119 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp4) +#. i18n: file: dataengine.ui:155 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_extIp6) +#. i18n: file: widget.ui:108 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_gui) +#. i18n: file: widget.ui:144 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_helper) +#. i18n: file: widget.ui:177 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctl) +#. i18n: file: widget.ui:210 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_netctlAuto) +#. i18n: file: widget.ui:246 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_sudo) +#. i18n: file: widget.ui:282 +#. i18n: ectx: property (text), widget (QPushButton, pushButton_wifi) +#: po/rc.cpp:6 po/rc.cpp:42 po/rc.cpp:54 po/rc.cpp:60 po/rc.cpp:66 +#: po/rc.cpp:72 po/rc.cpp:81 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:42 rc.cpp:54 rc.cpp:60 +#: rc.cpp:66 rc.cpp:72 rc.cpp:81 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:326 +#. i18n: ectx: property (text), widget (QLabel, label_font) +#: po/rc.cpp:33 rc.cpp:33 +msgid "Font" +msgstr "Шрифт" + +#. i18n: file: appearance.ui:358 +#. i18n: ectx: property (toolTip), widget (QFontComboBox, fontComboBox_font) +#: po/rc.cpp:36 rc.cpp:36 +msgid "Set font family" +msgstr "Укажите шрифт" + +#. i18n: file: appearance.ui:375 +#. i18n: ectx: property (text), widget (QLabel, label_activeIcon) +#: po/rc.cpp:39 rc.cpp:39 +msgid "Active icon" +msgstr "Иконка активного подключения" + +#. i18n: file: appearance.ui:408 +#. i18n: ectx: property (text), widget (QLabel, label_textAlign) +#: po/rc.cpp:45 rc.cpp:45 +msgid "Text align" +msgstr "Выравнивание текста" + +#. i18n: file: appearance.ui:440 +#. i18n: ectx: property (toolTip), widget (QComboBox, comboBox_textAlign) +#: po/rc.cpp:48 rc.cpp:48 +msgid "Set text align" +msgstr "Установите выравнивание текста" + +#. i18n: file: dataengine.ui:34 +#. i18n: ectx: property (text), widget (QLabel, label_netctl) +#. i18n: file: widget.ui:161 +#. 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:161 +#. 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:194 +#. 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:194 +#. 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 (QCheckBox, checkBox_extIp4) +#: po/rc.cpp:63 rc.cpp:63 +msgid "Check external IPv4" +msgstr "Проверять внешний IPv4" + +#. i18n: file: dataengine.ui:136 +#. i18n: ectx: property (text), widget (QCheckBox, checkBox_extIp6) +#: po/rc.cpp:69 rc.cpp:69 +msgid "Check external IPv6" +msgstr "Проверять внешний IPv6" + +#. i18n: file: widget.ui:34 +#. i18n: ectx: property (text), widget (QLabel, label_autoUpdate) +#: po/rc.cpp:75 rc.cpp:75 +msgid "Auto update interval, msec" +msgstr "Интервал автообновления, мсек" + +#. i18n: file: widget.ui:92 +#. i18n: ectx: property (text), widget (QLabel, label_gui) +#: po/rc.cpp:78 rc.cpp:78 +msgid "Path to GUI" +msgstr "Путь к GUI" + +#. i18n: file: widget.ui:125 +#. i18n: ectx: property (text), widget (QCheckBox, checkBox_helper) +#: po/rc.cpp:84 rc.cpp:84 +msgid "Use helper" +msgstr "Использовать хелпер" + +#. i18n: file: widget.ui:227 +#. 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:263 +#. 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:291 +#. 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:309 +#. i18n: ectx: property (toolTip), widget (QPlainTextEdit, textEdit) +#: po/rc.cpp:117 rc.cpp:117 +msgid "" +"$info - active profile information\n" +"$current - current profile name\n" +"$extip4 - external IPv4\n" +"$extip6 - external IPv6\n" +"$interfaces - list of the network interfaces\n" +"$intip4 - internal IPv4\n" +"$intip6 - internal IPv6\n" +"$profiles - list of the netctl profiles\n" +"$status - current profile status (static/enabled)" +msgstr "" +"$info - информация об активном профиле\n" +"$current - имя текущего профиля\n" +"$extip4 - внешний IPv4\n" +"$extip6 - внешний IPv6\n" +"$interfaces - список сетевых интерфейсов\n" +"$intip4 - внутренний IPv4\n" +"$intip6 - внутренний IPv6\n" +"$profiles - список профилей netctl\n" +"$status - статус текущего профиля (static/enabled)" + +#: po/rc.cpp:126 rc.cpp:126 +msgctxt "NAME OF TRANSLATORS" +msgid "Your names" +msgstr "Evgeniy Alekseev" + +#: po/rc.cpp:127 rc.cpp:127 +msgctxt "EMAIL OF TRANSLATORS" +msgid "Your emails" +msgstr "esalexeev@gmail.com" + +#~ msgid "Acknowledgement" +#~ msgstr "Благодарности" + +#~ msgid "normal" +#~ msgstr "normal" + +#~ msgid "italic" +#~ msgstr "italic" + +#~ msgid "Path to ip" +#~ msgstr "Путь к ip" + +#~ msgid "Path to interface list" +#~ msgstr "Путь к интерфейсам" + +#~ msgid "Show network devices" +#~ msgstr "Показать сетевые устройства" + +#~ msgid "Show external IP" +#~ msgstr "Показать внешний IP" + +#~ msgid "Show internal IP" +#~ msgstr "Показать внутренний IP" + +#~ msgid "Configuration" +#~ msgstr "Настройка" diff --git a/sources/version.h.in b/sources/version.h.in index fdf25c9..29fcd1d 100644 --- a/sources/version.h.in +++ b/sources/version.h.in @@ -31,6 +31,7 @@ #define PROJECT_BUILD_HELPER "@BUILD_HELPER@" #define PROJECT_BUILD_LIBRARY "@BUILD_LIBRARY@" #define PROJECT_BUILD_PLASMOID "@BUILD_PLASMOID@" +#cmakedefine BUILD_KDE4 // additional components #define PROJECT_BUILD_DOCS "@BUILD_DOCS@" #define PROJECT_BUILD_TEST "@BUILD_TEST@"