mirror of
https://github.com/YACReader/yacreader
synced 2025-07-19 05:24:57 -04:00
A?adido margen izquierdo al splitter principal para que coincida con el handler (falta comprobar como se ven en macosx)
A?adido bot?n para configurar el puerto del servidor
This commit is contained in:
@ -193,7 +193,7 @@ void LibraryWindow::doLayout()
|
||||
left = new QWidget;
|
||||
QVBoxLayout * l = new QVBoxLayout;
|
||||
selectedLibrary = new QComboBox;
|
||||
l->setContentsMargins(2,0,0,0);
|
||||
l->setContentsMargins(sHorizontal->handleWidth(),0,0,0);
|
||||
|
||||
YACReaderTitledToolBar * librariesTitle = new YACReaderTitledToolBar(tr("Libraries"));
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <QHostAddress>
|
||||
#include <QSettings>
|
||||
#include <QPalette>
|
||||
#include <QIntValidator>
|
||||
|
||||
#include "startup.h"
|
||||
#include "yacreader_global.h"
|
||||
@ -56,8 +57,7 @@ extern Startup * s;
|
||||
ServerConfigDialog::ServerConfigDialog(QWidget * parent)
|
||||
:QDialog(parent)
|
||||
{
|
||||
accept = new QPushButton(tr("Update IPs"));
|
||||
connect(accept,SIGNAL(clicked()),this,SLOT(generateQR()));
|
||||
accept = new QPushButton(tr("set port"),this);
|
||||
qrCodeImage = new QPixmap();
|
||||
qrCode = new QLabel(this);
|
||||
qrCode->move(196,73);
|
||||
@ -101,9 +101,14 @@ ServerConfigDialog::ServerConfigDialog(QWidget * parent)
|
||||
ip->setMinimumWidth(110);
|
||||
|
||||
port = new QLineEdit("8080",this);
|
||||
port->setReadOnly(true);
|
||||
port->setReadOnly(false);
|
||||
port->setMaximumWidth(50);
|
||||
port->move(571,110);
|
||||
port->move(520,110);
|
||||
QValidator *validator = new QIntValidator(1024, 65535, this);
|
||||
port->setValidator(validator);
|
||||
|
||||
accept->move(520,149);
|
||||
connect(accept,SIGNAL(pressed()),this,SLOT(updatePort()));
|
||||
|
||||
check = new QCheckBox(this);
|
||||
check->move(453,314);
|
||||
@ -251,6 +256,7 @@ void ServerConfigDialog::generateQR()
|
||||
|
||||
void ServerConfigDialog::generateQR(const QString & serverAddress)
|
||||
{
|
||||
qrCode->clear();
|
||||
qrGenerator = new QProcess();
|
||||
QStringList attributes;
|
||||
attributes << "-o" << "-" /*QCoreApplication::applicationDirPath()+"/utils/tmp.png"*/ << "-s" << "8" << "-l" << "H" << "-m" << "0" << serverAddress;
|
||||
@ -283,3 +289,18 @@ void ServerConfigDialog::regenerateQR(const QString & ip)
|
||||
{
|
||||
generateQR(ip+":"+s->getPort());
|
||||
}
|
||||
|
||||
void ServerConfigDialog::updatePort()
|
||||
{
|
||||
|
||||
QSettings * settings = new QSettings(QCoreApplication::applicationDirPath()+"/YACReaderLibrary.ini",QSettings::IniFormat); //TODO unificar la creaci<63>n del fichero de config con el servidor
|
||||
settings->beginGroup("listener");
|
||||
settings->setValue("port",port->text().toInt());
|
||||
settings->endGroup();
|
||||
|
||||
s->stop();
|
||||
s->start();
|
||||
|
||||
generateQR(ip->currentText()+":"+port->text());
|
||||
|
||||
}
|
@ -34,6 +34,7 @@ Q_OBJECT
|
||||
void regenerateQR(const QString & ip);
|
||||
void updateImage();
|
||||
void enableServer(int status);
|
||||
void updatePort();
|
||||
signals:
|
||||
void portChanged(QString port);
|
||||
|
||||
|
Reference in New Issue
Block a user