From 3009a3970e88bb2b190e71b9837587029d4f1041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Mon, 30 Jul 2012 19:31:31 +0200 Subject: [PATCH] Verificaci?n de ruta de destino a?adida a los di?logos de creaci?n y expotaci?n (info y covers) Al cerrar properties dialog ahora se hace un reset del focus --- YACReaderLibrary/export_comics_info_dialog.cpp | 12 ++++++++++-- YACReaderLibrary/export_library_dialog.cpp | 16 ++++++++++++---- YACReaderLibrary/library_window.cpp | 3 ++- YACReaderLibrary/properties_dialog.cpp | 2 ++ 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/YACReaderLibrary/export_comics_info_dialog.cpp b/YACReaderLibrary/export_comics_info_dialog.cpp index 4a4b3208..c965f5d3 100644 --- a/YACReaderLibrary/export_comics_info_dialog.cpp +++ b/YACReaderLibrary/export_comics_info_dialog.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "data_base_management.h" @@ -73,8 +74,15 @@ void ExportComicsInfoDialog::findPath() void ExportComicsInfoDialog::exportComicsInfo() { - DataBaseManagement::exportComicsInfo(source,path->text()); - close(); + QFileInfo f(path->text()); + QFileInfo fPath(f.absoluteDir().path()); + if(fPath.exists() && fPath.isDir() && fPath.isWritable()) + { + DataBaseManagement::exportComicsInfo(source,path->text()); + close(); + } + else + QMessageBox::critical(NULL,tr("Problem found while writing"),tr("The selected path for the output file does not exist or is not a valid path. Be sure that you have write access to this folder")); } void ExportComicsInfoDialog::close() diff --git a/YACReaderLibrary/export_library_dialog.cpp b/YACReaderLibrary/export_library_dialog.cpp index 66e0b212..cd692ef2 100644 --- a/YACReaderLibrary/export_library_dialog.cpp +++ b/YACReaderLibrary/export_library_dialog.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include ExportLibraryDialog::ExportLibraryDialog(QWidget * parent) @@ -63,10 +64,17 @@ ExportLibraryDialog::ExportLibraryDialog(QWidget * parent) void ExportLibraryDialog::exportLibrary() { - progressBar->show(); - accept->setEnabled(false); - emit exportPath(QDir::cleanPath(path->text())); - t.start(); + QFileInfo f(path->text()); + if(f.exists() && f.isDir() && f.isWritable()) + { + progressBar->show(); + accept->setEnabled(false); + emit exportPath(QDir::cleanPath(path->text())); + t.start(); + } + else + QMessageBox::critical(NULL,tr("Problem found while writing"),tr("The selected path for the output file does not exist or is not a valid path. Be sure that you have write access to this folder")); + } void ExportLibraryDialog::findPath() diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index 880487d0..e43a7008 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -438,8 +438,9 @@ void LibraryWindow::createToolBars() libraryToolBar->addSeparator(); - libraryToolBar->addAction(importLibraryAction); libraryToolBar->addAction(exportLibraryAction); + libraryToolBar->addAction(importLibraryAction); + libraryToolBar->addSeparator(); libraryToolBar->addAction(updateLibraryAction); diff --git a/YACReaderLibrary/properties_dialog.cpp b/YACReaderLibrary/properties_dialog.cpp index bcabb56d..8d477aa5 100644 --- a/YACReaderLibrary/properties_dialog.cpp +++ b/YACReaderLibrary/properties_dialog.cpp @@ -687,5 +687,7 @@ void PropertiesDialog::closeEvent ( QCloseEvent * e ) tabBar->setCurrentIndex(0); + coverPageEdit->setFocus(); + QDialog::closeEvent(e); }