|
|
|
@ -225,7 +225,6 @@ void Widget::init()
@@ -225,7 +225,6 @@ void Widget::init()
|
|
|
|
|
addFriendForm = new AddFriendForm; |
|
|
|
|
groupInviteForm = new GroupInviteForm; |
|
|
|
|
profileForm = new ProfileForm(); |
|
|
|
|
settingsWidget = new SettingsWidget(); |
|
|
|
|
|
|
|
|
|
//connect logout tray menu action
|
|
|
|
|
connect(actionLogout, &QAction::triggered, profileForm, &ProfileForm::onLogoutClicked); |
|
|
|
@ -234,12 +233,11 @@ void Widget::init()
@@ -234,12 +233,11 @@ void Widget::init()
|
|
|
|
|
Core* core = Nexus::getCore(); |
|
|
|
|
connect(core, &Core::fileDownloadFinished, filesForm, &FilesForm::onFileDownloadComplete); |
|
|
|
|
connect(core, &Core::fileUploadFinished, filesForm, &FilesForm::onFileUploadComplete); |
|
|
|
|
connect(&s, &Settings::showSystemTrayChanged, this, &Widget::onSetShowSystemTray); |
|
|
|
|
connect(core, &Core::selfAvatarChanged, profileForm, &ProfileForm::onSelfAvatarLoaded); |
|
|
|
|
connect(ui->addButton, &QPushButton::clicked, this, &Widget::onAddClicked); |
|
|
|
|
connect(ui->groupButton, &QPushButton::clicked, this, &Widget::onGroupClicked); |
|
|
|
|
connect(ui->transferButton, &QPushButton::clicked, this, &Widget::onTransferClicked); |
|
|
|
|
connect(ui->settingsButton, &QPushButton::clicked, this, &Widget::onSettingsClicked); |
|
|
|
|
connect(ui->settingsButton, &QPushButton::clicked, this, &Widget::onShowSettings); |
|
|
|
|
connect(profilePicture, &MaskablePixmapWidget::clicked, this, &Widget::showProfile); |
|
|
|
|
connect(ui->nameLabel, &CroppingLabel::clicked, this, &Widget::showProfile); |
|
|
|
|
connect(ui->statusLabel, &CroppingLabel::editFinished, this, &Widget::onStatusMessageChanged); |
|
|
|
@ -326,13 +324,13 @@ void Widget::init()
@@ -326,13 +324,13 @@ void Widget::init()
|
|
|
|
|
|
|
|
|
|
QAction* preferencesAction = viewMenu->menu()->addAction(QString()); |
|
|
|
|
preferencesAction->setMenuRole(QAction::PreferencesRole); |
|
|
|
|
connect(preferencesAction, &QAction::triggered, this, &Widget::onSettingsClicked); |
|
|
|
|
connect(preferencesAction, &QAction::triggered, this, &Widget::onShowSettings); |
|
|
|
|
|
|
|
|
|
QAction* aboutAction = viewMenu->menu()->addAction(QString()); |
|
|
|
|
aboutAction->setMenuRole(QAction::AboutRole); |
|
|
|
|
connect(aboutAction, &QAction::triggered, [this]() |
|
|
|
|
{ |
|
|
|
|
onSettingsClicked(); |
|
|
|
|
onShowSettings(); |
|
|
|
|
settingsWidget->showAbout(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -374,9 +372,6 @@ void Widget::init()
@@ -374,9 +372,6 @@ void Widget::init()
|
|
|
|
|
ui->mainSplitter->setSizes(sizes); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
connect(&s, &Settings::compactLayoutChanged, contactListWidget, &FriendListWidget::onCompactChanged); |
|
|
|
|
connect(&s, &Settings::groupchatPositionChanged, contactListWidget, &FriendListWidget::onGroupchatPositionChanged); |
|
|
|
|
connect(&s, &Settings::separateWindowChanged, this, &Widget::onSeparateWindowClicked); |
|
|
|
|
#if (AUTOUPDATE_ENABLED) |
|
|
|
|
if (Settings::getInstance().getCheckUpdates()) |
|
|
|
|
AutoUpdater::checkUpdatesAsyncInteractive(); |
|
|
|
@ -392,6 +387,16 @@ void Widget::init()
@@ -392,6 +387,16 @@ void Widget::init()
|
|
|
|
|
connect(groupInviteForm, &GroupInviteForm::groupInvitesSeen, this, &Widget::groupInvitesClear); |
|
|
|
|
connect(groupInviteForm, &GroupInviteForm::groupInviteAccepted, this, &Widget::onGroupInviteAccepted); |
|
|
|
|
|
|
|
|
|
// settings
|
|
|
|
|
connect(&s, &Settings::showSystemTrayChanged, |
|
|
|
|
this, &Widget::onSetShowSystemTray); |
|
|
|
|
connect(&s, &Settings::separateWindowChanged, |
|
|
|
|
this, &Widget::onSeparateWindowClicked); |
|
|
|
|
connect(&s, &Settings::compactLayoutChanged, |
|
|
|
|
contactListWidget, &FriendListWidget::onCompactChanged); |
|
|
|
|
connect(&s, &Settings::groupchatPositionChanged, |
|
|
|
|
contactListWidget, &FriendListWidget::onGroupchatPositionChanged); |
|
|
|
|
|
|
|
|
|
retranslateUi(); |
|
|
|
|
Translator::registerHandler(std::bind(&Widget::retranslateUi, this), this); |
|
|
|
|
|
|
|
|
@ -530,7 +535,6 @@ Widget::~Widget()
@@ -530,7 +535,6 @@ Widget::~Widget()
|
|
|
|
|
|
|
|
|
|
delete icon; |
|
|
|
|
delete profileForm; |
|
|
|
|
delete settingsWidget; |
|
|
|
|
delete addFriendForm; |
|
|
|
|
delete groupInviteForm; |
|
|
|
|
delete filesForm; |
|
|
|
@ -563,8 +567,8 @@ Widget* Widget::getInstance()
@@ -563,8 +567,8 @@ Widget* Widget::getInstance()
|
|
|
|
|
*/ |
|
|
|
|
void Widget::showUpdateDownloadProgress() |
|
|
|
|
{ |
|
|
|
|
onShowSettings(); |
|
|
|
|
settingsWidget->showAbout(); |
|
|
|
|
onSettingsClicked(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Widget::moveEvent(QMoveEvent *event) |
|
|
|
@ -659,7 +663,7 @@ void Widget::onBadProxyCore()
@@ -659,7 +663,7 @@ void Widget::onBadProxyCore()
|
|
|
|
|
"settings and restart.", "popup text")); |
|
|
|
|
critical.setIcon(QMessageBox::Critical); |
|
|
|
|
critical.exec(); |
|
|
|
|
onSettingsClicked(); |
|
|
|
|
onShowSettings(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Widget::onStatusSet(Status status) |
|
|
|
@ -724,19 +728,19 @@ void Widget::onSeparateWindowChanged(bool separate, bool clicked)
@@ -724,19 +728,19 @@ void Widget::onSeparateWindowChanged(bool separate, bool clicked)
|
|
|
|
|
{ |
|
|
|
|
showNormal(); |
|
|
|
|
resize(width, height()); |
|
|
|
|
|
|
|
|
|
if (settingsWidget) |
|
|
|
|
{ |
|
|
|
|
ContentLayout* contentLayout = createContentDialog((SettingDialog)); |
|
|
|
|
contentLayout->parentWidget()->resize(size); |
|
|
|
|
contentLayout->parentWidget()->move(pos); |
|
|
|
|
settingsWidget->show(contentLayout); |
|
|
|
|
setActiveToolMenuButton(Widget::None); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
setWindowTitle(QString()); |
|
|
|
|
setActiveToolMenuButton(None); |
|
|
|
|
|
|
|
|
|
if (clicked) |
|
|
|
|
{ |
|
|
|
|
ContentLayout* contentLayout = createContentDialog((SettingDialog)); |
|
|
|
|
contentLayout->parentWidget()->resize(size); |
|
|
|
|
contentLayout->parentWidget()->move(pos); |
|
|
|
|
settingsWidget->show(contentLayout); |
|
|
|
|
setActiveToolMenuButton(Widget::None); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -883,8 +887,13 @@ void Widget::onIconClick(QSystemTrayIcon::ActivationReason reason)
@@ -883,8 +887,13 @@ void Widget::onIconClick(QSystemTrayIcon::ActivationReason reason)
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Widget::onSettingsClicked() |
|
|
|
|
void Widget::onShowSettings() |
|
|
|
|
{ |
|
|
|
|
if (!settingsWidget) |
|
|
|
|
{ |
|
|
|
|
settingsWidget = new SettingsWidget(this); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (Settings::getInstance().getSeparateWindow()) |
|
|
|
|
{ |
|
|
|
|
if (!settingsWidget->isShown()) |
|
|
|
@ -1003,7 +1012,6 @@ void Widget::addFriend(int friendId, const ToxPk& friendPk)
@@ -1003,7 +1012,6 @@ void Widget::addFriend(int friendId, const ToxPk& friendPk)
|
|
|
|
|
ChatForm* friendForm = newfriend->getChatForm(); |
|
|
|
|
|
|
|
|
|
friendWidgets[friendId] = widget; |
|
|
|
|
|
|
|
|
|
newfriend->loadHistory(); |
|
|
|
|
|
|
|
|
|
const Settings& s = Settings::getInstance(); |
|
|
|
|