ORE Studio 0.0.4
Loading...
Searching...
No Matches
CronFieldWidget.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2026 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_QT_CRON_FIELD_WIDGET_HPP
21#define ORES_QT_CRON_FIELD_WIDGET_HPP
22
23#include <QWidget>
24#include <QList>
25#include <QVector>
26#include <QString>
27#include <QStringList>
28#include "ores.qt/export.hpp"
29
30class QRadioButton;
31class QComboBox;
32class QCheckBox;
33
34namespace ores::qt {
35
40 int min_val;
41 int max_val;
42 QStringList labels; // empty -> zero-padded numbers
43 QList<int> freq_steps; // step values for the Frequency combo
44 int checkboxes_per_row;
45};
46
55class ORES_QT_API CronFieldWidget : public QWidget {
56 Q_OBJECT
57
58public:
59 explicit CronFieldWidget(const FieldConfig& cfg, QWidget* parent = nullptr);
60
62 QString value() const;
63
65 void setValue(const QString& cron_field);
66
67signals:
68 void changed();
69
70private slots:
71 void onModeClicked();
72
73private:
74 void updateEnabled();
75 QString labelFor(int v) const;
76
77 FieldConfig cfg_;
78
79 QRadioButton* freqRadio_;
80 QComboBox* everyCombo_;
81 QComboBox* startCombo_;
82
83 QRadioButton* rangeRadio_;
84 QComboBox* minCombo_;
85 QComboBox* maxCombo_;
86
87 QRadioButton* choiceRadio_;
88 QVector<QCheckBox*> checkboxes_;
89};
90
91}
92
93#endif
Qt-based graphical user interface for ORE Studio.
Definition AccountController.hpp:32
Configuration for one cron field (minutes, hours, etc.).
Definition CronFieldWidget.hpp:39
One tab inside CronEditorDialog.
Definition CronFieldWidget.hpp:55