corregidos algunos problemas en las "webs"

a?adida nueva imagen de fondo para el di?logo sever_config

terminado el di?logo server_config
This commit is contained in:
Luis Ángel San Martín 2013-03-06 20:26:59 +01:00
parent 546dd330f0
commit ccf9ffa4bc
10 changed files with 131 additions and 53 deletions

View File

@ -56,5 +56,6 @@
<file>../images/comicRar.png</file> <file>../images/comicRar.png</file>
<file>../images/comicTar.png</file> <file>../images/comicTar.png</file>
<file>../images/comic7z.png</file> <file>../images/comic7z.png</file>
<file>../images/serverConfigBackground.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -18,8 +18,16 @@ int main( int argc, char ** argv )
app.setApplicationName("YACReaderLibrary"); app.setApplicationName("YACReaderLibrary");
#ifdef SERVER_RELEASE #ifdef SERVER_RELEASE
QSettings * settings = new QSettings(QCoreApplication::applicationDirPath()+"/YACReaderLibrary.ini",QSettings::IniFormat); //TODO unificar la creación del fichero de config con el servidor
settings->beginGroup("libraryConfig");
s = new Startup(); s = new Startup();
if(settings->value(SERVER_ON,true).toBool())
{
s->start(); s->start();
}
#endif #endif
LibraryWindow * mw = new LibraryWindow(); LibraryWindow * mw = new LibraryWindow();

View File

