| 1901 | } |
| 1902 | |
| 1903 | void LibraryWindow::removeLibrary() |
| 1904 | { |
| 1905 | QString currentLibrary = selectedLibrary->currentText(); |
| 1906 | QMessageBox *messageBox = new QMessageBox(QMessageBox::Question, |
| 1907 | tr("Are you sure?"), |
| 1908 | tr("Do you want remove ") + currentLibrary + tr(" library?"), |
| 1909 | QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No, |
| 1910 | this); |
| 1911 | messageBox->button(QMessageBox::YesToAll)->setText(tr("Remove and delete metadata")); |
| 1912 | messageBox->setWindowModality(Qt::WindowModal); |
| 1913 | int ret = messageBox->exec(); |
| 1914 | if (ret == QMessageBox::Yes) { |
| 1915 | libraries.remove(currentLibrary); |
| 1916 | selectedLibrary->removeItem(selectedLibrary->currentIndex()); |
| 1917 | // selectedLibrary->setCurrentIndex(0); |
| 1918 | if (libraries.isEmpty()) // no more libraries available. |
| 1919 | { |
| 1920 | contentViewsManager->comicsView->setModel(NULL); |
| 1921 | foldersView->setModel(NULL); |
| 1922 | listsView->setModel(NULL); |
| 1923 | |
| 1924 | actions.disableAllActions(); |
| 1925 | showNoLibrariesWidget(); |
| 1926 | } |
| 1927 | libraries.save(); |
| 1928 | } else if (ret == QMessageBox::YesToAll) { |
| 1929 | deleteCurrentLibrary(); |
| 1930 | } |
| 1931 | } |
| 1932 | |
| 1933 | void LibraryWindow::renameLibrary() |
| 1934 | { |
nothing calls this directly
no test coverage detected