+ // Load library, upgrade it if needed
+ libraryProgress = new ProgressDialog(tr("Upgrading library"), this);
+ Library *library = Library::instance();
+ connect(library, SIGNAL(beginUpgrade(int)),
+ this, SLOT(onBeginUpgrade(int)));
+ connect(library, SIGNAL(upgrading(const QString &)),
+ this, SLOT(onUpgrading(const QString &)));
+ connect(library, SIGNAL(endUpgrade()), this, SLOT(onEndUpgrade()));
+
+ // Handle loading book parts
+ connect(view, SIGNAL(partLoadStart(int)), this, SLOT(onPartLoadStart()));
+ connect(view, SIGNAL(partLoadEnd(int)), this, SLOT(onPartLoadEnd(int)));
+
+ // Handle progress
+ connect(view, SIGNAL(progress(qreal)), prog, SLOT(setProgress(qreal)));
+
+ // Shadow window for full screen reading
+ fullScreenWindow = new FullScreenWindow(this);
+ connect(fullScreenWindow, SIGNAL(restore()), this, SLOT(showRegular()));
+
+ // Handle settings changes
+ connect(Settings::instance(), SIGNAL(valueChanged(const QString &)),
+ this, SLOT(onSettingsChanged(const QString &)));
+
+ // Handle book view buttons
+ connect(next, SIGNAL(triggered()), this, SLOT(goToNextPage()));
+ connect(prev, SIGNAL(triggered()), this, SLOT(goToPreviousPage()));
+
+#ifdef DORIAN_TEST_MODEL
+ (void)new ModelTest(Library::instance(), this);
+#endif
+}
+
+void MainWindow::initialize()
+{
+ TRACE;