fix #433
This commit is contained in:
parent
98e850e031
commit
09d03eacf7
3 changed files with 8 additions and 18 deletions
|
@ -30,7 +30,7 @@
|
||||||
<url type="donation">https://martinrotter.github.io/donate/</url>
|
<url type="donation">https://martinrotter.github.io/donate/</url>
|
||||||
<content_rating type="oars-1.1" />
|
<content_rating type="oars-1.1" />
|
||||||
<releases>
|
<releases>
|
||||||
<release version="3.9.2" date="2021-06-04"/>
|
<release version="3.9.2" date="2021-06-08"/>
|
||||||
</releases>
|
</releases>
|
||||||
<content_rating type="oars-1.0">
|
<content_rating type="oars-1.0">
|
||||||
<content_attribute id="violence-cartoon">none</content_attribute>
|
<content_attribute id="violence-cartoon">none</content_attribute>
|
||||||
|
|
|
@ -30,7 +30,7 @@ FormDatabaseCleanup::FormDatabaseCleanup(QWidget* parent) : QDialog(parent), m_u
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormDatabaseCleanup::closeEvent(QCloseEvent* event) {
|
void FormDatabaseCleanup::closeEvent(QCloseEvent* event) {
|
||||||
if (m_ui->m_progressBar->isEnabled()) {
|
if (!m_ui->m_btnBox->isEnabled()) {
|
||||||
event->ignore();
|
event->ignore();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -39,7 +39,7 @@ void FormDatabaseCleanup::closeEvent(QCloseEvent* event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormDatabaseCleanup::keyPressEvent(QKeyEvent* event) {
|
void FormDatabaseCleanup::keyPressEvent(QKeyEvent* event) {
|
||||||
if (m_ui->m_progressBar->isEnabled()) {
|
if (!m_ui->m_btnBox->isEnabled()) {
|
||||||
event->ignore();
|
event->ignore();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -66,7 +66,6 @@ void FormDatabaseCleanup::startPurging() {
|
||||||
|
|
||||||
void FormDatabaseCleanup::onPurgeStarted() {
|
void FormDatabaseCleanup::onPurgeStarted() {
|
||||||
m_ui->m_progressBar->setValue(0);
|
m_ui->m_progressBar->setValue(0);
|
||||||
m_ui->m_progressBar->setEnabled(true);
|
|
||||||
m_ui->m_btnBox->setEnabled(false);
|
m_ui->m_btnBox->setEnabled(false);
|
||||||
m_ui->m_lblResult->setStatus(WidgetWithStatus::StatusType::Information, tr("Database cleanup is running."),
|
m_ui->m_lblResult->setStatus(WidgetWithStatus::StatusType::Information, tr("Database cleanup is running."),
|
||||||
tr("Database cleanup is running."));
|
tr("Database cleanup is running."));
|
||||||
|
@ -78,8 +77,7 @@ void FormDatabaseCleanup::onPurgeProgress(int progress, const QString& descripti
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormDatabaseCleanup::onPurgeFinished(bool finished) {
|
void FormDatabaseCleanup::onPurgeFinished(bool finished) {
|
||||||
m_ui->m_progressBar->setEnabled(false);
|
m_ui->m_progressBar->setValue(100);
|
||||||
m_ui->m_progressBar->setValue(0);
|
|
||||||
m_ui->m_btnBox->setEnabled(true);
|
m_ui->m_btnBox->setEnabled(true);
|
||||||
|
|
||||||
if (finished) {
|
if (finished) {
|
||||||
|
@ -100,5 +98,4 @@ void FormDatabaseCleanup::loadDatabaseInfo() {
|
||||||
|
|
||||||
m_ui->m_txtFileSize->setText(data_size_str);
|
m_ui->m_txtFileSize->setText(data_size_str);
|
||||||
m_ui->m_txtDatabaseType->setText(qApp->database()->driver()->humanDriverType());
|
m_ui->m_txtDatabaseType->setText(qApp->database()->driver()->humanDriverType());
|
||||||
m_ui->m_checkShrink->setChecked(m_ui->m_checkShrink->isEnabled());
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,9 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Shrink database file</string>
|
<string>Shrink database file</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0" colspan="3">
|
<item row="0" column="0" colspan="3">
|
||||||
|
@ -32,9 +35,6 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Remove all read messages</string>
|
<string>Remove all read messages</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="5" column="1">
|
||||||
|
@ -147,14 +147,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QProgressBar" name="m_progressBar">
|
<widget class="QProgressBar" name="m_progressBar"/>
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
Loading…
Add table
Reference in a new issue