@ -4,8 +4,11 @@
#include <QNetworkInterface> #include <QNetworkInterface>
#include <QHostInfo> #include <QHostInfo>
#include <QHostAddress> #include <QHostAddress>
#include <QSettings>
#include <QPalette>
#include "startup.h" #include "startup.h"
#include "yacreader_global.h"
extern Startup * s; extern Startup * s;
@ -15,59 +18,119 @@ ServerConfigDialog::ServerConfigDialog(QWidget * parent)
accept = new QPushButton(tr("Update IPs")); accept = new QPushButton(tr("Update IPs"));
connect(accept,SIGNAL(clicked()),this,SLOT(generateQR())); connect(accept,SIGNAL(clicked()),this,SLOT(generateQR()));
qrCodeImage = new QPixmap(); qrCodeImage = new QPixmap();
qrCode = new QLabel("xxxx",this); qrCode = new QLabel(this);
qrCode->move(196,73);
qrCode->setFixedSize(200,200);
QGridLayout * gridEdits = new QGridLayout; QLabel * title1 = new QLabel(tr("EASY SERVER CONNECTION"),this);
gridEdits->addWidget(new QLabel(tr("IP")),0,0); title1->move(37,30);
gridEdits->addWidget(new QLabel(tr("Port")),0,1); title1->setStyleSheet("QLabel {color:#1F1F1F; font-size:18px; font-family: Arial; font-weight: bold;}");
ip = new QComboBox();
QLabel * title2 = new QLabel(tr("SERVER ADDRESS"),this);
title2->move(451,30);
title2->setStyleSheet("QLabel {color:#1F1F1F; font-size:18px; font-family: Arial; font-weight: bold;}");
QLabel * qrMessage = new QLabel(tr("just scan the code with your device!!"),this);
qrMessage->move(194,290);//373,627);
qrMessage->setStyleSheet("QLabel {color:#1F1F1F; font-size:16px; font-family: Arial; font-style: italic;}");
qrMessage->setWordWrap(true);
qrMessage->setFixedWidth(200);
QLabel * propaganda = new QLabel(tr("YACReader is now available for iOS devices <a href='www.yacreader.com'> page </a>"),this);
propaganda->move(36,375);
propaganda->setStyleSheet("QLabel {color:#1F1F1F; font-size:16px; font-family: Arial; font-style: italic;}"
"QLabel::a {color:#1A1A1A}");
propaganda->setWordWrap(true);
propaganda->setFixedWidth(590);
propaganda->setOpenExternalLinks(true);
QLabel * ipLabel = new QLabel(tr("IP address"),this);
ipLabel->move(455,78);
ipLabel->setStyleSheet("QLabel {color:#1F1F1F; font-size:13px; font-family: Arial; font-weight: bold;}");
QLabel * portLabel = new QLabel(tr("Port"),this);
portLabel->move(455, 119);
portLabel->setStyleSheet("QLabel {color:#1F1F1F; font-size:13px; font-family: Arial; font-weight: bold;}");
ip = new QComboBox(this);
connect(ip,SIGNAL(activated(const QString &)),this,SLOT(regenerateQR(const QString &))); connect(ip,SIGNAL(activated(const QString &)),this,SLOT(regenerateQR(const QString &)));
gridEdits->addWidget(ip,1,0); ip->move(531,71);
port = new QLineEdit("8080"); ip->setSizeAdjustPolicy(QComboBox::AdjustToContents);
port = new QLineEdit("8080",this);
port->setReadOnly(true);
port->setMaximumWidth(50); port->setMaximumWidth(50);
gridEdits->addWidget(port,1,1); port->move(571,110);
gridEdits->setColumnStretch(0,1);
gridEdits->setColumnStretch(1,0);
QHBoxLayout * codeLayout = new QHBoxLayout; check = new QCheckBox(this);
codeLayout->addStretch(); check->move(453,314);
QLabel * qrMessage = new QLabel(); check->setText(tr("enable the server"));
qrMessage->setPixmap(QPixmap(":/images/qrMessage.png")); check->setStyleSheet("QCheckBox {color:#1F1F1F; font-size:13px; font-family: Arial; font-weight: bold;}");
codeLayout->addWidget(qrMessage);
codeLayout->addWidget(qrCode);
QVBoxLayout * configLayout = new QVBoxLayout; //check->setLayoutDirection(Qt::RightToLeft);
configLayout->addLayout(gridEdits);
configLayout->addLayout(codeLayout);
configLayout->addStretch();
configLayout->setSpacing(5);
QHBoxLayout * elementsLayout = new QHBoxLayout; //elementsLayout->setSpacing(40);
//elementsLayout->addWidget(iphone);
QLabel * iphone = new QLabel(); //elementsLayout->addStretch();
iphone->setPixmap(QPixmap(":/images/iphoneConfig.png")); //elementsLayout->addLayout(configLayout);
elementsLayout->setSpacing(40);
elementsLayout->addWidget(iphone);
elementsLayout->addStretch();
elementsLayout->addLayout(configLayout);
QHBoxLayout * buttons = new QHBoxLayout; QHBoxLayout * buttons = new QHBoxLayout;
buttons->addStretch(); buttons->addStretch();
buttons->addWidget(accept); buttons->addWidget(accept);
QVBoxLayout * mainLayout = new QVBoxLayout; //QVBoxLayout * mainLayout = new QVBoxLayout;
mainLayout->addLayout(elementsLayout); //mainLayout->addLayout(elementsLayout);
mainLayout->addLayout(buttons); //mainLayout->addLayout(buttons);
//mainLayout->addWidget(qrCode,0,1); //mainLayout->addWidget(qrCode,0,1);
this->setLayout(mainLayout); //this->setLayout(mainLayout);
generateQR();
QPalette Pal(palette()); QPalette Pal(palette());
// set black background // set black background
Pal.setColor(QPalette::Background, Qt::white); QPalette palette;
setAutoFillBackground(true); QImage image(":/images/serverConfigBackground.png");
setPalette(Pal); palette.setBrush(this->backgroundRole(), QBrush(image));
setPalette(palette);
this->setFixedSize(image.size());
QSettings * settings = new QSettings(QCoreApplication::applicationDirPath()+"/YACReaderLibrary.ini",QSettings::IniFormat); //TODO unificar la creación del fichero de config con el servidor
settings->beginGroup("libraryConfig");
if(settings->value(SERVER_ON,true).toBool())
{
check->setChecked(true);
generateQR();
}
else
check->setChecked(false);
settings->endGroup();
connect(check,SIGNAL(stateChanged(int)),this,SLOT(enableServer(int)));
}
void ServerConfigDialog::enableServer(int status)
{
QSettings * settings = new QSettings(QCoreApplication::applicationDirPath()+"/YACReaderLibrary.ini",QSettings::IniFormat); //TODO unificar la creación del fichero de config con el servidor
settings->beginGroup("libraryConfig");
if(status == Qt::Checked)
{
s->start();
this->generateQR();
settings->setValue(SERVER_ON,true);
}
else
{
s->stop();
qrCode->setPixmap(QPixmap());
ip->clear();
port->setText("");
settings->setValue(SERVER_ON,false);
}
settings->endGroup();
} }
void ServerConfigDialog::generateQR() void ServerConfigDialog::generateQR()
@ -118,7 +181,7 @@ void ServerConfigDialog::generateQR(const QString & serverAddress)
{ {
qrGenerator = new QProcess(); qrGenerator = new QProcess();
QStringList attributes; QStringList attributes;
attributes << "-o" << "-" /*QCoreApplication::applicationDirPath()+"/utils/tmp.png"*/ << "-s" << "8" << "-l" << "H" << serverAddress; attributes << "-o" << "-" /*QCoreApplication::applicationDirPath()+"/utils/tmp.png"*/ << "-s" << "8" << "-l" << "H" << "-m" << "0" << serverAddress;
connect(qrGenerator,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(updateImage(void))); connect(qrGenerator,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(updateImage(void)));
connect(qrGenerator,SIGNAL(error(QProcess::ProcessError)),this,SLOT(openingError(QProcess::ProcessError))); connect(qrGenerator,SIGNAL(error(QProcess::ProcessError)),this,SLOT(openingError(QProcess::ProcessError)));
qrGenerator->start(QCoreApplication::applicationDirPath()+"/utils/qrencode",attributes); qrGenerator->start(QCoreApplication::applicationDirPath()+"/utils/qrencode",attributes);

View File

@ -9,6 +9,7 @@
#include <QProcess> #include <QProcess>
#include <QPixmap> #include <QPixmap>
#include <QComboBox> #include <QComboBox>
#include <QCheckBox>
class ServerConfigDialog : public QDialog class ServerConfigDialog : public QDialog
{ {
@ -18,6 +19,9 @@ Q_OBJECT
private: private:
QComboBox * ip; QComboBox * ip;
QLineEdit * port; QLineEdit * port;
QCheckBox * check;
QPushButton * close; QPushButton * close;
QPushButton * accept; QPushButton * accept;
QLabel * qrCode; QLabel * qrCode;
@ -29,6 +33,7 @@ Q_OBJECT
void generateQR(const QString & serverAddress); void generateQR(const QString & serverAddress);
void regenerateQR(const QString & ip); void regenerateQR(const QString & ip);
void updateImage(); void updateImage();
void enableServer(int status);
signals: signals:
void portChanged(QString port); void portChanged(QString port);

View File

@ -41,6 +41,7 @@
#define X_ROTATION "X_ROTATION" #define X_ROTATION "X_ROTATION"
#define Y_COVER_OFFSET "Y_COVER_OFFSET" #define Y_COVER_OFFSET "Y_COVER_OFFSET"
#define V_SYNC "V_SYNC" #define V_SYNC "V_SYNC"
#define SERVER_ON "SERVER_ON"
enum FlowType enum FlowType
{ {

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -99,7 +99,7 @@ margin: 20px 12px 20px 0;
.importButton .importButton
{ {
width: 57px; width: 57px;
height: 22px; height: 18px;
background: url("../images/bt_import.jpg") no-repeat scroll 0 0 transparent; background: url("../images/bt_import.jpg") no-repeat scroll 0 0 transparent;
border: none; border: none;
text-align:center; text-align:center;
@ -112,8 +112,8 @@ margin: 20px 12px 20px 0;
.importedButton .importedButton
{ {
width: 67px; width: 67px;
height: 22px; height: 18px;
background: url("../images/bt_imported.jpg") no-repeat scroll 0 0 transparent; background: url("../images/bt_import.jpg") no-repeat scroll 0 -22px transparent;
border: none; border: none;
text-align:center; text-align:center;
display: block; display: block;

View File

@ -81,21 +81,21 @@ margin: 20px 0 15px 0;
.importButton .importButton
{ {
width: 67px; width: 67px;
height: 24px; height: 20px;
background: url("../images/bt_import.jpg") no-repeat scroll 0 0 transparent; background: url("../images/bt_import.jpg") no-repeat scroll 0 0 transparent;
border: none; border: none;
text-align:center; text-align:center;
display: block; display: block;
float: left; float: left;
margin: 0 0 0 8px; margin: 0 0 0 8px;
padding: 5px 0 0 0; padding: 4px 0 0 0;
} }
.importedButton .importedButton
{ {
width: 67px; width: 77px;
height: 22px; height: 20px;
background: url("../images/bt_imported.jpg") no-repeat scroll 0 0 transparent; background: url("../images/bt_import.jpg") no-repeat scroll 0 -24px transparent;
border: none; border: none;
text-align:center; text-align:center;
display: block; display: block;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 718 B

After

Width:  |  Height:  |  Size: 991 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 701 B

After

Width:  |  Height:  |  Size: 957 B