diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d54620d8..0478268b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -11,4 +11,6 @@ A Añadidas notificaciones de portada y última página InformationLabel se muestra ahora en la esquina superiror derecha. InformationLabel se muestra en 3 tamaños diferentes en función de la resolución -Corregido bug que causaba que las marcas de cómic leído no se dibujasen adecuadamente. \ No newline at end of file +Corregido bug que causaba que las marcas de cómic leído no se dibujasen adecuadamente. +Se recuerda si se debe mostrar o no la "label" información. +Corregido bug que provocaba el fallo de YACReader al pasar muy rápido las páginas. \ No newline at end of file diff --git a/YACReader/configuration.h b/YACReader/configuration.h index 9ec88fb5..a8a5e79f 100644 --- a/YACReader/configuration.h +++ b/YACReader/configuration.h @@ -79,7 +79,9 @@ bool getAlwaysOnTop(){return settings->value(ALWAYS_ON_TOP).toBool();}; void setAlwaysOnTop(bool b){ settings->setValue(ALWAYS_ON_TOP,b);}; bool getShowToolbars(){return settings->value(SHOW_TOOLBARS).toBool();}; - void setShowToolbars(bool b){return settings->setValue(SHOW_TOOLBARS,b);}; + void setShowToolbars(bool b){settings->setValue(SHOW_TOOLBARS,b);}; + bool getShowInformation(){return settings->value(SHOW_INFO,false).toBool();}; + void setShowInformation(bool b){settings->setValue(SHOW_INFO,b);}; void save(); diff --git a/YACReader/page_label_widget.cpp b/YACReader/page_label_widget.cpp index 63385bd6..b7036b17 100644 --- a/YACReader/page_label_widget.cpp +++ b/YACReader/page_label_widget.cpp @@ -39,7 +39,9 @@ PageLabelWidget::PageLabelWidget(QWidget * parent) //textLabel->resize(100,25); resize(p.size()); - updatePosition(); + //por defecto aparece oculto + if(parent != 0) + move(QPoint((parent->geometry().size().width()-this->width()),-this->height())); /*QSize size = textLabel->sizeHint(); int w = width(); // returns screen width diff --git a/YACReader/render.cpp b/YACReader/render.cpp index 839551eb..92b2b2e5 100644 --- a/YACReader/render.cpp +++ b/YACReader/render.cpp @@ -348,7 +348,7 @@ filters(f) void PageRender::run() { - //QMutexLocker locker(&mutex); + QMutexLocker locker(&mutex); QImage img; img.loadFromData(data); @@ -388,7 +388,7 @@ filters(f) void DoublePageRender::run() { //QImage result; - //QMutexLocker locker(&mutex); + QMutexLocker locker(&mutex); QImage img, img2; if(!data.isEmpty()) img.loadFromData(data); @@ -760,7 +760,7 @@ void Render::rotateLeft() //Calcula el número de nuevas páginas que hay que buferear y si debe hacerlo por la izquierda o la derecha (según sea el sentido de la lectura) void Render::updateBuffer() { - //QMutexLocker locker(&mutex); + QMutexLocker locker(&mutex); int windowSize = currentIndex - previousIndex; if(doublePage) { diff --git a/YACReader/viewer.cpp b/YACReader/viewer.cpp index 8d697bad..df58ad8c 100644 --- a/YACReader/viewer.cpp +++ b/YACReader/viewer.cpp @@ -58,9 +58,6 @@ drag(false) content->setMouseTracking(true); setMouseTracking(true); - informationLabel = new PageLabelWidget(this); - informationLabel->hide(); - showCursor(); goToDialog = new GoToDialog(this); @@ -112,6 +109,15 @@ drag(false) notificationsLabel = new NotificationsLabelWidget(this); notificationsLabel->hide(); + + informationLabel = new PageLabelWidget(this); + if(Configuration::getConfiguration().getShowInformation()) + { + QTimer * timer = new QTimer(); + connect(timer,SIGNAL(timeout()),this,SLOT(informationSwitch())); + connect(timer,SIGNAL(timeout()),timer,SLOT(deleteLater())); + timer->start(); + } } void Viewer::createConnections() @@ -497,6 +503,7 @@ void Viewer::informationSwitch() information?informationLabel->hide():informationLabel->show(); //informationLabel->move(QPoint((width()-informationLabel->width())/2,0)); information=!information; + Configuration::getConfiguration().setShowInformation(information); //TODO it shouldn't be neccesary informationLabel->adjustSize(); informationLabel->update(); diff --git a/YACReaderLibrary/server_config_dialog.cpp b/YACReaderLibrary/server_config_dialog.cpp index 32036e87..df50af67 100644 --- a/YACReaderLibrary/server_config_dialog.cpp +++ b/YACReaderLibrary/server_config_dialog.cpp @@ -17,14 +17,11 @@ ServerConfigDialog::ServerConfigDialog(QWidget * parent) qrCodeImage = new QPixmap(); qrCode = new QLabel("xxxx",this); - - - - QGridLayout * gridEdits = new QGridLayout; gridEdits->addWidget(new QLabel(tr("IP")),0,0); gridEdits->addWidget(new QLabel(tr("Port")),0,1); - ip = new QLineEdit(". . ."); + ip = new QComboBox(); + connect(ip,SIGNAL(activated(const QString &)),this,SLOT(regenerateQR(const QString &))); gridEdits->addWidget(ip,1,0); port = new QLineEdit("8080"); port->setMaximumWidth(50); @@ -88,19 +85,24 @@ void ServerConfigDialog::generateQR() QString dir; QList list = QHostInfo::fromName( QHostInfo::localHostName() ).addresses(); + QList otherAddresses; foreach(QHostAddress add, list) { QString tmp = add.toString(); if(tmp.contains(".") && tmp != "127.0.0.1") { - dir = tmp; - break; - } + if(dir.isEmpty()) + dir = tmp; + else + otherAddresses.push_back(tmp); + + } } if(!dir.isEmpty()) { generateQR(dir+":"+s->getPort()); - ip->setText(dir); + ip->addItem(dir); + ip->addItems(otherAddresses); port->setText(s->getPort()); } else @@ -140,4 +142,9 @@ void ServerConfigDialog::updateImage() qrCode->setPixmap(*qrCodeImage); delete qrGenerator;*/ -} \ No newline at end of file +} + +void ServerConfigDialog::regenerateQR(const QString & ip) +{ + generateQR(ip+":"+s->getPort()); +} diff --git a/YACReaderLibrary/server_config_dialog.h b/YACReaderLibrary/server_config_dialog.h index a6171182..09760afc 100644 --- a/YACReaderLibrary/server_config_dialog.h +++ b/YACReaderLibrary/server_config_dialog.h @@ -8,6 +8,7 @@ #include #include #include +#include class ServerConfigDialog : public QDialog { @@ -15,7 +16,7 @@ Q_OBJECT public: ServerConfigDialog(QWidget * parent = 0); private: - QLineEdit * ip; + QComboBox * ip; QLineEdit * port; QPushButton * close; QPushButton * accept; @@ -26,6 +27,7 @@ Q_OBJECT public slots: void generateQR(); void generateQR(const QString & serverAddress); + void regenerateQR(const QString & ip); void updateImage(); signals: void portChanged(QString port); diff --git a/common/yacreader_global.h b/common/yacreader_global.h index 164dca31..4549366c 100644 --- a/common/yacreader_global.h +++ b/common/yacreader_global.h @@ -24,6 +24,7 @@ #define BRIGHTNESS "BRIGHTNESS" #define CONTRAST "CONTRAST" #define GAMMA "GAMMA" +#define SHOW_INFO "SHOW_INFO" #define FLOW_TYPE_GL "FLOW_TYPE_GL" #define Y_POSITION "Y_POSITION" diff --git a/images/numPagesLabel.png b/images/numPagesLabel.png index e2956ebe..509e4d36 100644 Binary files a/images/numPagesLabel.png and b/images/numPagesLabel.png differ diff --git a/images/numPagesLabelBig.png b/images/numPagesLabelBig.png index e2235e03..34ee0e45 100644 Binary files a/images/numPagesLabelBig.png and b/images/numPagesLabelBig.png differ diff --git a/images/numPagesLabelMedium.png b/images/numPagesLabelMedium.png index 82ece58f..5bec00ed 100644 Binary files a/images/numPagesLabelMedium.png and b/images/numPagesLabelMedium.png differ