Commit f9465493 authored by Andreas Traczyk's avatar Andreas Traczyk

code cleanup, ui fixes

Change-Id: I28377c6594db54c72ae9ce6eacad6939476dddfe
parent 7d5aa7c2
......@@ -45,7 +45,6 @@
#include "localprofilecollection.h"
// client
#include "wizarddialog.h"
#include "windowscontactbackend.h"
#include "globalsystemtray.h"
#include "conversationitemdelegate.h"
......@@ -847,39 +846,45 @@ CallWidget::showIMOutOfCall(const QModelIndex& nodeIdx)
bool shouldShowSendContactRequestBtn = !isContact && isRINGAccount;
ui->sendContactRequestButton->setVisible(shouldShowSendContactRequestBtn);
auto convModel = LRCInstance::getCurrentConversationModel();
auto currentConversation = Utils::getConversationFromUid(LRCInstance::getSelectedConvUid(),
*convModel);
ui->messageView->setMessagesVisibility(false);
ui->messageView->clear();
ui->messageView->printHistory(*convModel, currentConversation->interactions, true);
// Contact Avatars
auto accInfo = &LRCInstance::getCurrentAccountInfo();
auto contactUri = currentConversation->participants.front();
try {
auto& contact = accInfo->contactModel->getContact(contactUri);
auto bestName = Utils::bestNameForConversation(*currentConversation, *convModel);
ui->messageView->setInvitation(
(contact.profileInfo.type == lrc::api::profile::Type::PENDING),
bestName,
accInfo->contactModel->getContactProfileId(contact.profileInfo.uri)
);
if (!contact.profileInfo.avatar.empty()) {
ui->messageView->setSenderImage(
accInfo->contactModel->getContactProfileId(contactUri),
contact.profileInfo.avatar);
} else {
auto avatar = Utils::conversationPhoto(LRCInstance::getSelectedConvUid(), *accInfo);
QByteArray ba;
QBuffer bu(&ba);
avatar.save(&bu, "PNG");
std::string avatarString = ba.toBase64().toStdString();
ui->messageView->setSenderImage(
accInfo->contactModel->getContactProfileId(contactUri),
avatarString);
}
} catch (...) { }
Utils::oneShotConnect(ui->messageView, &MessageWebView::messagesCleared,
[this] {
auto convModel = LRCInstance::getCurrentConversationModel();
auto currentConversation = Utils::getConversationFromUid(LRCInstance::getSelectedConvUid(),
*convModel);
ui->messageView->printHistory(*convModel, currentConversation->interactions);
Utils::oneShotConnect(ui->messageView, &MessageWebView::messagesLoaded,
[this] {
ui->messageView->setMessagesVisibility(true);
});
// Contact Avatars
auto accInfo = &LRCInstance::getCurrentAccountInfo();
auto contactUri = currentConversation->participants.front();
try {
auto& contact = accInfo->contactModel->getContact(contactUri);
auto bestName = Utils::bestNameForConversation(*currentConversation, *convModel);
ui->messageView->setInvitation(
(contact.profileInfo.type == lrc::api::profile::Type::PENDING),
bestName,
accInfo->contactModel->getContactProfileId(contact.profileInfo.uri)
);
if (!contact.profileInfo.avatar.empty()) {
ui->messageView->setSenderImage(
accInfo->contactModel->getContactProfileId(contactUri),
contact.profileInfo.avatar);
} else {
auto avatar = Utils::conversationPhoto(LRCInstance::getSelectedConvUid(), *accInfo);
QByteArray ba;
QBuffer bu(&ba);
avatar.save(&bu, "PNG");
std::string avatarString = ba.toBase64().toStdString();
ui->messageView->setSenderImage(
accInfo->contactModel->getContactProfileId(contactUri),
avatarString);
}
} catch (...) {}
});
}
void
......@@ -909,15 +914,9 @@ void
CallWidget::on_imBackButton_clicked()
{
ui->messageView->clear();
QMetaObject::Connection* const connection = new QMetaObject::Connection;
*connection = connect(ui->messageView, &MessageWebView::messagesCleared,
[this, connection] {
qDebug() << "messagesCleared";
if (connection) {
QObject::disconnect(*connection);
delete connection;
}
backToWelcomePage();
Utils::oneShotConnect(ui->messageView, &MessageWebView::messagesCleared,
[this] {
QTimer::singleShot(33, this, [this] { backToWelcomePage(); });
});
}
......
......@@ -370,7 +370,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="mainLayout">
<property name="spacing">
<number>0</number>
</property>
......@@ -401,7 +401,7 @@
<string/>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="welcomePage">
<property name="sizePolicy">
......
......@@ -39,7 +39,6 @@
#include "callmodel.h"
#include "callwidget.h"
#include "utils.h"
#include "wizarddialog.h"
#include "version.h"
MainWindow::MainWindow(QWidget* parent) :
......
......@@ -196,12 +196,11 @@ MessageWebView::removeInteraction(uint64_t interactionId)
void
MessageWebView::printHistory(lrc::api::ConversationModel& conversationModel,
const std::map<uint64_t,
lrc::api::interaction::Info> interactions,
bool fadeIn)
lrc::api::interaction::Info> interactions)
{
auto interactionsStr = interactionsToJsonArrayObject(conversationModel, interactions).toUtf8();
QString s = QString::fromLatin1("printHistory(%1,%2);")
.arg(interactionsStr.constData()).arg(fadeIn);
QString s = QString::fromLatin1("printHistory(%1);")
.arg(interactionsStr.constData());
page()->runJavaScript(s, QWebEngineScript::MainWorld);
}
......@@ -234,18 +233,6 @@ MessageWebView::setMessagesVisibility(bool visible)
page()->runJavaScript(s, QWebEngineScript::MainWorld);
}
void
MessageWebView::hideEvent(QHideEvent*)
{
setMessagesVisibility(false);
}
void
MessageWebView::showEvent(QShowEvent*)
{
setMessagesVisibility(true);
}
// JS bridging incoming
Q_INVOKABLE int
PrivateBridging::log(const QString& arg)
......@@ -255,7 +242,7 @@ PrivateBridging::log(const QString& arg)
}
Q_INVOKABLE int
PrivateBridging::messagesCleared()
PrivateBridging::emitMessagesCleared()
{
if (auto messageView = qobject_cast<MessageWebView*>(this->parent())) {
emit messageView->messagesCleared();
......@@ -263,6 +250,15 @@ PrivateBridging::messagesCleared()
return 0;
}
Q_INVOKABLE int
PrivateBridging::emitMessagesLoaded()
{
if (auto messageView = qobject_cast<MessageWebView*>(this->parent())) {
emit messageView->messagesLoaded();
}
return 0;
}
Q_INVOKABLE int
PrivateBridging::deleteInteraction(const QString& arg)
{
......
......@@ -42,7 +42,8 @@ public:
Q_INVOKABLE int acceptInvitation();
Q_INVOKABLE int refuseInvitation();
Q_INVOKABLE int blockConversation();
Q_INVOKABLE int messagesCleared();
Q_INVOKABLE int emitMessagesCleared();
Q_INVOKABLE int emitMessagesLoaded();
};
class MessageWebView : public QWebEngineView
......@@ -68,8 +69,7 @@ public:
void removeInteraction(uint64_t interactionId);
void printHistory(lrc::api::ConversationModel& conversationModel,
const std::map<uint64_t,
lrc::api::interaction::Info> interactions,
bool fadeIn = false);
lrc::api::interaction::Info> interactions);
void setSenderImage(const std::string& sender,
const std::string& senderImage);
void setInvitation(bool show,
......@@ -77,13 +77,10 @@ public:
const std::string& contactId = "");
void setMessagesVisibility(bool visible);
protected:
void hideEvent(QHideEvent*);
void showEvent(QShowEvent*);
signals:
void conversationRemoved();
void messagesCleared();
void messagesLoaded();
private slots:
void slotLoadFinished();
......
......@@ -406,9 +406,8 @@ NewWizardWidget::createRingAccount(const QString &displayName,
const QString &pin,
const QString &archivePath)
{
QMetaObject::Connection* const connection = new QMetaObject::Connection;
*connection = connect(&LRCInstance::accountModel(), &lrc::api::NewAccountModel::accountAdded,
[this, connection](const std::string& accountId) {
Utils::oneShotConnect(&LRCInstance::accountModel(), &lrc::api::NewAccountModel::accountAdded,
[this](const std::string& accountId) {
//set default ringtone
auto confProps = LRCInstance::accountModel().getAccountConfig(accountId);
confProps.Ringtone.ringtonePath = Utils::GetRingtonePath().toStdString();
......@@ -428,10 +427,6 @@ NewWizardWidget::createRingAccount(const QString &displayName,
if (ui->setAvatarWidget->hasAvatar()) {
LRCInstance::setCurrAccAvatar(ui->setAvatarWidget->getAvatarPixmap());
}
QObject::disconnect(*connection);
if (connection) {
delete connection;
}
});
QtConcurrent::run(
[=] {
......
......@@ -69,7 +69,7 @@
<TargetExt>.lib</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PreBuildEventUseInBuild>false</PreBuildEventUseInBuild>
<PreBuildEventUseInBuild>true</PreBuildEventUseInBuild>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
......@@ -284,16 +284,8 @@
<ClCompile Include="videowidget.cpp" />
<ClCompile Include="webchathelpers.cpp" />
<ClCompile Include="windowscontactbackend.cpp" />
<ClCompile Include="wizarddialog.cpp" />
<ClCompile Include="wizardwidget.cpp" />
</ItemGroup>
<ItemGroup>
<QtMoc Include="wizardwidget.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>
<IncludePath Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|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>
<Define Condition="'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'">_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;NIGHTLY_VERSION=20180706;ENABLE_AUTOUPDATE;QT_NO_DEBUG;NDEBUG</Define>
</QtMoc>
<QtMoc Include="aboutdialog.h">
</QtMoc>
<QtMoc Include="bannedcontactswidget.h">
......@@ -451,8 +443,6 @@
<ClInclude Include="version.h" />
<ClInclude Include="webchathelpers.h" />
<ClInclude Include="windowscontactbackend.h" />
<QtMoc Include="wizarddialog.h">
</QtMoc>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="debug\moc_predefs.h.cbt">
......@@ -481,7 +471,6 @@
<ClInclude Include="ui_ringbutton.h" />
<ClInclude Include="ui_videooverlay.h" />
<ClInclude Include="ui_videoview.h" />
<ClInclude Include="ui_wizarddialog.h" />
</ItemGroup>
<ItemGroup>
<None Include="translations\ring_client_windows.ts" />
......@@ -588,11 +577,6 @@
</QtUic>
<QtUic Include="videoview.ui">
</QtUic>
<QtUic Include="wizarddialog.ui">
</QtUic>
<QtUic Include="wizardwidget.ui">
<SubType>Designer</SubType>
</QtUic>
</ItemGroup>
<ItemGroup>
<None Include="images\FontAwesome.otf" />
......
......@@ -117,9 +117,6 @@
<ClCompile Include="windowscontactbackend.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="wizarddialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="smartlistview.cpp">
<Filter>Source Files</Filter>
</ClCompile>
......@@ -147,9 +144,6 @@
<ClCompile Include="invitebuttonswidget.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="wizardwidget.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="currentaccountcombobox.cpp">
<Filter>Source Files</Filter>
</ClCompile>
......@@ -266,9 +260,6 @@
<ClInclude Include="windowscontactbackend.h">
<Filter>Header Files</Filter>
</ClInclude>
<QtMoc Include="wizarddialog.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="smartlistmodel.h">
<Filter>Header Files</Filter>
</QtMoc>
......@@ -293,9 +284,6 @@
<QtMoc Include="invitebuttonswidget.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="wizardwidget.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="currentaccountcombobox.h">
<Filter>Header Files</Filter>
</QtMoc>
......@@ -373,9 +361,6 @@
<ClInclude Include="ui_videoview.h">
<Filter>Generated Files</Filter>
</ClInclude>
<ClInclude Include="ui_wizarddialog.h">
<Filter>Generated Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="translations\ring_client_windows.ts">
......@@ -587,15 +572,9 @@
<QtUic Include="videoview.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="wizarddialog.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="invitebuttonswidget.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="wizardwidget.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="settingswidget.ui">
<Filter>Form Files</Filter>
</QtUic>
......
......@@ -16,8 +16,12 @@
* 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/>. *
**************************************************************************/
#include "settingswidget.h"
#include "ui_settingswidget.h"
#include <QPixmap>
#include <QTimer>
#include <QModelIndex>
......@@ -27,43 +31,27 @@
#include <QMessageBox>
#include <QSettings>
// account settings
#include "api/newdevicemodel.h"
#include "utils.h"
#include "settingsitemwidget.h"
#include "settingswidget.h"
#include "ui_settingswidget.h"
#include "ui_advancedsettingswidget.h"
#include "passworddialog.h"
#include "regnamedialog.h"
#include "ui_regnamedialog.h"
#include "setavatardialog.h"
#include "ui_setavatardialog.h"
#include "deleteaccountdialog.h"
#include "ui_deleteaccountdialog.h"
// general Settings
#include "winsparkle.h"
#include "api/newdevicemodel.h"
#include "media/recordingmodel.h"
// av setttings
#include "audio/settings.h"
#include "audio/outputdevicemodel.h"
#include "audio/inputdevicemodel.h"
#include "video/devicemodel.h"
#include "video/channel.h"
#include "video/resolution.h"
#include "video/rate.h"
#include "video/previewmanager.h"
#include "callmodel.h"
#include "winsparkle.h"
SettingsWidget::SettingsWidget(QWidget* parent)
: NavWidget(parent),
ui(new Ui::SettingsWidget),
......@@ -130,13 +118,11 @@ SettingsWidget::SettingsWidget(QWidget* parent)
auto accountList = LRCInstance::accountModel().getAccountList();
if (!accountList.size()) {
QMetaObject::Connection* toDisconnect = &accountAddedConnection_;
accountAddedConnection_ = connect(&LRCInstance::accountModel(),
Utils::oneShotConnect(&LRCInstance::accountModel(),
&lrc::api::NewAccountModel::accountAdded,
[this, toDisconnect](const std::string& accountId) {
[this](const std::string& accountId) {
Q_UNUSED(accountId);
setConnections();
QObject::disconnect(*toDisconnect);
});
} else {
setConnections();
......
......@@ -36,7 +36,6 @@
// av settings
#include "video/devicemodel.h"
namespace Ui {
class SettingsWidget;
}
......@@ -122,11 +121,9 @@ private slots:
void setButtonIconSlot(int frame);
// ************************* General Settings *************************
private:
void populateGeneralSettings();
QMetaObject::Connection accountAddedConnection_;
private slots:
void setNotificationsSlot(int state);
......
......@@ -358,16 +358,6 @@ Utils::formatTimeString(const std::time_t& timestamp)
}
}
const lrc::api::conversation::Info*
Utils::getConversationPtrFromUid(const std::string& uid, const lrc::api::ConversationModel& model) {
auto currentConversation = Utils::getConversationFromUid(LRCInstance::getSelectedConvUid(), model);
auto conversations = model.allFilteredConversations();
if (currentConversation == conversations.end()) {
return nullptr;
}
return &(conversations[std::distance(model.allFilteredConversations().begin(), currentConversation)]);
}
lrc::api::ConversationModel::ConversationQueue::const_iterator
Utils::getConversationFromUid(const std::string& uid, const lrc::api::ConversationModel& model) {
return std::find_if(model.allFilteredConversations().begin(), model.allFilteredConversations().end(),
......@@ -453,4 +443,4 @@ Utils::getConversationFromCallId(const std::string& callId)
}
}
return "";
}
\ No newline at end of file
}
......@@ -71,7 +71,6 @@ namespace Utils
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);
std::string formatTimeString(const std::time_t& timestamp);
const lrc::api::conversation::Info * getConversationPtrFromUid(const std::string & uid, const lrc::api::ConversationModel & model);
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);
......@@ -81,6 +80,26 @@ namespace Utils
QPixmap generateTintedPixmap(const QString& filename, QColor color);
std::string getConversationFromCallId(const std::string& callId);
template <typename Func1, typename Func2>
void
oneShotConnect(const typename QtPrivate::FunctionPointer<Func1>::Object* sender, Func1 signal, Func2 slot)
{
QMetaObject::Connection* const connection = new QMetaObject::Connection;
*connection = QObject::connect(sender, signal, slot);
QMetaObject::Connection* const disconnectConnection = new QMetaObject::Connection;
*disconnectConnection = QObject::connect(sender, signal,
[connection, disconnectConnection] {
if (connection) {
QObject::disconnect(*connection);
delete connection;
}
if (disconnectConnection) {
QObject::disconnect(*disconnectConnection);
delete disconnectConnection;
}
});
}
template<typename E>
constexpr inline typename std::enable_if< std::is_enum<E>::value,
typename std::underlying_type<E>::type
......
......@@ -48,19 +48,14 @@ VideoOverlay::VideoOverlay(QWidget* parent) :
auto accountList = LRCInstance::accountModel().getAccountList();
if (!accountList.size()) {
QMetaObject::Connection* const connection = new QMetaObject::Connection;
connect(&LRCInstance::accountModel(),
Utils::oneShotConnect(&LRCInstance::accountModel(),
&lrc::api::NewAccountModel::accountAdded,
[this, connection](const std::string& accountId) {
[this](const std::string& accountId) {
Q_UNUSED(accountId);
connect(LRCInstance::getCurrentCallModel(), &lrc::api::NewCallModel::callStarted,
[this](const std::string& tempCallId) {
callId = tempCallId;
});
if (connection) {
QObject::disconnect(*connection);
delete connection;
}
});
} else {
connect(LRCInstance::getCurrentCallModel(), &lrc::api::NewCallModel::callStarted,
......
......@@ -283,20 +283,6 @@ function sendFile()
window.jsbridge.sendFile();
}
/**
* Clear all messages.
*/
/* exported clearMessages */
function clearMessages()
{
while (messages.firstChild) {
messages.removeChild(messages.firstChild)
}
canLazyLoad = false
window.jsbridge.messagesCleared()
}
/**
* Convert text to HTML.
*/
......@@ -1480,6 +1466,20 @@ function showMessagesDiv()
}
}
/**
* Clear all messages.
*/
/* exported clearMessages */
function clearMessages()
{
canLazyLoad = false
while (messages.firstChild) {
messages.removeChild(messages.firstChild)
}
window.jsbridge.emitMessagesCleared()
}
/**
* Set history buffer, initialize messages div and display a first batch
* of messages.
......@@ -1490,11 +1490,8 @@ function showMessagesDiv()
* @param messages_array should contain history to be printed
*/
/* exported printHistory */
function printHistory(messages_array, fadein = false)
function printHistory(messages_array)
{
if(fadein)
hideMessagesDiv()
historyBuffer = messages_array
historyBufferIndex = 0
......@@ -1504,8 +1501,7 @@ function printHistory(messages_array, fadein = false)
canLazyLoad = true
if(fadein)
showMessagesDiv()
window.jsbridge.emitMessagesLoaded()
}
/**
......
This diff is collapsed.
/**************************************************************************
* Copyright (C) 2015-2017 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> *
* *
* 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 <QDialog>
#include <QtConcurrent/QtConcurrent>
#include "account.h"
#include "person.h"
#include "lrcinstance.h"
namespace Ui {
class WizardDialog;
}
class WizardDialog : public QDialog
{
Q_OBJECT
public:
using AccountInfo = lrc::api::account::Info;
enum WizardMode {
WIZARD,
NEW_ACCOUNT,
IMPORT,
MIGRATION
};
public:
explicit WizardDialog(WizardMode wizardMode = WIZARD, AccountInfo* toBeMigrated = nullptr, QWidget* parent = 0);
~WizardDialog();
//UI Slots
private slots:
void on_existingPushButton_clicked();
void on_newAccountButton_clicked();
void on_nextButton_clicked();
void on_previousButton_clicked();
void on_passwordEdit_textChanged(const QString& arg1);
private slots:
void on_usernameEdit_textChanged(const QString& arg1);
void handle_registeredNameFound(Account *account, NameDirectory::LookupStatus status, const QString& address, const QString& name);
void handle_nameRegistrationEnded(NameDirectory::RegisterNameStatus status, const QString& name);
void timeoutNameLookupTimer();
void on_photoTaken(QString fileName);
void on_signUpCheckbox_toggled(bool checked);
void closeEvent(QCloseEvent* event);
void on_archivePathSelector_clicked();
void on_dhtImportBtn_clicked();
void on_fileImportBtn_clicked();
void slotAccountAdded(const std::string & accountId);
private:
Ui::WizardDialog* ui;
AccountInfo* account_;
WizardMode wizardMode_;
QMovie* movie_;
QTimer nameLookupTimer_;
void setup();
void changePage(bool existingAccount);
void validateFileImport();
void createRingAccount(const QString &displayName = QString(),
const QString &password = QString(),
const QString &pin = QString(),
const QString &archivePath = QString());
void processWizardInformations();
};
This diff is collapsed.
This diff is collapsed.
/**************************************************************************
* 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> *
* 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 <QDialog>
#include <QtConcurrent/QtConcurrent>
#include "account.h"
#include "person.h"
#include "lrcinstance.h"
#include "navwidget.h"
namespace Ui {
class WizardWidget;
}
class WizardWidget : public NavWidget
{
Q_OBJECT