#include <RulesPage.hpp>
Classes | |
| struct | Columns |
| struct | ComboColumns |
| struct | Rule |
Public Member Functions | |
| RulesPage () | |
Private Member Functions | |
| bool | replaceJsonStringField (const std::string &filepath, const std::string &key, const std::string &value) |
| bool | replaceJsonBoolField (const std::string &filepath, const std::string &key, bool value) |
| bool | writeFileAsRoot (const std::string &filepath, const std::string &content) |
| bool | createRuleFileAsRoot (const Rule &rule) |
| std::string | escapeJson (const std::string &input) |
| std::string | makeSafeFilename (const std::string &input) |
| void | onActionEdited (const Glib::ustring &path, const Glib::ustring &new_text) |
| void | onDurationEdited (const Glib::ustring &path, const Glib::ustring &new_text) |
| void | onDataEdited (const Glib::ustring &path, const Glib::ustring &new_text) |
| void | onEnabledToggled (const Glib::ustring &path) |
| void | buildComboModels () |
| void | buildToolbar () |
| void | buildTreeView () |
| void | loadRules () |
| Rule | parseRule (const std::string &filepath) |
| std::string | jsonField (const std::string &jsonjson, const std::string &key) |
| void | onCreateRule () |
| void | onDelete () |
| void | updateCount () |
Private Attributes | |
| Columns | m_columns |
| ComboColumns | m_comboColumns |
| Glib::RefPtr< Gtk::ListStore > | m_actionModel |
| Glib::RefPtr< Gtk::ListStore > | m_durationModel |
| Glib::RefPtr< Gtk::ListStore > | m_store |
| Gtk::TreeView | m_treeView |
| Gtk::ScrolledWindow | m_scroll |
| Gtk::Box | m_toolbar { Gtk::Orientation::HORIZONTAL, 6 } |
| Gtk::Button | m_createBtn |
| Gtk::Button | m_reloadBtn |
| Gtk::Button | m_deleteBtn |
| Gtk::Label | m_countLabel |
Definition at line 11 of file RulesPage.hpp.
| RulesPage::RulesPage | ( | ) |
Definition at line 30 of file RulesPage.cpp.
References buildComboModels(), buildToolbar(), buildTreeView(), loadRules(), m_scroll, m_toolbar, and m_treeView.
|
private |
Definition at line 50 of file RulesPage.cpp.
References RulesPage::ComboColumns::col_value, m_actionModel, m_comboColumns, and m_durationModel.
Referenced by RulesPage().
|
private |
Definition at line 71 of file RulesPage.cpp.
References _, loadRules(), m_countLabel, m_createBtn, m_deleteBtn, m_reloadBtn, m_toolbar, onCreateRule(), and onDelete().
Referenced by RulesPage().
|
private |
Definition at line 108 of file RulesPage.cpp.
References _, RulesPage::Columns::col_action, RulesPage::Columns::col_data, RulesPage::Columns::col_duration, RulesPage::Columns::col_enabled, RulesPage::Columns::col_name, RulesPage::Columns::col_operand, m_actionModel, m_columns, m_durationModel, m_store, m_treeView, onActionEdited(), onDataEdited(), onDurationEdited(), and onEnabledToggled().
Referenced by RulesPage().
|
private |
Definition at line 354 of file RulesPage.cpp.
References RulesPage::Rule::action, RulesPage::Rule::data, RulesPage::Rule::duration, RulesPage::Rule::enabled, escapeJson(), makeSafeFilename(), RulesPage::Rule::name, RulesPage::Rule::operand, RULES_DIR, and writeFileAsRoot().
Referenced by onCreateRule().
|
private |
Definition at line 403 of file RulesPage.cpp.
Referenced by createRuleFileAsRoot(), and replaceJsonStringField().
|
private |
Definition at line 255 of file RulesPage.cpp.
Referenced by parseRule().
|
private |
Definition at line 195 of file RulesPage.cpp.
References RulesPage::Columns::col_action, RulesPage::Columns::col_data, RulesPage::Columns::col_duration, RulesPage::Columns::col_enabled, RulesPage::Columns::col_filepath, RulesPage::Columns::col_name, RulesPage::Columns::col_operand, m_columns, m_store, parseRule(), RULES_DIR, and updateCount().
Referenced by buildToolbar(), onCreateRule(), and RulesPage().
|
private |
Definition at line 382 of file RulesPage.cpp.
Referenced by createRuleFileAsRoot().
|
private |
Definition at line 424 of file RulesPage.cpp.
References RulesPage::Columns::col_action, RulesPage::Columns::col_filepath, m_columns, m_store, and replaceJsonStringField().
Referenced by buildTreeView().
|
private |
Definition at line 481 of file RulesPage.cpp.
References _, RulesPage::Rule::action, createRuleFileAsRoot(), RulesPage::Rule::data, RulesPage::Rule::duration, RulesPage::Rule::enabled, loadRules(), RulesPage::Rule::name, and RulesPage::Rule::operand.
Referenced by buildToolbar().
|
private |
Definition at line 453 of file RulesPage.cpp.
References RulesPage::Columns::col_data, RulesPage::Columns::col_filepath, m_columns, m_store, and replaceJsonStringField().
Referenced by buildTreeView().
|
private |
Definition at line 640 of file RulesPage.cpp.
References RulesPage::Columns::col_filepath, m_columns, m_store, m_treeView, and updateCount().
Referenced by buildToolbar().
|
private |
Definition at line 439 of file RulesPage.cpp.
References RulesPage::Columns::col_duration, RulesPage::Columns::col_filepath, m_columns, m_store, and replaceJsonStringField().
Referenced by buildTreeView().
|
private |
Definition at line 464 of file RulesPage.cpp.
References RulesPage::Columns::col_enabled, RulesPage::Columns::col_filepath, m_columns, m_store, and replaceJsonBoolField().
Referenced by buildTreeView().
|
private |
Definition at line 230 of file RulesPage.cpp.
References jsonField().
Referenced by loadRules().
|
private |
Definition at line 308 of file RulesPage.cpp.
References writeFileAsRoot().
Referenced by onEnabledToggled().
|
private |
Definition at line 282 of file RulesPage.cpp.
References escapeJson(), and writeFileAsRoot().
Referenced by onActionEdited(), onDataEdited(), and onDurationEdited().
|
private |
Definition at line 658 of file RulesPage.cpp.
References m_countLabel, and m_store.
Referenced by loadRules(), and onDelete().
|
private |
Definition at line 334 of file RulesPage.cpp.
Referenced by createRuleFileAsRoot(), replaceJsonBoolField(), and replaceJsonStringField().
|
private |
Definition at line 47 of file RulesPage.hpp.
Referenced by buildComboModels(), and buildTreeView().
|
private |
Definition at line 43 of file RulesPage.hpp.
Referenced by buildTreeView(), loadRules(), onActionEdited(), onDataEdited(), onDelete(), onDurationEdited(), and onEnabledToggled().
|
private |
Definition at line 44 of file RulesPage.hpp.
Referenced by buildComboModels().
|
private |
Definition at line 57 of file RulesPage.hpp.
Referenced by buildToolbar(), and updateCount().
|
private |
Definition at line 54 of file RulesPage.hpp.
Referenced by buildToolbar().
|
private |
Definition at line 56 of file RulesPage.hpp.
Referenced by buildToolbar().
|
private |
Definition at line 48 of file RulesPage.hpp.
Referenced by buildComboModels(), and buildTreeView().
|
private |
Definition at line 55 of file RulesPage.hpp.
Referenced by buildToolbar().
|
private |
Definition at line 52 of file RulesPage.hpp.
Referenced by RulesPage().
|
private |
Definition at line 50 of file RulesPage.hpp.
Referenced by buildTreeView(), loadRules(), onActionEdited(), onDataEdited(), onDelete(), onDurationEdited(), onEnabledToggled(), and updateCount().
|
private |
Definition at line 53 of file RulesPage.hpp.
Referenced by buildToolbar(), and RulesPage().
|
private |
Definition at line 51 of file RulesPage.hpp.
Referenced by buildTreeView(), onDelete(), and RulesPage().