Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-client-windows
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
savoirfairelinux
jami-client-windows
Commits
643bf44f
Commit
643bf44f
authored
Apr 15, 2019
by
Andreas Traczyk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
settings: fixes crash when loading settings widget with no accounts
Change-Id: If11cb212d6a209b33d927f5911e3776818dcb0fe
parent
f37ed860
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
104 additions
and
65 deletions
+104
-65
advancedsettingswidget.h
advancedsettingswidget.h
+1
-1
callwidget.cpp
callwidget.cpp
+4
-0
callwidget.h
callwidget.h
+2
-0
mainwindow.cpp
mainwindow.cpp
+1
-0
navwidget.cpp
navwidget.cpp
+9
-4
navwidget.h
navwidget.h
+5
-4
newwizardwidget.cpp
newwizardwidget.cpp
+24
-19
newwizardwidget.h
newwizardwidget.h
+2
-0
ring-client-windows.vcxproj
ring-client-windows.vcxproj
+2
-1
ring-client-windows.vcxproj.filters
ring-client-windows.vcxproj.filters
+3
-3
settingswidget.cpp
settingswidget.cpp
+28
-33
settingswidget.h
settingswidget.h
+2
-0
utils.h
utils.h
+21
-0
No files found.
advancedsettingswidget.h
View file @
643bf44f
/***************************************************************************
* Copyright (C) 2019-2019 by Savoir-faire Linux
*
* 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 *
...
...
callwidget.cpp
View file @
643bf44f
...
...
@@ -265,6 +265,10 @@ CallWidget::updateCustomUI()
}
void
CallWidget
::
slotAccountOnBoarded
()
{}
int
CallWidget
::
getLeftPanelWidth
()
{
...
...
callwidget.h
View file @
643bf44f
...
...
@@ -67,6 +67,8 @@ public:
// NavWidget
virtual
void
navigated
(
bool
to
);
virtual
void
updateCustomUI
();
public
slots
:
virtual
void
slotAccountOnBoarded
();
public
slots
:
void
on_ringContactLineEdit_returnPressed
();
...
...
mainwindow.cpp
View file @
643bf44f
...
...
@@ -132,6 +132,7 @@ MainWindow::MainWindow(QWidget* parent) :
if
(
accountList
.
size
())
{
readSettingsFromRegistry
();
startScreen
=
ScreenEnum
::
CallScreen
;
emit
LRCInstance
::
instance
().
accountOnBoarded
();
}
else
{
startScreen
=
ScreenEnum
::
WizardScreen
;
}
...
...
navwidget.cpp
View file @
643bf44f
/***************************************************************************
* Copyright (C) 2015-201
7
by Savoir-faire Linux *
* Copyright (C) 2015-201
9
by Savoir-faire Linux *
* Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>*
* *
* This program is free software; you can redistribute it and/or modify *
...
...
@@ -18,10 +18,15 @@
#include "navwidget.h"
#include "lrcinstance.h"
#include "utils.h"
NavWidget
::
NavWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{}
QWidget
(
parent
)
{
Utils
::
oneShotConnect
(
&
LRCInstance
::
instance
(),
&
LRCInstance
::
accountOnBoarded
,
this
,
&
NavWidget
::
slotAccountOnBoarded
);
}
NavWidget
::~
NavWidget
()
{}
navwidget.h
View file @
643bf44f
/***************************************************************************
* Copyright (C) 2015-201
7
by Savoir-faire Linux *
* Copyright (C) 2015-201
9
by Savoir-faire Linux *
* Author: Edric Ladent Milaret <edric.ladent-milaret@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 *
...
...
@@ -21,7 +22,6 @@
#include <QWidget>
enum
ScreenEnum
{
//DO not add main widget screen before callScreen
WizardScreen
,
CallScreen
,
SetttingsScreen
,
...
...
@@ -41,7 +41,8 @@ public:
signals:
void
NavigationRequested
(
ScreenEnum
screen
);
void
BackRequested
();
};
protected
slots
:
virtual
void
slotAccountOnBoarded
()
=
0
;
};
newwizardwidget.cpp
View file @
643bf44f
...
...
@@ -158,6 +158,10 @@ NewWizardWidget::navigated(bool to)
Utils
::
setStackWidget
(
ui
->
stackedWidget
,
ui
->
welcomePage
);
}
void
NewWizardWidget
::
slotAccountOnBoarded
()
{}
void
NewWizardWidget
::
on_existingPushButton_clicked
()
{
...
...
@@ -448,8 +452,6 @@ NewWizardWidget::createAccount()
[
this
,
isRing
](
const
std
::
string
&
accountId
)
{
//set default ringtone
auto
confProps
=
LRCInstance
::
accountModel
().
getAccountConfig
(
accountId
);
if
(
confProps
.
username
.
empty
())
return
;
confProps
.
Ringtone
.
ringtonePath
=
Utils
::
GetRingtonePath
().
toStdString
();
if
(
!
isRing
)
{
// set SIP details
...
...
@@ -459,27 +461,29 @@ NewWizardWidget::createAccount()
confProps
.
proxyServer
=
inputPara_
[
"proxy"
].
toStdString
();
}
LRCInstance
::
accountModel
().
setAccountConfig
(
accountId
,
confProps
);
// RING SPECIFIC
if
(
isRing
)
{
connect
(
LRCInstance
::
editableAccountModel
(),
&
lrc
::
api
::
NewAccountModel
::
nameRegistrationEnded
,
[
this
]
{
lrc
::
api
::
account
::
ConfProperties_t
accountProperties
=
LRCInstance
::
accountModel
().
getAccountConfig
(
LRCInstance
::
getCurrAccId
());
LRCInstance
::
accountModel
().
setAccountConfig
(
LRCInstance
::
getCurrAccId
(),
accountProperties
);
if
(
!
confProps
.
username
.
empty
())
{
connect
(
LRCInstance
::
editableAccountModel
(),
&
lrc
::
api
::
NewAccountModel
::
nameRegistrationEnded
,
[
this
]
{
lrc
::
api
::
account
::
ConfProperties_t
accountProperties
=
LRCInstance
::
accountModel
().
getAccountConfig
(
LRCInstance
::
getCurrAccId
());
LRCInstance
::
accountModel
().
setAccountConfig
(
LRCInstance
::
getCurrAccId
(),
accountProperties
);
emit
NavigationRequested
(
ScreenEnum
::
CallScreen
);
emit
LRCInstance
::
instance
().
accountOnBoarded
();
});
LRCInstance
::
editableAccountModel
()
->
registerName
(
LRCInstance
::
getCurrAccId
(),
""
,
registeredName_
.
toStdString
()
);
}
else
{
emit
NavigationRequested
(
ScreenEnum
::
CallScreen
);
emit
LRCInstance
::
instance
().
accountOnBoarded
();
});
LRCInstance
::
editableAccountModel
()
->
registerName
(
LRCInstance
::
getCurrAccId
(),
""
,
registeredName_
.
toStdString
()
);
}
// END RING SPECIFIC
if
(
ui
->
setSIPAvatarWidget
->
hasAvatar
()
&&
wizardMode_
==
WizardMode
::
CREATESIP
)
{
LRCInstance
::
setCurrAccAvatar
(
ui
->
setSIPAvatarWidget
->
getAvatarPixmap
());
}
else
if
(
ui
->
setAvatarWidget
->
hasAvatar
()
&&
wizardMode_
==
WizardMode
::
CREATE
)
{
}
LRCInstance
::
setCurrAccAvatar
(
ui
->
setAvatarWidget
->
getAvatarPixmap
());
}
else
{
LRCInstance
::
setCurrAccAvatar
(
ui
->
setSIPAvatarWidget
->
getAvatarPixmap
());
}
});
Utils
::
oneShotConnect
(
&
LRCInstance
::
accountModel
(),
&
lrc
::
api
::
NewAccountModel
::
accountRemoved
,
...
...
@@ -515,6 +519,7 @@ NewWizardWidget::createAccount()
);
QThread
::
sleep
(
2
);
emit
NavigationRequested
(
ScreenEnum
::
CallScreen
);
emit
LRCInstance
::
instance
().
accountOnBoarded
();
}
});
changePage
(
ui
->
spinnerPage
);
...
...
newwizardwidget.h
View file @
643bf44f
...
...
@@ -53,6 +53,8 @@ public:
// NavWidget
virtual
void
navigated
(
bool
to
);
virtual
void
updateCustomUI
();
public
slots
:
virtual
void
slotAccountOnBoarded
();
//UI Slots
private
slots
:
...
...
ring-client-windows.vcxproj
View file @
643bf44f
...
...
@@ -452,9 +452,10 @@
<Define
Condition=
"'$(Configuration)|$(Platform)'=='ReleaseCompile|x64'"
>
_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;NIGHTLY_VERSION=20180706;ENABLE_AUTOUPDATE;QT_NO_DEBUG;NDEBUG
</Define>
</QtMoc>
<QtMoc
Include=
"settingswidget.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)'=='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
</Define>
<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>
<ClInclude
Include=
"utils.h"
/>
<QtMoc
Include=
"videooverlay.h"
>
...
...
ring-client-windows.vcxproj.filters
View file @
643bf44f
...
...
@@ -296,9 +296,6 @@
<QtMoc
Include=
"animationhelpers.h"
>
<Filter>
Header Files
</Filter>
</QtMoc>
<QtMoc
Include=
"settingswidget.h"
>
<Filter>
Header Files
</Filter>
</QtMoc>
<QtMoc
Include=
"passworddialog.h"
>
<Filter>
Header Files
</Filter>
</QtMoc>
...
...
@@ -332,6 +329,9 @@
<QtMoc
Include=
"advancedsipsettingwidget.h"
>
<Filter>
Header Files
</Filter>
</QtMoc>
<QtMoc
Include=
"settingswidget.h"
>
<Filter>
Header Files
</Filter>
</QtMoc>
</ItemGroup>
<ItemGroup>
<CustomBuild
Include=
"debug\moc_predefs.h.cbt"
>
...
...
settingswidget.cpp
View file @
643bf44f
/***************************************************************************
* Copyright (C) 2019-2019 by Savoir-faire Linux *
* Author: Isa Nanic <isa.nanic@savoirfairelinux.com> *
* 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: 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 *
* 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/>. *
**************************************************************************/
* Copyright (C) 2019 by Savoir-faire Linux *
* Author: Isa Nanic <isa.nanic@savoirfairelinux.com> *
* 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: Mingrui Zhang <mingrui.zhang@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 <https://www.gnu.org/licenses/>. *
**************************************************************************/
#include "settingswidget.h"
#include "ui_settingswidget.h"
...
...
@@ -82,8 +83,6 @@ SettingsWidget::SettingsWidget(QWidget* parent)
//display name SIP
ui
->
displaySIPNameLineEdit
->
setAlignment
(
Qt
::
AlignHCenter
);
setSelected
(
Button
::
accountSettingsButton
);
//SIP User Name
ui
->
usernameSIP
->
setStyleSheet
(
"border : 0px;"
);
...
...
@@ -131,20 +130,16 @@ SettingsWidget::SettingsWidget(QWidget* parent)
auto
accountList
=
LRCInstance
::
accountModel
().
getAccountList
();
if
(
!
accountList
.
size
())
{
Utils
::
oneShotConnect
(
&
LRCInstance
::
instance
(),
&
LRCInstance
::
accountOnBoarded
,
[
this
]()
{
setConnections
();
});
}
else
{
setConnections
();
}
ui
->
containerWidget
->
setVisible
(
false
);
}
void
SettingsWidget
::
slotAccountOnBoarded
()
{
setSelected
(
Button
::
accountSettingsButton
);
setConnections
();
}
void
SettingsWidget
::
navigated
(
bool
to
)
{
...
...
settingswidget.h
View file @
643bf44f
...
...
@@ -56,6 +56,8 @@ public:
// NavWidget
virtual
void
navigated
(
bool
to
);
virtual
void
updateCustomUI
();
public
slots
:
virtual
void
slotAccountOnBoarded
();
public
slots
:
void
updateSettings
(
int
size
);
...
...
utils.h
View file @
643bf44f
...
...
@@ -101,6 +101,27 @@ namespace Utils
});
}
template
<
typename
Func1
,
typename
Func2
>
void
oneShotConnect
(
const
typename
QtPrivate
::
FunctionPointer
<
Func1
>::
Object
*
sender
,
Func1
signal
,
const
typename
QtPrivate
::
FunctionPointer
<
Func2
>::
Object
*
receiver
,
Func2
slot
)
{
QMetaObject
::
Connection
*
const
connection
=
new
QMetaObject
::
Connection
;
*
connection
=
QObject
::
connect
(
sender
,
signal
,
receiver
,
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment