mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -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:
parent
1134273e96
commit
2fcb25ac0b
@ -3,6 +3,7 @@ Mejorada la gesti
|
||||
Añadido botón que permite ocultar las portadas en la pantalla de importación
|
||||
Añadidos títulos "Bibliotecas" y "Carpetas" a la barra de navegación
|
||||
Nuevos iconos para seleccionar la carpeta raíz, expandir y contraer todos.
|
||||
Botón para cambiar el puerto del servidor por el usuario.
|
||||
|
||||
6.2
|
||||
Nueva ventana de "bienvenida"
|
||||
|
@ -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ó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);
|
||||
|
||||
|
@ -18,7 +18,7 @@ YACReaderTitledToolBar::YACReaderTitledToolBar(const QString & title, QWidget *p
|
||||
|
||||
QLabel * nameLabel = new QLabel(title,this);
|
||||
|
||||
QString nameLabelStyleSheet = "QLabel {color:#454545; padding:0 0 0 0px; margin:0px; font-size:14px; font-weight:bold;}";
|
||||
QString nameLabelStyleSheet = "QLabel {color:#454545; padding:0 0 0 0px; margin:0px; font-size:13px; font-weight:bold;}";
|
||||
nameLabel->setStyleSheet(nameLabelStyleSheet);
|
||||
|
||||
mainLayout->addWidget(nameLabel,Qt::AlignLeft);
|
||||
|
Loading…
x
Reference in New Issue
Block a user