From 826d21d21fdd578ca915b7a14ea57f73fd8aa31f Mon Sep 17 00:00:00 2001 From: agilob Date: Mon, 11 May 2015 19:14:09 +0100 Subject: [PATCH] closes tux3/qtox#1354 more signals/slots were converted to qt5 style --- src/widget/form/settings/generalform.cpp | 5 +++-- src/widget/widget.cpp | 22 ++++++++++++---------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/widget/form/settings/generalform.cpp b/src/widget/form/settings/generalform.cpp index f52736395..0b69ba8e8 100644 --- a/src/widget/form/settings/generalform.cpp +++ b/src/widget/form/settings/generalform.cpp @@ -224,6 +224,7 @@ void GeneralForm::onSetShowSystemTray() Settings::getInstance().setShowSystemTray(bodyUI->showSystemTray->isChecked()); emit parent->setShowSystemTray(bodyUI->showSystemTray->isChecked()); bodyUI->lightTrayIcon->setEnabled(bodyUI->showSystemTray->isChecked()); + Settings::getInstance().save(); } void GeneralForm::onSetAutostartInTray() @@ -284,9 +285,9 @@ void GeneralForm::onAutoAcceptFileChange() Settings::getInstance().setAutoSaveEnabled(bodyUI->autoacceptFiles->isChecked()); if (bodyUI->autoacceptFiles->isChecked() == true) - connect(bodyUI->autoSaveFilesDir, SIGNAL(clicked()), this, SLOT(onAutoSaveDirChange())); + connect(bodyUI->autoSaveFilesDir, &QPushButton::clicked, this, &GeneralForm::onAutoSaveDirChange); else - disconnect(bodyUI->autoSaveFilesDir, SIGNAL(clicked()),this, SLOT(onAutoSaveDirChange())); + disconnect(bodyUI->autoSaveFilesDir, &QPushButton::clicked, this, &GeneralForm::onAutoSaveDirChange); } void GeneralForm::onAutoSaveDirChange() diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 249781280..e6206a90f 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -188,19 +188,19 @@ void Widget::init() settingsWidget = new SettingsWidget(); Core* core = Nexus::getCore(); - connect(core, SIGNAL(fileDownloadFinished(const QString&)), filesForm, SLOT(onFileDownloadComplete(const QString&))); - connect(core, SIGNAL(fileUploadFinished(const QString&)), filesForm, SLOT(onFileUploadComplete(const QString&))); + connect(core, &Core::fileDownloadFinished, filesForm, &FilesForm::onFileDownloadComplete); + connect(core, &Core::fileUploadFinished, filesForm, &FilesForm::onFileUploadComplete); connect(settingsWidget, &SettingsWidget::setShowSystemTray, this, &Widget::onSetShowSystemTray); - connect(core, SIGNAL(selfAvatarChanged(QPixmap)), profileForm, SLOT(onSelfAvatarLoaded(QPixmap))); - connect(ui->addButton, SIGNAL(clicked()), this, SLOT(onAddClicked())); - connect(ui->groupButton, SIGNAL(clicked()), this, SLOT(onGroupClicked())); - connect(ui->transferButton, SIGNAL(clicked()), this, SLOT(onTransferClicked())); - connect(ui->settingsButton, SIGNAL(clicked()), this, SLOT(onSettingsClicked())); + 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(profilePicture, &MaskablePixmapWidget::clicked, this, &Widget::showProfile); connect(ui->nameLabel, &CroppingLabel::clicked, this, &Widget::showProfile); - connect(ui->statusLabel, SIGNAL(textChanged(QString, QString)), this, SLOT(onStatusMessageChanged(QString, QString))); + connect(ui->statusLabel, &CroppingLabel::textChanged, this, &Widget::onStatusMessageChanged); connect(ui->mainSplitter, &QSplitter::splitterMoved, this, &Widget::onSplitterMoved); - connect(addFriendForm, SIGNAL(friendRequested(QString, QString)), this, SIGNAL(friendRequested(QString, QString))); + connect(addFriendForm, &AddFriendForm::friendRequested, this, &Widget::friendRequested); connect(timer, &QTimer::timeout, this, &Widget::onUserAwayCheck); connect(timer, &QTimer::timeout, this, &Widget::onEventIconTick); connect(timer, &QTimer::timeout, this, &Widget::onTryCreateTrayIcon); @@ -364,7 +364,9 @@ void Widget::changeEvent(QEvent *event) { if (event->type() == QEvent::WindowStateChange) { - if (isMinimized() && Settings::getInstance().getMinimizeToTray()) + if (isMinimized() && + Settings::getInstance().getShowSystemTray() && + Settings::getInstance().getMinimizeToTray()) this->hide(); } }