Observe volume keys on Symbian. Add minimal documentation to headers.
[dorian] / infodialog.cpp
index e2d0827..d6dee93 100644 (file)
@@ -3,9 +3,13 @@
 #include "infodialog.h"
 #include "book.h"
 #include "library.h"
+#include "trace.h"
 
-InfoDialog::InfoDialog(Book *b, QWidget *parent): Dyalog(parent), book(b)
+InfoDialog::InfoDialog(Book *b, QWidget *parent, bool showButtons):
+        Dyalog(parent, showButtons), book(b)
 {
+    TRACE;
+
     setWindowTitle(tr("Book Details"));
 
     if (book) {
@@ -42,12 +46,10 @@ InfoDialog::InfoDialog(Book *b, QWidget *parent): Dyalog(parent), book(b)
         addStretch();
     }
 
-    QPushButton *read = new QPushButton(tr("Read"), this);
-    QPushButton *remove = new QPushButton(tr("Delete"), this);
-    connect(read, SIGNAL(clicked()), this, SLOT(onReadBook()));
-    connect(remove, SIGNAL(clicked()), this, SLOT(onRemoveBook()));
-    addButton(read, QDialogButtonBox::ActionRole);
-    addButton(remove, QDialogButtonBox::DestructiveRole);
+    addButton(tr("Read"), this, SLOT(onReadBook()),
+              QDialogButtonBox::ActionRole);
+    addButton(tr("Delete"), this, SLOT(onRemoveBook()),
+              QDialogButtonBox::DestructiveRole);
 }
 
 void InfoDialog::onReadBook()