font size for all popup windows

(cherry picked from commit 70bad176eef85d3d19e49c828c8586bf9bd18435)
This commit is contained in:
Eduard Kalinowski 2017-04-26 22:23:43 +02:00 committed by Claudio Lanconelli
parent 83b250b72f
commit ad27aa7ac4
6 changed files with 87 additions and 5 deletions

View File

@ -52,6 +52,11 @@ AboutModalDialog::AboutModalDialog(QWidget* bw, const QString title)
cmdw = static_cast<e2CmdWindow *>(bw);
if (cmdw->getStyleSheet().length() > 0)
{
setStyleSheet(cmdw->getStyleSheet());
}
lblAbout0->setText(APPNAME + " - " + APPNAME_EXT + "<br>" + STR_MSGVERSION + " " + APPVERSION + " " __DATE__);
lblAbout1->setText("Copyright (C) " + COPYRIGHTYEAR + " by <a href=\"" + AUTHORMAIL + "\">" + AUTHORNAME + "</a><br><br>" +
"Porting to Qt4/Qt5 by <a href=\"" + PORTERMAIL + "\">" + PORTERGQT + "</a><br><br>" +

View File

@ -155,6 +155,12 @@ public: //---------------------------------------- public
// virtual void DropFile(const char *fn); //TODO use QDrag for drag&drop file into the buffer
virtual void Exit();
QString getStyleSheet()
{
return programStyleSheet;
}
private slots:
void onNew();
void onOpen(); //
@ -361,12 +367,12 @@ private:
QFont sysFont;
short fontSize;
QString programStyleSheet;
QLabel *txtComment;
QLabel *txtID;
QStringList arguments;
QString programStyleSheet;
QComboBox* cbxEEPType;
QComboBox* cbxEEPSubType;

View File

@ -54,7 +54,12 @@ e2Dialog::e2Dialog(QWidget* bw, const QString title)
setWindowTitle(title);
// cmdWin = (e2CmdWindow*)bw;
e2CmdWindow *cmdw = static_cast<e2CmdWindow *>(bw);
if (cmdw->getStyleSheet().length() > 0)
{
setStyleSheet(cmdw->getStyleSheet());
}
qDebug() << "e2Dialog::e2Dialog()";

View File

@ -31,6 +31,7 @@
#include <QDebug>
#include <QString>
#include "e2cmdw.h"
#include "types.h"
#include "filldlg.h"
#include "string_table.h"
@ -38,6 +39,8 @@
using namespace Translator;
class e2CmdWindow;
//=========================>>> FillDialog::FillDialog <<<====================
FillDialog::FillDialog(QWidget* bw, long &cfrom, long &cto, int &cval, long max_addr, const QString title) :
QDialog(bw)
@ -46,6 +49,13 @@ FillDialog::FillDialog(QWidget* bw, long &cfrom, long &cto, int &cval, long max_
setWindowTitle(title);
e2CmdWindow *cmdw = static_cast<e2CmdWindow *>(bw);
if (cmdw->getStyleSheet().length() > 0)
{
setStyleSheet(cmdw->getStyleSheet());
}
qDebug() << "FillDialog::FillDialog()";
pFrom = &cfrom;
@ -92,15 +102,15 @@ void FillDialog::onOk()
bool good;
bool bad = false;
QPalette *palette = new QPalette();
palette->setColor(QPalette::Text, Qt::black); //Color for good parameter
palette->setColor(QPalette::Text, Qt::black); //Color for good parameter
txiFrom->setPalette(*palette);
txiTo->setPalette(*palette);
txiVal->setPalette(*palette);
palette->setColor(QPalette::Text, Qt::red); //Color for bad parameter
palette->setColor(QPalette::Text, Qt::red); //Color for bad parameter
QString str = txiFrom->text();
mFrom = str.toLong(&good, 0); //0 accept both decimal and hex format (with 0x prefix)
mFrom = str.toLong(&good, 0); //0 accept both decimal and hex format (with 0x prefix)
//Check from field format
if (good == false)
@ -130,7 +140,9 @@ void FillDialog::onOk()
}
if (bad)
{
return;
}
//Check from field range
if (mFrom >= mMax)
@ -154,7 +166,9 @@ void FillDialog::onOk()
}
if (bad)
{
return;
}
*pFrom = mFrom;
*pTo = mTo;

