1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge branch 'pr1619'

closes tux3/qtox#1354

more signals/slots were converted to qt5 style
This commit is contained in:
tux3 2015-05-11 21:09:28 +02:00
commit c4eea377a3
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
2 changed files with 15 additions and 12 deletions

View File

@ -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()

View File

@ -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();
}
}