diff --git a/CMakeLists.txt b/CMakeLists.txt index f9534f6b..25f9f0d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,191 +1,192 @@ 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) +FIND_PACKAGE (KQuickItemViews QUIET 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) +IF(NOT KQuickItemViews_FOUND AND IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/libkquickitemviews/") + SET(LibKQuickItemViews_SRC "${CMAKE_CURRENT_SOURCE_DIR}/libkquickitemviews/") + SET(libkquickitemviews_FOUND true) + ADD_DEFINITIONS(-DKQUICKITEMVIEWS_USE_STATIC_PLUGIN=1) +ELSEIF(NOT KQuickItemViews_FOUND) + message(FATAL_ERROR "Download KQuickItemViews from `git clone https://anongit.kde.org/kquickitemviews/` and move it to `path/to/ring-kde/libkquickitemviews`") 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) +IF(LibKQuickItemViews_SRC) # Use the .a, not the .so; SET(ENABLE_STATIC true) - ADD_SUBDIRECTORY(${LibKQuickView_SRC}) + ADD_SUBDIRECTORY(${LibKQuickItemViews_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 cefd47f0..9d219e93 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,469 +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 + kquickitemviews # 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 bd44976e..d19ff70b 100644 --- a/src/accountview/accountview.qrc +++ b/src/accountview/accountview.qrc @@ -1,17 +1,18 @@ qml/accountlist.qml qml/presenceselector.qml qml/accounts.qml qml/accountdialog.qml qml/securitylevel.qml + qml/securitytip.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 index 29fe0af7..7887d1c3 100644 --- a/src/accountview/qml/accountdialog.qml +++ b/src/accountview/qml/accountdialog.qml @@ -1,108 +1,111 @@ /*************************************************************************** * 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 +import org.kde.playground.kquickitemviews 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 + Layout.maximumWidth: 300 } KQuickItemViews.IndexView { Layout.fillHeight: true Layout.fillWidth: true - modelIndex: accountTree.selectedAccount ? accountTree.selectedAccount.index : undefined + 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 + interactive : false 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 332e0879..33c0f3db 100644 --- a/src/accountview/qml/accountlist.qml +++ b/src/accountview/qml/accountlist.qml @@ -1,296 +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 +import org.kde.playground.kquickitemviews 1.0 as KQuickItemViews 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 } Item { Layout.fillHeight: true - KQuickView.DecorationAdapter { + KQuickItemViews.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 { + KQuickItemViews.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 index be3d3f92..17399691 100644 --- a/src/accountview/qml/accounts.qml +++ b/src/accountview/qml/accounts.qml @@ -1,163 +1,170 @@ /*************************************************************************** * 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 +import org.kde.playground.kquickitemviews 1.0 as KQuickItemViews +import net.lvindustries.ringqtquick 1.0 as RingQtQuick -Rectangle { - property QtObject selectedAccount: null - - SystemPalette { - id: activePalette - colorGroup: SystemPalette.Active - } - - color: activePalette.window +ListView { + id: accountList - Kirigami.CardsListView { - id: gridView - - Component { - id: codecDelegate - Kirigami.Card { - id: card - width: gridView.width - height: content.height + 20 - implicitHeight: content.height + 20 + property QtObject selectedAccount: null - property var pModel : ProfileModel.profilesForPerson(model.object) + spacing : 10 + model: ProfileModel + delegate: codecDelegate + + Component { + id: codecDelegate + Kirigami.Card { + id: card + x: 5 + width: accountList.width - 10 + 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 + } - ColumnLayout { - id: content - height: implicitHeight + ListView { + id: profileList + interactive: false + model: pModel + implicitHeight: contentHeight + height: contentHeight 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 } } - } + 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 - } + Rectangle { + opacity: 0.9 + anchors.fill: parent + color: object == accountList.selectedAccount ? activePalette.highlight : registrationStateColor + } - KQuickItemViews.DecorationAdapter { - width: check.implicitHeight - height: check.implicitHeight - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - pixmap: securityLevelIcon - } + KQuickItemViews.DecorationAdapter { + width: check.implicitHeight + height: check.implicitHeight + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + pixmap: securityLevelIcon + } - readonly property bool __separatorVisible: listItem.separatorVisible + 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); - } + 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 - } + } + RowLayout { + width: parent.width + height: check.implicitHeight*2 + CheckBox { + id: check + width: height + checked: model.enabled + } - Label { - text: alias - Layout.fillWidth: true - } + KQuickItemViews.DecorationAdapter { + height: check.implicitHeight + width: check.implicitHeight + pixmap: decoration } - actions: [ - Kirigami.Action { - text: i18n("Remove") - iconName: "list-remove" - onTriggered: {} - } - ] - onPressedChanged: { - selectedAccount = object + Label { + text: alias + Layout.fillWidth: true + } + } + actions: [ + Kirigami.Action { + text: i18n("Remove") + iconName: "list-remove" + onTriggered: {} } + ] + + onPressedChanged: { + accountList.selectedAccount = object } } } } } + } - footer: OutlineButton { - height: 50 - label: i18n("Add an account") - width: parent.width + RingQtQuick.AccountBuilder { + id: accountBuilder + } + + footer: OutlineButtons { + function callback(index) { + selectedAccount = accountBuilder.buildFor(index) } - anchors.fill: parent - model: ProfileModel - delegate: codecDelegate + width: accountList.width + rows: 2 + padding: 5 + model: accountBuilder + action: callback + } + + Component.onCompleted: { + accountList.selectedAccount = AvailableAccountModel.currentDefaultAccount() } } diff --git a/src/accountview/qml/credentials.qml b/src/accountview/qml/credentials.qml index c70d3537..c8feb9ef 100644 --- a/src/accountview/qml/credentials.qml +++ b/src/accountview/qml/credentials.qml @@ -1,128 +1,128 @@ /*************************************************************************** * 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 org.kde.playground.kquickview 1.0 as KQuickItemViews +import org.kde.playground.kquickitemviews 1.0 as KQuickItemViews import QtQuick.Controls 2.0 import QtQuick.Layouts 1.0 import RingQmlWidgets 1.0 Rectangle { property var account: null 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 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") } ] } } sourceComponent: isCategory ? categoryDelegate : credentialDelegate } } OutlineButtons { Layout.fillWidth: true height: 50 implicitHeight: 50 model: account ? account.credentialModel.availableTypeModel : null } } } diff --git a/src/accountview/qml/pages/advanced.qml b/src/accountview/qml/pages/advanced.qml index ec9589d9..c6050976 100644 --- a/src/accountview/qml/pages/advanced.qml +++ b/src/accountview/qml/pages/advanced.qml @@ -1,178 +1,183 @@ /*************************************************************************** * 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 +import org.kde.playground.kquickitemviews 1.0 as KQuickItemViews Page { Kirigami.FormLayout { anchors.fill: parent + Kirigami.Separator { + Kirigami.FormData.label: i18n("Registration") + Kirigami.FormData.isSection: true + } + 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 + enabled: hasCustomUserAgent + Kirigami.FormData.checkable: true + Kirigami.FormData.checked: hasCustomUserAgent + Kirigami.FormData.onCheckedChanged: {hasCustomUserAgent = checked} + } + + Kirigami.Separator { + Kirigami.FormData.label: i18n("Incoming calls") + Kirigami.FormData.isSection: true } CheckBox { - Kirigami.FormData.label: i18n("allowIncomingFromUnknown") + Kirigami.FormData.label: i18n("Allow calls from unknown peers") KQuickItemViews.RoleBinder.modelRole: "allowIncomingFromUnknown" KQuickItemViews.RoleBinder.objectProperty: "checked" RingQtQuick.FieldStatus.name: "allowIncomingFromUnknown" visible: RingQtQuick.FieldStatus.available } CheckBox { - Kirigami.FormData.label: i18n("allowIncomingFromHistory") + Kirigami.FormData.label: i18n("Allow calls from previously called peers") KQuickItemViews.RoleBinder.modelRole: "allowIncomingFromHistory" KQuickItemViews.RoleBinder.objectProperty: "checked" RingQtQuick.FieldStatus.name: "allowIncomingFromHistory" visible: RingQtQuick.FieldStatus.available } CheckBox { - Kirigami.FormData.label: i18n("allowIncomingFromContact") + Kirigami.FormData.label: i18n("Allow calls from your contacts") 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 + Kirigami.Separator { + Kirigami.FormData.label: i18n("Negotiation") + Kirigami.FormData.isSection: true } TextField { - Kirigami.FormData.label: i18n("proxy") + Kirigami.FormData.label: i18n("Proxy server URL") 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 + Kirigami.FormData.checkable: true + Kirigami.FormData.checked: hasProxy + enabled: hasProxy + Kirigami.FormData.onCheckedChanged: {hasProxy = checked} } TextField { - Kirigami.FormData.label: i18n("sipStunServer") + Kirigami.FormData.label: i18n("STUN server URL") 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 + Kirigami.FormData.checkable: true + Kirigami.FormData.checked: sipStunEnabled + enabled: sipStunEnabled + Kirigami.FormData.onCheckedChanged: {sipStunEnabled = checked} } TextField { - Kirigami.FormData.label: i18n("turnServer") + Kirigami.FormData.label: i18n("TURN server URL") KQuickItemViews.RoleBinder.modelRole: "turnServer" KQuickItemViews.RoleBinder.objectProperty: "text" RingQtQuick.FieldStatus.name: "turnServer" visible: RingQtQuick.FieldStatus.available readOnly: RingQtQuick.FieldStatus.readOnly + Kirigami.FormData.checkable: true + Kirigami.FormData.checked: turnServerEnabled + enabled: turnServerEnabled + Kirigami.FormData.onCheckedChanged: {turnServerEnabled = checked} + } + + Kirigami.Separator { + Kirigami.FormData.label: i18n("Features") + Kirigami.FormData.isSection: true } CheckBox { - Kirigami.FormData.label: i18n("upnpEnabled") + Kirigami.FormData.label: i18n("Enable Plug and Play (UPnP)") KQuickItemViews.RoleBinder.modelRole: "isUpnpEnabled" KQuickItemViews.RoleBinder.objectProperty: "checked" RingQtQuick.FieldStatus.name: "isUpnpEnabled" visible: RingQtQuick.FieldStatus.available } CheckBox { - Kirigami.FormData.label: i18n("presenceEnabled") + Kirigami.FormData.label: i18n("Enable presence broadcasting") KQuickItemViews.RoleBinder.modelRole: "presenceEnabled" KQuickItemViews.RoleBinder.objectProperty: "checked" RingQtQuick.FieldStatus.name: "presenceEnabled" visible: RingQtQuick.FieldStatus.available } CheckBox { - Kirigami.FormData.label: i18n("isVideoEnabled") + Kirigami.FormData.label: i18n("Enable video calls") 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") + Kirigami.FormData.label: i18n("Concurrent call limit") 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 + Kirigami.FormData.checkable: true + Kirigami.FormData.checked: hasActiveCallLimit + Kirigami.FormData.onCheckedChanged: {hasActiveCallLimit = checked} + } + + Row { + Kirigami.FormData.label: i18n("DTMF type") + RingQtQuick.FieldStatus.name: "dTMFType" + visible: RingQtQuick.FieldStatus.available + RadioButton { + text: i18n("DTMF over SIP") + KQuickItemViews.RoleBinder.modelRole: "dTMFType" + KQuickItemViews.RoleBinder.objectProperty: "checked" + } + RadioButton { + text: i18n("DTMF over RTP") + } } } } diff --git a/src/accountview/qml/pages/basic.qml b/src/accountview/qml/pages/basic.qml index 1c7cdd2e..a533b3c1 100644 --- a/src/accountview/qml/pages/basic.qml +++ b/src/accountview/qml/pages/basic.qml @@ -1,117 +1,121 @@ /*************************************************************************** * 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 +import org.kde.playground.kquickitemviews 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.ComboBoxView { // KQuickItemViews.RoleBinder.modelRole: "profile" // KQuickItemViews.RoleBinder.objectProperty: "text" id: profile - model: ProfileModel +// model: ProfileModel Kirigami.FormData.label: i18n("Profile") +// textRole: "display" + selectionModel: ProfileModel.getAccountSelectionModel(object) } - ComboBox { + KQuickItemViews.ComboBoxView { id: protocol // KQuickItemViews.RoleBinder.modelRole: "protocol" // KQuickItemViews.RoleBinder.objectProperty: "text" - model: object.protocolModel +// model: object.protocolModel Kirigami.FormData.label: i18n("Protocol") +// editable: RingQtQuick.FieldStatus.readOnly + selectionModel: protocolModel.selectionModel } 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/accountview/qml/pages/credentials.qml b/src/accountview/qml/pages/credentials.qml index 8bf7a568..590e62a8 100644 --- a/src/accountview/qml/pages/credentials.qml +++ b/src/accountview/qml/pages/credentials.qml @@ -1,175 +1,186 @@ /*************************************************************************** * 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 org.kde.playground.kquickitemviews 1.0 as KQuickItemViews import QtQuick.Controls 2.0 import QtQuick.Layouts 1.0 import RingQmlWidgets 1.0 Page { property var account: object property var details: credentialDetails SystemPalette { id: activePalette colorGroup: SystemPalette.Active } SystemPalette { id: inactivePalette colorGroup: SystemPalette.Inactive } 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.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 { + TreeHelper { + id: creationHelper + model: account ? account.credentialModel.availableTypeModel : null + } + Layout.fillWidth: true height: 50 + padding: 5 implicitHeight: 50 model: account ? account.credentialModel.availableTypeModel : null + action: function(index) { + account.credentialModel.addCredentials( + creationHelper.getIndex(index, undefined) + ) + } } 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" + echoMode: TextInput.Password } } } } } } diff --git a/src/accountview/qml/pages/network.qml b/src/accountview/qml/pages/network.qml index 35761aef..78746980 100644 --- a/src/accountview/qml/pages/network.qml +++ b/src/accountview/qml/pages/network.qml @@ -1,102 +1,136 @@ /*************************************************************************** * 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 +import org.kde.playground.kquickitemviews 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")*/ + Kirigami.Separator { + Kirigami.FormData.label: i18n("Network interface") + Kirigami.FormData.isSection: true + } + SpinBox { Kirigami.FormData.label: i18n("localPort") KQuickItemViews.RoleBinder.objectProperty: "value" KQuickItemViews.RoleBinder.modelRole: "localPort" RingQtQuick.FieldStatus.name: "localPort" visible: RingQtQuick.FieldStatus.available + from: 1024 + to: 65535 + } + + Kirigami.Separator { + Kirigami.FormData.label: i18n("Published address") + Kirigami.FormData.isSection: true } - CheckBox { - Kirigami.FormData.label: i18n("publishedSameAsLocal") + RadioButton { + Kirigami.FormData.label: i18n("Same as the local parameters") KQuickItemViews.RoleBinder.objectProperty: "checked" KQuickItemViews.RoleBinder.modelRole: "publishedSameAsLocal" RingQtQuick.FieldStatus.name: "publishedSameAsLocal" visible: RingQtQuick.FieldStatus.available } + RadioButton { + id: customPublished + Kirigami.FormData.label: i18n("Use custom values") + } + SpinBox { - Kirigami.FormData.label: i18n("publishedPort") + Kirigami.FormData.label: i18n("Published port") KQuickItemViews.RoleBinder.objectProperty: "value" KQuickItemViews.RoleBinder.modelRole: "publishedPort" RingQtQuick.FieldStatus.name: "publishedPort" visible: RingQtQuick.FieldStatus.available + enabled: customPublished.checked + from: 1024 + to: 65535 } TextField { - Kirigami.FormData.label: i18n("publishedAddress") + Kirigami.FormData.label: i18n("Published address") KQuickItemViews.RoleBinder.objectProperty: "text" KQuickItemViews.RoleBinder.modelRole: "publishedAddress" RingQtQuick.FieldStatus.name: "publishedAddress" visible: RingQtQuick.FieldStatus.available readOnly: RingQtQuick.FieldStatus.readOnly + enabled: customPublished.checked + } + + Kirigami.Separator { + Kirigami.FormData.label: i18n("RTP configuration (not recommended)") + Kirigami.FormData.isSection: true } SpinBox { - Kirigami.FormData.label: i18n("audioPortMin") + Kirigami.FormData.label: i18n("Minimum audio port") KQuickItemViews.RoleBinder.objectProperty: "value" KQuickItemViews.RoleBinder.modelRole: "audioPortMin" RingQtQuick.FieldStatus.name: "audioPortMin" visible: RingQtQuick.FieldStatus.available + from: 1024 + to: 65535 } SpinBox { - Kirigami.FormData.label: i18n("audioPortMax") + Kirigami.FormData.label: i18n("Maximum audio port") KQuickItemViews.RoleBinder.objectProperty: "value" KQuickItemViews.RoleBinder.modelRole: "audioPortMax" RingQtQuick.FieldStatus.name: "audioPortMax" visible: RingQtQuick.FieldStatus.available + from: 1024 + to: 65535 } SpinBox { - Kirigami.FormData.label: i18n("videoPortMin") + Kirigami.FormData.label: i18n("Minimum video port") KQuickItemViews.RoleBinder.objectProperty: "value" KQuickItemViews.RoleBinder.modelRole: "videoPortMin" RingQtQuick.FieldStatus.name: "videoPortMin" visible: RingQtQuick.FieldStatus.available + from: 1024 + to: 65535 } SpinBox { - Kirigami.FormData.label: i18n("videoPortMax") + Kirigami.FormData.label: i18n("Maximum video port") KQuickItemViews.RoleBinder.objectProperty: "value" KQuickItemViews.RoleBinder.modelRole: "videoPortMax" RingQtQuick.FieldStatus.name: "videoPortMax" visible: RingQtQuick.FieldStatus.available + from: 1024 + to: 65535 } } } diff --git a/src/accountview/qml/pages/ringtones.qml b/src/accountview/qml/pages/ringtones.qml index 047f25b8..aaf0118c 100644 --- a/src/accountview/qml/pages/ringtones.qml +++ b/src/accountview/qml/pages/ringtones.qml @@ -1,48 +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 +import org.kde.playground.kquickitemviews 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 index 485e8bb5..45b6d984 100644 --- a/src/accountview/qml/pages/security.qml +++ b/src/accountview/qml/pages/security.qml @@ -1,179 +1,198 @@ /*************************************************************************** * 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 org.kde.playground.kquickitemviews 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 + informationCount: object.securityEvaluationModel.informationCount + warningCount: object.securityEvaluationModel.warningCount + issueCount: object.securityEvaluationModel.issueCount + errorCount: object.securityEvaluationModel.errorCount + model: securityEvaluationModel } - GroupBox { - title: i18n("Security related suggestions") + Kirigami.FormLayout { 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.Separator { + Kirigami.FormData.label: i18n("TLS Certificates") + Kirigami.FormData.isSection: true + } + + TextField { + Kirigami.FormData.label: i18n("Authority certificate(s)") + KQuickItemViews.RoleBinder.modelRole: "tlsCaListCertificate" // * * * * 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 org.kde.playground.kquickitemviews 1.0 as KQuickItemViews +/** + * Display how secure the account is and how to improve it. + */ Item { + id: securityLevel 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 + property int informationCount: 0 + property int warningCount: 0 + property int issueCount: 0 + property int errorCount: 0 + property bool displayIssues: false + property QtObject model: null + property real issuesHeight: 0 + height: Kirigami.Theme.defaultFont.pointSize*5 + issuesHeight + implicitHeight: Kirigami.Theme.defaultFont.pointSize*5 + issuesHeight + + ColumnLayout { + width: parent.width - 10 height: parent.height + anchors.horizontalCenter: parent.horizontalCenter - 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" } + Behavior on height { + NumberAnimation {duration: 200} } 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 - } + id: securityLevelIndicator + x: 20 + anchors.leftMargin: 20 + Layout.fillWidth: true + Layout.preferredHeight: Kirigami.Theme.defaultFont.pointSize*3 + issuesHeight + + color: "transparent" + border.width: 1 + border.color: inactivePalette.text + radius: displayIssues ? 5 : 99 + clip: true + + Behavior on radius { + NumberAnimation {duration: 200} + } + + Behavior on Layout.preferredHeight { + NumberAnimation { duration: 200 } + } + + 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: Kirigami.Theme.defaultFont.pointSize*3 + width: (securityLevelIndicator.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 + Behavior on width { + NumberAnimation {duration: 200} + } + } + + MouseArea { + width: parent.width + height: Kirigami.Theme.defaultFont.pointSize*3 + Row { + anchors.fill: parent + Repeater { + model: securityLevels + delegate: RowLayout { + height: Kirigami.Theme.defaultFont.pointSize*3 + width: securityLevelIndicator.width / 6 + Text { + Layout.fillWidth: true + Layout.fillHeight: true + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + text: model.text + font.bold: true + color: activePalette.text + } + Rectangle { + Layout.fillHeight: true + width: 1 + color: inactivePalette.text + } + } } - Rectangle { - Layout.fillHeight: true - width: 1 - color: inactivePalette.text + } + + onClicked: { + displayIssues = !displayIssues + } + } + + Loader { + y: Kirigami.Theme.defaultFont.pointSize*3 + x: 1 + active: displayIssues + sourceComponent: ListView { + id: securityIssues + interactive: false + model: securityLevel.model + height: contentHeight + width: securityLevelIndicator.width - 2 + delegate: Kirigami.SwipeListItem { + id: swipeItem + width: parent.width + RowLayout { + anchors.fill: parent + KQuickItemViews.DecorationAdapter { + pixmap: decoration + Layout.preferredWidth: swipeItem.implicitHeight + Layout.minimumWidth: swipeItem.implicitHeight + Layout.fillHeight: true + } + Label { + text: display + Layout.fillWidth: true + Layout.fillHeight: true + } + } + } + + onContentHeightChanged: { + // 2 is to avoid hiding the border + securityLevel.issuesHeight = contentHeight + 2 } } + + onActiveChanged: { + if (!active) + securityLevel.issuesHeight = 0 + } + } + } + + MouseArea { + Layout.preferredHeight: Kirigami.Theme.defaultFont.pointSize*2 + Layout.fillWidth: true + RowLayout { + anchors.fill: parent + + Item { Layout.fillWidth: true; height: 1 } + + Image { + Layout.preferredHeight: Kirigami.Theme.defaultFont.pointSize*2 + Layout.preferredWidth: Kirigami.Theme.defaultFont.pointSize*2 + source: "image://icon/dialog-information" + } + + Label { + Layout.fillWidth: true + text: informationCount + i18n(" tips") + } + + Image { + Layout.preferredHeight: Kirigami.Theme.defaultFont.pointSize*2 + Layout.preferredWidth: Kirigami.Theme.defaultFont.pointSize*2 + source: "image://icon/dialog-warning" + } + + Label { + Layout.fillWidth: true + text: warningCount + i18n(" warnings") + } + + Image { + Layout.preferredHeight: Kirigami.Theme.defaultFont.pointSize*2 + Layout.preferredWidth: Kirigami.Theme.defaultFont.pointSize*2 + source: "image://icon/task-attempt" + } + + Label { + Layout.fillWidth: true + text: issueCount + i18n(" issues") + } + + Image { + Layout.preferredHeight: Kirigami.Theme.defaultFont.pointSize*2 + Layout.preferredWidth: Kirigami.Theme.defaultFont.pointSize*2 + source: "image://icon/dialog-error" + } + + Label { + Layout.fillWidth: true + text: errorCount + i18n(" errors") + } + + Item { Layout.fillWidth: true; height: 1 } + } + + onClicked: { + displayIssues = !displayIssues } } } } diff --git a/src/accountview/qml/pages/ringtones.qml b/src/accountview/qml/securitytip.qml similarity index 61% copy from src/accountview/qml/pages/ringtones.qml copy to src/accountview/qml/securitytip.qml index 047f25b8..5541b66e 100644 --- a/src/accountview/qml/pages/ringtones.qml +++ b/src/accountview/qml/securitytip.qml @@ -1,48 +1,60 @@ /*************************************************************************** * 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 org.kde.playground.kquickitemviews 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 +Rectangle { + property alias message: label.text + property alias icon: img.source + default property alias contents: buttons.children + height: content.implicitHeight + 10 + implicitHeight: content.implicitHeight + 10 + anchors.horizontalCenter: parent.horizontalCenter + + color: "transparent" + radius: 3 + border.width: 1 + border.color: inactivePalette.text + anchors.margins: 5 + + RowLayout { + id: content + width: parent.width + x: 5 + y: 5 + Image { + id: img + fillMode: Image.PreserveAspectFit + Layout.preferredWidth: parent.height + } + ColumnLayout { + Layout.fillWidth: true Label { - text: display + id: label + Layout.fillWidth: true + wrapMode: Text.WordWrap + } + RowLayout { + id: buttons } } } - - Kirigami.FormLayout { - anchors.fill: parent - - //KQuickItemViews.RoleBinder.modelRole: "alias" - //KQuickItemViews.RoleBinder.objectProperty: "text" - //Kirigami.FormData.label: i18n("Alias") - - } } diff --git a/src/actioncollection.cpp b/src/actioncollection.cpp index f3119b07..6eb1bb69 100644 --- a/src/actioncollection.cpp +++ b/src/actioncollection.cpp @@ -1,577 +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