2008-07-19 02:49:14 +12:00
|
|
|
/***************************************************************************
|
2009-04-27 10:04:51 +12:00
|
|
|
* Copyright (C) 2008 by BogDan Vatra <bogdan@licentia.eu> *
|
2020-04-07 03:37:34 +12:00
|
|
|
* Copyright (C) 2009-2020 by Robin Stuart <rstuart114@gmail.com> *
|
2008-07-19 02:49:14 +12:00
|
|
|
* *
|
2008-09-18 06:38:53 +12:00
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
2008-07-19 02:49:14 +12:00
|
|
|
* it under the terms of the GNU General Public License as published by *
|
2008-09-18 06:38:53 +12:00
|
|
|
* the Free Software Foundation, either version 3 of the License, or *
|
2008-07-19 02:49:14 +12:00
|
|
|
* (at your option) any later version. *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
2008-09-18 06:38:53 +12:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
2008-07-19 02:49:14 +12:00
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QtGui>
|
|
|
|
#include <QGraphicsItem>
|
2009-05-22 09:00:23 +12:00
|
|
|
#include <QMainWindow>
|
2016-12-15 12:33:17 +13:00
|
|
|
#include <QGraphicsScene>
|
2008-07-19 02:49:14 +12:00
|
|
|
|
|
|
|
#include "ui_mainWindow.h"
|
|
|
|
#include "barcodeitem.h"
|
|
|
|
|
2009-05-22 09:00:23 +12:00
|
|
|
class QLabel;
|
2009-05-20 02:05:26 +12:00
|
|
|
|
2008-07-19 02:49:14 +12:00
|
|
|
class MainWindow : public QWidget, private Ui::mainWindow
|
|
|
|
{
|
2019-11-26 10:20:21 +13:00
|
|
|
Q_OBJECT
|
2008-07-19 02:49:14 +12:00
|
|
|
|
|
|
|
public:
|
2021-07-07 06:53:31 +12:00
|
|
|
MainWindow(QWidget *parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
|
2019-11-26 10:20:21 +13:00
|
|
|
~MainWindow();
|
2008-07-19 02:49:14 +12:00
|
|
|
|
|
|
|
public slots:
|
2019-11-26 10:20:21 +13:00
|
|
|
void update_preview();
|
|
|
|
void change_options();
|
|
|
|
void on_fgcolor_clicked();
|
|
|
|
void on_bgcolor_clicked();
|
2020-10-01 00:19:12 +13:00
|
|
|
void composite_ui_set();
|
2019-11-26 10:20:21 +13:00
|
|
|
void composite_ean_check();
|
|
|
|
void maxi_primary();
|
2021-06-10 22:15:39 +12:00
|
|
|
void msi_plessey_ui_set();
|
2019-11-26 10:20:21 +13:00
|
|
|
void change_print_scale();
|
2020-10-01 00:19:12 +13:00
|
|
|
void change_cmyk();
|
|
|
|
void autoheight_ui_set();
|
|
|
|
void HRTShow_ui_set();
|
|
|
|
void dotty_ui_set();
|
|
|
|
void on_encoded();
|
|
|
|
void filter_symbologies();
|
2009-05-20 02:05:26 +12:00
|
|
|
|
2016-12-15 12:33:17 +13:00
|
|
|
protected:
|
|
|
|
void resizeEvent(QResizeEvent *event);
|
2020-10-01 00:19:12 +13:00
|
|
|
void combobox_item_enabled(QComboBox *comboBox, int index, bool enabled);
|
|
|
|
void upcean_addon_gap(QComboBox *comboBox, QLabel *label, int base);
|
2020-07-19 11:13:03 +12:00
|
|
|
void set_gs1_mode(bool gs1_mode);
|
2021-08-10 23:04:25 +12:00
|
|
|
void set_smaller_font(QLabel *note);
|
2021-06-20 00:11:23 +12:00
|
|
|
|
2020-10-01 00:19:12 +13:00
|
|
|
const char *get_setting_name(int symbology);
|
2021-06-20 00:11:23 +12:00
|
|
|
|
2020-10-01 00:19:12 +13:00
|
|
|
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);
|
|
|
|
int get_combobox_index(const QString &child);
|
|
|
|
void set_combobox_from_setting(QSettings &settings, const QString &setting, const QString &child, int default_val = 0);
|
|
|
|
int get_checkbox_val(const QString &child);
|
|
|
|
void set_checkbox_from_setting(QSettings &settings, const QString &setting, const QString &child, int default_val = 0);
|
2021-06-20 00:11:23 +12:00
|
|
|
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);
|
2020-10-01 00:19:12 +13:00
|
|
|
QString get_lineedit_val(const QString &child);
|
|
|
|
void set_lineedit_from_setting(QSettings &settings, const QString &setting, const QString &child, const char *default_val = "");
|
2020-12-20 06:13:35 +13:00
|
|
|
int get_spinbox_val(const QString &child);
|
|
|
|
void set_spinbox_from_setting(QSettings &settings, const QString &setting, const QString &child, int default_val = 0);
|
2021-06-20 00:11:23 +12:00
|
|
|
|
2020-10-01 00:19:12 +13:00
|
|
|
void save_sub_settings(QSettings &settings, int symbology);
|
|
|
|
void load_sub_settings(QSettings &settings, int symbology);
|
2017-10-24 08:37:52 +13:00
|
|
|
|
2009-05-20 02:05:26 +12:00
|
|
|
private slots:
|
2019-11-26 10:20:21 +13:00
|
|
|
bool save();
|
|
|
|
void about();
|
|
|
|
void quit_now();
|
|
|
|
void reset_view();
|
|
|
|
int open_data_dialog();
|
|
|
|
int open_sequence_dialog();
|
2017-05-16 08:12:19 +12:00
|
|
|
void copy_to_clipboard_svg();
|
|
|
|
void copy_to_clipboard_bmp();
|
2008-07-19 02:49:14 +12:00
|
|
|
|
|
|
|
private:
|
2019-11-26 10:20:21 +13:00
|
|
|
QColor m_fgcolor,m_bgcolor;
|
|
|
|
BarcodeItem m_bc;
|
|
|
|
QWidget *m_optionWidget;
|
|
|
|
QGraphicsScene *scene;
|
2020-10-01 00:19:12 +13:00
|
|
|
int m_symbology;
|
2008-07-19 02:49:14 +12:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|