mirror of
https://github.com/zealdocs/zeal.git
synced 2024-11-22 21:53:03 +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++;
|
||||
#endif
|
||||
|
||||
m_isStorageReadOnly = !QFileInfo(m_application->settings()->docsetPath).isWritable();
|
||||
const QFileInfo fi(m_application->settings()->docsetPath);
|
||||
|
||||
m_isStorageReadOnly = !fi.isWritable();
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
qt_ntfs_permission_lookup--;
|
||||
@ -95,7 +97,10 @@ DocsetsDialog::DocsetsDialog(Core::Application *app, QWidget *parent)
|
||||
#endif
|
||||
|
||||
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,
|
||||
this, &DocsetsDialog::extractionCompleted);
|
||||
|
@ -218,11 +218,7 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="readOnlyLabel">
|
||||
<property name="text">
|
||||
<string><b>Docset storage is read only.</b></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="storageStatusLabel"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
|
Loading…
Reference in New Issue
Block a user