@ -78,7 +78,7 @@
# include "src/widget/form/settingswidget.h"
# include "src/widget/form/settingswidget.h"
# include "src/widget/style.h"
# include "src/widget/style.h"
# include "src/widget/translator.h"
# include "src/widget/translator.h"
# include "src/widget/tool/i messageboxmanager.h"
# include "src/widget/tool/messageboxmanager.h"
# include "tool/removechatdialog.h"
# include "tool/removechatdialog.h"
# include "src/persistence/smileypack.h"
# include "src/persistence/smileypack.h"
@ -142,7 +142,7 @@ void Widget::acceptFileTransfer(const ToxFile& file, const QString& path)
Widget * Widget : : instance { nullptr } ;
Widget * Widget : : instance { nullptr } ;
Widget : : Widget ( Profile & profile_ , IAudioControl & audio_ , CameraSource & cameraSource_ ,
Widget : : Widget ( Profile & profile_ , IAudioControl & audio_ , CameraSource & cameraSource_ ,
Settings & settings_ , Style & style_ , IMessageBoxManager & messageBoxManager_ , QWidget * parent )
Settings & settings_ , Style & style_ , QWidget * parent )
: QMainWindow ( parent )
: QMainWindow ( parent )
, profile { profile_ }
, profile { profile_ }
, trayMenu { nullptr }
, trayMenu { nullptr }
@ -159,7 +159,7 @@ Widget::Widget(Profile &profile_, IAudioControl& audio_, CameraSource& cameraSou
, documentCache ( new DocumentCache ( * smileyPack , settings ) )
, documentCache ( new DocumentCache ( * smileyPack , settings ) )
, cameraSource { cameraSource_ }
, cameraSource { cameraSource_ }
, style { style_ }
, style { style_ }
, messageBoxManager ( messageBoxManager_ )
, messageBoxManager ( new MessageBoxManager ( this ) )
, friendList ( new FriendList ( ) )
, friendList ( new FriendList ( ) )
, contentDialogManager ( new ContentDialogManager ( * friendList ) )
, contentDialogManager ( new ContentDialogManager ( * friendList ) )
{
{
@ -268,7 +268,7 @@ void Widget::init()
sharedMessageProcessorParams . reset ( new MessageProcessor : : SharedParams ( core - > getMaxMessageSize ( ) , coreExt - > getMaxExtendedMessageSize ( ) ) ) ;
sharedMessageProcessorParams . reset ( new MessageProcessor : : SharedParams ( core - > getMaxMessageSize ( ) , coreExt - > getMaxExtendedMessageSize ( ) ) ) ;
chatListWidget = new FriendListWidget ( * core , this , settings , style ,
chatListWidget = new FriendListWidget ( * core , this , settings , style ,
messageBoxManager , * friendList , settings . getGroupchatPosition ( ) ) ;
* messageBoxManager , * friendList , settings . getGroupchatPosition ( ) ) ;
connect ( chatListWidget , & FriendListWidget : : searchCircle , this , & Widget : : searchCircle ) ;
connect ( chatListWidget , & FriendListWidget : : searchCircle , this , & Widget : : searchCircle ) ;
connect ( chatListWidget , & FriendListWidget : : connectCircleWidget , this ,
connect ( chatListWidget , & FriendListWidget : : connectCircleWidget , this ,
& Widget : : connectCircleWidget ) ;
& Widget : : connectCircleWidget ) ;
@ -296,9 +296,9 @@ void Widget::init()
style . setThemeColor ( settings , settings . getThemeColor ( ) ) ;
style . setThemeColor ( settings , settings . getThemeColor ( ) ) ;
CoreFile * coreFile = core - > getCoreFile ( ) ;
CoreFile * coreFile = core - > getCoreFile ( ) ;
filesForm = new FilesForm ( * coreFile , settings , style , messageBoxManager , * friendList ) ;
filesForm = new FilesForm ( * coreFile , settings , style , * messageBoxManager , * friendList ) ;
addFriendForm = new AddFriendForm ( core - > getSelfId ( ) , settings , style ,
addFriendForm = new AddFriendForm ( core - > getSelfId ( ) , settings , style ,
messageBoxManager , * core ) ;
* messageBoxManager , * core ) ;
groupInviteForm = new GroupInviteForm ( settings , * core ) ;
groupInviteForm = new GroupInviteForm ( settings , * core ) ;
# if UPDATE_CHECK_ENABLED
# if UPDATE_CHECK_ENABLED
@ -306,13 +306,13 @@ void Widget::init()
connect ( updateCheck . get ( ) , & UpdateCheck : : updateAvailable , this , & Widget : : onUpdateAvailable ) ;
connect ( updateCheck . get ( ) , & UpdateCheck : : updateAvailable , this , & Widget : : onUpdateAvailable ) ;
# endif
# endif
settingsWidget = new SettingsWidget ( updateCheck . get ( ) , audio , core , * smileyPack ,
settingsWidget = new SettingsWidget ( updateCheck . get ( ) , audio , core , * smileyPack ,
cameraSource , settings , style , messageBoxManager , this ) ;
cameraSource , settings , style , * messageBoxManager , this ) ;
# if UPDATE_CHECK_ENABLED
# if UPDATE_CHECK_ENABLED
updateCheck - > checkForUpdate ( ) ;
updateCheck - > checkForUpdate ( ) ;
# endif
# endif
profileInfo = new ProfileInfo ( core , & profile , settings ) ;
profileInfo = new ProfileInfo ( core , & profile , settings ) ;
profileForm = new ProfileForm ( profileInfo , settings , style , messageBoxManager ) ;
profileForm = new ProfileForm ( profileInfo , settings , style , * messageBoxManager ) ;
# if DESKTOP_NOTIFICATIONS
# if DESKTOP_NOTIFICATIONS
notificationGenerator . reset ( new NotificationGenerator ( settings , & profile ) ) ;
notificationGenerator . reset ( new NotificationGenerator ( settings , & profile ) ) ;
@ -1159,7 +1159,7 @@ void Widget::addFriend(uint32_t friendId, const ToxPk& friendPk)
auto rawChatroom = new FriendChatroom ( newfriend , contentDialogManager . get ( ) , * core , settings ) ;
auto rawChatroom = new FriendChatroom ( newfriend , contentDialogManager . get ( ) , * core , settings ) ;
std : : shared_ptr < FriendChatroom > chatroom ( rawChatroom ) ;
std : : shared_ptr < FriendChatroom > chatroom ( rawChatroom ) ;
const auto compact = settings . getCompactLayout ( ) ;
const auto compact = settings . getCompactLayout ( ) ;
auto widget = new FriendWidget ( chatroom , compact , settings , style , messageBoxManager ) ;
auto widget = new FriendWidget ( chatroom , compact , settings , style , * messageBoxManager ) ;
connectFriendWidget ( * widget ) ;
connectFriendWidget ( * widget ) ;
auto history = profile . getHistory ( ) ;
auto history = profile . getHistory ( ) ;
@ -1174,7 +1174,7 @@ void Widget::addFriend(uint32_t friendId, const ToxPk& friendPk)
* friendMessageDispatcher , * friendList ) ;
* friendMessageDispatcher , * friendList ) ;
auto friendForm = new ChatForm ( profile , newfriend , * chatHistory ,
auto friendForm = new ChatForm ( profile , newfriend , * chatHistory ,
* friendMessageDispatcher , * documentCache , * smileyPack , cameraSource ,
* friendMessageDispatcher , * documentCache , * smileyPack , cameraSource ,
settings , style , messageBoxManager , * contentDialogManager , * friendList ) ;
settings , style , * messageBoxManager , * contentDialogManager , * friendList ) ;
connect ( friendForm , & ChatForm : : updateFriendActivity , this , & Widget : : updateFriendActivity ) ;
connect ( friendForm , & ChatForm : : updateFriendActivity , this , & Widget : : updateFriendActivity ) ;
friendMessageDispatchers [ friendPk ] = friendMessageDispatcher ;
friendMessageDispatchers [ friendPk ] = friendMessageDispatcher ;
@ -1831,7 +1831,7 @@ void Widget::onUpdateAvailable()
ContentDialog * Widget : : createContentDialog ( ) const
ContentDialog * Widget : : createContentDialog ( ) const
{
{
ContentDialog * contentDialog = new ContentDialog ( * core , settings , style ,
ContentDialog * contentDialog = new ContentDialog ( * core , settings , style ,
messageBoxManager , * friendList ) ;
* messageBoxManager , * friendList ) ;
registerContentDialog ( * contentDialog ) ;
registerContentDialog ( * contentDialog ) ;
return contentDialog ;
return contentDialog ;
@ -2157,7 +2157,7 @@ Group* Widget::createGroup(uint32_t groupnumber, const GroupId& groupId)
groupAlertConnections . insert ( groupId , notifyReceivedConnection ) ;
groupAlertConnections . insert ( groupId , notifyReceivedConnection ) ;
auto form = new GroupChatForm ( * core , newgroup , * chatHistory , * messageDispatcher ,
auto form = new GroupChatForm ( * core , newgroup , * chatHistory , * messageDispatcher ,
settings , * documentCache , * smileyPack , style , messageBoxManager , * friendList ) ;
settings , * documentCache , * smileyPack , style , * messageBoxManager , * friendList ) ;
connect ( & settings , & Settings : : nameColorsChanged , form , & GenericChatForm : : setColorizedNames ) ;
connect ( & settings , & Settings : : nameColorsChanged , form , & GenericChatForm : : setColorizedNames ) ;
form - > setColorizedNames ( settings . getEnableGroupChatsColor ( ) ) ;
form - > setColorizedNames ( settings . getEnableGroupChatsColor ( ) ) ;
groupMessageDispatchers [ groupId ] = messageDispatcher ;
groupMessageDispatchers [ groupId ] = messageDispatcher ;