-
Notifications
You must be signed in to change notification settings - Fork 0
/
datatablewindow.h
97 lines (76 loc) · 2.8 KB
/
datatablewindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
Copyright © 2021 Frank Pereny
https://github.com/fjpereny/konverter
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 the Free Software Foundation,
either version 3 of the License, or (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.
*/
#ifndef DATATABLEWINDOW_H
#define DATATABLEWINDOW_H
#include <QMainWindow>
#include <QLabel>
namespace Ui {
class DataTableWindow;
const static QString yellow_background = "background-color: rgb(255, 255, 100);"
"color: rgb(0, 0, 0);";
const static QString red_background = "background-color : rgb(255, 0, 0);"
"color: rgb(255, 255, 255);";
const static QString green_background = "background-color : rgb(0, 255, 0);"
"color: rgb(0, 0, 0);";
}
class DataTableWindow : public QMainWindow
{
Q_OBJECT
public:
explicit DataTableWindow(QWidget *parent = nullptr, const QString *folder_sep = nullptr);
~DataTableWindow();
public :
void refresh_data();
void load_category_list();
void read_file_names();
private slots:
void on_actionClose_triggered();
void on_refUnitCombo_currentIndexChanged(int index);
void on_editCheckBox_toggled(bool checked);
void on_unitTypeList_itemSelectionChanged();
void on_inputValueLineEdit_textChanged(const QString &arg1);
void on_decimalSpinBox_valueChanged(int arg1);
void on_actionAbout_triggered();
void on_unitTable_itemSelectionChanged();
void on_delTypeButton_clicked();
void on_addTypeButton_clicked();
void on_addRowButton_clicked();
void on_delRowButton_clicked();
void on_changeMasterButton_clicked();
private:
Ui::DataTableWindow *ui;
QStringList *unit_names;
std::vector<double> *unit_values;
std::vector<double> *displayed_values;
QStringList *unit_notes;
QString *master_name;
bool *enable_calcs;
QStringList *data_file_list;
double *prev_input_value;
int *sig_digits;
QPalette *error_entry_red;
QLabel *status_bar_label;
const QString *fold_sep;
bool *unsaved_changes;
bool *error_detected;
void import_csv(QString file_name);
void load_unit_dropdown();
void set_master_unit();
void load_table();
void clear_data();
void set_edit_checkbox_status();
void copy_selected_cells();
void keyPressEvent(QKeyEvent *event);
void keyReleaseEvent(QKeyEvent *event);
void check_table_bools();
void remove_data_commas();
};
#endif // DATATABLEWINDOW_H