View File

@ -50,6 +50,13 @@ fuseModalDialog::fuseModalDialog(e2CmdWindow* bw, e2AppWinInfo *p, bool readonly
lock = awip->GetLockBits();
fuse = awip->GetFuseBits();
e2CmdWindow *cmdw = static_cast<e2CmdWindow *>(bw);
if (cmdw->getStyleSheet().length() > 0)
{
setStyleSheet(cmdw->getStyleSheet());
}
long type = bw->GetCurrentChipType();
qDebug() << "fuseModalDialog::fuseModalDialog()";
@ -405,6 +412,13 @@ blockDialog::blockDialog(e2CmdWindow* bw, e2AppWinInfo *p, bool readonly, const
lock = awip->GetLockBits();
fuse = awip->GetFuseBits();
e2CmdWindow *cmdw = static_cast<e2CmdWindow *>(bw);
if (cmdw->getStyleSheet().length() > 0)
{
setStyleSheet(cmdw->getStyleSheet());
}
qDebug() << "blockDialog::blockDialog()";

View File

@ -34,12 +34,15 @@
#include <QDebug>
#include <QString>
#include "e2cmdw.h"
#include "string_table.h"
#include "globals.h"
#include "infomdlg.h"
using namespace Translator;
class e2CmdWindow;
//======================>>> infoModalDialog::infoModalDialog <<<==================
e24xx_infoModalDialog::e24xx_infoModalDialog(QWidget* bw, int rlv, uint16_t crc, long size, const QString title) :
@ -49,6 +52,13 @@ e24xx_infoModalDialog::e24xx_infoModalDialog(QWidget* bw, int rlv, uint16_t crc,
setWindowTitle(title);
e2CmdWindow *cmdw = static_cast<e2CmdWindow *>(bw);
if (cmdw->getStyleSheet().length() > 0)
{
setStyleSheet(cmdw->getStyleSheet());
}
if (rlv == 1)
{
txiFrom->setText(STR_MSGYES);// SetCommandLabel(txtRllBnk, STR_MSGYES, e24xxCmds);
@ -107,6 +117,13 @@ other_infoModalDialog::other_infoModalDialog(QWidget* bw, long fsize, long esize
setWindowTitle(title);
e2CmdWindow *cmdw = static_cast<e2CmdWindow *>(bw);
if (cmdw->getStyleSheet().length() > 0)
{
setStyleSheet(cmdw->getStyleSheet());
}
QString str;
lblFrom->setText(STR_MSGCRC); // crc label
@ -153,6 +170,13 @@ notesModalDialog::notesModalDialog(QWidget* bw, QString &id, QString &cm, const
setWindowTitle(title);
e2CmdWindow *cmdw = static_cast<e2CmdWindow *>(bw);
if (cmdw->getStyleSheet().length() > 0)
{
setStyleSheet(cmdw->getStyleSheet());
}
qDebug() << "notesModalDialog::notesModalDialog()";
id_ptr = &id;
@ -202,6 +226,13 @@ editModalDialog::editModalDialog(QWidget* bw, int curval, const QString title) :
setWindowTitle(title);
e2CmdWindow *cmdw = static_cast<e2CmdWindow *>(bw);
if (cmdw->getStyleSheet().length() > 0)
{
setStyleSheet(cmdw->getStyleSheet());
}
qDebug() << "editModalDialog::editModalDialog()";
if (curval < 0)
@ -349,6 +380,13 @@ editModalDialog2::editModalDialog2(QWidget* bw, const QString curval, const QStr
setWindowTitle(title);
e2CmdWindow *cmdw = static_cast<e2CmdWindow *>(bw);
if (cmdw->getStyleSheet().length() > 0)
{
setStyleSheet(cmdw->getStyleSheet());
}
lblFrom->setHidden(true);
txiFrom->setHidden(true);