YACReaderLibrary opens now its own viewer windows

This commit is contained in:
Luis Ángel San Martín
2013-07-17 11:12:24 +02:00
parent e886f160cc
commit 1728f85cc0
13 changed files with 98 additions and 111 deletions

View File

@ -55,7 +55,7 @@
#include "comics_remover.h"
#include "yacreader_library_list_widget.h"
#include "yacreader_treeview.h"
#include "main_window_viewer.h"
//#include "yacreader_social_dialog.h"
//
@ -1006,19 +1006,25 @@ void LibraryWindow::openComic()
{
ComicDB comic = dmCV->getComic(comicView->currentIndex());
QString path = currentPath() + comic.path;
MainWindowViewer * viewer = new MainWindowViewer();
QList<ComicDB> siblings = dmCV->getAllComics();
viewer->open(path,comic,siblings);
viewer->show();
connect(viewer,SIGNAL(closed()),viewer,SLOT(deleteLater()));
/*quint64 comicId = comic.id;
//TODO generate IDS for libraries...
quint64 libraryId = selectedLibrary->currentIndex();
int page = *(comic.info.numPages) / 2;*/
#ifdef Q_OS_MAC
QProcess::startDetached("open", QStringList() << "-n" << QDir::cleanPath(QCoreApplication::applicationDirPath()+"/../../../YACReader.app") << "--args" << path /*<< comicId << libraryId << page*/);//,QStringList() << path);
//Comic is readed
#else
QProcess::startDetached(QDir::cleanPath(QCoreApplication::applicationDirPath())+QString("/YACReader \"%1\"").arg(path)/*.arg(comicId).arg(libraryId).arg(page)*/,QStringList());
#endif
//#ifdef Q_OS_MAC
//
// QProcess::startDetached("open", QStringList() << "-n" << QDir::cleanPath(QCoreApplication::applicationDirPath()+"/../../../YACReader.app") << "--args" << path /*<< comicId << libraryId << page*/);//,QStringList() << path);
// //Comic is readed
//#else
//
// QProcess::startDetached(QDir::cleanPath(QCoreApplication::applicationDirPath())+QString("/YACReader \"%1\"").arg(path)/*.arg(comicId).arg(libraryId).arg(page)*/,QStringList());
//#endif
//Comic is readed
setCurrentComicReaded();
}