From 154d82a84b625f6931515abd298213ad1047adc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Wed, 13 Feb 2013 22:49:21 +0100 Subject: [PATCH] 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. Modificado el di?logo "server config" para que muestre todas las ips y regenere el c?digo qr en caso de que el usuario cambie la ip. --- CHANGELOG.txt | 4 +++- YACReader/configuration.h | 4 +++- YACReader/page_label_widget.cpp | 4 +++- YACReader/render.cpp | 6 ++--- YACReader/viewer.cpp | 13 ++++++++--- YACReaderLibrary/server_config_dialog.cpp | 27 ++++++++++++++-------- YACReaderLibrary/server_config_dialog.h | 4 +++- common/yacreader_global.h | 1 + images/numPagesLabel.png | Bin 569 -> 623 bytes images/numPagesLabelBig.png | Bin 609 -> 739 bytes images/numPagesLabelMedium.png | Bin 612 -> 702 bytes 11 files changed, 43 insertions(+), 20 deletions(-) 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 e2956ebe40f38f5348f8cd9d4031d4bd65a5bc81..509e4d360fc8efcf657ae62846d6b0641cf7b611 100644 GIT binary patch delta 562 zcmV-20?qxo1n&fpNPhwmNkl}^B}qbAmJz5nmZMy(OHBl_*4C6#6vuJ#hsGGn^SlVCwtp~!b}>F8ibMp_S{LmC zVL;e0UYg=_tJNxm5n1Hug#i$ToFw5fi=v1mB8+bq2m@?zu0mmCW)WFrj)5rPkT62- zrSY>1WC0=iK*JPIIEv-b;&jtA4U#0m3V~n3Xk5;&ZAciA=Q&mg9BmjajDO^Jp6j|I%QCDGsBDVzpv<7#2hFrZGD197(7ErbD$8m4&0mIRtMOaU4OoGc6)2B2ZU-w31s5`Zw^ zBw?^60c=SC4FfR4fd3}Udc8)&fLdX4PVtO}0ZkhwH^QJ{K$C{iwURBD%Y=mSAq}V! z#+D`3nayTjVSgCDEEWr_64)Wd{*;|Qo_R(IDZTl8{yiKH-)Q)im}P)LA7}75JxZT) zOL?F?4F-eP@p$|}(sWj<6=oVx2vd2@gmSONiK6IvG#b6far`KyR9G?yqd0myinwL2 zDK{Mbe8CMAuwbq@Ja7eCB#fD3d=|n;bIIv*^Movw5_J1(DWHYI*mshQG`daBIa;7D zzxP-!G)#+yDc?!*t*@n!MKQ9dk}#m9!Z_CUq^vI|pMN`?vMi9Mg~EsmX{6OAsx-Ga x5C+0jwT)|SRSxDBP}LC55qZ!kpx{S<0RS`Gs7x|{#drV!002ovPDHLkV1nDH=H~za diff --git a/images/numPagesLabelBig.png b/images/numPagesLabelBig.png index e2235e034ca930b53636b393327ca169bfc9ac95..34ee0e45ae7059274fab08107cf905e507e4191a 100644 GIT binary patch delta 678 zcmV;X0$Kgx1mgveNq>b&L_t(|+U%XpZrVT;MrZtkO)x60TD28)!J_RZn=bo4Ec=|i zL|=hTRg0Qn?A~i;VB#b|>7qY6NBZQ1u(EXW&0I^K#26Dx63LC^h2)*&qvUq6SbSM7 zmu9osn7Xb_(=rWb)s#BVbCafNCr%v4-4%%d&VP%fmh2>3$)+d@qcW*P z+D3>3aCsxCNOvmIcsw@4;m`~QgM&x_a9Sj_qzM|S8jVIK%Q7SaxT2A|{gKL~68Sw6 z0Q}k>>Cj9`l9(upxJv+6Hc}UDB5N&o3E&K;>ZWB$2XK8O9bm`+fJgv{1n}R8wA<|v z34lfdKqLT`c7FhfL?it+Jjh0*dyNFw!9O5GqLBdDBLN^1082XnM52)Z5D5U00RC~J zb0Pr%jRb&50Eh&DNQeZ0NC1D6NP3hDA_34y0DnXz|CZJ6XG8+HjHe#Rc0%dW4gjui zBz=i~yWMU#a?NNZfXhV+CDPQZ)#_`W=eO(inmYw>0)IV-*}5g3N|j1-vp<-*D9f^% z&1RpZnPPtsGXR_xDRLrZUZ$$5>^EULoqn*^#ta_-9>+_hLJcHC$ur4I$s5U3QxwJf z`F#F)GMT)M^<-uMcp#E>A|U6sB z-7WKC_kVXipt;n&ll$C@6a`WOAd=Z1!hGjM@{)Loez>-}>4`)m0V3)7mhSbst!pHe zrV8Y!-S1_vtjnB)5sd`!@HvuiB~KHGRR$7;%Q_kf7&iEEw%ylKI12aAl?Fl5K%)M# z4w(RvdNPG$aX--uuTjuO29W@fdJkCb@jMb6$R85*Vp-Aw9Qi5003?q{)b9L&^#A|> M07*qoM6N<$f^76U8vpppcNq+-LL_t(|+U(uUZW2)d1>pICPOYG0uxW!NHYU37()aWkSo3Pa zM*h7+@1z%Mix#7ceqV9|ZCOona_*D_@+`~BkWR>}kbcNz$S~yNcs%|#nM^X^X`O?g z^O&N^X0yq*+pVhve^{iwLNz5)BzXQJ?VejCIBk)3EE4>MB7a#VP$Wk>Fn|jx7@4Xa|mVV39zP6bTdw6bTdw6iJcb zdAuPD76}vyUPh5ttCb>wMS}lRq;1UZxgx=7i?l10qaB>KNX4+euzRaIRrmrGX)jua_Riqs7`54mW{G@H$Sj7Fo|aKtMe z@!$cHAqUhnhG&CS=k zuCL3o?6_?3ut<3-f5EvVUl~ONk=guTm9P=}l6mHiP*4 zUVL3Q`DaC@OeoTQnc91#i?~d6EL0uSkAJHy66_c0@Ls8#EK@J0A0OLeT@{alg++q> zBBf>O#Im%7YIFXJW1U4pksi5UO5ayHOVUkBba<>&CKTzBd!{m3sPwT&)+kdX6zTYV lQ@T>c!5nc;c_8>HzyK&S^l-pPgl7N%002ovPDHLkV1hno0=NJG diff --git a/images/numPagesLabelMedium.png b/images/numPagesLabelMedium.png index 82ece58f22acb464a8b929aff8db03876bd349a7..5bec00edfdf11972fd8c3905d5201e686734e5f4 100644 GIT binary patch delta 640 zcmV-`0)PGF1il53Nq=BTL_t(|+U%W8j?*w0hHWQl5=wv2us}!^>H;JX61!f2oAeYM zjU)5`UCbR&H&q1*O=IkgGkl7M-Kc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