diff --git a/CMakeLists.txt b/CMakeLists.txt index bce17c58..f9534f6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,190 +1,191 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) IF(POLICY CMP0053) CMAKE_POLICY(SET CMP0053 NEW) ENDIF(POLICY CMP0053) IF(POLICY CMP0048) CMAKE_POLICY(SET CMP0048 NEW) ENDIF(POLICY CMP0048) IF(POLICY CMP0017) CMAKE_POLICY(SET CMP0017 NEW) ENDIF(POLICY CMP0017) IF(POLICY CMP0028) CMAKE_POLICY(SET CMP0028 NEW) ENDIF(POLICY CMP0028) SET(PROJECT_VERSION "3.0.1") PROJECT(ring-kde) SET(QT_MIN_VERSION "5.9.0" ) SET(KF5_DEP_VERSION "5.6.0" ) SET(AKO_DEP_VERSION "4.89.0") OPTION(ENABLE_SINGLE_INSTANCE "Reuse instances of Ring-KDE when possible" ON) SET(LOCAL_CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/" ) LIST(APPEND CMAKE_MODULE_PATH "${LOCAL_CMAKE_MODULE_PATH}") FIND_PACKAGE(ECM 1.1.0 REQUIRED NO_MODULE) LIST(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}") # libringqt isn't a "stable" library. Clients often only work with a very specific # commit and nothing else. To prevent using the wrong version, it is possible to # add a `libringqt` directory in the source. If present, that version will be used. IF(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/libringqt/") SET(LibRingQt_SRC "${CMAKE_CURRENT_SOURCE_DIR}/libringqt/") SET(ringqt_FOUND true) ELSE() FIND_PACKAGE ( LibRingQt QUIET CONFIG) ENDIF() + FIND_PACKAGE ( LibRingQtQuick REQUIRED CONFIG) # This package was developed for Ring-KDE. It is now a shared framework. Until # it is more widespread and stable, a copy is still included in Ring-KDE. IF(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/libkquickitemviews/") SET(LibKQuickView_SRC "${CMAKE_CURRENT_SOURCE_DIR}/libkquickitemviews/") SET(quickview_FOUND true) ELSE() message("Download KQuickItemViews from `git clone https://anongit.kde.org/kquickitemviews/`") message("and move it to `path/to/ring-kde/libkquickitemviews`") #FIND_PACKAGE (KF5 REQUIRED COMPONENTS KQuickItemViews) ENDIF() # Download libringqt if it wasn't found to simplify the build process IF(NOT ringqt_FOUND) INCLUDE(cmake/FetchRingQt.cmake) SET(LibRingQt_SRC ${CMAKE_CURRENT_BINARY_DIR}/libringqt/) ENDIF() # Use the build-in copy if it has been found IF(LibRingQt_SRC) # Use the .a, not the .so; SET(ENABLE_STATIC true) LIST(APPEND CMAKE_MODULE_PATH "${LibRingQt_SRC}/cmake/") ADD_SUBDIRECTORY(${LibRingQt_SRC}) INCLUDE_DIRECTORIES(${LibRingQt_SRC}/src) ENDIF() IF(LibKQuickView_SRC) # Use the .a, not the .so; SET(ENABLE_STATIC true) ADD_SUBDIRECTORY(${LibKQuickView_SRC}) ENDIF() INCLUDE(ECMInstallIcons) INCLUDE(ECMOptionalAddSubdirectory) INCLUDE(KDEInstallDirs) INCLUDE(KDECMakeSettings) INCLUDE(KDECompilerSettings) INCLUDE(FeatureSummary) # So far only Linux systems use this feature, so it will print noise on all # platforms where the necessary infrastructure doesn't even exists, let alone # in use. IF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux") SET(KDE_SKIP_TEST_SETTINGS 1) ENDIF() # Block known broken C++11 compilers IF (CMAKE_COMPILER_IS_GNUCC) EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) IF (GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8) MESSAGE(STATUS "Found GCC version >= 4.8: " ${GCC_VERSION}) ELSE() MESSAGE(FATAL_ERROR "Your version of GCC is too old, please install GCC 4.8 or later") ENDIF() ENDIF() SET(QT_USE_QT*) FIND_PACKAGE(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Widgets Gui Svg PrintSupport QuickControls2 Quick ) #FIND_PACKAGE(Qt5TextToSpeech ${QT_MIN_VERSION} QUIET) #SET_PACKAGE_PROPERTIES(Qt5TextToSpeech PROPERTIES # PURPOSE "Speech support" #) IF (Qt5TextToSpeech_FOUND) ADD_DEFINITIONS(-DHAVE_SPEECH) ENDIF() FIND_PACKAGE(KF5 "${KF5_DEP_VERSION}" REQUIRED COMPONENTS Config GuiAddons DBusAddons I18n WindowSystem XmlGui Notifications IconThemes Crash NotifyConfig GlobalAccel Declarative Kirigami2 ) FIND_PACKAGE(KF5 "${AKO_DEP_VERSION}" QUIET COMPONENTS DocTools Akonadi AkonadiContact Contacts ) IF ( KF5_AKONADI_FOUND AND KF5_AKONADICONTACT_FOUND AND KF5_CONTACTS_FOUND) ADD_DEFINITIONS("-DENABLE_AKONADI=1") ENDIF() INCLUDE( ${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake ) # INCLUDE( ${QT_USE_FILE} ) ADD_SUBDIRECTORY( data ) ADD_SUBDIRECTORY( src ) ADD_SUBDIRECTORY( man ) IF (KF5_DOCTOOLS_FOUND OR KF5_DOC_TOOLS_FOUND) ADD_SUBDIRECTORY( doc ) ENDIF() IF(${ENABLE_TEST} MATCHES true) ADD_SUBDIRECTORY( src/test) ENDIF() # macOS IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") SET(MACOSX_BUNDLE ON) SET(MACOSX_BUNDLE_BUNDLE_NAME "Ring-KDE") SET(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}") SET(CMAKE_MACOSX_RPATH ON) SET(CMAKE_SKIP_BUILD_RPATH FALSE) SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) SET(CMAKE_INSTALL_RPATH "${CMAKE_CURRENT_SOURCE_DIR}") SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") SET(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${PROJECT_VERSION}) ADD_CUSTOM_TARGET(dist COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD | gzip > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) FEATURE_SUMMARY(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1cf2f34a..cefd47f0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,466 +1,469 @@ IF(POLICY CMP0017) CMAKE_POLICY(SET CMP0017 NEW) ENDIF(POLICY CMP0017) IF(POLICY CMP0022) CMAKE_POLICY(SET CMP0022 NEW) ENDIF(POLICY CMP0022) IF(POLICY CMP0063) CMAKE_POLICY(SET CMP0063 NEW) ENDIF(POLICY CMP0063) # set(CMAKE_AUTOMOC ON) SET(KF5_DEP_VERSION "5.6.0") SET(QT_MIN_VERSION "5.2.0") FIND_PACKAGE ( KF5 REQUIRED ) FIND_PACKAGE (ECM 1.1.0 REQUIRED NO_MODULE) ADD_DEFINITIONS( ${KF5_DEFINITIONS} ${QT_DEFINITIONS} -fexceptions -Wno-error -Wno-reorder -Wno-error=deprecated-declarations ) # It doesn't work in sandboxes IF (NOT ENABLE_SINGLE_INSTANCE) ADD_DEFINITIONS(-DDISABLE_KDBUS_SERVICE=1) ENDIF() # Enable some useful warnings ADD_DEFINITIONS( -Wall -Wextra -Wmissing-declarations -Wmissing-noreturn -Wpointer-arith -Wcast-align -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wswitch-enum -Winit-self -Wmissing-include-dirs -Wundef -Wmissing-format-attribute -Wno-reorder -Wunused -Wuninitialized -Woverloaded-virtual -Wunused-value -pedantic -Wnonnull -Wsequence-point #-Wsystem-headers -Wsizeof-pointer-memaccess #-Wuseless-cast -Wvarargs ) #Add more warnings for compilers that support it. I used this command: #curl https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Warning-Options.html | \ #grep -E "^[\t ]+
-W[a-zA-Z=-]*" -o | grep -E "\-W[a-zA-Z=-]*" -o > #cat /tmp/48 /tmp/49 | sort | uniq -u # IF (CMAKE_COMPILER_IS_GNUCC) IF (CMAKE_COMPILER_IS_GNUCC) IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.9) ADD_DEFINITIONS( -Wunused-but-set-parameter -Wconditionally-supported -Wno-cpp # -Wdouble-promotion -Wdate-time -Wdelete-incomplete # -Wfloat-conversion ) ENDIF() IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 5.0) ADD_DEFINITIONS( -Wsuggest-override -Wsuggest-final-types -Wsuggest-final-methods -Wbool-compare -Wformat-signedness -Wlogical-not-parentheses -Wnormalized -Wshift-count-negative -Wshift-count-overflow -Wsized-deallocation -Wsizeof-array-argument ) ENDIF() IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 6.0) ADD_DEFINITIONS( -Wnull-dereference -Wtautological-compare -Wduplicated-cond -Wmisleading-indentation ) ENDIF() IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 7.0) ADD_DEFINITIONS( -Wimplicit-fallthrough -Wduplicated-branches -Wswitch-unreachable -Wformat-overflow -Wformat-truncation -Wnonnull ) ENDIF() IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 8.0) ADD_DEFINITIONS( -Wmultistatement-macros -Wstringop-truncation -Wif-not-aligned -Wmissing-attributes ) ENDIF() ENDIF() IF (CMAKE_COMPILER_IS_GNUCC) EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION) IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6.9 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.6) #GCC 4.6 version of those warnings does detect valid C++0x/C++11 as invalid. ADD_DEFINITIONS( -Wno-error=pragmas -Wno-pragmas -Wno-error ) ENDIF() IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.7 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.7) ADD_DEFINITIONS( -Wmaybe-uninitialized -Wunused-local-typedefs -pedantic ) ENDIF() IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.8) # ADD_DEFINITIONS("-Wzero-as-null-pointer-constant") # ADD_DEFINITIONS( -DENABLE_IGNORE_NULL=true ) ENDIF() ELSE() ADD_DEFINITIONS(-Wno-unknown-pragmas -Wno-unknown-warning-option) ENDIF() ADD_DEFINITIONS("-std=c++0x") #Make sure it can access DBUS autogenerated files INCLUDE_DIRECTORIES(SYSTEM ${KF5_INCLUDES} ${Qt5Widgets_INCLUDES} ${Qt5PrintSupport_INCLUDES} ${Qt5Core_INCLUDES} ${CMAKE_BINARY_DIR} ${ringqt_INCLUDE_DIR} ${LIB_TIP_INCLUDE} ${LIB_CONFIG_INCLUDE} ${LIB_CONFIG_WIDGETS} ) # Shared C++ QML components ADD_SUBDIRECTORY( qmlwidgets ) # Pack the icons shared by various components ADD_SUBDIRECTORY( sharedassets ) #Build KDE specific files ADD_SUBDIRECTORY( klib ) # Build the QML based first run Wizard ADD_SUBDIRECTORY( wizard ) # Build the QML based interactive video canvas ADD_SUBDIRECTORY( callview ) # Build the advanced phone dialer ADD_SUBDIRECTORY( dialview ) # Build the views and widgets related to the social timeline feature ADD_SUBDIRECTORY( timeline ) # Build the contact and profile photo editor dialog ADD_SUBDIRECTORY( photoselector ) # Build the elements used to notify the users of events ADD_SUBDIRECTORY( canvasindicators ) # Build the contact manager subsystem ADD_SUBDIRECTORY( contactview ) # Build the account manager subsystem ADD_SUBDIRECTORY( accountview ) # Build the main desktop component ADD_SUBDIRECTORY( desktopview ) IF(${CMAKE_BUILD_TYPE} MATCHES Release) MESSAGE("NO DEBUG OUTPUT") ADD_DEFINITIONS( -DQT_NO_DEBUG_OUTPUT) ELSE() # ADD_DEFINITIONS(-Werror) ENDIF(${CMAKE_BUILD_TYPE} MATCHES Release) # SET ( KF5_KABC_LIBS -lkabc ) # Delegates SET( ring_kde_DELEGATES # delegates/conferencedelegate.cpp # delegates/contactdelegate.cpp # delegates/historydelegate.cpp # delegates/phonenumberdelegate.cpp # delegates/delegatedropoverlay.cpp # delegates/dialpaddelegate.cpp delegates/autocompletiondelegate.cpp delegates/autocompletiondelegate2.cpp delegates/toolbardelegate.cpp delegates/accountinfodelegate.cpp delegates/kdepixmapmanipulation.cpp delegates/categorizeddelegate.cpp delegates/righticondelegate.cpp proxies/simplerotateproxy.cpp proxies/deduplicateproxy.cpp proxies/filtertoplevelproxy.cpp proxies/roletransformationproxy.cpp proxies/flagsfilterproxy.cpp proxies/pollingproxy.cpp #proxies/valuefilterproxy.cpp ) # Configuration pages SET( ring_kde_CONF conf/accountserializationadapter.cpp conf/configurationdialog.cpp conf/dlggeneral.cpp conf/dlgdisplay.cpp conf/dlgaudio.cpp conf/dlgaddressbook.cpp conf/dlgaccessibility.cpp conf/dlgpresence.cpp conf/dlgaccount.cpp configurator/localhistoryconfigurator.cpp configurator/peerprofileconfigurator.cpp configurator/bookmarkconfigurator.cpp configurator/audiorecordingconfigurator.cpp configurator/fallbackpersonconfigurator.cpp ) # Account pages SET( ring_kde_ACCOUNT conf/accountpages/advanced.cpp conf/accountpages/credentials.cpp conf/accountpages/basic.cpp conf/accountpages/network.cpp conf/accountpages/codecs.cpp conf/accountpages/ringtone.cpp conf/accountpages/security.cpp conf/accountpages/pagebase.cpp conf/accountpages/account.cpp conf/accountpages/devices.cpp conf/accountpages/dlgprofiles.cpp ) # Widgets SET( ring_kde_WIDGETS widgets/systray.cpp widgets/categorizedtreeview.cpp widgets/fileselector.cpp widgets/filterlineedit.cpp widgets/kphonenumberselector.cpp widgets/directoryview.cpp widgets/menumodelview.cpp widgets/accountstatusviewer.cpp widgets/autocombobox.cpp widgets/categorizedtree.cpp widgets/certificateviewer.cpp widgets/contextlistview.cpp widgets/groupedtoolbutton.cpp widgets/securityprogress.cpp ) # Video Widgets IF(NOT (${ENABLE_VIDEO} MATCHES false)) SET( ring_kde_VIDEO conf/dlgvideo.cpp ) ENDIF(NOT (${ENABLE_VIDEO} MATCHES false)) SET( ring_kde_SRCS main.cpp cmd.cpp notification.cpp ringapplication.cpp errormessage.cpp # canvasobjectmanager.cpp # eventmanager.cpp actioncollection.cpp implementation.cpp model/extendedprotocolmodel.cpp ${ring_kde_DELEGATES} ${ring_kde_CONF} ${ring_kde_WIDGETS} ${ring_kde_ACCOUNT} ${ring_kde_VIDEO} ) IF (Qt5TextToSpeech_FOUND) SET( ring_kde_SRCS ${ring_kde_SRCS} accessibility.cpp ) ENDIF() # generate rules for building source files from the resources SET(QtApp_RCCS qrc/resources.qrc conf/confresources.qrc ../data/appicon.qrc ) QT5_ADD_RESOURCES(QtApp_RCC_SRCS ${QtApp_RCCS}) # kde4_automoc(${ring_kde_SRCS}) SET( config_ui_files conf/dlggeneralbase.ui conf/dlgdisplaybase.ui conf/dlgaudiobase.ui conf/dlgaddressbookbase.ui conf/dlgaccessibility.ui conf/dlgaudiorecording.ui conf/dlgpresence.ui conf/dlgfallbackperson.ui conf/accountdlg.ui conf/accountpages/advanced.ui conf/accountpages/credentials.ui conf/accountpages/basic.ui conf/accountpages/network.ui conf/accountpages/codecs.ui conf/accountpages/ringtone.ui conf/accountpages/security.ui conf/accountpages/tabs.ui widgets/ui/directoryview.ui widgets/ui/accountcreator.ui widgets/ui/fileselect.ui configurator/peerprofile.ui configurator/bookmark.ui configurator/recording.ui ) # add_subdirectory( test ) #Enable again some day, it cause compile problems for some users IF(NOT (${ENABLE_VIDEO} MATCHES false)) SET(ENABLE_VIDEO 1 CACHE BOOLEAN "Enable video") ADD_DEFINITIONS( -DENABLE_VIDEO=true ) SET ( config_ui_files ${config_ui_files} conf/dlgvideobase.ui ) ENDIF(NOT (${ENABLE_VIDEO} MATCHES false)) IF(${DISABLE_UNIQUE_APPLICATION} MATCHES true) MESSAGE("KUniqueApplication disabled") SET(DISABLE_UNIQUE_APPLICATION 1 CACHE BOOLEAN "Disable KUniqueApplication") ADD_DEFINITIONS( -DDISABLE_UNIQUE_APPLICATION=true ) ENDIF(${DISABLE_UNIQUE_APPLICATION} MATCHES true) ki18n_wrap_ui(ring_kde_SRCS ${config_ui_files} ) IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ADD_EXECUTABLE(ring-kde MACOSX_BUNDLE ${ring_kde_SRCS} ${QtApp_RCC_SRCS}) set_source_files_properties( ../data/ring-kdeui.rc PROPERTIES MACOSX_PACKAGE_LOCATION Resources ) file( COPY ../data/ring-kdeui.rc DESTINATION "ring-kde.app/Contents/Resources/" ) ELSE() ADD_EXECUTABLE(ring-kde ${ring_kde_SRCS} ${QtApp_RCC_SRCS}) ENDIF() IF(NOT ${ENABLE_STATIC} MATCHES false) FIND_PACKAGE(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED DBus) INCLUDE_DIRECTORIES(SYSTEM ${Qt5DBus_INCLUDE_DIRS} ) LINK_DIRECTORIES(${Qt5DBus_LIBRARY_DIRS} ) ADD_DEFINITIONS(${Qt5DBus_CFLAGS}) TARGET_LINK_LIBRARIES(ring-kde ${ringqt_LIBRARY_STATIC} -lpthread ) IF(NOT ${ENABLE_LIBWRAP}) TARGET_LINK_LIBRARIES(ring-kde ${Qt5DBus_LIBRARIES} ) ENDIF() ELSE() TARGET_LINK_LIBRARIES(ring-kde ${ringqt_LIBRARY_DYNAMIC}) ENDIF() QT5_ADD_DBUS_ADAPTOR(ring_kde_SRCS ../data/org.kde.kuiserver.xml cmd.h Cmd ) TARGET_LINK_LIBRARIES(ring-kde libkring libwizard libcallview dialview libtimeline libphotoselector libcanvasindicator desktopview contactview accountview libqmlwidgets kquickview + # RingQt + ringqtquick + # Qt5 Qt5::Widgets Qt5::Core Qt5::Gui Qt5::Svg Qt5::PrintSupport # KF5 KF5::I18n KF5::WidgetsAddons KF5::ConfigCore KF5::ConfigGui KF5::DBusAddons KF5::XmlGui KF5::Notifications KF5::IconThemes KF5::Crash KF5::NotifyConfig KF5::GlobalAccel KF5::Declarative KF5::Kirigami2 ) IF (Qt5TextToSpeech_FOUND) TARGET_LINK_LIBRARIES(ring-kde Qt5::TextToSpeech ) ENDIF() ########### install files ############### INSTALL( TARGETS ring-kde DESTINATION ${BIN_INSTALL_DIR} ) INSTALL( FILES wizard/assets/beta_logo.svg DESTINATION ${DATA_INSTALL_DIR}/ring-kde ) diff --git a/src/accountview/accountview.qrc b/src/accountview/accountview.qrc index 5b5f7ff9..bd44976e 100644 --- a/src/accountview/accountview.qrc +++ b/src/accountview/accountview.qrc @@ -1,6 +1,17 @@ qml/accountlist.qml qml/presenceselector.qml + qml/accounts.qml + qml/accountdialog.qml + qml/securitylevel.qml + qml/pages/basic.qml + qml/pages/advanced.qml + qml/pages/network.qml + qml/pages/codecs.qml + qml/pages/credentials.qml + qml/pages/devices.qml + qml/pages/security.qml + qml/pages/ringtones.qml diff --git a/src/accountview/qml/accountdialog.qml b/src/accountview/qml/accountdialog.qml new file mode 100644 index 00000000..29fe0af7 --- /dev/null +++ b/src/accountview/qml/accountdialog.qml @@ -0,0 +1,108 @@ +/*************************************************************************** + * Copyright (C) 2017 by Bluesystems * + * Author : Emmanuel Lepage Vallee * + * * + * This program 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. * + * * + * This program 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 this program. If not, see . * + **************************************************************************/ +import QtQuick 2.7 +import org.kde.kirigami 2.2 as Kirigami +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.0 +import RingQmlWidgets 1.0 +import "Pages/" as Pages +import net.lvindustries.ringqtquick 1.0 as RingQtQuick +import org.kde.playground.kquickview 1.0 as KQuickItemViews + +Dialog { + id: accountDialog + standardButtons: Dialog.Save | Dialog.Cancel + + parent: applicationWindow().contentItem + x: applicationWindow().contentItem.width / 2 - width/2 + y: applicationWindow().contentItem.height / 2 - height/2 + + width: applicationWindow().contentItem.width * 0.85 + height: applicationWindow().contentItem.height * 0.85 + + onAccepted: {} + + onRejected: {} + + RowLayout { + anchors.fill: parent + + Accounts { + id: accountTree + Layout.fillHeight: true + Layout.preferredWidth: 300 + } + + KQuickItemViews.IndexView { + Layout.fillHeight: true + Layout.fillWidth: true + modelIndex: accountTree.selectedAccount ? accountTree.selectedAccount.index : undefined + clip: true + + delegate: RingQtQuick.AccountFields { + anchors.fill: parent + account: object + ColumnLayout { + anchors.fill: parent + TabBar { + id: pageTabs + Layout.fillWidth: true + TabButton { + text: i18n("Basic") + } + TabButton { + text: i18n("Advanced") + } + TabButton { + text: i18n("Network") + } + TabButton { + text: i18n("Devices") + } + TabButton { + text: i18n("Codecs") + } + TabButton { + text: i18n("Credentials") + } + TabButton { + text: i18n("Security") + } + TabButton { + text: i18n("Ringtones") + } + } + + SwipeView { + currentIndex: pageTabs.currentIndex + Layout.fillHeight: true + Layout.fillWidth: true + Pages.Basic {} + Pages.Advanced {} + Pages.Network {} + Pages.Devices {} + Pages.Codecs {} + Pages.Credentials {} + Pages.Security {} + Pages.Ringtones {} + } + } + } + } + } +} diff --git a/src/accountview/qml/accountlist.qml b/src/accountview/qml/accountlist.qml index 559c0d16..332e0879 100644 --- a/src/accountview/qml/accountlist.qml +++ b/src/accountview/qml/accountlist.qml @@ -1,293 +1,296 @@ /*************************************************************************** * Copyright (C) 2018 by Bluesystems * * Author : Emmanuel Lepage Vallee * * * * This program 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. * * * * This program 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 this program. If not, see . * **************************************************************************/ import QtQuick 2.7 import QtQuick.Layouts 1.0 import RingQmlWidgets 1.0 import Ring 1.0 import QtQuick.Controls 2.2 import ContactView 1.0 import org.kde.kirigami 2.2 as Kirigami import org.kde.playground.kquickview 1.0 as KQuickView ListView { id: accountList interactive: false height: totalHeight implicitHeight: totalHeight model: AccountModel property real totalHeight: footerItem + contentHeight + headerItem + 10 property real footerItem: 0 property real headerItem: 0 property bool enableAdd: true Component { id: accountErrorComponent RowLayout { anchors.fill: parent Image { Layout.fillHeight: true fillMode: Image.PreserveAspectFit width: parent.width sourceSize.width: 22 sourceSize.height: 22 horizontalAlignment: Image.AlignHCenter source: "image://SymbolicColorizer/:/sharedassets/outline/warning.svg" } Label { Layout.fillWidth: true Layout.fillHeight: true text: error color: activePalette.text wrapMode: Text.WordWrap width: parent.width } } } Component { id: defaultAccountComponent RowLayout { CheckBox { Layout.fillHeight: true Layout.preferredWidth: Kirigami.Units.fontMetrics.height * 2 Layout.minimumWidth: Kirigami.Units.fontMetrics.height * 2 checked: obj.enabled onClicked: { obj.enabled = checked obj.performAction(Account.SAVE) } } Rectangle { height: Kirigami.Units.fontMetrics.height * 0.66 width: Kirigami.Units.fontMetrics.height * 0.66 radius: 99 color: obj.registrationState == Account.READY ? Kirigami.Theme.positiveTextColor : ( obj.registrationState == Account.TRYING ? Kirigami.Theme.neutralTextColor : Kirigami.Theme.negativeTextColor ) } Label { Layout.fillHeight: true Layout.fillWidth: true text: obj.alias } - KQuickView.DecorationAdapter { - pixmap: secIcon - anchors.verticalCenter: parent.verticalCenter - height: (Kirigami.Units.fontMetrics.height * 2) - 6 - width: (Kirigami.Units.fontMetrics.height * 2) - 6 + Item { + Layout.fillHeight: true + KQuickView.DecorationAdapter { + pixmap: secIcon + anchors.verticalCenter: parent.verticalCenter + height: (Kirigami.Units.fontMetrics.height * 2) - 6 + width: (Kirigami.Units.fontMetrics.height * 2) - 6 + } } // Do not cover the handle Item { width: (Kirigami.Units.fontMetrics.height * 2) } } } Component { id: errorComponent RowLayout { anchors.fill: parent CheckBox { Layout.fillHeight: true Layout.preferredWidth: Kirigami.Units.fontMetrics.height * 2 Layout.minimumWidth: Kirigami.Units.fontMetrics.height * 2 checked: obj.enabled onClicked: { obj.enabled = checked obj.performAction(Account.SAVE) } } Rectangle { height: Kirigami.Units.fontMetrics.height * 0.66 width: Kirigami.Units.fontMetrics.height * 0.66 radius: 99 color: obj.registrationState == Account.READY ? Kirigami.Theme.positiveTextColor : ( obj.registrationState == Account.TRYING ? Kirigami.Theme.neutralTextColor : Kirigami.Theme.negativeTextColor ) } ColumnLayout { Layout.fillHeight: true Layout.fillWidth: true Loader { property string error: obj.lastErrorMessage property int code: obj.lastErrorCode id: accountError Layout.minimumHeight: active ? Kirigami.Units.fontMetrics.height * 1.5 : 0 Layout.fillWidth: true active: true sourceComponent: accountErrorComponent } Label { Layout.fillHeight: true Layout.fillWidth: true text: obj.alias } } KQuickView.DecorationAdapter { pixmap: secIcon anchors.verticalCenter: parent.verticalCenter height: (Kirigami.Units.fontMetrics.height * 2) - 6 width: (Kirigami.Units.fontMetrics.height * 2) - 6 } // Do not cover the handle Item { width: (Kirigami.Units.fontMetrics.height * 2) } } } Loader { id: accountDeleter property string name: "" property var account: "" active: false sourceComponent: Dialog { height: 150 parent: applicationWindow().contentItem x: applicationWindow().contentItem.width / 2 - width/2 y: applicationWindow().contentItem.height / 2 - height/2 standardButtons: Dialog.Ok | Dialog.Cancel closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent modal: true title: i18n("Delete an account") Label { text: i18n("
Are you sure you want to delete the account called ") + name + i18n(".

