mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 23:47:21 +00:00
small fixes before editing plasmoid
This commit is contained in:
parent
996d2d5bee
commit
682b6c5b4f
9
PKGBUILD
9
PKGBUILD
@ -18,21 +18,18 @@ optdepends=('kdebase-runtime: sudo support'
|
|||||||
'wpa_supplicant: wifi support')
|
'wpa_supplicant: wifi support')
|
||||||
source=("https://github.com/arcan1s/netctlplasmoid/releases/download/V.${pkgver}/${pkgname}-${pkgver}-src.tar.xz")
|
source=("https://github.com/arcan1s/netctlplasmoid/releases/download/V.${pkgver}/${pkgname}-${pkgver}-src.tar.xz")
|
||||||
install="${pkgname}.install"
|
install="${pkgname}.install"
|
||||||
md5sums=('5e7573643d528f770fca2dc3e2122e69')
|
md5sums=('866d6b7b819a43f1661ef133f3b255da')
|
||||||
|
|
||||||
# flags
|
# flags
|
||||||
_cmakekeys="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
|
_cmakekeys="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
|
||||||
[[ ${_build_gui} == 0 ]] && _cmakekeys=${_cmakekeys}" -DBUILD_GUI:BOOL=0"
|
[[ ${_build_gui} == 0 ]] && _cmakekeys=${_cmakekeys}" -DBUILD_GUI:BOOL=0"
|
||||||
[[ ${_build_plasmoid} == 0 ]] && _cmakekeys=${_cmakekeys}" -DBUILD_DATAENGINE:BOOL=0 -DBUILD_PLASMOID:BOOL=0" || depends[1]='kdebase-workspace'
|
[[ ${_build_plasmoid} == 0 ]] && _cmakekeys=${_cmakekeys}" -DBUILD_DATAENGINE:BOOL=0 -DBUILD_PLASMOID:BOOL=0" || depends[1]='kdebase-workspace'
|
||||||
|
|
||||||
prepare() {
|
build() {
|
||||||
rm -rf "${srcdir}/build"
|
rm -rf "${srcdir}/build"
|
||||||
mkdir "${srcdir}/build"
|
mkdir "${srcdir}/build"
|
||||||
}
|
|
||||||
|
|
||||||
build () {
|
|
||||||
cd "${srcdir}/build"
|
cd "${srcdir}/build"
|
||||||
cmake ${_cmakekeys} ../${pkgname}
|
cmake ${_cmakekeys} "../${pkgname}"
|
||||||
make
|
make
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
set (ADD_CXX_FLAGS "-Wall")
|
set (ADD_CXX_FLAGS "-Wall")
|
||||||
set (CMAKE_CXX_FLAGS "-O0 ${ADD_CXX_FLAGS}")
|
set (CMAKE_CXX_FLAGS "-O0 ${ADD_CXX_FLAGS}")
|
||||||
set (CMAKE_CXX_FLAGS_DEBUG "-g -O0")
|
set (CMAKE_CXX_FLAGS_DEBUG "-g -O0")
|
||||||
set (CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
|
set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
|
||||||
else ()
|
else ()
|
||||||
message (STATUS "Unknown compiler")
|
message (STATUS "Unknown compiler")
|
||||||
endif ()
|
endif ()
|
||||||
|
@ -7,7 +7,7 @@ find_package (KDE4 REQUIRED)
|
|||||||
include (KDE4Defaults)
|
include (KDE4Defaults)
|
||||||
|
|
||||||
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
|
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
|
||||||
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}/../)
|
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../)
|
||||||
|
|
||||||
set (PLUGIN_NAME ${SUBPROJECT})
|
set (PLUGIN_NAME ${SUBPROJECT})
|
||||||
file (GLOB SUBPROJECT_DESKTOP_IN *.desktop)
|
file (GLOB SUBPROJECT_DESKTOP_IN *.desktop)
|
||||||
|
@ -71,9 +71,7 @@ bool Netctl::readConfiguration()
|
|||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
fileStr = QString(confFile.readLine());
|
fileStr = QString(confFile.readLine());
|
||||||
if (confFile.atEnd())
|
if (fileStr[0] != '#') {
|
||||||
break;
|
|
||||||
else if (fileStr[0] != '#') {
|
|
||||||
if (fileStr.split(QString("="), QString::SkipEmptyParts).count() == 2) {
|
if (fileStr.split(QString("="), QString::SkipEmptyParts).count() == 2) {
|
||||||
if (fileStr.split(QString("="), QString::SkipEmptyParts)[0] == QString("EXTIP"))
|
if (fileStr.split(QString("="), QString::SkipEmptyParts)[0] == QString("EXTIP"))
|
||||||
checkExtIP = fileStr.split(QString("="), QString::SkipEmptyParts)[1].split(QString("\n"), QString::SkipEmptyParts)[0];
|
checkExtIP = fileStr.split(QString("="), QString::SkipEmptyParts)[1].split(QString("\n"), QString::SkipEmptyParts)[0];
|
||||||
@ -87,6 +85,8 @@ bool Netctl::readConfiguration()
|
|||||||
netDir = fileStr.split(QString("="), QString::SkipEmptyParts)[1].split(QString("\n"), QString::SkipEmptyParts)[0];
|
netDir = fileStr.split(QString("="), QString::SkipEmptyParts)[1].split(QString("\n"), QString::SkipEmptyParts)[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (confFile.atEnd())
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
confFile.close();
|
confFile.close();
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include <Plasma/DataEngine>
|
#include <Plasma/DataEngine>
|
||||||
|
|
||||||
|
|
||||||
class Netctl : public Plasma::DataEngine
|
class Netctl : public Plasma::DataEngine
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -33,6 +34,7 @@ protected:
|
|||||||
bool updateSourceEvent(const QString &source);
|
bool updateSourceEvent(const QString &source);
|
||||||
QStringList sources() const;
|
QStringList sources() const;
|
||||||
|
|
||||||
|
private:
|
||||||
// configuration
|
// configuration
|
||||||
// enable check external IP
|
// enable check external IP
|
||||||
QString checkExtIP;
|
QString checkExtIP;
|
||||||
@ -46,4 +48,5 @@ protected:
|
|||||||
QString netDir;
|
QString netDir;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* NETCTL_DE_H */
|
#endif /* NETCTL_DE_H */
|
||||||
|
0
sources/gui/netctl-gui.desktop
Executable file → Normal file
0
sources/gui/netctl-gui.desktop
Executable file → Normal file
@ -7,7 +7,7 @@ find_package (KDE4 REQUIRED)
|
|||||||
include (KDE4Defaults)
|
include (KDE4Defaults)
|
||||||
|
|
||||||
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
|
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
|
||||||
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}/../)
|
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../)
|
||||||
|
|
||||||
# set sources
|
# set sources
|
||||||
set (PLUGIN_NAME ${SUBPROJECT})
|
set (PLUGIN_NAME ${SUBPROJECT})
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
#include "netctl.h"
|
#include "netctl.h"
|
||||||
#include "ui_configwindow.h"
|
#include "ui_configwindow.h"
|
||||||
#include <version.h>
|
|
||||||
|
|
||||||
#include <KConfigDialog>
|
#include <KConfigDialog>
|
||||||
#include <KFileDialog>
|
#include <KFileDialog>
|
||||||
@ -27,11 +26,12 @@
|
|||||||
|
|
||||||
#include <QGraphicsLinearLayout>
|
#include <QGraphicsLinearLayout>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <cstdio>
|
|
||||||
|
#include <version.h>
|
||||||
|
|
||||||
|
|
||||||
Netctl::Netctl(QObject *parent, const QVariantList &args) :
|
Netctl::Netctl(QObject *parent, const QVariantList &args)
|
||||||
Plasma::Applet(parent, args)
|
: Plasma::Applet(parent, args)
|
||||||
{
|
{
|
||||||
setBackgroundHints(DefaultBackground);
|
setBackgroundHints(DefaultBackground);
|
||||||
setHasConfigurationInterface(true);
|
setHasConfigurationInterface(true);
|
||||||
@ -463,8 +463,8 @@ void Netctl::configChanged()
|
|||||||
fontColor = cg.readEntry("fontColor", "#000000");
|
fontColor = cg.readEntry("fontColor", "#000000");
|
||||||
fontWeight = cg.readEntry("fontWeight", 400);
|
fontWeight = cg.readEntry("fontWeight", 400);
|
||||||
fontStyle = cg.readEntry("fontStyle", "normal");
|
fontStyle = cg.readEntry("fontStyle", "normal");
|
||||||
activeIconPath = cg.readEntry("activeIconPath", "/usr/share/icons/hicolor/64x64/apps/network-idle.png");
|
activeIconPath = cg.readEntry("activeIconPath", "/usr/share/icons/hicolor/64x64/apps/netctl-idle.png");
|
||||||
inactiveIconPath = cg.readEntry("inactiveIconPath", "/usr/share/icons/hicolor/64x64/apps/network-offline.png");
|
inactiveIconPath = cg.readEntry("inactiveIconPath", "/usr/share/icons/hicolor/64x64/apps/netctl-offline.png");
|
||||||
|
|
||||||
formatLine[0] = ("<p align=\"center\"><span style=\" font-family:'" + fontFamily + \
|
formatLine[0] = ("<p align=\"center\"><span style=\" font-family:'" + fontFamily + \
|
||||||
"'; font-style:" + fontStyle + \
|
"'; font-style:" + fontStyle + \
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include <ui_configwindow.h>
|
#include <ui_configwindow.h>
|
||||||
|
|
||||||
|
|
||||||
class QGraphicsLinearLayout;
|
class QGraphicsLinearLayout;
|
||||||
|
|
||||||
class Netctl : public Plasma::Applet
|
class Netctl : public Plasma::Applet
|
||||||
@ -96,7 +97,7 @@ private:
|
|||||||
void connectToEngine();
|
void connectToEngine();
|
||||||
void disconnectFromEngine();
|
void disconnectFromEngine();
|
||||||
// notification
|
// notification
|
||||||
|
//
|
||||||
// configuration interface
|
// configuration interface
|
||||||
Ui::ConfigWindow uiConfig;
|
Ui::ConfigWindow uiConfig;
|
||||||
// configuration
|
// configuration
|
||||||
@ -120,4 +121,5 @@ private:
|
|||||||
|
|
||||||
K_EXPORT_PLASMA_APPLET(netctl, Netctl)
|
K_EXPORT_PLASMA_APPLET(netctl, Netctl)
|
||||||
|
|
||||||
|
|
||||||
#endif /* NETCTL_PLASMOID_H */
|
#endif /* NETCTL_PLASMOID_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user