Commit aedd8cc1 authored by Jan Grulich's avatar Jan Grulich
Browse files

Merge branch master

parents 26abf446 ad87480a
project(plasma-nm)
project(plasma-networkmanagement)
cmake_minimum_required(VERSION 2.6)
......@@ -8,10 +8,23 @@ find_package(NetworkManager "0.9.8" REQUIRED)
include(FindPkgConfig)
include(KDE4Defaults)
pkg_check_modules(MODEMMANAGERQT REQUIRED ModemManagerQt)
if (NOT MODEMMANAGERQT_FOUND)
message(FATAL_ERROR "ERROR: ModemManagerQt not found. http://projects.kde.org/libmm-qt")
endif (NOT MODEMMANAGERQT_FOUND)
if (DISABLE_MODEMMANAGER_SUPPORT)
message(STATUS "Disabling ModemManager support")
set(WITH_MODEMMANAGER_SUPPORT 0)
else()
pkg_check_modules(MODEMMANAGERQT ModemManagerQt)
if (MODEMMANAGERQT_FOUND)
message(STATUS "Enabling ModemManager support")
set(WITH_MODEMMANAGER_SUPPORT 1)
if (${MODEMMANAGERQT_VERSION} VERSION_GREATER 0.7.990)
set(MODEMMANAGERQT_ONE 1)
endif()
else()
message(STATUS "ModemManagerQt not found")
set(WITH_MODEMMANAGER_SUPPORT 0)
endif()
endif()
pkg_check_modules(NETWORKMANAGERQT REQUIRED NetworkManagerQt)
if (NOT NETWORKMANAGERQT_FOUND)
......@@ -20,7 +33,6 @@ endif (NOT NETWORKMANAGERQT_FOUND)
set(KDE_NETWORK_VERSION "0.9.3.1")
set(PLASMA_NM_VERSION "0.9.3.1")
set(MODEMMANAGERQT_VERSION ${MODEMMANAGERQT_VERSION})
configure_file(config.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config.h )
......@@ -33,6 +45,7 @@ pkg_check_modules(QTNETWORK REQUIRED QtNetwork)
pkg_check_modules(NETWORKMANAGER REQUIRED NetworkManager)
add_definitions(
-DWITH_MODEMMANAGER_SUPPORT=${WITH_MODEMMANAGER_SUPPORT}
${QT_DEFINITIONS}
${KDE_DEFINITIONS}
${NETWORKMANAGERQT_CFLAGS_OTHER}
......@@ -45,7 +58,10 @@ include_directories(${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/lib
${CMAKE_CURRENT_SOURCE_DIR}/lib/editor
${QTNETWORK_INCLUDE_DIRS}
${MODEMMANAGERQT_INCLUDE_DIRS}
${MODEMMANAGER_INCLUDE_DIRS}
if (MODEMMANAGERQT_FOUND)
${MODEMMANAGERQT_INCLUDE_DIRS}
endif()
${NETWORKMANAGERQT_INCLUDE_DIRS}
${NETWORKMANAGER_INCLUDE_DIRS}
${KDE4_INCLUDES})
......
#!/usr/bin/env bash
$EXTRACTRC `find declarative-plugins -name '*.ui' -o -name '*.rc'` `find settings/details -name '*.ui' -o -name '*.rc'` >> rc.cpp
$XGETTEXT rc.cpp `find applet -name '*.cpp'` `find declarative-plugins -name '*.cpp'` `find lib -name '*.cpp' | grep -v 'lib/editor'` `find settings/details -name '*.cpp'` -o $podir/plasma_applet_org.kde.plasma-nm.pot
$XGETTEXT `find applet -name '*.qml'` -j -L Java -o $podir/plasma_applet_org.kde.plasma-nm.pot
$EXTRACTRC `find declarative-plugins -name '*.ui' -o -name '*.rc'` `find settings/details -name '*.ui' -o -name '*.rc'` `find applet -name '*.ui'` >> rc.cpp
$XGETTEXT rc.cpp `find applet -name '*.cpp'` `find declarative-plugins -name '*.cpp'` `find lib -name '*.cpp' | grep -v 'lib/editor'` `find settings/details -name '*.cpp'` -o $podir/plasma_applet_org.kde.networkmanagement.pot
$XGETTEXT `find applet -name '*.qml'` -j -L Java -o $podir/plasma_applet_org.kde.networkmanagement.pot
rm -f rc.cpp
Plasma-nm
========================
Plasma applet written in QML for managing network connections
Dependencies:
-------------
- libnm-qt (NM/0.9 branch)
→ requires NetworkManager 0.9.8+
Optional dependencies:
---------------------
- libmm-qt (MM/0.5 branch)
→ requires ModemManager 0.5 - 0.6 (ModemManager 0.7+ is not supported yet)
Plasma-nm is compiled with ModemManager support by default when libmm-qt is found,
when you want to explicitly disable ModemManager support, use -DDISABLE_MODEMMANAGER_SUPPORT=true cmake parameter.
Compiling:
----------
mkdir build
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr [-DDISABLE_MODEMMANAGER_SUPPORT=true]
make
# As root:
make install
BUGS:
-----
Submit bugs and feature requests to KDE bugzilla, product plasma-nm:
https://bugs.kde.org/describecomponents.cgi?product=plasma-nm
NetworkManager specification:
------------------------------
http://projects.gnome.org/NetworkManager/developers/api/09/spec.html
http://projects.gnome.org/NetworkManager/developers/api/09/ref-settings.html
......@@ -14,7 +14,7 @@ set(networksettings_SRCS
kde4_add_plugin(active_settings_network ${networksettings_SRCS})
target_link_libraries(active_settings_network
NetworkManagerQt
plasmanm-internal
plasmanetworkmanagement-internal
${KDE4_PLASMA_LIBS}
${QT_QTNETWORK_LIBRARY}
${KDE4_KDEUI_LIBS}
......
......@@ -20,7 +20,7 @@
import QtQuick 1.1
import org.kde.plasma.components 0.1 as PlasmaComponents
import org.kde.plasmanm 0.1 as PlasmaNm
import org.kde.networkmanagement 0.1 as PlasmaNm
import org.kde.active.settings 0.1
Item {
......
......@@ -22,7 +22,7 @@ import QtQuick 1.1
import org.kde.qtextracomponents 0.1
import org.kde.plasma.components 0.1 as PlasmaComponents
import org.kde.plasma.core 0.1 as PlasmaCore
import org.kde.plasmanm 0.1 as PlasmaNm
import org.kde.networkmanagement 0.1 as PlasmaNm
Item {
property alias checked: connectionItem.checked;
......@@ -44,8 +44,8 @@ Item {
right: parent.right;
}
color: "green";
opacity: itemConnected ? 0.2 : 0.1;
visible: itemConnected || itemConnecting;
opacity: itemConnectionState == PlasmaNm.Enums.Activated ? 0.2 : 0.1;
visible: itemConnectionState == PlasmaNm.Enums.Activated || itemConnectionState == PlasmaNm.Enums.Activating;
}
PlasmaComponents.ListItem {
......@@ -62,7 +62,7 @@ Item {
id: svgIcons;
multipleImages: true;
imagePath: "icons/plasma-nm";
imagePath: "icons/plasma-networkmanagement";
}
Item {
......@@ -119,7 +119,7 @@ Item {
width: 48;
height: 48;
icon: QIcon("object-locked");
visible: itemSecure;
visible: itemSecurityType != PlasmaNm.Enums.None;
}
PlasmaComponents.Label {
......
......@@ -20,7 +20,7 @@
import QtQuick 1.1
import org.kde.plasma.components 0.1 as PlasmaComponents
import org.kde.plasmanm 0.1 as PlasmaNm
import org.kde.networkmanagement 0.1 as PlasmaNm
import org.kde.active.settings 0.1
Item {
......@@ -91,7 +91,7 @@ Item {
rightMargin: 5;
}
text: if (selectedItemModel) {
if (selectedItemModel.itemConnected || selectedItemModel.itemConnecting) {
if (selectedItemModel.itemConnectionState == PlasmaNm.Enums.Activated || selectedItemModel.itemConnectionState == PlasmaNm.Enums.Activating) {
i18n("Disconnect");
} else {
i18n("Connect");
......@@ -111,7 +111,7 @@ Item {
onClicked: {
if (selectedItemModel) {
if (!selectedItemModel.itemConnected && !selectedItemModel.itemConnecting) {
if (selectedItemModel.itemConnectionState != PlasmaNm.Enums.Activated && selectedItemModel.itemConnectionState != PlasmaNm.Enums.Activating) {
if (selectedItemModel.itemUuid) {
handler.activateConnection(selectedItemModel.itemConnectionPath, selectedItemModel.itemDevicePath, selectedItemModel.itemSpecificPath);
} else {
......@@ -120,7 +120,7 @@ Item {
connectionSettingsHandler.addAndActivateConnection(map, selectedItemModel.itemDevicePath, selectedItemModel.itemSpecificPath);
}
} else {
handler.deactivateConnection(selectedItemModel.itemConnectionPath);
handler.deactivateConnection(selectedItemModel.itemConnectionPath, selectedItemModel.itemDevicePath);
}
}
}
......@@ -165,7 +165,7 @@ Item {
var wirelessMap = [];
wirelessMap["ssid"] = selectedItemModel.itemSsid;
var wirelessSecurityMap = [];
if (selectedItemModel.itemSecure) {
if (selectedItemModel.itemSecurityType != PlasmaNm.Enums.None) {
// StaticWep
if (selectedItemModel.itemSecurityType == PlasmaNm.Enums.StaticWep) {
wirelessSecurityMap["key-mgmt"] = "none";
......
......@@ -21,7 +21,7 @@
import QtQuick 1.1
import org.kde.plasma.components 0.1 as PlasmaComponents
import org.kde.plasma.extras 0.1 as PlasmaExtras
import org.kde.plasmanm 0.1 as PlasmaNm
import org.kde.networkmanagement 0.1 as PlasmaNm
Item {
id: gsmSettingWidget;
......
......@@ -20,7 +20,7 @@
import QtQuick 1.1
import org.kde.plasma.extras 0.1 as PlasmaExtras
import org.kde.plasmanm 0.1 as PlasmaNm
import org.kde.networkmanagement 0.1 as PlasmaNm
PlasmaExtras.ScrollArea {
......
......@@ -21,7 +21,7 @@
import QtQuick 1.1
import org.kde.plasma.components 0.1 as PlasmaComponents
import org.kde.plasma.extras 0.1 as PlasmaExtras
import org.kde.plasmanm 0.1 as PlasmaNm
import org.kde.networkmanagement 0.1 as PlasmaNm
Item {
id: ipv4SettingWidget;
......
......@@ -25,7 +25,7 @@ import org.kde.plasma.extras 0.1 as PlasmaExtras
import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets
import org.kde.plasma.mobilecomponents 0.1 as MobileComponents
import org.kde.active.settings 0.1
import org.kde.plasmanm 0.1 as PlasmaNm
import org.kde.networkmanagement 0.1 as PlasmaNm
Item {
id: networkModule;
......
......@@ -20,7 +20,7 @@
import QtQuick 1.1
import org.kde.plasma.extras 0.1 as PlasmaExtras
import org.kde.plasmanm 0.1 as PlasmaNm
import org.kde.networkmanagement 0.1 as PlasmaNm
PlasmaExtras.ScrollArea {
......
......@@ -21,7 +21,7 @@
import QtQuick 1.1
import org.kde.plasma.components 0.1 as PlasmaComponents
import org.kde.plasma.extras 0.1 as PlasmaExtras
import org.kde.plasmanm 0.1 as PlasmaNm
import org.kde.networkmanagement 0.1 as PlasmaNm
Item {
id: wirelessSecuritySettingWidget;
......
......@@ -21,7 +21,7 @@
import QtQuick 1.1
import org.kde.plasma.components 0.1 as PlasmaComponents
import org.kde.plasma.extras 0.1 as PlasmaExtras
import org.kde.plasmanm 0.1 as PlasmaNm
import org.kde.networkmanagement 0.1 as PlasmaNm
Item {
id: wirelessSettingWidget;
......
......@@ -20,7 +20,7 @@
import QtQuick 1.1
import org.kde.plasma.extras 0.1 as PlasmaExtras
import org.kde.plasmanm 0.1 as PlasmaNm
import org.kde.networkmanagement 0.1 as PlasmaNm
PlasmaExtras.ScrollArea {
......
......@@ -2,7 +2,8 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/declarative/metadata.desktop.cmake
${CMAKE_CURRENT_BINARY_DIR}/declarative/metadata.desktop
@ONLY)
install(DIRECTORY declarative/contents DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.plasma-nm)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/declarative/metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.plasma-nm)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/declarative/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME plasma-applet-nm.desktop)
install(FILES icons/plasma-nm.svgz DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/default/icons/)
install(DIRECTORY declarative/contents DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.networkmanagement)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/declarative/metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.networkmanagement)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/declarative/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME plasma-applet-networkmanagement.desktop)
add_subdirectory(icons)
\ No newline at end of file
......@@ -22,7 +22,7 @@ import QtQuick 1.1
import org.kde.qtextracomponents 0.1
import org.kde.plasma.core 0.1 as PlasmaCore
import org.kde.plasma.components 0.1 as PlasmaComponents
import org.kde.plasmanm 0.1 as PlasmaNm
import org.kde.networkmanagement 0.1 as PlasmaNM
Item {
id: panelIconWidget;
......@@ -31,7 +31,7 @@ Item {
id: svgIcons;
multipleImages: true;
imagePath: "icons/plasma-nm";
imagePath: "icons/plasma-networkmanagement";
}
PlasmaCore.SvgItem {
......@@ -69,7 +69,7 @@ Item {
visible: running;
}
PlasmaNm.NetworkStatus {
PlasmaNM.NetworkStatus {
id: networkStatus;
onSetTooltip: {
......@@ -91,7 +91,7 @@ Item {
}
}
PlasmaNm.ConnectionIcon {
PlasmaNM.ConnectionIcon {
id: connectionIconProvider;
onHideConnectingIndicator: {
......
......@@ -22,7 +22,7 @@ import QtQuick 1.1
import org.kde.qtextracomponents 0.1
import org.kde.plasma.components 0.1 as PlasmaComponents
import org.kde.plasma.core 0.1 as PlasmaCore
import org.kde.plasmanm 0.1 as PlasmaNM
import org.kde.networkmanagement 0.1 as PlasmaNM
PlasmaComponents.ListItem {
id: connectionItem;
......@@ -36,22 +36,18 @@ PlasmaComponents.ListItem {
(!connectionView.unknownExpanded && itemSection == i18n("Unknown connections"))
property bool predictableWirelessPassword: !itemUuid && itemType == PlasmaNM.Enums.Wireless &&
itemSecure && itemSecurityType != PlasmaNM.Enums.DynamicWep && itemSecurityType != PlasmaNM.Enums.LEAP &&
itemSecurityType != PlasmaNM.Enums.WpaEap && itemSecurityType != PlasmaNM.Enums.Wpa2Eap;
itemSecurityType != PlasmaNM.Enums.None && itemSecurityType != PlasmaNM.Enums.DynamicWep && itemSecurityType != PlasmaNM.Enums.LEAP &&
itemSecurityType != PlasmaNM.Enums.WpaEap && itemSecurityType != PlasmaNM.Enums.Wpa2Eap;
property int defaultCheckboxHeight: theme.defaultFont.mSize.height * 1.6 + buttonPadding.margins.top;
signal itemExpanded(string connectionPath, bool itemExpanded);
signal itemExpanded(string itemUni, bool itemExpanded);
enabled: true
height: theme.defaultFont.mSize.height * 2.6 + ((connectionItemSettings.status != Loader.Ready || !expanded) ? 0 : connectionItemSettings.item.childrenRect.height + padding.margins.top);
onClicked: {
if (itemUuid) {
itemExpanded(itemConnectionPath, !expanded);
} else {
itemExpanded(itemName, !expanded);
}
itemExpanded(itemUni, !expanded);
}
Item {
......@@ -68,7 +64,7 @@ PlasmaComponents.ListItem {
id: svgIcons;
multipleImages: true;
imagePath: "icons/plasma-nm";
imagePath: "icons/plasma-networkmanagement";
}
Item {
......@@ -100,7 +96,7 @@ PlasmaComponents.ListItem {
right: parent.right;
}
icon: QIcon("object-locked");
visible: itemSecure;
visible: itemSecurityType != PlasmaNM.Enums.None;
}
}
......@@ -125,8 +121,8 @@ PlasmaComponents.ListItem {
}
text: itemName;
elide: Text.ElideRight;
font.weight: itemConnected ? Font.DemiBold : Font.Normal;
font.italic: itemConnecting ? true : false;
font.weight: itemConnectionState == PlasmaNM.Enums.Activated ? Font.DemiBold : Font.Normal;
font.italic: itemConnectionState == PlasmaNM.Enums.Activating ? true : false;
}
MouseEventListener {
......@@ -142,11 +138,7 @@ PlasmaComponents.ListItem {
onClicked: {
if (!expanded) {
if (itemUuid) {
itemExpanded(itemConnectionPath, !expanded);
} else {
itemExpanded(itemName, !expanded);
}
itemExpanded(itemUni, !expanded);
} else {
if (configureButton.active) {
detailsView = !detailsView
......@@ -164,7 +156,7 @@ PlasmaComponents.ListItem {
verticalCenter: parent.verticalCenter;
rightMargin: padding.margins.right;
}
running: itemConnecting;
running: itemConnectionState == PlasmaNM.Enums.Activating;
visible: running;
}
......@@ -215,7 +207,7 @@ PlasmaComponents.ListItem {
left: parent.left;
right: parent.right;
}
visible: (itemDevicePath && itemConnected && itemType != PlasmaNM.Enums.Vpn)
visible: (itemDevicePath && itemConnectionState == PlasmaNM.Enums.Activated && itemType != PlasmaNM.Enums.Vpn)
PlasmaNM.TrafficMonitor {
anchors.fill: parent;
......@@ -225,21 +217,17 @@ PlasmaComponents.ListItem {
PlasmaComponents.Button {
id: disconnectButton;
anchors {
horizontalCenter: parent.horizontalCenter;
top: trafficMonitor.bottom;
}
text: i18n("Disconnect");
onClicked: {
if (itemUuid) {
itemExpanded(itemConnectionPath, false);
} else {
itemExpanded(itemName, false);
}
itemExpanded(itemUni, false);
handler.deactivateConnection(itemConnectionPath);
handler.deactivateConnection(itemConnectionPath, itemDevicePath);
}
}
}
......@@ -306,13 +294,9 @@ PlasmaComponents.ListItem {
text: i18n("Connect");
onClicked: {
if (itemUuid) {
itemExpanded(itemConnectionPath, false);
} else {
itemExpanded(itemName, false);
}
itemExpanded(itemUni, false);
if (!itemConnected && !itemConnecting) {
if (itemConnectionState != PlasmaNM.Enums.Activated && itemConnectionState != PlasmaNM.Enums.Activating) {
if (itemUuid) {
handler.activateConnection(itemConnectionPath, itemDevicePath, itemSpecificPath);
} else {
......@@ -368,9 +352,10 @@ PlasmaComponents.ListItem {
topMargin: padding.margins.top;
}
text: i18n("Edit connection");
enabled: itemUuid;
onClicked: {
itemExpanded(itemConnectionPath, false);
itemExpanded(itemUni, false);
handler.editConnection(itemUuid);
}
}
......@@ -405,7 +390,7 @@ PlasmaComponents.ListItem {
}
function createContent() {
if (itemConnected || itemConnecting)
if (itemConnectionState == PlasmaNM.Enums.Activated || itemConnectionState == PlasmaNM.Enums.Activating)
connectionItemSettings.sourceComponent = connectionConnectedComponent;
else
connectionItemSettings.sourceComponent = connectionDisconnectedComponent;
......
......@@ -20,7 +20,7 @@
import QtQuick 1.1
import org.kde.plasma.components 0.1 as PlasmaComponents
import org.kde.plasmanm 0.1 as PlasmaNM
import org.kde.networkmanagement 0.1 as PlasmaNM
Item {
id: optionsWidget;
......
......@@ -21,7 +21,7 @@
import QtQuick 1.1
import org.kde.plasma.components 0.1 as PlasmaComponents
import org.kde.plasma.core 0.1 as PlasmaCore
import org.kde.plasmanm 0.1 as PlasmaNM
import org.kde.networkmanagement 0.1 as PlasmaNM
Item {
id: toolBar;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment