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

fix(ui): remove focus window option, fixing alert() on Windows

Fix #4762
This commit is contained in:
Anthony Bilinski 2018-09-13 14:25:34 -07:00
parent 7839a26083
commit 91bdd40f10
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
6 changed files with 2 additions and 58 deletions

View File

@ -207,7 +207,6 @@ void Settings::loadGlobal()
s.beginGroup("GUI");
{
showWindow = s.value("showWindow", true).toBool();
showInFront = s.value("showInFront", false).toBool();
notify = s.value("notify", true).toBool();
groupAlwaysNotify = s.value("groupAlwaysNotify", true).toBool();
groupchatPosition = s.value("groupchatPosition", true).toBool();
@ -526,7 +525,6 @@ void Settings::saveGlobal()
s.beginGroup("GUI");
{
s.setValue("showWindow", showWindow);
s.setValue("showInFront", showInFront);
s.setValue("notify", notify);
s.setValue("groupAlwaysNotify", groupAlwaysNotify);
s.setValue("separateWindow", separateWindow);
@ -1063,22 +1061,6 @@ void Settings::setSpellCheckingEnabled(bool newValue)
}
}
bool Settings::getShowInFront() const
{
QMutexLocker locker{&bigLock};
return showInFront;
}
void Settings::setShowInFront(bool newValue)
{
QMutexLocker locker{&bigLock};
if (newValue != showInFront) {
showInFront = newValue;
emit showInFrontChanged(showInFront);
}
}
bool Settings::getNotifySound() const
{
QMutexLocker locker{&bigLock};

View File

@ -164,7 +164,6 @@ signals:
void autorunChanged(bool enabled);
void autoSaveEnabledChanged(bool enabled);
void autostartInTrayChanged(bool enabled);
void showInFrontChanged(bool enabled);
void closeToTrayChanged(bool enabled);
void lightTrayIconChanged(bool enabled);
void minimizeToTrayChanged(bool enabled);
@ -325,9 +324,6 @@ public:
bool getShowWindow() const;
void setShowWindow(bool newValue);
bool getShowInFront() const;
void setShowInFront(bool newValue);
bool getNotifySound() const;
void setNotifySound(bool newValue);
@ -594,7 +590,6 @@ private:
bool checkUpdates;
bool notify;
bool showWindow;
bool showInFront;
bool notifySound;
bool busySound;
bool groupAlwaysNotify;

View File

@ -84,11 +84,7 @@ UserInterfaceForm::UserInterfaceForm(SettingsWidget* myParent)
bodyUI->busySound->setChecked(s.getBusySound());
bodyUI->busySound->setEnabled(s.getNotifySound() && s.getNotify());
bool showWindow = s.getShowWindow();
bodyUI->showWindow->setChecked(showWindow);
bodyUI->showInFront->setChecked(s.getShowInFront());
bodyUI->showInFront->setEnabled(showWindow);
bodyUI->showWindow->setChecked(s.getShowWindow());
bodyUI->cbGroupchatPosition->setChecked(s.getGroupchatPosition());
bodyUI->cbCompactLayout->setChecked(s.getCompactLayout());
@ -291,14 +287,7 @@ void UserInterfaceForm::on_busySound_stateChanged()
void UserInterfaceForm::on_showWindow_stateChanged()
{
bool isChecked = bodyUI->showWindow->isChecked();
Settings::getInstance().setShowWindow(isChecked);
bodyUI->showInFront->setEnabled(isChecked);
}
void UserInterfaceForm::on_showInFront_stateChanged()
{
Settings::getInstance().setShowInFront(bodyUI->showInFront->isChecked());
Settings::getInstance().setShowWindow(bodyUI->showWindow->isChecked());
}
void UserInterfaceForm::on_groupOnlyNotfiyWhenMentioned_stateChanged()

View File

@ -52,7 +52,6 @@ private slots:
void on_notifySound_stateChanged();
void on_busySound_stateChanged();
void on_showWindow_stateChanged();
void on_showInFront_stateChanged();
void on_groupOnlyNotfiyWhenMentioned_stateChanged();
void on_cbCompactLayout_stateChanged();
void on_cbSeparateWindow_stateChanged();

View File

@ -219,23 +219,6 @@
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_15">
<property name="leftMargin">
<number>40</number>
</property>
<item>
<widget class="QCheckBox" name="showInFront">
<property name="toolTip">
<string comment="toolTip for Focus window setting">Focus qTox when you receive message.</string>
</property>
<property name="text">
<string>Focus window</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
@ -615,7 +598,6 @@
<tabstop>notifySound</tabstop>
<tabstop>busySound</tabstop>
<tabstop>showWindow</tabstop>
<tabstop>showInFront</tabstop>
<tabstop>cbGroupchatPosition</tabstop>
<tabstop>cbCompactLayout</tabstop>
<tabstop>cbSeparateWindow</tabstop>

View File

@ -1448,9 +1448,6 @@ bool Widget::newMessageAlert(QWidget* currentWindow, bool isActive, bool sound,
if (notify) {
if (Settings::getInstance().getShowWindow()) {
currentWindow->show();
if (inactiveWindow && Settings::getInstance().getShowInFront()) {
currentWindow->activateWindow();
}
}
if (Settings::getInstance().getNotify()) {