mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 23:47:21 +00:00
added notifications
This commit is contained in:
parent
cc2b3faf85
commit
c4c407542f
@ -1,5 +1,6 @@
|
||||
Ver.1.0.4:
|
||||
+ added Qt5 gui (by default)
|
||||
+ added notifications
|
||||
|
||||
Ver.1.0.3:
|
||||
+ [plasmoid] edited russian translation
|
||||
|
4
PKGBUILD
4
PKGBUILD
@ -8,7 +8,7 @@
|
||||
pkgname=netctl-gui
|
||||
pkgver=1.0.4
|
||||
pkgrel=1
|
||||
pkgdesc="Qt GUI for netctl. Provides a plasmoid for KDE4"
|
||||
pkgdesc="Qt4/Qt5 GUI for netctl. Provides a plasmoid for KDE4"
|
||||
arch=('i686' 'x86_64')
|
||||
url="http://arcanis.name/projects/netctl-gui"
|
||||
license=('GPLv3')
|
||||
@ -19,7 +19,7 @@ optdepends=('kdebase-runtime: sudo support'
|
||||
'wpa_supplicant: wifi support')
|
||||
source=("https://github.com/arcan1s/netctl-gui/releases/download/V.${pkgver}/${pkgname}-${pkgver}-src.tar.xz")
|
||||
install="${pkgname}.install"
|
||||
md5sums=('df44243e2dc1acf1536ab58be9af0081')
|
||||
md5sums=('6bb4897a9244cf5b9c2e45dff43c07b2')
|
||||
|
||||
# flags
|
||||
_cmakekeys="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
|
||||
|
@ -30,6 +30,8 @@ else ()
|
||||
message (STATUS "Unknown compiler")
|
||||
endif ()
|
||||
|
||||
add_subdirectory (icons)
|
||||
|
||||
if (BUILD_PLASMOID)
|
||||
set (BUILD_DATAENGINE ON)
|
||||
endif ()
|
||||
|
@ -47,7 +47,7 @@ Netctl::~Netctl()
|
||||
// delete startProfile;
|
||||
// delete stopProfile;
|
||||
// delete restartProfile;
|
||||
// delete enableProfileAutoload;
|
||||
// delete enableProfile;
|
||||
|
||||
// delete iconWidget;
|
||||
|
||||
@ -103,14 +103,18 @@ void Netctl::updateInterface(bool setShown)
|
||||
|
||||
|
||||
// context menu
|
||||
void Netctl::enableProfileAutoloadSlot()
|
||||
void Netctl::enableProfileSlot()
|
||||
{
|
||||
QProcess command;
|
||||
QString commandLine, enableStatus;
|
||||
if (info[QString("status")].contains(QString("enabled")))
|
||||
if (info[QString("status")].contains(QString("enabled"))) {
|
||||
enableStatus = QString(" disable ");
|
||||
else
|
||||
sendNotification(QString("Info"), i18n("Set profile %1 disabled", info[QString("name")]));
|
||||
}
|
||||
else {
|
||||
enableStatus = QString(" enable ");
|
||||
sendNotification(QString("Info"), i18n("Set profile %1 enabled", info[QString("name")]));
|
||||
}
|
||||
if (useSudo)
|
||||
commandLine = paths[QString("sudo")] + QString(" \"") + paths[QString("netctl")] +
|
||||
enableStatus + info[QString("name")] + QString("\"");
|
||||
@ -125,6 +129,7 @@ void Netctl::startProfileSlot(QAction *profile)
|
||||
QProcess command;
|
||||
QString commandLine;
|
||||
commandLine = QString("");
|
||||
sendNotification(QString("Info"), i18n("Start profile %1", profile->text().remove(QString("&"))));
|
||||
if (status)
|
||||
commandLine = paths[QString("netctl")] + QString(" stop ") +
|
||||
info[QString("name")] + QString(" && ");
|
||||
@ -143,6 +148,7 @@ void Netctl::stopProfileSlot()
|
||||
{
|
||||
QProcess command;
|
||||
QString commandLine;
|
||||
sendNotification(QString("Info"), i18n("Stop profile %1", info[QString("name")]));
|
||||
if (useSudo)
|
||||
commandLine = paths[QString("sudo")] + QString(" \"") + paths[QString("netctl")] +
|
||||
QString(" stop ") + info[QString("name")] + QString("\"");
|
||||
@ -156,6 +162,7 @@ void Netctl::restartProfileSlot()
|
||||
{
|
||||
QProcess command;
|
||||
QString commandLine;
|
||||
sendNotification(QString("Info"), i18n("Restart profile %1", info[QString("name")]));
|
||||
if (useSudo)
|
||||
commandLine = paths[QString("sudo")] + QString(" \"") + paths[QString("netctl")] +
|
||||
QString(" restart ") + info[QString("name")] + QString("\"");
|
||||
@ -173,17 +180,17 @@ QList<QAction*> Netctl::contextualActions()
|
||||
stopProfile->setText(i18n("Stop ") + info[QString("name")]);
|
||||
restartProfile->setVisible(true);
|
||||
restartProfile->setText(i18n("Restart ") + info[QString("name")]);
|
||||
enableProfileAutoload->setVisible(true);
|
||||
enableProfile->setVisible(true);
|
||||
if (info[QString("status")].contains(QString("enabled")))
|
||||
enableProfileAutoload->setText(i18n("Disable ") + info[QString("name")]);
|
||||
enableProfile->setText(i18n("Disable ") + info[QString("name")]);
|
||||
else
|
||||
enableProfileAutoload->setText(i18n("Enable ") + info[QString("name")]);
|
||||
enableProfile->setText(i18n("Enable ") + info[QString("name")]);
|
||||
}
|
||||
else {
|
||||
startProfile->setText(i18n("Start profile"));
|
||||
stopProfile->setVisible(false);
|
||||
restartProfile->setVisible(false);
|
||||
enableProfileAutoload->setVisible(false);
|
||||
enableProfile->setVisible(false);
|
||||
}
|
||||
|
||||
startProfileMenu->clear();
|
||||
@ -215,10 +222,9 @@ void Netctl::createActions()
|
||||
connect(restartProfile, SIGNAL(triggered(bool)), this, SLOT(restartProfileSlot()));
|
||||
menuActions.append(restartProfile);
|
||||
|
||||
enableProfileAutoload = new QAction(i18n("Enable profile"), this);
|
||||
connect(enableProfileAutoload, SIGNAL(triggered(bool)), this,
|
||||
SLOT(enableProfileAutoloadSlot()));
|
||||
menuActions.append(enableProfileAutoload);
|
||||
enableProfile = new QAction(i18n("Enable profile"), this);
|
||||
connect(enableProfile, SIGNAL(triggered(bool)), this, SLOT(enableProfileSlot()));
|
||||
menuActions.append(enableProfile);
|
||||
}
|
||||
|
||||
|
||||
@ -227,7 +233,7 @@ void Netctl::sendNotification(const QString eventId, const QString message)
|
||||
{
|
||||
KNotification *notification = new KNotification(eventId);
|
||||
notification->setComponentData(KComponentData("plasma_applet_netctl"));
|
||||
notification->setTitle(eventId);
|
||||
notification->setTitle(QString("Netctl ::: ") + eventId);
|
||||
notification->setText(message);
|
||||
notification->sendEvent();
|
||||
delete notification;
|
||||
@ -236,6 +242,7 @@ void Netctl::sendNotification(const QString eventId, const QString message)
|
||||
|
||||
void Netctl::showGui()
|
||||
{
|
||||
sendNotification(QString("Info"), i18n("Start GUI"));
|
||||
QProcess command;
|
||||
command.startDetached(paths[QString("gui")]);
|
||||
}
|
||||
@ -298,12 +305,16 @@ void Netctl::dataUpdated(const QString &sourceName, const Plasma::DataEngine::Da
|
||||
}
|
||||
else if (sourceName == QString("statusBool")) {
|
||||
if (value == QString("true")) {
|
||||
if (! status)
|
||||
sendNotification(QString("Info"), i18n("Network is up"));
|
||||
status = true;
|
||||
iconWidget->setIcon(paths[QString("active")]);
|
||||
}
|
||||
else {
|
||||
iconWidget->setIcon(paths[QString("inactive")]);
|
||||
if (status)
|
||||
sendNotification(QString("Info"), i18n("Network is down"));
|
||||
status = false;
|
||||
iconWidget->setIcon(paths[QString("inactive")]);
|
||||
}
|
||||
}
|
||||
else if (sourceName == QString("statusString")) {
|
||||
|
@ -60,7 +60,7 @@ private slots:
|
||||
void selectInactiveIcon();
|
||||
void selectNetctlExe();
|
||||
// context menu
|
||||
void enableProfileAutoloadSlot();
|
||||
void enableProfileSlot();
|
||||
void startProfileSlot(QAction *profile);
|
||||
void stopProfileSlot();
|
||||
void restartProfileSlot();
|
||||
@ -83,7 +83,7 @@ private:
|
||||
void createActions();
|
||||
QList<QAction*> menuActions;
|
||||
QMenu *startProfileMenu;
|
||||
QAction *enableProfileAutoload;
|
||||
QAction *enableProfile;
|
||||
QAction *startProfile;
|
||||
QAction *stopProfile;
|
||||
QAction *restartProfile;
|
||||
|
@ -6,8 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: http://kde-look.org/content/show.php?content=98925\n"
|
||||
"POT-Creation-Date: 2014-04-06 18:45+0400\n"
|
||||
"PO-Revision-Date: 2014-04-06 12:33+0400\n"
|
||||
"POT-Creation-Date: 2014-04-07 00:27+0400\n"
|
||||
"PO-Revision-Date: 2014-04-07 00:28+0400\n"
|
||||
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
|
||||
"Language-Team: Russian <kde-russian@lists.kde.ru>\n"
|
||||
"Language: ru\n"
|
||||
@ -18,43 +18,75 @@ msgstr ""
|
||||
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
"X-Generator: Lokalize 1.5\n"
|
||||
|
||||
#: netctl.cpp:171
|
||||
#: netctl.cpp:112
|
||||
msgid "Set profile %1 disabled"
|
||||
msgstr "Set profile %1 disabled"
|
||||
|
||||
#: netctl.cpp:116
|
||||
msgid "Set profile %1 enabled"
|
||||
msgstr "Set profile %1 enabled"
|
||||
|
||||
#: netctl.cpp:132
|
||||
msgid "Start profile %1"
|
||||
msgstr "Start profile %1"
|
||||
|
||||
#: netctl.cpp:151
|
||||
msgid "Stop profile %1"
|
||||
msgstr "Stop profile %1"
|
||||
|
||||
#: netctl.cpp:165
|
||||
msgid "Restart profile %1"
|
||||
msgstr "Restart profile %1"
|
||||
|
||||
#: netctl.cpp:178
|
||||
msgid "Start another profile"
|
||||
msgstr "Start another profile"
|
||||
|
||||
#: netctl.cpp:173
|
||||
#: netctl.cpp:180
|
||||
msgid "Stop "
|
||||
msgstr "Stop "
|
||||
|
||||
#: netctl.cpp:175
|
||||
#: netctl.cpp:182
|
||||
msgid "Restart "
|
||||
msgstr "Restart "
|
||||
|
||||
#: netctl.cpp:178
|
||||
#: netctl.cpp:185
|
||||
msgid "Disable "
|
||||
msgstr "Disable "
|
||||
|
||||
#: netctl.cpp:180
|
||||
#: netctl.cpp:187
|
||||
msgid "Enable "
|
||||
msgstr "Enable "
|
||||
|
||||
#: netctl.cpp:183 netctl.cpp:203
|
||||
#: netctl.cpp:190 netctl.cpp:210
|
||||
msgid "Start profile"
|
||||
msgstr "Start profile"
|
||||
|
||||
#: netctl.cpp:210
|
||||
#: netctl.cpp:217
|
||||
msgid "Stop profile"
|
||||
msgstr "Stop profile"
|
||||
|
||||
#: netctl.cpp:214
|
||||
#: netctl.cpp:221
|
||||
msgid "Restart profile"
|
||||
msgstr "Restart profile"
|
||||
|
||||
#: netctl.cpp:218
|
||||
#: netctl.cpp:225
|
||||
msgid "Enable profile"
|
||||
msgstr "Enable profile"
|
||||
|
||||
#: netctl.cpp:420
|
||||
#: netctl.cpp:245
|
||||
msgid "Start GUI"
|
||||
msgstr "Start GUI"
|
||||
|
||||
#: netctl.cpp:309
|
||||
msgid "Network is up"
|
||||
msgstr "Network is up"
|
||||
|
||||
#: netctl.cpp:315
|
||||
msgid "Network is down"
|
||||
msgstr "Network is down"
|
||||
|
||||
#: netctl.cpp:431
|
||||
msgid "Netctl plasmoid"
|
||||
msgstr "Netctl plasmoid"
|
||||
|
||||
@ -232,3 +264,4 @@ msgstr "Evgeniy Alekseev"
|
||||
msgctxt "EMAIL OF TRANSLATORS"
|
||||
msgid "Your emails"
|
||||
msgstr "esalexeev@gmail.com"
|
||||
|
||||
|
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: http://kde-look.org/content/show.php?content=98925\n"
|
||||
"POT-Creation-Date: 2014-04-06 18:45+0400\n"
|
||||
"POT-Creation-Date: 2014-04-07 00:27+0400\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -17,43 +17,75 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: netctl.cpp:171
|
||||
msgid "Start another profile"
|
||||
#: netctl.cpp:112
|
||||
msgid "Set profile %1 disabled"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:173
|
||||
msgid "Stop "
|
||||
#: netctl.cpp:116
|
||||
msgid "Set profile %1 enabled"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:175
|
||||
msgid "Restart "
|
||||
#: netctl.cpp:132
|
||||
msgid "Start profile %1"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:151
|
||||
msgid "Stop profile %1"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:165
|
||||
msgid "Restart profile %1"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:178
|
||||
msgid "Disable "
|
||||
msgid "Start another profile"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:180
|
||||
msgid "Stop "
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:182
|
||||
msgid "Restart "
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:185
|
||||
msgid "Disable "
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:187
|
||||
msgid "Enable "
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:183 netctl.cpp:203
|
||||
#: netctl.cpp:190 netctl.cpp:210
|
||||
msgid "Start profile"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:210
|
||||
#: netctl.cpp:217
|
||||
msgid "Stop profile"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:214
|
||||
#: netctl.cpp:221
|
||||
msgid "Restart profile"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:218
|
||||
#: netctl.cpp:225
|
||||
msgid "Enable profile"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:420
|
||||
#: netctl.cpp:245
|
||||
msgid "Start GUI"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:309
|
||||
msgid "Network is up"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:315
|
||||
msgid "Network is down"
|
||||
msgstr ""
|
||||
|
||||
#: netctl.cpp:431
|
||||
msgid "Netctl plasmoid"
|
||||
msgstr ""
|
||||
|
||||
|
@ -6,8 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: http://kde-look.org/content/show.php?content=98925\n"
|
||||
"POT-Creation-Date: 2014-04-06 18:45+0400\n"
|
||||
"PO-Revision-Date: 2014-04-06 12:32+0400\n"
|
||||
"POT-Creation-Date: 2014-04-07 00:27+0400\n"
|
||||
"PO-Revision-Date: 2014-04-07 00:28+0400\n"
|
||||
"Last-Translator: Evgeniy Alekseev <esalexeev@gmail.com>\n"
|
||||
"Language-Team: Russian <kde-russian@lists.kde.ru>\n"
|
||||
"Language: ru\n"
|
||||
@ -18,43 +18,75 @@ msgstr ""
|
||||
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
"X-Generator: Lokalize 1.5\n"
|
||||
|
||||
#: netctl.cpp:171
|
||||
#: netctl.cpp:112
|
||||
msgid "Set profile %1 disabled"
|
||||
msgstr "Выключение автозагрузки профиля %1"
|
||||
|
||||
#: netctl.cpp:116
|
||||
msgid "Set profile %1 enabled"
|
||||
msgstr "Включение автозагрузки профиля %1"
|
||||
|
||||
#: netctl.cpp:132
|
||||
msgid "Start profile %1"
|
||||
msgstr "Запуск профиля %1"
|
||||
|
||||
#: netctl.cpp:151
|
||||
msgid "Stop profile %1"
|
||||
msgstr "Остановка профиля %1"
|
||||
|
||||
#: netctl.cpp:165
|
||||
msgid "Restart profile %1"
|
||||
msgstr "Перезапуск профиля %1"
|
||||
|
||||
#: netctl.cpp:178
|
||||
msgid "Start another profile"
|
||||
msgstr "Запустить другой профиль"
|
||||
|
||||
#: netctl.cpp:173
|
||||
#: netctl.cpp:180
|
||||
msgid "Stop "
|
||||
msgstr "Остановить "
|
||||
|
||||
#: netctl.cpp:175
|
||||
#: netctl.cpp:182
|
||||
msgid "Restart "
|
||||
msgstr "Перезапустить "
|
||||
|
||||
#: netctl.cpp:178
|
||||
#: netctl.cpp:185
|
||||
msgid "Disable "
|
||||
msgstr "Отключить "
|
||||
|
||||
#: netctl.cpp:180
|
||||
#: netctl.cpp:187
|
||||
msgid "Enable "
|
||||
msgstr "Включить "
|
||||
|
||||
#: netctl.cpp:183 netctl.cpp:203
|
||||
#: netctl.cpp:190 netctl.cpp:210
|
||||
msgid "Start profile"
|
||||
msgstr "Запустить профиль"
|
||||
|
||||
#: netctl.cpp:210
|
||||
#: netctl.cpp:217
|
||||
msgid "Stop profile"
|
||||
msgstr "Остановить профиль"
|
||||
|
||||
#: netctl.cpp:214
|
||||
#: netctl.cpp:221
|
||||
msgid "Restart profile"
|
||||
msgstr "Перезапустить профиль"
|
||||
|
||||
#: netctl.cpp:218
|
||||
#: netctl.cpp:225
|
||||
msgid "Enable profile"
|
||||
msgstr "Включить профиль"
|
||||
|
||||
#: netctl.cpp:420
|
||||
#: netctl.cpp:245
|
||||
msgid "Start GUI"
|
||||
msgstr "Запуск GUI"
|
||||
|
||||
#: netctl.cpp:309
|
||||
msgid "Network is up"
|
||||
msgstr "Сеть работает"
|
||||
|
||||
#: netctl.cpp:315
|
||||
msgid "Network is down"
|
||||
msgstr "Сеть не работает"
|
||||
|
||||
#: netctl.cpp:431
|
||||
msgid "Netctl plasmoid"
|
||||
msgstr "Netctl plasmoid"
|
||||
|
||||
@ -232,3 +264,4 @@ msgstr "Evgeniy Alekseev"
|
||||
msgctxt "EMAIL OF TRANSLATORS"
|
||||
msgid "Your emails"
|
||||
msgstr "esalexeev@gmail.com"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user