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.
This commit is contained in:
Luis Ángel San Martín 2013-02-13 22:49:21 +01:00
parent 06174deb7f
commit 154d82a84b
11 changed files with 43 additions and 20 deletions

View File

@ -12,3 +12,5 @@ A
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.
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.

View File

@ -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();

View File

@ -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

View File

@ -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)
{

View File

@ -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();

View File

@ -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<QHostAddress> list = QHostInfo::fromName( QHostInfo::localHostName() ).addresses();
QList<QString> otherAddresses;
foreach(QHostAddress add, list)
{
QString tmp = add.toString();
if(tmp.contains(".") && tmp != "127.0.0.1")
{
if(dir.isEmpty())
dir = tmp;
break;
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
@ -141,3 +143,8 @@ void ServerConfigDialog::updateImage()
delete qrGenerator;*/
}
void ServerConfigDialog::regenerateQR(const QString & ip)
{
generateQR(ip+":"+s->getPort());
}

View File

@ -8,6 +8,7 @@
#include <QPixmap>
#include <QProcess>
#include <QPixmap>
#include <QComboBox>
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);

View File

@ -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"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 569 B

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 B

After

Width:  |  Height:  |  Size: 739 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 612 B

After

Width:  |  Height:  |  Size: 702 B