This cannot be undone and you will lose the account permanently
") } onAccepted: { accountDeleter.active = false AccountModel.remove(account) AccountModel.save() accountDeleter.account = null } onRejected: { accountDeleter.active = false accountDeleter.account = null } } } delegate: Kirigami.SwipeListItem { property bool hasProblems: object.enabled && registrationState != Account.READY height: Kirigami.Units.fontMetrics.height * (hasProblems ? 3.5 : 2) width: accountList.width actions: [ Kirigami.Action { iconName: "message-news" text: i18n("Status logs") onTriggered: { object.performAction(Account.RELOAD) } }, Kirigami.Action { iconName: "document-share" text: i18n("Share") onTriggered: { //TODO } }, Kirigami.Action { iconName: "edit-delete" text: i18n("Delete") onTriggered: { accountDeleter.name = alias accountDeleter.account = object accountDeleter.active = true accountDeleter.item.open() //applicationWindow().globalDrawer.drawerOpen = false //FIXME } }, Kirigami.Action { iconName: "view-refresh" text: i18n("Reload") onTriggered: { object.performAction(Account.RELOAD) } } ] Loader { anchors.fill: parent property QtObject obj: object property var secIcon: securityLevelIcon sourceComponent: hasProblems ? errorComponent : defaultAccountComponent } } header: Kirigami.Heading { level: 2 text: i18n("Accounts") Component.onCompleted: { headerItem = Math.max(height, implicitHeight) } onHeightChanged: { headerItem = Math.max(height, implicitHeight) } } footer: OutlineButton { id: mainArea height: enableAdd ? fontMetrics.height * 3.5 : 0 expandedHeight: fontMetrics.height * 3.5 sideMargin: 2 width: parent.width label: i18n("Add an account") topPadding: 2 visible: enableAdd onClicked: { applicationWindow().globalDrawer.drawerOpen = false ActionCollection.showWizard.trigger() } Component.onCompleted: { footerItem = Math.max(height, implicitHeight) } onHeightChanged: { footerItem = Math.max(height, implicitHeight) } } } diff --git a/src/accountview/qml/accounts.qml b/src/accountview/qml/accounts.qml new file mode 100644 index 00000000..be3d3f92 --- /dev/null +++ b/src/accountview/qml/accounts.qml @@ -0,0 +1,163 @@ +/*************************************************************************** +* Copyright (C) 2017 by Bluesystems * +* Author : Emmanuel Lepage Vallee * +* * +* This program 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. * +* * +* This program 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 this program. If not, see . * +**************************************************************************/ +import QtQuick 2.8 +import org.kde.kirigami 2.5 as Kirigami +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.0 +import org.kde.playground.kquickview 1.0 as KQuickItemViews + +Rectangle { + property QtObject selectedAccount: null + + SystemPalette { + id: activePalette + colorGroup: SystemPalette.Active + } + + color: activePalette.window + + Kirigami.CardsListView { + id: gridView + + Component { + id: codecDelegate + Kirigami.Card { + id: card + width: gridView.width + height: content.height + 20 + implicitHeight: content.height + 20 + + property var pModel : ProfileModel.profilesForPerson(model.object) + + ColumnLayout { + id: content + height: implicitHeight + width: parent.width + Kirigami.Heading { + text: model.display + level:4 + } + + ListView { + id: profileList + interactive: false + model: pModel + implicitHeight: contentHeight + height: contentHeight + width: parent.width + + delegate: Kirigami.SwipeListItem { + id: listItem + width: card.width + background: Rectangle { + id: background + property var listItem: parent + + color: listItem.checked || + listItem.highlighted || ( + listItem.supportsMouseEvents + && listItem.pressed + && !listItem.checked + && !listItem.sectionDelegate + ) ? listItem.activeBackgroundColor : listItem.backgroundColor + + visible: listItem.ListView.view ? listItem.ListView.view.highlight === null : true + + Rectangle { + id: internal + property bool indicateActiveFocus: listItem.pressed || listItem.activeFocus || (listItem.ListView.view ? listItem.ListView.view.activeFocus : false) + anchors.fill: parent + visible: !listItem.supportsMouseEvents + color: listItem.activeBackgroundColor + opacity: (listItem.hovered || listItem.highlighted || listItem.activeFocus) && !listItem.pressed ? 0.5 : 0 + Behavior on opacity { NumberAnimation { duration: Kirigami.Units.longDuration } } + } + + Rectangle { + opacity: 0.9 + anchors.fill: parent + color: registrationStateColor + } + + KQuickItemViews.DecorationAdapter { + width: check.implicitHeight + height: check.implicitHeight + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + pixmap: securityLevelIcon + } + + readonly property bool __separatorVisible: listItem.separatorVisible + + on__SeparatorVisibleChanged: { + if (__separatorVisible) { + var newObject = Qt.createQmlObject('import QtQuick 2.0; import org.kde.kirigami 2.4; Separator {anchors {left: parent.left; right: parent.right; bottom: parent.top} visible: listItem.separatorVisible}', + background); + newObject = Qt.createQmlObject('import QtQuick 2.0; import org.kde.kirigami 2.4; Separator {anchors {left: parent.left; right: parent.right; bottom: parent.bottom} visible: listItem.separatorVisible}', + background); + } + } + } + RowLayout { + width: parent.width + height: check.implicitHeight*2 + CheckBox { + id: check + width: height + checked: model.enabled + } + + KQuickItemViews.DecorationAdapter { + height: check.implicitHeight + width: check.implicitHeight + pixmap: decoration + } + + Label { + text: alias + Layout.fillWidth: true + } + } + actions: [ + Kirigami.Action { + text: i18n("Remove") + iconName: "list-remove" + onTriggered: {} + } + ] + + onPressedChanged: { + selectedAccount = object + } + } + } + } + } + } + + footer: OutlineButton { + height: 50 + label: i18n("Add an account") + width: parent.width + } + + anchors.fill: parent + model: ProfileModel + delegate: codecDelegate + } +} diff --git a/src/conf/qml/codecs.qml b/src/accountview/qml/codecs.qml similarity index 100% copy from src/conf/qml/codecs.qml copy to src/accountview/qml/codecs.qml diff --git a/src/conf/qml/credentials.qml b/src/accountview/qml/credentials.qml similarity index 100% copy from src/conf/qml/credentials.qml copy to src/accountview/qml/credentials.qml diff --git a/src/conf/qml/devices.qml b/src/accountview/qml/devices.qml similarity index 100% copy from src/conf/qml/devices.qml copy to src/accountview/qml/devices.qml diff --git a/src/accountview/qml/pages/advanced.qml b/src/accountview/qml/pages/advanced.qml new file mode 100644 index 00000000..ec9589d9 --- /dev/null +++ b/src/accountview/qml/pages/advanced.qml @@ -0,0 +1,178 @@ +/*************************************************************************** +* Copyright (C) 2018 by Bluesystems * +* Author : Emmanuel Lepage Vallee * +* * +* This program 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. * +* * +* This program 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 this program. If not, see . * +**************************************************************************/ +import QtQuick 2.8 +import org.kde.kirigami 2.5 as Kirigami +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.0 +import net.lvindustries.ringqtquick 1.0 as RingQtQuick +import org.kde.playground.kquickview 1.0 as KQuickItemViews + + +Page { + Kirigami.FormLayout { + anchors.fill: parent + + SpinBox { + Kirigami.FormData.label: i18n("Registration expire") + KQuickItemViews.RoleBinder.modelRole: "registrationExpire" + KQuickItemViews.RoleBinder.objectProperty: "value" + RingQtQuick.FieldStatus.name: "registrationExpire" + visible: RingQtQuick.FieldStatus.available + } + + TextField { + Kirigami.FormData.label: i18n("Use custom useragent") + KQuickItemViews.RoleBinder.modelRole: "hasCustomUserAgent" + KQuickItemViews.RoleBinder.objectProperty: "text" + RingQtQuick.FieldStatus.name: "hasCustomUserAgent" + visible: RingQtQuick.FieldStatus.available + readOnly: RingQtQuick.FieldStatus.readOnly + } + + TextField { + Kirigami.FormData.label: i18n("Useragent") + KQuickItemViews.RoleBinder.modelRole: "userAgent" + KQuickItemViews.RoleBinder.objectProperty: "text" + RingQtQuick.FieldStatus.name: "userAgent" + visible: RingQtQuick.FieldStatus.available + readOnly: RingQtQuick.FieldStatus.readOnly + } + + CheckBox { + Kirigami.FormData.label: i18n("allowIncomingFromUnknown") + KQuickItemViews.RoleBinder.modelRole: "allowIncomingFromUnknown" + KQuickItemViews.RoleBinder.objectProperty: "checked" + RingQtQuick.FieldStatus.name: "allowIncomingFromUnknown" + visible: RingQtQuick.FieldStatus.available + } + + CheckBox { + Kirigami.FormData.label: i18n("allowIncomingFromHistory") + KQuickItemViews.RoleBinder.modelRole: "allowIncomingFromHistory" + KQuickItemViews.RoleBinder.objectProperty: "checked" + RingQtQuick.FieldStatus.name: "allowIncomingFromHistory" + visible: RingQtQuick.FieldStatus.available + } + + CheckBox { + Kirigami.FormData.label: i18n("allowIncomingFromContact") + KQuickItemViews.RoleBinder.modelRole: "allowIncomingFromContact" + KQuickItemViews.RoleBinder.objectProperty: "checked" + RingQtQuick.FieldStatus.name: "allowIncomingFromContact" + visible: RingQtQuick.FieldStatus.available + } + + CheckBox { + Kirigami.FormData.label: i18n("hasProxy") + KQuickItemViews.RoleBinder.modelRole: "hasProxy" + KQuickItemViews.RoleBinder.objectProperty: "checked" + RingQtQuick.FieldStatus.name: "hasProxy" + visible: RingQtQuick.FieldStatus.available + } + + TextField { + Kirigami.FormData.label: i18n("proxy") + KQuickItemViews.RoleBinder.modelRole: "proxy" + KQuickItemViews.RoleBinder.objectProperty: "text" + RingQtQuick.FieldStatus.name: "proxy" + visible: RingQtQuick.FieldStatus.available + readOnly: RingQtQuick.FieldStatus.readOnly + } + + CheckBox { + Kirigami.FormData.label: i18n("sipStunEnabled") + KQuickItemViews.RoleBinder.modelRole: "sipStunEnabled" + KQuickItemViews.RoleBinder.objectProperty: "checked" + RingQtQuick.FieldStatus.name: "sipStunEnabled" + visible: RingQtQuick.FieldStatus.available + } + + TextField { + Kirigami.FormData.label: i18n("sipStunServer") + KQuickItemViews.RoleBinder.modelRole: "sipStunServer" + KQuickItemViews.RoleBinder.objectProperty: "text" + RingQtQuick.FieldStatus.name: "sipStunServer" + visible: RingQtQuick.FieldStatus.available + readOnly: RingQtQuick.FieldStatus.readOnly + } + + CheckBox { + Kirigami.FormData.label: i18n("turnEnabled") + KQuickItemViews.RoleBinder.modelRole: "turnServerEnabled" + KQuickItemViews.RoleBinder.objectProperty: "checked" + RingQtQuick.FieldStatus.name: "turnServerEnabled" + visible: RingQtQuick.FieldStatus.available + } + + TextField { + Kirigami.FormData.label: i18n("turnServer") + KQuickItemViews.RoleBinder.modelRole: "turnServer" + KQuickItemViews.RoleBinder.objectProperty: "text" + RingQtQuick.FieldStatus.name: "turnServer" + visible: RingQtQuick.FieldStatus.available + readOnly: RingQtQuick.FieldStatus.readOnly + } + + CheckBox { + Kirigami.FormData.label: i18n("upnpEnabled") + KQuickItemViews.RoleBinder.modelRole: "isUpnpEnabled" + KQuickItemViews.RoleBinder.objectProperty: "checked" + RingQtQuick.FieldStatus.name: "isUpnpEnabled" + visible: RingQtQuick.FieldStatus.available + } + + CheckBox { + Kirigami.FormData.label: i18n("presenceEnabled") + KQuickItemViews.RoleBinder.modelRole: "presenceEnabled" + KQuickItemViews.RoleBinder.objectProperty: "checked" + RingQtQuick.FieldStatus.name: "presenceEnabled" + visible: RingQtQuick.FieldStatus.available + } + + CheckBox { + Kirigami.FormData.label: i18n("isVideoEnabled") + KQuickItemViews.RoleBinder.modelRole: "isVideoEnabled" + KQuickItemViews.RoleBinder.objectProperty: "checked" + RingQtQuick.FieldStatus.name: "isVideoEnabled" + visible: RingQtQuick.FieldStatus.available + } + + CheckBox { + Kirigami.FormData.label: i18n("hasActiveCallLimit") + KQuickItemViews.RoleBinder.modelRole: "hasActiveCallLimit" + KQuickItemViews.RoleBinder.objectProperty: "checked" + RingQtQuick.FieldStatus.name: "hasActiveCallLimit" + visible: RingQtQuick.FieldStatus.available + } + + SpinBox { + Kirigami.FormData.label: i18n("activeCallLimit") + KQuickItemViews.RoleBinder.modelRole: "activeCallLimit" + KQuickItemViews.RoleBinder.objectProperty: "value" + RingQtQuick.FieldStatus.name: "activeCallLimit" + visible: RingQtQuick.FieldStatus.available + } + + ComboBox { + Kirigami.FormData.label: i18n("dTMFType") + KQuickItemViews.RoleBinder.modelRole: "dTMFType" + RingQtQuick.FieldStatus.name: "dTMFType" + visible: RingQtQuick.FieldStatus.available + } + } +} diff --git a/src/accountview/qml/pages/basic.qml b/src/accountview/qml/pages/basic.qml new file mode 100644 index 00000000..1c7cdd2e --- /dev/null +++ b/src/accountview/qml/pages/basic.qml @@ -0,0 +1,117 @@ +/*************************************************************************** +* Copyright (C) 2018 by Bluesystems * +* Author : Emmanuel Lepage Vallee * +* * +* This program 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. * +* * +* This program 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 this program. If not, see . * +**************************************************************************/ +import QtQuick 2.8 +import org.kde.kirigami 2.5 as Kirigami +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.0 +import net.lvindustries.ringqtquick 1.0 as RingQtQuick +import org.kde.playground.kquickview 1.0 as KQuickItemViews + +/** + * This page contains the most basic elements necessary to create a SIP or + * Ring/Jami account. + */ +Page { + Kirigami.FormLayout { + anchors.fill: parent + + TextField { + id: alias + KQuickItemViews.RoleBinder.modelRole: "alias" + KQuickItemViews.RoleBinder.objectProperty: "text" + RingQtQuick.FieldStatus.name: "alias" + visible: RingQtQuick.FieldStatus.available + Kirigami.FormData.label: i18n("Alias") + readOnly: RingQtQuick.FieldStatus.readOnly + } + + ComboBox { +// KQuickItemViews.RoleBinder.modelRole: "profile" +// KQuickItemViews.RoleBinder.objectProperty: "text" + id: profile + model: ProfileModel + Kirigami.FormData.label: i18n("Profile") + } + + ComboBox { + id: protocol +// KQuickItemViews.RoleBinder.modelRole: "protocol" +// KQuickItemViews.RoleBinder.objectProperty: "text" + model: object.protocolModel + Kirigami.FormData.label: i18n("Protocol") + } + + TextField { + id: registeredname + KQuickItemViews.RoleBinder.modelRole: "registeredName" + KQuickItemViews.RoleBinder.objectProperty: "text" + RingQtQuick.FieldStatus.name: "registeredName" + visible: RingQtQuick.FieldStatus.available + Kirigami.FormData.label: i18n("Registered name") + readOnly: RingQtQuick.FieldStatus.readOnly + } + + TextField { + id: displayname + KQuickItemViews.RoleBinder.modelRole: "displayName" + KQuickItemViews.RoleBinder.objectProperty: "text" + RingQtQuick.FieldStatus.name: "displayName" + visible: RingQtQuick.FieldStatus.available + Kirigami.FormData.label: i18n("Display name") + readOnly: RingQtQuick.FieldStatus.readOnly + } + + TextField { + id: name + Kirigami.FormData.label: i18n("Username") + RingQtQuick.FieldStatus.name: "name" + visible: RingQtQuick.FieldStatus.available + KQuickItemViews.RoleBinder.modelRole: "name" + KQuickItemViews.RoleBinder.objectProperty: "text" + readOnly: RingQtQuick.FieldStatus.readOnly + } + + TextField { + Kirigami.FormData.label: i18n("Password") + id: password + RingQtQuick.FieldStatus.name: "password" + visible: RingQtQuick.FieldStatus.available + KQuickItemViews.RoleBinder.modelRole: "password" + KQuickItemViews.RoleBinder.objectProperty: "text" + readOnly: RingQtQuick.FieldStatus.readOnly + } + + TextField { + Kirigami.FormData.label: i18n("Hostname") + id: server + RingQtQuick.FieldStatus.name: "hostname" + visible: RingQtQuick.FieldStatus.available + KQuickItemViews.RoleBinder.modelRole: "hostname" + KQuickItemViews.RoleBinder.objectProperty: "text" + readOnly: RingQtQuick.FieldStatus.readOnly + } +// } + +// server +// name +// password +// autoAnswer + + + } +} diff --git a/src/conf/qml/codecs.qml b/src/accountview/qml/pages/codecs.qml similarity index 89% rename from src/conf/qml/codecs.qml rename to src/accountview/qml/pages/codecs.qml index f79089de..78618d39 100644 --- a/src/conf/qml/codecs.qml +++ b/src/accountview/qml/pages/codecs.qml @@ -1,83 +1,82 @@ /*************************************************************************** -* Copyright (C) 2017 by Bluesystems * +* Copyright (C) 2018 by Bluesystems * * Author : Emmanuel Lepage Vallee * * * * This program 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. * * * * This program 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 this program. If not, see . * **************************************************************************/ import QtQuick 2.8 import org.kde.kirigami 2.5 as Kirigami import QtQuick.Controls 2.0 import QtQuick.Layouts 1.0 -Rectangle { - property var account: null +Page { + property var account: object SystemPalette { id: activePalette colorGroup: SystemPalette.Active } - color: activePalette.window - Kirigami.CardsGridView { id: gridView - minimumColumnWidth: 0 - cellWidth: undefined - cellHeight: undefined + minimumColumnWidth: 160 + cellWidth: 160 + cellHeight: 160 Component { id: codecDelegate Item { id: content - width: card.width + 40 - height: card.height + 40 - implicitWidth: width + implicitWidth: card.width + 60 + implicitHeight: card.height + 60 + width: 200 Kirigami.Card { id: card anchors.centerIn: parent height: info.height + 20 width: info.implicitWidth + 20 RowLayout { id: info + anchors.centerIn: parent Kirigami.ListItemDragHandle { listView: gridView listItem: content Layout.fillHeight: true } ColumnLayout { height: implicitHeight CheckBox { text: name checked: model.enabled onCheckedChanged: { model.enabled = checked } } Label { text: "Bitrate: "+bitrate } Label { text: "Type: "+type } } } } } } anchors.fill: parent model: account ? account.codecModel : null delegate: codecDelegate } } diff --git a/src/conf/qml/credentials.qml b/src/accountview/qml/pages/credentials.qml similarity index 72% rename from src/conf/qml/credentials.qml rename to src/accountview/qml/pages/credentials.qml index c70d3537..8bf7a568 100644 --- a/src/conf/qml/credentials.qml +++ b/src/accountview/qml/pages/credentials.qml @@ -1,128 +1,175 @@ /*************************************************************************** -* Copyright (C) 2017 by Bluesystems * +* Copyright (C) 2018 by Bluesystems * * Author : Emmanuel Lepage Vallee * * * * This program 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. * * * * This program 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 this program. If not, see . * **************************************************************************/ import QtQuick 2.8 import org.kde.kirigami 2.5 as Kirigami import org.kde.playground.kquickview 1.0 as KQuickItemViews import QtQuick.Controls 2.0 import QtQuick.Layouts 1.0 import RingQmlWidgets 1.0 -Rectangle { - property var account: null +Page { + property var account: object + property var details: credentialDetails SystemPalette { id: activePalette colorGroup: SystemPalette.Active } SystemPalette { id: inactivePalette colorGroup: SystemPalette.Inactive } - color: activePalette.window - ColumnLayout { anchors.fill: parent Label { Layout.fillWidth: true text: i18n("This tab help manage accounts with multiple credentials. If you have multiple accounts. Do not use this feature, just create multiple accounts in Ring-KDE. Nor use this dialog if you only have one set of credentials. In that case, the \"Basic\" tab will provide everything you need.") } KQuickItemViews.TreeView { id: gridView - Layout.fillHeight: true Layout.fillWidth: true + Layout.preferredHeight: contentHeight model: account ? account.credentialModel : null delegate: Loader { Component { id: categoryDelegate ColumnLayout { width: gridView.width Item { height: 10 } Kirigami.Heading { text: display } } } Component { id: credentialDelegate Kirigami.SwipeListItem { ColumnLayout { Label { text: display } RowLayout { Text { color: inactivePalette.text text: "Realm: "+realm+"" } Item { Layout.fillWidth: true } } } actions: [ Kirigami.Action { text: i18n("Remove") iconName: "list-remove" onTriggered: { account.credentialModel.removeCredentials( rootIndex ) } }, Kirigami.Action { text: i18n("Edit") iconName: "document-edit" onTriggered: print("Action 1 clicked") }, Kirigami.Action { text: i18n("Move up") iconName: "go-up" onTriggered: print("Action 1 clicked") }, Kirigami.Action { text: i18n("Move down") iconName: "go-down" onTriggered: print("Action 1 clicked") } ] + + onPressedChanged: { + details.modelIndex = rootIndex + } } } sourceComponent: isCategory ? categoryDelegate : credentialDelegate } } - OutlineButtons { + OutlineButtons { Layout.fillWidth: true height: 50 implicitHeight: 50 model: account ? account.credentialModel.availableTypeModel : null } + Item { + Layout.fillHeight: true + Layout.fillWidth: true + } + + GroupBox { + title: i18n("Details") + Layout.fillWidth: true + height: implicitHeight + implicitHeight: 130 //FIXME + Layout.preferredHeight: implicitHeight + Layout.minimumHeight: implicitHeight + Layout.maximumHeight: implicitHeight + KQuickItemViews.IndexView { + id: credentialDetails + anchors.fill: parent + implicitHeight: 0 + height: 0 + delegate: Kirigami.FormLayout { + + anchors.fill: parent + + TextField { + Kirigami.FormData.label: i18n("Realm") + KQuickItemViews.RoleBinder.modelRole: "realm" + KQuickItemViews.RoleBinder.objectProperty: "text" + } + + TextField { + Kirigami.FormData.label: i18n("User (auth) name") + KQuickItemViews.RoleBinder.modelRole: "name" + KQuickItemViews.RoleBinder.objectProperty: "text" + } + + TextField { + Kirigami.FormData.label: i18n("Password") + KQuickItemViews.RoleBinder.modelRole: "password" + KQuickItemViews.RoleBinder.objectProperty: "text" + } + + } + } + } + } } diff --git a/src/conf/qml/devices.qml b/src/accountview/qml/pages/devices.qml similarity index 99% rename from src/conf/qml/devices.qml rename to src/accountview/qml/pages/devices.qml index c670cb4e..9aab807d 100644 --- a/src/conf/qml/devices.qml +++ b/src/accountview/qml/pages/devices.qml @@ -1,382 +1,380 @@ /*************************************************************************** * Copyright (C) 2017 by Bluesystems * * Author : Emmanuel Lepage Vallee * * * * This program 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. * * * * This program 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 this program. If not, see . * **************************************************************************/ import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.0 import Ring 1.0 import RingQmlWidgets 1.0 import PhotoSelectorPlugin 1.0 -Rectangle { +Page { id: deviceList - property var account: null + property var account: object SystemPalette { id: activePalette colorGroup: SystemPalette.Active } SystemPalette { id: inactivePalette colorGroup: SystemPalette.Inactive } - color: activePalette.window - Component { id: deviceDelegate Item { id: deviceDelegateRect clip: true width: deviceList.width height: confirmPassword.height + confirmLabel.height + 9 anchors.margins: 3 RowLayout { id: infoView width: parent.width height: parent.height ColumnLayout { Layout.fillHeight: true Layout.fillWidth: true Label { text: name color: activePalette.text font.bold: true Layout.fillWidth: true } Label { text: id color: activePalette.text Layout.fillHeight: true Layout.fillWidth: true } } Image { visible: isSelf fillMode: Image.PreserveAspectFit Layout.fillHeight: true Layout.preferredWidth: 30 width: 30 source: "image://icon/document-edit" MouseArea { anchors.fill: parent onClicked: { deviceDelegateRect.state = "beginEdit" } } } Image { visible: !isSelf fillMode: Image.PreserveAspectFit Layout.fillHeight: true Layout.preferredWidth: 30 width: 30 source: "image://icon/edit-delete" MouseArea { anchors.fill: parent onClicked: { deviceDelegateRect.state = "beginRevoke" } } } Behavior on x { NumberAnimation {duration: 200} } } RowLayout { id: revokeForm x: deviceList.width width: parent.width height: parent.height ColumnLayout { Layout.fillHeight: true Layout.fillWidth: true Label { id: confirmLabel color: activePalette.text text: i18n("Enter your account password to confirm:") Layout.fillWidth: true } TextField { id: confirmPassword Layout.fillWidth: true placeholderText: i18n("Enter your Ring account password") onTextChanged: { // contactViewPage.changed() } } } Image { fillMode: Image.PreserveAspectFit Layout.fillHeight: true Layout.preferredWidth: 30 width: 30 source: "image://icon/dialog-ok" MouseArea { anchors.fill: parent onClicked: { object.revoke(confirmPassword.text) deviceDelegateRect.state = "revokingProgress" } } } Image { fillMode: Image.PreserveAspectFit Layout.fillHeight: true Layout.preferredWidth: 30 width: 30 source: "image://icon/dialog-cancel" MouseArea { anchors.fill: parent onClicked: { deviceDelegateRect.state = "*" } } } Behavior on x { NumberAnimation {duration: 200} } Behavior on y { NumberAnimation {duration: 200} } } RowLayout { id: renameForm x: deviceList.width width: parent.width height: parent.height TextField { anchors.verticalCenter: parent.verticalCenter id: deviceName text: name Layout.fillWidth: true placeholderText: i18n("Enter a name for this device") onTextChanged: { // contactViewPage.changed() } } Image { fillMode: Image.PreserveAspectFit Layout.fillHeight: true Layout.preferredWidth: 30 width: 30 source: "image://icon/dialog-ok" MouseArea { anchors.fill: parent onClicked: { name = deviceName.text deviceDelegateRect.state = "*" } } } Behavior on x { NumberAnimation {duration: 200} } } RowLayout { id: revoking y: height width: parent.width height: parent.height BusyIndicator { id: registrationIndicator anchors.margins: 9 Layout.fillHeight: false } Label { text: i18n("Revokation in progress") color: activePalette.text Layout.fillWidth: true Layout.fillHeight: true } Behavior on y { NumberAnimation {duration: 200} } } Rectangle { height: 1 opacity: 0.2 width: parent.width color: inactivePalette.text anchors.bottom: parent.bottom } states: [ State { name: "beginRevoke" PropertyChanges { target: infoView x: -deviceList.width } PropertyChanges { target: revokeForm x: 0 } }, State { name: "revokingProgress" extend: "beginRevoke" PropertyChanges { target: revoking y: 0 } PropertyChanges { target: revokeForm y: -revokeForm.height } }, State { name: "beginEdit" PropertyChanges { target: infoView x: -deviceList.width } PropertyChanges { target: renameForm x: 0 } } ] } } ColumnLayout { anchors.fill: parent ListView { id: deviceListView delegate: deviceDelegate Layout.fillHeight: true Layout.fillWidth: true } Rectangle { id: addDevicePanel height: 30 Layout.fillWidth: true color: "green" clip: true ColumnLayout { anchors.fill: parent Text { id: exportButton height: 30 Layout.preferredHeight: 30 Layout.fillWidth: true text: i18n("Link another device to the account") horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter color: "red" MouseArea { anchors.fill: parent onClicked: { console.log("click click") } } } Text { text: i18n("Your pin is:") } // Text { // text: "2C33721B" // Layout.fillWidth: true // font.pointSize: 16 // horizontalAlignment: Text.AlignHCenter // // } Text { wrapMode: Text.WordWrap Layout.fillWidth: true text: i18n("To complete the process, you need to open Ring on the new device. Create a new account with \"Link this device to an account\". Your pin is valid for 10 minutes.") } Text { text: i18n("Close") Layout.fillWidth: true horizontalAlignment: Text.AlignHCenter } } Behavior on height { NumberAnimation {duration: 200} } states: [ State { name: "enterPassword" PropertyChanges { target: exportButton y: -exportButton.height } PropertyChanges { target: addDevicePanel height: 90 } } ] } } onAccountChanged: { if (!account) return deviceListView.model = account.ringDeviceModel } } diff --git a/src/accountview/qml/pages/network.qml b/src/accountview/qml/pages/network.qml new file mode 100644 index 00000000..35761aef --- /dev/null +++ b/src/accountview/qml/pages/network.qml @@ -0,0 +1,102 @@ +/*************************************************************************** +* Copyright (C) 2018 by Bluesystems * +* Author : Emmanuel Lepage Vallee * +* * +* This program 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. * +* * +* This program 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 this program. If not, see . * +**************************************************************************/ +import QtQuick 2.8 +import org.kde.kirigami 2.5 as Kirigami +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.0 +import net.lvindustries.ringqtquick 1.0 as RingQtQuick +import org.kde.playground.kquickview 1.0 as KQuickItemViews + +/** + * This page contains the most basic elements necessary to create a SIP or + * Ring/Jami account. + */ +Page { + Kirigami.FormLayout { + anchors.fill: parent + /*KQuickItemViews.RoleBinder.modelRole: "alias" + KQuickItemViews.RoleBinder.objectProperty: "text" + Kirigami.FormData.label: i18n("Alias")*/ + + SpinBox { + Kirigami.FormData.label: i18n("localPort") + KQuickItemViews.RoleBinder.objectProperty: "value" + KQuickItemViews.RoleBinder.modelRole: "localPort" + RingQtQuick.FieldStatus.name: "localPort" + visible: RingQtQuick.FieldStatus.available + } + + CheckBox { + Kirigami.FormData.label: i18n("publishedSameAsLocal") + KQuickItemViews.RoleBinder.objectProperty: "checked" + KQuickItemViews.RoleBinder.modelRole: "publishedSameAsLocal" + RingQtQuick.FieldStatus.name: "publishedSameAsLocal" + visible: RingQtQuick.FieldStatus.available + } + + SpinBox { + Kirigami.FormData.label: i18n("publishedPort") + KQuickItemViews.RoleBinder.objectProperty: "value" + KQuickItemViews.RoleBinder.modelRole: "publishedPort" + RingQtQuick.FieldStatus.name: "publishedPort" + visible: RingQtQuick.FieldStatus.available + } + + TextField { + Kirigami.FormData.label: i18n("publishedAddress") + KQuickItemViews.RoleBinder.objectProperty: "text" + KQuickItemViews.RoleBinder.modelRole: "publishedAddress" + RingQtQuick.FieldStatus.name: "publishedAddress" + visible: RingQtQuick.FieldStatus.available + readOnly: RingQtQuick.FieldStatus.readOnly + } + + SpinBox { + Kirigami.FormData.label: i18n("audioPortMin") + KQuickItemViews.RoleBinder.objectProperty: "value" + KQuickItemViews.RoleBinder.modelRole: "audioPortMin" + RingQtQuick.FieldStatus.name: "audioPortMin" + visible: RingQtQuick.FieldStatus.available + } + + SpinBox { + Kirigami.FormData.label: i18n("audioPortMax") + KQuickItemViews.RoleBinder.objectProperty: "value" + KQuickItemViews.RoleBinder.modelRole: "audioPortMax" + RingQtQuick.FieldStatus.name: "audioPortMax" + visible: RingQtQuick.FieldStatus.available + } + + SpinBox { + Kirigami.FormData.label: i18n("videoPortMin") + KQuickItemViews.RoleBinder.objectProperty: "value" + KQuickItemViews.RoleBinder.modelRole: "videoPortMin" + RingQtQuick.FieldStatus.name: "videoPortMin" + visible: RingQtQuick.FieldStatus.available + } + + SpinBox { + Kirigami.FormData.label: i18n("videoPortMax") + KQuickItemViews.RoleBinder.objectProperty: "value" + KQuickItemViews.RoleBinder.modelRole: "videoPortMax" + RingQtQuick.FieldStatus.name: "videoPortMax" + visible: RingQtQuick.FieldStatus.available + } + + } +} diff --git a/src/accountview/qml/pages/ringtones.qml b/src/accountview/qml/pages/ringtones.qml new file mode 100644 index 00000000..047f25b8 --- /dev/null +++ b/src/accountview/qml/pages/ringtones.qml @@ -0,0 +1,48 @@ +/*************************************************************************** +* Copyright (C) 2018 by Bluesystems * +* Author : Emmanuel Lepage Vallee * +* * +* This program 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. * +* * +* This program 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 this program. If not, see . * +**************************************************************************/ +import QtQuick 2.8 +import org.kde.kirigami 2.5 as Kirigami +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.0 +import org.kde.playground.kquickview 1.0 as KQuickItemViews + +/** + * This page contains the most basic elements necessary to create a SIP or + * Ring/Jami account. + */ +Page { + ListView { + anchors.fill: parent + model: RingtoneModel + delegate: Kirigami.SwipeListItem { + width: parent.width + Label { + text: display + } + } + } + + Kirigami.FormLayout { + anchors.fill: parent + + //KQuickItemViews.RoleBinder.modelRole: "alias" + //KQuickItemViews.RoleBinder.objectProperty: "text" + //Kirigami.FormData.label: i18n("Alias") + + } +} diff --git a/src/accountview/qml/pages/security.qml b/src/accountview/qml/pages/security.qml new file mode 100644 index 00000000..485e8bb5 --- /dev/null +++ b/src/accountview/qml/pages/security.qml @@ -0,0 +1,179 @@ +/*************************************************************************** +* Copyright (C) 2018 by Bluesystems * +* Author : Emmanuel Lepage Vallee * +* * +* This program 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. * +* * +* This program 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 this program. If not, see . * +**************************************************************************/ +import QtQuick 2.8 +import org.kde.kirigami 2.5 as Kirigami +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.0 +import org.kde.playground.kquickview 1.0 as KQuickItemViews +import net.lvindustries.ringqtquick 1.0 as RingQtQuick +import "../" as AccountWidgets + +/** + * This page contains the most basic elements necessary to create a SIP or + * Ring/Jami account. + */ +Page { + ColumnLayout { + anchors.fill: parent + + AccountWidgets.SecurityLevel { + Layout.fillWidth: true + level: securityLevel + } + + GroupBox { + title: i18n("Security related suggestions") + Layout.fillWidth: true + Layout.preferredHeight: 250 + ListView { + id: securityIssues + anchors.fill: parent + model: securityEvaluationModel + delegate: Kirigami.SwipeListItem { + id: swipeItem + width: parent.width + RowLayout { + width: parent.width + KQuickItemViews.DecorationAdapter { + pixmap: decoration + Layout.preferredWidth: swipeItem.implicitHeight + Layout.minimumWidth: swipeItem.implicitHeight + } + Label { + text: display + Layout.fillWidth: true + } + } + } + } + } + + Kirigami.FormLayout { + Layout.fillWidth: true + + CheckBox { + Kirigami.FormData.label: i18n("Encr&ypt media streams (SRTP)") + KQuickItemViews.RoleBinder.modelRole: "srtpEnabled" // + KQuickItemViews.RoleBinder.objectProperty: "checked" + RingQtQuick.FieldStatus.name: "srtpEnabled" + visible: RingQtQuick.FieldStatus.available + } + + CheckBox { + Kirigami.FormData.label: i18n("Fallback on RTP on SDES failure") + KQuickItemViews.RoleBinder.modelRole: "srtpRtpFallback" // * +* * +* This program 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. * +* * +* This program 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 this program. If not, see . * +**************************************************************************/ +import QtQuick 2.8 +import org.kde.kirigami 2.5 as Kirigami +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.0 +import org.kde.playground.kquickview 1.0 as KQuickItemViews + +Item { + property int level: 0 + height: Kirigami.Theme.defaultFont.pointSize*3 + implicitHeight: Kirigami.Theme.defaultFont.pointSize*3 + Rectangle { + id: securityLevel + x: 20 + width: parent.width - 40 + height: parent.height + + color: "transparent" + border.width: 1 + border.color: inactivePalette.text + radius: 99 + clip: true + + ListModel { + id: securityLevels + + ListElement { text: /*i18n(*/ "None" } + ListElement { text: /*i18n(*/ "Weak" } + ListElement { text: /*i18n(*/ "Medium" } + ListElement { text: /*i18n(*/ "Acceptable" } + ListElement { text: /*i18n(*/ "Strong" } + ListElement { text: /*i18n(*/ "Complete" } + } + + Rectangle { + height: parent.height + width: (securityLevel.width / 6) * (level+1) + color: level < 2 ? Kirigami.Theme.negativeTextColor : ( + level == 2 ? Kirigami.Theme.neutralTextColor : + Kirigami.Theme.positiveTextColor + ) + radius: 99 + } + + Row { + anchors.fill: parent + Repeater { + model: securityLevels + delegate: RowLayout { + height: securityLevel.height + width: securityLevel.width / 6 + Label { + Layout.fillWidth: true + Layout.fillHeight: true + horizontalAlignment: Text.AlignHCente + text: model.text + } + Rectangle { + Layout.fillHeight: true + width: 1 + color: inactivePalette.text + } + } + } + } + } +} diff --git a/src/actioncollection.cpp b/src/actioncollection.cpp index 86231e4a..f3119b07 100644 --- a/src/actioncollection.cpp +++ b/src/actioncollection.cpp @@ -1,575 +1,577 @@ /*************************************************************************** * Copyright (C) 2009-2015 by Savoir-Faire Linux * * Author : Emmanuel Lepage Vallee * * * * This program 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. * * * * This program 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 this program. If not, see . * **************************************************************************/ #include "actioncollection.h" //Qt #include #include #include #include #include #include #include //KDE #include #include #include #include #include #include #include #include #include #include //Ring #include "globalinstances.h" #include "ringapplication.h" #include "conf/configurationdialog.h" #include "icons/icons.h" #include "klib/kcfg_settings.h" #include #include #include #include #include #include #include