mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
corregido problema de lag con "check new version"
corregido bug que causaba que las marcas de leidos no se viesen bajo determinadas circustancias sincronizadas los sliders de ajustar a lo ancho corregido bug que causaba que los mensajes isCover e isLast no se mostrasen en modo de doble p?gina
This commit is contained in:
parent
ccf9ffa4bc
commit
a664eaf90e
@ -16,6 +16,7 @@ GoToFlowGL::GoToFlowGL(QWidget* parent, FlowType flowType)
|
||||
{
|
||||
|
||||
flow = new YACReaderPageFlowGL(this);
|
||||
flow->setShowMarks(false);
|
||||
|
||||
imageSize = Configuration::getConfiguration().getGotoSlideSize();
|
||||
|
||||
|
@ -94,7 +94,7 @@ void MainWindowViewer::setupUI()
|
||||
connect(versionChecker,SIGNAL(newVersionDetected()),
|
||||
this,SLOT(newVersion()));
|
||||
|
||||
//versionChecker->get(); //TODO
|
||||
versionChecker->get(); //TODO
|
||||
|
||||
viewer->setFocusPolicy(Qt::StrongFocus);
|
||||
|
||||
@ -332,6 +332,8 @@ void MainWindowViewer::createToolBars()
|
||||
tb2->setMenu(menu);
|
||||
|
||||
connect(sliderAction,SIGNAL(fitToWidthRatioChanged(float)),viewer,SLOT(updateFitToWidthRatio(float)));
|
||||
connect(optionsDialog,SIGNAL(fitToWidthRatioChanged(float)),sliderAction,SLOT(updateFitToWidthRatio(float)));
|
||||
|
||||
|
||||
//tb2->addAction();
|
||||
tb2->setPopupMode(QToolButton::MenuButtonPopup);
|
||||
|
@ -263,4 +263,13 @@ void OptionsDialog::resetImageConfig()
|
||||
settings.setValue(CONTRAST,100);
|
||||
settings.setValue(GAMMA,100);
|
||||
emit(changedImageOptions());
|
||||
}
|
||||
|
||||
void OptionsDialog::show()
|
||||
{
|
||||
//TODO solucionar el tema de las settings, esto sólo debería aparecer en una única línea de código
|
||||
QSettings *s = new QSettings(QCoreApplication::applicationDirPath()+"/YACReader.ini",QSettings::IniFormat);
|
||||
fitToWidthRatioS->setSliderPosition(settings->value(FIT_TO_WIDTH_RATIO).toFloat()*100);
|
||||
QDialog::show();
|
||||
delete s;
|
||||
}
|
@ -53,6 +53,7 @@ Q_OBJECT
|
||||
void contrastChanged(int value);
|
||||
void gammaChanged(int value);
|
||||
void resetImageConfig();
|
||||
void show();
|
||||
|
||||
signals:
|
||||
void changedOptions();
|
||||
|
@ -635,6 +635,8 @@ void Render::nextPage()
|
||||
currentIndex = nextPage;
|
||||
update();
|
||||
}
|
||||
else
|
||||
emit isLast();
|
||||
}
|
||||
//si se solicita la página anterior, se calcula cuál debe ser en función de si se lee en modo a doble página o no.
|
||||
//la página sólo se renderiza, si realmente ha cambiado.
|
||||
@ -663,6 +665,8 @@ void Render::previousPage()
|
||||
currentIndex = previousPage;
|
||||
update();
|
||||
}
|
||||
else
|
||||
emit isCover();
|
||||
}
|
||||
unsigned int Render::getIndex()
|
||||
{
|
||||
@ -742,8 +746,7 @@ void Render::goTo(int index)
|
||||
void Render::rotateRight()
|
||||
{
|
||||
imageRotation = (imageRotation+90) % 360;
|
||||
invalidate();
|
||||
update();
|
||||
reload();
|
||||
}
|
||||
void Render::rotateLeft()
|
||||
{
|
||||
@ -751,8 +754,7 @@ void Render::rotateLeft()
|
||||
imageRotation = 270;
|
||||
else
|
||||
imageRotation = imageRotation - 90;
|
||||
invalidate();
|
||||
update();
|
||||
reload();
|
||||
}
|
||||
|
||||
//Actualiza el buffer, añadiendo las imágenes (vacías) necesarias para su posterior renderizado y
|
||||
@ -890,7 +892,7 @@ void Render::invalidate()
|
||||
{
|
||||
if(pageRenders[i]!=0)
|
||||
{
|
||||
pageRenders[i]->terminate();
|
||||
pageRenders[i]->wait();
|
||||
delete pageRenders[i];
|
||||
pageRenders[i] = 0;
|
||||
}
|
||||
|
@ -68,4 +68,11 @@ void YACReaderSliderAction::updateText(int value)
|
||||
percentageLabel->setText(QString("%1 %").arg(value));
|
||||
Configuration::getConfiguration().setFitToWidthRatio(value/100.0);
|
||||
emit(fitToWidthRatioChanged(value / 100.0f));
|
||||
}
|
||||
|
||||
void YACReaderSliderAction::updateFitToWidthRatio(float v)
|
||||
{
|
||||
int value = v*100;
|
||||
slider->setValue(value);
|
||||
percentageLabel->setText(QString("%1 %").arg(value));
|
||||
}
|
@ -12,12 +12,14 @@ class YACReaderSliderAction : public QWidgetAction
|
||||
private:
|
||||
QLabel * percentageLabel;
|
||||
QSlider * slider;
|
||||
|
||||
public:
|
||||
|
||||
YACReaderSliderAction (QWidget * parent = 0);
|
||||
|
||||
public slots:
|
||||
void updateText(int value);
|
||||
void updateFitToWidthRatio(float v);
|
||||
|
||||
|
||||
signals:
|
||||
|
@ -7,7 +7,7 @@
|
||||
#define PREVIOUS_VERSION "5.0.0"
|
||||
|
||||
HttpVersionChecker::HttpVersionChecker()
|
||||
:QWidget()
|
||||
:QThread()
|
||||
{
|
||||
http = new QHttp(this);
|
||||
|
||||
@ -22,6 +22,12 @@ HttpVersionChecker::HttpVersionChecker()
|
||||
}
|
||||
|
||||
void HttpVersionChecker::get()
|
||||
{
|
||||
this->start();
|
||||
|
||||
}
|
||||
|
||||
void HttpVersionChecker::run()
|
||||
{
|
||||
QUrl url("http://code.google.com/p/yacreader/downloads/list");
|
||||
QHttp::ConnectionMode mode = QHttp::ConnectionModeHttp;
|
||||
@ -30,6 +36,7 @@ void HttpVersionChecker::get()
|
||||
if (path.isEmpty())
|
||||
path = "/";
|
||||
httpGetId = http->get(path, 0);
|
||||
exec();
|
||||
}
|
||||
void HttpVersionChecker::readResponseHeader(const QHttpResponseHeader &responseHeader)
|
||||
{
|
||||
@ -48,6 +55,7 @@ void HttpVersionChecker::httpRequestFinished(int requestId, bool error)
|
||||
QString response(content);
|
||||
#endif
|
||||
checkNewVersion(response);
|
||||
exit();
|
||||
}
|
||||
|
||||
//TODO escribir prueba unitaria
|
||||
|
@ -5,10 +5,10 @@
|
||||
#include <QHttp>
|
||||
#include <QHttpResponseHeader>
|
||||
#include <QByteArray>
|
||||
|
||||
#include <QThread>
|
||||
#include "yacreader_global.h"
|
||||
|
||||
class HttpVersionChecker : public QWidget
|
||||
class HttpVersionChecker : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@ -20,6 +20,7 @@
|
||||
void read(const QHttpResponseHeader &);
|
||||
void get();
|
||||
private:
|
||||
void run();
|
||||
QHttp *http;
|
||||
int httpGetId;
|
||||
QByteArray content;
|
||||
|
@ -711,7 +711,7 @@ void YACReaderFlowGL::populate(int n)
|
||||
}*/
|
||||
|
||||
loaded = QVector<bool>(n,false);
|
||||
marks = QVector<bool>(n,false);
|
||||
//marks = QVector<bool>(n,false);
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user