src/settingseditor/librarieseditor.cpp

changeset 206
654661eab7f3
parent 201
5d201ee4a9c3
child 218
63125c36de73
equal deleted inserted replaced
205:1a4342d80de7 206:654661eab7f3
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 }

mercurial