48 const QDir dir{this->ui.newLibraryPath->text()}; |
48 const QDir dir{this->ui.newLibraryPath->text()}; |
49 if (not dir.exists()) |
49 if (not dir.exists()) |
50 { |
50 { |
51 QMessageBox::critical(this, |
51 QMessageBox::critical(this, |
52 tr("Library does not exist"), |
52 tr("Library does not exist"), |
53 utility::format( |
53 format( |
54 tr("The directory %1 does not exist."), |
54 tr("The directory %1 does not exist."), |
55 utility::quoted(dir.path()))); |
55 quoted(dir.path()))); |
56 } |
56 } |
57 else |
57 else |
58 { |
58 { |
59 if (not dir.isReadable()) |
59 if (not dir.isReadable()) |
60 { |
60 { |
61 QMessageBox::warning(this, |
61 QMessageBox::warning(this, |
62 tr("Unreadable library"), |
62 tr("Unreadable library"), |
63 utility::format( |
63 format( |
64 tr("The directory %1 cannot be read."), |
64 tr("The directory %1 cannot be read."), |
65 utility::quoted(dir.path()))); |
65 quoted(dir.path()))); |
66 } |
66 } |
67 this->libraries.addLibrary({Library::OfficialLibrary, dir}); |
67 this->libraries.addLibrary({Library::OfficialLibrary, dir}); |
68 this->ui.newLibraryPath->clear(); |
68 this->ui.newLibraryPath->clear(); |
69 } |
69 } |
70 } |
70 } |