#include "infodialog.h"
#include "book.h"
#include "library.h"
+#include "trace.h"
InfoDialog::InfoDialog(Book *b, QWidget *parent, bool showButtons):
Dyalog(parent, showButtons), book(b)
{
- setWindowTitle(tr("Book Details"));
+ TRACE;
+
+ setWindowTitle(tr("Book details"));
if (book) {
QLabel *title = new QLabel(book->title, this);
void InfoDialog::onReadBook()
{
- Library::instance()->setNowReading(Library::instance()->find(book));
- close();
+ done(InfoDialog::Read);
}
void InfoDialog::onRemoveBook()
QMessageBox::question(this, tr("Delete book"),
tr("Delete book \"%1\" from library?").arg(book->shortName()),
QMessageBox::Yes | QMessageBox::No)) {
- Library::instance()->remove(Library::instance()->find(book));
- close();
+ done(InfoDialog::Delete);
}
}