mirror of
https://github.com/YACReader/yacreader
synced 2026-02-26 08:53:00 -05:00
bookmarks and image optiones are now stored in the library for each comic
This commit is contained in:
@ -1,8 +1,13 @@
|
|||||||
|
6.8 (No p<>blica)
|
||||||
|
Corregido bug que causaba un cierre inesperado despu<70>s de cambiar el modo de sincronizaci<63>n vertical (flow)
|
||||||
|
Corregido bug que causaba que la toolbar en el visor no se pudiese ocultar/mostrar sin un c<>mic abierto
|
||||||
|
Mejorada la gesti<74>n de errores al abrir c<>mics
|
||||||
|
Corregidos algunos bugs relacionados con la apertura de c<>mics
|
||||||
|
|
||||||
6.7 (No p<>blica)
|
6.7 (No p<>blica)
|
||||||
A<EFBFBD>adidos nuevos campos en la base de datos para almacenar informaci<63>n adicional sobre c<>mics: rating, p<>gina actual, bookmarks y configuraci<63>n de imagen
|
A<EFBFBD>adidos nuevos campos en la base de datos para almacenar informaci<63>n adicional sobre c<>mics: rating, p<>gina actual, bookmarks y configuraci<63>n de imagen
|
||||||
A<EFBFBD>adida comunicaci<63>n entre YACReaderLibrary y YACReader para poder almacenar el progreso de los c<>mics e informaci<63>n adicional
|
A<EFBFBD>adida comunicaci<63>n entre YACReaderLibrary y YACReader para poder almacenar el progreso de los c<>mics e informaci<63>n adicional
|
||||||
|
|
||||||
|
|
||||||
6.6 (No p<>blica)
|
6.6 (No p<>blica)
|
||||||
Modificado YACReader para que abra los archivos comprimidos usando 7z.dll (.so, .dylib)
|
Modificado YACReader para que abra los archivos comprimidos usando 7z.dll (.so, .dylib)
|
||||||
YACReader abre ahora los c<>mics por la <20>ltima p<>gina le<6C>da.
|
YACReader abre ahora los c<>mics por la <20>ltima p<>gina le<6C>da.
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QList>
|
||||||
#define NUM_BOOKMARKS 250
|
#define NUM_BOOKMARKS 250
|
||||||
|
|
||||||
Bookmarks::Bookmarks()
|
Bookmarks::Bookmarks()
|
||||||
@ -84,8 +84,8 @@ void Bookmarks::newComic(const QString & path)
|
|||||||
for(int i=0;i<latestBookmarks.count();i++)
|
for(int i=0;i<latestBookmarks.count();i++)
|
||||||
bookmarks.insert(latestBookmarks.at(i),QImage());
|
bookmarks.insert(latestBookmarks.at(i),QImage());
|
||||||
added = b.added;
|
added = b.added;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bookmarks::clear()
|
void Bookmarks::clear()
|
||||||
{
|
{
|
||||||
bookmarks.clear();
|
bookmarks.clear();
|
||||||
@ -94,6 +94,19 @@ void Bookmarks::clear()
|
|||||||
lastPage = QImage();
|
lastPage = QImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Bookmarks::load(const QList<int> & bookmarkIndexes, int lastPage)
|
||||||
|
{
|
||||||
|
lastPageIndex = lastPage;
|
||||||
|
foreach(int b, bookmarkIndexes)
|
||||||
|
if(b != -1)
|
||||||
|
{
|
||||||
|
latestBookmarks.push_back(b);
|
||||||
|
bookmarks.insert(b,QImage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void Bookmarks::save()
|
void Bookmarks::save()
|
||||||
{
|
{
|
||||||
BookmarksList::Bookmark b;
|
BookmarksList::Bookmark b;
|
||||||
|
|||||||
@ -71,6 +71,7 @@ class Bookmarks : public QObject
|
|||||||
void newComic(const QString & path);
|
void newComic(const QString & path);
|
||||||
void clear();
|
void clear();
|
||||||
void save();
|
void save();
|
||||||
|
bool load(const QList<int> & bookmarkIndexes, int lastPage);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
#include "bookmarks.h" //TODO desacoplar la dependencia con bookmarks
|
#include "bookmarks.h" //TODO desacoplar la dependencia con bookmarks
|
||||||
#include "qnaturalsorting.h"
|
#include "qnaturalsorting.h"
|
||||||
#include "compressed_archive.h"
|
#include "compressed_archive.h"
|
||||||
|
#include "comic_db.h"
|
||||||
|
|
||||||
#define EXTENSIONS << "*.jpg" << "*.jpeg" << "*.png" << "*.gif" << "*.tiff" << "*.tif" << "*.bmp"
|
#define EXTENSIONS << "*.jpg" << "*.jpeg" << "*.png" << "*.gif" << "*.tiff" << "*.tif" << "*.bmp"
|
||||||
#define EXTENSIONS_LITERAL << ".jpg" << ".jpeg" << ".png" << ".gif" << ".tiff" << ".tif" << ".bmp"
|
#define EXTENSIONS_LITERAL << ".jpg" << ".jpeg" << ".png" << ".gif" << ".tiff" << ".tif" << ".bmp"
|
||||||
@ -212,7 +213,29 @@ bool FileComic::load(const QString & path, int atPage)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QMessageBox::critical(NULL,tr("Not found"),tr("Comic not found")+" : " + path);
|
//QMessageBox::critical(NULL,tr("Not found"),tr("Comic not found")+" : " + path);
|
||||||
|
emit errorOpening();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FileComic::load(const QString & path, const ComicDB & comic)
|
||||||
|
{
|
||||||
|
QFileInfo fi(path);
|
||||||
|
|
||||||
|
if(fi.exists())
|
||||||
|
{
|
||||||
|
QList<int> bookmarkIndexes;
|
||||||
|
bookmarkIndexes << comic.info.bookmark1 << comic.info.bookmark2 << comic.info.bookmark3;
|
||||||
|
if(bm->load(bookmarkIndexes,comic.info.currentPage-1))
|
||||||
|
emit bookmarksUpdated();
|
||||||
|
_firstPage = comic.info.currentPage-1;
|
||||||
|
_path = QDir::cleanPath(path);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//QMessageBox::critical(NULL,tr("Not found"),tr("Comic not found")+" : " + path);
|
||||||
emit errorOpening();
|
emit errorOpening();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -546,6 +569,10 @@ PDFComic::~PDFComic()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool PDFComic::load(const QString & path, int atPage)
|
bool PDFComic::load(const QString & path, int atPage)
|
||||||
|
{
|
||||||
|
QFileInfo fi(path);
|
||||||
|
|
||||||
|
if(fi.exists())
|
||||||
{
|
{
|
||||||
_path = path;
|
_path = path;
|
||||||
if(atPage == -1)
|
if(atPage == -1)
|
||||||
@ -557,6 +584,34 @@ bool PDFComic::load(const QString & path, int atPage)
|
|||||||
//emit bookmarksLoaded(*bm);
|
//emit bookmarksLoaded(*bm);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
emit errorOpening();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PDFComic::load(const QString & path, const ComicDB & comic)
|
||||||
|
{
|
||||||
|
QFileInfo fi(path);
|
||||||
|
|
||||||
|
if(fi.exists())
|
||||||
|
{
|
||||||
|
QList<int> bookmarkIndexes;
|
||||||
|
bookmarkIndexes << comic.info.bookmark1 << comic.info.bookmark2 << comic.info.bookmark3;
|
||||||
|
if(bm->load(bookmarkIndexes,comic.info.currentPage-1))
|
||||||
|
emit bookmarksUpdated();
|
||||||
|
_firstPage = comic.info.currentPage-1;
|
||||||
|
_path = QDir::cleanPath(path);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//QMessageBox::critical(NULL,tr("Not found"),tr("Comic not found")+" : " + path);
|
||||||
|
emit errorOpening();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void PDFComic::process()
|
void PDFComic::process()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
#include "poppler-qt4.h"
|
#include "poppler-qt4.h"
|
||||||
|
|
||||||
|
class ComicDB;
|
||||||
|
|
||||||
class Comic : public QObject
|
class Comic : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -43,6 +45,7 @@
|
|||||||
void setup();
|
void setup();
|
||||||
//Load pages from file
|
//Load pages from file
|
||||||
virtual bool load(const QString & path, int atPage = -1) = 0;
|
virtual bool load(const QString & path, int atPage = -1) = 0;
|
||||||
|
virtual bool load(const QString & path, const ComicDB & comic){return false;};
|
||||||
|
|
||||||
/*void loadFromFile(const QString & pathFile);
|
/*void loadFromFile(const QString & pathFile);
|
||||||
void loadFromDir(const QString & pathDir);
|
void loadFromDir(const QString & pathDir);
|
||||||
@ -95,6 +98,7 @@
|
|||||||
~FileComic();
|
~FileComic();
|
||||||
void fileExtracted(int index, const QByteArray & rawData);
|
void fileExtracted(int index, const QByteArray & rawData);
|
||||||
virtual bool load(const QString & path, int atPage = -1);
|
virtual bool load(const QString & path, int atPage = -1);
|
||||||
|
virtual bool load(const QString & path, const ComicDB & comic);
|
||||||
void crcError(int index);
|
void crcError(int index);
|
||||||
void unknownError(int index);
|
void unknownError(int index);
|
||||||
public slots:
|
public slots:
|
||||||
@ -132,6 +136,7 @@
|
|||||||
~PDFComic();
|
~PDFComic();
|
||||||
|
|
||||||
virtual bool load(const QString & path, int atPage = -1);
|
virtual bool load(const QString & path, int atPage = -1);
|
||||||
|
virtual bool load(const QString & path, const ComicDB & comic);
|
||||||
public slots:
|
public slots:
|
||||||
void process();
|
void process();
|
||||||
};
|
};
|
||||||
|
|||||||
@ -142,7 +142,7 @@ void MainWindowViewer::setupUI()
|
|||||||
connect(optionsDialog,SIGNAL(accepted()),viewer,SLOT(updateOptions()));
|
connect(optionsDialog,SIGNAL(accepted()),viewer,SLOT(updateOptions()));
|
||||||
connect(optionsDialog,SIGNAL(fitToWidthRatioChanged(float)),viewer,SLOT(updateFitToWidthRatio(float)));
|
connect(optionsDialog,SIGNAL(fitToWidthRatioChanged(float)),viewer,SLOT(updateFitToWidthRatio(float)));
|
||||||
connect(optionsDialog, SIGNAL(optionsChanged()),this,SLOT(reloadOptions()));
|
connect(optionsDialog, SIGNAL(optionsChanged()),this,SLOT(reloadOptions()));
|
||||||
connect(optionsDialog,SIGNAL(changedImageOptions()),viewer,SLOT(updateImageOptions()));
|
connect(optionsDialog,SIGNAL(changedFilters(int,int,int)),viewer,SLOT(updateFilters(int,int,int)));
|
||||||
|
|
||||||
optionsDialog->restoreOptions(settings);
|
optionsDialog->restoreOptions(settings);
|
||||||
shortcutsDialog = new ShortcutsDialog(this);
|
shortcutsDialog = new ShortcutsDialog(this);
|
||||||
@ -152,40 +152,7 @@ void MainWindowViewer::setupUI()
|
|||||||
|
|
||||||
setWindowTitle("YACReader");
|
setWindowTitle("YACReader");
|
||||||
|
|
||||||
if(QCoreApplication::argc() == 2) //only path...
|
openFromArgv();
|
||||||
{
|
|
||||||
isClient = false;
|
|
||||||
//TODO: new method open(QString)
|
|
||||||
QString pathFile = QCoreApplication::arguments().at(1);
|
|
||||||
QFileInfo fi(pathFile);
|
|
||||||
currentDirectory = fi.absoluteDir().path();
|
|
||||||
getSiblingComics(fi.absolutePath(),fi.fileName());
|
|
||||||
|
|
||||||
setWindowTitle("YACReader - " + fi.fileName());
|
|
||||||
enableActions();
|
|
||||||
viewer->open(pathFile);
|
|
||||||
}
|
|
||||||
else if(QCoreApplication::argc() == 5)
|
|
||||||
{
|
|
||||||
isClient = true;
|
|
||||||
QString pathFile = QCoreApplication::arguments().at(1);
|
|
||||||
currentDirectory = pathFile;
|
|
||||||
quint64 comicId = QCoreApplication::arguments().at(2).toULongLong();
|
|
||||||
libraryId = QCoreApplication::arguments().at(3).toULongLong();
|
|
||||||
int page = QCoreApplication::arguments().at(4).toULongLong();
|
|
||||||
|
|
||||||
enableActions();
|
|
||||||
|
|
||||||
//TODO request data to the server
|
|
||||||
|
|
||||||
currentComicDB.id = comicId;
|
|
||||||
YACReaderLocalClient client;
|
|
||||||
|
|
||||||
if(client.requestComicInfo(libraryId,currentComicDB,siblingComics))
|
|
||||||
open(pathFile+currentComicDB.path,currentComicDB,siblingComics);
|
|
||||||
else
|
|
||||||
{/*error*/}
|
|
||||||
}
|
|
||||||
|
|
||||||
versionChecker = new HttpVersionChecker();
|
versionChecker = new HttpVersionChecker();
|
||||||
|
|
||||||
@ -220,6 +187,43 @@ void MainWindowViewer::setupUI()
|
|||||||
hideToolBars();
|
hideToolBars();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindowViewer::openFromArgv()
|
||||||
|
{
|
||||||
|
if(QCoreApplication::argc() == 2) //only path...
|
||||||
|
{
|
||||||
|
isClient = false;
|
||||||
|
//TODO: new method open(QString)
|
||||||
|
QString pathFile = QCoreApplication::arguments().at(1);
|
||||||
|
QFileInfo fi(pathFile);
|
||||||
|
currentDirectory = fi.absoluteDir().path();
|
||||||
|
getSiblingComics(fi.absolutePath(),fi.fileName());
|
||||||
|
|
||||||
|
setWindowTitle("YACReader - " + fi.fileName());
|
||||||
|
enableActions();
|
||||||
|
viewer->open(pathFile);
|
||||||
|
}
|
||||||
|
else if(QCoreApplication::argc() == 4)
|
||||||
|
{
|
||||||
|
isClient = true;
|
||||||
|
QString pathFile = QCoreApplication::arguments().at(1);
|
||||||
|
currentDirectory = pathFile;
|
||||||
|
quint64 comicId = QCoreApplication::arguments().at(2).toULongLong();
|
||||||
|
libraryId = QCoreApplication::arguments().at(3).toULongLong();
|
||||||
|
|
||||||
|
enableActions();
|
||||||
|
|
||||||
|
currentComicDB.id = comicId;
|
||||||
|
YACReaderLocalClient client;
|
||||||
|
|
||||||
|
if(client.requestComicInfo(libraryId,currentComicDB,siblingComics))
|
||||||
|
open(pathFile+currentComicDB.path,currentComicDB,siblingComics);
|
||||||
|
else
|
||||||
|
{/*error*/}
|
||||||
|
|
||||||
|
optionsDialog->setFilters(currentComicDB.info.brightness, currentComicDB.info.contrast, currentComicDB.info.gamma);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindowViewer::createActions()
|
void MainWindowViewer::createActions()
|
||||||
{
|
{
|
||||||
openAction = new QAction(tr("&Open"),this);
|
openAction = new QAction(tr("&Open"),this);
|
||||||
@ -598,10 +602,12 @@ void MainWindowViewer::open(QString path, ComicDB & comic, QList<ComicDB> & sibl
|
|||||||
else
|
else
|
||||||
setWindowTitle("YACReader - " + fi.fileName());
|
setWindowTitle("YACReader - " + fi.fileName());
|
||||||
|
|
||||||
viewer->open(path,comic.info.currentPage-1);
|
viewer->open(path,comic);
|
||||||
enableActions();
|
enableActions();
|
||||||
int index = siblings.indexOf(comic);
|
int index = siblings.indexOf(comic);
|
||||||
|
|
||||||
|
optionsDialog->setFilters(currentComicDB.info.brightness, currentComicDB.info.contrast, currentComicDB.info.gamma);
|
||||||
|
|
||||||
if(index>0)
|
if(index>0)
|
||||||
openPreviousComicAction->setDisabled(false);
|
openPreviousComicAction->setDisabled(false);
|
||||||
else
|
else
|
||||||
@ -840,20 +846,10 @@ void MainWindowViewer::newVersion()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void MainWindowViewer::closeEvent ( QCloseEvent * event )
|
void MainWindowViewer::closeEvent ( QCloseEvent * event )
|
||||||
{
|
{
|
||||||
YACReaderLocalClient client;
|
|
||||||
if(isClient)
|
if(isClient)
|
||||||
{
|
sendComic();
|
||||||
currentComicDB.info.currentPage = viewer->getCurrentPageNumber()+1;
|
|
||||||
currentComicDB.info.hasBeenOpened = true;
|
|
||||||
//viewer->getBookmarks();
|
|
||||||
client.sendComicInfo(libraryId,currentComicDB);
|
|
||||||
}
|
|
||||||
|
|
||||||
viewer->save();
|
viewer->save();
|
||||||
Configuration & conf = Configuration::getConfiguration();
|
Configuration & conf = Configuration::getConfiguration();
|
||||||
@ -869,20 +865,16 @@ void MainWindowViewer::closeEvent ( QCloseEvent * event )
|
|||||||
|
|
||||||
void MainWindowViewer::openPreviousComic()
|
void MainWindowViewer::openPreviousComic()
|
||||||
{
|
{
|
||||||
YACReaderLocalClient client;
|
|
||||||
if(!siblingComics.isEmpty() && isClient)
|
if(!siblingComics.isEmpty() && isClient)
|
||||||
{
|
{
|
||||||
|
sendComic();
|
||||||
currentComicDB.info.currentPage = viewer->getCurrentPageNumber()+1;
|
|
||||||
currentComicDB.info.hasBeenOpened = true;
|
|
||||||
//viewer->getBookmarks();
|
|
||||||
client.sendComicInfo(libraryId,currentComicDB);
|
|
||||||
|
|
||||||
int currentIndex = siblingComics.indexOf(currentComicDB);
|
int currentIndex = siblingComics.indexOf(currentComicDB);
|
||||||
if (currentIndex == -1)
|
if (currentIndex == -1)
|
||||||
return;
|
return;
|
||||||
if(currentIndex-1 >= 0 && currentIndex-1 < siblingComics.count())
|
if(currentIndex-1 >= 0 && currentIndex-1 < siblingComics.count())
|
||||||
{
|
{
|
||||||
|
siblingComics[currentIndex] = currentComicDB; //updated
|
||||||
currentComicDB = siblingComics.at(currentIndex-1);
|
currentComicDB = siblingComics.at(currentIndex-1);
|
||||||
open(currentDirectory+currentComicDB.path,currentComicDB,siblingComics);
|
open(currentDirectory+currentComicDB.path,currentComicDB,siblingComics);
|
||||||
}
|
}
|
||||||
@ -900,19 +892,16 @@ void MainWindowViewer::openPreviousComic()
|
|||||||
|
|
||||||
void MainWindowViewer::openNextComic()
|
void MainWindowViewer::openNextComic()
|
||||||
{
|
{
|
||||||
YACReaderLocalClient client;
|
|
||||||
if(!siblingComics.isEmpty() && isClient)
|
if(!siblingComics.isEmpty() && isClient)
|
||||||
{
|
{
|
||||||
currentComicDB.info.currentPage = viewer->getCurrentPageNumber()+1;
|
sendComic();
|
||||||
currentComicDB.info.hasBeenOpened = true;
|
|
||||||
//viewer->getBookmarks();
|
|
||||||
client.sendComicInfo(libraryId,currentComicDB);
|
|
||||||
|
|
||||||
int currentIndex = siblingComics.indexOf(currentComicDB);
|
int currentIndex = siblingComics.indexOf(currentComicDB);
|
||||||
if (currentIndex == -1)
|
if (currentIndex == -1)
|
||||||
return;
|
return;
|
||||||
if(currentIndex+1 > 0 && currentIndex+1 < siblingComics.count())
|
if(currentIndex+1 > 0 && currentIndex+1 < siblingComics.count())
|
||||||
{
|
{
|
||||||
|
siblingComics[currentIndex] = currentComicDB; //updated
|
||||||
currentComicDB = siblingComics.at(currentIndex+1);
|
currentComicDB = siblingComics.at(currentIndex+1);
|
||||||
open(currentDirectory+currentComicDB.path,currentComicDB,siblingComics);
|
open(currentDirectory+currentComicDB.path,currentComicDB,siblingComics);
|
||||||
}
|
}
|
||||||
@ -1034,3 +1023,13 @@ void MainWindowViewer::adjustToFullSizeSwitch()
|
|||||||
Configuration::getConfiguration().setAdjustToFullSize(!Configuration::getConfiguration().getAdjustToFullSize());
|
Configuration::getConfiguration().setAdjustToFullSize(!Configuration::getConfiguration().getAdjustToFullSize());
|
||||||
viewer->updatePage();
|
viewer->updatePage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindowViewer::sendComic()
|
||||||
|
{
|
||||||
|
YACReaderLocalClient * client = new YACReaderLocalClient;
|
||||||
|
currentComicDB.info.hasBeenOpened = true;
|
||||||
|
viewer->updateComic(currentComicDB);
|
||||||
|
client->sendComicInfo(libraryId,currentComicDB);
|
||||||
|
connect(client,SIGNAL(finished()),client,SLOT(deleteLater()));
|
||||||
|
//delete client;
|
||||||
|
}
|
||||||
@ -106,6 +106,7 @@ class YACReaderSliderAction;
|
|||||||
QString nextComicPath;
|
QString nextComicPath;
|
||||||
//! M<>todo que inicializa el interfaz.
|
//! M<>todo que inicializa el interfaz.
|
||||||
void setupUI();
|
void setupUI();
|
||||||
|
void openFromArgv();
|
||||||
void createActions();
|
void createActions();
|
||||||
void createToolBars();
|
void createToolBars();
|
||||||
void getSiblingComics(QString path,QString currentComic);
|
void getSiblingComics(QString path,QString currentComic);
|
||||||
@ -127,6 +128,7 @@ signals:
|
|||||||
void closed();
|
void closed();
|
||||||
protected:
|
protected:
|
||||||
virtual void closeEvent ( QCloseEvent * event );
|
virtual void closeEvent ( QCloseEvent * event );
|
||||||
|
void sendComic();
|
||||||
public:
|
public:
|
||||||
MainWindowViewer();
|
MainWindowViewer();
|
||||||
~MainWindowViewer();
|
~MainWindowViewer();
|
||||||
|
|||||||
@ -244,21 +244,24 @@ void OptionsDialog::brightnessChanged(int value)
|
|||||||
{
|
{
|
||||||
QSettings settings(QCoreApplication::applicationDirPath()+"/YACReader.ini",QSettings::IniFormat);
|
QSettings settings(QCoreApplication::applicationDirPath()+"/YACReader.ini",QSettings::IniFormat);
|
||||||
settings.setValue(BRIGHTNESS,value);
|
settings.setValue(BRIGHTNESS,value);
|
||||||
emit(changedImageOptions());
|
emit changedFilters(brightnessS->getValue(), contrastS->getValue(), gammaS->getValue());
|
||||||
|
//emit(changedImageOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionsDialog::contrastChanged(int value)
|
void OptionsDialog::contrastChanged(int value)
|
||||||
{
|
{
|
||||||
QSettings settings(QCoreApplication::applicationDirPath()+"/YACReader.ini",QSettings::IniFormat);
|
QSettings settings(QCoreApplication::applicationDirPath()+"/YACReader.ini",QSettings::IniFormat);
|
||||||
settings.setValue(CONTRAST,value);
|
settings.setValue(CONTRAST,value);
|
||||||
emit(changedImageOptions());
|
emit changedFilters(brightnessS->getValue(), contrastS->getValue(), gammaS->getValue());
|
||||||
|
///emit(changedImageOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionsDialog::gammaChanged(int value)
|
void OptionsDialog::gammaChanged(int value)
|
||||||
{
|
{
|
||||||
QSettings settings(QCoreApplication::applicationDirPath()+"/YACReader.ini",QSettings::IniFormat);
|
QSettings settings(QCoreApplication::applicationDirPath()+"/YACReader.ini",QSettings::IniFormat);
|
||||||
settings.setValue(GAMMA,value);
|
settings.setValue(GAMMA,value);
|
||||||
emit(changedImageOptions());
|
emit changedFilters(brightnessS->getValue(), contrastS->getValue(), gammaS->getValue());
|
||||||
|
//emit(changedImageOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionsDialog::resetImageConfig()
|
void OptionsDialog::resetImageConfig()
|
||||||
@ -270,7 +273,8 @@ void OptionsDialog::resetImageConfig()
|
|||||||
settings.setValue(BRIGHTNESS,0);
|
settings.setValue(BRIGHTNESS,0);
|
||||||
settings.setValue(CONTRAST,100);
|
settings.setValue(CONTRAST,100);
|
||||||
settings.setValue(GAMMA,100);
|
settings.setValue(GAMMA,100);
|
||||||
emit(changedImageOptions());
|
emit changedFilters(brightnessS->getValue(), contrastS->getValue(), gammaS->getValue());
|
||||||
|
//emit(changedImageOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionsDialog::show()
|
void OptionsDialog::show()
|
||||||
@ -281,3 +285,20 @@ void OptionsDialog::show()
|
|||||||
QDialog::show();
|
QDialog::show();
|
||||||
delete s;
|
delete s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OptionsDialog::setFilters(int brightness, int contrast, int gamma)
|
||||||
|
{
|
||||||
|
if(brightness != -1)
|
||||||
|
brightnessS->setValue(brightness);
|
||||||
|
else
|
||||||
|
brightnessS->setValue(0);
|
||||||
|
if(contrast != -1)
|
||||||
|
contrastS->setValue(contrast);
|
||||||
|
else
|
||||||
|
contrastS->setValue(100);
|
||||||
|
if(gamma != -1)
|
||||||
|
gammaS->setValue(gamma);
|
||||||
|
else
|
||||||
|
gammaS->setValue(100);
|
||||||
|
|
||||||
|
}
|
||||||
@ -56,10 +56,12 @@ Q_OBJECT
|
|||||||
void gammaChanged(int value);
|
void gammaChanged(int value);
|
||||||
void resetImageConfig();
|
void resetImageConfig();
|
||||||
void show();
|
void show();
|
||||||
|
void setFilters(int brightness, int contrast, int gamma);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void changedOptions();
|
void changedOptions();
|
||||||
void changedImageOptions();
|
void changedImageOptions();
|
||||||
|
void changedFilters(int brightness, int contrast, int gamma);
|
||||||
void fitToWidthRatioChanged(float ratio);
|
void fitToWidthRatioChanged(float ratio);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
#define NL 2
|
#define NL 2
|
||||||
#define NR 2
|
#define NR 2
|
||||||
|
|
||||||
|
#include "comic_db.h"
|
||||||
#include "yacreader_global.h"
|
#include "yacreader_global.h"
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
@ -223,9 +224,9 @@ QImage MedianNoiseReductionFilter::setFilter(const QImage & image)
|
|||||||
// BrightnessFilter
|
// BrightnessFilter
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
BrightnessFilter::BrightnessFilter(int l)
|
BrightnessFilter::BrightnessFilter(int l)
|
||||||
:level(l)
|
:ImageFilter()
|
||||||
{
|
{
|
||||||
|
level = l;
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage BrightnessFilter::setFilter(const QImage & image)
|
QImage BrightnessFilter::setFilter(const QImage & image)
|
||||||
@ -240,17 +241,24 @@ QImage BrightnessFilter::setFilter(const QImage & image)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;*/
|
return result;*/
|
||||||
|
if(level ==-1)
|
||||||
|
{
|
||||||
QSettings settings(QCoreApplication::applicationDirPath()+"/YACReader.ini",QSettings::IniFormat);
|
QSettings settings(QCoreApplication::applicationDirPath()+"/YACReader.ini",QSettings::IniFormat);
|
||||||
return changeBrightness(image,settings.value(BRIGHTNESS,0).toInt());
|
return changeBrightness(image,settings.value(BRIGHTNESS,0).toInt());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return changeBrightness(image,level);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// ContrastFilter
|
// ContrastFilter
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
ContrastFilter::ContrastFilter(int l)
|
ContrastFilter::ContrastFilter(int l)
|
||||||
:level(l)
|
:ImageFilter()
|
||||||
{
|
{
|
||||||
|
level = l;
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage ContrastFilter::setFilter(const QImage & image)
|
QImage ContrastFilter::setFilter(const QImage & image)
|
||||||
@ -311,22 +319,37 @@ QImage ContrastFilter::setFilter(const QImage & image)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return result;*/
|
return result;*/
|
||||||
|
if(level ==-1)
|
||||||
|
{
|
||||||
QSettings settings(QCoreApplication::applicationDirPath()+"/YACReader.ini",QSettings::IniFormat);
|
QSettings settings(QCoreApplication::applicationDirPath()+"/YACReader.ini",QSettings::IniFormat);
|
||||||
return changeContrast(image,settings.value(CONTRAST,100).toInt());
|
return changeContrast(image,settings.value(CONTRAST,100).toInt());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return changeContrast(image,level);
|
||||||
|
}
|
||||||
|
}
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// ContrastFilter
|
// ContrastFilter
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
GammaFilter::GammaFilter(int l)
|
GammaFilter::GammaFilter(int l)
|
||||||
:level(l)
|
:ImageFilter()
|
||||||
{
|
{
|
||||||
|
level = l;
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage GammaFilter::setFilter(const QImage & image)
|
QImage GammaFilter::setFilter(const QImage & image)
|
||||||
|
{
|
||||||
|
if(level ==-1)
|
||||||
{
|
{
|
||||||
QSettings settings(QCoreApplication::applicationDirPath()+"/YACReader.ini",QSettings::IniFormat);
|
QSettings settings(QCoreApplication::applicationDirPath()+"/YACReader.ini",QSettings::IniFormat);
|
||||||
return changeGamma(image,settings.value(GAMMA,100).toInt());
|
return changeGamma(image,settings.value(GAMMA,100).toInt());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return changeGamma(image,level);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// PageRender
|
// PageRender
|
||||||
@ -585,6 +608,40 @@ void Render::update()
|
|||||||
// Comic interface
|
// Comic interface
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void Render::load(const QString & path, int atPage)
|
void Render::load(const QString & path, int atPage)
|
||||||
|
{
|
||||||
|
createComic(path);
|
||||||
|
loadComic(path,atPage);
|
||||||
|
startLoad();
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
void Render::load(const QString & path, const ComicDB & comicDB)
|
||||||
|
{
|
||||||
|
//TODO prepare filters
|
||||||
|
for(int i = 0; i < filters.count(); i++)
|
||||||
|
{
|
||||||
|
if(typeid(*filters[i]) == typeid(BrightnessFilter))
|
||||||
|
if(comicDB.info.brightness == -1)
|
||||||
|
filters[i]->setLevel(0);
|
||||||
|
else
|
||||||
|
filters[i]->setLevel(comicDB.info.brightness);
|
||||||
|
if(typeid(*filters[i]) == typeid(ContrastFilter))
|
||||||
|
if(comicDB.info.contrast == -1)
|
||||||
|
filters[i]->setLevel(100);
|
||||||
|
else
|
||||||
|
filters[i]->setLevel(comicDB.info.contrast);
|
||||||
|
if(typeid(*filters[i]) == typeid(GammaFilter))
|
||||||
|
if(comicDB.info.gamma == -1)
|
||||||
|
filters[i]->setLevel(100);
|
||||||
|
else
|
||||||
|
filters[i]->setLevel(comicDB.info.gamma);
|
||||||
|
}
|
||||||
|
createComic(path);
|
||||||
|
loadComic(path,comicDB);
|
||||||
|
startLoad();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Render::createComic(const QString & path)
|
||||||
{
|
{
|
||||||
if(comic!=0)
|
if(comic!=0)
|
||||||
{
|
{
|
||||||
@ -622,6 +679,22 @@ void Render::load(const QString & path, int atPage)
|
|||||||
connect(comic,SIGNAL(isLast()),this,SIGNAL(isLast()));
|
connect(comic,SIGNAL(isLast()),this,SIGNAL(isLast()));
|
||||||
connect(comic,SIGNAL(isCover()),this,SIGNAL(isCover()));
|
connect(comic,SIGNAL(isCover()),this,SIGNAL(isCover()));
|
||||||
|
|
||||||
|
pagesReady.clear();
|
||||||
|
}
|
||||||
|
void Render::loadComic(const QString & path,const ComicDB & comicDB)
|
||||||
|
{
|
||||||
|
//if(typeid(*comic) != typeid(FolderComic))
|
||||||
|
comic->load(path,comicDB);
|
||||||
|
//else
|
||||||
|
{/*TODO error*/}
|
||||||
|
}
|
||||||
|
void Render::loadComic(const QString & path, int atPage)
|
||||||
|
{
|
||||||
|
comic->load(path,atPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Render::startLoad()
|
||||||
|
{
|
||||||
QThread * thread = NULL;
|
QThread * thread = NULL;
|
||||||
|
|
||||||
thread = new QThread();
|
thread = new QThread();
|
||||||
@ -631,18 +704,12 @@ void Render::load(const QString & path, int atPage)
|
|||||||
connect(thread, SIGNAL(started()), comic, SLOT(process()));
|
connect(thread, SIGNAL(started()), comic, SLOT(process()));
|
||||||
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
|
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
|
||||||
|
|
||||||
pagesReady.clear();
|
|
||||||
|
|
||||||
comic->load(path,atPage); //garantiza que se va a intentar abrir el c<>mic
|
|
||||||
|
|
||||||
if(thread != NULL)
|
if(thread != NULL)
|
||||||
thread->start();
|
thread->start();
|
||||||
|
|
||||||
invalidate();
|
invalidate();
|
||||||
loadedComic = true;
|
loadedComic = true;
|
||||||
update();
|
update();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Render::renderAt(int page)
|
void Render::renderAt(int page)
|
||||||
@ -1003,3 +1070,18 @@ void Render::reload()
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Render::updateFilters(int brightness, int contrast, int gamma)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < filters.count(); i++)
|
||||||
|
{
|
||||||
|
if(typeid(*filters[i]) == typeid(BrightnessFilter))
|
||||||
|
filters[i]->setLevel(brightness);
|
||||||
|
if(typeid(*filters[i]) == typeid(ContrastFilter))
|
||||||
|
filters[i]->setLevel(contrast);
|
||||||
|
if(typeid(*filters[i]) == typeid(GammaFilter))
|
||||||
|
filters[i]->setLevel(gamma);
|
||||||
|
}
|
||||||
|
|
||||||
|
reload();
|
||||||
|
}
|
||||||
@ -15,12 +15,17 @@
|
|||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
|
||||||
class Comic;
|
class Comic;
|
||||||
|
class ComicDB;
|
||||||
class Render;
|
class Render;
|
||||||
|
|
||||||
class ImageFilter {
|
class ImageFilter {
|
||||||
public:
|
public:
|
||||||
ImageFilter(){};
|
ImageFilter(){};
|
||||||
virtual QImage setFilter(const QImage & image) = 0;
|
virtual QImage setFilter(const QImage & image) = 0;
|
||||||
|
inline int getLevel() {return level;};
|
||||||
|
inline void setLevel(int l) {level = l;};
|
||||||
|
protected:
|
||||||
|
int level;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MeanNoiseReductionFilter : public ImageFilter {
|
class MeanNoiseReductionFilter : public ImageFilter {
|
||||||
@ -43,26 +48,20 @@ private:
|
|||||||
|
|
||||||
class BrightnessFilter : public ImageFilter {
|
class BrightnessFilter : public ImageFilter {
|
||||||
public:
|
public:
|
||||||
BrightnessFilter(int l=150);
|
BrightnessFilter(int l=-1);
|
||||||
virtual QImage setFilter(const QImage & image);
|
virtual QImage setFilter(const QImage & image);
|
||||||
private:
|
|
||||||
int level;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ContrastFilter : public ImageFilter {
|
class ContrastFilter : public ImageFilter {
|
||||||
public:
|
public:
|
||||||
ContrastFilter(int l=150);
|
ContrastFilter(int l=-1);
|
||||||
virtual QImage setFilter(const QImage & image);
|
virtual QImage setFilter(const QImage & image);
|
||||||
private:
|
|
||||||
int level;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class GammaFilter : public ImageFilter {
|
class GammaFilter : public ImageFilter {
|
||||||
public:
|
public:
|
||||||
GammaFilter(int l=150);
|
GammaFilter(int l=-1);
|
||||||
virtual QImage setFilter(const QImage & image);
|
virtual QImage setFilter(const QImage & image);
|
||||||
private:
|
|
||||||
int level;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -136,7 +135,12 @@ public slots:
|
|||||||
//--comic interface
|
//--comic interface
|
||||||
void nextPage();
|
void nextPage();
|
||||||
void previousPage();
|
void previousPage();
|
||||||
|
void load(const QString & path, const ComicDB & comic);
|
||||||
void load(const QString & path, int atPage);
|
void load(const QString & path, int atPage);
|
||||||
|
void createComic(const QString & path);
|
||||||
|
void loadComic(const QString & path,const ComicDB & comic);
|
||||||
|
void loadComic(const QString & path, int atPage);
|
||||||
|
void startLoad();
|
||||||
void rotateRight();
|
void rotateRight();
|
||||||
void rotateLeft();
|
void rotateLeft();
|
||||||
unsigned int getIndex();
|
unsigned int getIndex();
|
||||||
@ -152,6 +156,7 @@ public slots:
|
|||||||
void save();
|
void save();
|
||||||
void reset();
|
void reset();
|
||||||
void reload();
|
void reload();
|
||||||
|
void updateFilters(int brightness, int contrast, int gamma);
|
||||||
Bookmarks * getBookmarks();
|
Bookmarks * getBookmarks();
|
||||||
//sets the firt page to render
|
//sets the firt page to render
|
||||||
void renderAt(int page);
|
void renderAt(int page);
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
#include "onstart_flow_selection_dialog.h"
|
#include "onstart_flow_selection_dialog.h"
|
||||||
#include "page_label_widget.h"
|
#include "page_label_widget.h"
|
||||||
#include "notifications_label_widget.h"
|
#include "notifications_label_widget.h"
|
||||||
|
#include "comic_db.h"
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#define STEPS 22
|
#define STEPS 22
|
||||||
|
|
||||||
@ -174,14 +174,15 @@ void Viewer::createConnections()
|
|||||||
connect(render,SIGNAL(bookmarksUpdated()),this,SLOT(setBookmarks()));
|
connect(render,SIGNAL(bookmarksUpdated()),this,SLOT(setBookmarks()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Viewer::open(QString pathFile, int atPage)
|
//Deprecated
|
||||||
|
void Viewer::prepareForOpening()
|
||||||
{
|
{
|
||||||
if(render->hasLoadedComic())
|
if(render->hasLoadedComic())
|
||||||
save();
|
save();
|
||||||
//bd->setBookmarks(*bm);
|
//bd->setBookmarks(*bm);
|
||||||
|
|
||||||
goToFlow->reset();
|
goToFlow->reset();
|
||||||
render->load(pathFile, atPage);
|
|
||||||
//render->update();
|
//render->update();
|
||||||
|
|
||||||
verticalScrollBar()->setSliderPosition(verticalScrollBar()->minimum());
|
verticalScrollBar()->setSliderPosition(verticalScrollBar()->minimum());
|
||||||
@ -195,8 +196,18 @@ void Viewer::open(QString pathFile, int atPage)
|
|||||||
}
|
}
|
||||||
|
|
||||||
informationLabel->setText("...");
|
informationLabel->setText("...");
|
||||||
|
}
|
||||||
|
|
||||||
|
void Viewer::open(QString pathFile, int atPage)
|
||||||
|
{
|
||||||
|
prepareForOpening();
|
||||||
|
render->load(pathFile, atPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Viewer::open(QString pathFile, const ComicDB & comic)
|
||||||
|
{
|
||||||
|
prepareForOpening();
|
||||||
|
render->load(pathFile, comic);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Viewer::showMessageErrorOpening()
|
void Viewer::showMessageErrorOpening()
|
||||||
@ -802,11 +813,17 @@ void Viewer::updateConfig(QSettings * settings)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//deprecated
|
||||||
void Viewer::updateImageOptions()
|
void Viewer::updateImageOptions()
|
||||||
{
|
{
|
||||||
render->reload();
|
render->reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Viewer::updateFilters(int brightness, int contrast,int gamma)
|
||||||
|
{
|
||||||
|
render->updateFilters(brightness,contrast,gamma);
|
||||||
|
}
|
||||||
|
|
||||||
void Viewer::setBookmarks()
|
void Viewer::setBookmarks()
|
||||||
{
|
{
|
||||||
bd->setBookmarks(*render->getBookmarks());
|
bd->setBookmarks(*render->getBookmarks());
|
||||||
@ -834,3 +851,34 @@ int Viewer::getCurrentPageNumber()
|
|||||||
{
|
{
|
||||||
return render->getIndex();
|
return render->getIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Viewer::updateComic(ComicDB & comic)
|
||||||
|
{
|
||||||
|
//set currentPage
|
||||||
|
comic.info.currentPage = render->getIndex()+1;
|
||||||
|
//set bookmarks
|
||||||
|
Bookmarks * boomarks = render->getBookmarks();
|
||||||
|
QList<int> boomarksList = boomarks->getBookmarkPages();
|
||||||
|
int numBookmarks = boomarksList.size();
|
||||||
|
if(numBookmarks > 0)
|
||||||
|
comic.info.bookmark1 = boomarksList[0];
|
||||||
|
if(numBookmarks > 1)
|
||||||
|
comic.info.bookmark2 = boomarksList[1];
|
||||||
|
if(numBookmarks > 2)
|
||||||
|
comic.info.bookmark3 = boomarksList[2];
|
||||||
|
//set filters
|
||||||
|
//TODO: avoid use settings for this...
|
||||||
|
QSettings settings(QCoreApplication::applicationDirPath()+"/YACReader.ini",QSettings::IniFormat);
|
||||||
|
int brightness = settings.value(BRIGHTNESS,0).toInt();
|
||||||
|
int contrast = settings.value(CONTRAST,100).toInt();
|
||||||
|
int gamma = settings.value(GAMMA,100).toInt();
|
||||||
|
|
||||||
|
if(brightness != 0 || comic.info.brightness!=-1)
|
||||||
|
comic.info.brightness = brightness;
|
||||||
|
if(contrast != 100 || comic.info.contrast!=-1)
|
||||||
|
comic.info.contrast = contrast;
|
||||||
|
if(gamma != 100 || comic.info.gamma!=-1)
|
||||||
|
comic.info.gamma = gamma;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -16,7 +16,7 @@
|
|||||||
#include <QPropertyAnimation>
|
#include <QPropertyAnimation>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
|
class ComicDB;
|
||||||
class Comic;
|
class Comic;
|
||||||
class MagnifyingGlass;
|
class MagnifyingGlass;
|
||||||
class GoToFlow;
|
class GoToFlow;
|
||||||
@ -35,7 +35,9 @@ class NotificationsLabelWidget;
|
|||||||
public:
|
public:
|
||||||
bool fullscreen; //TODO, change by the right use of windowState();
|
bool fullscreen; //TODO, change by the right use of windowState();
|
||||||
public slots:
|
public slots:
|
||||||
|
void prepareForOpening();
|
||||||
void open(QString pathFile, int atPage = -1);
|
void open(QString pathFile, int atPage = -1);
|
||||||
|
void open(QString pathFile, const ComicDB & comic);
|
||||||
void prev();
|
void prev();
|
||||||
void next();
|
void next();
|
||||||
void showGoToDialog();
|
void showGoToDialog();
|
||||||
@ -80,7 +82,9 @@ virtual void mouseReleaseEvent ( QMouseEvent * event );
|
|||||||
void showMessageErrorOpening();
|
void showMessageErrorOpening();
|
||||||
void showMessageErrorOpening(QString);
|
void showMessageErrorOpening(QString);
|
||||||
void setBookmarks();
|
void setBookmarks();
|
||||||
|
//deprecated
|
||||||
void updateImageOptions();
|
void updateImageOptions();
|
||||||
|
void updateFilters(int brightness, int contrast,int gamma);
|
||||||
void showIsCoverMessage();
|
void showIsCoverMessage();
|
||||||
void showIsLastMessage();
|
void showIsLastMessage();
|
||||||
int getCurrentPageNumber();
|
int getCurrentPageNumber();
|
||||||
@ -142,6 +146,7 @@ virtual void mouseReleaseEvent ( QMouseEvent * event );
|
|||||||
const BookmarksDialog * getBookmarksDialog(){return bd;}
|
const BookmarksDialog * getBookmarksDialog(){return bd;}
|
||||||
//returns the current index starting in 1 [1,nPages]
|
//returns the current index starting in 1 [1,nPages]
|
||||||
unsigned int getIndex();
|
unsigned int getIndex();
|
||||||
|
void updateComic(ComicDB & comic);
|
||||||
signals:
|
signals:
|
||||||
void backgroundChanges();
|
void backgroundChanges();
|
||||||
void pageAvailable(bool);
|
void pageAvailable(bool);
|
||||||
|
|||||||
@ -101,10 +101,15 @@ bool YACReaderLocalClient::sendComicInfo(quint64 libraryId, ComicDB & comic)
|
|||||||
tries++;
|
tries++;
|
||||||
}
|
}
|
||||||
if(tries == 100 && written != block.size())
|
if(tries == 100 && written != block.size())
|
||||||
|
{
|
||||||
|
emit finished();
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
emit finished();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
emit finished();
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,7 @@ public:
|
|||||||
explicit YACReaderLocalClient(QObject *parent = 0);
|
explicit YACReaderLocalClient(QObject *parent = 0);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
void finished();
|
||||||
public slots:
|
public slots:
|
||||||
void readMessage();
|
void readMessage();
|
||||||
bool requestComicInfo(quint64 libraryId, ComicDB & comic,QList<ComicDB> & siblings);
|
bool requestComicInfo(quint64 libraryId, ComicDB & comic,QList<ComicDB> & siblings);
|
||||||
|
|||||||
@ -1012,17 +1012,15 @@ void LibraryWindow::openComic()
|
|||||||
quint64 comicId = comic.id;
|
quint64 comicId = comic.id;
|
||||||
//TODO generate IDS for libraries...
|
//TODO generate IDS for libraries...
|
||||||
quint64 libraryId = selectedLibrary->currentIndex();
|
quint64 libraryId = selectedLibrary->currentIndex();
|
||||||
int page = *(comic.info.numPages) / 2;
|
|
||||||
|
|
||||||
|
// %1 %2 %3 NO-->%4 %5 %6 %7 %8 %9 %10
|
||||||
|
//Invoke YACReader comicPath comicId libraryId NO-->currentPage bookmark1 bookmark2 bookmark3 brightness contrast gamma
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
|
QProcess::startDetached("open", QStringList() << "-n" << QDir::cleanPath(QCoreApplication::applicationDirPath()+"/../../../YACReader.app") << "--args" << path << comicId << libraryId /*<< page << bookmark1 << bookmark2 << bookmark3 << brightness << contrast << gamma*/);//,QStringList() << path);
|
||||||
QProcess::startDetached("open", QStringList() << "-n" << QDir::cleanPath(QCoreApplication::applicationDirPath()+"/../../../YACReader.app") << "--args" << path << comicId << libraryId << page);//,QStringList() << path);
|
|
||||||
#else
|
#else
|
||||||
|
/* \"%4\" \"%5\" \"%6\" \"%7\" \"%8\" \"%9\" \"%10\" */
|
||||||
QProcess::startDetached(QDir::cleanPath(QCoreApplication::applicationDirPath())+QString("/YACReader \"%1\" \"%2\" \"%3\" \"%4\"").arg(path).arg(comicId).arg(libraryId).arg(page),QStringList());
|
QProcess::startDetached(QDir::cleanPath(QCoreApplication::applicationDirPath())+QString("/YACReader \"%1\" \"%2\" \"%3\"").arg(path).arg(comicId).arg(libraryId)/*.arg(page).arg(bookmark1).arg(bookmark2).arg(bookmark3).arg(brightness).arg(contrast).arg(gamma)*/,QStringList());
|
||||||
#endif
|
#endif
|
||||||
//Comic is readed
|
|
||||||
//setCurrentComicReaded();
|
|
||||||
setCurrentComicOpened();
|
setCurrentComicOpened();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user