mirror of
https://github.com/zealdocs/zeal.git
synced 2024-11-27 01:53:06 +03:00
fix(ui): improve message when storage does not exist (#1152)
This commit is contained in:
parent
e07015a225
commit
5b809d87fe
@ -83,7 +83,9 @@ DocsetsDialog::DocsetsDialog(Core::Application *app, QWidget *parent)
|
|||||||
qt_ntfs_permission_lookup++;
|
qt_ntfs_permission_lookup++;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_isStorageReadOnly = !QFileInfo(m_application->settings()->docsetPath).isWritable();
|
const QFileInfo fi(m_application->settings()->docsetPath);
|
||||||
|
|
||||||
|
m_isStorageReadOnly = !fi.isWritable();
|
||||||
|
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
qt_ntfs_permission_lookup--;
|
qt_ntfs_permission_lookup--;
|
||||||
@ -95,7 +97,10 @@ DocsetsDialog::DocsetsDialog(Core::Application *app, QWidget *parent)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
ui->statusLabel->clear(); // Clear text shown in the designer mode.
|
ui->statusLabel->clear(); // Clear text shown in the designer mode.
|
||||||
ui->readOnlyLabel->setVisible(m_isStorageReadOnly);
|
ui->storageStatusLabel->setVisible(m_isStorageReadOnly);
|
||||||
|
ui->storageStatusLabel->setText(fi.exists() ?
|
||||||
|
QStringLiteral("<b>Docset storage is read only.</b>") :
|
||||||
|
QStringLiteral("<b>Docset storage does not exist.</b>"));
|
||||||
|
|
||||||
connect(m_application, &Core::Application::extractionCompleted,
|
connect(m_application, &Core::Application::extractionCompleted,
|
||||||
this, &DocsetsDialog::extractionCompleted);
|
this, &DocsetsDialog::extractionCompleted);
|
||||||
|
@ -218,11 +218,7 @@
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="readOnlyLabel">
|
<widget class="QLabel" name="storageStatusLabel"/>
|
||||||
<property name="text">
|
|
||||||
<string><b>Docset storage is read only.</b></string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
Loading…
Reference in New Issue
Block a user