From 5e9090175fa2e6e96fa208cea8c50b4549e1b7e5 Mon Sep 17 00:00:00 2001 From: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> Date: Tue, 23 Apr 2019 14:57:00 -0400 Subject: [PATCH] settings: refactor - fixes programmatic slot triggering - overhauls ui - standardizes layouts - fixes file path elide - adds win10 style toggle switches - fixes toggle state comparisons - fixes registry settings - fixes minimize on close function - fixes navigate to settings from tray icon - removes blocking calls to stopPreview - enhances system notifications - fixes codec selection - fixes photobooth in settings - fixes avatar cropping and scaling Change-Id: I1fb7669e3cd5dc1c23743ccfe0b54c3e6ac5078b --- accountlistmodel.cpp | 2 +- advancedsettingswidget.cpp | 67 +- advancedsettingswidget.ui | 2504 ++++----- advancedsipsettingwidget.cpp | 129 +- advancedsipsettingwidget.h | 15 +- advancedsipsettingwidget.ui | 1419 +++--- bannedcontactswidget.ui | 129 - banneditemwidget.cpp | 57 + photoboothdialog.h => banneditemwidget.h | 29 +- banneditemwidget.ui | 161 + callwidget.cpp | 8 +- callwidget.ui | 15 +- conversationitemdelegate.cpp | 4 +- conversationitemdelegate.h | 2 +- copy-runtime-files.ps1 | 2 +- deleteaccountdialog.cpp | 1 + deleteaccountdialog.h | 8 +- deleteaccountdialog.ui | 39 +- deviceeditwidget.ui | 42 - deviceitemwidget.cpp | 97 + photoboothdialog.cpp => deviceitemwidget.h | 50 +- deviceitemwidget.ui | 202 + iconbutton.cpp | 43 + iconbutton.h | 42 + .../icons/baseline-desktop_windows-24px.svg | 1 + images/icons/baseline-people-24px.svg | 1 + images/icons/ic_hide_password.png | Bin 0 -> 4717 bytes images/icons/ic_show_password.png | Bin 0 -> 7530 bytes images/icons/round-add_a_photo-24px.svg | 1 + images/icons/showHide.PNG | Bin 815 -> 0 bytes images/icons/showHideTwo.PNG | Bin 449 -> 0 bytes invitebuttonswidget.cpp | 2 +- invitebuttonswidget.h | 2 +- linkdevicedialog.cpp | 116 + linkdevwidget.h => linkdevicedialog.h | 27 +- linkdevwidget.ui => linkdevicedialog.ui | 625 +-- linkdevwidget.cpp | 96 - lrcinstance.h | 5 +- main.cpp | 4 +- mainwindow.cpp | 152 +- mainwindow.h | 6 +- nameregistrationdialog.cpp | 101 + regnamedialog.h => nameregistrationdialog.h | 32 +- nameregistrationdialog.ui | 658 +++ newwizardwidget.cpp | 58 +- newwizardwidget.h | 6 +- newwizardwidget.ui | 891 ++-- passworddialog.cpp | 83 +- passworddialog.h | 8 +- passworddialog.ui | 288 +- photoboothwidget.cpp | 40 +- photoboothwidget.h | 14 +- photoboothwidget.ui | 241 +- pixbufmanipulator.cpp | 167 +- pixbufmanipulator.h | 3 - regnamedialog.cpp | 86 - regnamedialog.ui | 640 --- ressources.qrc | 7 +- ring-client-windows.sln | 118 +- ring-client-windows.vcxproj | 71 +- ring-client-windows.vcxproj.filters | 84 +- setavatardialog.cpp | 226 - setavatardialog.h | 82 - setavatardialog.ui | 226 - settingsitemwidget.cpp | 133 - settingsitemwidget.h | 50 - settingskey.h | 11 +- settingswidget.cpp | 845 ++-- settingswidget.h | 135 +- settingswidget.ui | 4502 ++++++++--------- stylesheet.css | 318 +- toggleswitch.cpp | 152 + toggleswitch.h | 85 + utils.cpp | 156 +- utils.h | 61 +- videooverlay.cpp | 1 - winsparkle | 2 +- 77 files changed, 8471 insertions(+), 8215 deletions(-) delete mode 100644 bannedcontactswidget.ui create mode 100644 banneditemwidget.cpp rename photoboothdialog.h => banneditemwidget.h (69%) create mode 100644 banneditemwidget.ui delete mode 100644 deviceeditwidget.ui create mode 100644 deviceitemwidget.cpp rename photoboothdialog.cpp => deviceitemwidget.h (61%) create mode 100644 deviceitemwidget.ui create mode 100644 iconbutton.cpp create mode 100644 iconbutton.h create mode 100644 images/icons/baseline-desktop_windows-24px.svg create mode 100644 images/icons/baseline-people-24px.svg create mode 100644 images/icons/ic_hide_password.png create mode 100644 images/icons/ic_show_password.png create mode 100644 images/icons/round-add_a_photo-24px.svg delete mode 100644 images/icons/showHide.PNG delete mode 100644 images/icons/showHideTwo.PNG create mode 100644 linkdevicedialog.cpp rename linkdevwidget.h => linkdevicedialog.h (69%) rename linkdevwidget.ui => linkdevicedialog.ui (50%) delete mode 100644 linkdevwidget.cpp create mode 100644 nameregistrationdialog.cpp rename regnamedialog.h => nameregistrationdialog.h (67%) create mode 100644 nameregistrationdialog.ui delete mode 100644 regnamedialog.cpp delete mode 100644 regnamedialog.ui delete mode 100644 setavatardialog.cpp delete mode 100644 setavatardialog.h delete mode 100644 setavatardialog.ui delete mode 100644 settingsitemwidget.cpp delete mode 100644 settingsitemwidget.h create mode 100644 toggleswitch.cpp create mode 100644 toggleswitch.h diff --git a/accountlistmodel.cpp b/accountlistmodel.cpp index 29c7e8c..adee7bc 100644 --- a/accountlistmodel.cpp +++ b/accountlistmodel.cpp @@ -69,7 +69,7 @@ QVariant AccountListModel::data(const QModelIndex &index, int role) const return QVariant(Utils::toUnderlyingValue<lrc::api::account::Status>(accountInfo.status)); case Role::Picture: case Qt::DecorationRole: - return PixbufManipulator::accountPhoto(accountInfo); + return Utils::accountPhoto(accountInfo); case Role::ID: return QVariant(QString::fromStdString(accountInfo.id)); } diff --git a/advancedsettingswidget.cpp b/advancedsettingswidget.cpp index 9f7d08e..f5c7e8c 100644 --- a/advancedsettingswidget.cpp +++ b/advancedsettingswidget.cpp @@ -1,6 +1,7 @@ /*************************************************************************** - * Copyright (C) 2019-2019 by Savoir-faire Linux * + * Copyright (C) 2019 by Savoir-faire Linux * * Author: Isa Nanic <isa.nanic@savoirfairelinux.com> * + * Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * * * * 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 * @@ -20,11 +21,11 @@ #include <QFileDialog> -#include "api/newcodecmodel.h" - #include "lrcinstance.h" #include "utils.h" +#include "api/newcodecmodel.h" + AdvancedSettingsWidget::AdvancedSettingsWidget(QWidget* parent) :QWidget(parent), ui(new Ui::AdvancedSettingsWidget) @@ -73,9 +74,28 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(QWidget* parent) connect(ui->audioDownPushButton, &QPushButton::clicked, this, &AdvancedSettingsWidget::decreaseAudioCodecPriority); connect(ui->audioUpPushButton, &QPushButton::clicked, this, &AdvancedSettingsWidget::increaseAudioCodecPriority); + ui->audioDownPushButton->setEnabled(false); + ui->audioUpPushButton->setEnabled(false); + + connect(ui->audioListWidget, &QListWidget::itemSelectionChanged, + [this] { + bool enabled = ui->audioListWidget->selectedItems().size(); + ui->audioDownPushButton->setEnabled(enabled); + ui->audioUpPushButton->setEnabled(enabled); + }); + connect(ui->videoDownPushButton, &QPushButton::clicked, this, &AdvancedSettingsWidget::decreaseVideoCodecPriority); connect(ui->videoUpPushButton, &QPushButton::clicked, this, &AdvancedSettingsWidget::increaseVideoCodecPriority); + ui->videoDownPushButton->setEnabled(false); + ui->videoUpPushButton->setEnabled(false); + + connect(ui->videoListWidget, &QListWidget::itemSelectionChanged, + [this] { + bool enabled = ui->videoListWidget->selectedItems().size(); + ui->videoDownPushButton->setEnabled(enabled); + ui->videoUpPushButton->setEnabled(enabled); + }); } AdvancedSettingsWidget::~AdvancedSettingsWidget() @@ -311,11 +331,8 @@ AdvancedSettingsWidget::updateAudioCodecs() for (auto it = audioCodecList.begin(); it != audioCodecList.end(); ++it, ++i) { QListWidgetItem* audioItem = new QListWidgetItem(ui->audioListWidget); audioItem->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); - Qt::CheckState state; - it->enabled ? state = Qt::Checked : state = Qt::Unchecked; - audioItem->setCheckState(state); - audioItem->setData(Qt::DisplayRole, QString::fromStdString(it->name) + "\n" + QString::fromStdString(it->samplerate) - + " Hz"); + audioItem->setCheckState(it->enabled ? Qt::Checked : Qt::Unchecked); + audioItem->setData(Qt::DisplayRole, QString::fromStdString(it->name) + " " + QString::fromStdString(it->samplerate) + " Hz"); ui->audioListWidget->addItem(audioItem); } @@ -325,21 +342,15 @@ void AdvancedSettingsWidget::updateVideoCodecs() { ui->videoListWidget->clear(); - auto videoCodecList = LRCInstance::getCurrentAccountInfo().codecModel->getVideoCodecs(); int i = 0; - for (auto it = videoCodecList.begin(); it != videoCodecList.end(); ++it, ++i) { - if (it->name.length()) { // [temporary fix] - QListWidgetItem* videoItem = new QListWidgetItem(ui->videoListWidget); - videoItem->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); - Qt::CheckState state; - it->enabled ? state = Qt::Checked : state = Qt::Unchecked; - videoItem->setCheckState(state); - videoItem->setData(Qt::DisplayRole, QString::fromStdString(it->name) + "\n"); - - ui->audioListWidget->addItem(videoItem); - } + if (!it->name.length()) { continue; } // temporary fix for empty codec entries + QListWidgetItem* videoItem = new QListWidgetItem(ui->videoListWidget); + videoItem->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); + videoItem->setCheckState(it->enabled ? Qt::Checked : Qt::Unchecked); + videoItem->setData(Qt::DisplayRole, QString::fromStdString(it->name)); + ui->audioListWidget->addItem(videoItem); } } @@ -374,7 +385,9 @@ AdvancedSettingsWidget::decreaseAudioCodecPriority() advance(it, selectedRow); LRCInstance::getCurrentAccountInfo().codecModel->decreasePriority(it->id, false); - updateAudioCodecs(); + + // swap current item down + Utils::swapQListWidgetItems(ui->audioListWidget, true); } void @@ -386,7 +399,9 @@ AdvancedSettingsWidget::increaseAudioCodecPriority() advance(it, selectedRow); LRCInstance::getCurrentAccountInfo().codecModel->increasePriority(it->id, false); - updateAudioCodecs(); + + // swap current item up + Utils::swapQListWidgetItems(ui->audioListWidget, false); } void @@ -398,7 +413,9 @@ AdvancedSettingsWidget::decreaseVideoCodecPriority() advance(it, selectedRow); LRCInstance::getCurrentAccountInfo().codecModel->decreasePriority(it->id, true); - updateVideoCodecs(); + + // swap current item down + Utils::swapQListWidgetItems(ui->videoListWidget, true); } void @@ -410,7 +427,9 @@ AdvancedSettingsWidget::increaseVideoCodecPriority() advance(it, selectedRow); LRCInstance::getCurrentAccountInfo().codecModel->increasePriority(it->id, true); - updateVideoCodecs(); + + // swap current item up + Utils::swapQListWidgetItems(ui->videoListWidget, false); } void diff --git a/advancedsettingswidget.ui b/advancedsettingswidget.ui index dd9be8d..343ca04 100644 --- a/advancedsettingswidget.ui +++ b/advancedsettingswidget.ui @@ -6,1177 +6,1425 @@ <rect> <x>0</x> <y>0</y> - <width>688</width> - <height>1273</height> + <width>731</width> + <height>1387</height> </rect> </property> <property name="windowTitle"> <string>Form</string> </property> - <property name="styleSheet"> - <string notr="true"/> - </property> <layout class="QVBoxLayout" name="verticalLayout"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> <item> - <widget class="QFrame" name="CallSettings"> - <property name="styleSheet"> - <string notr="true"/> + <spacer name="verticalSpacer_13"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>24</height> + </size> </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <property name="topMargin"> - <number>20</number> - </property> - <property name="bottomMargin"> - <number>20</number> - </property> - <item> - <widget class="QLabel" name="label"> - <property name="font"> - <font> - <pointsize>11</pointsize> - </font> - </property> - <property name="text"> - <string>Call Settings</string> - </property> - </widget> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <property name="leftMargin"> - <number>40</number> - </property> - <property name="topMargin"> - <number>5</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_9"> - <property name="bottomMargin"> - <number>3</number> - </property> - <item> - <widget class="QCheckBox" name="checkBoxUntrusted"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Allow Calls From Untrusted Peers</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QCheckBox" name="checkBoxAutoAnswer"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Auto Answer Calls</string> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0"> - <item> - <widget class="QCheckBox" name="checkBoxCustomRingtone"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Enable Custom Ringtone</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="btnRingtone"> - <property name="minimumSize"> - <size> - <width>250</width> - <height>25</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true">background: rgb(248, 248, 248); border-radius: 3px;</string> - </property> - <property name="text"> - <string>Add a custom ringtone</string> - </property> - <property name="icon"> - <iconset> - <normaloff>images/icons/round-folder-24px.svg</normaloff>images/icons/round-folder-24px.svg</iconset> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_7"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> - </item> - </layout> - </widget> + </spacer> </item> <item> - <widget class="QFrame" name="NameServer"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> + <layout class="QVBoxLayout" name="callSettingsLayout"> + <property name="topMargin"> + <number>0</number> </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> + <property name="bottomMargin"> + <number>0</number> </property> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <property name="topMargin"> - <number>30</number> - </property> - <property name="bottomMargin"> - <number>20</number> - </property> - <item> - <widget class="QLabel" name="label_2"> - <property name="font"> - <font> - <pointsize>11</pointsize> - </font> - </property> - <property name="text"> - <string>Name Server</string> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <property name="leftMargin"> - <number>40</number> - </property> - <item> - <widget class="QLabel" name="label_3"> - <property name="minimumSize"> - <size> - <width>60</width> - <height>0</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="text"> - <string>Address</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_8"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLineEdit" name="lineEditNameServer"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>300</width> - <height>0</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true">border-bottom: 1px solid black;</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> + <item> + <widget class="QLabel" name="label"> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>Call Settings</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_9"> + <property name="bottomMargin"> + <number>3</number> + </property> + <item> + <widget class="ToggleSwitch" name="checkBoxUntrusted" native="true"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text" stdset="0"> + <string>Allow Calls From Untrusted Peers</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_11"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="ToggleSwitch" name="checkBoxAutoAnswer" native="true"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text" stdset="0"> + <string>Auto Answer Calls</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0"> + <item> + <widget class="ToggleSwitch" name="checkBoxCustomRingtone" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text" stdset="0"> + <string>Enable Custom Ringtone</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btnRingtone"> + <property name="minimumSize"> + <size> + <width>300</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset> + <normaloff>images/icons/round-folder-24px.svg</normaloff>images/icons/round-folder-24px.svg</iconset> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + </layout> </item> <item> - <widget class="QFrame" name="OpenDHTConfiguration"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> + <spacer name="verticalSpacer_3"> + <property name="orientation"> + <enum>Qt::Vertical</enum> </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> + <property name="sizeType"> + <enum>QSizePolicy::Minimum</enum> </property> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <property name="topMargin"> - <number>30</number> - </property> - <property name="bottomMargin"> - <number>20</number> - </property> - <item> - <widget class="QLabel" name="label_4"> - <property name="font"> - <font> - <pointsize>11</pointsize> - </font> - </property> - <property name="text"> - <string>OpenDHT Configuration</string> - </property> - </widget> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_6"> - <property name="topMargin"> - <number>0</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <property name="leftMargin"> - <number>40</number> - </property> - <item> - <widget class="QCheckBox" name="checkBoxEnableProxy"> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Enable Proxy</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLineEdit" name="lineEditProxy"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>300</width> - <height>0</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true">border-bottom: 1px solid black;</string> - </property> - <property name="frame"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <property name="leftMargin"> - <number>40</number> - </property> - <item> - <widget class="QLabel" name="labelBootstrap"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Bootstrap</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLineEdit" name="lineEditBootstrap"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>300</width> - <height>0</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true">border-bottom: 1px solid black;</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> </item> <item> - <widget class="QFrame" name="Security"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> + <layout class="QVBoxLayout" name="nameServerLayout"> + <property name="topMargin"> + <number>0</number> </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> + <property name="bottomMargin"> + <number>0</number> </property> - <layout class="QVBoxLayout" name="verticalLayout_16"> - <property name="topMargin"> - <number>30</number> - </property> - <property name="bottomMargin"> - <number>20</number> - </property> - <item> - <widget class="QLabel" name="label_17"> - <property name="font"> - <font> - <pointsize>11</pointsize> - </font> - </property> - <property name="text"> - <string>Security</string> - </property> - </widget> - </item> - <item> - <layout class="QGridLayout" name="gridLayout_2"> - <property name="leftMargin"> - <number>40</number> - </property> - <item row="3" column="0"> - <widget class="QLabel" name="label_21"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Private Key Password</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_19"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>User Certificate</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QLineEdit" name="lineEditCertPassword"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>300</width> - <height>0</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true">border-bottom: 1px solid black;</string> - </property> - <property name="placeholderText"> - <string>no password</string> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_20"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Private Key</string> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="label_18"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>CA Certificate</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_5"> - <item> - <widget class="QPushButton" name="btnCACert"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>250</width> - <height>25</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="styleSheet"> - <string notr="true">background: rgb(248, 248, 248); border-radius: 3px;</string> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset> - <normaloff>images/icons/round-folder-24px.svg</normaloff>images/icons/round-folder-24px.svg</iconset> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Minimum</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item row="1" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <item> - <widget class="QPushButton" name="btnUserCert"> - <property name="minimumSize"> - <size> - <width>250</width> - <height>25</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="styleSheet"> - <string notr="true">background: rgb(248, 248, 248); border-radius: 3px;</string> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset> - <normaloff>images/icons/round-folder-24px.svg</normaloff>images/icons/round-folder-24px.svg</iconset> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Minimum</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item row="2" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_7"> - <item> - <widget class="QPushButton" name="btnPrivateKey"> - <property name="minimumSize"> - <size> - <width>250</width> - <height>25</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="styleSheet"> - <string notr="true">background: rgb(248, 248, 248); border-radius: 3px;</string> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset> - <normaloff>images/icons/round-folder-24px.svg</normaloff>images/icons/round-folder-24px.svg</iconset> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_6"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Minimum</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> - </item> - </layout> - </widget> + <item> + <widget class="QLabel" name="label_2"> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>Name Server</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_4"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_7"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_3"> + <property name="minimumSize"> + <size> + <width>60</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="text"> + <string>Address</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_8"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLineEdit" name="lineEditNameServer"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>300</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + </layout> </item> <item> - <widget class="QFrame" name="Connectivity"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> + <spacer name="verticalSpacer_5"> + <property name="orientation"> + <enum>Qt::Vertical</enum> </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> + <property name="sizeType"> + <enum>QSizePolicy::Minimum</enum> </property> - <layout class="QVBoxLayout" name="verticalLayout_8"> - <property name="topMargin"> - <number>30</number> - </property> - <property name="bottomMargin"> - <number>20</number> - </property> - <item> - <widget class="QLabel" name="label_11"> - <property name="font"> - <font> - <pointsize>11</pointsize> - </font> - </property> - <property name="text"> - <string>Connectivity</string> - </property> - </widget> - </item> - <item> - <layout class="QGridLayout" name="gridLayout"> - <property name="leftMargin"> - <number>40</number> - </property> - <item row="3" column="2"> - <widget class="QLineEdit" name="lineEditTurnUsername"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true">border-bottom: 1px solid black;</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <spacer name="horizontalSpacer_5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_13"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string> TURN Address</string> - </property> - </widget> - </item> - <item row="2" column="2"> - <widget class="QLineEdit" name="lineEditTurnAddress"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>300</width> - <height>0</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="autoFillBackground"> - <bool>false</bool> - </property> - <property name="styleSheet"> - <string notr="true">border-bottom: 1px solid black;</string> - </property> - </widget> - </item> - <item row="5" column="0"> - <widget class="QCheckBox" name="checkBoxSTUNEnable"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Use STUN</string> - </property> - </widget> - </item> - <item row="4" column="2"> - <widget class="QLineEdit" name="lineEditTurnPsswd"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true">border-bottom: 1px solid black;</string> - </property> - </widget> - </item> - <item row="5" column="2"> - <widget class="QLineEdit" name="lineEditSTUNAddress"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true">border-bottom: 1px solid black;</string> - </property> - <property name="placeholderText"> - <string>STUN Address</string> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_14"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string> TURN Username</string> - </property> - </widget> - </item> - <item row="4" column="0"> - <widget class="QLabel" name="label_12"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string> TURN Password</string> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QCheckBox" name="checkBoxUPnP"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Use UPnP</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QCheckBox" name="checkBoxTurnEnable"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Use TURN</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> </item> <item> - <widget class="QFrame" name="Video"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> + <layout class="QVBoxLayout" name="openDHTLayout"> + <property name="topMargin"> + <number>0</number> </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> + <property name="bottomMargin"> + <number>0</number> </property> - <layout class="QHBoxLayout" name="horizontalLayout_14"> - <property name="topMargin"> - <number>30</number> - </property> - <property name="bottomMargin"> - <number>20</number> - </property> - <item> - <layout class="QVBoxLayout" name="verticalLayout_12"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_10"> - <item> - <widget class="QLabel" name="audioLabel"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>30</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="text"> - <string>Audio Codecs</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_10"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="audioDownPushButton"> - <property name="minimumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset> - <normaloff>images/icons/round-arrow_drop_down-24px.svg</normaloff>images/icons/round-arrow_drop_down-24px.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="audioUpPushButton"> - <property name="minimumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset> - <normaloff>images/icons/round-arrow_drop_up-24px.svg</normaloff>images/icons/round-arrow_drop_up-24px.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_11"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>10</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <widget class="QListWidget" name="audioListWidget"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>200</height> - </size> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_13"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_8"> - <item> - <widget class="QCheckBox" name="videoCheckBox"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>30</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="text"> - <string>Video Codecs</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_9"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="videoDownPushButton"> - <property name="minimumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset> - <normaloff>images/icons/round-arrow_drop_down-24px.svg</normaloff>images/icons/round-arrow_drop_down-24px.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="videoUpPushButton"> - <property name="minimumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset> - <normaloff>images/icons/round-arrow_drop_up-24px.svg</normaloff>images/icons/round-arrow_drop_up-24px.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_12"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>10</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <widget class="QListWidget" name="videoListWidget"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>200</height> - </size> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> + <item> + <widget class="QLabel" name="label_4"> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>OpenDHT Configuration</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_6"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_9"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="leftMargin"> + <number>0</number> + </property> + <item> + <widget class="ToggleSwitch" name="checkBoxEnableProxy" native="true"> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text" stdset="0"> + <string>Enable Proxy</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLineEdit" name="lineEditProxy"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>300</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="frame"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <property name="leftMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="labelBootstrap"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Bootstrap</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLineEdit" name="lineEditBootstrap"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>300</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_7"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Minimum</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="securityLayout"> + <property name="topMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_17"> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>Security</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_8"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_10"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <layout class="QGridLayout" name="gridLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <item row="3" column="0"> + <widget class="QLabel" name="label_21"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Private Key Password</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_19"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>User Certificate</string> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QLineEdit" name="lineEditCertPassword"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>300</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="echoMode"> + <enum>QLineEdit::PasswordEchoOnEdit</enum> + </property> + <property name="placeholderText"> + <string/> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_20"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Private Key</string> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="label_18"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>CA Certificate</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <item> + <widget class="QPushButton" name="btnCACert"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>250</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset> + <normaloff>images/icons/round-folder-24px.svg</normaloff>images/icons/round-folder-24px.svg</iconset> + </property> + </widget> + </item> + </layout> + </item> + <item row="1" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <item> + <widget class="QPushButton" name="btnUserCert"> + <property name="minimumSize"> + <size> + <width>250</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset> + <normaloff>images/icons/round-folder-24px.svg</normaloff>images/icons/round-folder-24px.svg</iconset> + </property> + </widget> + </item> + </layout> + </item> + <item row="2" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <item> + <widget class="QPushButton" name="btnPrivateKey"> + <property name="minimumSize"> + <size> + <width>250</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset> + <normaloff>images/icons/round-folder-24px.svg</normaloff>images/icons/round-folder-24px.svg</iconset> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_9"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Minimum</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="connectivityLayout"> + <property name="topMargin"> + <number>10</number> + </property> + <item> + <widget class="QLabel" name="label_11"> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>Connectivity</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_10"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_14"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <layout class="QGridLayout" name="gridLayout"> + <property name="leftMargin"> + <number>0</number> + </property> + <item row="3" column="2"> + <widget class="QLineEdit" name="lineEditTurnUsername"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + </widget> + </item> + <item row="0" column="1"> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::MinimumExpanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="2" column="2"> + <widget class="QLineEdit" name="lineEditTurnAddress"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>300</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="5" column="2"> + <widget class="QLineEdit" name="lineEditSTUNAddress"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="placeholderText"> + <string>STUN Address</string> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="ToggleSwitch" name="checkBoxSTUNEnable" native="true"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text" stdset="0"> + <string>Use STUN</string> + </property> + </widget> + </item> + <item row="4" column="2"> + <widget class="QLineEdit" name="lineEditTurnPsswd"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="echoMode"> + <enum>QLineEdit::PasswordEchoOnEdit</enum> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="ToggleSwitch" name="checkBoxUPnP" native="true"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text" stdset="0"> + <string>Use UPnP</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="ToggleSwitch" name="checkBoxTurnEnable" native="true"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text" stdset="0"> + <string>Use TURN</string> + </property> + </widget> + </item> + <item row="4" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_16"> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label_7"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>TURN Password</string> + </property> + </widget> + </item> + </layout> + </item> + <item row="3" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_17"> + <item> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label_8"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>TURN Username</string> + </property> + </widget> + </item> + </layout> + </item> + <item row="2" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_18"> + <item> + <spacer name="horizontalSpacer_6"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label_9"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>TURN Address</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_11"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Minimum</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="mediaLayout"> + <property name="topMargin"> + <number>10</number> + </property> + <item> + <widget class="QLabel" name="label_5"> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>Media</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_12"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_15"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ToggleSwitch" name="videoCheckBox" native="true"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text" stdset="0"> + <string>Enable Video</string> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_12"> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <item> + <layout class="QVBoxLayout" name="verticalLayout_13"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_8"> + <item> + <widget class="QLabel" name="label_6"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Video Codecs</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_9"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="videoDownPushButton"> + <property name="minimumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset> + <normaloff>images/icons/round-arrow_drop_down-24px.svg</normaloff>images/icons/round-arrow_drop_down-24px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="videoUpPushButton"> + <property name="minimumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset> + <normaloff>images/icons/round-arrow_drop_up-24px.svg</normaloff>images/icons/round-arrow_drop_up-24px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_12"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>10</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QListWidget" name="videoListWidget"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>186</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="focusPolicy"> + <enum>Qt::TabFocus</enum> + </property> + <property name="verticalScrollMode"> + <enum>QAbstractItemView::ScrollPerPixel</enum> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_12"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_10"> + <item> + <widget class="QLabel" name="audioLabel"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Audio Codecs</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_10"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="audioDownPushButton"> + <property name="minimumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset> + <normaloff>images/icons/round-arrow_drop_down-24px.svg</normaloff>images/icons/round-arrow_drop_down-24px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="audioUpPushButton"> + <property name="minimumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset> + <normaloff>images/icons/round-arrow_drop_up-24px.svg</normaloff>images/icons/round-arrow_drop_up-24px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_11"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>10</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QListWidget" name="audioListWidget"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>186</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="focusPolicy"> + <enum>Qt::TabFocus</enum> + </property> + <property name="verticalScrollMode"> + <enum>QAbstractItemView::ScrollPerPixel</enum> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </item> + </layout> </item> <item> <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> + <property name="sizeType"> + <enum>QSizePolicy::MinimumExpanding</enum> + </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>40</height> + <height>48</height> </size> </property> </spacer> </item> </layout> </widget> + <customwidgets> + <customwidget> + <class>ToggleSwitch</class> + <extends>QWidget</extends> + <header>ToggleSwitch.h</header> + <container>1</container> + </customwidget> + </customwidgets> <resources/> <connections/> </ui> diff --git a/advancedsipsettingwidget.cpp b/advancedsipsettingwidget.cpp index bd369a3..1d45697 100644 --- a/advancedsipsettingwidget.cpp +++ b/advancedsipsettingwidget.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * Copyright (C) 2019-2019 by Savoir-faire Linux * - * Author: Isa Nanic <isa.nanic@savoirfairelinux.com> - * Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com> + * Author: Isa Nanic <isa.nanic@savoirfairelinux.com> * + * Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com> * * * * 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 * @@ -21,14 +21,14 @@ #include <QFileDialog> -#include "api/newcodecmodel.h" - #include "lrcinstance.h" #include "utils.h" +#include "api/newcodecmodel.h" + AdvancedSIPSettingsWidget::AdvancedSIPSettingsWidget(QWidget* parent) - :QWidget(parent), - ui(new Ui::AdvancedSIPSettingsWidget) + : QWidget(parent) + , ui(new Ui::AdvancedSIPSettingsWidget) { ui->setupUi(this); @@ -61,9 +61,28 @@ AdvancedSIPSettingsWidget::AdvancedSIPSettingsWidget(QWidget* parent) connect(ui->audioDownPushButtonSIP, &QPushButton::clicked, this, &AdvancedSIPSettingsWidget::decreaseAudioCodecPriority); connect(ui->audioUpPushButtonSIP, &QPushButton::clicked, this, &AdvancedSIPSettingsWidget::increaseAudioCodecPriority); + ui->audioDownPushButtonSIP->setEnabled(false); + ui->audioUpPushButtonSIP->setEnabled(false); + + connect(ui->audioListWidgetSIP, &QListWidget::itemSelectionChanged, + [this] { + bool enabled = ui->audioListWidgetSIP->selectedItems().size(); + ui->audioDownPushButtonSIP->setEnabled(enabled); + ui->audioUpPushButtonSIP->setEnabled(enabled); + }); + connect(ui->videoDownPushButtonSIP, &QPushButton::clicked, this, &AdvancedSIPSettingsWidget::decreaseVideoCodecPriority); connect(ui->videoUpPushButtonSIP, &QPushButton::clicked, this, &AdvancedSIPSettingsWidget::increaseVideoCodecPriority); + ui->videoDownPushButtonSIP->setEnabled(false); + ui->videoUpPushButtonSIP->setEnabled(false); + + connect(ui->videoListWidgetSIP, &QListWidget::itemSelectionChanged, + [this] { + bool enabled = ui->videoListWidgetSIP->selectedItems().size(); + ui->videoDownPushButtonSIP->setEnabled(enabled); + ui->videoUpPushButtonSIP->setEnabled(enabled); + }); } AdvancedSIPSettingsWidget::~AdvancedSIPSettingsWidget() @@ -71,8 +90,7 @@ AdvancedSIPSettingsWidget::~AdvancedSIPSettingsWidget() delete ui; } -void -AdvancedSIPSettingsWidget::updateAdvancedSIPSettings() +void AdvancedSIPSettingsWidget::updateAdvancedSIPSettings() { auto config = LRCInstance::getCurrAccConfig(); //Call Settings @@ -103,23 +121,20 @@ AdvancedSIPSettingsWidget::updateAdvancedSIPSettings() } // call settings -void -AdvancedSIPSettingsWidget::setAutoAnswerCalls(bool state) +void AdvancedSIPSettingsWidget::setAutoAnswerCalls(bool state) { auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); confProps.autoAnswer = state; LRCInstance::editableAccountModel()->setAccountConfig(LRCInstance::getCurrAccId(), confProps); } -void -AdvancedSIPSettingsWidget::setEnableRingtone(bool state) +void AdvancedSIPSettingsWidget::setEnableRingtone(bool state) { auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); confProps.Ringtone.ringtoneEnabled = state; LRCInstance::editableAccountModel()->setAccountConfig(LRCInstance::getCurrAccId(), confProps); } -void -AdvancedSIPSettingsWidget::openFileCustomRingtone() +void AdvancedSIPSettingsWidget::openFileCustomRingtone() { QString fileUrl; auto oldPath = QString::fromStdString(LRCInstance::getCurrAccConfig().Ringtone.ringtonePath); @@ -138,22 +153,19 @@ AdvancedSIPSettingsWidget::openFileCustomRingtone() } // connectivity -void -AdvancedSIPSettingsWidget::setUseUPnP(bool state) +void AdvancedSIPSettingsWidget::setUseUPnP(bool state) { auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); confProps.upnpEnabled = state; LRCInstance::editableAccountModel()->setAccountConfig(LRCInstance::getCurrAccId(), confProps); } -void -AdvancedSIPSettingsWidget::setUseTURN(bool state) +void AdvancedSIPSettingsWidget::setUseTURN(bool state) { auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); confProps.TURN.enable = state; LRCInstance::editableAccountModel()->setAccountConfig(LRCInstance::getCurrAccId(), confProps); } -void -AdvancedSIPSettingsWidget::setUseSTUN(bool state) +void AdvancedSIPSettingsWidget::setUseSTUN(bool state) { auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); confProps.STUN.enable = state; @@ -162,37 +174,32 @@ AdvancedSIPSettingsWidget::setUseSTUN(bool state) state ? ui->lineEditSTUNAddressSIP->setEnabled(true) : ui->lineEditSTUNAddressSIP->setEnabled(false); } -void -AdvancedSIPSettingsWidget::setTURNAddress(const QString& name) +void AdvancedSIPSettingsWidget::setTURNAddress(const QString& name) { auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); confProps.TURN.server = name.toStdString(); LRCInstance::editableAccountModel()->setAccountConfig(LRCInstance::getCurrAccId(), confProps); } -void -AdvancedSIPSettingsWidget::setTURNUsername(const QString& name) +void AdvancedSIPSettingsWidget::setTURNUsername(const QString& name) { auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); confProps.TURN.username = name.toStdString(); LRCInstance::editableAccountModel()->setAccountConfig(LRCInstance::getCurrAccId(), confProps); } -void -AdvancedSIPSettingsWidget::setTURNPsswd(const QString& name) +void AdvancedSIPSettingsWidget::setTURNPsswd(const QString& name) { auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); confProps.TURN.password = name.toStdString(); LRCInstance::editableAccountModel()->setAccountConfig(LRCInstance::getCurrAccId(), confProps); } -void -AdvancedSIPSettingsWidget::setSTUNAddress(const QString& name) +void AdvancedSIPSettingsWidget::setSTUNAddress(const QString& name) { auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); confProps.STUN.server = name.toStdString(); LRCInstance::editableAccountModel()->setAccountConfig(LRCInstance::getCurrAccId(), confProps); } -void -AdvancedSIPSettingsWidget::updateAudioCodecs() +void AdvancedSIPSettingsWidget::updateAudioCodecs() { ui->audioListWidgetSIP->clear(); @@ -202,18 +209,14 @@ AdvancedSIPSettingsWidget::updateAudioCodecs() for (auto it = audioCodecList.begin(); it != audioCodecList.end(); ++it, ++i) { QListWidgetItem* audioItem = new QListWidgetItem(ui->audioListWidgetSIP); audioItem->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); - Qt::CheckState state; - it->enabled ? state = Qt::Checked : state = Qt::Unchecked; - audioItem->setCheckState(state); - audioItem->setData(Qt::DisplayRole, QString::fromStdString(it->name) + "\n" + QString::fromStdString(it->samplerate) - + " Hz"); + audioItem->setCheckState(it->enabled ? Qt::Checked : Qt::Unchecked); + audioItem->setData(Qt::DisplayRole, QString::fromStdString(it->name) + " " + QString::fromStdString(it->samplerate) + " Hz"); ui->audioListWidgetSIP->addItem(audioItem); } } -void -AdvancedSIPSettingsWidget::updateVideoCodecs() +void AdvancedSIPSettingsWidget::updateVideoCodecs() { ui->videoListWidgetSIP->clear(); @@ -221,21 +224,16 @@ AdvancedSIPSettingsWidget::updateVideoCodecs() int i = 0; for (auto it = videoCodecList.begin(); it != videoCodecList.end(); ++it, ++i) { - if (it->name.length()) { // [temporary fix] - QListWidgetItem* videoItem = new QListWidgetItem(ui->videoListWidgetSIP); - videoItem->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); - Qt::CheckState state; - it->enabled ? state = Qt::Checked : state = Qt::Unchecked; - videoItem->setCheckState(state); - videoItem->setData(Qt::DisplayRole, QString::fromStdString(it->name) + "\n"); - - ui->audioListWidgetSIP->addItem(videoItem); - } + if (!it->name.length()) { continue; } // temporary fix for empty codec entries + QListWidgetItem* videoItem = new QListWidgetItem(ui->videoListWidgetSIP); + videoItem->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); + videoItem->setCheckState(it->enabled ? Qt::Checked : Qt::Unchecked); + videoItem->setData(Qt::DisplayRole, QString::fromStdString(it->name) + "\n"); + ui->audioListWidgetSIP->addItem(videoItem); } } -void -AdvancedSIPSettingsWidget::audioCodecsStateChange(QListWidgetItem* item) +void AdvancedSIPSettingsWidget::audioCodecsStateChange(QListWidgetItem* item) { auto audioCodecList = LRCInstance::getCurrentAccountInfo().codecModel->getAudioCodecs(); auto it = audioCodecList.begin(); @@ -245,8 +243,7 @@ AdvancedSIPSettingsWidget::audioCodecsStateChange(QListWidgetItem* item) LRCInstance::getCurrentAccountInfo().codecModel->enable(it->id, !(it->enabled)); } -void -AdvancedSIPSettingsWidget::videoCodecsStateChange(QListWidgetItem* item) +void AdvancedSIPSettingsWidget::videoCodecsStateChange(QListWidgetItem* item) { auto videoCodecList = LRCInstance::getCurrentAccountInfo().codecModel->getVideoCodecs(); auto it = videoCodecList.begin(); @@ -256,8 +253,7 @@ AdvancedSIPSettingsWidget::videoCodecsStateChange(QListWidgetItem* item) LRCInstance::getCurrentAccountInfo().codecModel->enable(it->id, !(it->enabled)); } -void -AdvancedSIPSettingsWidget::decreaseAudioCodecPriority() +void AdvancedSIPSettingsWidget::decreaseAudioCodecPriority() { int selectedRow = ui->audioListWidgetSIP->row(ui->audioListWidgetSIP->selectedItems().at(0)); auto audioCodecList = LRCInstance::getCurrentAccountInfo().codecModel->getAudioCodecs(); @@ -265,11 +261,12 @@ AdvancedSIPSettingsWidget::decreaseAudioCodecPriority() advance(it, selectedRow); LRCInstance::getCurrentAccountInfo().codecModel->decreasePriority(it->id, false); - updateAudioCodecs(); + + // swap current item down + Utils::swapQListWidgetItems(ui->audioListWidgetSIP, true); } -void -AdvancedSIPSettingsWidget::increaseAudioCodecPriority() +void AdvancedSIPSettingsWidget::increaseAudioCodecPriority() { int selectedRow = ui->audioListWidgetSIP->row(ui->audioListWidgetSIP->selectedItems().at(0)); auto audioCodecList = LRCInstance::getCurrentAccountInfo().codecModel->getAudioCodecs(); @@ -278,10 +275,12 @@ AdvancedSIPSettingsWidget::increaseAudioCodecPriority() advance(it, selectedRow); LRCInstance::getCurrentAccountInfo().codecModel->increasePriority(it->id, false); updateAudioCodecs(); + + // swap current item up + Utils::swapQListWidgetItems(ui->audioListWidgetSIP, false); } -void -AdvancedSIPSettingsWidget::decreaseVideoCodecPriority() +void AdvancedSIPSettingsWidget::decreaseVideoCodecPriority() { int selectedRow = ui->videoListWidgetSIP->row(ui->videoListWidgetSIP->selectedItems().at(0)); auto videoCodecList = LRCInstance::getCurrentAccountInfo().codecModel->getVideoCodecs(); @@ -289,11 +288,12 @@ AdvancedSIPSettingsWidget::decreaseVideoCodecPriority() advance(it, selectedRow); LRCInstance::getCurrentAccountInfo().codecModel->decreasePriority(it->id, true); - updateVideoCodecs(); + + // swap current item down + Utils::swapQListWidgetItems(ui->videoListWidgetSIP, true); } -void -AdvancedSIPSettingsWidget::increaseVideoCodecPriority() +void AdvancedSIPSettingsWidget::increaseVideoCodecPriority() { int selectedRow = ui->videoListWidgetSIP->row(ui->videoListWidgetSIP->selectedItems().at(0)); auto videoCodecList = LRCInstance::getCurrentAccountInfo().codecModel->getVideoCodecs(); @@ -301,11 +301,12 @@ AdvancedSIPSettingsWidget::increaseVideoCodecPriority() advance(it, selectedRow); LRCInstance::getCurrentAccountInfo().codecModel->increasePriority(it->id, true); - updateVideoCodecs(); + + // swap current item up + Utils::swapQListWidgetItems(ui->videoListWidgetSIP, false); } -void -AdvancedSIPSettingsWidget::setVideoState(int state) +void AdvancedSIPSettingsWidget::setVideoState(int state) { auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); confProps.Video.videoEnabled = (bool)state; diff --git a/advancedsipsettingwidget.h b/advancedsipsettingwidget.h index 9627e44..65ab520 100644 --- a/advancedsipsettingwidget.h +++ b/advancedsipsettingwidget.h @@ -1,7 +1,7 @@ /*************************************************************************** * Copyright (C) 2019-2019 by Savoir-faire Linux * - * Author: Isa Nanic <isa.nanic@savoirfairelinux.com> - * Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com> + * Author: Isa Nanic <isa.nanic@savoirfairelinux.com> * + * Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com> * * * * 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 * @@ -19,16 +19,14 @@ #pragma once -#include <QWidget> #include <QListWidgetItem> +#include <QWidget> -namespace Ui -{ +namespace Ui { class AdvancedSIPSettingsWidget; } -class AdvancedSIPSettingsWidget : public QWidget -{ +class AdvancedSIPSettingsWidget : public QWidget { Q_OBJECT AdvancedSIPSettingsWidget(const AdvancedSIPSettingsWidget& cpy); @@ -74,5 +72,4 @@ private slots: void increaseVideoCodecPriority(); void setVideoState(int state); - -}; \ No newline at end of file +}; diff --git a/advancedsipsettingwidget.ui b/advancedsipsettingwidget.ui index c3da965..1eef72b 100644 --- a/advancedsipsettingwidget.ui +++ b/advancedsipsettingwidget.ui @@ -7,642 +7,849 @@ <x>0</x> <y>0</y> <width>688</width> - <height>1273</height> + <height>821</height> </rect> </property> <property name="windowTitle"> <string>Form</string> </property> - <property name="styleSheet"> - <string notr="true"/> - </property> <layout class="QVBoxLayout" name="verticalLayout"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> <item> - <widget class="QFrame" name="SIPCallSettings"> - <property name="styleSheet"> - <string notr="true"/> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>24</height> + </size> </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <property name="topMargin"> - <number>20</number> - </property> - <property name="bottomMargin"> - <number>20</number> - </property> - <item> - <widget class="QLabel" name="labelISP"> - <property name="font"> - <font> - <pointsize>11</pointsize> - </font> - </property> - <property name="text"> - <string>Call Settings</string> - </property> - </widget> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayoutSIP_3"> - <property name="leftMargin"> - <number>40</number> - </property> - <property name="topMargin"> - <number>5</number> - </property> - <item> - <widget class="QCheckBox" name="checkBoxAutoAnswerSIP"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Auto Answer Calls</string> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutSIP" stretch="0,0,0"> - <item> - <widget class="QCheckBox" name="checkBoxCustomRingtoneSIP"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Enable Custom Ringtone</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="btnRingtoneSIP"> - <property name="minimumSize"> - <size> - <width>250</width> - <height>25</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true">background: rgb(248, 248, 248); border-radius: 3px;</string> - </property> - <property name="text"> - <string>Add a custom ringtone</string> - </property> - <property name="icon"> - <iconset> - <normaloff>images/icons/round-folder-24px.svg</normaloff>images/icons/round-folder-24px.svg</iconset> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacerSIP_7"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> - </item> - </layout> - </widget> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QLabel" name="labelISP"> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>Call Settings</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_11"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="ToggleSwitch" name="checkBoxAutoAnswerSIP" native="true"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text" stdset="0"> + <string>Auto Answer Calls</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0"> + <item> + <widget class="ToggleSwitch" name="checkBoxCustomRingtoneSIP" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text" stdset="0"> + <string>Enable Custom Ringtone</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btnRingtoneSIP"> + <property name="minimumSize"> + <size> + <width>300</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset> + <normaloff>images/icons/round-folder-24px.svg</normaloff>images/icons/round-folder-24px.svg</iconset> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + </layout> </item> <item> - <widget class="QFrame" name="SIPConnectivity"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> + <spacer name="verticalSpacer_4"> + <property name="orientation"> + <enum>Qt::Vertical</enum> </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> + <property name="sizeType"> + <enum>QSizePolicy::Minimum</enum> </property> - <layout class="QVBoxLayout" name="verticalLayout_8"> - <property name="topMargin"> - <number>30</number> - </property> - <property name="bottomMargin"> - <number>20</number> - </property> - <item> - <widget class="QLabel" name="labelSIP_11"> - <property name="font"> - <font> - <pointsize>11</pointsize> - </font> - </property> - <property name="text"> - <string>Connectivity</string> - </property> - </widget> - </item> - <item> - <layout class="QGridLayout" name="gridLayoutSIP"> - <property name="leftMargin"> - <number>40</number> - </property> - <item row="3" column="2"> - <widget class="QLineEdit" name="lineEditTurnUsernameSIP"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true">border-bottom: 1px solid black;</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <spacer name="horizontalSpacerSIP_5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="labelSIP_13"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string> TURN Address</string> - </property> - </widget> - </item> - <item row="2" column="2"> - <widget class="QLineEdit" name="lineEditTurnAddressSIP"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>300</width> - <height>0</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="autoFillBackground"> - <bool>false</bool> - </property> - <property name="styleSheet"> - <string notr="true">border-bottom: 1px solid black;</string> - </property> - </widget> - </item> - <item row="5" column="0"> - <widget class="QCheckBox" name="checkBoxSTUNEnableSIP"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Use STUN</string> - </property> - </widget> - </item> - <item row="4" column="2"> - <widget class="QLineEdit" name="lineEditTurnPsswdSIP"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true">border-bottom: 1px solid black;</string> - </property> - </widget> - </item> - <item row="5" column="2"> - <widget class="QLineEdit" name="lineEditSTUNAddressSIP"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true">border-bottom: 1px solid black;</string> - </property> - <property name="placeholderText"> - <string>STUN Address</string> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="labelSIP_14"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string> TURN Username</string> - </property> - </widget> - </item> - <item row="4" column="0"> - <widget class="QLabel" name="labelSIP_12"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string> TURN Password</string> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QCheckBox" name="checkBoxUPnPSIP"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Use UPnP</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QCheckBox" name="checkBoxTurnEnableSIP"> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Use TURN</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> </item> <item> - <widget class="QFrame" name="SIPVideo"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> + <layout class="QVBoxLayout" name="verticalLayout_5"> + <property name="topMargin"> + <number>0</number> </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> + <item> + <widget class="QLabel" name="label"> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>Connectivity</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_5"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_14"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <layout class="QGridLayout" name="gridLayout"> + <property name="leftMargin"> + <number>0</number> + </property> + <item row="3" column="2"> + <widget class="QLineEdit" name="lineEditTurnUsernameSIP"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + </widget> + </item> + <item row="0" column="1"> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::MinimumExpanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="2" column="2"> + <widget class="QLineEdit" name="lineEditTurnAddressSIP"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>300</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="5" column="2"> + <widget class="QLineEdit" name="lineEditSTUNAddressSIP"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="placeholderText"> + <string>STUN Address</string> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="ToggleSwitch" name="checkBoxSTUNEnableSIP" native="true"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text" stdset="0"> + <string>Use STUN</string> + </property> + </widget> + </item> + <item row="4" column="2"> + <widget class="QLineEdit" name="lineEditTurnPsswdSIP"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="echoMode"> + <enum>QLineEdit::PasswordEchoOnEdit</enum> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="ToggleSwitch" name="checkBoxUPnPSIP" native="true"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text" stdset="0"> + <string>Use UPnP</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="ToggleSwitch" name="checkBoxTurnEnableSIP" native="true"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text" stdset="0"> + <string>Use TURN</string> + </property> + </widget> + </item> + <item row="4" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_16"> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label_7"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>TURN Password</string> + </property> + </widget> + </item> + </layout> + </item> + <item row="3" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_17"> + <item> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label_8"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>TURN Username</string> + </property> + </widget> + </item> + </layout> + </item> + <item row="2" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_18"> + <item> + <spacer name="horizontalSpacer_6"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label_9"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>TURN Address</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_6"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Minimum</enum> </property> - <layout class="QHBoxLayout" name="horizontalLayout_14"> - <property name="topMargin"> - <number>30</number> - </property> - <property name="bottomMargin"> - <number>20</number> - </property> - <item> - <layout class="QVBoxLayout" name="verticalLayoutSIP_12"> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutSIP_10"> - <item> - <widget class="QLabel" name="audioLabelSIP"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>30</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="text"> - <string>Audio Codecs</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacerSIP_10"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="audioDownPushButtonSIP"> - <property name="minimumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset> - <normaloff>images/icons/round-arrow_drop_down-24px.svg</normaloff>images/icons/round-arrow_drop_down-24px.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="audioUpPushButtonSIP"> - <property name="minimumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset> - <normaloff>images/icons/round-arrow_drop_up-24px.svg</normaloff>images/icons/round-arrow_drop_up-24px.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacerSIP_11"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>10</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <widget class="QListWidget" name="audioListWidgetSIP"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>200</height> - </size> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayoutSIP_13"> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutSIP_8"> - <item> - <widget class="QCheckBox" name="videoCheckBoxSIP"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>30</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="text"> - <string>Video Codecs</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacerSIP_9"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="videoDownPushButtonSIP"> - <property name="minimumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset> - <normaloff>images/icons/round-arrow_drop_down-24px.svg</normaloff>images/icons/round-arrow_drop_down-24px.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="videoUpPushButtonSIP"> - <property name="minimumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset> - <normaloff>images/icons/round-arrow_drop_up-24px.svg</normaloff>images/icons/round-arrow_drop_up-24px.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacerSIP_12"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>10</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <widget class="QListWidget" name="videoListWidgetSIP"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>200</height> - </size> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> </item> <item> - <spacer name="verticalSpacerSIP"> + <layout class="QVBoxLayout" name="verticalLayout_7"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_2"> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>Media</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_7"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_15"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ToggleSwitch" name="videoCheckBoxSIP" native="true"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text" stdset="0"> + <string>Enable Video</string> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_12"> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <item> + <layout class="QVBoxLayout" name="verticalLayout_13"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_8"> + <item> + <widget class="QLabel" name="label_6"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Video Codecs</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_9"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="videoDownPushButtonSIP"> + <property name="minimumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset> + <normaloff>images/icons/round-arrow_drop_down-24px.svg</normaloff>images/icons/round-arrow_drop_down-24px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="videoUpPushButtonSIP"> + <property name="minimumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset> + <normaloff>images/icons/round-arrow_drop_up-24px.svg</normaloff>images/icons/round-arrow_drop_up-24px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_12"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>10</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QListWidget" name="videoListWidgetSIP"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>186</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="focusPolicy"> + <enum>Qt::TabFocus</enum> + </property> + <property name="verticalScrollMode"> + <enum>QAbstractItemView::ScrollPerPixel</enum> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_12"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_10"> + <item> + <widget class="QLabel" name="audioLabel"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Audio Codecs</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_10"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="audioDownPushButtonSIP"> + <property name="minimumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset> + <normaloff>images/icons/round-arrow_drop_down-24px.svg</normaloff>images/icons/round-arrow_drop_down-24px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="audioUpPushButtonSIP"> + <property name="minimumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset> + <normaloff>images/icons/round-arrow_drop_up-24px.svg</normaloff>images/icons/round-arrow_drop_up-24px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_11"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>10</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QListWidget" name="audioListWidgetSIP"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>186</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="focusPolicy"> + <enum>Qt::TabFocus</enum> + </property> + <property name="verticalScrollMode"> + <enum>QAbstractItemView::ScrollPerPixel</enum> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_3"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> + <property name="sizeType"> + <enum>QSizePolicy::MinimumExpanding</enum> + </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>40</height> + <height>48</height> </size> </property> </spacer> </item> </layout> </widget> + <customwidgets> + <customwidget> + <class>ToggleSwitch</class> + <extends>QWidget</extends> + <header>ToggleSwitch.h</header> + <container>1</container> + </customwidget> + </customwidgets> <resources/> <connections/> </ui> diff --git a/bannedcontactswidget.ui b/bannedcontactswidget.ui deleted file mode 100644 index 6df7cbd..0000000 --- a/bannedcontactswidget.ui +++ /dev/null @@ -1,129 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>BannedContactsWidget</class> - <widget class="QWidget" name="BannedContactsWidget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>712</width> - <height>544</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout" stretch="1,2"> - <property name="sizeConstraint"> - <enum>QLayout::SetNoConstraint</enum> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QListView" name="bannedList"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Banned contacts list</string> - </property> - </widget> - </item> - <item> - <widget class="QStackedWidget" name="debanStack"> - <property name="currentIndex"> - <number>1</number> - </property> - <widget class="QWidget" name="cleanPage"/> - <widget class="QWidget" name="debanPage"> - <layout class="QVBoxLayout" name="verticalLayout" stretch="1,0,0,0,1"> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item alignment="Qt::AlignHCenter|Qt::AlignVCenter"> - <widget class="QLabel" name="bannedIdLabel"> - <property name="text"> - <string>Banned ID</string> - </property> - </widget> - </item> - <item> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item alignment="Qt::AlignHCenter"> - <widget class="QPushButton" name="debanButton"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>265</width> - <height>30</height> - </size> - </property> - <property name="toolTip"> - <string>Deban contact button</string> - </property> - <property name="text"> - <string>Deban contact, and add to contact list</string> - </property> - </widget> - </item> - <item> - <spacer name="verticalSpacer_3"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/banneditemwidget.cpp b/banneditemwidget.cpp new file mode 100644 index 0000000..7b494c3 --- /dev/null +++ b/banneditemwidget.cpp @@ -0,0 +1,57 @@ +/*************************************************************************** + * Copyright (C) 2019 by Savoir-faire Linux * + * Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * + * * + * 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 <http://www.gnu.org/licenses/>. * + **************************************************************************/ + +#include "ui_banneditemwidget.h" + +#include "banneditemwidget.h" + +#include "lrcinstance.h" +#include "utils.h" + +BannedItemWidget::BannedItemWidget(const QString& name, + const QString& id, + QWidget* parent) + : QWidget(parent), + ui(new Ui::BannedItemWidget) +{ + ui->setupUi(this); + ui->labelContactName->setText(name); + ui->labelContactId->setText(id); + + auto avatarImage = Utils::fallbackAvatar(QSize(48, 48), id, name); + ui->labelContactAvatar->setPixmap(QPixmap::fromImage(avatarImage)); + + ui->btnReAddContact->setToolTip(QObject::tr("Add as contact")); + + connect(ui->btnReAddContact, &QPushButton::clicked, this, + [this]() { + emit btnReAddContactClicked(); + }); +} + +BannedItemWidget::~BannedItemWidget() +{ + disconnect(this); + delete ui; +} + +QSize +BannedItemWidget::sizeHint() const +{ + return QSize(); +} \ No newline at end of file diff --git a/photoboothdialog.h b/banneditemwidget.h similarity index 69% rename from photoboothdialog.h rename to banneditemwidget.h index a70d769..41da6b7 100644 --- a/photoboothdialog.h +++ b/banneditemwidget.h @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2017-2019 by Savoir-faire Linux * - * Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>* + * Copyright (C) 2019 by Savoir-faire Linux * + * Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * * * * 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 * @@ -18,22 +18,27 @@ #pragma once -#include <QDialog> +#include <QWidget> namespace Ui { -class PhotoBoothDialog; +class BannedItemWidget; } -class PhotoBoothDialog : public QDialog +class BannedItemWidget : public QWidget { Q_OBJECT - public: - explicit PhotoBoothDialog(QWidget* parent = 0); - ~PhotoBoothDialog(); - QString& getOutputFileName() { return fileName_;} + explicit BannedItemWidget(const QString& name, + const QString& id, + QWidget* parent = 0); + ~BannedItemWidget(); + + QSize sizeHint() const override; private: - Ui::PhotoBoothDialog* ui; - QString fileName_; -}; + Ui::BannedItemWidget* ui; + +signals: + void btnReAddContactClicked() const; + +}; \ No newline at end of file diff --git a/banneditemwidget.ui b/banneditemwidget.ui new file mode 100644 index 0000000..78aa3c2 --- /dev/null +++ b/banneditemwidget.ui @@ -0,0 +1,161 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>BannedItemWidget</class> + <widget class="QWidget" name="BannedItemWidget"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>449</width> + <height>69</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="leftMargin"> + <number>7</number> + </property> + <property name="topMargin"> + <number>7</number> + </property> + <property name="rightMargin"> + <number>7</number> + </property> + <property name="bottomMargin"> + <number>7</number> + </property> + <item> + <widget class="QLabel" name="labelContactAvatar"> + <property name="minimumSize"> + <size> + <width>48</width> + <height>48</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>48</width> + <height>48</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>8</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>7</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="labelContactName"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>name</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="labelContactId"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>id</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QPushButton" name="btnReAddContact"> + <property name="minimumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="ressources.qrc"> + <normaloff>:/images/icons/ic_person_add_black_24dp_2x.png</normaloff>:/images/icons/ic_person_add_black_24dp_2x.png</iconset> + </property> + <property name="iconSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>8</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources> + <include location="ressources.qrc"/> + </resources> + <connections/> +</ui> diff --git a/callwidget.cpp b/callwidget.cpp index f74e2d9..bfb7806 100644 --- a/callwidget.cpp +++ b/callwidget.cpp @@ -72,7 +72,7 @@ CallWidget::CallWidget(QWidget* parent) : videoRenderer_ = nullptr; - QSettings settings; + QSettings settings("jami.net", "Jami"); // select last used account if stored in registry auto accountList = LRCInstance::accountModel().getAccountList(); @@ -139,7 +139,7 @@ CallWidget::CallWidget(QWidget* parent) : [this](int pos, int index) { Q_UNUSED(index); Q_UNUSED(pos); - QSettings settings; + QSettings settings("jami.net", "Jami"); settings.setValue(SettingsKey::mainSplitterState, ui->mainActivitySplitter->saveState()); }); @@ -289,8 +289,8 @@ CallWidget::onIncomingMessage(const std::string& convUid, } auto bestName = Utils::bestNameForConversation(*conversation, *convModel); Utils::showSystemNotification(this, - QString(tr("Message incoming from %1")) - .arg(QString::fromStdString(bestName))); + QString::fromStdString(bestName), + QString::fromStdString(interaction.body)); } updateConversationsFilterWidget(); if (convUid != LRCInstance::getSelectedConvUid()) { diff --git a/callwidget.ui b/callwidget.ui index 46025eb..817a5c7 100644 --- a/callwidget.ui +++ b/callwidget.ui @@ -67,14 +67,14 @@ <item> <widget class="QWidget" name="sidePanelLayoutWidget" native="true"> <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="minimumSize"> <size> - <width>320</width> + <width>380</width> <height>0</height> </size> </property> @@ -84,6 +84,12 @@ <height>16777215</height> </size> </property> + <property name="baseSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> <layout class="QVBoxLayout" name="verticalLayout_12" stretch="0,0"> <property name="spacing"> <number>0</number> @@ -1992,7 +1998,7 @@ Copy and share it with your friends! </spacer> </item> <item> - <widget class="MessageWebView" name="messageView"> + <widget class="MessageWebView" name="messageView" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> @@ -2005,6 +2011,9 @@ Copy and share it with your friends! <height>16777215</height> </size> </property> + <property name="styleSheet"> + <string notr="true">b</string> + </property> </widget> </item> <item> diff --git a/conversationitemdelegate.cpp b/conversationitemdelegate.cpp index aef4413..7418fc5 100644 --- a/conversationitemdelegate.cpp +++ b/conversationitemdelegate.cpp @@ -188,7 +188,7 @@ ConversationItemDelegate::paintConversationItem(QPainter* painter, QRect rectName1(rect.left() + leftMargin, rect.top() + topMargin, - rect.width() - leftMargin - infoTextWidth_ - infoTextWidthModifier - 4, + rect.width() - leftMargin - infoTextWidth_ - infoTextWidthModifier - 8, rect.height() / 2 - 2); QRect rectName2(rectName1.left(), @@ -204,7 +204,7 @@ ConversationItemDelegate::paintConversationItem(QPainter* painter, QRect rectInfo2(rectInfo1.left(), rectInfo1.top() + rectInfo1.height() - infoText2HeightModifier, rectInfo1.width(), - rectInfo1.height() - bottomMargin + infoText2HeightModifier); + rectInfo1.height() - bottomMargin + infoText2HeightModifier + 4); QFontMetrics fontMetrics(font); diff --git a/conversationitemdelegate.h b/conversationitemdelegate.h index 2484b8c..feaf187 100644 --- a/conversationitemdelegate.h +++ b/conversationitemdelegate.h @@ -42,7 +42,7 @@ private: constexpr static int dy_ = 6; constexpr static int dx_ = 12; constexpr static int fontSize_ = 11; - constexpr static int infoTextWidth_ = 144; + constexpr static int infoTextWidth_ = 176; mutable std::map<int, bool> highlightMap_; }; diff --git a/copy-runtime-files.ps1 b/copy-runtime-files.ps1 index 5ecaadc..871e46a 100644 --- a/copy-runtime-files.ps1 +++ b/copy-runtime-files.ps1 @@ -114,7 +114,7 @@ $CopyDir = $OutDir + "\ringtones" New-Item -ItemType directory -Path $CopyDir -Force $RingtonePath = "$ClientDir\..\daemon\ringtones" write-host "copying ringtones..." -Get-ChildItem -Path $RingtonePath -Include *.ul, *.wav, *.ogg -Recurse | ForEach-Object { +Get-ChildItem -Path $RingtonePath -Include *.ul, *.ogg, *.wav, *.opus -Recurse | ForEach-Object { write-host "copying ringtone: " $_.FullName " => " $CopyDir Copy-Item -Path $_.FullName -Destination $CopyDir -Force –Recurse } diff --git a/deleteaccountdialog.cpp b/deleteaccountdialog.cpp index 88e2d66..aee10f0 100644 --- a/deleteaccountdialog.cpp +++ b/deleteaccountdialog.cpp @@ -38,6 +38,7 @@ DeleteAccountDialog::DeleteAccountDialog(QWidget *parent) : connect(ui->btnDeleteCancel, &QPushButton::clicked, this, &DeleteAccountDialog::on_deleteCancelBtn_clicked); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + setFixedSize(size()); } DeleteAccountDialog::~DeleteAccountDialog() diff --git a/deleteaccountdialog.h b/deleteaccountdialog.h index 5af3822..aec0ed3 100644 --- a/deleteaccountdialog.h +++ b/deleteaccountdialog.h @@ -16,9 +16,7 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * **************************************************************************/ - -#ifndef DELETEACCOUNTDIALOG_H -#define DELETEACCOUNTDIALOG_H +#pragma once #include <QDialog> @@ -42,6 +40,4 @@ signals: private: Ui::DeleteAccountDialog *ui; -}; - -#endif // DELETEACCOUNTDIALOG_H +}; \ No newline at end of file diff --git a/deleteaccountdialog.ui b/deleteaccountdialog.ui index 1b2c1a0..5a59ccf 100644 --- a/deleteaccountdialog.ui +++ b/deleteaccountdialog.ui @@ -10,7 +10,7 @@ <x>0</x> <y>0</y> <width>400</width> - <height>240</height> + <height>274</height> </rect> </property> <property name="sizePolicy"> @@ -22,13 +22,13 @@ <property name="minimumSize"> <size> <width>400</width> - <height>240</height> + <height>274</height> </size> </property> <property name="maximumSize"> <size> <width>400</width> - <height>240</height> + <height>274</height> </size> </property> <property name="windowTitle"> @@ -37,6 +37,9 @@ <property name="styleSheet"> <string notr="true"/> </property> + <property name="modal"> + <bool>false</bool> + </property> <layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,0,0,0,0,0"> <item alignment="Qt::AlignHCenter"> <widget class="QLabel" name="labelDeletion"> @@ -48,12 +51,18 @@ </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="text"> <string>Do you really want to delete the following account?</string> </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> </widget> </item> <item alignment="Qt::AlignHCenter"> @@ -61,12 +70,12 @@ <property name="minimumSize"> <size> <width>30</width> - <height>0</height> + <height>30</height> </size> </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> <weight>75</weight> <bold>true</bold> </font> @@ -84,13 +93,13 @@ <property name="minimumSize"> <size> <width>20</width> - <height>0</height> + <height>30</height> </size> </property> <property name="font"> <font> <family>MS Sans Serif</family> - <pointsize>7</pointsize> + <pointsize>10</pointsize> <italic>false</italic> </font> </property> @@ -113,7 +122,7 @@ <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>10</height> + <height>5</height> </size> </property> </spacer> @@ -128,13 +137,13 @@ </property> <property name="minimumSize"> <size> - <width>250</width> - <height>0</height> + <width>300</width> + <height>90</height> </size> </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="styleSheet"> @@ -165,7 +174,7 @@ <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>20</height> + <height>10</height> </size> </property> </spacer> @@ -219,7 +228,7 @@ </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="toolTip"> @@ -262,7 +271,7 @@ </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="toolTip"> diff --git a/deviceeditwidget.ui b/deviceeditwidget.ui deleted file mode 100644 index 5ebc245..0000000 --- a/deviceeditwidget.ui +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Form</class> - <widget class="QWidget" name="Form"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>324</width> - <height>120</height> - </rect> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - <widget class="QLineEdit" name="lineEdit"> - <property name="geometry"> - <rect> - <x>30</x> - <y>20</y> - <width>113</width> - <height>20</height> - </rect> - </property> - </widget> - <widget class="QPushButton" name="pushButton"> - <property name="geometry"> - <rect> - <x>240</x> - <y>50</y> - <width>75</width> - <height>23</height> - </rect> - </property> - <property name="text"> - <string>PushButton</string> - </property> - </widget> - </widget> - <resources/> - <connections/> -</ui> diff --git a/deviceitemwidget.cpp b/deviceitemwidget.cpp new file mode 100644 index 0000000..c8913c1 --- /dev/null +++ b/deviceitemwidget.cpp @@ -0,0 +1,97 @@ +/*************************************************************************** + * Copyright (C) 2019 by Savoir-faire Linux * + * Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * + * * + * 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 <http://www.gnu.org/licenses/>. * + **************************************************************************/ + +#include "ui_deviceitemwidget.h" + +#include "deviceitemwidget.h" + +#include "lrcinstance.h" + +DeviceItemWidget::DeviceItemWidget(const QString& name, + const QString& id, + bool isCurrent, + QWidget* parent) + : QWidget(parent), + ui(new Ui::DeviceItemWidget) +{ + ui->setupUi(this); + ui->labelDeviceId->setText(id); + ui->editDeviceName->setText(name); + + ui->btnEditDevice->setIcon( + isCurrent ? + QIcon(":/images/icons/round-edit-24px.svg") : + QIcon(":/images/icons/round-remove_circle-24px.svg")); + + ui->btnEditDevice->setToolTip( + isCurrent ? + QObject::tr("Edit Device Name") : + QObject::tr("Unlink Device From Account")); + + ui->editDeviceName->setReadOnly(true); + + ui->labelThisDevice->setVisible(isCurrent); + + connect(ui->editDeviceName, + SIGNAL(returnPressed()), + ui->btnEditDevice, + SIGNAL(clicked())); + + connect(ui->btnEditDevice, &QPushButton::clicked, this, + [this, isCurrent]() { + if (isCurrent) { + toggleEditable(); + } else { + emit btnRemoveDeviceClicked(); + } + }); + +} + +DeviceItemWidget::~DeviceItemWidget() +{ + disconnect(this); + delete ui; +} + +void +DeviceItemWidget::toggleEditable() +{ + if (!editable_) { + ui->editDeviceName->setReadOnly(false); + ui->editDeviceName->setFocus(); + ui->editDeviceName->setStyleSheet("background: white;"); + ui->btnEditDevice->setIcon(QIcon(":/images/icons/round-save_alt-24px.svg")); + ui->btnEditDevice->setToolTip(QObject::tr("Save new device name")); + } else { + ui->editDeviceName->setReadOnly(true); + ui->editDeviceName->setStyleSheet("background: transparent;"); + ui->btnEditDevice->setIcon(QIcon(":/images/icons/round-edit-24px.svg")); + ui->btnEditDevice->setToolTip(QObject::tr("Edit Device Name")); + auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); + confProps.deviceName = ui->editDeviceName->text().toStdString(); + LRCInstance::editableAccountModel()->setAccountConfig(LRCInstance::getCurrAccId(), confProps); + } + editable_ = !editable_; +} + +QSize +DeviceItemWidget::sizeHint() const +{ + return QSize(); +} \ No newline at end of file diff --git a/photoboothdialog.cpp b/deviceitemwidget.h similarity index 61% rename from photoboothdialog.cpp rename to deviceitemwidget.h index 737c1fb..fca5f48 100644 --- a/photoboothdialog.cpp +++ b/deviceitemwidget.h @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2017-2019 by Savoir-faire Linux * - * Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>* + * Copyright (C) 2019 by Savoir-faire Linux * + * Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * * * * 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 * @@ -16,28 +16,34 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * **************************************************************************/ -#include "photoboothdialog.h" -#include "ui_photoboothdialog.h" +#pragma once -#include <QFileDialog> -#include <QStandardPaths> +#include <QWidget> -#include "video/previewmanager.h" - -PhotoBoothDialog::PhotoBoothDialog(QWidget* parent) : - QDialog(parent), - ui(new Ui::PhotoBoothDialog) -{ - ui->setupUi(this); - setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint)); - connect(ui->Photobooth, &PhotoboothWidget::photoTaken, [this](QString fileName){ - fileName_ = fileName; - accept(); - } - ); +namespace Ui { +class DeviceItemWidget; } -PhotoBoothDialog::~PhotoBoothDialog() +class DeviceItemWidget : public QWidget { - delete ui; -} + Q_OBJECT +public: + explicit DeviceItemWidget(const QString& name, + const QString& id, + bool isCurrent, + QWidget* parent = 0); + ~DeviceItemWidget(); + + QSize sizeHint() const override; + +private: + Ui::DeviceItemWidget* ui; + + bool editable_ = false; + + void toggleEditable(); + +signals: + void btnRemoveDeviceClicked() const; + +}; \ No newline at end of file diff --git a/deviceitemwidget.ui b/deviceitemwidget.ui new file mode 100644 index 0000000..9bb36bf --- /dev/null +++ b/deviceitemwidget.ui @@ -0,0 +1,202 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DeviceItemWidget</class> + <widget class="QWidget" name="DeviceItemWidget"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>435</width> + <height>85</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="leftMargin"> + <number>7</number> + </property> + <property name="topMargin"> + <number>7</number> + </property> + <property name="rightMargin"> + <number>7</number> + </property> + <property name="bottomMargin"> + <number>7</number> + </property> + <item> + <widget class="QLabel" name="label_2"> + <property name="minimumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="ressources.qrc">:/images/icons/baseline-desktop_windows-24px.svg</pixmap> + </property> + </widget> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>7</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <item> + <widget class="QLineEdit" name="editDeviceName"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="labelDeviceId"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Device Id</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="labelThisDevice"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + <underline>false</underline> + </font> + </property> + <property name="text"> + <string>this device</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + <item> + <widget class="QPushButton" name="btnEditDevice"> + <property name="minimumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="ressources.qrc"> + <normaloff>:/images/icons/round-save_alt-24px.svg</normaloff>:/images/icons/round-save_alt-24px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>8</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources> + <include location="ressources.qrc"/> + </resources> + <connections/> +</ui> diff --git a/iconbutton.cpp b/iconbutton.cpp new file mode 100644 index 0000000..d2b2419 --- /dev/null +++ b/iconbutton.cpp @@ -0,0 +1,43 @@ +#include "iconbutton.h" + +IconButton::IconButton(QWidget* parent) + : QAbstractButton(parent), + hovered_(false) +{} + +void IconButton::enterEvent(QEvent* e) +{ + hovered_ = true; + QAbstractButton::enterEvent(e); +}; + +void IconButton::leaveEvent(QEvent* e) +{ + hovered_ = false; + QAbstractButton::leaveEvent(e); +}; + +QSize IconButton::sizeHint() const +{ + return pixmap_.size(); +} + +void IconButton::paintEvent(QPaintEvent* e) { + Q_UNUSED(e); + QPainter p(this); + QRect rect = this->rect(); + p.setPen(Qt::NoPen); + if (isChecked()) { + p.setBrush(QColor(240, 240, 240, 240)); + p.drawRect(rect); + } else if (hovered_) { + p.setBrush(QColor(245, 245, 245, 245)); + p.drawRect(rect); + } + auto _y = (rect.height() - pixmap_.height()) * 0.5; + p.drawPixmap(24, _y, pixmap_); + p.setPen(Qt::black); + auto textHeight = QFontMetrics(font()).size(Qt::TextSingleLine, text_).height(); + auto _y2 = rect.height() - textHeight; + p.drawText(QPoint(24 + pixmap_.width() + 24, _y2), text_); +} \ No newline at end of file diff --git a/iconbutton.h b/iconbutton.h new file mode 100644 index 0000000..b60c49f --- /dev/null +++ b/iconbutton.h @@ -0,0 +1,42 @@ +#pragma once +#include <QAbstractButton> +#include <QPainter> + +class IconButton : public QAbstractButton { + Q_OBJECT; + + Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap); + Q_PROPERTY(QString text READ text WRITE setText); + +public: + explicit IconButton(QWidget* parent = nullptr); + + QPixmap pixmap() { + return pixmap_; + } + + void setPixmap(const QPixmap& pm) { + pixmap_ = pm; + update(); + } + + QString text() const { + return text_; + } + void setText(const QString& text) { + text_ = text; + } + +protected: + void enterEvent(QEvent* e) override; + void leaveEvent(QEvent* e) override; + void paintEvent(QPaintEvent* e); + + QSize sizeHint() const; + +private: + QPixmap pixmap_; + QString text_; + + bool hovered_; +}; \ No newline at end of file diff --git a/images/icons/baseline-desktop_windows-24px.svg b/images/icons/baseline-desktop_windows-24px.svg new file mode 100644 index 0000000..f56c475 --- /dev/null +++ b/images/icons/baseline-desktop_windows-24px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M21 2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h7v2H8v2h8v-2h-2v-2h7c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H3V4h18v12z"/></svg> \ No newline at end of file diff --git a/images/icons/baseline-people-24px.svg b/images/icons/baseline-people-24px.svg new file mode 100644 index 0000000..6bcb859 --- /dev/null +++ b/images/icons/baseline-people-24px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg> \ No newline at end of file diff --git a/images/icons/ic_hide_password.png b/images/icons/ic_hide_password.png new file mode 100644 index 0000000000000000000000000000000000000000..ccad190eaf366c056fbaf2b8a1935d97f24472cf GIT binary patch literal 4717 zcmeAS@N?(olHy`uVBq!ia0y~yVEE3!z;K&`je&t-<0E!C1_lPUByV>Y1~B;Pyt|%( zfq}EYBeIx*K~EWk87r3BmoYFfu$OrHy0SlJ5f+hEUzO<pjDdkcvcxr_#5q4VH#M(> z!MP|ku_QG`p**uBL&4qCHz2%`Pn>~4@T#YaV@SoVw{t5e%n9AuKL7n`AEucCQ&d@$ zq*%-sO>@c9oUW?XCC$Nd>TVZXtCINMM_W5MmabSZg^5dxD`RJ}YhXx$yQ|<7r&b}; zqN@oU9M2B%a&o2^8Q1=KTpK-0(fG1$?Y_U?LrPT}XT5w^eD8Vn`MOC0OimrYCa&UW znQ+I6<D@PU<&h`aC@?9SLvd#-5_NK|l7LeYx1!2+WNK$9i<3v5V#^aTBuZs_mjlSi z6#~p!O<9vwJg?ke{(5Pai1ey6X(v~+H_UqKlobB1m@_r+<f1itJ6m0*y_pp4k#SOQ zr|OmoFDe%>ns%-&3VJ5S6_Q$XQg>mi%k(=!Q642HbyuqH<XXsXvOsNPDF3NDTxtt- zAX+9x2XS-i?Nr@1;fd`8ubj@cze1jc32>wqp4460sxtk~q$rOf5R>J-+}Z%)SJO0$ zR|~an+VN!C6{jZeyiQ$}olmCSkYrnNYJFYPb*FdB*wfZnO?mKDXwRi0b3=*G>-48? zd@}6@FQ?hm-A}?AOcgfFQmRT7PMB&}aktqsR^_U%PY`Q=ll%Pr^Hj3_d2(G1w|%|p zOObYf%Fb8o(u%YVRCc`D*jA*iptAGT=K3v9gBusTkH5?w_R?tkybq@yta>bUDt3F< z^eaMpJ{D<5dly};=KXzVRl?W9Uk|KWct<FD#hxsU?MK8)-{nnF+!x%byD_xvYtQG9 zByEe(wy!<kLz23UIM+FD<2to=r>~;ah3C_5EXsTubwnY0)^+h<2Cj+gxo55m2o8?X zsO#!p7$U0tMIdy3w8jIM)=BYESNZk67)*U&d3tT#q=22%4^L<8ynANZe7TUPtCs7$ zQog8K^!0??-)Z~%cC3r<S*lgixi&1^H=4zeDZJ>q{^XY@UcWjXwd&BiG<n_EMf#`b zJyE-st7)`7?{<#gH7#$;7ikw|jJD5vb(ZVZrYq&aZa<T!lxuBN-S%qlyd|q16s31= zn!253y<cQ@?oOk!r*`3!#U6YKzLqK5<U3XCpeT3kiMcnd&je47>9`~5wJfnhe`dA& z1EqwGr=tEwO_XM5NM|yx`g^cZuUVHhjLDtZnpr<|X7@K|kF|4rEZHNN?#xm-dEJR) zv8}1SdUa)4JkuTaEe#BFF0`ao3hGY{-FteKyI;Zmr~|nNoD|;fs@Wy*+wg$yfff4$ z8Llz!_R3>jb4uH|tn|E7`-A(;Wv{m7EPGXap6MLxJi~Qo_wWAy{Z`l7ecLo<6yM!k z-_HKQ>A?{d&$JTR6T&uv=?wY|axW^Xdg^7@u35{o<c#dx#p)l{vaVqkD-AXi&Xe(+ z^yK3K-UD&}uH2BTXPn2E6MQYN>{{4P*JQO1><>JJ|NJ+6uO`oz!!=o?#>%nrEYm&C zH-?=zez05k>uN02b2T|P+vQDJcU66YWUz0lzd^^hJ({x~KaO`_>ACLN(o<{m`(9nz zF1A51g5}JMsx2}VGG=e?y>fiFpV65s;N;q(*=Ek~0=J**Wwd8__RT2jU($n*!6wI# ze|E|FIxApum`{KAoyB>cjfWeS|4`bz?$;gf#)FwPJD%R-7jXJ=%;@{_@G_RT!z|jq z@}^PqR8HF7V4L`I$>g&)qHgRD+nKrY%-T(-C;n}i-Dr9F&(GNns){Y`yH4KO{pF+M za|ZF(jyf*aWA3!yFgV$B?c0-m+t2g=R(g<gb*4aY(YD{0_{)=+b7D{a&CXe}NB$f` zU+7&<L&f8})c+RoZhOC2duO;{`q7(957@18R+Kwx_s-p(B}ezv)4eDD8t3d=d;iT| z>4KTBHg-o{s(Z1laOUre>+jgJyqi<N`HF>`Ij*m_rk!Iw_iD9SV#y)P-)Nm^6`Ye* zd96-u@0x(mOtV>Q=H3fi>HEzpl2L1CXx<!|lgo1tu&WDK8|@U%x$e2<jqIQAnhsl^ zZeIDctiombHOAkMUWZg!tvPu6!}aR>3Spde8@ZTsTy?tw_V512oDtviWp`U+Kg0I+ zl}%}r)RUUtK8=&zSXpN)x|73krpHs!&MS}Y+U(z+RoeX9D(&QauK&-O8I&g){itV( zzt|jO(y_kc&hZC|4;KGR|L-4@!2ZD6=2OFwy7=eX!Y{vEW}9;Tr{LU7MtQcfj-p?g z?w|ie9<W!gyTCAKS;N|W544tZTIz1PvH!SviR<Ls+=UE3<P)+}4o=t3P%Y;@omrW( zvAr>zf!TJdKR>JG?b*+hC$h$`I<R)x1J`N(ou@N0Q|#L|Hp{S8pS(4BUY(WP{*E^a zZxX)DRTe)Xc%c8Z#2(kcZ?&g(?XKCqhvP@!k^9$~t}&fwf5%}fR&~ocl`SXv$L<*k z3#;T~IAzu}UM)JQys`RGLjU6#Ic$EMifec;YkY}&KF57ytj7JN|9e&E@-W_K;+t~q zsz6MVeG{{7U9y~z6<f`+`C_@3vKf9R=5TMQz5ls$x5m@FoXe-q3ay!QaLuO*5%!8r zw~ar&|I1wV`260)S*`Q@78gYyh&>QpS@E_~=NrqqZ%o3fLaQ9jv%hJ5yE^eG-;I}A z>)HR=e+hi?(nNb#Yww)+#<g+XC*y7`m^<r*s^A`<py?Xf@-GT^g{N%Xp1AtLKM^O1 z?oTfBo`oDq-k2PhwAS{0&0TL#wwqn^K4}(7typ=#nv3t-j~?02$_JjmNED5lvT_6G zyhWS^9qAt`B}E>I<=p$=?t1#}7RRNV%no`_*xApp&-0IT8PkXT2fQ1$Dmt+)sbzCG zz;<m~a`(+-_ag#jQ_g(Mn(_QP`?MRvMSG4Xi-o7(<=)ekc_uwwX*>HNj<R>RmfrYK zD^??0(fzA3*nD>PFInCPx^nH28$>Jif8V^=*HGP1>+<a9)(qi{-ZLIlP3D->D67Bt zS><7kAB?~A9?a>f`_8dVx8&%zJYLP1cYFuGfBpAS_{6(_wtnXP$#*7MtLq(FR=art z>mMcyyOx6ZFGk&x8}xn@@BO(+;V{#Fq1o&;0Zra-dS>v}%zUGFJ%cg3VLDTGlG*Xa zUw0m7t*id~GxA>liLT_v*BeeBZ#~j?R;hpenj?G%+#Z~b?39ho6R)}QTj2SGvm8~k zj~?JXV95LGx96KTmd74v6}G)EwEw{O;MbZX=Uno{_tajyJk@5;e{1e%zpCfx9du>! z`(80?_QPr(W^sn;)k<gd{5HRGuKHgs{>J0FIJ2?Qx*4Z8zU+$m_3%~o^;e8m($>d* zZ<XBd&%Jxo_cH>Aj-5Gea9W}C;QWT%_G-49^4WjXAE-Q-E)-K#ep2y(>Vbcj9kr$# zcy34(am+J${DA*}><zPXS0&BP-+uF+S#kNQO1+J{AB6NzUvpIMYs+St8zM!gxMs!+ zJYZ(~&hWqW?e%kyyJHz@cyBm2dB1tPq5b%AR?9utSEz3j-l#ig?VVFb>zAcYQenQq z@g(%XyBiZvMi%pbxF0t$Yms+OLwJ&S?wRus_a57@^UYyrj@O^`&fi)0?c>CQvm1pQ zd@WNy{5+ubKA6{YzFW8Llfn&J>Kkw0o_4=OcArD;)3Sr^4eygDf0r(<c`dv#IlC|T z^PY(^&%f3u#Vzc+d!$mOAX#HY<n-T5YwC6#DUbQUUR3kC^~S!>=hMGFnf73*_V%A~ z_rojxK6gAFy=*;m-pk)6Q?*XMZOZ?=@B7L)fyzxhKa4jht#+9DWT`-P>-Eo@WcK@U zNAT}q`w@DrJ7k&8?I!+v^I!T-Kc6Hn`y}_Me#3VL`|~dp)v7;Fuj1Th{%gaW{XyKj z{oh;UcWv*|d+hZ7)Hj~Gt@f$%D)Sw;`SCHYI~u0`c5PbK(xdlozy5fO=?LGAs*kCu zg1bMQxf^)Xc*EvPdTeFdFOqwh(v#aAU92yL-n1^>$iDHg$T^kW&Q8mOs@Iwy&DYx0 zAM3Sq?<Mxe{|x&Yb&WK%-rnV%)17-MTzK!Dr2V|R?`55D+ILC9>};vXhFvf0$}*pR zJ0*WW&-S;;2LHw;=0Bnq{IjK}K6yInm&${=2kKbs)&{;g_eQwk{`94qaZx+1S>j*R ze*9Y#v%urzf2Nu<yLp86M63*F$Y-Ay@*!NBF^{G1<fDouw@$rvoVe@8bcXgxf6FfB z?GXOK@<CI{_x{z$PaR3;S^e1j80Es7)|<7-DsMAtDR5u;dcl$O5cM0b?9-Fjx1QHI z>3;ha|J>6J_Ff;(9Eodrd)}VYI&wP?PxapY(l=zh;wn97+Rx|SC;Y*#zUsWzP4_)q z(TrbxJ>`5~Exl3oX0g|ot4wC0yM=bYOV5`4ePimR-Oe8@|B1wV)>)sbO4R+J`o?6& zRo}@rO;`L6`#DxJm+f$$DRKCmiUs%WSPL1gAWzTGrjyH0#dXAb*!3qpGui#{xg1M) zg12C{W);iA=ZV)p?-7a)4Rdqb$g8lPsV;n(<(sIJcPAd5-=`ZM>+@0hW$?$^2e<Fl z{CB_V+OO~>?%o|cDeLvS*RY(w5uUjC^J^#8*&&`+?TX!v|2pM7KYOOD=F95_`2_Kk zf45~deOLUpc_Xt?eAC&QkVf_f|D<Hw!wVNND|x#9uFxz?dOGpOmn(Xz=N~-&$^IcY zNA^qUjjL;yo_bMx;!n!-AC(8VJE|>fuWf1Ay@7GB^eUaQ)Ti%GJZQe*`XZf?{pbGG zC#>FRJ&|s_&#+(l{@!<&Q`O(g$#U4R@Ak@i&o!-{VO!<tSG5P$rbc_+(%5<2bD#9K zl&>7;Uua%^e*VDP8!^AK9+>5LzL~~kcUoZEiWizUPJB~(v*OkAYYXNaZ#a9y;#_s3 z?n1S0{z<!Z7I{oc5!*KXTTPCN+0uD;c>mnp{5SUB`>!`DW2HB&ZJ+&Dal=*PODocs zv&>GN(W%QL`RQZ#afbe{?N4lSl#el;Kg6w>m+W@!<}TJhyw)zCXIZ7Z-gRnj#Rt6u z*P7%#OWAI_{L4A`ZcB9MT-AH4Zj1Z8+V<xn`|Y+3n$!IgvL~l&Ol!S-NKAGw=kAGR z*|JC1ExjW<iJ#&8k-XrTS7!rcdoRTtvx%<fyuEt=vb?h&j-9xx_>=F3%<G@`+GQp@ z>0M+iR42X7{-IieiAlo!+)FKckKPNpFTMLx2I~gpud)Tg{NAz~9FG+@tZx%|ml?#U z!fR!rP`Hqv>D&RonwhHXS*OM1=53GT?P+b3ZJuoM_J+KDPa#KiMWNvaeX|G4mQ~r_ zV7v2Z?Ut(toJ(a5Cf}LtZO4B*tzwe-ZT6>bsk0v_-<aw+J>mCj^N?Ke=}*orv$qqE zKJ+Uq$ME<9qe|6`omXDRzUppZpRKp`$-O$Y`~21>4@BOuO$nJa-7I)}{*NCV1*sf~ zYr9;F{M9O|FXS>7NPRHM`MH!upFjDA)bG$6UPpW#v^6HEmh(?K&r)`jPs~C#I(}{A z_D2%Ot~J&(+}7LO*mfq|``sIreEvOqWujk}8EpIP;~lj*zp6hmI)42@wv+1^->v_B z%IIWl&x_3)CcEBijji2cZ1!W>zREjk-_6dSv1hb<B3bPc8CCRL@fXkgZuzdcw+bhu z7kS$4<+)qen{+&&meG1k(%hD5cU)6HePg)8sQ0sYBQtNB_osC`<*jEtihASo!Ssel z#e^G^cJnM+exq%Q<qh7Y$CJxV^$)N;+tT-U;@NkJZ}_&IPbxo@dth33pJ}P-%qQ#o z-158kNk}(TZ~I?s{=c4?SF`Wif*TxVS!d4PShprVY4u6DMUC0}RLl3K%zwGwc?0u1 z{-bP<({{he<o)&fZL8|r(B$Zb-x~zqh2E%opL^rW)J>b8tXuo0c*F1G-w&E?ka_g? z+d{sBlMCzhCm(rhZ~cECqcqFzd&Xbh9=IiNsCiZC$-6Emt>c?-tX$OncdNkc`1`Wf z(`%0ldF;En`D0c6+Jkx#KXkWc<!o`T;_dLvyQo-m>!OSNk!M$Lum5=?)XV>C&wrOU z`(DkIwV&Kqols)OGpTUqHsjyhj+w6Bo}|9!-aDrC$ND1n@k{e$?{~Xxzj)cUCt`n7 ze@$^ex17I9xPIOKwmtIp+}6hHYJX){3*;|xev+8uu=?-ww4Ax$)c*gDXn&L2D5^6l znj_F;R=p_Z5QfTjq)`sUm<PtN2xvqDWtamx=z%&Q0^tP)|6~0vyJmWFZs~i_u#u;$ KpUXO@geCw!)(MdS literal 0 HcmV?d00001 diff --git a/images/icons/ic_show_password.png b/images/icons/ic_show_password.png new file mode 100644 index 0000000000000000000000000000000000000000..2a6655786a47723443854df3fa37aa2daa3b9ad5 GIT binary patch literal 7530 zcmeAS@N?(olHy`uVBq!ia0y~yVEE3!z;K&`je&t-<0E!C1_lPUByV>Y1~B;Pyt|%( zfq}EYBeIx*K~EWk87r3BmoYFfu$OrHy0SlJ5f;&sO5$65n1O*ovcxr_#5q4VH#M(> z!MP|ku_QG`p**uBL&4qCHz2%`Pn>~4=8~t2V@SoVw{t6}#D-2iR{wopc(I3vQ_>+7 zM^47Tj5aru4CNIH3Pu_VT7rRs0WPf;&diH?A23+BEOpFr5fBtPdSZdu1vXJf4krfT zLlR1o9;>uW_k8#Jzwx{3`9-UO4p+awSN!hZwO!g<C0@^~-naSt&BNQ3pUbc{E7}~{ z#=_P-@pgiN#7<r`M$v5{2_Cn+=7R}O%+MGoa=o$X0GXk@UAGa74v-l=cVL!Pv@FtX zyx*}%!>evh)rw!6e?4#9yg26Se7=Hn&%9eVo4<*!a=q7B?{<JC!OFn*{~ehdKJ&|L z4=69-y|F;$9rLaRzXaP2Qa_g4oquU>KH-o4zfAUqiMI{vlFT(T<Ch(|D>Q@m4Z|Lp z8*DR-TBgeJt}=IY_58>3!Qz9)2aXL)5i6g>zn!CfQ{1RX+AVEvw}bEn#y9LTEPKRe zaBN}H{q<d0CCumo?|RjktHBqS%fGmoF8YBzL2-kJZmoTQ+3LI}=d33xtG-f6C{Hj? zNKfdCdKR`|f&Y|)*9#mZHC9INXQ`0*Vf`We0b}V;?{ho5YD<;NPqg$+UGcU`{2s4` zRK@InThk7mh?(-$ZokwH#vNgIe|>dWKk2U7oQc*P+;exFFK$R~G=EWBS>>i%WP9S@ zny7EB2TTtbzj_v(a__`j)s45OURck3kN3^ZhU%iQz}k9!#_ifC|1;UVn)7<IZ1R(H zRtvjdCCM|-VLRh+Da3V6#EMxjL{)!UJurO0^gwLEam(;+szycWtru8T>TSe3^W<4_ zx>-*5T$t_V`u+t!qdD__ws)*my)WF}nQ+WyIj*L;@;q~#qlM!}lg@kGcX(^$I`^zU zekt4S9oqye&IxB3>{w(N-z;%4zamzfb#Oh?I+sgXqRKlb?vA@wCH^4x0Q-bh8&w?A zR?Jsj&*0B=pDB-JTGYKeCt|gO%o&3lxf{2y(vC9;G8ggG{Ui0jy^8mh$t3BW$6wW% zuRQ%XPGzbo@9PDpnNI$0eCqXS_1ARm9>b#kjw`NPuPkSfcMXaxTYgUNl!x$X%LAnc zqOwyAi}=fz&ud^gW!K}f|LoUqkK_KCKbY;2=re!kYqxh<N!yiUBjQ=U9bih`x9jzG z=I6}i(O09-om?xLYRz!p)oSytGpyfdJrGq%EtCFG_+aK9@k3Ag?nH%}30nyMP?)rR z+oQ<^0Zyl)_P4U!z4qj4=y~3qrU}>B-f-3MXTI6MQE_A4FZqcNUL-rz-}8{O*}3|N zU>Z}ro7QQood3_;o~)jrwf*zww4<LL-jzLIc#wUdEaHI9`tKiiH~u`ZXwQ<fO{&|Y z-gF*NJ@C-OdfDBzpSz7NrTvP15VPd-nxrS+`mgvNP&{z6YJ1+PiLGAqvL?1n*Af1& zwIxD9UP-7k;fU;k$OH48{ARPd=JmGtvz%kFbDU9om9z7-M|a91k6qJxom%}BKDnKL zb^rCH`hA?7T4f4GCyl?Z+9a%W=0;<O@wSZ{TTQQI`-p$=T=IF1_7S0L2`AQurtN-t zw@UBflQrz8c-Aw#3wgcSg>w&+=E0K3G5c3~WEH4=$cjCFop~~Q#IJx0ynomN&sD0K znA>s`xd&e1lHvR_J@1T#LehFxxe%xSTszobPO6&tW9ud>=N`4J;3j#VH@zMP<t$tF zi9V1&u=2qBxy66o-o1%<9k%t_`-{C2>>D2bnsBUxd!pU5ty!t3dbjC?Dv7eHeiccO z`yjZNsr3R=v}03lJfmLOxm<&y<=$_UHY^tU?VA#Qpnge<p0e#}bLRaHSxb%8jYC8? z%xU_vL%wZ^)NSS+Twj%VHRf|4^!+~RPN0aX@>#j?kC!4N_f6cjWZKW`9$n8om&`g< z`9W4m<-<1N52`MwECXx4imER0|D%y$D3`sX(lzg{kFJN|p_K>3=Iw5(J;3y!C}HFI zUOuVsH)LNn+Xt=Pu|8a-okh!@`OlH*hp$B!X>VMvwDYy_)ubO;8_gA>?xz3DlV$5{ zJaXXQ0r3fmJi2nid!#d2|K&fw6Qx{UYv$|NSu1Pw^U`$%KTgU1YNi753$jVki|W>& z6>vPseKqv^SA};MYs)7UuRFaw-sW4vVv&h8uk*k9U4Qb>&2!BGrrP%CImNG?-<p@5 zn|k$9EZ-aMKO&rAKVQt<@=CEZS;W<Pb$QaX-E4Uk!W*XN^-0c~w5y3{|8I_h)y3<k z%PiD-Q6^-RlVDWmcJ=fDqX)7Fgyd)WKjO*nU@DNABsS}%=El=i+v~Usitlx-4ZHKQ zI-W^}>&|ladHEU&x2nt;^8@-Xov>xw!Z_c_szR-L*ZSR8bZx`@f5mWrfBE}AXXldt zLW02`&IvNctz&y0(W^Tn+Ky}WUA`L8iv9P>Yj}?2I9$@W@4PI0){!^I-b*VV+*bT$ z)uZGBlZ)Bb{6E+vulk)A*|}I_R!dKbt(<+ZhG*Ruo(JibC5PP$-)1q|E&E;|zxbu! z-p$+-dK{kdee{{ITdTcRb&_)Kw}SIw6FyxO{!({0-{jtta{X0b?Zj6Gf1mh3^+Aw| z{JptLUx&YXvQFvSe+AP=c3j#P38q2}dyckzbpQI7yGkLhX+Nue?XG%%_G{@!n~qB= zeDhgy<UPZmP@l@MWEQtK7w2_NdcEJN^Ww{w*(S{Ios(Q=KfPC^y>YvX((?7k?x!{L zcKrLf^;uW{Z@zz?OH{63=Q<Ln^7W@&LhLOu8^4dqdCg0@YE-ucdmGE|IM-pT_xkM= z330{4EHzh6vl;L4#PIld?w+;w;k4-Z3U8Otl=S}2*lUMhZV8z6+c@c<x?-zRb@iLG zQyX7TJUHp~rCqCzY6?_yr|kQ5POg3rSAlkc+NFqu6%$#n&-#))@#Wlo*Vsh_EZ=%J zc7}cmO`H@RUm*1%dCANJ;Yrp@!v2&zVAT#-$vw|0%I$jfA3oOy5-z(|DrXcacWGW{ z&OefGIgj_i$pgx6Z+6`~m>=Hs`;KL}1J@=om%uC6GPv&v6uAeQ2ue=aC;rd-LrmY& zJyMN!OIExz`;%khd0~;>ujh@^+=TY5V>GRu$hV~br^cT(Hmi?uCCER&^Z3}_Hi=fI z4cs60d;GgmzIIRXgrKYU+$w4d=XS<k5w}ueNXmE6S~<_;mgyN=ePyGN_(S)<NK|Q< zDrR1;?EMt?`sFlpW_kA(o@kr<>7FHj&IMczHrn?soT>kD{ui5rEDv5ENbEh)c>Snu z|DqL~p3man?zEn|BV_LZy93N_??Uc;=BTg^T6Rb3K;l=K0)c{h+q<84@X0S)ab%y6 zy>%_yq9umSN8R3Bxl_!p<KksqyZxS_f$R^-4cWH36*0+4#}91tXg@zi;G3wC!Gj_j zpOY?45%Zm{p5J#ZH~!(zyVj13GuKsF8mx_DSwAy+opf4t%C@V1ErvbodwfhS6<>!% zU*G?WF>~o$&YX3I6H>0cpX|}tvD&C_roVZn*H^a(_Do&sf5a-xAJ4fIWnL8iHRZpH zxZRYGJGCcXxgNydVaw_%{kHSV(f6y~#hbLae_|=npXB~;_Ay~A<A3uEgYNDS_}{$c zDoZ>=&9-OF{Bw#Q*G-7|7TWP5wzYn)=G)hkT{359Z*==wG2zRpk|ndVEI%~uTEA4V zroHQ5@!pQ6GszyS(u@~OcvwD<=g!)=soYOqI=1nfT`gIgwc&=Rd|tT25kIj%Cywks zd4o+~sn<N7ecrX|jHPVtk@_DvE(QNBS}@}x^IIR=88Hs$KcD!}?4)*L?d&%iDYM$R z-$e5HoV#(X&y=~)X2YsJ={-xP{qa4KaZkfJTVUn(PfiKPmMpq{z_!sMwCJ_cc}6+j z2{%MtW^SHgm~{Svh*x~`wT04x{x42Q9OOR0|3ymT(mw5MnG`qOYu0kf3Ca^acKInk zaa<Z|x~L{O>{9%$d)18P3XgN7mYQDYs)<nEwb^KjQ}F@bs$LFG!$m$@8l*Bd9!<WJ z;ktyOu1rC5eWP@`;RZEs-MPE&?Pk8tv{`D;y^|5k>)o#eZaaNq3h#2kf2A$$Oa%%B zZX&L_ysF!udE2i%xGbrm`}Ks6yQGaA-bhT8-X(WK>!?Vw;0-~+TQ{_Fa}8`u=3jKS zII`+sOLBXEx>}^osk31L+aL1$30)!MdGF)0E#|#K8CHwh=c;X7{r%Lv1EvR_W$u0v z6;iU5?Z1<Yw9&eZV-eS_<c_9wH^`PaE@$z|Y5$UQe{y5jT284mvs}x%nkMc3KU4DO z+&bA6+4B;n#T{SP*ZSb2hX16^ocaxB7qaeqo)Xr$DrznBvgK5i&*Fw2hFj*$`%hav zSlIAAndi+yy{d(JPr}3t?Fu9wvR+sf=%#cjGuiCJR-WS~Y7F-~7iC19dRHm`K_PK5 zr|0Q?*;~H9uV^`PZ@PhtxLIpl0;lFS(JcKx?1F#a=|oS-owy}t){}J%{K9DgYkz57 zX$#@avz?WYX2X=E{-|v-)86#(#q2YGPfg>>F^X!N@o{SwqaEv(rKx*Ov-V9XXwJII za-Z>s+2RSFeeNF^_cytm;BM)cOK^?)nX7uT#^wIq_TLY*8_JjMF`xFd;ST3Peg->} zOHs`gGkU`umbCV9|C#r9k)ngv<!j44-e`KPt-H9G_xrjj>$ClZ<CfkE&`{ddQhY3X z=XR$kIqRZL1)>R_U7?wRm-_eabiY2I<E6B}vE7B$*R1(H+~WQlbS?6ny^HUtbHv0a zc3(Hi+}XVP<lll*@_GJ$gcy2C`rk}Qx*Em$!}_NqW9E0;x?s6d8;*_1rN{64&v?4@ zaPB1aAhlEf<c^tfd30@=aryl;wy4J9M$5x@_p>Meo8}Sj<$g{~XJxpb@cNG?`!@P_ zwNG+3lBslRxgr%~BID0~+auq#XhtC4$-PEX^|uB#=j~el+D`i9(Pdxn&Qq@MXf$WA z<||c|dZRDr`1n`rX18}++>WXJ{kTtVg|A1Q-P-rpJnb&FoiWnyn{uamLjRTP2_D8v zjV=~zUz+#m|NizrN$&!}7ajDlQ9aH*HSDm*ltt0e+DlAdT%1_6*#DG-(PC4Ho%7Fs zblSRXhvV)uuO&YpyfN#s?Qaq1Dc<~U?_7V_zPaQ6nz`<~YIu;{oLR*_@1i9a{V6jj zig%XyJmXjr<E35S)q+m#<J<Y#b;-2P-|k*=5n}lFG2_Hv>j(0dTkd&o4Sl?S(v&@A zO2&I?RDLjPO0{rIWICt3Q=G}4H`GX$f78V<ruk~jOpUy5Jxdl}`V&$A^-I9s<}X#N zF8|BRd^<I7iPzfn9j%h5`u9uzPgm@}#*{Pt)B6JHf1LbN8sjI#-A)zT7ri*p=~#-r z#houV7oNDwUK8%$zGp#0kDT9UlYQqmoBA(nwVRt{9(&1SqPh)x%r;GZeYt0R72+TM z%0#~Bm@zl3eDbQbdTva?=ah@?cb|Fd#hrWLnx#^i{)f<no6GpFRIvP?sA{QL(IWED z-#5@~MKFIze3#KFkMs4jZcfcT>A$mt^@r_;=7}Ep#}DV2u>TRh=>PgW=fP-C`%k}e zRdk;*Z+!2%<?v-5rgNtRcbY3C&vqAi(`TOO`KwWT!h~wMpyb?+ORlqcW$qpbO|jo_ zZSlNV%cnE5ZcpaF%eb8Vzr5S7d&)cGzcIzD>{V)YTO=vi?9+Qk>hB(=3Y*989@ZW> zWTL)#Mc;S7misTJ@GRdmA#lpiW6C#jPS*cmIwZcx+vL{eyuCG2KPK#okKDtz)@e%B zrM#^<Y;jYWlfE<0XAkQ?<}G!x^Z6WY#`})XOv0JezuPTYaWr=8z3zt7#yjrqJutoT zxUs>b3MnNKL8D)SsY_<NSBFaXT5o2&Xb>;|!Ab4Yq4lR5R&QsN+)-|R^WxKY?p$GF z88&LUGLAQj5=6f~(qr;kZ0qB`r}3-(pY$arTSY7m@++n;bc%hS_h9b<WyuW>QXhyt zP<bBns?|)3r@|zW{jybK@Z93l#~-QoUbC7yL2pVt>zjG%#VdlhbNq6g{xb3Na*_A< z|9Tutk=vlge57xJ#?P`AX&-H7`wPsaXQV5)%w8+}L&NB}l}nSmhvnldTiDNpul*@} zBBkHe#Lo2^_nifDM?OpLNLRm~VZO;$r*Kb&$NGay+a^StM;Gz`SRrJ4<k2)fmoK)$ zM+IleRY&RmaP`=kzL)<RSJ06!k_q#Q^Ge-1=DxYTm~(T*QN>qU?-Qq7{CLpp+zh$B zuVa>}@8<qcDL2FL+SirG7mKatc+>9V{xZxv?(}!PmkVpvjUqQ`CT9z*_P)26J;0-S z-J<tjJEPWA+w?gvZ0V8Nr5y0uR<I&lEar2T_+88JqH}-wP9C4nX0wWAea~ZS73tOT zJKW!2V`uD7Rndy;RWjPY$D`ubuha)w4{mRb_?}@C7H|G9=7E(<fW6807j6$Ep2s}v zDld5}eDzBCtGPAdF22hQPVs(aQ4;y6yd-SToV2Gm)$UbuyXd|MZJc;pF>)ev<I}A> zm|P$K&36gB!m@|;hvuaU!Ani+*`HZGe|J9Ti@!&l!?72BLE*m)mPn*;yXXCwvHWG6 zi_}X$+XM5iRoBP|oV;+i>cMWY#^$RtTBb4mR{xOppfO5zO`z_+WD(c52Yw#VY}Boi z^kkHMIp?#}kGS6#yS;vxrKl9NPujyDs2RJ|e!8S{p-b0$Gu}YXD&K@7?-<W5ICj)= zt5W$Q*}vWodK(36)<$)^MwW(tX0YAzOfmI>qNn6{<=6&w>*rakq9Z0VG1&gBZkQ~< zdVYe30i);dqi!2RE-re)*Lg$K<>QOst!idl?`-h;P|t8&@S4X}r2>@={|h!x;4SUf zt`S%%!_#@g`|I9UL0`jzvqM7b>&y~))3q7m8O)4VEp>Vm{$j4lltrTLEC&88)2_YV z6<!=3{P})3W4zMtzbBF-m)ka$XO$heV38y~!C~$C&8OK9M=c3>x~}S2;i4*5uf-a# z81}V4iRW&tneo-*<B7lfTxQs+mou(B_Iqm7TY+x@`UP?Yjm7KM9h&r&N2rupURkHH zo%2BY$?p$#x<$P`*<s+Kab%sst8LS-%)U{ox;<*!)mK5fd@T<IgA|H_qJBNIblNSq zq?*O$&Fl#`e4W*HxqbbnH<iVBV$y`U%s&G7G?^-`3${Pq_xf3%e7n!yOzsC$y$<|W zJY|?IwKe@!UhNmxuobNJV*i<QI(JuaZs?8tuxrQT-78wNd0TGqD>hAEEuG1;$n9wB z7QKq{C0)5u3}QBgoA0r&*~}1qwqvhqf%T++pZ2a>(DP)|_wsYLH(&g(JiMlF*@<_o zb_>e+?w=G;&YhU9d^Nc3qwsFt9U?EUf17)wQ|*9_OHE_K$+ax+-BqIeRqj44-0Czr z&fG8f{1Jn)Ey|0F_>TU+$I?C}QNHO&YRrcxVNL3v=lHAe%zUEs!BV9u@9E0q&9~Mb zu&g@z(Y7rx@cb8x2m2mAOJ{e_Q>~bPZ?FGy$IQm6cfKnBYvl@@L|lC%gYrMN+?dbo zcdXvFfop@1h1ie9ajuu6Z<{=J2oy10{klj}$>hQ3_EL}jFE39lnGnalDfd&~-F0HW zr!YJc6MbO0<fMkM=B1EWg{=?FU#`5{d*5-JhxrTEj%_jBkslH}?=CBUGnrXooAaxq z{p!wJ`2)pzy6=VdJGf2B6Fl(m?e%iY)0W?xF8)+KGOx2kPi76<vGV@hox2{@`+e@4 z>sj>LJ)h|tQ(arfpVkM9{=3@$3Vya|e?`ZBsU2)HTL0_LNmV&ps_`M<R{0yBollu# zzSO0pocldN&`NQ~i)v<jcD|lP8r$=#R9-kJow%;Zs<lseH_IR13ib~P*E;5Eo{rrr z*mZ(u#q5S~wny96x<AwY&k-?S_4-;yy^5YGuj|AnKIC##+%7+J-!H!BcUG<WH)-Z+ z%~zZ|L^99pVE(`Rq*BU(gV(Rh-c{{d<n$tJk5@*b{gQ&0k39s=e*dob`s&9WI>OeI zr&S+#HlvTjPR2vR_KIjq$oZcK_#2-)?dcBpRG!=9a@biY>c_q+#krCH%L1p>+uv20 z&G?_Qro|v@$K-_Dj}Of3nBgj5S@?EBw&O4MXUdHi1&;kw*?j4_vMG<P-IiZ&k@thW zK5%w;J*heLLc`n4N8hOaCzngk{>#Vz74%N_aa(lk^8|+^jcZnt+e^#}*7~y-KIuMq zA>=0G35QQFTa14wY<$w)u({#))zb4{R0OtOVqLQ7!&i@`H)Re@TA-!KtKiOD|5aB& z>gN;QFw;-*ZC~1c%X!Mb@hg`v*c<gZ)T?ef>!NU8`JTqLf{abhQ?DqN9<|(hW4{Yi zqyMjp+^(A6b64N_lCM;G`N9z{?a=Z)*^SZ@YF-&<M)B!7+?2cFt9w(?>%|4WhzVDo zZl4g*zy0Hc6UXmI#~v!Xn=qXznCVVJ=hqj`Rrkf2?cFYUy<YLz#c!{>d3Mj^0@W`% zrH5xTsg|<Ntgzz0X!F_Xg5=L%yH~U3U;2IT=7|%xCa|+j`O3G0@8XjxfeMM0oDs`r zZwfchNcuZj-BL%$C~Wt2PrF^bH{8~K{&v9c1kanBC#GCD;?>@v^6sPb)@%GJ8z1SI zKaq3zq${xW%=Q(o=esi!oqkLbs+RmvuEOz!N6F`AGs}xP>rS)8F4mpM*7sH*^w!$1 z1vy-EPBgDgTz;(Z9MdkRm9`yDD;IVwTEY5q>0XY`WwW(bCI(;I)x@*jhIfZ4OSY`m zPT}xk?FZ6T^4m`;v@N{QdS=V){uS5RmfOp>hW%Y}a2ubBYq4g~_1s%&Z7iZo{{Q-W z!sXVy0CsPeh1(>vw|qA}VRBTNW3lu}gMGV8#V^e)H#D-^F7k=nePK4o3WocQRpR&C z46^3(F5VseozZ*3zZUz+A79xke}57CHTTAirB~Wm?|gE|VqfE!b~OI&oal+mSvx*0 z`WLJ!vw>e}>27&5O_h|AjfVMu1p>~^z7jgcJX2qH@f(J3E-pNiXNEjm)!t~g#O}X{ z>eseCeo4KbR^48%GM{gc_>T>{-ufQn&5!+1x5TBK@lwTRHT|M6w|5WUKNg-SbS-(p zz9#`y6P?{%J@*EA)*4=zTOK66lYRS>^(^;z=X9BP9C7<}ChAqnq2u9=^R1sxyS+(b zXS;HRP|0nsi4IlLLDjh|=lM<@Nbb1t#C(F=tge@bq<6YIe@aWxDv<afx#Z*_ru>%+ z#aA-hi|>&2ES%bN#qHh42{xR2WP3t(?Uj4EYSW}^zjohCb+LFDrs7eiy}|6uDI?`_ zE0=u6Zwz+5J$77?I~07k@AlXIoO@vU)uivUr<xU+H@#rp+x@<KMcJFh)9!fKnQ_mx zQB6=>^zxs$%~d_)qV~j-lNs*p*E|`|{bohp?uj)i5#1W6{>WWqiSN=nDY3ElPNYIr zkI51rhn64xPHCq3tt`*h^!<&$`!4Q5pv&JUYNZEvPY}A;r8{w=^=UC%#b56{81nf4 zR&xKXJ~~IoT}b4$yUD$GuDdq9b6IuLY{KDL`O4)HDf!pZ^%g1Z(iiH<PG1}s$#L07 zxbRrr)+4JYaC|rQ*jp|?X`j*SoF{zK-UtiKd=Tlud^%?D_VN!wtwBa^zp_lPzM6ks z!EwXxD^B{%)2yHGdb?VB=Vy;kua<L86uK8X|Luf7zf4@F+j2k7x4tU1{z|%LLBCzU z;>CC3i|;?nlitZI%_$$g^M$WRoNZ;A!s02<Rvf)AH&Hon-LLXTjO=b-69srTY`J=E zyU~HQ?;Mv+&<kc#w|cpHLPEr+DU<4t$K)z+Ppp|{C%I2NJn}cENBC`*($}}Y8f2s{ z{*^6s<n?-`B7LC?UjN>>yxMa8<@u*to77pholOGG&}AO}v>t5=4>Tdy44d6k-hME_ zph%jB4TFJwk}u(jnMBVWw&sH;at*LBFy;$kmT`#u=l@-hd-!MevM|t`si&)-%Q~lo FCIFggBLV;b literal 0 HcmV?d00001 diff --git a/images/icons/round-add_a_photo-24px.svg b/images/icons/round-add_a_photo-24px.svg new file mode 100644 index 0000000..522c335 --- /dev/null +++ b/images/icons/round-add_a_photo-24px.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 8c0 .55.45 1 1 1s1-.45 1-1V6h2c.55 0 1-.45 1-1s-.45-1-1-1H5V2c0-.55-.45-1-1-1s-1 .45-1 1v2H1c-.55 0-1 .45-1 1s.45 1 1 1h2v2z"/><circle cx="13" cy="14" r="3"/><path d="M21 6h-3.17l-1.24-1.35c-.37-.41-.91-.65-1.47-.65h-6.4c.17.3.28.63.28 1 0 1.1-.9 2-2 2H6v1c0 1.1-.9 2-2 2-.37 0-.7-.11-1-.28V20c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-8 13c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"/></svg> \ No newline at end of file diff --git a/images/icons/showHide.PNG b/images/icons/showHide.PNG deleted file mode 100644 index f418b8a9d1895908a09866862138eb4863c3355b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 815 zcmeAS@N?(olHy`uVBq!ia0y~yU{GXWU=ZbCV_;x7!QXy`fq{XsILO_JVcj{ImkbOH zEa{HEjtmSN`?>!lvNA9*a29w(7Besim4Gngy)^j>1_q`ho-U3d9^P+5_j_j*iq!vi z_ZFC#8p6kR>4K1ni~XIfjssx_O;v79Sr#ST<nTO;qiEs+72h>17XvORshsxuo%-xs zWzD(6r}tJ}_13RAEp1m}8^8Z~&AI0_?>>gF4LiL5Sp39_`g(V(xo%sduG*S&IjclG z`T29F=D%ORx*~Mi&Y$=9{qy=Y_tT<CyQ?3=3|t=l`zN<Bz{4v1xaXrkfA)BGIxTD{ zu;`gSUEFt%D9^+nKYmPDVs36e>)nb2moEng9}ju{>eZ|CsR^6f+u38{<4+qGmY26L zUaZW*#26D7m$l1pY0!!gtywZ}FSs;ax|A~|?k?wi&3dJY2Od3As;aIwG%{l9KH9W! zp<-oReEjjZZ`W!p-{)Q6vS)qY)r&4ovPT{lzFg<mvT1Yi^2?l?Z}Ln(-Fo+KY)ni{ z$D8BFkKed=@7R?qBFBy$+pu-((mSdi3PPP62ai>?ytAm7s50r~k_lF}wyh^q4jnnt zlH_u1^UXCL=L08dSl_*K=g5Hr4Fby+dOmye#z%5#+}>&P5(L%w*qW8TpE}hglB_gu zWAUm>cklAfKC9MR(a&OOH1F*B^QSZJ-Mbehq;N~hSgJRvq(me;JNr_qt)Q(l|Bo8G zz?{rX&eNw)pW64}{imNcYU=7wd#s)3ZWqk;?CI}MPD^7uniME}|K`nuckayDG{K{# zYsGht$1>^R;nU~TM{`yk%-VYB@y84m(?u+Q53q@ei3Mm)HK~-oIE`iF{{8x&zgF$7 zsHvI4G}mV0$&{8qZ{DnNn;Z7Rqv>v;=GQM@5~`}AejdJ5ZJpsXNm@px<?zD^;hXPD zyn5l$lyERcPrdW^@81v0b{7^DC|EZYO5J$>{czs)?uq7RW>)(Ivm}%p4HSDlZm#r* zkDtFux4pgn>F-ysR=r`KbnWy-t~SpV2MY^C+S}W2+`fJI<jKw-uJ5<Ieb5!M@BOdx dZ$aDrU#?gGvVK0G#=yY9;OXk;vd$@?2>>>QidO&t diff --git a/images/icons/showHideTwo.PNG b/images/icons/showHideTwo.PNG deleted file mode 100644 index 9b8cfda8a8bc514376f77567791576fc71d2dcbb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 449 zcmeAS@N?(olHy`uVBq!ia0y~yV322EU=ZP8V_;w?&3yKYfq{XsILO_JVcj{ImkbOH zEa{HEjtmSN`?>!lvNA9*a29w(7Besim4Gngy)^j>1_s73PZ!4!5AU~=6xTNuh#bAY z{bI|x-X&*UjCSo5^gP#d*QGos#J<UFwKMa<l?M&ESj`H96STH`E_<JLq5TAReoOj~ z*8l&?zt1Ut|JUoXNa{yH{nq{;%!v|*OnhV3Uze|U^_avGD3ZAS_QSH>sn-N%K59!` za5d{-X>8t<(9c|}?B}0<@wI9~s-?NZvL7!?oc7;$-+lL3+UAFBu0D5!``wg7R)^|{ zb>CN4uesl@;+bJK`$pdO9Wi=4*<QS_uyG0vy^>|BGyU}Tw)n2ej}Jd=IGE5-wU;mU z`cJWW(wAoUL{2-J<{J3qi0iwjOD!DPGI}0=oRPoa^2-FHnI8<_eXm|~J^M_WF;Ba* zi4?C!7t`%+H+{nPrxzW4f25G-{O1LkQtyKVSmv<>t_->Gwrpe6+8<$`%KrE$7Cy4O zr@&$Hv&8CXja~a=i=20N>o#lX{1dM^;{9-c*YY21+<iJyM=sw}U|?Wi@O1TaS?83{ F1ORj{$7uin diff --git a/invitebuttonswidget.cpp b/invitebuttonswidget.cpp index c1dba8c..9e6397e 100644 --- a/invitebuttonswidget.cpp +++ b/invitebuttonswidget.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2019-2019 by Savoir-faire Linux * + * Copyright (C) 2019 by Savoir-faire Linux * * Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * * * * This program is free software; you can redistribute it and/or modify * diff --git a/invitebuttonswidget.h b/invitebuttonswidget.h index 0c56efd..a701fc6 100644 --- a/invitebuttonswidget.h +++ b/invitebuttonswidget.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2019-2019 by Savoir-faire Linux * + * Copyright (C) 2019 by Savoir-faire Linux * * Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * * * * This program is free software; you can redistribute it and/or modify * diff --git a/linkdevicedialog.cpp b/linkdevicedialog.cpp new file mode 100644 index 0000000..80b5eba --- /dev/null +++ b/linkdevicedialog.cpp @@ -0,0 +1,116 @@ +/*************************************************************************** + * Copyright (C) 2019 by Savoir-faire Linux * + * Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * + * * + * 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 <https://www.gnu.org/licenses/>. * + **************************************************************************/ + +#include "linkdevicedialog.h" +#include "ui_linkdevicedialog.h" + +#include <QMovie> +#include <QTimer> + +LinkDeviceDialog::LinkDeviceDialog(QWidget* parent) + : QDialog(parent), + ui(new Ui::LinkDeviceDialog) +{ + ui->setupUi(this); + + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + setFixedSize(size()); + + setWindowTitle(tr("Link Another Device")); + + timeout_ = new QTimer(this); + + if (LRCInstance::getCurrAccConfig().archiveHasPassword) { + ui->stackedWidget->setCurrentWidget(ui->passwordConfirmPage); + } else { + setGeneratingPage(); + } + + connect(ui->btnPasswordOk, SIGNAL(clicked()), this, SLOT(setGeneratingPage())); + connect(ui->btnPasswordCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(ui->btnCloseExportDialog, SIGNAL(clicked()), this, SLOT(reject())); + connect(&LRCInstance::accountModel(), &lrc::api::NewAccountModel::exportOnRingEnded, + this, &LinkDeviceDialog::setExportPage); +} + +LinkDeviceDialog::~LinkDeviceDialog() +{ + delete ui; +} + +void +LinkDeviceDialog::setGeneratingPage() +{ + if (ui->passwordEdit->text().isEmpty() && LRCInstance::getCurrAccConfig().archiveHasPassword) { + setExportPage(std::string(), + lrc::api::account::ExportOnRingStatus::WRONG_PASSWORD, + std::string()); + return; + } + + ui->stackedWidget->setCurrentWidget(ui->exportingPage); + + QMovie* movie = new QMovie(":/images/jami_eclipse_spinner.gif"); + movie->setScaledSize(QSize(96, 96)); + ui->exportingSpinner->setMovie(movie); + ui->exportingSpinner->show(); + movie->start(); + + timeout_->setInterval(exportTimeout_); + timeout_->setSingleShot(true); + connect(timeout_, &QTimer::timeout, this, + [this]() { + setExportPage(std::string(), + lrc::api::account::ExportOnRingStatus::NETWORK_ERROR, + std::string()); + }); + timeout_->start(); + + LRCInstance::accountModel().exportOnRing(LRCInstance::getCurrAccId(), ui->passwordEdit->text().toStdString()); +} + +void +LinkDeviceDialog::setExportPage(const std::string& accountId, lrc::api::account::ExportOnRingStatus status, const std::string& pin) +{ + Q_UNUSED(accountId); + timeout_->stop(); + + switch (status) { + case lrc::api::account::ExportOnRingStatus::WRONG_PASSWORD: + ui->infoLabel->setStyleSheet("color: red;"); + ui->infoLabel->setText(tr("Incorrect password")); + ui->yourPinLabel->hide(); + ui->exportedPIN->hide(); + break; + + case lrc::api::account::ExportOnRingStatus::SUCCESS: + ui->infoLabel->setStyleSheet("color: #2b5084;border: 1px solid lightgray;background-color: whitesmoke;padding: 8px;border-radius: 15px;"); + ui->exportedPIN->setText(QString::fromStdString(pin)); + break; + + case lrc::api::account::ExportOnRingStatus::NETWORK_ERROR: + case lrc::api::account::ExportOnRingStatus::INVALID: + disconnect(); + ui->infoLabel->setStyleSheet("color: red;"); + ui->infoLabel->setText(tr("Something went wrong.\nPlease try again later.")); + ui->yourPinLabel->hide(); + ui->exportedPIN->hide(); + } + + ui->stackedWidget->setCurrentWidget(ui->exportedPage); +} \ No newline at end of file diff --git a/linkdevwidget.h b/linkdevicedialog.h similarity index 69% rename from linkdevwidget.h rename to linkdevicedialog.h index eb704f7..2ec52f4 100644 --- a/linkdevwidget.h +++ b/linkdevicedialog.h @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2019-2019 by Savoir-faire Linux * - * Author: Isa Nanic <isa.nanic@savoirfairelinux.com> * + * Copyright (C) 2019 by Savoir-faire Linux * + * Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * * * * 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 * @@ -13,36 +13,29 @@ * 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 <https://www.gnu.org/licenses/>. * + * along with this program. If not, see <https://www.gnu.org/licenses/>. * **************************************************************************/ #pragma once #include <QPushButton> +#include <QDialog> #include "lrcinstance.h" -#include "ui_linkdevwidget.h" - namespace Ui { - class LinkDevWidget; + class LinkDeviceDialog; } -class LinkDevWidget : public QWidget +class LinkDeviceDialog : public QDialog { Q_OBJECT - LinkDevWidget(const LinkDevWidget& cpy); - public: - explicit LinkDevWidget(QWidget* parent = nullptr); - ~LinkDevWidget(); - inline const QPushButton* cancelBtn() const { return ui->cancelBtn; }; - inline const QPushButton* enterBtn() const { return ui->enterBtn; }; - inline const QPushButton* endCancelBtn() const { return ui->closePushButton; }; - + explicit LinkDeviceDialog(QWidget* parent = nullptr); + ~LinkDeviceDialog(); private: - Ui::LinkDevWidget* ui; - const int exportTimeout_ = 10000; + Ui::LinkDeviceDialog* ui; + const int exportTimeout_ = 20000; QTimer* timeout_; diff --git a/linkdevwidget.ui b/linkdevicedialog.ui similarity index 50% rename from linkdevwidget.ui rename to linkdevicedialog.ui index b04d16d..f2b7ab3 100644 --- a/linkdevwidget.ui +++ b/linkdevicedialog.ui @@ -1,57 +1,75 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>LinkDevWidget</class> - <widget class="QWidget" name="LinkDevWidget"> + <class>LinkDeviceDialog</class> + <widget class="QDialog" name="LinkDeviceDialog"> <property name="geometry"> <rect> <x>0</x> <y>0</y> - <width>744</width> - <height>848</height> + <width>365</width> + <height>208</height> </rect> </property> <property name="windowTitle"> - <string>Form</string> + <string>Dialog</string> </property> - <widget class="QWidget" name="verticalLayoutWidget"> - <property name="geometry"> - <rect> - <x>9</x> - <y>9</y> - <width>701</width> - <height>791</height> - </rect> + <property name="modal"> + <bool>false</bool> + </property> + <layout class="QVBoxLayout" name="verticalLayout_7"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> </property> - <layout class="QVBoxLayout" name="verticalLayout" stretch="0"> - <item> - <widget class="QStackedWidget" name="stackedWidget"> - <property name="minimumSize"> - <size> - <width>600</width> - <height>0</height> - </size> - </property> - <property name="currentIndex"> - <number>0</number> - </property> - <widget class="QWidget" name="start"> - <widget class="QWidget" name="verticalLayoutWidget_2"> - <property name="geometry"> - <rect> - <x>9</x> - <y>19</y> - <width>681</width> - <height>761</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout_2" stretch="1,0,0,0,0,0,1"> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QStackedWidget" name="stackedWidget"> + <property name="currentIndex"> + <number>0</number> + </property> + <widget class="QWidget" name="passwordConfirmPage"> + <layout class="QVBoxLayout" name="verticalLayout_5"> + <item> + <layout class="QVBoxLayout" name="verticalLayout_2"> <item> - <spacer name="verticalSpacer"> + <spacer name="verticalSpacer_4"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Enter your account password</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_10"> + <property name="orientation"> + <enum>Qt::Vertical</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -62,9 +80,12 @@ </spacer> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0,1"> + <layout class="QHBoxLayout" name="horizontalLayout_5" stretch="1,6,1"> + <property name="topMargin"> + <number>0</number> + </property> <item> - <spacer name="horizontalSpacer"> + <spacer name="horizontalSpacer_8"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -77,31 +98,34 @@ </spacer> </item> <item> - <widget class="QLabel" name="label"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <widget class="QLineEdit" name="passwordEdit"> + <property name="minimumSize"> + <size> + <width>294</width> + <height>30</height> + </size> </property> <property name="font"> <font> <pointsize>10</pointsize> </font> </property> - <property name="text"> - <string>Add A New Device</string> + <property name="echoMode"> + <enum>QLineEdit::Password</enum> + </property> + <property name="placeholderText"> + <string>Password</string> + </property> + <property name="clearButtonEnabled"> + <bool>true</bool> </property> </widget> </item> <item> - <spacer name="horizontalSpacer_2"> + <spacer name="horizontalSpacer_9"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeType"> - <enum>QSizePolicy::Minimum</enum> - </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> @@ -113,13 +137,10 @@ </layout> </item> <item> - <spacer name="verticalSpacer_3"> + <spacer name="verticalSpacer_9"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> @@ -129,52 +150,12 @@ </spacer> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_5"> - <item> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>To add a new device, enter your account password:</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> + <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,0"> + <property name="topMargin"> + <number>0</number> + </property> <item> - <spacer name="horizontalSpacer_7"> + <spacer name="horizontalSpacer_12"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -187,72 +168,25 @@ </spacer> </item> <item> - <widget class="QLineEdit" name="passwordLineEdit"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> + <widget class="QPushButton" name="btnPasswordOk"> <property name="minimumSize"> <size> - <width>250</width> - <height>0</height> + <width>130</width> + <height>30</height> </size> </property> - <property name="echoMode"> - <enum>QLineEdit::Password</enum> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_8"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <spacer name="horizontalSpacer_9"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="cancelBtn"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> </property> <property name="text"> - <string>Cancel</string> + <string>Ok</string> </property> </widget> </item> <item> - <spacer name="horizontalSpacer_11"> + <spacer name="horizontalSpacer_14"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -261,27 +195,32 @@ </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> - <height>20</height> + <width>20</width> + <height>0</height> </size> </property> </spacer> </item> <item> - <widget class="QPushButton" name="enterBtn"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <widget class="QPushButton" name="btnPasswordCancel"> + <property name="minimumSize"> + <size> + <width>130</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> </property> <property name="text"> - <string>Enter</string> + <string>Cancel</string> </property> </widget> </item> <item> - <spacer name="horizontalSpacer_10"> + <spacer name="horizontalSpacer_13"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -296,7 +235,7 @@ </layout> </item> <item> - <spacer name="verticalSpacer_2"> + <spacer name="verticalSpacer_5"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> @@ -309,21 +248,15 @@ </spacer> </item> </layout> - </widget> - </widget> - <widget class="QWidget" name="middle"> - <widget class="QWidget" name="verticalLayoutWidget_3"> - <property name="geometry"> - <rect> - <x>14</x> - <y>9</y> - <width>671</width> - <height>771</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout_3" stretch="1,0,1"> + </item> + </layout> + </widget> + <widget class="QWidget" name="exportingPage"> + <layout class="QVBoxLayout" name="verticalLayout_4"> + <item> + <layout class="QVBoxLayout" name="verticalLayout_3"> <item> - <spacer name="verticalSpacer_4"> + <spacer name="verticalSpacer_2"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> @@ -336,141 +269,22 @@ </spacer> </item> <item> - <widget class="QWidget" name="widget" native="true"> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_6" stretch="1,0,1"> - <item> - <spacer name="horizontalSpacer_12"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label_3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Exporting account on the network</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_13"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_4" stretch="1,0,1"> - <item> - <spacer name="horizontalSpacer_5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="spinningLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>50</width> - <height>50</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>50</width> - <height>50</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_6"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer_5"> - <property name="orientation"> - <enum>Qt::Vertical</enum> + <widget class="QLabel" name="label_2"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> + <property name="text"> + <string>Exporting account</string> </property> - </spacer> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> </item> - </layout> - </widget> - </widget> - <widget class="QWidget" name="end"> - <widget class="QWidget" name="verticalLayoutWidget_4"> - <property name="geometry"> - <rect> - <x>10</x> - <y>10</y> - <width>681</width> - <height>771</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout_4" stretch="1,0,0,0,0,1"> <item> - <spacer name="verticalSpacer_6"> + <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> @@ -483,9 +297,12 @@ </spacer> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_7"> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <property name="topMargin"> + <number>0</number> + </property> <item> - <spacer name="horizontalSpacer_14"> + <spacer name="horizontalSpacer_10"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -498,20 +315,20 @@ </spacer> </item> <item> - <widget class="QLabel" name="label_4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <widget class="QLabel" name="exportingSpinner"> + <property name="minimumSize"> + <size> + <width>96</width> + <height>96</height> + </size> </property> <property name="text"> - <string>Your generated pin:</string> + <string/> </property> </widget> </item> <item> - <spacer name="horizontalSpacer_15"> + <spacer name="horizontalSpacer_11"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -526,9 +343,43 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_8"> + <spacer name="verticalSpacer_3"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + <widget class="QWidget" name="exportedPage"> + <layout class="QVBoxLayout" name="verticalLayout_6"> + <item> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <spacer name="verticalSpacer_6"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> - <spacer name="horizontalSpacer_16"> + <spacer name="horizontalSpacer_5"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -541,34 +392,49 @@ </spacer> </item> <item> - <widget class="QLabel" name="label_5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> + <widget class="QLabel" name="yourPinLabel"> <property name="font"> <font> <pointsize>10</pointsize> </font> </property> - <property name="cursor"> - <cursorShape>IBeamCursor</cursorShape> + <property name="text"> + <string>Your PIN is</string> </property> - <property name="focusPolicy"> - <enum>Qt::StrongFocus</enum> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> - <property name="text"> - <string/> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="exportedPIN"> + <property name="font"> + <font> + <pointsize>12</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> </property> - <property name="textInteractionFlags"> - <set>Qt::TextSelectableByMouse</set> + <property name="text"> + <string>PIN</string> </property> </widget> </item> <item> - <spacer name="horizontalSpacer_17"> + <spacer name="horizontalSpacer_4"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -583,9 +449,12 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_9"> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <property name="topMargin"> + <number>0</number> + </property> <item> - <spacer name="horizontalSpacer_18"> + <spacer name="horizontalSpacer_6"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -598,20 +467,25 @@ </spacer> </item> <item> - <widget class="QLabel" name="label_6"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <widget class="QLabel" name="infoLabel"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> </property> <property name="text"> - <string>This pin and the account password should be entered in your device within 5 minutes.</string> + <string>This pin and the account password should be entered in your device within 10 minutes.</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap"> + <bool>true</bool> </property> </widget> </item> <item> - <spacer name="horizontalSpacer_19"> + <spacer name="horizontalSpacer_7"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -626,9 +500,25 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_10"> + <spacer name="verticalSpacer_8"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="topMargin"> + <number>0</number> + </property> <item> - <spacer name="horizontalSpacer_20"> + <spacer name="horizontalSpacer"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -641,20 +531,31 @@ </spacer> </item> <item> - <widget class="QPushButton" name="closePushButton"> + <widget class="QPushButton" name="btnCloseExportDialog"> <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize"> + <size> + <width>130</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> <property name="text"> <string>Close</string> </property> </widget> </item> <item> - <spacer name="horizontalSpacer_21"> + <spacer name="horizontalSpacer_2"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -682,12 +583,12 @@ </spacer> </item> </layout> - </widget> - </widget> + </item> + </layout> </widget> - </item> - </layout> - </widget> + </widget> + </item> + </layout> </widget> <resources/> <connections/> diff --git a/linkdevwidget.cpp b/linkdevwidget.cpp deleted file mode 100644 index 69621dd..0000000 --- a/linkdevwidget.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2019-2019 by Savoir-faire Linux * - * Author: Isa Nanic <isa.nanic@savoirfairelinux.com> * - * * - * 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 <https://www.gnu.org/licenses/>. * - **************************************************************************/ - -#include "linkdevwidget.h" - -#include <QMovie> -#include <QTimer> - -LinkDevWidget::LinkDevWidget(QWidget* parent) - : QWidget(parent), - ui(new Ui::LinkDevWidget) -{ - ui->setupUi(this); - - if (LRCInstance::getCurrAccConfig().archiveHasPassword) { - ui->stackedWidget->setCurrentWidget(ui->start); - } else { - setGeneratingPage(); - } - - connect(ui->enterBtn, &QPushButton::clicked, - this, &LinkDevWidget::setGeneratingPage); - connect(&LRCInstance::accountModel(), &lrc::api::NewAccountModel::exportOnRingEnded, - this, &LinkDevWidget::setExportPage); -} - -LinkDevWidget::~LinkDevWidget() -{ - delete ui; -} - -void -LinkDevWidget::setGeneratingPage() -{ - ui->stackedWidget->setCurrentWidget(ui->middle); - - QMovie* movie = new QMovie(":/images/ajax-loader.gif"); - ui->spinningLabel->setMovie(movie); - ui->spinningLabel->show(); - movie->start(); - - timeout_ = new QTimer(this); - timeout_->setInterval(exportTimeout_); - timeout_->setSingleShot(true); - connect(timeout_, &QTimer::timeout, this, - [&]() { - setExportPage(std::string(), - lrc::api::account::ExportOnRingStatus::NETWORK_ERROR, - std::string()); - }); - timeout_->start(); - - LRCInstance::accountModel().exportOnRing(LRCInstance::getCurrAccId(), ui->passwordLineEdit->text().toStdString()); -} - -void -LinkDevWidget::setExportPage(const std::string& accountId, lrc::api::account::ExportOnRingStatus status, const std::string& pin) -{ - Q_UNUSED(accountId); - timeout_->stop(); - - ui->stackedWidget->setCurrentWidget(ui->end); - - switch (status) { - case lrc::api::account::ExportOnRingStatus::WRONG_PASSWORD: - ui->label_4->setText(tr("Your account password was incorrect")); - ui->label_5->hide(); - ui->label_6->hide(); - break; - - case lrc::api::account::ExportOnRingStatus::SUCCESS: - ui->label_5->setText(QString::fromStdString(pin)); - break; - - default: - disconnect(); - ui->label_4->setText(tr("Something went wrong.\nPlease try again later.")); - ui->label_5->hide(); - ui->label_6->hide(); - } -} \ No newline at end of file diff --git a/lrcinstance.h b/lrcinstance.h index bcc8a5f..8881b28 100644 --- a/lrcinstance.h +++ b/lrcinstance.h @@ -119,7 +119,7 @@ public: static void setSelectedAccountId(const std::string& accountId) { instance().selectedAccountId_ = accountId; - QSettings settings; + QSettings settings("jami.net", "Jami"); settings.setValue(SettingsKey::selectedAccount, QString::fromStdString(accountId)); }; @@ -158,7 +158,8 @@ public: QBuffer bu(&ba); bu.open(QIODevice::WriteOnly); avatarPixmap.save(&bu, "PNG"); - instance().editableAccountModel()->setAvatar(getCurrAccId(), ba.toBase64().toStdString()); + auto str = ba.toBase64().toStdString(); + instance().editableAccountModel()->setAvatar(getCurrAccId(), str); }; static void setCurrAccAvatar(const std::string& avatar) { diff --git a/main.cpp b/main.cpp index 8ba6b81..3d78ddf 100644 --- a/main.cpp +++ b/main.cpp @@ -230,12 +230,14 @@ main(int argc, char *argv[]) font.setFamily("Segoe UI"); a.setFont(font); +#ifndef DEBUG_STYLESHEET QFile file(":/stylesheet.css"); if(file.open(QIODevice::ReadOnly | QIODevice::Text)) { a.setStyleSheet(file.readAll()); file.close(); } +#endif QFontDatabase::addApplicationFont(":/images/FontAwesome.otf"); @@ -247,7 +249,7 @@ main(int argc, char *argv[]) } if (not startMinimized) - MainWindow::instance().show(); + MainWindow::instance().showWindow(); else { MainWindow::instance().showMinimized(); MainWindow::instance().hide(); diff --git a/mainwindow.cpp b/mainwindow.cpp index 413b858..11527e5 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -21,28 +21,32 @@ #include "ui_mainwindow.h" #include <QDesktopWidget> -#include <QWindow> #include <QScreen> +#include <QWindow> +#include <QTimer> +#include <QDir> +#include <QStandardPaths> #include "media/text.h" #include "media/textrecording.h" #ifdef Q_OS_WIN -#include <windows.h> +#include "winsparkle.h" #include <QWinThumbnailToolBar> #include <QWinThumbnailToolButton> -#include "winsparkle.h" +#include <windows.h> #endif #include "aboutdialog.h" -#include "settingskey.h" #include "callmodel.h" #include "callwidget.h" +#include "settingskey.h" #include "utils.h" #include "version.h" -MainWindow::MainWindow(QWidget* parent) : - QMainWindow(parent), +MainWindow::MainWindow(QWidget* parent) + : QMainWindow(parent) + , ui(new Ui::MainWindow) { @@ -52,14 +56,19 @@ MainWindow::MainWindow(QWidget* parent) : if (auto navWidget = dynamic_cast<NavWidget*>(ui->navStack->widget(i))) { connect(navWidget, &NavWidget::NavigationRequested, [this](ScreenEnum scr) { + for (int i = 0; i < ui->navStack->count(); ++i) { + if (auto navWidget = dynamic_cast<NavWidget*>(ui->navStack->widget(i))) { + navWidget->navigated(scr == i); + } + } Utils::setStackWidget(ui->navStack, ui->navStack->widget(scr)); }); } } connect(ui->navStack, SIGNAL(currentChanged(int)), - this, SLOT(slotCurrentChanged(int)), - Qt::QueuedConnection); + this, SLOT(slotCurrentChanged(int)), + Qt::QueuedConnection); QIcon icon(":images/jami.png"); @@ -74,8 +83,11 @@ MainWindow::MainWindow(QWidget* parent) : auto configAction = new QAction(tr("Settings"), this); connect(configAction, &QAction::triggered, [this]() { - Utils::setStackWidget(ui->navStack, ui->settingswidget); - setWindowState(Qt::WindowActive); + if (auto currentWidget = dynamic_cast<NavWidget*>(ui->navStack->currentWidget())) { + emit currentWidget->NavigationRequested(ScreenEnum::SetttingsScreen); + setWindowState(Qt::WindowActive); + showWindow(); + } }); menu->addAction(configAction); @@ -90,10 +102,10 @@ MainWindow::MainWindow(QWidget* parent) : sysIcon.show(); connect(&sysIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), - this, SLOT(trayActivated(QSystemTrayIcon::ActivationReason))); + this, SLOT(trayActivated(QSystemTrayIcon::ActivationReason))); #ifdef Q_OS_WIN - HMENU sysMenu = ::GetSystemMenu((HWND) winId(), FALSE); + HMENU sysMenu = ::GetSystemMenu((HWND)winId(), FALSE); if (sysMenu != NULL) { ::AppendMenuA(sysMenu, MF_SEPARATOR, 0, 0); QString aboutTitle = tr("About"); @@ -146,6 +158,24 @@ MainWindow::MainWindow(QWidget* parent) : } lastScr_ = startScreen; + +#ifdef DEBUG_STYLESHEET + QTimer *timer = new QTimer(this); + connect(timer, &QTimer::timeout, + [this]() { + QString fileName = "stylesheet.css"; + QDir filePath = QDir(QCoreApplication::applicationDirPath()); + filePath.cdUp(); + filePath.cdUp(); + QFile file(filePath.filePath(fileName)); + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { + auto fileContent = file.readAll(); + setStyleSheet(fileContent); + file.close(); + } + }); + timer->start(1000); +#endif } MainWindow::~MainWindow() @@ -153,36 +183,21 @@ MainWindow::~MainWindow() delete ui; } -void -MainWindow::slotCurrentChanged(int index) +void MainWindow::slotCurrentChanged(int index) { auto accountList = LRCInstance::accountModel().getAccountList(); - auto firstUse = - (accountList.size() == 1 && lastScr_ == ScreenEnum::WizardScreen && - lastAccountCount_ < accountList.size()) || - !accountList.size(); - if (lastScr_ == ScreenEnum::WizardScreen && - lastAccountCount_ < accountList.size()) { + auto firstUse = (accountList.size() == 1 && lastScr_ == ScreenEnum::WizardScreen && lastAccountCount_ < accountList.size()) || !accountList.size(); + if (lastScr_ == ScreenEnum::WizardScreen && lastAccountCount_ < accountList.size()) { lastAccountCount_ = accountList.size(); } - for (int i = 0; i < ui->navStack->count(); ++i) { - if (auto navWidget = dynamic_cast<NavWidget*>(ui->navStack->widget(i))) { - navWidget->navigated(index == i); - } - } auto scr = Utils::toEnum<ScreenEnum>(index); - if (scr == ScreenEnum::SetttingsScreen) { - ui->settingswidget->updateSettings(ui->callwidget->getLeftPanelWidth()); - } - setWindowSize(scr, firstUse); lastScr_ = scr; } -void -MainWindow::onRingEvent(const QString& uri) +void MainWindow::onRingEvent(const QString& uri) { this->showNormal(); if (not uri.isEmpty()) { @@ -192,13 +207,12 @@ MainWindow::onRingEvent(const QString& uri) } } -bool -MainWindow::nativeEvent(const QByteArray& eventType, void* message, long* result) +bool MainWindow::nativeEvent(const QByteArray& eventType, void* message, long* result) { Q_UNUSED(eventType) #ifdef Q_OS_WIN - MSG* msg = (MSG*) message; + MSG* msg = (MSG*)message; if (msg->message == WM_SYSCOMMAND) { if ((msg->wParam & 0xfff0) == IDM_ABOUTBOX) { @@ -217,15 +231,14 @@ MainWindow::nativeEvent(const QByteArray& eventType, void* message, long* result return false; } -void -MainWindow::trayActivated(QSystemTrayIcon::ActivationReason reason) +void MainWindow::trayActivated(QSystemTrayIcon::ActivationReason reason) { if (reason != QSystemTrayIcon::ActivationReason::Context) this->show(); } -void -MainWindow::showWindow() { +void MainWindow::showWindow() +{ if (currentWindowState_ == Qt::WindowMaximized) { showMaximized(); } else { @@ -235,13 +248,16 @@ MainWindow::showWindow() { raise(); } -void -MainWindow::notificationClicked() { - showWindow(); +void MainWindow::notificationClicked() +{ + if (auto currentWidget = dynamic_cast<NavWidget*>(ui->navStack->currentWidget())) { + emit currentWidget->NavigationRequested(ScreenEnum::CallScreen); + setWindowState(Qt::WindowActive); + showWindow(); + } } -void -MainWindow::createThumbBar() +void MainWindow::createThumbBar() { #ifdef Q_OS_WIN QWinThumbnailToolBar* thumbbar = new QWinThumbnailToolBar(this); @@ -259,8 +275,7 @@ MainWindow::createThumbBar() #endif } -void -MainWindow::changeEvent(QEvent* e) +void MainWindow::changeEvent(QEvent* e) { if (e->type() == QEvent::WindowStateChange) { QWindowStateChangeEvent* event = static_cast<QWindowStateChangeEvent*>(e); @@ -273,39 +288,44 @@ MainWindow::changeEvent(QEvent* e) QWidget::changeEvent(e); } -void -MainWindow::closeEvent(QCloseEvent* event) +void MainWindow::closeEvent(QCloseEvent* event) { Video::PreviewManager::instance().stopPreview(); - QSettings settings; + QSettings settings("jami.net", "Jami"); if (settings.value(SettingsKey::closeOrMinimized).toBool()) { this->hide(); event->ignore(); } else { settings.setValue(SettingsKey::geometry, saveGeometry()); settings.setValue(SettingsKey::windowState, saveState()); + this->disconnect(screenChangedConnection_); + QMainWindow::closeEvent(event); } - this->disconnect(screenChangedConnection_); - QMainWindow::closeEvent(event); } -void -MainWindow::readSettingsFromRegistry() +void MainWindow::readSettingsFromRegistry() { - QSettings settings; + QSettings settings("jami.net", "Jami"); + restoreGeometry(settings.value(SettingsKey::geometry).toByteArray()); restoreState(settings.value(SettingsKey::windowState).toByteArray()); LRCInstance::editableDataTransferModel()->downloadDirectory = settings.value(SettingsKey::downloadPath, - QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)).toString().toStdString() + "/"; + QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)) + .toString() + .toStdString() + + "/"; if (not settings.contains(SettingsKey::enableNotifications)) { settings.setValue(SettingsKey::enableNotifications, true); } + + if (not settings.contains(SettingsKey::closeOrMinimized)) { + settings.setValue(SettingsKey::closeOrMinimized, true); + } } -void -MainWindow::setWindowSize(ScreenEnum scr, bool firstUse) +void MainWindow::setWindowSize(ScreenEnum scr, bool firstUse) { auto screenNumber = qApp->desktop()->screenNumber(); auto accountList = LRCInstance::accountModel().getAccountList(); @@ -322,9 +342,7 @@ MainWindow::setWindowSize(ScreenEnum scr, bool firstUse) Qt::LeftToRight, Qt::AlignCenter, size(), - qApp->desktop()->screenGeometry(screenNumber) - ) - ); + qApp->desktop()->screenGeometry(screenNumber))); if (scr == ScreenEnum::WizardScreen) { setWindowFlags(Qt::Dialog); setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint)); @@ -338,21 +356,19 @@ MainWindow::setWindowSize(ScreenEnum scr, bool firstUse) } } -void -MainWindow::show() +void MainWindow::show() { QMainWindow::show(); disconnect(screenChangedConnection_); screenChangedConnection_ = connect(windowHandle(), &QWindow::screenChanged, - this, &MainWindow::slotScreenChanged); + this, &MainWindow::slotScreenChanged); auto screenNumber = qApp->desktop()->screenNumber(); QScreen* screen = qApp->screens().at(screenNumber); currentScalingRatio_ = screen->logicalDotsPerInchX() / 96; qobject_cast<NavWidget*>(ui->navStack->currentWidget())->updateCustomUI(); } -void -MainWindow::slotScreenChanged(QScreen* screen) +void MainWindow::slotScreenChanged(QScreen* screen) { adjustSize(); updateGeometry(); @@ -365,15 +381,13 @@ MainWindow::slotScreenChanged(QScreen* screen) }); } -void -MainWindow::resizeEvent(QResizeEvent* event) +void MainWindow::resizeEvent(QResizeEvent* event) { Q_UNUSED(event); qobject_cast<NavWidget*>(ui->navStack->currentWidget())->updateCustomUI(); } -float -MainWindow::getCurrentScalingRatio() +float MainWindow::getCurrentScalingRatio() { return currentScalingRatio_; } @@ -382,4 +396,4 @@ void MainWindow::keyReleaseEvent(QKeyEvent* ke) { emit keyReleased(ke); QMainWindow::keyReleaseEvent(ke); -} \ No newline at end of file +} diff --git a/mainwindow.h b/mainwindow.h index c648f92..fde1c27 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -31,9 +31,9 @@ static constexpr char IDM_ABOUTBOX = 0x0010; static constexpr uint32_t QtMaxDimension = 16777215; static constexpr uint32_t mainWindowMinWidth = 1088; -static constexpr uint32_t mainWindowMinHeight = 600; +static constexpr uint32_t mainWindowMinHeight = 638; static constexpr uint32_t wizardDialogWidth = 512; -static constexpr uint32_t wizardDialogHeight = 512; +static constexpr uint32_t wizardDialogHeight = 638; namespace Ui { class MainWindow; @@ -52,6 +52,7 @@ public: bool init(); void show(); float getCurrentScalingRatio(); + void showWindow(); protected: bool nativeEvent(const QByteArray& eventType, void* message, long* result); @@ -76,7 +77,6 @@ private: explicit MainWindow(QWidget* parent = 0); ~MainWindow(); - void showWindow(); void setWindowSize(ScreenEnum scr, bool firstUse = false); ScreenEnum lastScr_; int lastAccountCount_; diff --git a/nameregistrationdialog.cpp b/nameregistrationdialog.cpp new file mode 100644 index 0000000..2aea505 --- /dev/null +++ b/nameregistrationdialog.cpp @@ -0,0 +1,101 @@ +/************************************************************************** +* Copyright (C) 2019 by Savoir-faire Linux * +* Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * +* * +* 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 <http://www.gnu.org/licenses/>. * +**************************************************************************/ + +#include "nameregistrationdialog.h" +#include "ui_nameregistrationdialog.h" + +#include "utils.h" +#include "ringthemeutils.h" + +#include <QTimer> + +NameRegistrationDialog::NameRegistrationDialog(const QString& nameToRegister, QWidget* parent) + : QDialog(parent), + ui(new Ui::NameRegistrationDialog), + nameToRegister_(nameToRegister) +{ + ui->setupUi(this); + + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + setFixedSize(size()); + + connect(ui->btnRegister, &QPushButton::clicked, this, &NameRegistrationDialog::slotStartNameRegistration); + connect(ui->btnCancel, &QPushButton::clicked, [this]() { reject(); }); + connect(ui->btnCloseRegisterDialog, &QPushButton::clicked, [this]() { reject(); }); + + connect(LRCInstance::editableAccountModel(), &lrc::api::NewAccountModel::nameRegistrationEnded, + this, &NameRegistrationDialog::slotNameRegistrationResult); + + spinnerAnimation_ = new QMovie(":/images/jami_eclipse_spinner.gif"); + spinnerAnimation_->setScaledSize(QSize(96, 96)); + + if (LRCInstance::getCurrAccConfig().archiveHasPassword) { + ui->stackedWidget->setCurrentWidget(ui->passwordConfirmPage); + } else { + slotStartNameRegistration(); + } +} + +NameRegistrationDialog::~NameRegistrationDialog() +{ + delete ui; +} + +void +NameRegistrationDialog::slotStartNameRegistration() +{ + auto password = ui->passwordEdit->text().toStdString(); + LRCInstance::editableAccountModel()->registerName(LRCInstance::getCurrAccId(), + password, nameToRegister_.toStdString()); + startSpinner(); +} + +void +NameRegistrationDialog::slotNameRegistrationResult(const std::string& accountId, + lrc::api::account::RegisterNameStatus status, const std::string& registerdName) +{ + Q_UNUSED(accountId); + Q_UNUSED(registerdName); + + spinnerAnimation_->stop(); + + if(status == lrc::api::account::RegisterNameStatus::SUCCESS) { + accept(); + } else { + switch (status) { + case lrc::api::account::RegisterNameStatus::WRONG_PASSWORD: + ui->lblRegistrationError->setText(tr("Incorrect password")); + break; + case lrc::api::account::RegisterNameStatus::NETWORK_ERROR: + ui->lblRegistrationError->setText(tr("Network error")); + break; + default: + break; + } + ui->stackedWidget->setCurrentWidget(ui->nameNotRegisteredPage); + } +} + +void +NameRegistrationDialog::startSpinner() +{ + ui->stackedWidget->setCurrentWidget(ui->registeringPage); + + ui->spinnerLabel->setMovie(spinnerAnimation_); + spinnerAnimation_->start(); +} \ No newline at end of file diff --git a/regnamedialog.h b/nameregistrationdialog.h similarity index 67% rename from regnamedialog.h rename to nameregistrationdialog.h index ddd7ea5..4f01940 100644 --- a/regnamedialog.h +++ b/nameregistrationdialog.h @@ -1,6 +1,6 @@ /************************************************************************** -* Copyright (C) 2019-2019 by Savoir-faire Linux * -* Author: Isa Nanic <isa.nanic@savoirfairelinux.com> * +* Copyright (C) 2019 by Savoir-faire Linux * +* Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * * * * 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 * @@ -17,6 +17,7 @@ **************************************************************************/ #pragma once + #include <QDialog> #include <QMovie> @@ -24,27 +25,30 @@ #include "api/newaccountmodel.h" namespace Ui { - class RegNameDialog; + class NameRegistrationDialog; } -class RegNameDialog : public QDialog +using namespace lrc::api::account; + +class NameRegistrationDialog : public QDialog { - Q_OBJECT - RegNameDialog(const RegNameDialog& cpy); + Q_OBJECT; public: - RegNameDialog(const QString& newRegName = "", QWidget* parent = nullptr); - ~RegNameDialog(); + NameRegistrationDialog(const QString& nameToRegister, QWidget* parent = nullptr); + ~NameRegistrationDialog(); private slots: - void nameRegistrationResultSlot(const std::string& accountId, - lrc::api::account::RegisterNameStatus status, const std::string& registerdName); - void startNameRegistration(); + void slotNameRegistrationResult(const std::string& accountId, + RegisterNameStatus status, + const std::string& registerdName); + void slotStartNameRegistration(); private: - Ui::RegNameDialog* ui; - QString registeredName_; - QMovie* gif; + Ui::NameRegistrationDialog* ui; + + QString nameToRegister_; + QMovie* spinnerAnimation_; void startSpinner(); }; diff --git a/nameregistrationdialog.ui b/nameregistrationdialog.ui new file mode 100644 index 0000000..814edb2 --- /dev/null +++ b/nameregistrationdialog.ui @@ -0,0 +1,658 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>NameRegistrationDialog</class> + <widget class="QDialog" name="NameRegistrationDialog"> + <property name="windowModality"> + <enum>Qt::ApplicationModal</enum> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>365</width> + <height>208</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777214</width> + <height>16777214</height> + </size> + </property> + <property name="windowTitle"> + <string>Set Registered Name</string> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="modal"> + <bool>true</bool> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QStackedWidget" name="stackedWidget"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>700</width> + <height>700</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="currentIndex"> + <number>2</number> + </property> + <widget class="QWidget" name="passwordConfirmPage"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QWidget" name="widget" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <property name="spacing"> + <number>11</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QVBoxLayout" name="verticalLayout_4"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_5"> + <property name="spacing"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_9"> + <item> + <spacer name="horizontalSpacer_9"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label_7"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Enter your account password</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_10"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_12" stretch="1,3,1"> + <property name="spacing"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <spacer name="horizontalSpacer_11"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLineEdit" name="passwordEdit"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>294</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="toolTip"> + <string>Password text input</string> + </property> + <property name="accessibleName"> + <string/> + </property> + <property name="accessibleDescription"> + <string>Password text entry</string> + </property> + <property name="echoMode"> + <enum>QLineEdit::Password</enum> + </property> + <property name="placeholderText"> + <string>Password</string> + </property> + <property name="clearButtonEnabled"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_16"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_5"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="btnRegister"> + <property name="minimumSize"> + <size> + <width>130</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string>Register</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="btnCancel"> + <property name="minimumSize"> + <size> + <width>130</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string>Cancel</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_6"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <widget class="QWidget" name="registeringPage"> + <layout class="QVBoxLayout" name="verticalLayout_6"> + <item> + <layout class="QVBoxLayout" name="verticalLayout_7"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <spacer name="verticalSpacer_15"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Registering Name</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_7"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_15"> + <item> + <spacer name="horizontalSpacer_32"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="spinnerLabel"> + <property name="minimumSize"> + <size> + <width>96</width> + <height>96</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_33"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_16"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + <widget class="QWidget" name="nameNotRegisteredPage"> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <spacer name="verticalSpacer_3"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <item> + <spacer name="horizontalSpacer_14"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="lblRegistrationError"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Something went wrong</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_15"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_8"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="btnCloseRegisterDialog"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>130</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Close</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_4"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/newwizardwidget.cpp b/newwizardwidget.cpp index b6b9f96..f389295 100644 --- a/newwizardwidget.cpp +++ b/newwizardwidget.cpp @@ -3,8 +3,8 @@ * Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>* * Author: Anthony L�onard <anthony.leonard@savoirfairelinux.com> * * Author: Olivier Soldano <olivier.soldano@savoirfairelinux.com> * -* Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> -* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com> +* Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * +* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com> * * * * 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 * @@ -27,6 +27,7 @@ #include <QMessageBox> #include <QFileDialog> #include <QBitmap> +#include <QtConcurrent/QtConcurrent> #include "namedirectory.h" @@ -53,14 +54,11 @@ NewWizardWidget::NewWizardWidget(QWidget* parent) : lookupSpinnerMovie_ = new QMovie(":/images/jami_rolling_spinner.gif"); lookupSpinnerMovie_->setScaledSize(QSize(30, 30)); - lookupStatusLabel_ = new QLabel(this); - lookupStatusLabel_->setMovie(lookupSpinnerMovie_); - lookupStatusLabel_->hide(); + ui->lookupStatusLabel->setMovie(lookupSpinnerMovie_); + ui->lookupStatusLabel->hide(); registrationStateOk_ = false; - passwordStatusLabel_ = new QLabel(this); - statusSuccessPixmap_ = Utils::generateTintedPixmap(":/images/icons/baseline-done-24px.svg", RingTheme::presenceGreen_); statusInvalidPixmap_ = Utils::generateTintedPixmap(":/images/icons/baseline-error_outline-24px.svg", RingTheme::urgentOrange_); statusErrorPixmap_ = Utils::generateTintedPixmap(":/images/icons/baseline-close-24px.svg", RingTheme::red_); @@ -130,22 +128,22 @@ NewWizardWidget::updateNameRegistrationUi(NameRegistrationUIState state) { switch (state) { case NameRegistrationUIState::BLANK: - lookupStatusLabel_->hide(); + ui->lookupStatusLabel->hide(); break; case NameRegistrationUIState::INVALID: - lookupStatusLabel_->setPixmap(statusInvalidPixmap_); + ui->lookupStatusLabel->setPixmap(statusInvalidPixmap_); break; case NameRegistrationUIState::TAKEN: - lookupStatusLabel_->setPixmap(statusErrorPixmap_); + ui->lookupStatusLabel->setPixmap(statusErrorPixmap_); break; case NameRegistrationUIState::FREE: - lookupStatusLabel_->setPixmap(statusSuccessPixmap_); + ui->lookupStatusLabel->setPixmap(statusSuccessPixmap_); break; case NameRegistrationUIState::SEARCHING: - lookupStatusLabel_->setMovie(lookupSpinnerMovie_); + ui->lookupStatusLabel->setMovie(lookupSpinnerMovie_); lookupSpinnerMovie_->stop(); lookupSpinnerMovie_->start(); - lookupStatusLabel_->show(); + ui->lookupStatusLabel->show(); break; } } @@ -189,8 +187,8 @@ void NewWizardWidget::changePage(QWidget* toPage) if (toPage == ui->welcomePage) { fileToImport_ = QString(""); setNavBarVisibility(false, true); - lookupStatusLabel_->hide(); - passwordStatusLabel_->hide(); + ui->lookupStatusLabel->hide(); + ui->passwordStatusLabel->hide(); } else if (toPage == ui->createRingAccountPage) { ui->usernameEdit->clear(); ui->passwordEdit->clear(); @@ -223,22 +221,18 @@ void NewWizardWidget::changePage(QWidget* toPage) ui->pinEdit->setEnabled(true); ui->fileImportBtn->setEnabled(true); setNavBarVisibility(true); - lookupStatusLabel_->hide(); - passwordStatusLabel_->hide(); + ui->lookupStatusLabel->hide(); + ui->passwordStatusLabel->hide(); validateWizardProgression(); } else if (toPage == ui->spinnerPage) { - lookupStatusLabel_->hide(); - passwordStatusLabel_->hide(); + ui->lookupStatusLabel->hide(); + ui->passwordStatusLabel->hide(); } } void NewWizardWidget::updateCustomUI() { - QPoint editUsernamePos = ui->usernameEdit->mapTo(this, ui->usernameEdit->rect().topRight()); - lookupStatusLabel_->setGeometry(editUsernamePos.x() + 6, editUsernamePos.y() - 1, 30, 30); - QPoint editconfpassPos = ui->confirmPasswordEdit->mapTo(this, ui->confirmPasswordEdit->rect().topRight()); - passwordStatusLabel_->setGeometry(editconfpassPos.x() + 6, editconfpassPos.y() - 1, 24, 24); } void @@ -275,8 +269,8 @@ NewWizardWidget::on_previousButton_clicked() if (curWidget == ui->createRingAccountPage) { ui->setAvatarWidget->stopBooth(); } if (curWidget == ui->createRingSIPAccountPage) { ui->setSIPAvatarWidget->stopBooth(); } disconnect(registeredNameFoundConnection_); - lookupStatusLabel_->hide(); - passwordStatusLabel_->hide(); + ui->lookupStatusLabel->hide(); + ui->passwordStatusLabel->hide(); if (curWidget == ui->createRingAccountPage || curWidget == ui->linkRingAccountPage || curWidget == ui->createRingSIPAccountPage) { changePage(ui->welcomePage); @@ -390,13 +384,13 @@ NewWizardWidget::validateWizardProgression() registrationStateOk_ == true); bool passwordOk = ui->passwordEdit->text() == ui->confirmPasswordEdit->text(); if (passwordOk && !ui->passwordEdit->text().isEmpty()) { - passwordStatusLabel_->show(); - passwordStatusLabel_->setPixmap(statusSuccessPixmap_); + ui->passwordStatusLabel->show(); + ui->passwordStatusLabel->setPixmap(statusSuccessPixmap_); } else if (!passwordOk) { - passwordStatusLabel_->show(); - passwordStatusLabel_->setPixmap(statusErrorPixmap_); + ui->passwordStatusLabel->show(); + ui->passwordStatusLabel->setPixmap(statusErrorPixmap_); } else { - passwordStatusLabel_->hide(); + ui->passwordStatusLabel->hide(); } ui->nextButton->setEnabled(usernameOk && passwordOk); } @@ -436,7 +430,9 @@ NewWizardWidget::processWizardInformations() } inputPara_["archivePath"] = fileToImport_; - if (inputPara_.find("archivePin") == inputPara_.end()) { inputPara_["archivePin"] = ""; } + if (inputPara_.find("archivePin") == inputPara_.end()) { + inputPara_["archivePin"] = ""; + } changePage(ui->spinnerPage); createAccount(); diff --git a/newwizardwidget.h b/newwizardwidget.h index 0cb7a7a..8651ff2 100644 --- a/newwizardwidget.h +++ b/newwizardwidget.h @@ -1,5 +1,5 @@ /************************************************************************** -* Copyright (C) 2018-2019 by Savoir-faire Linux * +* Copyright (C) 2018-2019 by Savoir-faire Linux * * Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * * * * This program is free software; you can redistribute it and/or modify * @@ -19,7 +19,7 @@ #pragma once #include <QLabel> -#include <QtConcurrent/QtConcurrent> +#include <QTimer> #include <map> #include "lrcinstance.h" @@ -89,12 +89,10 @@ private: QMovie* lookupSpinnerMovie_; QTimer lookupTimer_; - QLabel* lookupStatusLabel_; QString registeredName_; bool registrationStateOk_; QMetaObject::Connection registeredNameFoundConnection_; QString fileToImport_; - QLabel* passwordStatusLabel_; std::map<std::string, QString> inputPara_; void updateNameRegistrationUi(NameRegistrationUIState state); diff --git a/newwizardwidget.ui b/newwizardwidget.ui index 972ed84..597ef33 100644 --- a/newwizardwidget.ui +++ b/newwizardwidget.ui @@ -66,13 +66,13 @@ <property name="minimumSize"> <size> <width>512</width> - <height>512</height> + <height>638</height> </size> </property> <property name="maximumSize"> <size> <width>512</width> - <height>512</height> + <height>638</height> </size> </property> <layout class="QVBoxLayout" name="verticalLayout_10"> @@ -108,7 +108,7 @@ <string notr="true"/> </property> <property name="currentIndex"> - <number>0</number> + <number>2</number> </property> <widget class="QWidget" name="welcomePage"> <layout class="QVBoxLayout" name="verticalLayout_3"> @@ -220,16 +220,21 @@ </property> <property name="minimumSize"> <size> - <width>220</width> + <width>256</width> <height>30</height> </size> </property> <property name="maximumSize"> <size> - <width>220</width> + <width>256</width> <height>16777215</height> </size> </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> <property name="toolTip"> <string>Create Jami account button</string> </property> @@ -258,16 +263,21 @@ <widget class="QPushButton" name="existingPushButton"> <property name="minimumSize"> <size> - <width>220</width> + <width>256</width> <height>30</height> </size> </property> <property name="maximumSize"> <size> - <width>220</width> + <width>256</width> <height>16777215</height> </size> </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> <property name="toolTip"> <string>Link device button</string> </property> @@ -299,16 +309,21 @@ </property> <property name="minimumSize"> <size> - <width>220</width> + <width>256</width> <height>30</height> </size> </property> <property name="maximumSize"> <size> - <width>220</width> + <width>256</width> <height>16777215</height> </size> </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> <property name="toolTip"> <string>Create Jami SIP account button</string> </property> @@ -442,6 +457,11 @@ <height>195</height> </size> </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> <property name="styleSheet"> <string notr="true">padding:8px;background-color:#efefef;border:1px solid #e0e0e0; border-radius:16px;</string> </property> @@ -504,7 +524,7 @@ p, li { white-space: pre-wrap; } </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="text"> @@ -531,7 +551,7 @@ p, li { white-space: pre-wrap; } </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> </widget> @@ -572,7 +592,7 @@ p, li { white-space: pre-wrap; } </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="text"> @@ -599,7 +619,7 @@ p, li { white-space: pre-wrap; } </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="toolTip"> @@ -660,7 +680,7 @@ p, li { white-space: pre-wrap; } </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="echoMode"> @@ -678,7 +698,7 @@ p, li { white-space: pre-wrap; } </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="text"> @@ -769,7 +789,7 @@ p, li { white-space: pre-wrap; } </property> <property name="font"> <font> - <pointsize>15</pointsize> + <pointsize>13</pointsize> </font> </property> <property name="styleSheet"> @@ -837,8 +857,8 @@ p, li { white-space: pre-wrap; } </property> <property name="minimumSize"> <size> - <width>140</width> - <height>140</height> + <width>261</width> + <height>261</height> </size> </property> <property name="styleSheet"> @@ -859,7 +879,7 @@ p, li { white-space: pre-wrap; } <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>3</height> + <height>6</height> </size> </property> </spacer> @@ -911,7 +931,7 @@ p, li { white-space: pre-wrap; } <widget class="QLineEdit" name="fullNameEdit"> <property name="minimumSize"> <size> - <width>200</width> + <width>261</width> <height>30</height> </size> </property> @@ -923,7 +943,7 @@ p, li { white-space: pre-wrap; } </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="toolTip"> @@ -997,7 +1017,7 @@ p, li { white-space: pre-wrap; } <widget class="QLabel" name="accountSectionLabel"> <property name="font"> <font> - <pointsize>14</pointsize> + <pointsize>13</pointsize> </font> </property> <property name="styleSheet"> @@ -1025,7 +1045,7 @@ p, li { white-space: pre-wrap; } <property name="topMargin"> <number>0</number> </property> - <item row="0" column="0"> + <item row="1" column="0"> <widget class="QWidget" name="verticalWidget1" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="MinimumExpanding"> @@ -1050,407 +1070,434 @@ p, li { white-space: pre-wrap; } <number>0</number> </property> <item> - <widget class="QWidget" name="infoWidget" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <layout class="QGridLayout" name="gridLayout_9"> + <property name="topMargin"> + <number>10</number> </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> + <property name="rightMargin"> + <number>0</number> </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> + <property name="horizontalSpacing"> + <number>0</number> </property> - <layout class="QHBoxLayout" name="horizontalLayout_8"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <spacer name="horizontalSpacer_9"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="infoLabel"> - <property name="font"> - <font> - <pointsize>12</pointsize> - </font> - </property> - <property name="text"> - <string/> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_10"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QWidget" name="signUpWidget" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_7"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QCheckBox" name="signUpCheckbox"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="toolTip"> - <string>Register your username. + <item row="1" column="0"> + <spacer name="horizontalSpacer_6"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="3" column="0"> + <spacer name="horizontalSpacer_8"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="2" column="0"> + <spacer name="horizontalSpacer_7"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="0" column="1"> + <widget class="QCheckBox" name="signUpCheckbox"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="toolTip"> + <string>Register your username. This will reserve the username so that only you can use it. Your friends will be able to call you with your usename instead of using your ID.</string> - </property> - <property name="accessibleName"> - <string>Public username checkbox</string> - </property> - <property name="accessibleDescription"> - <string>Checkbox selecting if the user wants a public username</string> - </property> - <property name="text"> - <string>Register public username</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> + </property> + <property name="accessibleName"> + <string>Public username checkbox</string> + </property> + <property name="accessibleDescription"> + <string>Checkbox selecting if the user wants a public username</string> + </property> + <property name="text"> + <string>Register public username</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QWidget" name="confPassWidget" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <layout class="QHBoxLayout" name="confirmPassLabel"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLineEdit" name="confirmPasswordEdit"> + <property name="minimumSize"> + <size> + <width>261</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>200</width> + <height>16777215</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="toolTip"> + <string>Password confirmation text input</string> + </property> + <property name="accessibleName"> + <string/> + </property> + <property name="accessibleDescription"> + <string>Password confirmation text input</string> + </property> + <property name="echoMode"> + <enum>QLineEdit::PasswordEchoOnEdit</enum> + </property> + <property name="placeholderText"> + <string>Confirm password</string> + </property> + <property name="clearButtonEnabled"> + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="2" column="1"> + <widget class="QWidget" name="passWidget" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <layout class="QHBoxLayout" name="passLayout"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLineEdit" name="passwordEdit"> + <property name="minimumSize"> + <size> + <width>261</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>200</width> + <height>16777215</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="toolTip"> + <string>Password text input</string> + </property> + <property name="accessibleName"> + <string/> + </property> + <property name="accessibleDescription"> + <string>Password text entry</string> + </property> + <property name="echoMode"> + <enum>QLineEdit::PasswordEchoOnEdit</enum> + </property> + <property name="placeholderText"> + <string>Password</string> + </property> + <property name="clearButtonEnabled"> + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="1" column="1"> + <widget class="QWidget" name="usernameWidget" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <layout class="QHBoxLayout" name="usernameLayout"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLineEdit" name="usernameEdit"> + <property name="minimumSize"> + <size> + <width>261</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>200</width> + <height>16777215</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="toolTip"> + <string>Public username edit</string> + </property> + <property name="accessibleName"> + <string/> + </property> + <property name="placeholderText"> + <string>Choose your username</string> + </property> + <property name="clearButtonEnabled"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="1" column="2"> + <layout class="QHBoxLayout" name="horizontalLayout_8"> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>7</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="lookupStatusLabel"> + <property name="minimumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + <item row="3" column="2"> + <layout class="QHBoxLayout" name="horizontalLayout_14"> + <item> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>7</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="passwordStatusLabel"> + <property name="minimumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + <item row="0" column="2"> + <spacer name="horizontalSpacer_9"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>37</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> </item> + </layout> + </widget> + </item> + <item row="0" column="0"> + <widget class="QWidget" name="infoWidget" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <property name="topMargin"> + <number>1</number> + </property> <item> - <widget class="QWidget" name="usernameWidget" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> + <widget class="QLabel" name="infoLabel"> <property name="minimumSize"> <size> <width>0</width> <height>30</height> </size> </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> - </property> - <layout class="QHBoxLayout" name="usernameLayout"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QLineEdit" name="usernameEdit"> - <property name="minimumSize"> - <size> - <width>200</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>200</width> - <height>16777215</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="toolTip"> - <string>Public username edit</string> - </property> - <property name="accessibleName"> - <string/> - </property> - <property name="placeholderText"> - <string>Choose your username</string> - </property> - <property name="clearButtonEnabled"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QWidget" name="passWidget" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> + <property name="baseSize"> <size> <width>0</width> - <height>30</height> + <height>0</height> </size> </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> </property> - <layout class="QHBoxLayout" name="passLayout"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QLineEdit" name="passwordEdit"> - <property name="minimumSize"> - <size> - <width>200</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>200</width> - <height>16777215</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="toolTip"> - <string>Password text input</string> - </property> - <property name="accessibleName"> - <string/> - </property> - <property name="accessibleDescription"> - <string>Password text entry</string> - </property> - <property name="echoMode"> - <enum>QLineEdit::Password</enum> - </property> - <property name="placeholderText"> - <string>Password</string> - </property> - <property name="clearButtonEnabled"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QWidget" name="confPassWidget" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <property name="text"> + <string/> </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> + <property name="alignment"> + <set>Qt::AlignCenter</set> </property> - <layout class="QHBoxLayout" name="confirmPassLabel"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QLineEdit" name="confirmPasswordEdit"> - <property name="minimumSize"> - <size> - <width>200</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>200</width> - <height>16777215</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="toolTip"> - <string>Password confirmation text input</string> - </property> - <property name="accessibleName"> - <string/> - </property> - <property name="accessibleDescription"> - <string>Password confirmation text input</string> - </property> - <property name="echoMode"> - <enum>QLineEdit::Password</enum> - </property> - <property name="placeholderText"> - <string>Confirm password</string> - </property> - <property name="clearButtonEnabled"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> </widget> </item> </layout> @@ -1529,7 +1576,7 @@ instead of using your ID.</string> </property> <property name="font"> <font> - <pointsize>15</pointsize> + <pointsize>13</pointsize> </font> </property> <property name="styleSheet"> @@ -1597,8 +1644,8 @@ instead of using your ID.</string> </property> <property name="minimumSize"> <size> - <width>150</width> - <height>150</height> + <width>261</width> + <height>261</height> </size> </property> <property name="styleSheet"> @@ -1619,7 +1666,7 @@ instead of using your ID.</string> <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>3</height> + <height>6</height> </size> </property> </spacer> @@ -1698,7 +1745,7 @@ instead of using your ID.</string> <widget class="QLineEdit" name="SIPfullNameEdit"> <property name="minimumSize"> <size> - <width>200</width> + <width>261</width> <height>30</height> </size> </property> @@ -1710,7 +1757,7 @@ instead of using your ID.</string> </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="toolTip"> @@ -1757,7 +1804,7 @@ instead of using your ID.</string> <widget class="QLabel" name="SIPaccountSectionLabel"> <property name="font"> <font> - <pointsize>14</pointsize> + <pointsize>13</pointsize> </font> </property> <property name="styleSheet"> @@ -1907,7 +1954,7 @@ instead of using your ID.</string> <widget class="QLineEdit" name="SIPservernameEdit"> <property name="minimumSize"> <size> - <width>200</width> + <width>261</width> <height>30</height> </size> </property> @@ -1919,7 +1966,7 @@ instead of using your ID.</string> </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="toolTip"> @@ -1979,7 +2026,7 @@ instead of using your ID.</string> <widget class="QLineEdit" name="SIPproxyEdit"> <property name="minimumSize"> <size> - <width>200</width> + <width>261</width> <height>30</height> </size> </property> @@ -1991,7 +2038,7 @@ instead of using your ID.</string> </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="toolTip"> @@ -2057,7 +2104,7 @@ instead of using your ID.</string> <widget class="QLineEdit" name="SIPusernameEdit"> <property name="minimumSize"> <size> - <width>200</width> + <width>261</width> <height>30</height> </size> </property> @@ -2069,7 +2116,7 @@ instead of using your ID.</string> </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="toolTip"> @@ -2135,7 +2182,7 @@ instead of using your ID.</string> <widget class="QLineEdit" name="SIPpasswordEdit"> <property name="minimumSize"> <size> - <width>200</width> + <width>261</width> <height>30</height> </size> </property> @@ -2147,7 +2194,7 @@ instead of using your ID.</string> </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="toolTip"> @@ -2160,7 +2207,7 @@ instead of using your ID.</string> <string>SIP Password text input</string> </property> <property name="echoMode"> - <enum>QLineEdit::Password</enum> + <enum>QLineEdit::PasswordEchoOnEdit</enum> </property> <property name="placeholderText"> <string>Password</string> @@ -2302,7 +2349,7 @@ instead of using your ID.</string> </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="toolTip"> @@ -2342,7 +2389,7 @@ instead of using your ID.</string> </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="toolTip"> @@ -2388,7 +2435,7 @@ instead of using your ID.</string> </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="toolTip"> diff --git a/passworddialog.cpp b/passworddialog.cpp index 54d6e62..4e73295 100644 --- a/passworddialog.cpp +++ b/passworddialog.cpp @@ -1,6 +1,7 @@ /************************************************************************** * Copyright (C) 2019-2019 by Savoir-faire Linux * * Author: Isa Nanic <isa.nanic@savoirfairelinux.com> * +* Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * * * * 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 * @@ -15,11 +16,12 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * **************************************************************************/ -#include <QTimer> - #include "passworddialog.h" #include "ui_passworddialog.h" +#include <QTimer> +#include <QtConcurrent/QtConcurrent> + #include "lrcinstance.h" PasswordDialog::PasswordDialog(QWidget* parent) @@ -28,28 +30,24 @@ PasswordDialog::PasswordDialog(QWidget* parent) { ui->setupUi(this); - ui->currentPsswdEdit->setEchoMode(QLineEdit::Password); - ui->newPsswdEdit->setEchoMode(QLineEdit::Password); - ui->confirmNewPsswdEdit->setEchoMode(QLineEdit::Password); + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + setFixedSize(size()); - if (!LRCInstance::getCurrAccConfig().archiveHasPassword) { - ui->currentPsswdEdit->hide(); - } else { - ui->currentPsswdEdit->show(); - } + ui->currentPasswordEdit->setEchoMode(QLineEdit::Password); + ui->passwordEdit->setEchoMode(QLineEdit::Password); + ui->confirmPasswordEdit->setEchoMode(QLineEdit::Password); - connect(ui->currentPsswdEdit, &QLineEdit::textChanged, this, &PasswordDialog::validateNewPsswd); - connect(ui->newPsswdEdit, &QLineEdit::textChanged, this, &PasswordDialog::validateNewPsswd); - connect(ui->confirmNewPsswdEdit, &QLineEdit::textChanged, this, &PasswordDialog::validateNewPsswd); + ui->currentPasswordEdit->setEnabled(LRCInstance::getCurrAccConfig().archiveHasPassword); - connect(ui->confirmButton, &QPushButton::clicked, [=]() { - savePassword(); - } - ); + connect(ui->currentPasswordEdit, &QLineEdit::textChanged, this, &PasswordDialog::validatePassword); + connect(ui->passwordEdit, &QLineEdit::textChanged, this, &PasswordDialog::validatePassword); + connect(ui->confirmPasswordEdit, &QLineEdit::textChanged, this, &PasswordDialog::validatePassword); + connect(ui->btnChangePasswordConfirm, &QPushButton::clicked, [this] { savePassword(); }); + connect(ui->btnChangePasswordCancel, &QPushButton::clicked, [this] { reject(); }); - connect(ui->cancelButton, &QPushButton::clicked, this, &PasswordDialog::closeSlot); + ui->btnChangePasswordConfirm->setEnabled(false); - ui->confirmButton->setEnabled(false); + ui->wrongPasswordLabel->hide(); } PasswordDialog::~PasswordDialog() @@ -57,52 +55,35 @@ PasswordDialog::~PasswordDialog() delete ui; } -// only sets new password if both new passwords match void -PasswordDialog::validateNewPsswd() +PasswordDialog::validatePassword() { - ui->newPsswdEdit->setStyleSheet("border: 1px solid red;"); - ui->confirmNewPsswdEdit->setStyleSheet("border: 1px solid red;"); + bool acceptablePassword = ui->passwordEdit->text() == ui->confirmPasswordEdit->text(); + ui->btnChangePasswordConfirm->setEnabled(acceptablePassword); - if (ui->newPsswdEdit->text() == ui->confirmNewPsswdEdit->text()) { - ui->newPsswdEdit->setStyleSheet("border: 1px solid green;"); - ui->confirmNewPsswdEdit->setStyleSheet("border: 1px solid green;"); + if (acceptablePassword) { + ui->passwordEdit->setStyleSheet("border: 2px solid green;"); + ui->confirmPasswordEdit->setStyleSheet("border: 2px solid green;"); + return; } - freeConfirmButton(); -} -void -PasswordDialog::freeConfirmButton() -{ - if (ui->newPsswdEdit->text() == ui->confirmNewPsswdEdit->text()) { - ui->confirmButton->setEnabled(true); - } - else { - ui->confirmButton->setEnabled(false); - } + ui->passwordEdit->setStyleSheet("border: 2px solid red;"); + ui->confirmPasswordEdit->setStyleSheet("border: 2px solid red;"); } void PasswordDialog::savePassword() { if (LRCInstance::editableAccountModel()->changeAccountPassword(LRCInstance::getCurrAccId(), - ui->currentPsswdEdit->text().toStdString(), ui->newPsswdEdit->text().toStdString())) { - ui->userMessageLabel->setText(tr("Password Changed Successfully")); + ui->currentPasswordEdit->text().toStdString(), ui->passwordEdit->text().toStdString())) { auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); - ui->newPsswdEdit->text().isEmpty() ? confProps.archiveHasPassword = false : confProps.archiveHasPassword = true; + confProps.archiveHasPassword = !ui->passwordEdit->text().isEmpty(); LRCInstance::editableAccountModel()->setAccountConfig(LRCInstance::getCurrAccId(), confProps); - ui->cancelButton->hide(); - ui->confirmButton->hide(); - ui->currentPsswdEdit->hide(); - ui->newPsswdEdit->hide(); - ui->confirmNewPsswdEdit->hide(); - - QTimer::singleShot(900, this, SLOT(closeSlot())); - } - else { - ui->userMessageLabel->setText(tr("Current Password Incorrect")); - ui->currentPsswdEdit->setText(""); + accept(); + } else { + ui->wrongPasswordLabel->show(); + ui->currentPasswordEdit->setText(""); } } \ No newline at end of file diff --git a/passworddialog.h b/passworddialog.h index ec7fab7..56f5c47 100644 --- a/passworddialog.h +++ b/passworddialog.h @@ -15,8 +15,8 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * **************************************************************************/ - #pragma once + #include <QDialog> namespace Ui { @@ -26,19 +26,15 @@ namespace Ui { class PasswordDialog : public QDialog { Q_OBJECT - PasswordDialog(const PasswordDialog& cpy); - public: PasswordDialog(QWidget* parent = nullptr); ~PasswordDialog(); private slots: - void validateNewPsswd(); - inline void closeSlot() { done(0); }; + void validatePassword(); private: Ui::PasswordDialog* ui; - void freeConfirmButton(); void savePassword(); }; \ No newline at end of file diff --git a/passworddialog.ui b/passworddialog.ui index 483b886..2415a98 100644 --- a/passworddialog.ui +++ b/passworddialog.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>458</width> - <height>250</height> + <width>440</width> + <height>237</height> </rect> </property> <property name="sizePolicy"> @@ -19,13 +19,13 @@ <property name="minimumSize"> <size> <width>440</width> - <height>250</height> + <height>224</height> </size> </property> <property name="maximumSize"> <size> - <width>458</width> - <height>268</height> + <width>16777215</width> + <height>16777215</height> </size> </property> <property name="windowTitle"> @@ -38,16 +38,55 @@ <property name="sizeConstraint"> <enum>QLayout::SetDefaultConstraint</enum> </property> + <property name="leftMargin"> + <number>40</number> + </property> + <property name="rightMargin"> + <number>40</number> + </property> + <item> + <spacer name="verticalSpacer_3"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>5</height> + </size> + </property> + </spacer> + </item> <item> - <layout class="QVBoxLayout" name="verticalLayout_5"> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="spacing"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> <item> - <widget class="QLineEdit" name="currentPsswdEdit"> + <widget class="QLineEdit" name="currentPasswordEdit"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="minimumSize"> <size> <width>0</width> <height>30</height> </size> </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> <property name="layoutDirection"> <enum>Qt::LeftToRight</enum> </property> @@ -60,7 +99,7 @@ </widget> </item> <item> - <spacer name="verticalSpacer"> + <spacer name="verticalSpacer_4"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> @@ -70,109 +109,173 @@ <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>15</height> + <height>2</height> </size> </property> </spacer> </item> <item> - <widget class="QLineEdit" name="newPsswdEdit"> + <widget class="QLabel" name="wrongPasswordLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="minimumSize"> <size> <width>0</width> - <height>30</height> + <height>12</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>12</height> </size> </property> + <property name="font"> + <font> + <pointsize>8</pointsize> + </font> + </property> <property name="text"> - <string/> + <string>Current Password Incorrect</string> </property> - <property name="placeholderText"> - <string>Enter New Password</string> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> </property> </widget> </item> + </layout> + </item> + <item> + <widget class="QLineEdit" name="passwordEdit"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="placeholderText"> + <string>Enter New Password</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="confirmPasswordEdit"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="placeholderText"> + <string>Confirm New Password</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>5</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>7</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> <item> - <widget class="QLineEdit" name="confirmNewPsswdEdit"> + <widget class="QPushButton" name="btnChangePasswordConfirm"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="minimumSize"> <size> - <width>0</width> + <width>130</width> <height>30</height> </size> </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> <property name="text"> - <string/> + <string>Confirm</string> </property> - <property name="placeholderText"> - <string>Confirm New Password</string> + <property name="flat"> + <bool>false</bool> </property> </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="spacing"> - <number>20</number> - </property> - <property name="leftMargin"> - <number>20</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>20</number> - </property> - <item> - <widget class="QPushButton" name="confirmButton"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">background: rgb(237, 237, 237); border: 1px solid black;</string> - </property> - <property name="text"> - <string>Confirm</string> - </property> - <property name="flat"> - <bool>false</bool> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="cancelButton"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">background: rgb(237, 237, 237); border: 1px solid black;</string> - </property> - <property name="text"> - <string>Cancel</string> - </property> - <property name="flat"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QLabel" name="userMessageLabel"> - <property name="minimumSize"> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> <size> - <width>0</width> - <height>25</height> + <width>40</width> + <height>20</height> </size> </property> - <property name="maximumSize"> + </spacer> + </item> + <item> + <widget class="QPushButton" name="btnChangePasswordCancel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> <size> - <width>16777215</width> - <height>25</height> + <width>130</width> + <height>30</height> </size> </property> <property name="font"> @@ -180,16 +283,35 @@ <pointsize>10</pointsize> </font> </property> + <property name="styleSheet"> + <string notr="true"/> + </property> <property name="text"> - <string/> + <string>Cancel</string> </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> + <property name="flat"> + <bool>false</bool> </property> </widget> </item> </layout> </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>5</height> + </size> + </property> + </spacer> + </item> </layout> </widget> <customwidgets> diff --git a/photoboothwidget.cpp b/photoboothwidget.cpp index cab2241..a2108e4 100644 --- a/photoboothwidget.cpp +++ b/photoboothwidget.cpp @@ -1,6 +1,7 @@ /*************************************************************************** - * Copyright (C) 2015-2017 by Savoir-faire Linux * + * Copyright (C) 2015-2019 by Savoir-faire Linux * * Author: Olivier Soldano <olivier.soldano@savoirfairelinux.com> * + * Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * * * * 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 * @@ -53,7 +54,7 @@ PhotoboothWidget::PhotoboothWidget(QWidget *parent) : flashAnimation_->setEasingCurve(QEasingCurve::OutCubic); takePhotoState_ = true; - ui->takePhotoButton->setIcon(QPixmap(":/images/icons/baseline-camera_alt-24px.svg")); + ui->takePhotoButton->setIcon(QIcon(":/images/icons/baseline-camera_alt-24px.svg")); } PhotoboothWidget::~PhotoboothWidget() @@ -71,7 +72,7 @@ void PhotoboothWidget::startBooth() ui->videoFeed->show(); ui->avatarLabel->hide(); takePhotoState_ = true; - ui->takePhotoButton->setIcon(QPixmap(":/images/icons/baseline-camera_alt-24px.svg")); + ui->takePhotoButton->setIcon(QIcon(":/images/icons/baseline-camera_alt-24px.svg")); } void PhotoboothWidget::stopBooth() @@ -80,7 +81,7 @@ void PhotoboothWidget::stopBooth() ui->videoFeed->hide(); ui->avatarLabel->show(); takePhotoState_ = false; - ui->takePhotoButton->setIcon(QPixmap(":/images/icons/baseline-refresh-24px.svg")); + ui->takePhotoButton->setIcon(QIcon(":/images/icons/baseline-refresh-24px.svg")); } void @@ -96,18 +97,20 @@ PhotoboothWidget::on_importButton_clicked() return; } Video::PreviewManager::instance().stopPreview(); - auto image = QImage(fileName_); - auto avatar = image.scaled(100, 100, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); - avatarPixmap_ = QPixmap::fromImage(Utils::getCirclePhoto(avatar, ui->avatarLabel->width())); - ui->avatarLabel->setPixmap(avatarPixmap_); + auto image = Utils::cropImage(QImage(fileName_)); + auto avatar = image.scaled(224, 224, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); + avatarPixmap_ = QPixmap::fromImage(avatar); + ui->avatarLabel->setPixmap(QPixmap::fromImage(Utils::getCirclePhoto(avatar, ui->avatarLabel->width()))); hasAvatar_ = true; + emit photoTaken(); stopBooth(); } void PhotoboothWidget::on_takePhotoButton_clicked() { - if (!takePhotoState_) { + if (!takePhotoState_) { // restart + emit clearedPhoto(); startBooth(); return; } else { @@ -125,16 +128,27 @@ PhotoboothWidget::on_takePhotoButton_clicked() QtConcurrent::run( [this] { Video::PreviewManager::instance().stopPreview(); - auto photo = ui->videoFeed->takePhoto(); - auto avatar = photo.scaled(100, 100, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); - avatarPixmap_ = QPixmap::fromImage(Utils::getCirclePhoto(avatar, ui->avatarLabel->width())); - ui->avatarLabel->setPixmap(avatarPixmap_); + auto photo = Utils::cropImage(ui->videoFeed->takePhoto()); + auto avatar = photo.scaled(224, 224, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); + avatarPixmap_ = QPixmap::fromImage(avatar); + ui->avatarLabel->setPixmap(QPixmap::fromImage(Utils::getCirclePhoto(avatar, ui->avatarLabel->width()))); hasAvatar_ = true; + emit photoTaken(); stopBooth(); }); } } +void +PhotoboothWidget::setAvatarPixmap(const QPixmap& avatarPixmap, bool default) +{ + ui->avatarLabel->setPixmap(avatarPixmap); + stopBooth(); + if (default) { + ui->takePhotoButton->setIcon(QIcon(":/images/icons/round-add_a_photo-24px.svg")); + } +} + const QPixmap& PhotoboothWidget::getAvatarPixmap() { diff --git a/photoboothwidget.h b/photoboothwidget.h index 9b0d356..86cf88d 100644 --- a/photoboothwidget.h +++ b/photoboothwidget.h @@ -1,6 +1,7 @@ /*************************************************************************** - * Copyright (C) 2015-2017 by Savoir-faire Linux * + * Copyright (C) 2015-2019 by Savoir-faire Linux * * Author: Olivier Soldano <olivier.soldano@savoirfairelinux.com> * + * Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * * * * 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 * @@ -16,8 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * **************************************************************************/ -#ifndef PHOTOBOOTHWIDGET_H -#define PHOTOBOOTHWIDGET_H +#pragma once #include <QWidget> #include <QLabel> @@ -34,8 +34,10 @@ class PhotoboothWidget : public QWidget public: explicit PhotoboothWidget(QWidget *parent = 0); ~PhotoboothWidget(); + void startBooth(); void stopBooth(); + void setAvatarPixmap(const QPixmap& avatarPixmap, bool default = false); const QPixmap& getAvatarPixmap(); bool hasAvatar(); @@ -55,8 +57,6 @@ private: bool takePhotoState_; signals: - void photoTaken(QString fileName); - + void photoTaken(); + void clearedPhoto(); }; - -#endif // PHOTOBOOTHWIDGET_H diff --git a/photoboothwidget.ui b/photoboothwidget.ui index 258159f..21a95ba 100644 --- a/photoboothwidget.ui +++ b/photoboothwidget.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>392</width> - <height>160</height> + <width>224</width> + <height>485</height> </rect> </property> <property name="sizePolicy"> @@ -21,7 +21,7 @@ </property> <layout class="QVBoxLayout" name="verticalLayout" stretch="0,0"> <property name="spacing"> - <number>0</number> + <number>7</number> </property> <property name="leftMargin"> <number>0</number> @@ -51,7 +51,7 @@ <number>0</number> </property> <property name="bottomMargin"> - <number>3</number> + <number>0</number> </property> <item> <widget class="QWidget" name="verticalWidget" native="true"> @@ -61,25 +61,10 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> - <size> - <width>120</width> - <height>120</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>120</width> - <height>120</height> - </size> - </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> + <layout class="QVBoxLayout" name="verticalLayout_3"> <property name="spacing"> <number>0</number> </property> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> <property name="leftMargin"> <number>0</number> </property> @@ -94,16 +79,22 @@ </property> <item> <widget class="QLabel" name="avatarLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="minimumSize"> <size> - <width>120</width> - <height>120</height> + <width>224</width> + <height>224</height> </size> </property> <property name="maximumSize"> <size> - <width>120</width> - <height>120</height> + <width>224</width> + <height>224</height> </size> </property> <property name="text"> @@ -121,8 +112,8 @@ </property> <property name="minimumSize"> <size> - <width>120</width> - <height>120</height> + <width>224</width> + <height>224</height> </size> </property> <property name="toolTip"> @@ -140,99 +131,113 @@ </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="topMargin"> - <number>0</number> + <widget class="QWidget" name="buttonsWidget" native="true"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> </property> - <item> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="takePhotoButton"> - <property name="minimumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="ressources.qrc"> - <normaloff>:/images/icons/baseline-camera_alt-24px.svg</normaloff>:/images/icons/baseline-camera_alt-24px.svg</iconset> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>6</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="importButton"> - <property name="minimumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="ressources.qrc"> - <normaloff>:/images/icons/round-folder-24px.svg</normaloff>:/images/icons/round-folder-24px.svg</iconset> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>30</height> + </size> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="topMargin"> + <number>1</number> + </property> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="takePhotoButton"> + <property name="minimumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="ressources.qrc"> + <normaloff>:/images/icons/baseline-camera_alt-24px.svg</normaloff>:/images/icons/baseline-camera_alt-24px.svg</iconset> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>6</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="importButton"> + <property name="minimumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="ressources.qrc"> + <normaloff>:/images/icons/round-folder-24px.svg</normaloff>:/images/icons/round-folder-24px.svg</iconset> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> </item> </layout> </widget> diff --git a/pixbufmanipulator.cpp b/pixbufmanipulator.cpp index ea8fde3..3bacc4d 100644 --- a/pixbufmanipulator.cpp +++ b/pixbufmanipulator.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2015-2017 by Savoir-faire Linux * + * Copyright (C) 2015-2019 by Savoir-faire Linux * * Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>* * Author: Anthony Léonard <anthony.leonard@savoirfairelinux.com> * * Author: Olivier Soldano <olivier.soldano@savoirfairelinux.com> * @@ -28,7 +28,6 @@ #include <QByteArray> #include <QBuffer> #include <QPainter> -#include <QCryptographicHash> #include "person.h" #include "call.h" @@ -47,112 +46,13 @@ #include "ringthemeutils.h" #undef interface -static const QSize IMAGE_SIZE {128, 128}; - -QColor -getAvatarColor(const QString& canonicalUri) { - if (canonicalUri.isEmpty()) { - return RingTheme::defaultAvatarColor_; - } - auto h = QString(QCryptographicHash::hash(canonicalUri.toLocal8Bit(), QCryptographicHash::Md5).toHex()); - if (h.isEmpty() || h.isNull()) { - return RingTheme::defaultAvatarColor_; - } - auto colorIndex = std::string("0123456789abcdef").find(h.at(0).toLatin1()); - return RingTheme::avatarColors_[colorIndex]; -} - -// Generate a QImage representing a dummy user avatar, when user doesn't provide it. -// Current rendering is a flat colored circle with a centered letter. -// The color of the letter is computed from the circle color to be visible whaterver be the circle color. -static QImage -fallbackAvatar(const QSize size, const QString& canonicalUriStr, const QString& letterStr = QString()) -{ - // We start with a transparent avatar - QImage avatar(size, QImage::Format_ARGB32); - avatar.fill(Qt::transparent); - - // We pick a color based on the passed character - QColor avColor = getAvatarColor(canonicalUriStr); - - // We draw a circle with this color - QPainter painter(&avatar); - painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); - painter.setPen(Qt::transparent); - painter.setBrush(avColor.lighter(110)); - painter.drawEllipse(avatar.rect()); - - // If a letter was passed, then we paint a letter in the circle, - // otherwise we draw the default avatar icon - QString letterStrCleaned(letterStr); - letterStrCleaned.remove(QRegExp("[\\n\\t\\r]")); - if (!letterStr.isEmpty()) { - auto letter = letterStr.at(0).toUpper().toLatin1(); - QFont font("Arial", avatar.height() / 2.66667, QFont::Medium); - painter.setFont(font); - painter.setPen(Qt::white); - painter.drawText(avatar.rect(), QString(letter), QTextOption(Qt::AlignCenter)); - } else { - QRect overlayRect = avatar.rect(); - qreal margin = (0.05 * overlayRect.width()); - overlayRect.moveLeft(overlayRect.left() + margin * 0.5); - overlayRect.moveTop(overlayRect.top() + margin * 0.5); - overlayRect.setWidth(overlayRect.width() - margin); - overlayRect.setHeight(overlayRect.height() - margin); - painter.drawPixmap(overlayRect, QPixmap(":/images/default_avatar_overlay.svg")); - } - - return avatar; -} - -QImage -fallbackAvatar(const QSize size, const ContactMethod* cm) -{ - if (cm == nullptr) { - return QImage(); - } - QImage image; - auto letterStr = QString(); - if (cm->uri().userinfo() != cm->bestName()) { - letterStr = cm->bestName(); - } - image = fallbackAvatar( size, - cm->uri().full(), - letterStr); - return image; -} - -QImage -fallbackAvatar(const QSize size, const std::string& alias, const std::string& uri) -{ - return fallbackAvatar(size, - QString::fromStdString(uri), - QString::fromStdString(alias)); -} - -/*Namespace Interfaces collide with QBuffer*/ -QByteArray QImageToByteArray(QImage image) -{ - QByteArray ba; - QBuffer buffer(&ba); - buffer.open(QIODevice::WriteOnly); - image.save(&buffer, "PNG"); - return ba; -} - -QImage -PixbufManipulator::scaleAndFrame(const QImage photo, const QSize& size) -{ - return photo.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation); -} - QVariant PixbufManipulator::callPhoto(Call* c, const QSize& size, bool displayPresence) { if (!c || c->type() == Call::Type::CONFERENCE){ - return QVariant::fromValue(fallbackAvatar(size, - c->peerContactMethod()->uri().full(), - c->peerContactMethod()->bestName())); + return QVariant::fromValue(Utils::fallbackAvatar(size, + c->peerContactMethod()->uri().full(), + c->peerContactMethod()->bestName())); } return callPhoto(c->peerContactMethod(), size, displayPresence); } @@ -163,7 +63,7 @@ PixbufManipulator::callPhoto(const ContactMethod* cm, const QSize& size, bool di if (cm && cm->contact()) { return contactPhoto(cm->contact(), size, displayPresence); } else { - return QVariant::fromValue(fallbackAvatar(size, cm)); + return QVariant::fromValue(Utils::fallbackAvatar(size, cm)); } } @@ -175,9 +75,9 @@ PixbufManipulator::contactPhoto(Person* p, const QSize& size, bool displayPresen if (p->photo().isValid()) { photo = p->photo().value<QImage>(); } else { - photo = fallbackAvatar(IMAGE_SIZE, p->phoneNumbers().at(0)); + photo = Utils::fallbackAvatar(IMAGE_SIZE, p->phoneNumbers().at(0)); } - return QVariant::fromValue(scaleAndFrame(photo, size)); + return QVariant::fromValue(Utils::scaleAndFrame(photo, size)); } QVariant PixbufManipulator::personPhoto(const QByteArray& data, const QString& type) @@ -212,7 +112,7 @@ QByteArray PixbufManipulator::toByteArray(const QVariant& pxm) { auto image = pxm.value<QImage>(); - QByteArray ba = QImageToByteArray(image); + QByteArray ba = Utils::QImageToByteArray(image); return ba; } @@ -262,9 +162,9 @@ QVariant PixbufManipulator::decorationRole(const Call* c) && c->peerContactMethod()->contact()->photo().isValid()) { photo = c->peerContactMethod()->contact()->photo().value<QImage>(); } else { - fallbackAvatar(IMAGE_SIZE, c->peerContactMethod()); + Utils::fallbackAvatar(IMAGE_SIZE, c->peerContactMethod()); } - return QVariant::fromValue(scaleAndFrame(photo, IMAGE_SIZE)); + return QVariant::fromValue(Utils::scaleAndFrame(photo, IMAGE_SIZE)); } QVariant PixbufManipulator::decorationRole(const ContactMethod* cm) @@ -274,9 +174,9 @@ QVariant PixbufManipulator::decorationRole(const ContactMethod* cm) && cm->contact()->photo().isValid()) { photo = cm->contact()->photo().value<QImage>(); } else { - photo = fallbackAvatar(IMAGE_SIZE, cm); + photo = Utils::fallbackAvatar(IMAGE_SIZE, cm); } - return QVariant::fromValue(scaleAndFrame(photo, IMAGE_SIZE)); + return QVariant::fromValue(Utils::scaleAndFrame(photo, IMAGE_SIZE)); } QVariant PixbufManipulator::decorationRole(const Person* p) @@ -285,9 +185,9 @@ QVariant PixbufManipulator::decorationRole(const Person* p) if (p && p->photo().isValid()) { photo = p->photo().value<QImage>(); } else { - photo = fallbackAvatar(IMAGE_SIZE, p->phoneNumbers().at(0)); + photo = Utils::fallbackAvatar(IMAGE_SIZE, p->phoneNumbers().at(0)); } - return QVariant::fromValue(scaleAndFrame(photo, IMAGE_SIZE)); + return QVariant::fromValue(Utils::scaleAndFrame(photo, IMAGE_SIZE)); } QVariant PixbufManipulator::decorationRole(const Account* acc) @@ -314,15 +214,15 @@ PixbufManipulator::decorationRole(const lrc::api::conversation::Info & conversat auto bestId = Utils::bestIdForContact(contactInfo); if (accountInfo.profileInfo.type == lrc::api::profile::Type::SIP && contactInfo.profileInfo.type == lrc::api::profile::Type::TEMPORARY) { - photo = fallbackAvatar(IMAGE_SIZE, QString(), QString()); + photo = Utils::fallbackAvatar(IMAGE_SIZE, QString(), QString()); } else if (accountInfo.profileInfo.type == lrc::api::profile::Type::SIP) { - photo = fallbackAvatar(IMAGE_SIZE, - QString::fromStdString("sip:" + bestId), - QString()); + photo = Utils::fallbackAvatar(IMAGE_SIZE, + QString::fromStdString("sip:" + bestId), + QString()); } else if (contactInfo.profileInfo.type == lrc::api::profile::Type::TEMPORARY && contactInfo.profileInfo.uri.empty()) { - photo = fallbackAvatar(IMAGE_SIZE, QString(), QString()); + photo = Utils::fallbackAvatar(IMAGE_SIZE, QString(), QString()); } else if (!contactPhoto.empty()) { QByteArray byteArray(contactPhoto.c_str(), contactPhoto.length()); @@ -332,31 +232,12 @@ PixbufManipulator::decorationRole(const lrc::api::conversation::Info & conversat auto avatarName = contactInfo.profileInfo.uri == bestName ? QString() : QString::fromStdString(bestName); - photo = fallbackAvatar(IMAGE_SIZE, - QString::fromStdString("ring:" + bestId), - avatarName); + photo = Utils::fallbackAvatar(IMAGE_SIZE, + QString::fromStdString("ring:" + bestId), + avatarName); } } catch (...) {} } - return QVariant::fromValue(scaleAndFrame(photo, IMAGE_SIZE)); -} - -QVariant -PixbufManipulator::accountPhoto(const lrc::api::account::Info& accountInfo) -{ - QImage photo; - if (!accountInfo.profileInfo.avatar.empty()) { - QByteArray ba = QByteArray::fromStdString(accountInfo.profileInfo.avatar); - photo = GlobalInstances::pixmapManipulator().personPhoto(ba, nullptr).value<QImage>(); - } - else { - auto bestId = Utils::bestIdForAccount(accountInfo); - auto bestName = Utils::bestNameForAccount(accountInfo); - QString letterStr = bestId == bestName ? QString() : QString::fromStdString(bestName); - photo = fallbackAvatar( IMAGE_SIZE, - QString::fromStdString("ring:" + bestId), - letterStr); - } - return QVariant::fromValue(scaleAndFrame(photo, IMAGE_SIZE)); -} + return QVariant::fromValue(Utils::scaleAndFrame(photo, IMAGE_SIZE)); +} \ No newline at end of file diff --git a/pixbufmanipulator.h b/pixbufmanipulator.h index 3097043..49fe229 100644 --- a/pixbufmanipulator.h +++ b/pixbufmanipulator.h @@ -54,7 +54,4 @@ public: QVariant decorationRole(const Account* acc) override; QVariant decorationRole(const lrc::api::conversation::Info& conversation, const lrc::api::account::Info& accountInfo) override; - static QImage scaleAndFrame(const QImage photo, const QSize& size); - static QVariant accountPhoto(const lrc::api::account::Info& accountInfo); }; - diff --git a/regnamedialog.cpp b/regnamedialog.cpp deleted file mode 100644 index 75130b8..0000000 --- a/regnamedialog.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/************************************************************************** -* Copyright (C) 2019-2019 by Savoir-faire Linux * -* Author: Isa Nanic <isa.nanic@savoirfairelinux.com> * -* * -* 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 <http://www.gnu.org/licenses/>. * -**************************************************************************/ - -#include "regnamedialog.h" -#include "ui_regnamedialog.h" - -#include <QTimer> - -RegNameDialog::RegNameDialog(const QString& newRegName, QWidget* parent) - :QDialog(parent), - ui(new Ui::RegNameDialog), - registeredName_(newRegName), - gif(new QMovie(":/images/ajax-loader.gif")) -{ - ui->setupUi(this); - - ui->stackedWidget->setCurrentWidget(ui->startPage); - ui->registeredName->setText(newRegName); - - connect(ui->startPageConfirmBtn, &QPushButton::clicked, this, &RegNameDialog::startNameRegistration); - - connect(ui->startPageCancelBtn, &QPushButton::clicked, [this]() { - reject(); - } - ); - - // get name registration result - connect(LRCInstance::editableAccountModel(), &lrc::api::NewAccountModel::nameRegistrationEnded, - this, &RegNameDialog::nameRegistrationResultSlot); -} - -RegNameDialog::~RegNameDialog() -{ - disconnect(this); - delete ui; -} - -void -RegNameDialog::startNameRegistration() -{ - LRCInstance::editableAccountModel()->registerName(LRCInstance::getCurrAccId(), - "", registeredName_.toStdString()); - startSpinner(); -} - -void -RegNameDialog::nameRegistrationResultSlot(const std::string& accountId, - lrc::api::account::RegisterNameStatus status, const std::string& registerdName) -{ - Q_UNUSED(accountId); - Q_UNUSED(registerdName); - - gif->stop(); - - if(status == lrc::api::account::RegisterNameStatus::SUCCESS) { - ui->stackedWidget->setCurrentWidget(ui->nameRegisteredPage); - QTimer::singleShot(1000, this, &RegNameDialog::accept); - } else { - ui->stackedWidget->setCurrentWidget(ui->nameNotRegisteredPage); - QTimer::singleShot(1000, this, &RegNameDialog::reject); - } -} - -void -RegNameDialog::startSpinner() -{ - ui->stackedWidget->setCurrentWidget(ui->loadingPage); - - ui->spinnerLabel->setMovie(gif); - gif->start(); -} \ No newline at end of file diff --git a/regnamedialog.ui b/regnamedialog.ui deleted file mode 100644 index d4643e9..0000000 --- a/regnamedialog.ui +++ /dev/null @@ -1,640 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>RegNameDialog</class> - <widget class="QDialog" name="RegNameDialog"> - <property name="windowModality"> - <enum>Qt::ApplicationModal</enum> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>480</width> - <height>200</height> - </rect> - </property> - <property name="minimumSize"> - <size> - <width>480</width> - <height>200</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>480</width> - <height>200</height> - </size> - </property> - <property name="windowTitle"> - <string>Set Registered Name</string> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="modal"> - <bool>true</bool> - </property> - <widget class="QStackedWidget" name="stackedWidget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>481</width> - <height>191</height> - </rect> - </property> - <property name="maximumSize"> - <size> - <width>700</width> - <height>700</height> - </size> - </property> - <property name="currentIndex"> - <number>0</number> - </property> - <widget class="QWidget" name="startPage"> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <spacer name="verticalSpacer_5"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label"> - <property name="font"> - <font> - <pointsize>10</pointsize> - </font> - </property> - <property name="text"> - <string>Are you sure you would like to register this name?</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Once associated to this account, it cannot be changed.</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <spacer name="horizontalSpacer_5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string>Your new registered name would be:</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_6"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_5"> - <property name="topMargin"> - <number>6</number> - </property> - <item> - <spacer name="horizontalSpacer_10"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="registeredName"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="font"> - <font> - <pointsize>10</pointsize> - </font> - </property> - <property name="text"> - <string/> - </property> - <property name="textInteractionFlags"> - <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_11"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <property name="bottomMargin"> - <number>10</number> - </property> - <item> - <spacer name="horizontalSpacer_7"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="startPageConfirmBtn"> - <property name="minimumSize"> - <size> - <width>150</width> - <height>37</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">background: rgb(250, 250, 250); border: none; padding: 10px;</string> - </property> - <property name="text"> - <string>Confirm Registration</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_8"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="startPageCancelBtn"> - <property name="minimumSize"> - <size> - <width>150</width> - <height>37</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">background: rgb(250, 250, 250); border: none; padding: 10px;</string> - </property> - <property name="text"> - <string>Cancel</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_9"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer_6"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <widget class="QWidget" name="loadingPage"> - <layout class="QVBoxLayout" name="verticalLayout_6"> - <item> - <spacer name="verticalSpacer_15"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_15"> - <item> - <spacer name="horizontalSpacer_32"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="spinnerLabel"> - <property name="minimumSize"> - <size> - <width>40</width> - <height>40</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>40</width> - <height>40</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_33"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer_16"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <widget class="QWidget" name="nameRegisteredPage"> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <item> - <spacer name="horizontalSpacer_12"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label_4"> - <property name="font"> - <font> - <pointsize>10</pointsize> - </font> - </property> - <property name="text"> - <string>The name has been successfully registered!</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_13"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> - </widget> - <widget class="QWidget" name="nameNotRegisteredPage"> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <item> - <spacer name="verticalSpacer_3"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_7"> - <item> - <spacer name="horizontalSpacer_14"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label_5"> - <property name="font"> - <font> - <pointsize>10</pointsize> - </font> - </property> - <property name="text"> - <string>Something went wrong.</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_15"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_8"> - <item> - <spacer name="horizontalSpacer_16"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label_6"> - <property name="text"> - <string>Please try again later</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_17"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>10</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_9"> - <item> - <spacer name="horizontalSpacer_18"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label_7"> - <property name="text"> - <string>Your account does not have a registered name</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_19"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer_4"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </widget> - </widget> - <resources/> - <connections/> -</ui> diff --git a/ressources.qrc b/ressources.qrc index d3df037..2797897 100644 --- a/ressources.qrc +++ b/ressources.qrc @@ -76,7 +76,10 @@ <file>images/icons/round-error-24px.svg</file> <file>images/icons/round-save_alt-24px.svg</file> <file>images/jami_eclipse_spinner.gif</file> - <file>images/icons/showHide.PNG</file> - <file>images/icons/showHideTwo.PNG</file> + <file>images/icons/ic_hide_password.png</file> + <file>images/icons/ic_show_password.png</file> + <file>images/icons/baseline-desktop_windows-24px.svg</file> + <file>images/icons/baseline-people-24px.svg</file> + <file>images/icons/round-add_a_photo-24px.svg</file> </qresource> </RCC> diff --git a/ring-client-windows.sln b/ring-client-windows.sln index ca60adc..38c0226 100644 --- a/ring-client-windows.sln +++ b/ring-client-windows.sln @@ -5,14 +5,14 @@ VisualStudioVersion = 15.0.27703.2026 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ring-client-windows", "ring-client-windows.vcxproj", "{0F6318E4-4C06-384E-BCA8-F344DA187957}" ProjectSection(ProjectDependencies) = postProject - {25AAE3D1-64FC-3F7F-A613-FD2946045822} = {25AAE3D1-64FC-3F7F-A613-FD2946045822} + {A604BA33-C1DB-34F6-8584-C429857717A8} = {A604BA33-C1DB-34F6-8584-C429857717A8} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ring-daemon", "..\daemon\MSVC\ring-daemon.vcxproj", "{79F8DE42-595D-49D9-A66F-55244FD9DCC3}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ringclient_static", "..\lrc\msvc\ringclient_static.vcxproj", "{25AAE3D1-64FC-3F7F-A613-FD2946045822}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ringclient_static", "..\lrc\msvc\ringclient_static.vcxproj", "{A604BA33-C1DB-34F6-8584-C429857717A8}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qtwrapper", "..\lrc\msvc\src\qtwrapper\qtwrapper.vcxproj", "{A9C7244C-3AD1-3E17-9345-72835807575F}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qtwrapper", "..\lrc\msvc\src\qtwrapper\qtwrapper.vcxproj", "{8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}" ProjectSection(ProjectDependencies) = postProject {79F8DE42-595D-49D9-A66F-55244FD9DCC3} = {79F8DE42-595D-49D9-A66F-55244FD9DCC3} EndProjectSection @@ -102,62 +102,62 @@ Global {79F8DE42-595D-49D9-A66F-55244FD9DCC3}.RelWithDebInfo|x64.Build.0 = ReleaseLib|x64 {79F8DE42-595D-49D9-A66F-55244FD9DCC3}.RelWithDebInfo|x86.ActiveCfg = ReleaseLib|Win32 {79F8DE42-595D-49D9-A66F-55244FD9DCC3}.RelWithDebInfo|x86.Build.0 = ReleaseLib|Win32 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.Debug|x64.ActiveCfg = Debug|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.Debug|x64.Build.0 = Debug|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.Debug|x86.ActiveCfg = Debug|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.DebugLib_win32|x64.ActiveCfg = Debug|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.DebugLib_win32|x64.Build.0 = Debug|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.DebugLib_win32|x86.ActiveCfg = MinSizeRel|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.DebugLib_win32|x86.Build.0 = MinSizeRel|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.DebugLib|x64.ActiveCfg = Debug|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.DebugLib|x64.Build.0 = Debug|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.DebugLib|x86.ActiveCfg = MinSizeRel|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.DebugLib|x86.Build.0 = MinSizeRel|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.MinSizeRel|x86.ActiveCfg = MinSizeRel|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.Release|x64.ActiveCfg = Release|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.Release|x64.Build.0 = Release|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.Release|x86.ActiveCfg = Release|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.ReleaseLib_win32|x64.ActiveCfg = Release|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.ReleaseLib_win32|x64.Build.0 = Release|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.ReleaseLib_win32|x86.ActiveCfg = MinSizeRel|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.ReleaseLib_win32|x86.Build.0 = MinSizeRel|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.ReleaseLib|x64.ActiveCfg = Release|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.ReleaseLib|x64.Build.0 = Release|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.ReleaseLib|x86.ActiveCfg = MinSizeRel|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.ReleaseLib|x86.Build.0 = MinSizeRel|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 - {25AAE3D1-64FC-3F7F-A613-FD2946045822}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.Debug|x64.ActiveCfg = Debug|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.Debug|x64.Build.0 = Debug|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.Debug|x86.ActiveCfg = Debug|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.DebugLib_win32|x64.ActiveCfg = Debug|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.DebugLib_win32|x64.Build.0 = Debug|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.DebugLib_win32|x86.ActiveCfg = MinSizeRel|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.DebugLib_win32|x86.Build.0 = MinSizeRel|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.DebugLib|x64.ActiveCfg = Debug|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.DebugLib|x64.Build.0 = Debug|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.DebugLib|x86.ActiveCfg = MinSizeRel|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.DebugLib|x86.Build.0 = MinSizeRel|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.MinSizeRel|x86.ActiveCfg = MinSizeRel|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.Release|x64.ActiveCfg = Release|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.Release|x64.Build.0 = Release|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.Release|x86.ActiveCfg = Release|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.ReleaseLib_win32|x64.ActiveCfg = Release|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.ReleaseLib_win32|x64.Build.0 = Release|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.ReleaseLib_win32|x86.ActiveCfg = MinSizeRel|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.ReleaseLib_win32|x86.Build.0 = MinSizeRel|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.ReleaseLib|x64.ActiveCfg = Release|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.ReleaseLib|x64.Build.0 = Release|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.ReleaseLib|x86.ActiveCfg = MinSizeRel|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.ReleaseLib|x86.Build.0 = MinSizeRel|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 - {A9C7244C-3AD1-3E17-9345-72835807575F}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.Debug|x64.ActiveCfg = Debug|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.Debug|x64.Build.0 = Debug|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.Debug|x86.ActiveCfg = Debug|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.DebugLib_win32|x64.ActiveCfg = Debug|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.DebugLib_win32|x64.Build.0 = Debug|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.DebugLib_win32|x86.ActiveCfg = MinSizeRel|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.DebugLib_win32|x86.Build.0 = MinSizeRel|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.DebugLib|x64.ActiveCfg = Debug|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.DebugLib|x64.Build.0 = Debug|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.DebugLib|x86.ActiveCfg = MinSizeRel|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.DebugLib|x86.Build.0 = MinSizeRel|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.MinSizeRel|x86.ActiveCfg = MinSizeRel|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.Release|x64.ActiveCfg = Release|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.Release|x64.Build.0 = Release|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.Release|x86.ActiveCfg = Release|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.ReleaseLib_win32|x64.ActiveCfg = Release|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.ReleaseLib_win32|x64.Build.0 = Release|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.ReleaseLib_win32|x86.ActiveCfg = MinSizeRel|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.ReleaseLib_win32|x86.Build.0 = MinSizeRel|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.ReleaseLib|x64.ActiveCfg = Release|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.ReleaseLib|x64.Build.0 = Release|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.ReleaseLib|x86.ActiveCfg = MinSizeRel|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.ReleaseLib|x86.Build.0 = MinSizeRel|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {A604BA33-C1DB-34F6-8584-C429857717A8}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.Debug|x64.ActiveCfg = Debug|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.Debug|x64.Build.0 = Debug|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.Debug|x86.ActiveCfg = Debug|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.DebugLib_win32|x64.ActiveCfg = Debug|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.DebugLib_win32|x64.Build.0 = Debug|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.DebugLib_win32|x86.ActiveCfg = MinSizeRel|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.DebugLib_win32|x86.Build.0 = MinSizeRel|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.DebugLib|x64.ActiveCfg = Debug|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.DebugLib|x64.Build.0 = Debug|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.DebugLib|x86.ActiveCfg = MinSizeRel|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.DebugLib|x86.Build.0 = MinSizeRel|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.MinSizeRel|x86.ActiveCfg = MinSizeRel|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.Release|x64.ActiveCfg = Release|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.Release|x64.Build.0 = Release|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.Release|x86.ActiveCfg = Release|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.ReleaseLib_win32|x64.ActiveCfg = Release|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.ReleaseLib_win32|x64.Build.0 = Release|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.ReleaseLib_win32|x86.ActiveCfg = MinSizeRel|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.ReleaseLib_win32|x86.Build.0 = MinSizeRel|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.ReleaseLib|x64.ActiveCfg = Release|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.ReleaseLib|x64.Build.0 = Release|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.ReleaseLib|x86.ActiveCfg = MinSizeRel|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.ReleaseLib|x86.Build.0 = MinSizeRel|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {8C3AD0D4-A52C-3EFB-A2C6-04EA3AB5F00E}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64 {DBBFBC55-1C20-4D21-AE3B-6E8B14C4FE48}.Debug|x64.ActiveCfg = Debug|x64 {DBBFBC55-1C20-4D21-AE3B-6E8B14C4FE48}.Debug|x64.Build.0 = Debug|x64 {DBBFBC55-1C20-4D21-AE3B-6E8B14C4FE48}.Debug|x86.ActiveCfg = Debug|x64 diff --git a/ring-client-windows.vcxproj b/ring-client-windows.vcxproj index 422e664..dc472ce 100644 --- a/ring-client-windows.vcxproj +++ b/ring-client-windows.vcxproj @@ -226,6 +226,7 @@ <ClCompile Include="advancedsettingswidget.cpp" /> <ClCompile Include="advancedsipsettingwidget.cpp" /> <ClCompile Include="avatargraphicsview.cpp" /> + <ClCompile Include="banneditemwidget.cpp" /> <ClCompile Include="bannedlistmodel.cpp" /> <ClCompile Include="animationhelpers.cpp" /> <ClCompile Include="currentaccountcombobox.cpp" /> @@ -243,7 +244,16 @@ <Define Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;NIGHTLY_VERSION=20180706;ENABLE_AUTOUPDATE;QT_NO_DEBUG;NDEBUG</Define> </ClCompile> <ClCompile Include="deleteaccountdialog.cpp" /> + <ClCompile Include="deviceitemwidget.cpp" /> <ClCompile Include="globalsystemtray.cpp" /> + <ClCompile Include="iconbutton.cpp"> + <OutputFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName)\%(Filename).moc</OutputFile> + <DynamicSource Condition="'$(Configuration)|$(Platform)'=='Release|x64'">input</DynamicSource> + <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> + <OutputFile Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">.\GeneratedFiles\$(ConfigurationName)\%(Filename).moc</OutputFile> + <DynamicSource Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">input</DynamicSource> + <IncludePath Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> + </ClCompile> <ClCompile Include="idlabel.cpp" /> <ClCompile Include="bezierconnectorwidget.cpp"> <OutputFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName)\%(Filename).moc</OutputFile> @@ -256,7 +266,7 @@ <Define Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">COMPILE_ONLY;_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;ENABLE_AUTOUPDATE;QT_NO_DEBUG;NDEBUG</Define> </ClCompile> <ClCompile Include="invitebuttonswidget.cpp" /> - <ClCompile Include="linkdevwidget.cpp" /> + <ClCompile Include="linkdevicedialog.cpp" /> <ClCompile Include="main.cpp" /> <ClCompile Include="mainwindow.cpp" /> <ClCompile Include="messagewebpage.cpp" /> @@ -264,10 +274,9 @@ <ClCompile Include="navwidget.cpp" /> <ClCompile Include="newwizardwidget.cpp" /> <ClCompile Include="passworddialog.cpp" /> - <ClCompile Include="photoboothdialog.cpp" /> <ClCompile Include="photoboothwidget.cpp" /> <ClCompile Include="pixbufmanipulator.cpp" /> - <ClCompile Include="regnamedialog.cpp" /> + <ClCompile Include="nameregistrationdialog.cpp" /> <ClCompile Include="ringbutton.cpp" /> <ClCompile Include="ringcontactlineedit.cpp" /> <ClCompile Include="runguard.cpp" /> @@ -282,13 +291,12 @@ <Define Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;NIGHTLY_VERSION=20180706;ENABLE_AUTOUPDATE;QT_NO_DEBUG;NDEBUG</Define> <Define Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;NIGHTLY_VERSION=20180706;ENABLE_AUTOUPDATE;QT_NO_DEBUG;NDEBUG</Define> </ClCompile> - <ClCompile Include="setavatardialog.cpp" /> - <ClCompile Include="settingsitemwidget.cpp" /> <ClCompile Include="settingswidget.cpp" /> <ClCompile Include="smartlistselectorbuttonnotifier.cpp" /> <ClCompile Include="smartlistview.cpp" /> <ClCompile Include="conversationitemdelegate.cpp" /> <ClCompile Include="smartlistmodel.cpp" /> + <ClCompile Include="toggleswitch.cpp" /> <ClCompile Include="utils.cpp" /> <ClCompile Include="videooverlay.cpp" /> <ClCompile Include="videoview.cpp" /> @@ -324,8 +332,6 @@ </QtMoc> <QtMoc Include="navwidget.h"> </QtMoc> - <QtMoc Include="photoboothdialog.h"> - </QtMoc> <QtMoc Include="photoboothwidget.h"> </QtMoc> <QtMoc Include="invitebuttonswidget.h"> @@ -358,9 +364,10 @@ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName)\.;.\GeneratedFiles;.;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\lrc\src;$(ProjectDir)..\client-windows\winsparkle\include;$(ProjectDir)..\client-windows\qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release;$(QTDIR)\include\QtMultimedia;$(QTDIR)\include\QtMultimediaWidgets</IncludePath> <Define Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;NIGHTLY_VERSION=20180706;ENABLE_AUTOUPDATE;QT_NO_DEBUG;NDEBUG;QT_MULTIMEDIA_LIB;QT_MULTIMEDIAWIDGETS_LIB</Define> </QtMoc> - <QtMoc Include="linkdevwidget.h"> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName)\.;.\GeneratedFiles;.;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\lrc\src;$(ProjectDir)..\client-windows\winsparkle\include;$(ProjectDir)..\client-windows\qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release;$(QTDIR)\include\QtMultimedia;$(QTDIR)\include\QtMultimediaWidgets</IncludePath> + <QtMoc Include="linkdevicedialog.h"> + <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> <Define Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;NIGHTLY_VERSION=20180706;ENABLE_AUTOUPDATE;QT_NO_DEBUG;NDEBUG;QT_MULTIMEDIA_LIB;QT_MULTIMEDIAWIDGETS_LIB</Define> + <IncludePath Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> </QtMoc> <QtMoc Include="bezierconnectorwidget.h"> <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName)\.;.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> @@ -400,27 +407,32 @@ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> <IncludePath Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> </QtMoc> + <QtMoc Include="iconbutton.h"> + <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> + <IncludePath Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> + </QtMoc> + <QtMoc Include="deviceitemwidget.h"> + <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> + <IncludePath Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> + </QtMoc> + <QtMoc Include="banneditemwidget.h"> + <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> + <IncludePath Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> + </QtMoc> <ClInclude Include="pixbufmanipulator.h" /> <QtMoc Include="ringbutton.h"> </QtMoc> <QtMoc Include="ringcontactlineedit.h"> </QtMoc> - <QtMoc Include="regnamedialog.h"> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName)\.;.\GeneratedFiles;.;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\lrc\src;$(ProjectDir)..\client-windows\winsparkle\include;$(ProjectDir)..\client-windows\qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release;$(QTDIR)\include\QtMultimedia;$(QTDIR)\include\QtMultimediaWidgets</IncludePath> + <QtMoc Include="nameregistrationdialog.h"> + <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> <Define Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;NIGHTLY_VERSION=20180706;ENABLE_AUTOUPDATE;QT_NO_DEBUG;NDEBUG;QT_MULTIMEDIA_LIB;QT_MULTIMEDIAWIDGETS_LIB</Define> + <IncludePath Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> </QtMoc> <ClInclude Include="ringthemeutils.h" /> <QtMoc Include="selectareadialog.h"> </QtMoc> - <QtMoc Include="setavatardialog.h"> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName)\.;.\GeneratedFiles;.;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\lrc\src;$(ProjectDir)..\client-windows\winsparkle\include;$(ProjectDir)..\client-windows\qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> - <Define Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;NIGHTLY_VERSION=20180706;ENABLE_AUTOUPDATE;QT_NO_DEBUG;NDEBUG</Define> - </QtMoc> <ClInclude Include="runguard.h" /> - <ClInclude Include="settingsitemwidget.h"> - <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName)\.;.\GeneratedFiles;.;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\lrc\src;$(ProjectDir)..\client-windows\winsparkle\include;$(ProjectDir)..\client-windows\qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release;$(QTDIR)\include\QtMultimedia;$(QTDIR)\include\QtMultimediaWidgets</IncludePath> - <Define Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;NIGHTLY_VERSION=20180706;ENABLE_AUTOUPDATE;QT_NO_DEBUG;NDEBUG;QT_MULTIMEDIA_LIB;QT_MULTIMEDIAWIDGETS_LIB</Define> - </ClInclude> <ClInclude Include="settingskey.h" /> <QtMoc Include="smartlistview.h"> <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName)\.;.\GeneratedFiles;.;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\lrc\src;$(ProjectDir)..\client-windows\winsparkle\include;$(ProjectDir)..\client-windows\qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> @@ -458,6 +470,10 @@ <SubType>Designer</SubType> <IncludePath Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> </QtMoc> + <QtMoc Include="toggleswitch.h"> + <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> + <IncludePath Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">.\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;$(ProjectDir)..\ring-daemon\contrib\msvc\include;$(ProjectDir)..\daemon\contrib\msvc\include;$(ProjectDir)..\ring-lrc\src;$(ProjectDir)..\lrc\src;$(ProjectDir)winsparkle\include;$(ProjectDir)qrencode-win32\qrencode-win32;$(QTDIR)\include;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtWinExtras;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtXml;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWebEngineWidgets;$(QTDIR)\include\QtWebChannel;$(QTDIR)\include\QtCore;$(QTDIR)\mkspecs\win32-msvc;.\release</IncludePath> + </QtMoc> <ClInclude Include="utils.h" /> <QtMoc Include="videooverlay.h"> </QtMoc> @@ -487,7 +503,6 @@ <Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">release\moc_predefs.h;%(Outputs)</Outputs> </CustomBuild> <ClInclude Include="ui_aboutdialog.h" /> - <ClInclude Include="ui_bannedcontactswidget.h" /> <ClInclude Include="ui_callwidget.h" /> <ClInclude Include="ui_deleteaccountdialog.h" /> <ClInclude Include="ui_mainwindow.h" /> @@ -564,24 +579,26 @@ <QtUic Include="advancedsettingswidget.ui"> <SubType>Designer</SubType> </QtUic> - <QtUic Include="advancedsipsettingwidget.ui" /> - <QtUic Include="animatedoverlay.ui"> + <QtUic Include="advancedsipsettingwidget.ui"> <SubType>Designer</SubType> </QtUic> - <QtUic Include="bannedcontactswidget.ui"> + <QtUic Include="animatedoverlay.ui"> + <SubType>Designer</SubType> </QtUic> + <QtUic Include="banneditemwidget.ui" /> <QtUic Include="callwidget.ui"> <SubType>Designer</SubType> </QtUic> <QtUic Include="deleteaccountdialog.ui"> <SubType>Designer</SubType> </QtUic> - <QtUic Include="deviceeditwidget.ui" /> + <QtUic Include="deviceitemwidget.ui" /> <QtUic Include="invitebuttonswidget.ui" /> - <QtUic Include="linkdevwidget.ui" /> + <QtUic Include="linkdevicedialog.ui" /> <QtUic Include="mainwindow.ui"> <SubType>Designer</SubType> </QtUic> + <QtUic Include="nameregistrationdialog.ui" /> <QtUic Include="newwizardwidget.ui" /> <QtUic Include="passworddialog.ui"> <SubType>Designer</SubType> @@ -590,12 +607,8 @@ </QtUic> <QtUic Include="photoboothwidget.ui"> </QtUic> - <QtUic Include="regnamedialog.ui" /> <QtUic Include="ringbutton.ui"> </QtUic> - <QtUic Include="setavatardialog.ui"> - <SubType>Designer</SubType> - </QtUic> <QtUic Include="settingswidget.ui"> <SubType>Designer</SubType> </QtUic> diff --git a/ring-client-windows.vcxproj.filters b/ring-client-windows.vcxproj.filters index a8d370b..fe52850 100644 --- a/ring-client-windows.vcxproj.filters +++ b/ring-client-windows.vcxproj.filters @@ -81,9 +81,6 @@ <ClCompile Include="navwidget.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="photoboothdialog.cpp"> - <Filter>Source Files</Filter> - </ClCompile> <ClCompile Include="photoboothwidget.cpp"> <Filter>Source Files</Filter> </ClCompile> @@ -165,37 +162,43 @@ <ClCompile Include="advancedsettingswidget.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="setavatardialog.cpp"> + <ClCompile Include="avatargraphicsview.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="avatargraphicsview.cpp"> + <ClCompile Include="accountlistmodel.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="regnamedialog.cpp"> + <ClCompile Include="bannedlistmodel.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="accountlistmodel.cpp"> + <ClCompile Include="newwizardwidget.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="bannedlistmodel.cpp"> + <ClCompile Include="runguard.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="settingsitemwidget.cpp"> + <ClCompile Include="bezierconnectorwidget.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="linkdevwidget.cpp"> + <ClCompile Include="advancedsipsettingwidget.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="newwizardwidget.cpp"> + <ClCompile Include="nameregistrationdialog.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="runguard.cpp"> + <ClCompile Include="toggleswitch.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="bezierconnectorwidget.cpp"> + <ClCompile Include="iconbutton.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="advancedsipsettingwidget.cpp"> + <ClCompile Include="deviceitemwidget.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="banneditemwidget.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="linkdevicedialog.cpp"> <Filter>Source Files</Filter> </ClCompile> </ItemGroup> @@ -221,9 +224,6 @@ <QtMoc Include="navwidget.h"> <Filter>Header Files</Filter> </QtMoc> - <QtMoc Include="photoboothdialog.h"> - <Filter>Header Files</Filter> - </QtMoc> <QtMoc Include="photoboothwidget.h"> <Filter>Header Files</Filter> </QtMoc> @@ -302,21 +302,12 @@ <QtMoc Include="advancedsettingswidget.h"> <Filter>Header Files</Filter> </QtMoc> - <QtMoc Include="setavatardialog.h"> - <Filter>Header Files</Filter> - </QtMoc> <QtMoc Include="avatargraphicsview.h"> <Filter>Header Files</Filter> </QtMoc> - <QtMoc Include="regnamedialog.h"> - <Filter>Header Files</Filter> - </QtMoc> <QtMoc Include="bannedlistmodel.h"> <Filter>Header Files</Filter> </QtMoc> - <QtMoc Include="linkdevwidget.h"> - <Filter>Header Files</Filter> - </QtMoc> <QtMoc Include="newwizardwidget.h"> <Filter>Header Files</Filter> </QtMoc> @@ -332,6 +323,24 @@ <QtMoc Include="settingswidget.h"> <Filter>Header Files</Filter> </QtMoc> + <QtMoc Include="nameregistrationdialog.h"> + <Filter>Header Files</Filter> + </QtMoc> + <QtMoc Include="toggleswitch.h"> + <Filter>Header Files</Filter> + </QtMoc> + <QtMoc Include="iconbutton.h"> + <Filter>Header Files</Filter> + </QtMoc> + <QtMoc Include="deviceitemwidget.h"> + <Filter>Header Files</Filter> + </QtMoc> + <QtMoc Include="banneditemwidget.h"> + <Filter>Header Files</Filter> + </QtMoc> + <QtMoc Include="linkdevicedialog.h"> + <Filter>Header Files</Filter> + </QtMoc> </ItemGroup> <ItemGroup> <CustomBuild Include="debug\moc_predefs.h.cbt"> @@ -343,9 +352,6 @@ <ClInclude Include="ui_aboutdialog.h"> <Filter>Generated Files</Filter> </ClInclude> - <ClInclude Include="ui_bannedcontactswidget.h"> - <Filter>Generated Files</Filter> - </ClInclude> <ClInclude Include="ui_callwidget.h"> <Filter>Generated Files</Filter> </ClInclude> @@ -554,9 +560,6 @@ <QtUic Include="aboutdialog.ui"> <Filter>Form Files</Filter> </QtUic> - <QtUic Include="bannedcontactswidget.ui"> - <Filter>Form Files</Filter> - </QtUic> <QtUic Include="callwidget.ui"> <Filter>Form Files</Filter> </QtUic> @@ -593,25 +596,25 @@ <QtUic Include="advancedsettingswidget.ui"> <Filter>Form Files</Filter> </QtUic> - <QtUic Include="setavatardialog.ui"> + <QtUic Include="animatedoverlay.ui"> <Filter>Form Files</Filter> </QtUic> - <QtUic Include="animatedoverlay.ui"> + <QtUic Include="newwizardwidget.ui"> <Filter>Form Files</Filter> </QtUic> - <QtUic Include="regnamedialog.ui"> + <QtUic Include="advancedsipsettingwidget.ui"> <Filter>Form Files</Filter> </QtUic> - <QtUic Include="deviceeditwidget.ui"> + <QtUic Include="nameregistrationdialog.ui"> <Filter>Form Files</Filter> </QtUic> - <QtUic Include="linkdevwidget.ui"> + <QtUic Include="deviceitemwidget.ui"> <Filter>Form Files</Filter> </QtUic> - <QtUic Include="newwizardwidget.ui"> + <QtUic Include="banneditemwidget.ui"> <Filter>Form Files</Filter> </QtUic> - <QtUic Include="advancedsipsettingwidget.ui"> + <QtUic Include="linkdevicedialog.ui"> <Filter>Form Files</Filter> </QtUic> </ItemGroup> @@ -756,9 +759,6 @@ <ResourceCompile Include="ico.rc" /> </ItemGroup> <ItemGroup> - <ClInclude Include="settingsitemwidget.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="webchathelpers.h"> <Filter>Header Files</Filter> </ClInclude> diff --git a/setavatardialog.cpp b/setavatardialog.cpp deleted file mode 100644 index aa2d8d9..0000000 --- a/setavatardialog.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/************************************************************************** -* Copyright (C) 2019-2019 by Savoir-faire Linux * -* Author: Isa Nanic <isa.nanic@savoirfairelinux.com> * -* * -* 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 <https://www.gnu.org/licenses/>. * -**************************************************************************/ - -#include <QtMultimedia/QCameraInfo> -#include <QFileDialog> -#include <QAbstractScrollArea> -#include <QScreen> -#include <QWindow> -#include <QtMultimedia/QCameraImageCapture> -#include <QBuffer> -#include <QStandardPaths> - -#include "setavatardialog.h" -#include "ui_setavatardialog.h" - -#include "lrcinstance.h" -#include "accountlistmodel.h" -#include "currentaccountcombobox.h" - -SetAvatarDialog::SetAvatarDialog(QWidget* parent) - : QDialog(parent), - ui(new Ui::SetAvatarDialog), - videoWidget_(new QCameraViewfinder(this)), - camera_(new QCamera) -{ - ui->setupUi(this); - - connect(ui->cancelButton, &QPushButton::clicked, [&]() { - done(0); - } - ); - - connect(ui->saveButton, &QPushButton::clicked, this, &SetAvatarDialog::saveAvatar); - - connect(ui->selectFileButton, &QPushButton::clicked, this, &SetAvatarDialog::openFileManager); - - connect(ui->takePictureButton, &QPushButton::clicked, this, &SetAvatarDialog::captureImage); - - connect(ui->cameraButton, &QPushButton::clicked, this, &SetAvatarDialog::pictureMode); - - ui->graphicsView->setAvatarSize(avatarSize_); - - videoWidget_->setGeometry(ui->graphicsView->x(), ui->graphicsView->y(), - ui->graphicsView->width(), ui->graphicsView->height()); - - pictureMode(); - startCamera(); - - ui->horizontalLayout_2->update(); -} - -SetAvatarDialog::~SetAvatarDialog() -{ - disconnect(this); - delete mediaPlayer_; - delete videoWidget_; - delete imageCapture_; - delete camera_; - delete ui; -} - -void -SetAvatarDialog::startCamera() -{ - imageCapture_ = new QCameraImageCapture(camera_, this); - camera_->setCaptureMode(QCamera::CaptureViewfinder); - connect(imageCapture_, SIGNAL(imageSaved(int, const QString&)), - this, SLOT(imageCaptureSlot(int, const QString&))); -} - -bool -SetAvatarDialog::checkCamAvailable() -{ - if (QCameraInfo::availableCameras().count() > 0) { - return true; - } - else { - return false; - } -} - -// no support yet for back-facing camera [todo]; no support for portrait mode [todo] -void -SetAvatarDialog::pictureMode() -{ - if (checkCamAvailable()) { - camera_ = new QCamera(QCamera::FrontFace); - camera_->setViewfinder(videoWidget_); - - ui->graphicsView->hide(); - videoWidget_->show(); - - camera_->start(); - - ui->saveButton->hide(); - ui->cameraButton->hide(); - - ui->takePictureButton->show(); - ui->selectFileButton->show(); - } - else { - openFileManager(); // no camera detected so open file manager - } -} - -void -SetAvatarDialog::editMode() -{ - camera_->unlock(); - camera_->stop(); - - ui->takePictureButton->hide(); - - ui->saveButton->show(); - ui->cameraButton->show(); - ui->selectFileButton->show(); - - videoWidget_->hide(); - ui->graphicsView->show(); - configureAvatarScene(rawPixmap_); -} - -void -SetAvatarDialog::openFileManager() -{ - auto picturesDir = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).first(); - rawPixmap_.load(QFileDialog::getOpenFileName(this, - tr("Open Image"), picturesDir, tr("Image Files (*.jpg *.jpeg *.png *.bmp)"))); - editMode(); -} - -void -SetAvatarDialog::configureAvatarScene(const QPixmap& pixMap) -{ - if (!pixMap.isNull()) { - const int margin = 8; - QPen pen; - pen.setStyle(Qt::NoPen); - - graphicsScene_.clear(); - - graphicsScene_.addPixmap(pixMap); - graphicsScene_.addRect(-(pixMap.width()*margin - avatarSize_) / 2, - -(pixMap.height() * margin - avatarSize_) / 2, pixMap.width() * margin, pixMap.height() * margin, pen, QBrush()); - ui->graphicsView->setScene(&graphicsScene_); - } -} - -void -SetAvatarDialog::captureImage() -{ - startCamera(); - - camera_->setCaptureMode(QCamera::CaptureStillImage); - imageCapture_->setCaptureDestination(QCameraImageCapture::CaptureToFile); - - if (imageCapture_->isCaptureDestinationSupported(QCameraImageCapture::CaptureToFile)) { - camera_->searchAndLock(); - camera_->start(); - imageCapture_->capture(); - } -} - -// save avatar image and exit SetAvatarDialog -void -SetAvatarDialog::saveAvatar() -{ - avatarSize_ *= 2; - - QRect avatarRect((ui->graphicsView->width() - avatarSize_)/2 + ui->graphicsView->x(), (ui->graphicsView->height() - avatarSize_)/2 + ui->graphicsView->y(), - avatarSize_, avatarSize_); - - QRegion avatarRegion(avatarRect.x() - ui->graphicsView->x(), avatarRect.y() - ui->graphicsView->y(), - avatarSize_, avatarSize_, QRegion::Ellipse); - ui->graphicsView->setMask(avatarRegion); - - finalAvatarPixmap_ = grab(avatarRect); - - done(0); -} - -void -SetAvatarDialog::done(int exCode) -{ - QDialog::done(exCode); - if (!finalAvatarPixmap_.isNull()) { - QByteArray ba; - QBuffer bu(&ba); - finalAvatarPixmap_.save(&bu, "PNG"); - emit pixmapSignal(ba.toBase64().toStdString()); - } - else { - emit pixmapSignal(std::string()); - } - camera_->unlock(); - camera_->stop(); -} - -void -SetAvatarDialog::imageCaptureSlot(int useless, const QString& text) -{ - Q_UNUSED(useless); - - rawPixmap_ = rawPixmap_.fromImage(QImage(text)); - - if (!rawPixmap_.isNull()){ - editMode(); - } - QFile file(text); - file.remove(); // erase file -} diff --git a/setavatardialog.h b/setavatardialog.h deleted file mode 100644 index b0e5c6e..0000000 --- a/setavatardialog.h +++ /dev/null @@ -1,82 +0,0 @@ -/************************************************************************** -* Copyright (C) 2019-2019 by Savoir-faire Linux * -* Author: Isa Nanic <isa.nanic@savoirfairelinux.com> * -* * -* 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 <https://www.gnu.org/licenses/>. * -**************************************************************************/ - -#pragma once - -#include <QPushButton> - -#include <QAction> -#include <QDialog> -#include <QRegion> -#include <QtMultimedia/QCamera> -#include <QGraphicsScene> -#include <QtMultimedia/QMediaPlayer> -#include <QtMultimedia/QCameraImageCapture> -#include <QtMultimediaWidgets/QCameraViewfinder> -#include <QtMultimedia/QCameraImageCapture> - - -#include "accountlistmodel.h" -#include "avatargraphicsview.h" -#include "settingswidget.h" - -namespace Ui { - class SetAvatarDialog; -} - -class SetAvatarDialog : public QDialog -{ - Q_OBJECT - SetAvatarDialog(const SetAvatarDialog& cpy); - -public: - SetAvatarDialog(QWidget* parent = nullptr); - ~SetAvatarDialog(); - -signals: - void pixmapSignal(const std::string& avatarInBase64String); - -private slots: - void done(int exCode); - void imageCaptureSlot(int useless, const QString& text); - void pictureMode(); - void captureImage(); - void openFileManager(); - void saveAvatar(); - -private: - Ui::SetAvatarDialog* ui; - void startCamera(); - - void configureAvatarScene(const QPixmap& pixMap); - void editMode(); - - bool checkCamAvailable(); - - int avatarSize_ = 130; - - QMediaPlayer* mediaPlayer_; - - QCameraViewfinder* videoWidget_; - QCameraImageCapture* imageCapture_; - QCamera* camera_; - QGraphicsScene graphicsScene_; - - QPixmap rawPixmap_; - QPixmap finalAvatarPixmap_; -}; \ No newline at end of file diff --git a/setavatardialog.ui b/setavatardialog.ui deleted file mode 100644 index 0458b7a..0000000 --- a/setavatardialog.ui +++ /dev/null @@ -1,226 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>SetAvatarDialog</class> - <widget class="QDialog" name="SetAvatarDialog"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>530</width> - <height>373</height> - </rect> - </property> - <property name="minimumSize"> - <size> - <width>530</width> - <height>373</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>530</width> - <height>373</height> - </size> - </property> - <property name="baseSize"> - <size> - <width>800</width> - <height>590</height> - </size> - </property> - <property name="windowTitle"> - <string>Change Your Avatar Image</string> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,0,1"> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="AvatarGraphicsView" name="graphicsView" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>500</width> - <height>300</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> - </property> - <property name="cursor"> - <cursorShape>CrossCursor</cursorShape> - </property> - <property name="mouseTracking"> - <bool>true</bool> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>5</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="spacing"> - <number>10</number> - </property> - <item> - <widget class="QPushButton" name="saveButton"> - <property name="minimumSize"> - <size> - <width>80</width> - <height>30</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">background: rgb(245, 245, 245); border: 0px; border-radius: 3px;</string> - </property> - <property name="text"> - <string>Save</string> - </property> - <property name="flat"> - <bool>false</bool> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="takePictureButton"> - <property name="minimumSize"> - <size> - <width>80</width> - <height>30</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">background: rgb(245, 245, 245); border: 0px; border-radius: 3px;</string> - </property> - <property name="text"> - <string>Take Picture</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="cameraButton"> - <property name="minimumSize"> - <size> - <width>80</width> - <height>30</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">background: rgb(245, 245, 245); border: 0px; border-radius: 3px;</string> - </property> - <property name="text"> - <string>Camera</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="selectFileButton"> - <property name="minimumSize"> - <size> - <width>80</width> - <height>30</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">background: rgb(245, 245, 245); border: 0px; border-radius: 3px;</string> - </property> - <property name="text"> - <string>Select A File</string> - </property> - <property name="flat"> - <bool>false</bool> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="cancelButton"> - <property name="minimumSize"> - <size> - <width>80</width> - <height>30</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">background: rgb(245, 245, 245); border: 0px; border-radius: 3px;</string> - </property> - <property name="text"> - <string>Cancel</string> - </property> - <property name="flat"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>AvatarGraphicsView</class> - <extends>QWidget</extends> - <header>avatargraphicsview.h</header> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> diff --git a/settingsitemwidget.cpp b/settingsitemwidget.cpp deleted file mode 100644 index 06fde4f..0000000 --- a/settingsitemwidget.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2018-2019 Savoir-faire Linux Inc. * - * Author: Isa Nanic <isa.nanic@savoirfairelinux.com> * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library 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 * - * Lesser 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 <https://www.gnu.org/licenses/>. * - ***************************************************************************/ - -#include "settingsitemwidget.h" - -#include "lrcinstance.h" -#include "api/newdevicemodel.h" -#include "ringthemeutils.h" - -SettingsItemWidget::SettingsItemWidget(int height, int index, bool banned, QListWidget* parent) - : QListWidgetItem(parent), - banned_(banned), - index_(index), - height_(height), - nameEdit_(new QLineEdit(parent)), - idlabel_(new QLabel(parent)), - button_(new QPushButton(parent)) -{ - setFlags(Qt::NoItemFlags); - // for all items: - button_->setGeometry(parent->width() - 50, verMargin_ + height_ * index_, 30, 36); - nameEdit_->setStyleSheet("border: 0px; border-radius: 3px; background: transparent;"); - idlabel_->setStyleSheet("border: 0px; border-radius: 3px; background: transparent;"); - button_->setStyleSheet("border: 0px; border-radius: 3px; background: transparent;"); - button_->setIconSize(QSize(22, 22)); - - nameEdit_->setGeometry(horMargin_, verMargin_ + height_ * index_, 300, 22); - nameEdit_->setReadOnly(true); - - idlabel_->setGeometry(horMargin_, verMargin_ + 20 + height_ * index_, 400, 22); - idlabel_->setTextInteractionFlags(Qt::NoTextInteraction); - - // end all items - - if (index_ % 2) { - setBackgroundColor(Qt::white); - } - else { - setBackgroundColor(RingTheme::smartlistHighlight_); - } - - if (!banned_) { // populate the device list - auto deviceList = LRCInstance::getCurrentAccountInfo().deviceModel->getAllDevices(); - auto it = deviceList.begin(); - std::advance(it, index_); - - nameEdit_->setText(QString::fromStdString(it->name)); - idlabel_->setText(QString::fromStdString(it->id)); - - if (!index_) { - button_->setIcon(QPixmap(":/images/icons/round-edit-24px.svg")); - button_->setToolTip(QObject::tr("Edit Device Name")); - - QObject::connect(button_, &QPushButton::pressed, [this]() { toggleEditable(); }); - } - else { - button_->setIcon(QPixmap(":/images/icons/round-remove_circle-24px.svg")); - button_->setToolTip(QObject::tr("Unlink Device From Account")); - } - nameEdit_->show(); - idlabel_->show(); - button_->show(); - } - else { // populate the banned contacts list - auto bannedContactList = LRCInstance::getCurrentAccountInfo().contactModel->getBannedContacts(); - auto it = bannedContactList.begin(); - std::advance(it, index_); - - auto contactInfo = LRCInstance::getCurrentAccountInfo().contactModel->getContact(*it); - - nameEdit_->setText(QString::fromStdString(contactInfo.registeredName)); - idlabel_->setText(QString::fromStdString(contactInfo.profileInfo.uri)); - button_->setIcon(QPixmap(":/images/icons/round-undo-24px.svg")); - button_->setToolTip(QObject::tr("Unblock Contact")); - - nameEdit_->show(); - idlabel_->show(); - button_->show(); - } - - QObject::connect(nameEdit_, &QLineEdit::editingFinished, [this]() { finishEdit(); }); -} - -SettingsItemWidget::~SettingsItemWidget() -{ - delete nameEdit_; - delete idlabel_; - delete button_; -} - -void -SettingsItemWidget::toggleEditable() -{ - if (!editable_) { - nameEdit_->setReadOnly(false); - nameEdit_->setStyleSheet("border: 0px; border-radius: 3px; background: white;"); - nameEdit_->setFocus(); - button_->setIcon(QPixmap(":/images/icons/round-save_alt-24px.svg")); - } - else { - finishEdit(); - } - editable_ =! editable_; -} - -void -SettingsItemWidget::finishEdit() -{ - if (!index_) { - nameEdit_->setReadOnly(true); - nameEdit_->setStyleSheet("border: 0px; border-radius: 3px; background: transparent;"); - button_->setIcon(QPixmap(":/images/icons/round-edit-24px.svg")); - - auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); - confProps.deviceName = nameEdit_->text().toStdString(); - LRCInstance::editableAccountModel()->setAccountConfig(LRCInstance::getCurrAccId(), confProps); - } -} diff --git a/settingsitemwidget.h b/settingsitemwidget.h deleted file mode 100644 index d5985a6..0000000 --- a/settingsitemwidget.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2018-2019 Savoir-faire Linux Inc. * - * Author: Isa Nanic <isa.nanic@savoirfairelinux.com> * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library 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 * - * Lesser 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 <http://www.gnu.org/licenses/>. * - ***************************************************************************/ -#include <QListWidgetItem> -#include <QLineEdit> -#include <QLabel> -#include <QPushButton> - - - -class SettingsItemWidget : public QListWidgetItem -{ -public: - SettingsItemWidget(int height, int index, bool banned, QListWidget* parent = nullptr); - ~SettingsItemWidget(); - - QPushButton* button_; - -private: - bool selected_ = false; - bool banned_ = false; - const int index_; - const int height_; - - const int horMargin_ = 15; - const int verMargin_ = 8; - - QLineEdit* nameEdit_; - QLabel* idlabel_; - - void toggleEditable(); - void finishEdit(); - - bool editable_ = false; -}; - diff --git a/settingskey.h b/settingskey.h index fdd820e..f417e1f 100644 --- a/settingskey.h +++ b/settingskey.h @@ -21,15 +21,10 @@ namespace SettingsKey { constexpr static char closeOrMinimized[] = "closeOrMin"; -constexpr static char autoAnswer[] = "autoAnswer"; -constexpr static char geometry[] = "geometry"; -constexpr static char windowState[] = "windowState"; +constexpr static char downloadPath[] = "downloadPath"; constexpr static char enableNotifications[] = "enableNotifications"; +constexpr static char geometry[] = "geometry"; constexpr static char selectedAccount[] = "selectedAccount"; constexpr static char mainSplitterState[] = "mainSplitterState"; -constexpr static char downloadPath[] = "downloadPath"; +constexpr static char windowState[] = "windowState"; } - -#define accountAutoAnswer(A) (A+SettingsKey::autoAnswer) - - diff --git a/settingswidget.cpp b/settingswidget.cpp index 9d83be8..ea65874 100644 --- a/settingswidget.cpp +++ b/settingswidget.cpp @@ -24,135 +24,141 @@ #include "settingswidget.h" #include "ui_settingswidget.h" -#include <QPixmap> -#include <QTimer> -#include <QModelIndex> #include <QFileDialog> #include <QInputDialog> -#include <QStandardPaths> #include <QMessageBox> -#include <QSettings> +#include <QModelIndex> +#include <QPixmap> #include <QScrollBar> +#include <QSettings> +#include <QStandardPaths> +#include <QTimer> +#include <QtConcurrent/QtConcurrent> +#include "deleteaccountdialog.h" +#include "passworddialog.h" +#include "nameregistrationdialog.h" #include "settingskey.h" #include "utils.h" -#include "settingsitemwidget.h" -#include "passworddialog.h" -#include "regnamedialog.h" -#include "setavatardialog.h" -#include "deleteaccountdialog.h" +#include "deviceitemwidget.h" +#include "banneditemwidget.h" #include "api/newdevicemodel.h" -#include "media/recordingmodel.h" -#include "audio/settings.h" -#include "audio/outputdevicemodel.h" #include "audio/inputdevicemodel.h" -#include "video/devicemodel.h" +#include "audio/outputdevicemodel.h" +#include "audio/settings.h" +#include "callmodel.h" +#include "media/recordingmodel.h" #include "video/channel.h" -#include "video/resolution.h" -#include "video/rate.h" +#include "video/devicemodel.h" #include "video/previewmanager.h" -#include "callmodel.h" +#include "video/rate.h" +#include "video/resolution.h" #ifdef Q_OS_WIN #include "winsparkle.h" #endif SettingsWidget::SettingsWidget(QWidget* parent) - : NavWidget(parent), - ui(new Ui::SettingsWidget), - scrollArea_(new QScrollArea(this)), - scrollSIPArea_(new QScrollArea(this)), - deviceModel_(&Video::DeviceModel::instance()), - gif(new QMovie(":/images/ajax-loader.gif")) + : NavWidget(parent) + , ui(new Ui::SettingsWidget) + , scrollArea_(new QScrollArea(this)) + , scrollSIPArea_(new QScrollArea(this)) + , deviceModel_(&Video::DeviceModel::instance()) { ui->setupUi(this); + ui->accountSettingsButton->setPixmap(QPixmap(":/images/icons/baseline-people-24px.svg")); + ui->generalSettingsButton->setPixmap(QPixmap(":/images/icons/round-settings-24px.svg")); + ui->mediaSettingsButton->setPixmap(QPixmap(":/images/icons/baseline-desktop_windows-24px.svg")); + ui->accountSettingsButton->setChecked(true); ui->btnExitSettings->setIconSize(QSize(24, 24)); - ui->btnExitSettings->setIcon(QPixmap(":/images/icons/round-close-24px.svg")); + ui->btnExitSettings->setIcon(QIcon(":/images/icons/round-close-24px.svg")); - //Show hide button - QPixmap pixmap(":/images/icons/showHide.PNG"); - ui->showhideButton->setIcon(QIcon(pixmap)); - ui->showhideButton->setIconSize(pixmap.rect().size()); + // avatar + avatarSize_ = 224; - //Show Password + /////////////////////////////////////////////////////////////////////////// + // SIP + /////////////////////////////////////////////////////////////////////////// + + // Show Password ui->passSIPlineEdit->setEchoMode(QLineEdit::Password); - //display name SIP + // display name SIP ui->displaySIPNameLineEdit->setAlignment(Qt::AlignHCenter); + ui->displaySIPNameLineEdit->setPlaceholderText(tr("Enter an alias")); - //SIP User Name + // SIP User Name ui->usernameSIP->setStyleSheet("border : 0px;"); - //SIP Advanced Setting initilization - ui->advancedAccountSettingsSIPButton->setIcon(QPixmap(":/images/icons/round-arrow_drop_down-24px.svg")); - - //SIP Avatar - avatarSIPSize_ = ui->currentSIPAccountAvatar->width(); - ui->currentSIPAccountAvatar->setIconSize(QSize(avatarSIPSize_, avatarSIPSize_)); - QRegion avatarSIPClickableRegion(-1, -1, - ui->currentSIPAccountAvatar->width() + 2, ui->currentSIPAccountAvatar->height() + 2, QRegion::Ellipse); - ui->currentSIPAccountAvatar->setMask(avatarSIPClickableRegion); + // SIP Advanced Setting initilization + ui->advancedAccountSettingsSIPButton->setIcon(QIcon(":/images/icons/round-arrow_drop_down-24px.svg")); ui->scrollSIPArea->verticalScrollBar()->setEnabled(true); ui->scrollSIPArea->verticalScrollBar()->setStyleSheet("QScrollBar:vertical { width: 10px; }"); ui->advancedSIPSettingsWidget->setVisible(false); + /////////////////////////////////////////////////////////////////////////// + // Jami + /////////////////////////////////////////////////////////////////////////// + // display name (aka alias) ui->displayNameLineEdit->setAlignment(Qt::AlignHCenter); - ui->displayNameLineEdit->setPlaceholderText(tr("Enter the displayed name")); + ui->displayNameLineEdit->setPlaceholderText(tr("Enter an alias")); ui->currentRegisteredID->setReadOnly(true); ui->currentRegisteredID->setStyleSheet("border : 0px;"); ui->currentRingID->setReadOnly(true); - //Ring Avatar - avatarSize_ = ui->currentAccountAvatar->width(); - - ui->currentAccountAvatar->setIconSize(QSize(avatarSize_, avatarSize_)); - - // create ellipse-selectable avatar image - QRegion avatarClickableRegion(-1, -1, - ui->currentAccountAvatar->width() + 2, ui->currentAccountAvatar->height() + 2, QRegion::Ellipse); - ui->currentAccountAvatar->setMask(avatarClickableRegion); - - ui->advancedAccountSettingsPButton->setIcon(QPixmap(":/images/icons/round-arrow_drop_down-24px.svg")); - ui->linkDevPushButton->setIcon(QPixmap(":/images/icons/round-add-24px.svg")); - ui->blockedContactsBtn->setIcon(QPixmap(":/images/icons/round-arrow_drop_up-24px.svg")); + ui->advancedAccountSettingsPButton->setIcon(QIcon(":/images/icons/round-arrow_drop_down-24px.svg")); + ui->advancedAccountSettingsPButton->setIconSize(QSize(32, 32)); + ui->linkDevPushButton->setIcon(QIcon(":/images/icons/round-add-24px.svg")); + ui->bannedContactsBtn->setIcon(QIcon(":/images/icons/round-arrow_drop_down-24px.svg")); ui->scrollArea->verticalScrollBar()->setEnabled(true); ui->scrollArea->verticalScrollBar()->setStyleSheet("QScrollBar:vertical { width: 10px; }"); ui->advancedSettingsWidget->setVisible(false); - auto accountList = LRCInstance::accountModel().getAccountList(); + statusSuccessPixmap_ = Utils::generateTintedPixmap(":/images/icons/baseline-done-24px.svg", RingTheme::presenceGreen_); + statusInvalidPixmap_ = Utils::generateTintedPixmap(":/images/icons/baseline-error_outline-24px.svg", RingTheme::urgentOrange_); + statusErrorPixmap_ = Utils::generateTintedPixmap(":/images/icons/baseline-close-24px.svg", RingTheme::red_); + + lookupSpinnerMovie_ = new QMovie(":/images/jami_rolling_spinner.gif"); + lookupSpinnerMovie_->setScaledSize(QSize(30, 30)); + + ui->lookupStatusLabel->setMovie(lookupSpinnerMovie_); + ui->lookupStatusLabel->hide(); ui->containerWidget->setVisible(false); } -void -SettingsWidget::slotAccountOnBoarded() +void SettingsWidget::slotAccountOnBoarded() { setSelected(Button::accountSettingsButton); setConnections(); } -void -SettingsWidget::navigated(bool to) +void SettingsWidget::navigated(bool to) { ui->containerWidget->setVisible(to); + if (to) { + setSelected(Button::accountSettingsButton); + updateAccountInfoDisplayed(); + // hide banned list + ui->bannedContactsListWidget->setVisible(false); + } } void SettingsWidget::updateCustomUI() { } -void -SettingsWidget::leaveSettingsSlot() +void SettingsWidget::leaveSettingsSlot() { if (advancedSettingsDropped_) { toggleAdvancedSettings(); @@ -162,7 +168,11 @@ SettingsWidget::leaveSettingsSlot() toggleAdvancedSIPSettings(); } - Video::PreviewManager::instance().stopPreview(); + QtConcurrent::run( + [this] { + ui->currentAccountAvatar->stopBooth(); + Video::PreviewManager::instance().stopPreview(); + }); emit NavigationRequested(ScreenEnum::CallScreen); } @@ -172,28 +182,14 @@ SettingsWidget::~SettingsWidget() delete ui; } -// called at every callwidget -> settingsWidget navigation -void -SettingsWidget::updateSettings(int size) -{ - setSelected(Button::accountSettingsButton); - resize(size); - updateAccountInfoDisplayed(); -} - -void -SettingsWidget::resize(int size) -{ - ui->rightSettingsWidget->setGeometry(size, 0, this->width() - size, this->height()); - ui->accountSettingsButton->setFixedWidth(size); -} - -void -SettingsWidget::setSelected(Button sel) +void SettingsWidget::setSelected(Button sel) { switch (sel) { case Button::accountSettingsButton: - Video::PreviewManager::instance().stopPreview(); + QtConcurrent::run( + [this] { + Video::PreviewManager::instance().stopPreview(); + }); if (LRCInstance::getCurrentAccountInfo().profileInfo.type == lrc::api::profile::Type::SIP) { ui->stackedWidget->setCurrentWidget(ui->currentSIPAccountSettingsScrollWidget); @@ -217,19 +213,22 @@ SettingsWidget::setSelected(Button sel) } ui->accountSettingsButton->setChecked(true); - ui->avSettingsButton->setChecked(false); + ui->mediaSettingsButton->setChecked(false); break; } case Button::generalSettingsButton: - Video::PreviewManager::instance().stopPreview(); + QtConcurrent::run( + [this] { + Video::PreviewManager::instance().stopPreview(); + }); ui->stackedWidget->setCurrentWidget(ui->generalSettings); populateGeneralSettings(); - if (pastButton_ == Button::avSettingsButton) { + if (pastButton_ == Button::mediaSettingsButton) { ui->generalSettingsButton->setChecked(true); - ui->avSettingsButton->setChecked(false); + ui->mediaSettingsButton->setChecked(false); break; } else { @@ -238,17 +237,17 @@ SettingsWidget::setSelected(Button sel) break; } - case Button::avSettingsButton: + case Button::mediaSettingsButton: ui->stackedWidget->setCurrentWidget(ui->avSettings); populateAVSettings(); if (pastButton_ == Button::accountSettingsButton) { - ui->avSettingsButton->setChecked(true); + ui->mediaSettingsButton->setChecked(true); ui->accountSettingsButton->setChecked(false); break; } else { - ui->avSettingsButton->setChecked(true); + ui->mediaSettingsButton->setChecked(true); ui->generalSettingsButton->setChecked(false); break; } @@ -258,177 +257,127 @@ SettingsWidget::setSelected(Button sel) } // called to update current settings information when navigating to settingsWidget -void -SettingsWidget::updateAccountInfoDisplayed() +void SettingsWidget::updateAccountInfoDisplayed() { - ui->usernameSIP->setText(QString::fromStdString( (LRCInstance::getCurrentAccountInfo().accountModel->getAccountConfig(LRCInstance::getCurrentAccountInfo().id)).username )); - ui->hostnameSIP->setText(QString::fromStdString( (LRCInstance::getCurrentAccountInfo().accountModel->getAccountConfig(LRCInstance::getCurrentAccountInfo().id)).hostname )); - ui->passSIPlineEdit->setText(QString::fromStdString((LRCInstance::getCurrentAccountInfo().accountModel->getAccountConfig(LRCInstance::getCurrentAccountInfo().id)).password )); - ui->ProxySIP->setText(QString::fromStdString((LRCInstance::getCurrentAccountInfo().accountModel->getAccountConfig(LRCInstance::getCurrentAccountInfo().id)).proxyServer)); + auto& accInfo = LRCInstance::getCurrentAccountInfo(); + auto accConfig = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); + + ui->usernameSIP->setText(QString::fromStdString(accConfig.username)); + ui->hostnameSIP->setText(QString::fromStdString(accConfig.hostname)); + ui->passSIPlineEdit->setText(QString::fromStdString(accConfig.password)); + ui->ProxySIP->setText(QString::fromStdString(accConfig.proxyServer)); - ui->currentRegisteredID->setText(QString::fromStdString(LRCInstance::getCurrentAccountInfo().registeredName)); - ui->currentRingID->setText(QString::fromStdString(LRCInstance::getCurrentAccountInfo().profileInfo.uri)); + ui->currentRegisteredID->setText(QString::fromStdString(accInfo.registeredName)); + ui->currentRingID->setText(QString::fromStdString(accInfo.profileInfo.uri)); // if no registered name is found for account - if (LRCInstance::getCurrentAccountInfo().registeredName.empty()) { + if (accInfo.registeredName.empty()) { + ui->btnRegisterName->show(); + ui->btnRegisterName->setVisible(false); + ui->currentRegisteredID->setStyleSheet("font-weight: normal; background-color: rgb(240, 240, 240);border: 2px;"); + ui->currentRegisteredID->setClearButtonEnabled(false); ui->currentRegisteredID->setReadOnly(false); - + setRegNameUi(RegName::BLANK); } else { + ui->btnRegisterName->hide(); + ui->currentRegisteredID->setStyleSheet("font-weight: bold; background-color: transparent;border: 0px;"); + ui->currentRegisteredID->setClearButtonEnabled(false); ui->currentRegisteredID->setReadOnly(true); - setRegNameUi(RegName::BLANK); } - //Sip Avator set - ui->currentSIPAccountAvatar->setIcon(LRCInstance::getCurrAccPixmap(). - scaledToHeight(avatarSize_, Qt::SmoothTransformation)); + // sip avatar set + setAvatar(ui->currentSIPAccountAvatar); - //Ring Avator set - ui->currentAccountAvatar->setIcon(LRCInstance::getCurrAccPixmap(). - scaledToHeight(avatarSize_, Qt::SmoothTransformation)); + // jami avatar set + setAvatar(ui->currentAccountAvatar); - ui->accountEnableCheckBox->setChecked(LRCInstance::getCurrentAccountInfo().enabled); - ui->accountSIPEnableCheckBox->setChecked(LRCInstance::getCurrentAccountInfo().enabled); + ui->accountEnableCheckBox->setChecked(accInfo.enabled); + ui->accountSIPEnableCheckBox->setChecked(accInfo.enabled); - ui->displayNameLineEdit->setText(QString::fromStdString(LRCInstance::getCurrentAccountInfo().profileInfo.alias)); - ui->displaySIPNameLineEdit->setText(QString::fromStdString(LRCInstance::getCurrentAccountInfo().profileInfo.alias)); + ui->displayNameLineEdit->setText(QString::fromStdString(accInfo.profileInfo.alias)); + ui->displaySIPNameLineEdit->setText(QString::fromStdString(accInfo.profileInfo.alias)); updateAndShowDevicesSlot(); - bannedContactsShown_ = false; - if (!LRCInstance::getCurrentAccountInfo().contactModel->getBannedContacts().size()) { - ui->blockedContactsBtn->hide(); - - } else { - ui->blockedContactsBtn->show(); - } + ui->bannedContactsListWidget->setVisible(false); + ui->bannedContactsBtn->setIcon(QIcon(":/images/icons/round-arrow_drop_down-24px.svg")); + ui->bannedContactsLayoutWidget->setVisible(accInfo.contactModel->getBannedContacts().size()); } void -SettingsWidget::passwordClicked() +SettingsWidget::setAvatar(PhotoboothWidget* avatarWidget) { - PasswordDialog passwdDialog(this); - passwdDialog.exec(); + auto& accountInfo = LRCInstance::getCurrentAccountInfo(); + auto defaultAvatar = accountInfo.profileInfo.avatar.empty(); + auto avatar = Utils::accountPhoto(accountInfo, { avatarSize_ , avatarSize_ }); + avatarWidget->setAvatarPixmap(QPixmap::fromImage(avatar), defaultAvatar); } -void -SettingsWidget::showhideButtonClicked() +void SettingsWidget::passwordClicked() { - if (showOrHide_) { - - ui->passSIPlineEdit->setEchoMode(QLineEdit::Password); - QPixmap pixmaptwo(":/images/icons/showHide.PNG"); - ui->showhideButton->setIcon(QIcon(pixmaptwo)); - ui->showhideButton->setIconSize(pixmaptwo.rect().size()); - - } else { - - ui->passSIPlineEdit->setEchoMode(QLineEdit::Normal); - QPixmap pixmap(":/images/icons/showHideTwo.PNG"); - ui->showhideButton->setIcon(QIcon(pixmap)); - ui->showhideButton->setIconSize(pixmap.rect().size()); - - } - - showOrHide_ = !showOrHide_; - + PasswordDialog passwdDialog(this); + passwdDialog.exec(); } -void -SettingsWidget::toggleAdvancedSIPSettings() +void SettingsWidget::toggleAdvancedSIPSettings() { if (advancedSIPSettingsDropped_) { - ui->advancedAccountSettingsSIPButton->setIcon(QPixmap(":/images/icons/round-arrow_drop_down-24px.svg")); + ui->advancedAccountSettingsSIPButton->setIcon(QIcon(":/images/icons/round-arrow_drop_down-24px.svg")); ui->scrollBarSIPLabel->show(); ui->advancedSIPSettingsWidget->setVisible(false); } else { - ui->advancedAccountSettingsSIPButton->setIcon(QPixmap(":/images/icons/round-arrow_drop_up-24px.svg")); + ui->advancedAccountSettingsSIPButton->setIcon(QIcon(":/images/icons/round-arrow_drop_up-24px.svg")); ui->scrollBarSIPLabel->hide(); ui->advancedSIPSettingsWidget->setVisible(true); ui->advancedSIPSettingsWidget->updateAdvancedSIPSettings(); QTimer::singleShot(50, this, - [this] { - auto top = ui->advancedAccountSettingsSIPButton->frameGeometry().top(); - ui->scrollSIPArea->verticalScrollBar()->setSliderPosition(top); - }); + [this] { + auto top = ui->advancedAccountSettingsSIPButton->frameGeometry().top(); + ui->scrollSIPArea->verticalScrollBar()->setSliderPosition(top); + }); } advancedSIPSettingsDropped_ = !advancedSIPSettingsDropped_; - } -void -SettingsWidget::toggleAdvancedSettings() +void SettingsWidget::toggleAdvancedSettings() { if (advancedSettingsDropped_) { - ui->advancedAccountSettingsPButton->setIcon(QPixmap(":/images/icons/round-arrow_drop_down-24px.svg")); + ui->advancedAccountSettingsPButton->setIcon(QIcon(":/images/icons/round-arrow_drop_down-24px.svg")); ui->scrollBarLabel->show(); ui->advancedSettingsWidget->setVisible(false); - } else { - ui->advancedAccountSettingsPButton->setIcon(QPixmap(":/images/icons/round-arrow_drop_up-24px.svg")); + ui->advancedAccountSettingsPButton->setIcon(QIcon(":/images/icons/round-arrow_drop_up-24px.svg")); ui->scrollBarLabel->hide(); ui->advancedSettingsWidget->setVisible(true); ui->advancedSettingsWidget->updateAdvancedSettings(); QTimer::singleShot(50, this, - [this] { - auto top = ui->advancedAccountSettingsPButton->frameGeometry().top(); - ui->scrollArea->verticalScrollBar()->setSliderPosition(top); - }); + [this] { + auto top = ui->advancedAccountSettingsPButton->frameGeometry().top(); + ui->scrollArea->verticalScrollBar()->setSliderPosition(top); + }); } advancedSettingsDropped_ = !advancedSettingsDropped_; } -void -SettingsWidget::toggleBannedContacts() +void SettingsWidget::toggleBannedContacts() { - if (bannedContactsShown_) { // will show linked devices next - bannedContactsShown_ = false; - updateAndShowDevicesSlot(); - - } else { // will show banned contacts next - bannedContactsShown_ = true; - updateAndShowBannedContactsSlot(); - } + auto bannedContactsVisible = ui->bannedContactsListWidget->isVisible(); + ui->bannedContactsListWidget->setVisible(!bannedContactsVisible); + updateAndShowBannedContactsSlot(); } -void -SettingsWidget::resizeEvent(QResizeEvent* event) +void SettingsWidget::resizeEvent(QResizeEvent* event) { QWidget::resizeEvent(event); - - if (LRCInstance::getCurrentAccountInfo().profileInfo.type == lrc::api::profile::Type::SIP) { - - scrollSIPArea_->resize(ui->currentSIPAccountSettingsScrollWidget->width(), this->height()); - - } else { - - scrollArea_->resize(ui->currentAccountSettingsScrollWidget->width(), this->height()); - - } + scrollSIPArea_->resize(ui->currentSIPAccountSettingsScrollWidget->width(), this->height()); + scrollArea_->resize(ui->currentAccountSettingsScrollWidget->width(), this->height()); } -void -SettingsWidget::avatarClicked() -{ - SetAvatarDialog avatarDialog(this); - - // return new avatar pixmap from setAvatarDialog - connect(&avatarDialog, &SetAvatarDialog::pixmapSignal, - [this](const std::string& pixString) { - if (!pixString.empty()) { - LRCInstance::setCurrAccAvatar(pixString); - updateAccountInfoDisplayed(); - } - } - ); - avatarDialog.exec(); -} - -void -SettingsWidget::verifyRegisteredNameSlot() +void SettingsWidget::verifyRegisteredNameSlot() { if (!LRCInstance::getCurrentAccountInfo().registeredName.empty()) { setRegNameUi(RegName::BLANK); @@ -452,8 +401,7 @@ SettingsWidget::verifyRegisteredNameSlot() } // returns true if name is valid registered name -bool -SettingsWidget::validateRegNameForm(const QString& regName) +bool SettingsWidget::validateRegNameForm(const QString& regName) { QRegularExpression regExp(" "); @@ -465,8 +413,7 @@ SettingsWidget::validateRegNameForm(const QString& regName) } } -void -SettingsWidget::receiveRegNameSlot(const std::string& accountID, +void SettingsWidget::receiveRegNameSlot(const std::string& accountID, lrc::api::account::LookupStatus status, const std::string& address, const std::string& name) { Q_UNUSED(accountID); @@ -474,14 +421,12 @@ SettingsWidget::receiveRegNameSlot(const std::string& accountID, afterNameLookup(status, name); } -void -SettingsWidget::beforeNameLookup() +void SettingsWidget::beforeNameLookup() { NameDirectory::instance().lookupName(nullptr, QString(), registeredName_); } -void -SettingsWidget::afterNameLookup(lrc::api::account::LookupStatus status, const std::string& regName) +void SettingsWidget::afterNameLookup(lrc::api::account::LookupStatus status, const std::string& regName) { if (registeredName_.toStdString() == regName && regName.length() > 2) { if (status == lrc::api::account::LookupStatus::NOT_FOUND) { @@ -496,95 +441,72 @@ SettingsWidget::afterNameLookup(lrc::api::account::LookupStatus status, const st } } -void -SettingsWidget::setRegNameUi(RegName stat) +void SettingsWidget::setRegNameUi(RegName stat) { - disconnect(gif, SIGNAL(frameChanged(int)), this, SLOT(setButtonIconSlot(int))); - disconnect(ui->regNameButton, &QPushButton::clicked, this, &SettingsWidget::regNameRegisteredSlot); + disconnect(lookupSpinnerMovie_, SIGNAL(frameChanged(int)), this, SLOT(setButtonIconSlot(int))); + disconnect(ui->btnRegisterName, &QPushButton::clicked, this, &SettingsWidget::slotRegisterName); switch (stat) { case RegName::BLANK: - ui->currentRegisteredID->setStyleSheet("padding-left: 5px; border: 0px; border-radius: 3px; border: 1px solid rgb(245, 245, 245);"); - regNameBtn_ = false; - ui->currentRegisteredID->setToolTip(tr("")); - ui->regNameButton->setIcon(QPixmap()); - ui->regNameButton->setEnabled(false); + ui->btnRegisterName->setVisible(false); + ui->lookupStatusLabel->hide(); break; case RegName::INVALIDFORM: - ui->currentRegisteredID->setStyleSheet("padding-left: 5px; border: 1px solid red; border-radius: 3px;"); - regNameBtn_ = false; - ui->currentRegisteredID->setToolTip(tr("A registered name should not have any spaces and must be at least three letters long")); - ui->regNameButton->setIcon(QPixmap(":/images/icons/round-error-24px.svg")); - ui->regNameButton->setToolTip(tr("A registered name should not have any spaces and must be at least three letters long")); - ui->regNameButton->setEnabled(true); + ui->btnRegisterName->setVisible(false); + ui->lookupStatusLabel->setPixmap(statusInvalidPixmap_); + ui->lookupStatusLabel->show(); + ui->lookupStatusLabel->setToolTip(tr("A registered name should not have any spaces and must be at least three letters long")); break; case RegName::TAKEN: - ui->currentRegisteredID->setStyleSheet("padding-left: 5px; border: 1px solid orange; border-radius: 3px;"); - regNameBtn_ = false; - ui->currentRegisteredID->setToolTip(tr("This name is already taken")); - ui->regNameButton->setIcon(QPixmap(":/images/icons/round-error-24px.svg")); - ui->regNameButton->setToolTip(tr("This registered name is already taken")); - ui->regNameButton->setEnabled(true); + ui->btnRegisterName->setVisible(false); + ui->lookupStatusLabel->setPixmap(statusErrorPixmap_); + ui->lookupStatusLabel->show(); + ui->lookupStatusLabel->setToolTip(tr("This name is already taken")); break; case RegName::FREE: - ui->currentRegisteredID->setStyleSheet("padding-left: 5px; border: 1px solid green; border-radius: 3px;"); - regNameBtn_ = true; - ui->currentRegisteredID->setToolTip(tr("This name is available")); - ui->regNameButton->setIcon(QPixmap(":/images/icons/round-check_circle-24px.svg")); - ui->regNameButton->setToolTip(tr("Register this name")); - ui->regNameButton->setEnabled(true); - - connect(ui->regNameButton, &QPushButton::clicked, this, &SettingsWidget::regNameRegisteredSlot); + ui->btnRegisterName->setVisible(true); + ui->lookupStatusLabel->setPixmap(statusSuccessPixmap_); + ui->lookupStatusLabel->show(); + ui->lookupStatusLabel->setToolTip(tr("Register this name")); + + connect(ui->btnRegisterName, &QPushButton::clicked, this, &SettingsWidget::slotRegisterName); break; case RegName::SEARCHING: - ui->currentRegisteredID->setStyleSheet("padding-left: 5px; border: 1px solid rgb(2, 187, 213); border-radius: 3px;"); - regNameBtn_ = false; - ui->currentRegisteredID->setToolTip(tr("")); - - connect(gif, SIGNAL(frameChanged(int)), this, SLOT(setButtonIconSlot(int))); - gif->start(); - ui->regNameButton->setEnabled(false); + ui->btnRegisterName->setVisible(false); + ui->lookupStatusLabel->setMovie(lookupSpinnerMovie_); + lookupSpinnerMovie_->stop(); + lookupSpinnerMovie_->start(); + ui->lookupStatusLabel->show(); + ui->lookupStatusLabel->setToolTip(tr("")); break; } } void -SettingsWidget::setButtonIconSlot(int frame) +SettingsWidget::slotRegisterName() { - Q_UNUSED(frame); - ui->regNameButton->setIcon(QIcon(gif->currentPixmap())); -} - -void -SettingsWidget::regNameRegisteredSlot() -{ - if (!regNameBtn_) { - return; - } - - RegNameDialog regNameDialog(registeredName_, this); - - if (regNameDialog.exec() == QDialog::Accepted) { - ui->currentRegisteredID->setReadOnly(true); - ui->currentRegisteredID->setText(registeredName_); + NameRegistrationDialog nameRegistrationDialog(registeredName_, this); + if (nameRegistrationDialog.exec() == QDialog::Accepted) { lrc::api::account::ConfProperties_t accountProperties = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), accountProperties); - + ui->btnRegisterName->hide(); + ui->currentRegisteredID->setStyleSheet("font-weight: bold; background-color: transparent;border: 0px;"); + ui->currentRegisteredID->setClearButtonEnabled(false); + ui->currentRegisteredID->setReadOnly(true); + ui->lookupStatusLabel->hide(); } else { ui->currentRegisteredID->setText(""); registeredName_ = ""; + setRegNameUi(RegName::BLANK); } - - setRegNameUi(RegName::BLANK); } -void -SettingsWidget::setAccEnableSlot(int state) +void SettingsWidget::setAccEnableSlot(int state) { LRCInstance::editableAccountModel()->enableAccount(LRCInstance::getCurrAccId(), (bool)state); @@ -592,8 +514,7 @@ SettingsWidget::setAccEnableSlot(int state) LRCInstance::editableAccountModel()->setAccountConfig(LRCInstance::getCurrAccId(), confProps); } -void -SettingsWidget::delAccountSlot() +void SettingsWidget::delAccountSlot() { DeleteAccountDialog delDialog(this); auto ret = delDialog.exec(); @@ -611,8 +532,7 @@ SettingsWidget::delAccountSlot() } } -void -SettingsWidget::removeDeviceSlot(int index) +void SettingsWidget::removeDeviceSlot(int index) { if (!index) { return; @@ -622,36 +542,36 @@ SettingsWidget::removeDeviceSlot(int index) auto it = deviceList.begin(); std::advance(it, index); - QString psswd; + QString password; bool ok = false; if (LRCInstance::getCurrAccConfig().archiveHasPassword) { - psswd = QInputDialog::getText(this, tr("Remove Device"), - tr("Enter this account's password to confirm the removal of this device"), QLineEdit::Password, - QDir::home().dirName(), &ok); + password = QInputDialog::getText(this, tr("Remove Device"), + tr("Enter this account's password to confirm the removal of this device"), + QLineEdit::Password, + QDir::home().dirName(), &ok); } else { - psswd = ""; - QMessageBox devDel; - devDel.setText(tr("Please confirm that you wish to remove this device")); - devDel.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); - devDel.setDefaultButton(QMessageBox::Cancel); + password = ""; + QMessageBox confirmDialog; + confirmDialog.setText(tr("Are you sure you wish to remove this device?")); + confirmDialog.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); + confirmDialog.setDefaultButton(QMessageBox::Cancel); - if (devDel.exec() == QMessageBox::Ok) { + if (confirmDialog.exec() == QMessageBox::Ok) { goto delete_; } } if (ok) { -delete_: - LRCInstance::getCurrentAccountInfo().deviceModel->revokeDevice(it->id, psswd.toStdString()); + delete_: + LRCInstance::getCurrentAccountInfo().deviceModel->revokeDevice(it->id, password.toStdString()); updateAndShowDevicesSlot(); } } -void -SettingsWidget::unban(int index) +void SettingsWidget::unban(int index) { auto bannedContactList = LRCInstance::getCurrentAccountInfo().contactModel->getBannedContacts(); auto it = bannedContactList.begin(); @@ -663,131 +583,112 @@ SettingsWidget::unban(int index) updateAndShowBannedContactsSlot(); } -void -SettingsWidget::exportAccountSlot() +void SettingsWidget::exportAccountSlot() { QFileDialog dialog(this); QString dir = QFileDialog::getExistingDirectory(this, tr("Export Account Here"), - QDir::homePath() + "/Desktop", QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + QDir::homePath() + "/Desktop", QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if (!dir.isEmpty()) { LRCInstance::accountModel().exportToFile(LRCInstance::getCurrAccId(), (dir + "/export.gz").toStdString()); } } -void -SettingsWidget::updateAndShowDevicesSlot() +void SettingsWidget::updateAndShowDevicesSlot() { ui->settingsListWidget->clear(); - ui->label->setText(tr("Linked Devices")); - ui->blockedContactsBtn->setText(tr("Blocked Contacts")); ui->linkDevPushButton->show(); auto deviceList = LRCInstance::getCurrentAccountInfo().deviceModel->getAllDevices(); int i = 0; - for (auto it = deviceList.begin(); it != deviceList.end(); ++it, ++i) { - SettingsItemWidget* item = new SettingsItemWidget(itemHeight_, i, false, ui->settingsListWidget); - item->setSizeHint(QSize(ui->settingsListWidget->width(), itemHeight_)); + auto item = new QListWidgetItem(ui->settingsListWidget); ui->settingsListWidget->addItem(item); - - if (i) { - connect(item->button_, &QPushButton::clicked, [this, i]() { + auto row = new DeviceItemWidget(QString::fromStdString(it->name), + QString::fromStdString(it->id), + it->isCurrent, + this); + item->setSizeHint(QSize(ui->settingsListWidget->width(), + row->minimumSizeHint().height())); + ui->settingsListWidget->setItemWidget(item, row); + connect(row, &DeviceItemWidget::btnRemoveDeviceClicked, + [this, i, isCurrent = it->isCurrent]() { removeDeviceSlot(i); - } - ); - } + }); } } -void -SettingsWidget::updateAndShowBannedContactsSlot() +void SettingsWidget::updateAndShowBannedContactsSlot() { - if (bannedContactsShown_) { - ui->settingsListWidget->clear(); + if (!ui->bannedContactsListWidget->isVisible()) { + ui->bannedContactsBtn->setIcon(QIcon(":/images/icons/round-arrow_drop_down-24px.svg")); + return; + } - ui->label->setText(tr("Blocked Contacts")); - ui->blockedContactsBtn->setText(tr("Linked Devices")); - ui->linkDevPushButton->hide(); + ui->bannedContactsBtn->setIcon(QIcon(":/images/icons/round-arrow_drop_up-24px.svg")); - auto bannedContactList = LRCInstance::getCurrentAccountInfo().contactModel->getBannedContacts(); + auto bannedContactList = LRCInstance::getCurrentAccountInfo().contactModel->getBannedContacts(); - int i = 0; + if (!bannedContactList.size()) { + toggleBannedContacts(); + ui->bannedContactsLayoutWidget->setVisible(false); + return; + } - for (auto it = bannedContactList.begin(); it != bannedContactList.end(); ++it, ++i) { - SettingsItemWidget* item = new SettingsItemWidget(itemHeight_, i, true, ui->settingsListWidget); - item->setSizeHint(QSize(ui->settingsListWidget->width(), itemHeight_)); - ui->settingsListWidget->addItem(item); + ui->bannedListWidget->clear(); - connect(item->button_, &QPushButton::clicked, [this, i]() { + int i = 0; + for (auto it = bannedContactList.begin(); it != bannedContactList.end(); ++it, ++i) { + auto contactInfo = LRCInstance::getCurrentAccountInfo().contactModel->getContact(*it); + auto contactName = QString::fromStdString(contactInfo.registeredName); + auto contactId = QString::fromStdString(contactInfo.profileInfo.uri); + auto item = new QListWidgetItem(ui->bannedListWidget); + ui->bannedListWidget->addItem(item); + auto row = new BannedItemWidget(contactName, + contactId, + this); + item->setSizeHint(QSize(ui->bannedListWidget->width(), + row->minimumSizeHint().height())); + ui->bannedListWidget->setItemWidget(item, row); + connect(row, &BannedItemWidget::btnReAddContactClicked, + [this, i]() { unban(i); - } - ); - } - - if (!bannedContactList.size()) { - updateAndShowDevicesSlot(); - ui->blockedContactsBtn->hide(); - } + }); } } -void -SettingsWidget::showLinkDevSlot() +void SettingsWidget::showLinkDevSlot() { if (!advancedSettingsWidget_) { delete advancedSettingsWidget_; } - linkDevWidget = new LinkDevWidget(ui->scrollAreaWidgetContents); - linkDevWidget->setMinimumWidth(600); - - ui->accountHorLayout->insertWidget(1, linkDevWidget); - - linkDevWidget->show(); - ui->centralWidget->hide(); - - connect(linkDevWidget->cancelBtn(), &QPushButton::clicked, this, &SettingsWidget::showCurrentAccountSlot); - connect(linkDevWidget->endCancelBtn(), &QPushButton::clicked, this, &SettingsWidget::showCurrentAccountSlot); + auto linkDeviceDialog = new LinkDeviceDialog(this); + linkDeviceDialog->exec(); } -void -SettingsWidget::showCurrentAccountSlot() -{ - disconnect(linkDevWidget); - delete linkDevWidget; - - ui->centralWidget->show(); - updateAndShowDevicesSlot(); -} - -void -SettingsWidget::setConnections() +void SettingsWidget::setConnections() { // btnExitSettings connect(ui->btnExitSettings, &QPushButton::clicked, this, &SettingsWidget::leaveSettingsSlot); connect(ui->accountSettingsButton, &QPushButton::clicked, [this]() { setSelected(Button::accountSettingsButton); - } - ); + }); connect(ui->generalSettingsButton, &QPushButton::clicked, [this]() { setSelected(Button::generalSettingsButton); - } - ); + }); - connect(ui->avSettingsButton, &QPushButton::clicked, [this]() { - setSelected(Button::avSettingsButton); - } - ); + connect(ui->mediaSettingsButton, &QPushButton::clicked, [this]() { + setSelected(Button::mediaSettingsButton); + }); - connect(ui->currentSIPAccountAvatar, &QPushButton::clicked, [this]() { + /*connect(ui->currentSIPAccountAvatar, &QPushButton::clicked, [this]() { avatarClicked(); - } - ); + });*/ connect(ui->advancedAccountSettingsSIPButton, &QPushButton::clicked, this, &SettingsWidget::toggleAdvancedSIPSettings); @@ -796,43 +697,55 @@ SettingsWidget::setConnections() connect(ui->accountSIPEnableCheckBox, &QCheckBox::clicked, this, &SettingsWidget::setAccEnableSlot); - connect(ui->displaySIPNameLineEdit, &QLineEdit::textChanged, [this](const QString& displayName) { - LRCInstance::setCurrAccDisplayName(displayName.toStdString()); - } - ); + connect(ui->displaySIPNameLineEdit, &QLineEdit::editingFinished, + [this] { + LRCInstance::setCurrAccDisplayName(ui->displaySIPNameLineEdit->text().toStdString()); + }); - connect(ui->showhideButton, &QPushButton::clicked, [this]() { - showhideButtonClicked(); - } - ); + connect(ui->passSIPlineEdit, &QLineEdit::editingFinished, + [this] { + confProps_ = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); + confProps_.password = ui->passSIPlineEdit->text().toStdString(); + LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps_); + }); - connect(ui->passSIPlineEdit, &QLineEdit::textChanged, [this](const QString& displayName) { - confProps_ = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); - confProps_.password = displayName.toStdString(); - LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps_); - } - ); + connect(ui->ProxySIP, &QLineEdit::editingFinished, + [this] { + confProps_ = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); + confProps_.proxyServer = ui->ProxySIP->text().toStdString(); + LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps_); + }); - connect(ui->ProxySIP, &QLineEdit::textChanged, [this](const QString& displayName) { - confProps_ = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); - confProps_.proxyServer = displayName.toStdString(); - LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps_); - } - ); + connect(ui->passwdPushButton, &QPushButton::clicked, + [this]() { + passwordClicked(); + }); - connect(ui->passwdPushButton, &QPushButton::clicked, [this]() { - passwordClicked(); - } - ); + connect(ui->currentAccountAvatar, &PhotoboothWidget::clearedPhoto, + [this] { + LRCInstance::setCurrAccAvatar(QPixmap()); + setAvatar(ui->currentAccountAvatar); + }); - connect(ui->currentAccountAvatar, &QPushButton::clicked, [this]() { - avatarClicked(); - } - ); + connect(ui->currentAccountAvatar, &PhotoboothWidget::photoTaken, + [this] { + LRCInstance::setCurrAccAvatar(ui->currentAccountAvatar->getAvatarPixmap()); + }); + + connect(ui->currentSIPAccountAvatar, &PhotoboothWidget::clearedPhoto, + [this] { + LRCInstance::setCurrAccAvatar(QPixmap()); + setAvatar(ui->currentSIPAccountAvatar); + }); + + connect(ui->currentSIPAccountAvatar, &PhotoboothWidget::photoTaken, + [this] { + LRCInstance::setCurrAccAvatar(ui->currentSIPAccountAvatar->getAvatarPixmap()); + }); connect(ui->advancedAccountSettingsPButton, &QPushButton::clicked, this, &SettingsWidget::toggleAdvancedSettings); - connect(ui->currentRegisteredID, &QLineEdit::textChanged, this, &SettingsWidget::verifyRegisteredNameSlot); + connect(ui->currentRegisteredID, &QLineEdit::textEdited, this, &SettingsWidget::verifyRegisteredNameSlot); connect(&LRCInstance::accountModel(), &lrc::api::NewAccountModel::registeredNameFound, this, &SettingsWidget::receiveRegNameSlot); @@ -844,7 +757,7 @@ SettingsWidget::setConnections() connect(ui->btnDeletAccount, &QPushButton::clicked, this, &SettingsWidget::delAccountSlot); // connect "banned contacts" button - connect(ui->blockedContactsBtn, &QPushButton::clicked, this, &SettingsWidget::toggleBannedContacts); + connect(ui->bannedContactsBtn, &QPushButton::clicked, this, &SettingsWidget::toggleBannedContacts); // connect "link device" button connect(ui->linkDevPushButton, &QPushButton::clicked, this, &SettingsWidget::showLinkDevSlot); @@ -860,40 +773,40 @@ SettingsWidget::setConnections() // account settings setters { connect(ui->accountEnableCheckBox, &QCheckBox::clicked, this, &SettingsWidget::setAccEnableSlot); - connect(ui->displayNameLineEdit, &QLineEdit::textChanged, [this](const QString& displayName) { - LRCInstance::setCurrAccDisplayName(displayName.toStdString()); - } - ); + connect(ui->displayNameLineEdit, &QLineEdit::editingFinished, + [this] { + LRCInstance::setCurrAccDisplayName(ui->displayNameLineEdit->text().toStdString()); + }); - connect(ui->usernameSIP, &QLineEdit::textChanged, - [this](const QString& displayName) { - confProps_ = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); - confProps_.username = displayName.toStdString(); - LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps_); - }); + connect(ui->usernameSIP, &QLineEdit::editingFinished, + [this] { + confProps_ = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); + confProps_.username = ui->usernameSIP->text().toStdString(); + LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps_); + }); - connect(ui->hostnameSIP, &QLineEdit::textChanged, [this](const QString& displayName) { - confProps_ = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); - confProps_.hostname = displayName.toStdString(); - LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps_); - } - ); + connect(ui->hostnameSIP, &QLineEdit::editingFinished, + [this] { + confProps_ = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId()); + confProps_.hostname = ui->hostnameSIP->text().toStdString(); + LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps_); + }); // general settings - connect(ui->notificationCheckBox, &QAbstractButton::clicked, this, &SettingsWidget::setNotificationsSlot); + connect(ui->notificationCheckBox, &QAbstractButton::clicked, this, &SettingsWidget::slotSetNotifications); - connect(ui->closeOrMinCheckBox, &QAbstractButton::clicked, this, &SettingsWidget::setClosedOrMinSlot); + connect(ui->closeOrMinCheckBox, &QAbstractButton::clicked, this, &SettingsWidget::slotSetClosedOrMin); connect(ui->downloadButton, &QAbstractButton::clicked, this, &SettingsWidget::openDownloadFolderSlot); - connect(ui->alwaysRecordingCheckBox, &QAbstractButton::clicked, this, &SettingsWidget::setAlwaysRecordingSlot); + connect(ui->alwaysRecordingCheckBox, &QAbstractButton::clicked, this, &SettingsWidget::slotSetAlwaysRecording); connect(ui->checkUpdateButton, &QAbstractButton::clicked, this, &SettingsWidget::checkForUpdateSlot); connect(ui->intervalUpdateCheckSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &SettingsWidget::setUpdateIntervalSlot); - connect(ui->autoUpdateCheckBox, &QAbstractButton::clicked, this, &SettingsWidget::setUpdateAutomaticSlot); + connect(ui->autoUpdateCheckBox, &QAbstractButton::clicked, this, &SettingsWidget::slotSetUpdateAutomatic); // audio / visual settings @@ -904,12 +817,19 @@ SettingsWidget::setConnections() void SettingsWidget::populateGeneralSettings() { - QSettings settings; + QSettings settings("jami.net", "Jami"); // settings - ui->downloadButton->setText(QString::fromStdString(LRCInstance::dataTransferModel().downloadDirectory)); + QString downloadPath = QDir::toNativeSeparators(QString::fromStdString(LRCInstance::dataTransferModel().downloadDirectory)); + int pos = downloadPath.lastIndexOf(QChar('\\')); + if (pos == downloadPath.length() - 1) { + downloadPath.truncate(pos); + } + Utils::setElidedText(ui->downloadButton, downloadPath); + ui->closeOrMinCheckBox->setChecked(settings.value(SettingsKey::closeOrMinimized).toBool()); - ui->notificationCheckBox->setChecked(settings.value(SettingsKey::enableNotifications).toBool()); + auto notifs = settings.value(SettingsKey::enableNotifications).toBool(); + ui->notificationCheckBox->setChecked(notifs); //recordings ui->alwaysRecordingCheckBox->setChecked(media::RecordingModel::instance().isAlwaysRecording()); @@ -919,7 +839,7 @@ void SettingsWidget::populateGeneralSettings() media::RecordingModel::instance().setRecordPath(recordPath); } - ui->recordPathButton->setText(media::RecordingModel::instance().recordPath()); + Utils::setElidedText(ui->recordPathButton, media::RecordingModel::instance().recordPath()); #ifdef Q_OS_WIN ui->autoUpdateCheckBox->setChecked(win_sparkle_get_automatic_check_for_updates()); @@ -927,107 +847,72 @@ void SettingsWidget::populateGeneralSettings() #endif } -void -SettingsWidget::setNotificationsSlot(int state) +void SettingsWidget::slotSetNotifications(bool state) { - QSettings settings; - - if (state == Qt::CheckState::Unchecked) { - settings.setValue(SettingsKey::enableNotifications, false); - - } else { - settings.setValue(SettingsKey::enableNotifications, true); - } + QSettings settings("jami.net", "Jami"); + settings.setValue(SettingsKey::enableNotifications, state); } -void -SettingsWidget::setClosedOrMinSlot(int state) +void SettingsWidget::slotSetClosedOrMin(bool state) { - QSettings settings; - - if (state == Qt::CheckState::Unchecked) { - settings.setValue(SettingsKey::closeOrMinimized, false); - - } else { - settings.setValue(SettingsKey::closeOrMinimized, true); - } + QSettings settings("jami.net", "Jami"); + settings.setValue(SettingsKey::closeOrMinimized, state); } -void -SettingsWidget::checkForUpdateSlot() +void SettingsWidget::checkForUpdateSlot() { #ifdef Q_OS_WIN win_sparkle_check_update_with_ui(); #endif } -void -SettingsWidget::setUpdateIntervalSlot(int value) +void SettingsWidget::setUpdateIntervalSlot(int value) { #ifdef Q_OS_WIN win_sparkle_set_update_check_interval(value * 86400); #endif } -void -SettingsWidget::setUpdateAutomaticSlot(int state) +void SettingsWidget::slotSetUpdateAutomatic(bool state) { #ifdef Q_OS_WIN - - if (state == Qt::CheckState::Unchecked) { - win_sparkle_set_automatic_check_for_updates(false); - ui->intervalUpdateCheckSpinBox->setEnabled(false); - - } else { - win_sparkle_set_automatic_check_for_updates(true); - ui->intervalUpdateCheckSpinBox->setEnabled(true); - } - + win_sparkle_set_automatic_check_for_updates(state); #endif + ui->intervalUpdateCheckSpinBox->setEnabled(state); } -void -SettingsWidget::openDownloadFolderSlot() +void SettingsWidget::openDownloadFolderSlot() { - QSettings settings; + QSettings settings("jami.net", "Jami"); QString dir = QFileDialog::getExistingDirectory(this, tr("Select A Folder For Your Downloads"), - QStandardPaths::writableLocation(QStandardPaths::DownloadLocation), QFileDialog::ShowDirsOnly - | QFileDialog::DontResolveSymlinks); + QStandardPaths::writableLocation(QStandardPaths::DownloadLocation), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if (!dir.isEmpty()) { - ui->downloadButton->setText(dir); + Utils::setElidedText(ui->downloadButton, dir); settings.setValue(SettingsKey::downloadPath, dir); LRCInstance::editableDataTransferModel()->downloadDirectory = dir.toStdString() + "/"; } } -void -SettingsWidget::setAlwaysRecordingSlot(int state) +void SettingsWidget::slotSetAlwaysRecording(bool state) { - if (state == Qt::CheckState::Unchecked) { - media::RecordingModel::instance().setAlwaysRecording(false); - - } else { - media::RecordingModel::instance().setAlwaysRecording(true); - } + media::RecordingModel::instance().setAlwaysRecording(state); } -void -SettingsWidget::openRecordFolderSlot() +void SettingsWidget::openRecordFolderSlot() { QString dir = QFileDialog::getExistingDirectory(this, tr("Select A Folder For Your Recordings"), - media::RecordingModel::instance().recordPath(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + media::RecordingModel::instance().recordPath(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if (!dir.isEmpty()) { media::RecordingModel::instance().setRecordPath(dir); - ui->recordPathButton->setText(media::RecordingModel::instance().recordPath()); + Utils::setElidedText(ui->recordPathButton, media::RecordingModel::instance().recordPath()); } } // ************************* Audio/Visual Settings ************************* -void -SettingsWidget::populateAVSettings() +void SettingsWidget::populateAVSettings() { // audio auto inputModel = Audio::Settings::instance().inputDeviceModel(); @@ -1072,22 +957,19 @@ SettingsWidget::populateAVSettings() showPreview(); } -void -SettingsWidget::outputDevIndexChangedSlot(int index) +void SettingsWidget::outputDevIndexChangedSlot(int index) { auto outputModel = Audio::Settings::instance().outputDeviceModel(); outputModel->selectionModel()->setCurrentIndex(outputModel->index(index), QItemSelectionModel::ClearAndSelect); } -void -SettingsWidget::inputdevIndexChangedSlot(int index) +void SettingsWidget::inputdevIndexChangedSlot(int index) { auto inputModel = Audio::Settings::instance().inputDeviceModel(); inputModel->selectionModel()->setCurrentIndex(inputModel->index(index), QItemSelectionModel::ClearAndSelect); } -void -SettingsWidget::deviceModelIndexChanged(int index) +void SettingsWidget::deviceModelIndexChanged(int index) { if (index < 0) { currentDeviceName_ = ""; @@ -1103,8 +985,7 @@ SettingsWidget::deviceModelIndexChanged(int index) currentDeviceName_ = deviceModel_->activeDevice()->name(); } -void -SettingsWidget::slotDeviceBoxCurrentIndexChanged(int index) +void SettingsWidget::slotDeviceBoxCurrentIndexChanged(int index) { if (index < 0) { return; @@ -1132,21 +1013,18 @@ void SettingsWidget::slotFormatBoxCurrentIndexChanged(int index) } } -void -SettingsWidget::startVideo() +void SettingsWidget::startVideo() { Video::PreviewManager::instance().stopPreview(); Video::PreviewManager::instance().startPreview(); } -void -SettingsWidget::stopVideo() +void SettingsWidget::stopVideo() { Video::PreviewManager::instance().stopPreview(); } -void -SettingsWidget::toggleVideoSettings(bool enabled) +void SettingsWidget::toggleVideoSettings(bool enabled) { ui->formatBox->clear(); ui->deviceBox->clear(); @@ -1154,15 +1032,13 @@ SettingsWidget::toggleVideoSettings(bool enabled) ui->deviceBox->setEnabled(enabled); } -void -SettingsWidget::toggleVideoPreview(bool enabled) +void SettingsWidget::toggleVideoPreview(bool enabled) { ui->previewUnavailableLabel->setVisible(!enabled); ui->videoLayoutWidget->setVisible(enabled); } -void -SettingsWidget::showPreview() +void SettingsWidget::showPreview() { if (!CallModel::instance().getActiveCalls().size()) { ui->previewUnavailableLabel->hide(); @@ -1176,8 +1052,7 @@ SettingsWidget::showPreview() } } -void -SettingsWidget::setFormatListForDevice(Video::Device* device) +void SettingsWidget::setFormatListForDevice(Video::Device* device) { auto activeChannel = device->activeChannel(); diff --git a/settingswidget.h b/settingswidget.h index 5bbaf81..00bc806 100644 --- a/settingswidget.h +++ b/settingswidget.h @@ -1,7 +1,7 @@ /*************************************************************************** * Copyright (C) 2019-2019 by Savoir-faire Linux * - * Author: Isa Nanic <isa.nanic@savoirfairelinux.com> - * Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com> + * Author: Isa Nanic <isa.nanic@savoirfairelinux.com> * + * Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com> * * * * 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 * @@ -16,42 +16,35 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see <https://www.gnu.org/licenses/>. * **************************************************************************/ - #pragma once -#include <QScrollArea> + #include <QMovie> +#include <QScrollArea> -#include "navwidget.h" #include "lrcinstance.h" +#include "navwidget.h" #include "advancedsettingswidget.h" #include "advancedsipsettingwidget.h" #include "bannedlistmodel.h" +#include "linkdevicedialog.h" +#include "photoboothwidget.h" -#include "linkdevwidget.h" -#include "ui_linkdevwidget.h" - -// general settings #include "api/datatransfermodel.h" #include "typedefs.h" - -// av settings #include "video/devicemodel.h" -namespace Ui -{ +namespace Ui { class SettingsWidget; } -class SettingsWidget : public NavWidget -{ +class SettingsWidget : public NavWidget { Q_OBJECT SettingsWidget(const SettingsWidget& cpy); public: explicit SettingsWidget(QWidget* parent = nullptr); ~SettingsWidget(); - void resize(int size); // NavWidget virtual void navigated(bool to); @@ -59,60 +52,64 @@ public: public slots: virtual void slotAccountOnBoarded(); -public slots: - void updateSettings(int size); - private: - enum Button {accountSettingsButton, generalSettingsButton, avSettingsButton}; - enum RegName {BLANK, INVALIDFORM, TAKEN, FREE, SEARCHING}; - enum List {DevList, BannedContacts}; + Ui::SettingsWidget* ui; + enum Button { + accountSettingsButton, + generalSettingsButton, + mediaSettingsButton + }; + enum RegName { + BLANK, + INVALIDFORM, + TAKEN, + FREE, + SEARCHING + }; + + void setAvatar(PhotoboothWidget* avatarWidget); void setSelected(Button sel); void updateAccountInfoDisplayed(); - void resizeEvent(QResizeEvent* event); - - Ui::SettingsWidget* ui; - - // ************************* SIP Account/Account Settings ************************* - - lrc::api::account::ConfProperties_t confProps_; - - bool showOrHide_{false}; - void showhideButtonClicked(); + bool sipPasswordHidden_{false}; void passwordClicked(); - void avatarClicked(); - void afterNameLookup(lrc::api::account::LookupStatus status, const std::string& regName); - QString registeredName_; - bool validateRegNameForm(const QString& regName); + void setRegNameUi(RegName stat); + void removeDeviceSlot(int index); + void unban(int index); + void setConnections(); + void populateGeneralSettings(); + void populateAVSettings(); + void setFormatListForDevice(Video::Device* device); + void showPreview(); + void startVideo(); + void stopVideo(); + void toggleVideoSettings(bool enabled); + void toggleVideoPreview(bool enabled); + QString registeredName_; + lrc::api::account::ConfProperties_t confProps_; AdvancedSettingsWidget* advancedSettingsWidget_; QScrollArea* scrollArea_; Button pastButton_ = Button::generalSettingsButton; bool advancedSettingsDropped_ = false; - bool bannedContactsShown_ = false; - + QList<QPair<int, int>> formatIndexList_; + Video::DeviceModel* deviceModel_; + QString currentDeviceName_; AdvancedSIPSettingsWidget* advancedSIPSettingsWidget_; QScrollArea* scrollSIPArea_; bool advancedSIPSettingsDropped_ = false; - int avatarSize_; int avatarSIPSize_; - - void setRegNameUi(RegName stat); bool regNameBtn_ = false; - const int itemHeight_ = 55; - void removeDeviceSlot(int index); - void unban(int index); - - void setConnections(); - QMovie* gif; - - LinkDevWidget* linkDevWidget; + QMovie* lookupSpinnerMovie_; + QPixmap statusSuccessPixmap_; + QPixmap statusInvalidPixmap_; + QPixmap statusErrorPixmap_; private slots: void leaveSettingsSlot(); @@ -120,57 +117,27 @@ private slots: void beforeNameLookup(); void receiveRegNameSlot(const std::string& accountID, lrc::api::account::LookupStatus status, const std::string& address, const std::string& name); - void regNameRegisteredSlot(); + void slotRegisterName(); void setAccEnableSlot(int state); void delAccountSlot(); - void toggleAdvancedSIPSettings(); void toggleAdvancedSettings(); void toggleBannedContacts(); void exportAccountSlot(); - void updateAndShowDevicesSlot(); void updateAndShowBannedContactsSlot(); - void showLinkDevSlot(); - void showCurrentAccountSlot(); - - void setButtonIconSlot(int frame); - - // ************************* General Settings ************************* -private: - void populateGeneralSettings(); - -private slots: - void setNotificationsSlot(int state); + void slotSetNotifications(bool state); void checkForUpdateSlot(); - void setClosedOrMinSlot(int state); + void slotSetClosedOrMin(bool state); void openDownloadFolderSlot(); - void setAlwaysRecordingSlot(int state); + void slotSetAlwaysRecording(bool state); void openRecordFolderSlot(); void setUpdateIntervalSlot(int value); - void setUpdateAutomaticSlot(int state); - - // ************************* Audio/Visual Settings ************************* -private: - QList<QPair<int, int>> formatIndexList_; - Video::DeviceModel* deviceModel_; - QString currentDeviceName_; - - void populateAVSettings(); - void setFormatListForDevice(Video::Device* device); - void showPreview(); - void startVideo(); - void stopVideo(); - void toggleVideoSettings(bool enabled); - void toggleVideoPreview(bool enabled); - -private slots: + void slotSetUpdateAutomatic(bool state); void outputDevIndexChangedSlot(int index); void inputdevIndexChangedSlot(int index); - void deviceModelIndexChanged(int index); void slotDeviceBoxCurrentIndexChanged(int index); void slotFormatBoxCurrentIndexChanged(int index); - }; diff --git a/settingswidget.ui b/settingswidget.ui index 09ebdd8..b68936f 100644 --- a/settingswidget.ui +++ b/settingswidget.ui @@ -6,16 +6,13 @@ <rect> <x>0</x> <y>0</y> - <width>896</width> - <height>781</height> + <width>1146</width> + <height>883</height> </rect> </property> <property name="windowTitle"> <string>Form</string> </property> - <property name="styleSheet"> - <string notr="true"/> - </property> <layout class="QHBoxLayout" name="horizontalLayout_3"> <property name="spacing"> <number>0</number> @@ -60,13 +57,13 @@ </property> <property name="minimumSize"> <size> - <width>0</width> + <width>380</width> <height>0</height> </size> </property> <property name="maximumSize"> <size> - <width>16777215</width> + <width>380</width> <height>16777215</height> </size> </property> @@ -76,10 +73,7 @@ <height>0</height> </size> </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <layout class="QVBoxLayout" name="leftVerticalLayout" stretch="0,0,0,1,0,0,0,5"> + <layout class="QVBoxLayout" name="leftVerticalLayout" stretch="0,0,0,0,0,0,5"> <property name="spacing"> <number>0</number> </property> @@ -178,9 +172,6 @@ <height>30</height> </size> </property> - <property name="styleSheet"> - <string notr="true"/> - </property> <property name="text"> <string/> </property> @@ -205,20 +196,7 @@ </spacer> </item> <item> - <spacer name="verticalSpacer_6"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="accountSettingsButton"> + <widget class="IconButton" name="accountSettingsButton" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> @@ -247,22 +225,16 @@ <property name="mouseTracking"> <bool>true</bool> </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="text"> + <property name="text" stdset="0"> <string>Account</string> </property> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="flat"> + <property name="checkable" stdset="0"> <bool>true</bool> </property> </widget> </item> <item> - <widget class="QPushButton" name="generalSettingsButton"> + <widget class="IconButton" name="generalSettingsButton" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> @@ -291,22 +263,16 @@ <property name="mouseTracking"> <bool>true</bool> </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="text"> + <property name="text" stdset="0"> <string>General</string> </property> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="flat"> + <property name="checkable" stdset="0"> <bool>true</bool> </property> </widget> </item> <item> - <widget class="QPushButton" name="avSettingsButton"> + <widget class="IconButton" name="mediaSettingsButton" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> @@ -335,19 +301,10 @@ <property name="mouseTracking"> <bool>true</bool> </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="text"> + <property name="text" stdset="0"> <string>Audio / Video</string> </property> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="default"> - <bool>false</bool> - </property> - <property name="flat"> + <property name="checkable" stdset="0"> <bool>true</bool> </property> </widget> @@ -382,9 +339,6 @@ <height>16777215</height> </size> </property> - <property name="styleSheet"> - <string notr="true"/> - </property> <layout class="QHBoxLayout" name="horizontalLayout_4" stretch="0"> <property name="spacing"> <number>0</number> @@ -421,11 +375,8 @@ <height>16777215</height> </size> </property> - <property name="styleSheet"> - <string notr="true"/> - </property> <property name="currentIndex"> - <number>2</number> + <number>1</number> </property> <widget class="QWidget" name="generalSettings"> <property name="sizePolicy"> @@ -463,16 +414,22 @@ <number>0</number> </property> <item> - <layout class="QHBoxLayout" name="horizontalLayout_5" stretch="2,0,3"> + <layout class="QHBoxLayout" name="horizontalLayout_5" stretch="0,0,3"> + <property name="spacing"> + <number>7</number> + </property> <item> <spacer name="horizontalSpacer_16"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> <property name="sizeHint" stdset="0"> <size> - <width>50</width> - <height>20</height> + <width>48</width> + <height>0</height> </size> </property> </spacer> @@ -492,661 +449,864 @@ </size> </property> <layout class="QVBoxLayout" name="verticalLayout_5"> + <property name="leftMargin"> + <number>0</number> + </property> <property name="topMargin"> <number>0</number> </property> + <property name="rightMargin"> + <number>0</number> + </property> <property name="bottomMargin"> <number>0</number> </property> <item> - <layout class="QVBoxLayout" name="verticalLayout_4" stretch="2,0,0,0,0,0,0,0,0,0,0,0,0,0,5"> - <item> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label_4"> - <property name="font"> - <font> - <pointsize>11</pointsize> - </font> - </property> - <property name="text"> - <string>System</string> - </property> - </widget> - </item> - <item> - <spacer name="verticalSpacer_19"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_19"> - <property name="leftMargin"> - <number>40</number> - </property> - <property name="topMargin"> - <number>5</number> - </property> - <item> - <widget class="QCheckBox" name="notificationCheckBox"> - <property name="font"> - <font> - <pointsize>10</pointsize> - </font> - </property> - <property name="toolTip"> - <string>enable notifications checkbox</string> - </property> - <property name="styleSheet"> - <string notr="true">color: rgb(77, 77, 77);</string> - </property> - <property name="text"> - <string>Enable desktop notifications</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_20"> - <property name="leftMargin"> - <number>40</number> - </property> - <item> - <widget class="QCheckBox" name="closeOrMinCheckBox"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="font"> - <font> - <pointsize>10</pointsize> - </font> - </property> - <property name="toolTip"> - <string>keep minimized on close checkbox</string> - </property> - <property name="styleSheet"> - <string notr="true">color: rgb(77, 77, 77);</string> - </property> - <property name="text"> - <string>Keep minimized on close</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer_11"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>15</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_22"> - <property name="leftMargin"> - <number>40</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <item> - <widget class="QLabel" name="label_3"> - <property name="font"> - <font> - <pointsize>10</pointsize> - </font> - </property> - <property name="text"> - <string>Download folder</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_18"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="downloadButton"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="minimumSize"> - <size> - <width>150</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>30</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">QPushButton {background: rgb(245, 245, 245); border: 0px; border-radius: 3px; padding: 5px;} -QPushButton:hover {background: rgb(237,237, 237); border: 0px; border-radius: 3px;} -QPushButton:pressed {background: rgb(230,230, 230); border: 0px; border-radius: 3px;}</string> - </property> - <property name="icon"> - <iconset> - <normaloff>../../../../.designer/backup/images/icons/round-folder-24px.svg</normaloff>../../../../.designer/backup/images/icons/round-folder-24px.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - </widget> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer_18"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>30</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_11"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_28"> - <item> - <widget class="QLabel" name="label_2"> - <property name="font"> - <font> - <pointsize>11</pointsize> - </font> - </property> - <property name="text"> - <string>Recordings</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer_20"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_29"> - <property name="leftMargin"> - <number>40</number> - </property> - <property name="topMargin"> - <number>5</number> - </property> - <item> - <widget class="QLabel" name="label_5"> - <property name="font"> - <font> - <pointsize>10</pointsize> - </font> - </property> - <property name="text"> - <string>Save in</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_12"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="recordPathButton"> - <property name="minimumSize"> - <size> - <width>150</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>30</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">QPushButton {background: rgb(245, 245, 245); border: 0px; border-radius: 3px; padding: 5px;} -QPushButton:hover {background: rgb(237,237, 237); border: 0px; border-radius: 3px;} -QPushButton:pressed {background: rgb(230,230, 230); border: 0px; border-radius: 3px;}</string> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset> - <normaloff>../../../../.designer/backup/images/icons/round-folder-24px.svg</normaloff>../../../../.designer/backup/images/icons/round-folder-24px.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_30"> - <property name="leftMargin"> - <number>40</number> - </property> - <item> - <widget class="QCheckBox" name="alwaysRecordingCheckBox"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="font"> - <font> - <pointsize>10</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true">color: rgb(77, 77, 77);</string> - </property> - <property name="text"> - <string>Always Recording</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer_14"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label_6"> - <property name="font"> - <font> - <pointsize>11</pointsize> - </font> - </property> - <property name="text"> - <string>Updates</string> - </property> - </widget> - </item> - <item> - <spacer name="verticalSpacer_21"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <property name="leftMargin"> - <number>40</number> - </property> - <property name="topMargin"> - <number>5</number> - </property> - <item> - <widget class="QCheckBox" name="autoUpdateCheckBox"> - <property name="font"> - <font> - <pointsize>10</pointsize> - </font> - </property> - <property name="acceptDrops"> - <bool>false</bool> - </property> - <property name="toolTip"> - <string>Autamatic update checks checkbox</string> - </property> - <property name="styleSheet"> - <string notr="true">color: rgb(77, 77, 77);</string> - </property> - <property name="text"> - <string>Check for updates automatically every</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="intervalUpdateCheckSpinBox"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="maximumSize"> - <size> - <width>60</width> - <height>16777215</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="toolTip"> - <string>Interval between update checks in days selector</string> - </property> - <property name="suffix"> - <string> days</string> - </property> - <property name="minimum"> - <number>1</number> - </property> - <property name="value"> - <number>3</number> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_17"> - <property name="topMargin"> - <number>0</number> - </property> - <item> - <spacer name="horizontalSpacer_5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="checkUpdateButton"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>30</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="toolTip"> - <string>Check for updates now button</string> - </property> - <property name="styleSheet"> - <string notr="true">QPushButton {background: rgb(245, 245, 245); border: 0px; border-radius: 3px; padding: 5px;} -QPushButton:hover {background: rgb(237,237, 237); border: 0px; border-radius: 3px;} -QPushButton:pressed {background: rgb(230,230, 230); border: 0px; border-radius: 3px;}</string> - </property> - <property name="text"> - <string>Check for updates now</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <spacer name="accountSettingsBottom"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_17"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>50</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> - </widget> - <widget class="QWidget" name="currentAccountSettingsScrollWidget"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QScrollArea" name="scrollArea"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>580</height> - </size> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Plain</enum> - </property> - <property name="verticalScrollBarPolicy"> - <enum>Qt::ScrollBarAsNeeded</enum> - </property> - <property name="horizontalScrollBarPolicy"> - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - <property name="sizeAdjustPolicy"> - <enum>QAbstractScrollArea::AdjustIgnored</enum> - </property> - <property name="widgetResizable"> - <bool>true</bool> - </property> - <widget class="QWidget" name="scrollAreaWidgetContents"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>625</width> - <height>580</height> - </rect> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_12" stretch="0"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> + <widget class="QWidget" name="widget1" native="true"> + <layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,0,0,0,0,0,0,0,7"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <spacer name="verticalSpacer_21"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label_9"> + <property name="font"> + <font> + <pointsize>15</pointsize> + </font> + </property> + <property name="text"> + <string>General</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>24</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_7"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_4"> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>System</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_12"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_15"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="notificationLayout"> + <property name="spacing"> + <number>12</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="ToggleSwitch" name="notificationCheckBox" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="toolTip"> + <string>toggle enable notifications</string> + </property> + <property name="text" stdset="0"> + <string>Enable desktop notifications</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="closeOrMinLayout"> + <property name="spacing"> + <number>12</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="ToggleSwitch" name="closeOrMinCheckBox" native="true"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="toolTip"> + <string>Toggle keep minimized on close</string> + </property> + <property name="text" stdset="0"> + <string>Keep minimized on close</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_22"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_3"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Download folder</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_18"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="downloadButton"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="minimumSize"> + <size> + <width>320</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>180</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="icon"> + <iconset> + <normaloff>../../../../.designer/backup/images/icons/round-folder-24px.svg</normaloff>../../../../.designer/backup/images/icons/round-folder-24px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_18"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_11"> + <item> + <widget class="QLabel" name="label_2"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>Call Recordings</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_19"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_10"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_29"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_5"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Save in</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_12"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::MinimumExpanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="recordPathButton"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="minimumSize"> + <size> + <width>320</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>180</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset> + <normaloff>../../../../.designer/backup/images/icons/round-folder-24px.svg</normaloff>../../../../.designer/backup/images/icons/round-folder-24px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>24</width> + <height>24</height> + </size> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_30"> + <property name="spacing"> + <number>12</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="ToggleSwitch" name="alwaysRecordingCheckBox" native="true"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text" stdset="0"> + <string>Always Recording</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_14"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_14"> + <property name="topMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_6"> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>Updates</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_20"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_16"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <property name="spacing"> + <number>12</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="ToggleSwitch" name="autoUpdateCheckBox" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="acceptDrops"> + <bool>false</bool> + </property> + <property name="toolTip"> + <string>Toggle automatic updates</string> + </property> + <property name="text" stdset="0"> + <string>Check for updates automatically every</string> + </property> + <property name="checked" stdset="0"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="intervalUpdateCheckSpinBox"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="maximumSize"> + <size> + <width>180</width> + <height>16777215</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="toolTip"> + <string>Interval between update checks in days selector</string> + </property> + <property name="keyboardTracking"> + <bool>false</bool> + </property> + <property name="suffix"> + <string> days</string> + </property> + <property name="minimum"> + <number>1</number> + </property> + <property name="value"> + <number>3</number> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_17"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="QPushButton" name="checkUpdateButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="toolTip"> + <string>Check for updates now button</string> + </property> + <property name="text"> + <string>Check for updates now</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </item> + <item> + <spacer name="accountSettingsBottom"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::MinimumExpanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_17"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>50</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + <widget class="QWidget" name="currentAccountSettingsScrollWidget"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <spacer name="verticalSpacer_6"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>48</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_17"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="accountPageTitle"> + <property name="font"> + <font> + <pointsize>15</pointsize> + </font> + </property> + <property name="text"> + <string>Jami Account</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>50</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QScrollArea" name="scrollArea"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>580</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Plain</enum> + </property> + <property name="verticalScrollBarPolicy"> + <enum>Qt::ScrollBarAsNeeded</enum> + </property> + <property name="horizontalScrollBarPolicy"> + <enum>Qt::ScrollBarAlwaysOff</enum> + </property> + <property name="sizeAdjustPolicy"> + <enum>QAbstractScrollArea::AdjustIgnored</enum> + </property> + <property name="widgetResizable"> + <bool>true</bool> + </property> + <widget class="QWidget" name="scrollAreaWidgetContents"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>745</width> + <height>1416</height> + </rect> + </property> + <property name="styleSheet"> + <string notr="true">back</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_12" stretch="0"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> <layout class="QHBoxLayout" name="accountHorLayout" stretch="2,0,0,3"> <property name="spacing"> - <number>0</number> + <number>7</number> </property> <property name="topMargin"> <number>0</number> @@ -1156,9 +1316,12 @@ QPushButton:pressed {background: rgb(230,230, 230); border: 0px; border-radius: <property name="orientation"> <enum>Qt::Horizontal</enum> </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> <property name="sizeHint" stdset="0"> <size> - <width>460</width> + <width>48</width> <height>0</height> </size> </property> @@ -1183,15 +1346,15 @@ QPushButton:pressed {background: rgb(230,230, 230); border: 0px; border-radius: <height>0</height> </size> </property> - <layout class="QVBoxLayout" name="currentAccountSettingsScrollLayout" stretch="3,0,0,0,0,0,3,0,5"> + <layout class="QVBoxLayout" name="currentAccountSettingsScrollLayout" stretch="0,0,0,0,0,0,0,0,0,0,3,0,5"> <property name="spacing"> - <number>0</number> + <number>7</number> </property> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> - <number>0</number> + <number>3</number> </property> <property name="rightMargin"> <number>0</number> @@ -1200,7 +1363,180 @@ QPushButton:pressed {background: rgb(230,230, 230); border: 0px; border-radius: <number>0</number> </property> <item> - <spacer name="verticalSpacer_7"> + <spacer name="verticalSpacer_7"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>24</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_22"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="ToggleSwitch" name="accountEnableCheckBox" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text" stdset="0"> + <string>Enable</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_27"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_23"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_11"> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>Profile</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_16"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_29"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="PhotoboothWidget" name="currentAccountAvatar" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>261</width> + <height>261</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>261</width> + <height>261</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="displayNameLineEdit"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>261</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + <stylestrategy>PreferAntialias</stylestrategy> + </font> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_28"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> @@ -1210,154 +1546,238 @@ QPushButton:pressed {background: rgb(230,230, 230); border: 0px; border-radius: <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>40</height> + <height>20</height> </size> </property> </spacer> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_56"> - <property name="bottomMargin"> + <layout class="QVBoxLayout" name="verticalLayout_24"> + <property name="topMargin"> <number>0</number> </property> <item> - <layout class="QVBoxLayout" name="verticalLayout_17"> + <widget class="QLabel" name="label_12"> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>Identity</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_26"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_26"> <property name="spacing"> - <number>0</number> + <number>7</number> </property> <property name="leftMargin"> - <number>0</number> + <number>20</number> </property> <property name="topMargin"> <number>0</number> </property> + <property name="bottomMargin"> + <number>0</number> + </property> <item> - <spacer name="verticalSpacer_15"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>10</height> - </size> - </property> - </spacer> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <property name="bottomMargin"> - <number>20</number> + <layout class="QHBoxLayout" name="horizontalLayout_15"> + <property name="topMargin"> + <number>0</number> </property> <item> - <widget class="QPushButton" name="currentAccountAvatar"> + <widget class="QLabel" name="label_15"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Id</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="currentRingID"> <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="minimumSize"> <size> - <width>150</width> - <height>150</height> + <width>580</width> + <height>30</height> </size> </property> <property name="maximumSize"> <size> - <width>150</width> - <height>150</height> + <width>16777215</width> + <height>40</height> </size> </property> <property name="font"> <font> + <pointsize>10</pointsize> <stylestrategy>PreferAntialias</stylestrategy> </font> </property> - <property name="cursor"> - <cursorShape>PointingHandCursor</cursorShape> - </property> - <property name="styleSheet"> - <string notr="true">border: none;</string> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> </property> <property name="text"> <string/> </property> - <property name="iconSize"> - <size> - <width>160</width> - <height>160</height> - </size> - </property> - <property name="flat"> - <bool>false</bool> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> </property> </widget> </item> </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_64" stretch="0"> - <property name="spacing"> - <number>0</number> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_16"> <property name="topMargin"> <number>0</number> </property> - <property name="rightMargin"> + <property name="bottomMargin"> <number>0</number> </property> <item> - <widget class="QLineEdit" name="displayNameLineEdit"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>170</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>170</width> - <height>30</height> - </size> - </property> + <widget class="QLabel" name="lblRegisteredName"> <property name="font"> <font> - <pointsize>9</pointsize> - <stylestrategy>PreferAntialias</stylestrategy> + <pointsize>10</pointsize> </font> </property> - <property name="styleSheet"> - <string notr="true">border: 0px; border-radius: 3px; background: rgb(245, 245, 245);</string> - </property> <property name="text"> - <string/> + <string>Registered name</string> </property> </widget> </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_61"> + <item> + <widget class="QLineEdit" name="currentRegisteredID"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>300</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + <stylestrategy>PreferAntialias</stylestrategy> + </font> + </property> + <property name="mouseTracking"> + <bool>true</bool> + </property> + <property name="text"> + <string/> + </property> + <property name="frame"> + <bool>false</bool> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="readOnly"> + <bool>false</bool> + </property> + <property name="placeholderText"> + <string>Type here to register a username</string> + </property> + <property name="clearButtonEnabled"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="lookupStatusLabel"> + <property name="minimumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btnRegisterName"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Register</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_9"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::MinimumExpanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>1</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> </layout> </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_18"> - <property name="spacing"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> <item> - <spacer name="verticalSpacer_13"> + <spacer name="verticalSpacer_30"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> @@ -1373,644 +1793,77 @@ QPushButton:pressed {background: rgb(230,230, 230); border: 0px; border-radius: </spacer> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_58" stretch="0,40"> - <property name="spacing"> + <layout class="QHBoxLayout" name="horizontalLayout_13"> + <property name="topMargin"> <number>0</number> </property> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> <item> - <widget class="QWidget" name="widget_4" native="true"> + <widget class="QPushButton" name="passwdPushButton"> <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="minimumSize"> <size> - <width>114</width> - <height>0</height> + <width>261</width> + <height>30</height> </size> </property> <property name="maximumSize"> <size> - <width>110</width> + <width>16777215</width> <height>16777215</height> </size> </property> - <layout class="QVBoxLayout" name="verticalLayout_19"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_16"> - <property name="bottomMargin"> - <number>5</number> - </property> - <item> - <spacer name="horizontalSpacer_14"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>1</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label_11"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>40</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>40</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - <stylestrategy>PreferDefault</stylestrategy> - </font> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="text"> - <string>Account</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="textInteractionFlags"> - <set>Qt::NoTextInteraction</set> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_60"> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <spacer name="horizontalSpacer_42"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>1</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="currentRegisteredIDLabel"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>32</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>32</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Registered Name</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="textInteractionFlags"> - <set>Qt::NoTextInteraction</set> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_59"> - <property name="bottomMargin"> - <number>3</number> - </property> - <item> - <spacer name="horizontalSpacer_41"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>1</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="currentRingIDMessage"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>40</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>150</width> - <height>40</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - <stylestrategy>PreferAntialias</stylestrategy> - </font> - </property> - <property name="text"> - <string>ID</string> - </property> - <property name="textInteractionFlags"> - <set>Qt::NoTextInteraction</set> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QGridLayout" name="gridLayout_2"> - <property name="bottomMargin"> - <number>0</number> - </property> - <property name="spacing"> - <number>0</number> - </property> - <item row="0" column="0"> - <spacer name="horizontalSpacer_25"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>1</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="0" column="1"> - <widget class="QLabel" name="label_7"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>26</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>26</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Password</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="textInteractionFlags"> - <set>Qt::NoTextInteraction</set> - </property> - </widget> - </item> - <item row="1" column="1"> - <spacer name="verticalSpacer_16"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>2</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> - </widget> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_20"> - <property name="spacing"> - <number>0</number> + <property name="font"> + <font> + <pointsize>10</pointsize> + <underline>false</underline> + </font> </property> - <property name="leftMargin"> - <number>10</number> + <property name="text"> + <string>Change Password</string> </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_14"> - <property name="bottomMargin"> - <number>5</number> - </property> - <item> - <widget class="QCheckBox" name="accountEnableCheckBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>40</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>140</width> - <height>40</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="text"> - <string>Enable</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_15"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>1</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_61"> - <item> - <widget class="QLineEdit" name="currentRegisteredID"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>250</width> - <height>32</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>32</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - <stylestrategy>PreferAntialias</stylestrategy> - </font> - </property> - <property name="mouseTracking"> - <bool>true</bool> - </property> - <property name="styleSheet"> - <string notr="true">padding-left: 10; border: 1px solid black;</string> - </property> - <property name="text"> - <string/> - </property> - <property name="frame"> - <bool>false</bool> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> - </property> - <property name="readOnly"> - <bool>false</bool> - </property> - <property name="placeholderText"> - <string>Type here to register a username</string> - </property> - <property name="clearButtonEnabled"> - <bool>false</bool> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="regNameButton"> - <property name="minimumSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="iconSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="flat"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_9"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>1</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_62"> - <property name="spacing"> - <number>0</number> - </property> - <item> - <widget class="QLineEdit" name="currentRingID"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>290</width> - <height>40</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>40</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>8</pointsize> - <stylestrategy>PreferAntialias</stylestrategy> - </font> - </property> - <property name="layoutDirection"> - <enum>Qt::RightToLeft</enum> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="text"> - <string/> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_10"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>1</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_63"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <item> - <widget class="QPushButton" name="passwdPushButton"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>134</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>134</width> - <height>30</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - <underline>false</underline> - </font> - </property> - <property name="styleSheet"> - <string notr="true">border: 0px; border-radius: 3px; background: rgb(245, 245, 245); -padding: 5px; -</string> - </property> - <property name="text"> - <string>Change Password</string> - </property> - <property name="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_7"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_65"> - <property name="spacing"> - <number>15</number> - </property> - <property name="leftMargin"> - <number>10</number> - </property> - <property name="topMargin"> - <number>10</number> - </property> - <property name="rightMargin"> - <number>10</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> <item> - <spacer name="horizontalSpacer_19"> + <spacer name="horizontalSpacer_14"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> <property name="sizeHint" stdset="0"> <size> - <width>30</width> + <width>40</width> <height>20</height> </size> </property> </spacer> </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_9"> + <property name="topMargin"> + <number>0</number> + </property> <item> <widget class="QPushButton" name="btnExportAccount"> <property name="minimumSize"> <size> - <width>150</width> + <width>261</width> <height>30</height> </size> </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> - <property name="styleSheet"> - <string notr="true">border: 0px; border-radius: 3px; background: rgb(245, 245, 245); -padding: 5px; -</string> - </property> <property name="text"> <string>Export Account</string> </property> @@ -2019,24 +1872,39 @@ padding: 5px; </property> </widget> </item> + <item> + <spacer name="horizontalSpacer_15"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_11"> + <property name="topMargin"> + <number>0</number> + </property> <item> <widget class="QPushButton" name="btnDeletAccount"> <property name="minimumSize"> <size> - <width>150</width> + <width>261</width> <height>30</height> </size> </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> - <property name="styleSheet"> - <string notr="true">border: 0px; border-radius: 3px; background: rgb(245, 245, 245); -padding: 5px; -</string> - </property> <property name="text"> <string>Delete Account</string> </property> @@ -2046,16 +1914,13 @@ padding: 5px; </widget> </item> <item> - <spacer name="horizontalSpacer_26"> + <spacer name="horizontalSpacer_19"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> <property name="sizeHint" stdset="0"> <size> - <width>30</width> + <width>40</width> <height>20</height> </size> </property> @@ -2068,7 +1933,7 @@ padding: 5px; </layout> </item> <item> - <spacer name="verticalSpacer_8"> + <spacer name="verticalSpacer_29"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> @@ -2084,35 +1949,120 @@ padding: 5px; </spacer> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_66"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> + <layout class="QVBoxLayout" name="verticalLayout_18"> <property name="topMargin"> <number>0</number> </property> - <property name="rightMargin"> - <number>1</number> - </property> <property name="bottomMargin"> - <number>3</number> + <number>0</number> </property> <item> - <layout class="QGridLayout" name="gridLayout_8"> - <property name="topMargin"> - <number>0</number> + <widget class="QLabel" name="label"> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>30</height> + </size> </property> - <property name="bottomMargin"> - <number>0</number> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>Linked Devices</string> + </property> + <property name="textInteractionFlags"> + <set>Qt::NoTextInteraction</set> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_8"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_19"> <property name="spacing"> + <number>7</number> + </property> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> <number>0</number> </property> - <item row="0" column="0"> - <widget class="QLabel" name="label"> + <item> + <widget class="QListWidget" name="settingsListWidget"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>580</width> + <height>164</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>164</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="focusPolicy"> + <enum>Qt::TabFocus</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Plain</enum> + </property> + <property name="editTriggers"> + <set>QAbstractItemView::NoEditTriggers</set> + </property> + <property name="showDropIndicator" stdset="0"> + <bool>false</bool> + </property> + <property name="alternatingRowColors"> + <bool>false</bool> + </property> + <property name="selectionMode"> + <enum>QAbstractItemView::NoSelection</enum> + </property> + <property name="verticalScrollMode"> + <enum>QAbstractItemView::ScrollPerPixel</enum> + </property> + <property name="uniformItemSizes"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="linkDevPushButton"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> <property name="maximumSize"> <size> <width>16777215</width> @@ -2121,186 +2071,227 @@ padding: 5px; </property> <property name="font"> <font> - <pointsize>11</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="text"> - <string>Linked Devices</string> + <string>Link Another Device</string> + </property> + <property name="iconSize"> + <size> + <width>24</width> + <height>24</height> + </size> </property> - <property name="textInteractionFlags"> - <set>Qt::NoTextInteraction</set> + <property name="flat"> + <bool>false</bool> </property> </widget> </item> </layout> </item> - <item> - <spacer name="horizontalSpacer_46"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label_12"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>30</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="linkDevPushButton"> - <property name="minimumSize"> - <size> - <width>150</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>30</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="styleSheet"> - <string notr="true">border: 0px; border-radius: 3px; background: rgb(245, 245, 245); -padding: 5px; -</string> - </property> - <property name="text"> - <string>Link Another Device</string> - </property> - <property name="iconSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="flat"> - <bool>false</bool> - </property> - </widget> - </item> </layout> </item> <item> - <widget class="QListWidget" name="settingsListWidget"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <spacer name="verticalSpacer_13"> + <property name="orientation"> + <enum>Qt::Vertical</enum> </property> - <property name="minimumSize"> - <size> - <width>600</width> - <height>140</height> - </size> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> </property> - <property name="maximumSize"> + <property name="sizeHint" stdset="0"> <size> - <width>16777215</width> - <height>130</height> + <width>20</width> + <height>20</height> </size> </property> - <property name="styleSheet"> - <string notr="true">border: 1px solid grey;</string> - </property> - <property name="frameShadow"> - <enum>QFrame::Plain</enum> - </property> - <property name="editTriggers"> - <set>QAbstractItemView::NoEditTriggers</set> - </property> - <property name="showDropIndicator" stdset="0"> - <bool>false</bool> - </property> - <property name="alternatingRowColors"> - <bool>false</bool> - </property> - <property name="selectionMode"> - <enum>QAbstractItemView::NoSelection</enum> - </property> - <property name="uniformItemSizes"> - <bool>true</bool> - </property> - </widget> + </spacer> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_67"> - <property name="topMargin"> - <number>5</number> - </property> - <item> - <widget class="QPushButton" name="blockedContactsBtn"> - <property name="minimumSize"> - <size> - <width>120</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>180</width> - <height>30</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="layoutDirection"> - <enum>Qt::RightToLeft</enum> - </property> - <property name="styleSheet"> - <string notr="true">border: 0px; border-radius: 3px; background: rgb(245, 245, 245); -padding-right: 20px; -padding-left: 15px; -</string> - </property> - <property name="text"> - <string>Blocked Contacts</string> - </property> - <property name="iconSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_47"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> + <widget class="QWidget" name="bannedContactsLayoutWidget" native="true"> + <layout class="QVBoxLayout" name="verticalLayout_20"> + <property name="topMargin"> + <number>1</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_7"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>Banned Contacts</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_7"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>10</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="bannedContactsBtn"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>9</pointsize> + </font> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="ressources.qrc"> + <normaloff>:/images/icons/round-arrow_drop_down-24px.svg</normaloff>:/images/icons/round-arrow_drop_down-24px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_47"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::MinimumExpanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QWidget" name="bannedContactsListWidget" native="true"> + <property name="enabled"> + <bool>true</bool> + </property> + <layout class="QVBoxLayout" name="verticalLayout_21"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <spacer name="verticalSpacer_15"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QListWidget" name="bannedListWidget"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>580</width> + <height>150</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>150</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="focusPolicy"> + <enum>Qt::TabFocus</enum> + </property> + <property name="verticalScrollMode"> + <enum>QAbstractItemView::ScrollPerPixel</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> </item> <item> <spacer name="verticalSpacer_10"> @@ -2321,10 +2312,10 @@ padding-left: 15px; <item> <layout class="QHBoxLayout" name="horizontalLayout_68" stretch="1,0,1"> <property name="topMargin"> - <number>4</number> + <number>0</number> </property> <property name="bottomMargin"> - <number>15</number> + <number>0</number> </property> <item> <spacer name="horizontalSpacer_48"> @@ -2358,18 +2349,12 @@ padding-left: 15px; </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> <property name="layoutDirection"> <enum>Qt::RightToLeft</enum> </property> - <property name="styleSheet"> - <string notr="true">border: 0px; border-radius: 3px; background: rgb(245, 245, 245); -padding-right: 20px; -padding-left: 15px; -</string> - </property> <property name="text"> <string>Advanced Account Settings</string> </property> @@ -2405,12 +2390,12 @@ padding-left: 15px; <enum>Qt::Vertical</enum> </property> <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> + <enum>QSizePolicy::Minimum</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>0</height> + <height>48</height> </size> </property> </spacer> @@ -2455,7 +2440,7 @@ padding-left: 15px; </widget> </item> <item> - <spacer name="horizontalSpacer_3"> + <spacer name="horizontalSpacer_31"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -2494,9 +2479,6 @@ padding-left: 15px; <height>16777215</height> </size> </property> - <property name="styleSheet"> - <string notr="true">background-color: rgba(255, 255, 255, 255)</string> - </property> <layout class="QVBoxLayout" name="verticalLayoutsip_2"> <property name="spacing"> <number>0</number> @@ -2513,6 +2495,83 @@ padding-left: 15px; <property name="bottomMargin"> <number>0</number> </property> + <item> + <spacer name="verticalSpacer_31"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_14"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <spacer name="horizontalSpacer_10"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>48</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_27"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="accountPageTitleSIP"> + <property name="font"> + <font> + <pointsize>15</pointsize> + </font> + </property> + <property name="text"> + <string>SIP Account</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <spacer name="horizontalSpacer_25"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> <item> <widget class="QScrollArea" name="scrollSIPArea"> <property name="minimumSize"> @@ -2544,13 +2603,10 @@ padding-left: 15px; <rect> <x>0</x> <y>0</y> - <width>697</width> - <height>781</height> + <width>745</width> + <height>886</height> </rect> </property> - <property name="styleSheet"> - <string notr="true"/> - </property> <layout class="QHBoxLayout" name="horizontalLayoutsip_12" stretch="0"> <property name="spacing"> <number>0</number> @@ -2568,15 +2624,15 @@ padding-left: 15px; <number>0</number> </property> <item> - <layout class="QHBoxLayout" name="SIPaccountHorLayout" stretch="2,0,0,2"> + <layout class="QHBoxLayout" name="SIPaccountHorLayout" stretch="2,0,0,3"> <property name="spacing"> - <number>0</number> + <number>7</number> </property> <property name="sizeConstraint"> <enum>QLayout::SetDefaultConstraint</enum> </property> <property name="leftMargin"> - <number>50</number> + <number>0</number> </property> <property name="topMargin"> <number>0</number> @@ -2587,11 +2643,11 @@ padding-left: 15px; <enum>Qt::Horizontal</enum> </property> <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <enum>QSizePolicy::Fixed</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>460</width> + <width>48</width> <height>13</height> </size> </property> @@ -2610,21 +2666,27 @@ padding-left: 15px; </property> <item> <widget class="QWidget" name="centralSIPWidget" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="minimumSize"> <size> - <width>0</width> + <width>600</width> <height>0</height> </size> </property> - <layout class="QVBoxLayout" name="currentSIPAccountSettingsScrollLayout" stretch="3,0,0,0,0,0"> + <layout class="QVBoxLayout" name="currentSIPAccountSettingsScrollLayout" stretch="0,0,0,0,0,0,3,0,5"> <property name="spacing"> - <number>0</number> + <number>7</number> </property> <property name="leftMargin"> <number>0</number> </property> <property name="topMargin"> - <number>0</number> + <number>3</number> </property> <property name="rightMargin"> <number>0</number> @@ -2643,170 +2705,354 @@ padding-left: 15px; <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>40</height> + <height>24</height> </size> </property> </spacer> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayoutsip_56"> - <property name="bottomMargin"> - <number>0</number> + <layout class="QVBoxLayout" name="verticalLayout_28"> + <item> + <widget class="ToggleSwitch" name="accountSIPEnableCheckBox" native="true"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text" stdset="0"> + <string>Enable</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacerSIP_10"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_30"> + <item> + <widget class="QLabel" name="label_21"> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>Profile</string> + </property> + </widget> + </item> <item> - <spacer name="horizontalSpacer_31"> + <spacer name="verticalSpacer_32"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Vertical</enum> </property> <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <enum>QSizePolicy::Fixed</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> - <height>20</height> + <width>20</width> + <height>10</height> </size> </property> </spacer> </item> <item> - <layout class="QVBoxLayout" name="verticalLayoutsip_17"> - <property name="spacing"> - <number>0</number> - </property> + <layout class="QVBoxLayout" name="verticalLayout_25"> <property name="leftMargin"> - <number>0</number> + <number>20</number> </property> - <property name="topMargin"> + <property name="bottomMargin"> <number>0</number> </property> <item> - <spacer name="verticalSpacersip_15"> - <property name="orientation"> - <enum>Qt::Vertical</enum> + <widget class="PhotoboothWidget" name="currentSIPAccountAvatar" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> + <property name="minimumSize"> + <size> + <width>261</width> + <height>261</height> + </size> </property> - <property name="sizeHint" stdset="0"> + <property name="maximumSize"> <size> - <width>20</width> - <height>10</height> + <width>261</width> + <height>261</height> </size> </property> - </spacer> + </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayoutsip_2"> - <property name="bottomMargin"> - <number>20</number> + <widget class="QLineEdit" name="displaySIPNameLineEdit"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <item> - <widget class="QPushButton" name="currentSIPAccountAvatar"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>261</width> + <height>30</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + <stylestrategy>PreferAntialias</stylestrategy> + </font> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_33"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_31"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_22"> + <property name="font"> + <font> + <pointsize>13</pointsize> + </font> + </property> + <property name="text"> + <string>Identity</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_34"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_32"> + <property name="leftMargin"> + <number>20</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QFormLayout" name="formLayout"> + <property name="horizontalSpacing"> + <number>14</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="label_23"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Username</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLineEdit" name="usernameSIP"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>300</width> + <height>16777215</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_24"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Hostname</string> </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLineEdit" name="hostnameSIP"> <property name="minimumSize"> <size> - <width>150</width> - <height>150</height> + <width>0</width> + <height>30</height> </size> </property> <property name="maximumSize"> <size> - <width>150</width> - <height>150</height> + <width>300</width> + <height>16777215</height> </size> </property> <property name="font"> <font> - <stylestrategy>PreferAntialias</stylestrategy> + <pointsize>10</pointsize> </font> </property> - <property name="cursor"> - <cursorShape>PointingHandCursor</cursorShape> - </property> - <property name="styleSheet"> - <string notr="true">border: none;</string> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_26"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> </property> <property name="text"> - <string/> + <string>Proxy</string> </property> - <property name="iconSize"> + </widget> + </item> + <item row="3" column="1"> + <widget class="QLineEdit" name="passSIPlineEdit"> + <property name="minimumSize"> <size> - <width>160</width> - <height>160</height> + <width>0</width> + <height>30</height> </size> </property> - <property name="flat"> - <bool>false</bool> + <property name="maximumSize"> + <size> + <width>300</width> + <height>16777215</height> + </size> + </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="echoMode"> + <enum>QLineEdit::PasswordEchoOnEdit</enum> </property> </widget> </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutsip_64" stretch="0"> - <property name="spacing"> - <number>0</number> - </property> - <property name="topMargin"> - <number>20</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <item> - <widget class="QLineEdit" name="displaySIPNameLineEdit"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <item row="3" column="0"> + <widget class="QLabel" name="label_25"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="text"> + <string>Password</string> </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLineEdit" name="ProxySIP"> <property name="minimumSize"> <size> - <width>170</width> + <width>0</width> <height>30</height> </size> </property> <property name="maximumSize"> <size> - <width>170</width> - <height>30</height> + <width>300</width> + <height>16777215</height> </size> </property> <property name="font"> <font> - <pointsize>9</pointsize> - <stylestrategy>PreferAntialias</stylestrategy> + <pointsize>10</pointsize> </font> </property> - <property name="styleSheet"> - <string notr="true">border: 0px; border-radius: 3px; background: rgb(245, 245, 245);</string> - </property> - <property name="text"> - <string/> - </property> </widget> </item> </layout> </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayoutsip_18"> - <property name="spacing"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> <item> - <spacer name="verticalSpacerSIP_13"> + <spacer name="verticalSpacer_36"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> @@ -2816,666 +3062,29 @@ padding-left: 15px; <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>13</height> + <height>10</height> </size> </property> </spacer> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayoutsip_58" stretch="1,1"> - <property name="spacing"> - <number>0</number> - </property> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> - <item> - <widget class="QWidget" name="widgetSIP_4" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>114</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>110</width> - <height>16777215</height> - </size> - </property> - <layout class="QVBoxLayout" name="verticalLayoutSIP_19"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutSIP_16"> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <spacer name="horizontalSpacerSIP_14"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>1</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="labeSIPl_11"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>40</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>40</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - <stylestrategy>PreferDefault</stylestrategy> - </font> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="text"> - <string>Account</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="textInteractionFlags"> - <set>Qt::NoTextInteraction</set> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutSIP_60"> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <spacer name="horizontalSpacerSIP_42"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>1</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="currentSIPIDLabel"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>34</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>34</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>UserName</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="textInteractionFlags"> - <set>Qt::NoTextInteraction</set> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutSIP_59"> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <spacer name="horizontalSpacerSIP_41"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>1</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="currentSIPHostnameMessage"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>34</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>150</width> - <height>34</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - <stylestrategy>PreferAntialias</stylestrategy> - </font> - </property> - <property name="text"> - <string>Hostname</string> - </property> - <property name="textInteractionFlags"> - <set>Qt::NoTextInteraction</set> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QGridLayout" name="gridLayoutSIP_2"> - <property name="bottomMargin"> - <number>0</number> - </property> - <property name="spacing"> - <number>0</number> - </property> - <item row="0" column="0"> - <spacer name="horizontalSpacerSIP_25"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>1</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="0" column="1"> - <widget class="QLabel" name="labelSIP_7"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>34</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>34</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="text"> - <string>Password</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="textInteractionFlags"> - <set>Qt::NoTextInteraction</set> - </property> - </widget> - </item> - <item row="1" column="1"> - <spacer name="verticalSpacerSIP_16"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>2</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutSIP_100"> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <spacer name="horizontalSpacerSIP_101"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>1</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="currentSIPProxyMessage"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>34</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>150</width> - <height>34</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - <stylestrategy>PreferAntialias</stylestrategy> - </font> - </property> - <property name="text"> - <string>Proxy</string> - </property> - <property name="textInteractionFlags"> - <set>Qt::NoTextInteraction</set> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayoutsip_20"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>10</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutsip_14"> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QCheckBox" name="accountSIPEnableCheckBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>40</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>140</width> - <height>40</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>9</pointsize> - </font> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="text"> - <string>Enable</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacersip_15"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>1</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutSIP_61"> - <property name="spacing"> - <number>0</number> - </property> - <item> - <widget class="QLineEdit" name="usernameSIP"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>1000</width> - <height>1000</height> - </size> - </property> - <property name="font"> - <font> - <family>Times New Roman</family> - <pointsize>9</pointsize> - </font> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutSIP_62"> - <property name="spacing"> - <number>0</number> - </property> - <item> - <widget class="QLineEdit" name="hostnameSIP"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>1000</width> - <height>1000</height> - </size> - </property> - <property name="font"> - <font> - <family>Times New Roman</family> - <pointsize>9</pointsize> - </font> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutSIP_63"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>5</number> - </property> - <item> - <widget class="QLineEdit" name="passSIPlineEdit"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>1000</width> - <height>1000</height> - </size> - </property> - <property name="font"> - <font> - <family>Times New Roman</family> - <pointsize>9</pointsize> - </font> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="showhideButton"> - <property name="maximumSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacerSIP_7"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutSIP_102"> - <property name="spacing"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>5</number> - </property> - <item> - <widget class="QLineEdit" name="ProxySIP"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>1000</width> - <height>1000</height> - </size> - </property> - <property name="font"> - <font> - <family>Times New Roman</family> - <pointsize>9</pointsize> - </font> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutSIP_65"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_24"> <property name="topMargin"> <number>0</number> </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <spacer name="horizontalSpacer_29"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>10</width> - <height>20</height> - </size> - </property> - </spacer> - </item> <item> <widget class="QPushButton" name="btnSIPDeletAccount"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> <property name="minimumSize"> <size> - <width>233</width> - <height>30</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> + <width>261</width> <height>30</height> </size> </property> <property name="font"> <font> - <pointsize>9</pointsize> + <pointsize>10</pointsize> </font> </property> - <property name="styleSheet"> - <string notr="true">border: 0px; border-radius: 3px; background: rgb(245, 245, 245); -padding: 5px; -</string> - </property> <property name="text"> <string>Delete Account</string> </property> @@ -3489,12 +3098,9 @@ padding: 5px; <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> <property name="sizeHint" stdset="0"> <size> - <width>197</width> + <width>40</width> <height>20</height> </size> </property> @@ -3507,7 +3113,7 @@ padding: 5px; </layout> </item> <item> - <spacer name="verticalSpacerSIP_10"> + <spacer name="verticalSpacer_35"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> @@ -3517,18 +3123,18 @@ padding: 5px; <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>80</height> + <height>40</height> </size> </property> </spacer> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayoutSIP_68" stretch="0,0,0"> + <layout class="QHBoxLayout" name="horizontalLayoutSIP_68" stretch="1,0,1"> <property name="spacing"> - <number>0</number> + <number>7</number> </property> <property name="topMargin"> - <number>4</number> + <number>0</number> </property> <property name="bottomMargin"> <number>0</number> @@ -3552,21 +3158,21 @@ padding: 5px; <item> <widget class="QPushButton" name="advancedAccountSettingsSIPButton"> <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="minimumSize"> <size> - <width>230</width> - <height>45</height> + <width>180</width> + <height>30</height> </size> </property> <property name="maximumSize"> <size> - <width>230</width> - <height>45</height> + <width>16777215</width> + <height>30</height> </size> </property> <property name="font"> @@ -3577,12 +3183,6 @@ padding: 5px; <property name="layoutDirection"> <enum>Qt::RightToLeft</enum> </property> - <property name="styleSheet"> - <string notr="true">border: 0px; border-radius: 3px; background: rgb(245, 245, 245); -padding-right: 20px; -padding-left: 15px; -</string> - </property> <property name="text"> <string>Advanced Account Settings</string> </property> @@ -3612,31 +3212,18 @@ padding-left: 15px; </item> </layout> </item> - <item> - <spacer name="horizontalSpacerSIP_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>697</width> - <height>0</height> - </size> - </property> - </spacer> - </item> <item> <spacer name="verticalSpacerSIP_9"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> + <enum>QSizePolicy::Minimum</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>10</height> + <height>48</height> </size> </property> </spacer> @@ -3690,7 +3277,7 @@ padding-left: 15px; </property> <property name="sizeHint" stdset="0"> <size> - <width>300</width> + <width>322</width> <height>13</height> </size> </property> @@ -3752,21 +3339,27 @@ padding-left: 15px; <number>0</number> </property> <item> - <layout class="QGridLayout" name="gridLayout" columnstretch="2,0,3"> - <item row="0" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_10"> + <property name="spacing"> + <number>7</number> + </property> + <item> <spacer name="horizontalSpacer"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> - <height>20</height> + <width>48</width> + <height>0</height> </size> </property> </spacer> </item> - <item row="0" column="1"> + <item> <widget class="QWidget" name="widget_2" native="true"> <property name="minimumSize"> <size> @@ -3780,12 +3373,9 @@ padding-left: 15px; <height>16777215</height> </size> </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <layout class="QVBoxLayout" name="verticalLayout_8" stretch="2,0,0,0,0,2,1,5"> + <layout class="QVBoxLayout" name="verticalLayout_8" stretch="0,0,2,0,0,0,0,2,1,5"> <property name="spacing"> - <number>0</number> + <number>7</number> </property> <property name="leftMargin"> <number>0</number> @@ -3800,17 +3390,45 @@ padding-left: 15px; <number>0</number> </property> <item> - <spacer name="verticalSpacer_23"> + <spacer name="verticalSpacer_25"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <enum>QSizePolicy::Fixed</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>40</height> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label_13"> + <property name="font"> + <font> + <pointsize>15</pointsize> + </font> + </property> + <property name="text"> + <string>Audio / Video</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_23"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>24</height> </size> </property> </spacer> @@ -3818,20 +3436,20 @@ padding-left: 15px; <item> <layout class="QVBoxLayout" name="verticalLayout_9"> <property name="spacing"> - <number>0</number> + <number>7</number> </property> <item> <widget class="QLabel" name="label_16"> <property name="minimumSize"> <size> <width>0</width> - <height>30</height> + <height>0</height> </size> </property> <property name="maximumSize"> <size> <width>16777215</width> - <height>30</height> + <height>16777215</height> </size> </property> <property name="font"> @@ -3844,6 +3462,19 @@ padding-left: 15px; </property> </widget> </item> + <item> + <spacer name="verticalSpacer_11"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> <item> <layout class="QVBoxLayout" name="verticalLayout_12"> <property name="spacing"> @@ -3855,7 +3486,7 @@ padding-left: 15px; <item> <layout class="QHBoxLayout" name="horizontalLayout_32"> <property name="spacing"> - <number>0</number> + <number>7</number> </property> <item> <widget class="QLabel" name="label_18"> @@ -3924,7 +3555,7 @@ padding-left: 15px; <item> <layout class="QHBoxLayout" name="horizontalLayout_31"> <property name="spacing"> - <number>0</number> + <number>7</number> </property> <item> <widget class="QLabel" name="label_17"> @@ -4002,7 +3633,7 @@ padding-left: 15px; <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>10</height> + <height>20</height> </size> </property> </spacer> @@ -4010,7 +3641,7 @@ padding-left: 15px; <item> <layout class="QVBoxLayout" name="verticalLayout_6"> <property name="spacing"> - <number>0</number> + <number>7</number> </property> <property name="topMargin"> <number>0</number> @@ -4042,6 +3673,19 @@ padding-left: 15px; </property> </widget> </item> + <item> + <spacer name="verticalSpacer_17"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> <item> <layout class="QVBoxLayout" name="verticalLayout_13"> <property name="leftMargin"> @@ -4053,7 +3697,7 @@ padding-left: 15px; <item> <layout class="QHBoxLayout" name="horizontalLayout_33"> <property name="spacing"> - <number>0</number> + <number>7</number> </property> <item> <widget class="QLabel" name="label_20"> @@ -4113,7 +3757,7 @@ padding-left: 15px; <item> <layout class="QHBoxLayout" name="horizontalLayout_8"> <property name="spacing"> - <number>0</number> + <number>7</number> </property> <property name="topMargin"> <number>0</number> @@ -4180,7 +3824,7 @@ padding-left: 15px; <enum>Qt::Vertical</enum> </property> <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> + <enum>QSizePolicy::Expanding</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -4201,12 +3845,9 @@ padding-left: 15px; <property name="maximumSize"> <size> <width>16777215</width> - <height>300</height> + <height>224</height> </size> </property> - <property name="styleSheet"> - <string notr="true">background-color:black;</string> - </property> <layout class="QHBoxLayout" name="videoLayout" stretch="1,0,1"> <property name="spacing"> <number>0</number> @@ -4253,7 +3894,7 @@ padding-left: 15px; <property name="minimumSize"> <size> <width>510</width> - <height>300</height> + <height>224</height> </size> </property> <property name="maximumSize"> @@ -4268,9 +3909,6 @@ padding-left: 15px; <height>0</height> </size> </property> - <property name="styleSheet"> - <string notr="true"/> - </property> </widget> </item> <item> @@ -4332,7 +3970,7 @@ padding-left: 15px; </layout> </widget> </item> - <item row="0" column="2"> + <item> <spacer name="horizontalSpacer_11"> <property name="orientation"> <enum>Qt::Horizontal</enum> @@ -4380,7 +4018,27 @@ padding-left: 15px; <extends>QWidget</extends> <header location="global">advancedsipsettingwidget.h</header> </customwidget> + <customwidget> + <class>ToggleSwitch</class> + <extends>QWidget</extends> + <header>ToggleSwitch.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>IconButton</class> + <extends>QWidget</extends> + <header>iconbutton.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>PhotoboothWidget</class> + <extends>QWidget</extends> + <header>photoboothwidget.h</header> + <container>1</container> + </customwidget> </customwidgets> - <resources/> + <resources> + <include location="ressources.qrc"/> + </resources> <connections/> </ui> diff --git a/stylesheet.css b/stylesheet.css index 42817e8..65ae06d 100644 --- a/stylesheet.css +++ b/stylesheet.css @@ -1,3 +1,17 @@ +QToolTip { + color: white; + background-color: #109ede; + border: 1px solid white; +} + +QPushButton { + background-color: rgb(242, 242, 242); + border-style: solid; + border-width: 0px; + border-radius: 15px; + color: rgb(32, 32, 32); +} + QPushButton#takePhotoButton, QPushButton#importButton { background-color: rgb(242, 242, 242); border-radius: 5px; @@ -32,21 +46,11 @@ QPushButton#refuseButton:pressed, QPushButton#cancelButton:pressed{ background-color: #db3c30; } -QPushButton { - background-color: rgb(242, 242, 242); - border-style: solid; - border-width: 0px; - border-radius: 15px; - color: rgb(32, 32, 32); -} - QWidget#smartListOuterWidget { background-color: rgb(255, 255, 255); } -QPushButton#btnConversations, QPushButton#btnInvites, -QPushButton#btnExportAccount, QPushButton#btnDeletAccount, -QPushButton#btnSIPDeletAccount { +QPushButton#btnConversations, QPushButton#btnInvites { border-radius: 0px; border-top-left-radius: 15px; border-top-right-radius: 15px; @@ -60,9 +64,7 @@ QPushButton#btnSIPDeletAccount { border-left: 2px solid rgb(240, 240, 240); } -QPushButton#btnConversations:hover, QPushButton#btnInvites:hover, -QPushButton#btnExportAccount:hover, QPushButton#btnDeletAccount:hover, -QPushButton#btnSIPDeletAccount:hover { +QPushButton#btnConversations:hover, QPushButton#btnInvites:hover { background-color: rgb(188, 185, 184); border-top: 2px solid rgb(188, 185, 184); border-right: 2px solid rgb(188, 185, 184); @@ -70,8 +72,7 @@ QPushButton#btnSIPDeletAccount:hover { border-left: 2px solid rgb(188, 185, 184); } -QPushButton#btnConversations:checked, QPushButton#btnInvites:checked, -QPushButton#btnExportAccount:checked, QPushButton#btnDeletAccount:checked { +QPushButton#btnConversations:checked, QPushButton#btnInvites:checked { background-color: rgb(255, 255, 255); border-bottom: 2px solid rgb(255, 255, 255); } @@ -108,23 +109,6 @@ QPushButton#btnExitSettings:pressed, QPushButton#btnDeleteAccept:pressed, QPushB background-color: rgb(212, 212, 212); } -QPushButton#accountSettingsButton, QPushButton#generalSettingsButton, QPushButton#avSettingsButton { - border-radius: 0px; - background-color: transparent; -} - -QPushButton#accountSettingsButton:hover, -QPushButton#generalSettingsButton:hover, -QPushButton#avSettingsButton:hover { - background-color: rgb(245, 245, 245); -} - -QPushButton#accountSettingsButton:checked, -QPushButton#generalSettingsButton:checked, -QPushButton#avSettingsButton:checked { - background-color: rgb(240, 240, 240); -} - QWidget#searchBarLayoutWidget, QWidget#smartList, QWidget#sidePanelLayoutWidget, QWidget#leftSettingsWidget { border-right: 2px solid rgb(240, 240, 240); @@ -164,50 +148,6 @@ SmartListView { border: none; } -QListView#audioCodecView, QListView#videoCodecView, QListView#cipherListView{ - background-color: transparent; - border: 2px solid rgb(77, 77, 77); -} - -QListView#audioCodecView::item, QListView#videoCodecView::item, QListView#cipherListView::item { - height: 30px; - font: 30px; - -} - -QListView#audioCodecView::indicator, QListView#videoCodecView::indicator, -QListView#cipherListView::indicator{ - height : 12 px; - width : 12 px; - border: 2px solid rgb(77, 77, 77); - border-radius: 4px; - background: none; -} - -QListView#audioCodecView::indicator:checked, QListView#videoCodecView::indicator:checked, -QListView#cipherListView::indicator:checked{ - border-color: #2b4b7e; - background: #2b4b7e; - image: url(":/images/icons/ic_check_white_18dp_2x.png"); -} - -QListView#audioCodecView::item:selected, QListView#videoCodecView::item:selected, -QListView#cipherListView::item:selected{ - background-color: rgba(220, 220, 220, 255); - border: none; -} - -QListView#audioCodecView::item:hover, QListView#videoCodecView::item:hover, -QListView#cipherListView::item:hover{ - background-color: rgba(229, 229, 229, 255); - border-radius: 18px; -} - -QListView#cipherListView::item:disabled -{ - background-color: transparent; -} - SmartListView::item:selected, QListView#BannedList::item:selected { background-color: rgba(220, 220, 220, 255); border: none; @@ -304,7 +244,12 @@ QScrollBar::handle:vertical{ background: rgb(77, 77, 77); } -QWidget#messagingPage, QWidget#contactRequestPage, +QWidget#messagingPage { + background: rgb(255, 255, 255); +} + +QDialog#PasswordDialog, +QDialog#LinkDeviceDialog, QDialog#DeleteAccountDialog { background: rgb(255, 255, 255); } @@ -320,7 +265,6 @@ QPushButton#dhtImportBtn, QPushButton#fileImportBtn, QPushButton#changePassBtn, border-radius: 15px; height: 30px; color: white; - font: 14px; } QPushButton#nextButton:disabled, QPushButton#playButton:disabled, QPushButton#clearHistoryButton:disabled, @@ -340,7 +284,6 @@ QPushButton#cancelChangeBtn { background-color: rgb(251, 72, 71); border: 0px; color: white; - font: 14px; } QPushButton#nextButton:hover, QPushButton#playButton:hover, QPushButton#clearHistoryButton:hover, @@ -387,7 +330,7 @@ QComboBox{ border-top: transparent; border-left: transparent; border-right: transparent; - font: 11pt "Sans Serif"; + font-family: "Sans Serif"; padding: 2px; } @@ -428,23 +371,6 @@ QWidget#horizontalWidget{ background: transparent; } -QSpinBox { - background: transparent; - border-radius: 0px; - border-style: solid; - border-width: 2px; - border-color: #414141; - border-top: transparent; - border-left: transparent; - border-right: transparent; - font: 11pt "Sans Serif"; - padding: 2px; -} - -QSpinBox:focus { - border-color: #109ede; -} - QCheckBox::indicator{ height : 12 px; width : 12 px; @@ -525,7 +451,6 @@ QToolButton::menu-arrow {image:none;} QLabel#accountIdLabel, QLabel#accountAliasLabel, QLabel#deletionLabel1, QLabel#deletionLabel2, QLabel#warningLabel{ background: transparent; - font: 11pt "Sans Serif"; } QLabel#accountAliasLabel, QLabel#deletionLabel1, QLabel#deletionLabel2{ @@ -555,21 +480,204 @@ QPushButton#pictureButton:checked, QPushButton#fileButton:checked { } /* } setAvatarDialog */ +QSpinBox { + background-color: rgb(240, 240, 240); + border-radius: 14px; + height: 28px; + padding: 2px; + margin-bottom: 4px; +} + + QSpinBox::up-button { + subcontrol-origin: border; + subcontrol-position: top right; + width: 16px; + height: 18px; + padding-right: 4px; + margin-top: 3px; + } + + QSpinBox::down-button { + subcontrol-origin: border; + subcontrol-position: bottom right; + width: 16px; + height: 18px; + padding-right: 4px; + margin-bottom: 3px; + } + /* SettingsWidget { */ -QWidget#leftSettingsWidget, QWidget#rightSettingsWidget, -QWidget#DeleteAccountDialog, QWidget#AdvancedSettingsWidget, -QWidget#RegNameDialog, QWidget#PasswordDialog, QWidget#centralWidget, -QWidget#scrollAreaWidgetContents { +SettingsWidget QLabel#wrongPasswordLabel { + color: red; + margin-left: 8px; +} +SettingsWidget QLabel#exportedPIN { + color: darkblue; + margin-bottom: 4px; +} + +SettingsWidget QPushButton { + padding-right: 16px; + padding-left: 16px; + border-style: solid; + border-width: 0px; + border-radius: 15px; + color: rgb(32, 32, 32); + background-color: rgb(242, 242, 242); +} + + SettingsWidget QPushButton:hover { + background-color: rgb(237, 237, 237); + } + + SettingsWidget QPushButton:pressed { + background-color: rgb(212, 212, 212); + } + + SettingsWidget QPushButton:disabled { + color: gray; + } + +SettingsWidget QLabel:disabled { + color: rgb(160, 160, 160); +} + +SettingsWidget QWidget#leftSettingsWidget, +SettingsWidget QWidget#rightSettingsWidget, +SettingsWidget QWidget#DeleteAccountDialog, +SettingsWidget QWidget#advancedSettingsWidget, +SettingsWidget QWidget#advancedSIPSettingsWidget, +SettingsWidget QWidget#NameRegistrationDialog, +SettingsWidget QWidget#centralWidget, +SettingsWidget QWidget#centralSIPWidget, +SettingsWidget QWidget#scrollAreaWidgetContents, +SettingsWidget QWidget#scrollAreaSIPWidgetContents { background-color: rgba(255, 255, 255, 255); } -QLineEdit#currentRingID { +SettingsWidget .QLineEdit { + border-radius: 15px; + background-color: rgb(240, 240, 240); + padding-left: 8px; + padding-right: 8px; + height: 30px; +} + +SettingsWidget QLineEdit#currentRingID { border: 0px; + border-radius: 0px; + padding: 0px; + background-color: transparent; + font-weight: bold; +} + +SettingsWidget QLineEdit#currentRegisteredID { + border: 2px; + border-radius: 15px; padding: 1px; + padding-left: 8px; + margin-right: 4px; + border-style: solid; + background-color: rgb(240, 240, 240); +} + +SettingsWidget QPushButton#regNameButton { background-color: transparent; } -QPushButton#regNameButton { +SettingsWidget QWidget#videoLayoutWidget { + background-color: black; +} + +SettingsWidget QPushButton#btnDeletAccount, +SettingsWidget QPushButton#btnSIPDeletAccount { + background-color: rgb(252, 91, 90); + color: white; +} + + SettingsWidget QPushButton#btnDeletAccount:hover, + SettingsWidget QPushButton#btnSIPDeletAccount:hover { + background-color: red; + color: white; + } + + SettingsWidget QPushButton#btnDeletAccount:pressed, + SettingsWidget QPushButton#btnSIPDeletAccount:pressed { + background-color: darkred; + color: white; + } + +QListView .QLabel#labelDeviceId { + padding-left: 4px; + font-weight: 300; +} + +QListView .QLabel#labelThisDevice { + margin-right: 16px; + font-style: italic; + color: green; +} + +QListWidget .QLabel { + background-color: transparent; +} + +QListWidget .QLineEdit { + background-color: transparent; +} + +QListWidget .QPushButton { background-color: transparent; } + QListWidget .QPushButton:hover { + background-color: transparent; + } + QListWidget .QPushButton:pressed { + background-color: transparent; + } + +QListView::item:selected { + background-color: rgb(220, 220, 220); +} + +SettingsWidget QListView { + background-color: whitesmoke; + border: 1px solid rgb(212, 212, 212); + font-size: 16px; +} + + SettingsWidget QListView::item { + height: 30px; + font: 30px; + padding: 8px; + } + + SettingsWidget QListView::indicator { + height: 12 px; + width: 12 px; + border: 2px solid rgb(77, 77, 77); + border-radius: 4px; + background: none; + } + + SettingsWidget QListView::indicator:checked { + border-color: #2b4b7e; + background: #2b4b7e; + image: url(":/images/icons/ic_check_white_18dp_2x.png"); + } + + SettingsWidget QListView::item:selected { + background-color: rgba(220, 220, 220, 255); + border: none; + color: black; + } + + SettingsWidget QListView::item:hover { + background-color: rgba(229, 229, 229, 255); + } + + SettingsWidget QListView::item:disabled { + background-color: transparent; + } + /* } SettingsWidget */ \ No newline at end of file diff --git a/toggleswitch.cpp b/toggleswitch.cpp new file mode 100644 index 0000000..f7554a9 --- /dev/null +++ b/toggleswitch.cpp @@ -0,0 +1,152 @@ +/************************************************************************** +* Copyright (C) 2019 by Savoir-faire Linux * +* Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * +* * +* 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 <http://www.gnu.org/licenses/>. * +**************************************************************************/ + +// Based on: https://stackoverflow.com/questions/14780517/toggle-switch-in-qt + +#include "toggleswitch.h" +#include "ringthemeutils.h" + +ToggleSwitch::ToggleSwitch(QWidget *parent) + : QAbstractButton(parent), + width_(50), + opacity_(0.000), + switch_(false), + margin_(3), + thumb_("#d5d5d5"), + textMargin_(24), + anim_(new QPropertyAnimation(this, "offset", this)), + style_(SwitchStyle::UWP) +{ + setMouseTracking(true); + setBrush(QColor(43, 75, 126)); + setOffset(qreal(switch_)); + + if (style_ == SwitchStyle::UWP) { + pinRadius_ = height() * 0.5 - margin_; + knobRadius_ = pinRadius_ * 0.8; + height_ = 2 * pinRadius_; + pinWidth_ = height_ * 2; + width_ = pinWidth_; + } else { + knobRadius_ = height() * 0.5 - margin_; + pinRadius_ = knobRadius_ * 0.6; + height_ = 2 * knobRadius_; + pinWidth_ = height_; + width_ = pinWidth_ + 2 * knobRadius_; + } +} + +void ToggleSwitch::paintEvent(QPaintEvent *e) +{ + Q_UNUSED(e); + QPainter p(this); + //p.setOpacity(isEnabled() ? (switch_ ? 0.5 : 0.38) : 0.12); + //p.setOpacity(isEnabled() ? 1.0 : 0.12); + p.setOpacity(isEnabled() ? (switch_ ? 1.0 : 0.5) : 0.12); + p.setRenderHint(QPainter::Antialiasing, true); + + if (style_ == SwitchStyle::UWP) { + // pin + QPainterPath path; + p.setPen(switch_ ? Qt::NoPen : QPen(Qt::black, 2)); + path.addRoundedRect(QRect(1, + margin_, + pinWidth_, + 2 * pinRadius_), + pinRadius_, pinRadius_); + p.fillPath(path, (switch_ ? brush() : Qt::white)); + p.drawPath(path); + + // knob + p.setPen(Qt::NoPen); + p.setBrush(switch_ ? Qt::white : Qt::black); + p.drawEllipse(QPoint(1 + pinRadius_ + offset() * pinWidth_ * 0.5, + margin_ + pinRadius_), + knobRadius_, knobRadius_); + } else { + auto pinch = pinWidth_ / 8; + p.setPen(Qt::NoPen); + // pin + p.setBrush(isEnabled() ? (switch_ ? brush() : Qt::black) : Qt::black); + p.drawRoundedRect(QRect(1 + knobRadius_, + margin_ + knobRadius_ - pinRadius_, + pinWidth_, + 2 * pinRadius_), + pinRadius_, pinRadius_); + + // knob + p.setOpacity(1.0); + p.setBrush(isEnabled() ? thumb_ : QColor("#bdbdbd")); + p.drawEllipse(QPoint(1 + knobRadius_ + pinch + offset() * (pinWidth_ - pinch * 2), + margin_ + knobRadius_), + knobRadius_, knobRadius_); + } + p.setOpacity(1.0); + p.setPen(isEnabled() ? Qt::black : Qt::gray); + p.drawText(width_ + textMargin_, height_ - margin_, text_); +} + +void ToggleSwitch::mouseReleaseEvent(QMouseEvent *e) +{ + QRect activeArea(rect()); + auto textWidth = QFontMetrics(font()).size(Qt::TextSingleLine, text_).width(); + activeArea.setWidth(width_ + textMargin_ + textWidth); + if (e->button() & Qt::LeftButton + && activeArea.contains(e->pos())) { + switch_ = switch_ ? false : true; + thumb_ = switch_ ? brush_ : QBrush("#d5d5d5"); + if (switch_) { + anim_->setStartValue(0.0); + anim_->setEndValue(1.0); + anim_->setDuration(100); + anim_->start(); + } else { + anim_->setStartValue(offset()); + anim_->setEndValue(0.0); + anim_->setDuration(100); + anim_->start(); + } + emit clicked(switch_); + } +} + +void ToggleSwitch::mouseMoveEvent(QMouseEvent *e) +{ + QRect activeArea(rect()); + auto textWidth = QFontMetrics(font()).size(Qt::TextSingleLine, text_).width(); + activeArea.setWidth(width_ + textMargin_ + textWidth); + if (activeArea.contains(e->pos())) { + setCursor(Qt::PointingHandCursor); + } else { + setCursor(Qt::ArrowCursor); + } + QAbstractButton::mouseMoveEvent(e); +} + +QSize ToggleSwitch::sizeHint() const +{ + auto textWidth = QFontMetrics(font()).size(Qt::TextSingleLine, text_).width(); + return QSize(width_ + textMargin_ + textWidth, height_ + 2 * margin_); +} + +void ToggleSwitch::setChecked(bool state) +{ + switch_ = state; + setOffset(qreal(switch_)); + thumb_ = switch_ ? brush_ : QBrush("#d5d5d5"); +} \ No newline at end of file diff --git a/toggleswitch.h b/toggleswitch.h new file mode 100644 index 0000000..1b573d8 --- /dev/null +++ b/toggleswitch.h @@ -0,0 +1,85 @@ +/************************************************************************** +* Copyright (C) 2019 by Savoir-faire Linux * +* Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> * +* * +* 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 <http://www.gnu.org/licenses/>. * +**************************************************************************/ + +#pragma once + +#include <QtWidgets> + +class ToggleSwitch : public QAbstractButton { + Q_OBJECT; + + Q_PROPERTY(QString text READ text WRITE setText); + Q_PROPERTY(qreal offset READ offset WRITE setOffset); + Q_PROPERTY(QBrush brush READ brush WRITE setBrush); + +public: + enum class SwitchStyle { MATERIAL, UWP }; + + ToggleSwitch(QWidget* parent = nullptr); + + QSize sizeHint() const override; + + QString text() const { + return text_; + } + void setText(const QString& text) { + text_ = text; + } + + QBrush brush() const { + return brush_; + } + void setBrush(const QBrush &brush) { + brush_ = brush; + } + + qreal offset() const { + return offset_; + } + void setOffset(qreal o) { + offset_ = o; + update(); + } + + void setChecked(bool state); + +protected: + void paintEvent(QPaintEvent*) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent*) override; + +private: + QString text_; + bool switch_; + qreal opacity_; + qreal offset_; + SwitchStyle style_; + + int width_; + int height_; + int margin_; + int textMargin_; + int knobRadius_; + int pinRadius_; + int pinWidth_; + + QBrush thumb_; + QBrush track_; + QBrush brush_; + QPropertyAnimation *anim_ = nullptr; +}; \ No newline at end of file diff --git a/utils.cpp b/utils.cpp index 4c982b7..17e0747 100644 --- a/utils.cpp +++ b/utils.cpp @@ -38,9 +38,9 @@ #include <QApplication> #include <QFile> -#include "globalinstances.h" -#include "pixbufmanipulator.h" +#include <globalinstances.h> +#include "pixbufmanipulator.h" #include "globalsystemtray.h" #include "lrcinstance.h" @@ -217,7 +217,18 @@ Utils::setStackWidget(QStackedWidget* stack, QWidget* widget) void Utils::showSystemNotification(QWidget* widget, const QString & message, long delay) { - GlobalSystemTray::instance().showMessage("Jami", message); + GlobalSystemTray::instance().showMessage(message, "", QIcon(":images/jami.png")); + QApplication::alert(widget, delay); +} + +void Utils::showSystemNotification(QWidget* widget, + const QString & sender, + const QString & message, + long delay) +{ + QIcon(); + GlobalSystemTray::instance() + .showMessage(sender, message, QIcon(":images/jami.png")); QApplication::alert(widget, delay); } @@ -392,6 +403,109 @@ Utils::conversationPhoto(const std::string & convUid, const lrc::api::account::I return QImage(); } +QColor +Utils::getAvatarColor(const QString& canonicalUri) { + if (canonicalUri.isEmpty()) { + return RingTheme::defaultAvatarColor_; + } + auto h = QString(QCryptographicHash::hash(canonicalUri.toLocal8Bit(), QCryptographicHash::Md5).toHex()); + if (h.isEmpty() || h.isNull()) { + return RingTheme::defaultAvatarColor_; + } + auto colorIndex = std::string("0123456789abcdef").find(h.at(0).toLatin1()); + return RingTheme::avatarColors_[colorIndex]; +} + +// Generate a QImage representing a dummy user avatar, when user doesn't provide it. +// Current rendering is a flat colored circle with a centered letter. +// The color of the letter is computed from the circle color to be visible whaterver be the circle color. +QImage +Utils::fallbackAvatar(const QSize size, const QString& canonicalUriStr, const QString& letterStr) +{ + // We start with a transparent avatar + QImage avatar(size, QImage::Format_ARGB32); + avatar.fill(Qt::transparent); + + // We pick a color based on the passed character + QColor avColor = getAvatarColor(canonicalUriStr); + + // We draw a circle with this color + QPainter painter(&avatar); + painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); + painter.setPen(Qt::transparent); + painter.setBrush(avColor.lighter(110)); + painter.drawEllipse(avatar.rect()); + + // If a letter was passed, then we paint a letter in the circle, + // otherwise we draw the default avatar icon + QString letterStrCleaned(letterStr); + letterStrCleaned.remove(QRegExp("[\\n\\t\\r]")); + if (!letterStr.isEmpty()) { + auto letter = letterStr.at(0).toUpper().toLatin1(); + QFont font("Arial", avatar.height() / 2.66667, QFont::Medium); + painter.setFont(font); + painter.setPen(Qt::white); + painter.drawText(avatar.rect(), QString(letter), QTextOption(Qt::AlignCenter)); + } else { + QRect overlayRect = avatar.rect(); + qreal margin = (0.05 * overlayRect.width()); + overlayRect.moveLeft(overlayRect.left() + margin * 0.5); + overlayRect.moveTop(overlayRect.top() + margin * 0.5); + overlayRect.setWidth(overlayRect.width() - margin); + overlayRect.setHeight(overlayRect.height() - margin); + painter.drawPixmap(overlayRect, QPixmap(":/images/default_avatar_overlay.svg")); + } + + return avatar; +} + +QImage +Utils::fallbackAvatar(const QSize size, const ContactMethod* cm) +{ + if (cm == nullptr) { + return QImage(); + } + QImage image; + auto letterStr = QString(); + if (cm->uri().userinfo() != cm->bestName()) { + letterStr = cm->bestName(); + } + image = fallbackAvatar(size, + cm->uri().full(), + letterStr); + return image; +} + +QImage +Utils::fallbackAvatar(const QSize size, const std::string& alias, const std::string& uri) +{ + return fallbackAvatar(size, + QString::fromStdString(uri), + QString::fromStdString(alias)); +} + +QByteArray +Utils::QImageToByteArray(QImage image) +{ + QByteArray ba; + QBuffer buffer(&ba); + buffer.open(QIODevice::WriteOnly); + image.save(&buffer, "PNG"); + return ba; +} + +QImage +Utils::cropImage(const QImage& img) +{ + QRect rect; + auto w = img.width(); + auto h = img.height(); + if (w > h) { + return img.copy({ (w - h) / 2, 0, h, h }); + } + return img.copy({ 0, (h - w) / 2, w, w }); +} + QByteArray Utils::QByteArrayFromFile(const QString& filename) { @@ -418,6 +532,30 @@ Utils::generateTintedPixmap(const QString& filename, QColor color) return QPixmap::fromImage(tmpImage); } +QImage +Utils::scaleAndFrame(const QImage photo, const QSize& size) +{ + return photo.scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation); +} + +QImage +Utils::accountPhoto(const lrc::api::account::Info& accountInfo, const QSize& size) +{ + QImage photo; + if (!accountInfo.profileInfo.avatar.empty()) { + QByteArray ba = QByteArray::fromStdString(accountInfo.profileInfo.avatar); + photo = GlobalInstances::pixmapManipulator().personPhoto(ba, nullptr).value<QImage>(); + } else { + auto bestId = bestIdForAccount(accountInfo); + auto bestName = bestNameForAccount(accountInfo); + QString letterStr = bestId == bestName ? QString() : QString::fromStdString(bestName); + photo = fallbackAvatar(size, + QString::fromStdString("ring:" + bestId), + letterStr); + } + return scaleAndFrame(photo, size); +} + lrc::api::conversation::Info Utils::getConversationFromCallId(const std::string & callId) { @@ -465,3 +603,15 @@ Utils::getConversationFromUid(const std::string & convUid, bool filtered) } return lrc::api::conversation::Info(); } + +void +Utils::swapQListWidgetItems(QListWidget* list, bool down) +{ + QListWidgetItem *current = list->currentItem(); + int currIndex = list->row(current); + QListWidgetItem *other = list->item(list->row(current) + (down ? 1 : -1)); + int otherIndex = list->row(other); + QListWidgetItem *temp = list->takeItem(otherIndex); + down ? list->insertItem(currIndex, temp) : list->insertItem(otherIndex, current); + down ? list->insertItem(otherIndex, current) : list->insertItem(currIndex, temp); +} diff --git a/utils.h b/utils.h index 4aaff06..8de725c 100644 --- a/utils.h +++ b/utils.h @@ -17,11 +17,20 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * **************************************************************************/ - #pragma once -//Needed for OS detection +#include "ringthemeutils.h" + +#include <string> + +#include <QString> +#include <QImage> +#include <QStackedWidget> +#include <QTextDocument> +#include <QItemDelegate> #include <QtGlobal> +#include <QCryptographicHash> +#include <QListWidget> #ifdef Q_OS_WIN #include <windows.h> @@ -33,22 +42,17 @@ #define LPCWSTR char* #endif -#include <string> -#include <QString> -#include <QImage> -#include <QStackedWidget> -#include <QTextDocument> -#include <QItemDelegate> +#include <api/conversationmodel.h> +#include <api/account.h> +#include <api/contactmodel.h> +#include <api/contact.h> +#include <contactmethod.h> -#include "api/conversationmodel.h" -#include "api/account.h" -#include "api/contactmodel.h" -#include "api/contact.h" +static const QSize IMAGE_SIZE{ 128, 128 }; namespace Utils { - constexpr int animDuration_ = 200; // animation duration for sliding page in ms - + // system bool CreateStartupLink(); void DeleteStartupLink(); bool CreateLink(LPCWSTR lpszPathObj, LPCWSTR lpszPathLink); @@ -57,10 +61,11 @@ namespace Utils QString GenGUID(); QString GetISODate(); void InvokeMailto(const QString& subject, const QString& body, const QString& attachement = QString()); - QImage getCirclePhoto(const QImage original, int sizePhoto); void setStackWidget(QStackedWidget *stack, QWidget *widget); void showSystemNotification(QWidget* widget, const QString& message, long delay = 5000); + void showSystemNotification(QWidget* widget, const QString& sender, const QString& message, long delay = 5000); + // names std::string bestIdForConversation(const lrc::api::conversation::Info& conv, const lrc::api::ConversationModel& model); std::string bestIdForAccount(const lrc::api::account::Info & account); std::string bestNameForAccount(const lrc::api::account::Info & account); @@ -69,18 +74,36 @@ namespace Utils std::string bestNameForConversation(const lrc::api::conversation::Info & conv, const lrc::api::ConversationModel & model); std::string secondBestNameForAccount(const lrc::api::account::Info& account); // returns empty string if only infoHash is available lrc::api::profile::Type profileType(const lrc::api::conversation::Info & conv, const lrc::api::ConversationModel & model); + + // interactions std::string formatTimeString(const std::time_t& timestamp); lrc::api::ConversationModel::ConversationQueue::const_iterator getConversationFromUid(const std::string& uid, const lrc::api::ConversationModel& model); lrc::api::ConversationModel::ConversationQueue::const_iterator getConversationFromUri(const std::string& uri, const lrc::api::ConversationModel& model); bool isInteractionGenerated(const lrc::api::interaction::Type& interaction); bool isContactValid(const std::string& contactUid, const lrc::api::ConversationModel& model); + + // image + QImage getCirclePhoto(const QImage original, int sizePhoto); QImage conversationPhoto(const std::string& convUid, const lrc::api::account::Info& accountInfo); + QColor getAvatarColor(const QString& canonicalUri); + QImage fallbackAvatar(const QSize size, const QString& canonicalUriStr, const QString& letterStr = QString()); + QImage fallbackAvatar(const QSize size, const ContactMethod* cm); + QImage fallbackAvatar(const QSize size, const std::string& alias, const std::string& uri); + QByteArray QImageToByteArray(QImage image); QByteArray QByteArrayFromFile(const QString& filename); QPixmap generateTintedPixmap(const QString& filename, QColor color); + QImage scaleAndFrame(const QImage photo, const QSize& size = IMAGE_SIZE); + QImage accountPhoto(const lrc::api::account::Info& accountInfo, const QSize& size = IMAGE_SIZE); + QImage cropImage(const QImage& img); + + // convo lrc::api::conversation::Info getConversationFromCallId(const std::string& callId); lrc::api::conversation::Info getSelectedConversation(); lrc::api::conversation::Info getConversationFromUid(const std::string & convUid, bool filtered = true); + // misc helpers + void swapQListWidgetItems(QListWidget* list, bool down = true); + template <typename Func1, typename Func2> void oneShotConnect(const typename QtPrivate::FunctionPointer<Func1>::Object* sender, Func1 signal, Func2 slot) @@ -122,6 +145,14 @@ namespace Utils }); } + template<typename T> + void + setElidedText(T* object, const QString &text, Qt::TextElideMode mode = Qt::ElideMiddle, int padding = 32) { + QFontMetrics metrics(object->font()); + QString clippedText = metrics.elidedText(text, mode, object->width() - padding); + object->setText(clippedText); + } + template<typename E> constexpr inline typename std::enable_if< std::is_enum<E>::value, typename std::underlying_type<E>::type diff --git a/videooverlay.cpp b/videooverlay.cpp index 6e44463..acfde47 100644 --- a/videooverlay.cpp +++ b/videooverlay.cpp @@ -24,7 +24,6 @@ // LRC #include "callmodel.h" -#include "contactmethod.h" #include "person.h" #include "account.h" diff --git a/winsparkle b/winsparkle index 1110f62..6e7bb85 160000 --- a/winsparkle +++ b/winsparkle @@ -1 +1 @@ -Subproject commit 1110f626f4c659beb9fcb05e7ecac380b96c6d15 +Subproject commit 6e7bb8554852d7f964fd176c440dd29cc772f2dc -- GitLab