46 void LibrariesEditor::addNewLibrary() |
46 void LibrariesEditor::addNewLibrary() |
47 { |
47 { |
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( |
|
52 this, |
52 tr("Library does not exist"), |
53 tr("Library does not exist"), |
53 format( |
54 tr("The directory %1 does not exist.").arg(quoted(dir.path())) |
54 tr("The directory %1 does not exist."), |
55 ); |
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 format( |
63 tr("The directory %1 cannot be read.").arg(quoted(dir.path())) |
64 tr("The directory %1 cannot be read."), |
64 ); |
65 quoted(dir.path()))); |
|
66 } |
65 } |
67 this->libraries.addLibrary({Library::OfficialLibrary, dir}); |
66 this->libraries.addLibrary({Library::OfficialLibrary, dir}); |
68 this->ui.newLibraryPath->clear(); |
67 this->ui.newLibraryPath->clear(); |
69 } |
68 } |
70 } |
69 } |