mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Add compliant height, using ZINT_COMPLIANT_HEIGHT flag for back-compatibility
Rename barcode funcs to same as BARCODE_XXX name library: barcode funcs array for dispatch, used for ZBarcode_ValidID() also general: change is_sane() comparison to nonzero from ZINT_ERROR_INVALID_OPTION MAILMARK: fuller error messages CODABAR: add option to show check character in HRT zint.h: use 0xNNNN for OR-able defines GUI: add guard descent height reset button, add Zint version to window title, static get_zint_version() method, use QStringLiteral (QSL shorthand), use SIGNAL(toggled()), add errtxt "popup" and status bar, add icons, add saveAs shortcut, add main menu, context menus and actions, add help, reset_view() -> reset_colours(), add copy to clipboard as EMF/GIF/PNG/TIF, lessen triggering of update_preview(), shorten names of getters/setters, simplify/shorten some update_preview() logic in switch, CODEONE disable structapp for Version S qzint.cpp: add on_errored signal, add missing getters, add test
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2008 by BogDan Vatra <bogdan@licentia.eu> *
|
||||
* Copyright (C) 2009-2020 by Robin Stuart <rstuart114@gmail.com> *
|
||||
* Copyright (C) 2009-2021 by Robin Stuart <rstuart114@gmail.com> *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
@ -13,6 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
/* vim: set ts=4 sw=4 et : */
|
||||
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
@ -26,6 +27,7 @@
|
||||
#include "barcodeitem.h"
|
||||
|
||||
class QLabel;
|
||||
class QShortcut;
|
||||
|
||||
class MainWindow : public QWidget, private Ui::mainWindow
|
||||
{
|
||||
@ -35,6 +37,8 @@ public:
|
||||
MainWindow(QWidget *parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
|
||||
~MainWindow();
|
||||
|
||||
static QString get_zint_version();
|
||||
|
||||
public slots:
|
||||
void update_preview();
|
||||
void change_options();
|
||||
@ -42,72 +46,120 @@ public slots:
|
||||
void on_bgcolor_clicked();
|
||||
void composite_ui_set();
|
||||
void composite_ean_check();
|
||||
void maxi_scm();
|
||||
void maxi_scm_ui_set();
|
||||
void msi_plessey_ui_set();
|
||||
void change_print_scale();
|
||||
void change_cmyk();
|
||||
void autoheight_ui_set();
|
||||
void HRTShow_ui_set();
|
||||
void dotty_ui_set();
|
||||
void codeone_ui_set();
|
||||
void structapp_ui_set();
|
||||
void on_encoded();
|
||||
void filter_symbologies();
|
||||
void on_errored();
|
||||
void filter_symbologies();
|
||||
|
||||
bool save();
|
||||
void about();
|
||||
void help();
|
||||
void quit_now();
|
||||
void menu();
|
||||
|
||||
void reset_colours();
|
||||
int open_data_dialog();
|
||||
int open_sequence_dialog();
|
||||
|
||||
void copy_to_clipboard_bmp();
|
||||
void copy_to_clipboard_emf();
|
||||
void copy_to_clipboard_eps();
|
||||
void copy_to_clipboard_gif();
|
||||
#ifndef NO_PNG
|
||||
void copy_to_clipboard_png();
|
||||
#endif
|
||||
void copy_to_clipboard_pcx();
|
||||
void copy_to_clipboard_svg();
|
||||
void copy_to_clipboard_tif();
|
||||
|
||||
void copy_to_clipboard_errtxt();
|
||||
|
||||
void guard_reset_upcean();
|
||||
void guard_reset_upca();
|
||||
|
||||
void view_context_menu(const QPoint &pos);
|
||||
void errtxtBar_context_menu(const QPoint &pos);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
void combobox_item_enabled(QComboBox *comboBox, int index, bool enabled);
|
||||
void upcean_addon_gap(const char *comboBoxName, const char *labelName, int base);
|
||||
void upcean_guard_descent(const char *spnBoxName, const char *labelName);
|
||||
bool event(QEvent *event) override;
|
||||
|
||||
void combobox_item_enabled(QComboBox *comboBox, int index, bool enabled);
|
||||
void upcean_addon_gap(const QString &comboBoxName, const QString &labelName, int base);
|
||||
void upcean_guard_descent(const QString &spnBoxName, const QString &labelName);
|
||||
void guard_reset(const QString &spnBoxName);
|
||||
void set_gs1_mode(bool gs1_mode);
|
||||
void set_smaller_font(QLabel *note);
|
||||
void set_smaller_font(const QString &labelName);
|
||||
|
||||
QObject *widget_obj(const char *name);
|
||||
void createActions();
|
||||
void createMenu();
|
||||
void enableActions(bool enabled);
|
||||
|
||||
const char *get_setting_name(int symbology);
|
||||
void copy_to_clipboard(const QString &filename, const QString &name, const char *mimeType = nullptr);
|
||||
|
||||
int get_button_group_index(const QStringList &children);
|
||||
void set_radiobutton_from_setting(QSettings &settings, const QString &setting, const QStringList &children,
|
||||
int default_val = 0);
|
||||
void errtxtBar_clear();
|
||||
void errtxtBar_set(bool isError);
|
||||
|
||||
int get_combobox_index(const QString &child);
|
||||
void set_combobox_from_setting(QSettings &settings, const QString &setting, const QString &child,
|
||||
int default_val = 0);
|
||||
QPoint get_context_menu_pos(const QPoint &pos, QWidget *widget);
|
||||
|
||||
int get_checkbox_val(const QString &child);
|
||||
void set_checkbox_from_setting(QSettings &settings, const QString &setting, const QString &child,
|
||||
int default_val = 0);
|
||||
QWidget *get_widget(const QString &name);
|
||||
|
||||
double get_doublespinbox_val(const QString &child);
|
||||
void set_doublespinbox_from_setting(QSettings &settings, const QString &setting, const QString &child,
|
||||
float default_val = 0.0f);
|
||||
const QString &get_setting_name(int symbology);
|
||||
|
||||
QString get_lineedit_val(const QString &child);
|
||||
void set_lineedit_from_setting(QSettings &settings, const QString &setting, const QString &child,
|
||||
const char *default_val = "");
|
||||
int get_rad_grp_index(const QStringList &names);
|
||||
void set_rad_from_setting(QSettings &settings, const QString &setting, const QStringList &names,
|
||||
int default_val = 0);
|
||||
bool get_rad_val(const QString &name);
|
||||
|
||||
int get_spinbox_val(const QString &child);
|
||||
void set_spinbox_from_setting(QSettings &settings, const QString &setting, const QString &child,
|
||||
int default_val = 0);
|
||||
int get_cmb_index(const QString &name);
|
||||
void set_cmb_from_setting(QSettings &settings, const QString &setting, const QString &name, int default_val = 0);
|
||||
|
||||
void save_sub_settings(QSettings &settings, int symbology);
|
||||
void load_sub_settings(QSettings &settings, int symbology);
|
||||
int get_chk_val(const QString &name);
|
||||
void set_chk_from_setting(QSettings &settings, const QString &setting, const QString &name, int default_val = 0);
|
||||
|
||||
private slots:
|
||||
bool save();
|
||||
void about();
|
||||
void quit_now();
|
||||
void reset_view();
|
||||
int open_data_dialog();
|
||||
int open_sequence_dialog();
|
||||
void copy_to_clipboard_svg();
|
||||
void copy_to_clipboard_bmp();
|
||||
double get_dspn_val(const QString &name);
|
||||
void set_dspn_from_setting(QSettings &settings, const QString &setting, const QString &name,
|
||||
float default_val = 0.0f);
|
||||
|
||||
QString get_txt_val(const QString &name);
|
||||
void set_txt_from_setting(QSettings &settings, const QString &setting, const QString &name,
|
||||
const QString &default_val);
|
||||
|
||||
int get_spn_val(const QString &name);
|
||||
void set_spn_from_setting(QSettings &settings, const QString &setting, const QString &name, int default_val = 0);
|
||||
|
||||
void save_sub_settings(QSettings &settings, int symbology);
|
||||
void load_sub_settings(QSettings &settings, int symbology);
|
||||
|
||||
private:
|
||||
QColor m_fgcolor,m_bgcolor;
|
||||
BarcodeItem m_bc;
|
||||
QWidget *m_optionWidget;
|
||||
QGraphicsScene *scene;
|
||||
int m_symbology;
|
||||
int m_symbology;
|
||||
QShortcut *m_saveAsShortcut;
|
||||
QMenu *m_menu;
|
||||
QAction *m_copyBMPAct;
|
||||
QAction *m_copyEMFAct;
|
||||
QAction *m_copyEPSAct;
|
||||
QAction *m_copyGIFAct;
|
||||
QAction *m_copyPCXAct;
|
||||
QAction *m_copyPNGAct;
|
||||
QAction *m_copySVGAct;
|
||||
QAction *m_copyTIFAct;
|
||||
QAction *m_saveAsAct;
|
||||
QAction *m_aboutAct;
|
||||
QAction *m_helpAct;
|
||||
QAction *m_quitAct;
|
||||
QAction *m_copyErrtxtAct;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user