mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Verificaci?n de que el directorio de destino cuando se crea una libreria existe,
es realmente un directorio y se puede escribir en ?l.
This commit is contained in:
parent
86914fd634
commit
a1f5eb08b1
@ -4,7 +4,7 @@
|
|||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QSizePolicy>
|
#include <QSizePolicy>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
CreateLibraryDialog::CreateLibraryDialog(QWidget * parent)
|
CreateLibraryDialog::CreateLibraryDialog(QWidget * parent)
|
||||||
:QDialog(parent)
|
:QDialog(parent)
|
||||||
@ -92,6 +92,10 @@ void CreateLibraryDialog::setupUI()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CreateLibraryDialog::create()
|
void CreateLibraryDialog::create()
|
||||||
|
{
|
||||||
|
|
||||||
|
QFileInfo f(path->text());
|
||||||
|
if(f.exists() && f.isDir() && f.isWritable())
|
||||||
{
|
{
|
||||||
progressBar->show();
|
progressBar->show();
|
||||||
message->show();
|
message->show();
|
||||||
@ -100,6 +104,9 @@ void CreateLibraryDialog::create()
|
|||||||
accept->setEnabled(false);
|
accept->setEnabled(false);
|
||||||
emit(createLibrary(QDir::cleanPath(path->text()),QDir::cleanPath(path->text())+"/.yacreaderlibrary",nameEdit->text()));
|
emit(createLibrary(QDir::cleanPath(path->text()),QDir::cleanPath(path->text())+"/.yacreaderlibrary",nameEdit->text()));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
QMessageBox::critical(NULL,tr("Path not found"),tr("The selected path does not exist or is not a valid path. Be sure that you have write access to this folder"));
|
||||||
|
}
|
||||||
|
|
||||||
void CreateLibraryDialog::findPath()
|
void CreateLibraryDialog::findPath()
|
||||||
{
|
{
|
||||||
@ -125,7 +132,7 @@ void CreateLibraryDialog::close()
|
|||||||
nameEdit->clear();
|
nameEdit->clear();
|
||||||
currentFileLabel->setText("");
|
currentFileLabel->setText("");
|
||||||
this->adjustSize();
|
this->adjustSize();
|
||||||
accept->setEnabled(true);
|
accept->setEnabled(false);
|
||||||
QDialog::close();
|
QDialog::close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user