mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Add the option to open qTox when a message is recived
This commit is contained in:
parent
4941ec2673
commit
cbad1c4966
|
@ -120,6 +120,7 @@ void Settings::load()
|
||||||
currentProfile = s.value("currentProfile", "").toString();
|
currentProfile = s.value("currentProfile", "").toString();
|
||||||
autoAwayTime = s.value("autoAwayTime", 10).toInt();
|
autoAwayTime = s.value("autoAwayTime", 10).toInt();
|
||||||
checkUpdates = s.value("checkUpdates", false).toBool();
|
checkUpdates = s.value("checkUpdates", false).toBool();
|
||||||
|
showInFront = s.value("showInFront", false).toBool();
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
s.beginGroup("Widgets");
|
s.beginGroup("Widgets");
|
||||||
|
@ -257,6 +258,7 @@ void Settings::save(QString path)
|
||||||
s.setValue("currentProfile", currentProfile);
|
s.setValue("currentProfile", currentProfile);
|
||||||
s.setValue("autoAwayTime", autoAwayTime);
|
s.setValue("autoAwayTime", autoAwayTime);
|
||||||
s.setValue("checkUpdates", checkUpdates);
|
s.setValue("checkUpdates", checkUpdates);
|
||||||
|
s.setValue("showInFront", showInFront);
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
s.beginGroup("Widgets");
|
s.beginGroup("Widgets");
|
||||||
|
@ -480,6 +482,16 @@ void Settings::setStatusChangeNotificationEnabled(bool newValue)
|
||||||
statusChangeNotificationEnabled = newValue;
|
statusChangeNotificationEnabled = newValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Settings::getShowInFront() const
|
||||||
|
{
|
||||||
|
return showInFront;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Settings::setShowInFront(bool newValue)
|
||||||
|
{
|
||||||
|
showInFront = newValue;
|
||||||
|
}
|
||||||
|
|
||||||
QString Settings::getTranslation() const
|
QString Settings::getTranslation() const
|
||||||
{
|
{
|
||||||
return translation;
|
return translation;
|
||||||
|
|
|
@ -102,6 +102,9 @@ public:
|
||||||
bool getCheckUpdates() const;
|
bool getCheckUpdates() const;
|
||||||
void setCheckUpdates(bool newValue);
|
void setCheckUpdates(bool newValue);
|
||||||
|
|
||||||
|
bool getShowInFront() const;
|
||||||
|
void setShowInFront(bool newValue);
|
||||||
|
|
||||||
QPixmap getSavedAvatar(const QString& ownerId);
|
QPixmap getSavedAvatar(const QString& ownerId);
|
||||||
void saveAvatar(QPixmap& pic, const QString& ownerId);
|
void saveAvatar(QPixmap& pic, const QString& ownerId);
|
||||||
|
|
||||||
|
@ -223,6 +226,7 @@ private:
|
||||||
bool minimizeToTray;
|
bool minimizeToTray;
|
||||||
bool useEmoticons;
|
bool useEmoticons;
|
||||||
bool checkUpdates;
|
bool checkUpdates;
|
||||||
|
bool showInFront;
|
||||||
|
|
||||||
bool forceTCP;
|
bool forceTCP;
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
|
||||||
bodyUI->useEmoticons->setChecked(Settings::getInstance().getUseEmoticons());
|
bodyUI->useEmoticons->setChecked(Settings::getInstance().getUseEmoticons());
|
||||||
bodyUI->autoacceptFiles->setChecked(Settings::getInstance().getAutoSaveEnabled());
|
bodyUI->autoacceptFiles->setChecked(Settings::getInstance().getAutoSaveEnabled());
|
||||||
bodyUI->autoSaveFilesDir->setText(Settings::getInstance().getGlobalAutoAcceptDir());
|
bodyUI->autoSaveFilesDir->setText(Settings::getInstance().getGlobalAutoAcceptDir());
|
||||||
|
bodyUI->showInFront->setChecked(Settings::getInstance().getShowInFront());
|
||||||
|
|
||||||
for (auto entry : SmileyPack::listSmileyPacks())
|
for (auto entry : SmileyPack::listSmileyPacks())
|
||||||
{
|
{
|
||||||
|
@ -106,6 +107,7 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
|
||||||
connect(bodyUI->minimizeToTray, &QCheckBox::stateChanged, this, &GeneralForm::onSetMinimizeToTray);
|
connect(bodyUI->minimizeToTray, &QCheckBox::stateChanged, this, &GeneralForm::onSetMinimizeToTray);
|
||||||
connect(bodyUI->statusChanges, &QCheckBox::stateChanged, this, &GeneralForm::onSetStatusChange);
|
connect(bodyUI->statusChanges, &QCheckBox::stateChanged, this, &GeneralForm::onSetStatusChange);
|
||||||
connect(bodyUI->autoAwaySpinBox, SIGNAL(editingFinished()), this, SLOT(onAutoAwayChanged()));
|
connect(bodyUI->autoAwaySpinBox, SIGNAL(editingFinished()), this, SLOT(onAutoAwayChanged()));
|
||||||
|
connect(bodyUI->showInFront, &QCheckBox::stateChanged, this, &GeneralForm::onSetShowInFront);
|
||||||
connect(bodyUI->autoacceptFiles, &QCheckBox::stateChanged, this, &GeneralForm::onAutoAcceptFileChange);
|
connect(bodyUI->autoacceptFiles, &QCheckBox::stateChanged, this, &GeneralForm::onAutoAcceptFileChange);
|
||||||
if(bodyUI->autoacceptFiles->isChecked())
|
if(bodyUI->autoacceptFiles->isChecked())
|
||||||
connect(bodyUI->autoSaveFilesDir, SIGNAL(clicked()), this, SLOT(onAutoSaveDirChange()));
|
connect(bodyUI->autoSaveFilesDir, SIGNAL(clicked()), this, SLOT(onAutoSaveDirChange()));
|
||||||
|
@ -291,3 +293,8 @@ void GeneralForm::onCheckUpdateChanged()
|
||||||
{
|
{
|
||||||
Settings::getInstance().setCheckUpdates(bodyUI->checkUpdates->isChecked());
|
Settings::getInstance().setCheckUpdates(bodyUI->checkUpdates->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GeneralForm::onSetShowInFront()
|
||||||
|
{
|
||||||
|
Settings::getInstance().setShowInFront(bodyUI->showInFront->isChecked());
|
||||||
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ private slots:
|
||||||
void onAutoAcceptFileChange();
|
void onAutoAcceptFileChange();
|
||||||
void onAutoSaveDirChange();
|
void onAutoSaveDirChange();
|
||||||
void onCheckUpdateChanged();
|
void onCheckUpdateChanged();
|
||||||
|
void onSetShowInFront();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::GeneralSettings *bodyUI;
|
Ui::GeneralSettings *bodyUI;
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>511</width>
|
<width>511</width>
|
||||||
<height>720</height>
|
<height>796</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,0,1">
|
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,0,1">
|
||||||
|
@ -128,6 +128,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="showInFront">
|
||||||
|
<property name="text">
|
||||||
|
<string>Open qTox on message received</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item alignment="Qt::AlignLeft">
|
<item alignment="Qt::AlignLeft">
|
||||||
|
|
|
@ -767,6 +767,10 @@ void Widget::newMessageAlert()
|
||||||
QApplication::alert(this);
|
QApplication::alert(this);
|
||||||
|
|
||||||
static QFile sndFile(":audio/notification.pcm");
|
static QFile sndFile(":audio/notification.pcm");
|
||||||
|
if(Settings::getInstance().getShowInFront() == true)
|
||||||
|
{
|
||||||
|
this->show();
|
||||||
|
}
|
||||||
static QByteArray sndData;
|
static QByteArray sndData;
|
||||||
if (sndData.isEmpty())
|
if (sndData.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user