GUI: add CLI equivalent dialog (#163); use spinboxes in Sequence dialog

and restrict sequence to max 10,000, add button icons;
   make Export dialog sizable and show every 100 results, add button icon;
   fix saving CHANNEL option, fix Export painting main window (Windows), fix
   guard descent not-resetting
 qzint: add getAsCLI(), warnLevel(), extra isStackable()/isComposite() etc
 Add ZBarcode_BarcodeName()
 manual: doc above, some fixes, tweaks
This commit is contained in:
gitlost 2021-11-23 19:12:48 +00:00
parent 9d85c425f4
commit 739a64a6ff
34 changed files with 2264 additions and 1199 deletions

View file

@ -27,35 +27,43 @@
#include "datawindow.h"
DataWindow::DataWindow()
// Shorthand
#define QSL QStringLiteral
DataWindow::DataWindow(const QString &input) : Valid(false)
{
setupUi(this);
QSettings settings;
#if QT_VERSION < 0x60000
settings.setIniCodec("UTF-8");
#endif
connect(btnCancel, SIGNAL( clicked( bool )), SLOT(quit_now()));
connect(btnReset, SIGNAL( clicked( bool )), SLOT(clear_data()));
connect(btnOK, SIGNAL( clicked( bool )), SLOT(okay()));
}
QByteArray geometry = settings.value(QSL("studio/data/window_geometry")).toByteArray();
restoreGeometry(geometry);
QIcon closeIcon(QIcon::fromTheme(QSL("window-close"), QIcon(QSL(":res/x.svg"))));
QIcon clearIcon(QIcon::fromTheme(QSL("edit-clear"), QIcon(QSL(":res/delete.svg"))));
QIcon okIcon(QIcon(QSL(":res/check.svg")));
btnCancel->setIcon(closeIcon);
btnDataClear->setIcon(clearIcon);
btnOK->setIcon(okIcon);
DataWindow::DataWindow(const QString &input)
{
setupUi(this);
txtDataInput->setPlainText(input);
txtDataInput->moveCursor(QTextCursor::End, QTextCursor::MoveAnchor);
connect(btnCancel, SIGNAL( clicked( bool )), SLOT(quit_now()));
connect(btnReset, SIGNAL( clicked( bool )), SLOT(clear_data()));
connect(btnCancel, SIGNAL( clicked( bool )), SLOT(close()));
connect(btnDataClear, SIGNAL( clicked( bool )), SLOT(clear_data()));
connect(btnOK, SIGNAL( clicked( bool )), SLOT(okay()));
connect(btnFromFile, SIGNAL( clicked( bool )), SLOT(from_file()));
}
DataWindow::~DataWindow()
{
}
void DataWindow::quit_now()
{
Valid = 0;
close();
QSettings settings;
#if QT_VERSION < 0x60000
settings.setIniCodec("UTF-8");
#endif
settings.setValue(QSL("studio/data/window_geometry"), saveGeometry());
}
void DataWindow::clear_data()
@ -65,7 +73,7 @@ void DataWindow::clear_data()
void DataWindow::okay()
{
Valid = 1;
Valid = true;
DataOutput = txtDataInput->toPlainText();
close();
}
@ -93,7 +101,7 @@ void DataWindow::from_file()
}
file.setFileName(filename);
if(!file.open(QIODevice::ReadOnly)) {
if (!file.open(QIODevice::ReadOnly)) {
QMessageBox::critical(this, tr("Open Error"), tr("Could not open selected file."));
return;
}