diff --git a/PKGBUILD b/PKGBUILD index dd4d02a..c9264bc 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -9,7 +9,7 @@ pkgver=1.0.0 pkgrel=1 pkgdesc="Qt4 GUI for netctl. Provides a plasmoid for KDE4" arch=('i686' 'x86_64') -url="http://arcan1s.github.io/projects/netctlplasmoid" +url="http://arcanis.name/projects/netctl-gui" license=('GPLv3') depends=('netctl' 'qt4') makedepends=('automoc4' 'cmake' 'desktop-file-utils' 'xdg-utils') @@ -18,7 +18,7 @@ optdepends=('kdebase-runtime: sudo support' 'wpa_supplicant: wifi support') source=("https://github.com/arcan1s/netctlplasmoid/releases/download/V.${pkgver}/${pkgname}-${pkgver}-src.tar.xz") install="${pkgname}.install" -md5sums=('866d6b7b819a43f1661ef133f3b255da') +md5sums=('5e7573643d528f770fca2dc3e2122e69') # flags _cmakekeys="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release" diff --git a/sources/CMakeLists.txt b/sources/CMakeLists.txt index 410797d..689042a 100644 --- a/sources/CMakeLists.txt +++ b/sources/CMakeLists.txt @@ -15,19 +15,12 @@ configure_file (${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/ver message (STATUS "Version: ${PROJECT_VERSION}") # install options -option (WITH_DEBUG_MODE "Build with debug mode" OFF) option (BUILD_GUI "Build GUI" ON) option (BUILD_DATAENGINE "Build data engine" ON) option (BUILD_PLASMOID "Build plasmoid" ON) option (BUILD_SCRIPTS "Build special scripts" ON) -# verbose -set (CMAKE_VERBOSE_MAKEFILE ON) - # flags -if (WITH_DEBUG_MODE) - add_definitions (-DDEBUG_MODE=1) -endif () if (CMAKE_COMPILER_IS_GNUCXX) set (ADD_CXX_FLAGS "-Wall") set (CMAKE_CXX_FLAGS "-O0 ${ADD_CXX_FLAGS}") diff --git a/sources/dataengine/netctl.cpp b/sources/dataengine/netctl.cpp index 3897122..9dcff79 100644 --- a/sources/dataengine/netctl.cpp +++ b/sources/dataengine/netctl.cpp @@ -206,9 +206,9 @@ bool Netctl::updateSourceEvent(const QString &source) QStringList profile = cmdOutput.split(QString("\n"), QString::SkipEmptyParts); for (int i=0; i -1) + if (profile[i].contains(QString("enabled"))) value = QString("enabled"); - else if (profile[i].indexOf(QString("static")) > -1) + else if (profile[i].contains(QString("static"))) value = QString("static"); break; } diff --git a/sources/plasmoid/netctl.cpp b/sources/plasmoid/netctl.cpp index 99b573a..1c033d1 100644 --- a/sources/plasmoid/netctl.cpp +++ b/sources/plasmoid/netctl.cpp @@ -71,34 +71,31 @@ void Netctl::init() iconFrame = new Plasma::Frame(); QGraphicsLinearLayout *iconLayout = new QGraphicsLinearLayout(); iconWidget = new Plasma::IconWidget(KIcon(""), QString(), this); + iconWidget->setPreferredWidth(30); + iconWidget->setPreferredHeight(30); + iconWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum); connect(iconWidget, SIGNAL(doubleClicked()), this, SLOT(showGui())); iconFrame->setLayout(iconLayout); iconLayout->addItem(iconWidget); fullSpaceLayout->addItem(iconFrame); + // text + textFrame = new Plasma::Frame(); + QGraphicsLinearLayout *textLayout = new QGraphicsLinearLayout(); + textLabel = new Plasma::Label(); + textLabel->setPreferredHeight(30); + textLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); + textLayout->addItem(textLabel); + textFrame->setLayout(textLayout); + fullSpaceLayout->addItem(textFrame); + textFrame->hide(); + // stretch + fullSpaceLayout->addStretch(1); // read variables configChanged(); } -void Netctl::addTextFrame(const bool state) -{ - if (state) { - textFrame = new Plasma::Frame(); - QGraphicsLinearLayout *textLayout = new QGraphicsLinearLayout(); - textLabel = new Plasma::Label(); - textLayout->addItem(textLabel); - textFrame->setLayout(textLayout); - fullSpaceLayout->addItem(textFrame); - } - else { - fullSpaceLayout->removeItem(textFrame); - delete textLabel; - delete textFrame; - } -} - - void Netctl::updateWidget() { update(); @@ -251,7 +248,7 @@ void Netctl::connectToEngine() netctlEngine->connectSource(QString("intIp"), this, autoUpdateInterval); if (showNetDev) netctlEngine->connectSource(QString("interfaces"), this, autoUpdateInterval); - addTextFrame(true); + textFrame->show(); } updateWidget(); } @@ -270,7 +267,7 @@ void Netctl::disconnectFromEngine() netctlEngine->disconnectSource(QString("intIp"), this); if (showNetDev) netctlEngine->disconnectSource(QString("interfaces"), this); - addTextFrame(false); + textFrame->hide(); } updateWidget(); } diff --git a/sources/plasmoid/netctl.h b/sources/plasmoid/netctl.h index e156bd4..8737828 100644 --- a/sources/plasmoid/netctl.h +++ b/sources/plasmoid/netctl.h @@ -53,7 +53,6 @@ public slots: private slots: // main interface - void addTextFrame(const bool state = true); void updateWidget(); // configuration interface void selectGuiExe();