mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 04:54:29 -04:00
Add a small dialog to show some info about a library
This commit is contained in:
@ -619,6 +619,9 @@ void LibraryWindow::createMenus()
|
||||
|
||||
selectedLibrary->addAction(actions.exportLibraryAction);
|
||||
selectedLibrary->addAction(actions.importLibraryAction);
|
||||
YACReader::addSperator(selectedLibrary);
|
||||
|
||||
selectedLibrary->addAction(actions.showLibraryInfo);
|
||||
|
||||
// MacOSX app menus
|
||||
#ifdef Q_OS_MACOS
|
||||
@ -648,6 +651,10 @@ void LibraryWindow::createMenus()
|
||||
libraryMenu->addAction(actions.exportLibraryAction);
|
||||
libraryMenu->addAction(actions.importLibraryAction);
|
||||
|
||||
libraryMenu->addSeparator();
|
||||
|
||||
libraryMenu->addAction(actions.showLibraryInfo);
|
||||
|
||||
// folder
|
||||
QMenu *folderMenu = new QMenu(tr("Folder"));
|
||||
folderMenu->addAction(actions.openContainingFolderAction);
|
||||
@ -1894,6 +1901,23 @@ void LibraryWindow::rescanLibraryForXMLInfo()
|
||||
xmlInfoLibraryScanner->scanLibrary(path, path + "/.yacreaderlibrary");
|
||||
}
|
||||
|
||||
void LibraryWindow::showLibraryInfo()
|
||||
{
|
||||
auto id = libraries.getUuid(selectedLibrary->currentText());
|
||||
auto info = DBHelper::getLibraryInfo(id);
|
||||
|
||||
// TODO: use something nicer than a QMessageBox
|
||||
QMessageBox msgBox;
|
||||
msgBox.setWindowTitle(tr("Library info"));
|
||||
msgBox.setText(info);
|
||||
QSpacerItem *horizontalSpacer = new QSpacerItem(420, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
QGridLayout *layout = (QGridLayout *)msgBox.layout();
|
||||
layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount());
|
||||
msgBox.setStandardButtons(QMessageBox::Close);
|
||||
msgBox.setDefaultButton(QMessageBox::Close);
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
void LibraryWindow::rescanCurrentFolderForXMLInfo()
|
||||
{
|
||||
rescanFolderForXMLInfo(getCurrentFolderIndex());
|
||||
|
Reference in New Issue
Block a user