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

@ -53,8 +53,9 @@
<file>../images/7z.png</file>
<file>../images/pdf.png</file>
<file>../images/comicZip.png</file>
<file>../images/comicRar.png</file>
<file>../images/comicTar.png</file>
<file>../images/comic7z.png</file>
<file>../images/comicRar.png</file>
<file>../images/comicTar.png</file>
<file>../images/comic7z.png</file>
<file>../images/serverConfigBackground.png</file>
</qresource>
</RCC>

View File

@ -18,8 +18,16 @@ int main( int argc, char ** argv )
app.setApplicationName("YACReaderLibrary");
#ifdef SERVER_RELEASE
s = new Startup();
s->start();
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();
if(settings->value(SERVER_ON,true).toBool())
{
s->start();
}
#endif
LibraryWindow * mw = new LibraryWindow();

View File

@ -4,8 +4,11 @@
#include <QNetworkInterface>
#include <QHostInfo>
#include <QHostAddress>
#include <QSettings>
#include <QPalette>
#include "startup.h"
#include "yacreader_global.h"
extern Startup * s;
@ -15,59 +18,119 @@ ServerConfigDialog::ServerConfigDialog(QWidget * parent)
accept = new QPushButton(tr("Update IPs"));
connect(accept,SIGNAL(clicked()),this,SLOT(generateQR()));
qrCodeImage = new QPixmap();
qrCode = new QLabel("xxxx",this);
qrCode = new QLabel(this);
qrCode->move(196,73);
qrCode->setFixedSize(200,200);
QGridLayout * gridEdits = new QGridLayout;
gridEdits->addWidget(new QLabel(tr("IP")),0,0);
gridEdits->addWidget(new QLabel(tr("Port")),0,1);
ip = new QComboBox();
QLabel * title1 = new QLabel(tr("EASY SERVER CONNECTION"),this);
title1->move(37,30);
title1->setStyleSheet("QLabel {color:#1F1F1F; font-size:18px; font-family: Arial; font-weight: bold;}");
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 &)));
gridEdits->addWidget(ip,1,0);
port = new QLineEdit("8080");
ip->move(531,71);
ip->setSizeAdjustPolicy(QComboBox::AdjustToContents);
port = new QLineEdit("8080",this);
port->setReadOnly(true);
port->setMaximumWidth(50);
gridEdits->addWidget(port,1,1);
gridEdits->setColumnStretch(0,1);
gridEdits->setColumnStretch(1,0);
port->move(571,110);
QHBoxLayout * codeLayout = new QHBoxLayout;
codeLayout->addStretch();
QLabel * qrMessage = new QLabel();
qrMessage->setPixmap(QPixmap(":/images/qrMessage.png"));
codeLayout->addWidget(qrMessage);
codeLayout->addWidget(qrCode);
QVBoxLayout * configLayout = new QVBoxLayout;
configLayout->addLayout(gridEdits);
configLayout->addLayout(codeLayout);
configLayout->addStretch();
configLayout->setSpacing(5);
QHBoxLayout * elementsLayout = new QHBoxLayout;
QLabel * iphone = new QLabel();
iphone->setPixmap(QPixmap(":/images/iphoneConfig.png"));
elementsLayout->setSpacing(40);
elementsLayout->addWidget(iphone);
elementsLayout->addStretch();
elementsLayout->addLayout(configLayout);
check = new QCheckBox(this);
check->move(453,314);
check->setText(tr("enable the server"));
check->setStyleSheet("QCheckBox {color:#1F1F1F; font-size:13px; font-family: Arial; font-weight: bold;}");
//check->setLayoutDirection(Qt::RightToLeft);
//elementsLayout->setSpacing(40);
//elementsLayout->addWidget(iphone);
//elementsLayout->addStretch();
//elementsLayout->addLayout(configLayout);
QHBoxLayout * buttons = new QHBoxLayout;
buttons->addStretch();
buttons->addWidget(accept);
QVBoxLayout * mainLayout = new QVBoxLayout;
mainLayout->addLayout(elementsLayout);
mainLayout->addLayout(buttons);
//QVBoxLayout * mainLayout = new QVBoxLayout;
//mainLayout->addLayout(elementsLayout);
//mainLayout->addLayout(buttons);
//mainLayout->addWidget(qrCode,0,1);
this->setLayout(mainLayout);
generateQR();
//this->setLayout(mainLayout);
QPalette Pal(palette());
// set black background
Pal.setColor(QPalette::Background, Qt::white);
setAutoFillBackground(true);
setPalette(Pal);
QPalette palette;
QImage image(":/images/serverConfigBackground.png");
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()
@ -118,7 +181,7 @@ void ServerConfigDialog::generateQR(const QString & serverAddress)
{
qrGenerator = new QProcess();
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(error(QProcess::ProcessError)),this,SLOT(openingError(QProcess::ProcessError)));
qrGenerator->start(QCoreApplication::applicationDirPath()+"/utils/qrencode",attributes);

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

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

View File

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