mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
Renames signals for consistency
Updates signal names across UI components (checkbox, textbox, and CAN) to use more consistent and descriptive names, improving code readability and maintainability. The 'on_change' and 'on_send' signals are renamed to 'changed' and 'send' respectively.
This commit is contained in:
+1
-1
@@ -108,5 +108,5 @@ void UI_can::can_send(uint32_t id, uint8_t dlc, std::array<uint8_t, 8> payload)
|
||||
frame.setFrameId(id);
|
||||
frame.setPayload(QByteArray::fromRawData((const char *)(payload.data()), dlc));
|
||||
|
||||
emit on_send(frame);
|
||||
emit send(frame);
|
||||
}
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ class UI_can : public UI_item
|
||||
void can_send(uint32_t id, uint8_t dlc, std::array<uint8_t, 8> payload) override;
|
||||
void can_clear() override;
|
||||
signals:
|
||||
void on_send(QCanBusFrame msg);
|
||||
void send(QCanBusFrame msg);
|
||||
|
||||
private:
|
||||
std::vector<CanFrame> m_can_send_messages;
|
||||
|
||||
+2
-2
@@ -18,14 +18,14 @@ void UI_checkbox::click()
|
||||
{
|
||||
m_checked = !m_checked;
|
||||
emit ui_changed();
|
||||
emit on_change(m_checked);
|
||||
emit changed(m_checked);
|
||||
}
|
||||
|
||||
void UI_checkbox::set_state(bool state)
|
||||
{
|
||||
m_checked = state;
|
||||
emit ui_changed();
|
||||
emit on_change(m_checked);
|
||||
emit changed(m_checked);
|
||||
}
|
||||
|
||||
bool UI_checkbox::state() const
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ class UI_checkbox : public UI_item
|
||||
json to_json(size_t id) const override;
|
||||
|
||||
signals:
|
||||
void on_change(bool);
|
||||
void changed(bool);
|
||||
|
||||
private:
|
||||
bool m_checked;
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ void UI_textbox::set_text(std::string text)
|
||||
return;
|
||||
m_text = text;
|
||||
emit ui_changed();
|
||||
emit on_change(m_text);
|
||||
emit changed(m_text);
|
||||
}
|
||||
|
||||
void UI_textbox::set_hint(std::string hint)
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ class UI_textbox : public UI_item
|
||||
void from_json(const json &j) override;
|
||||
json to_json(size_t id) const override;
|
||||
signals:
|
||||
void on_change(std::string text);
|
||||
void changed(std::string text);
|
||||
|
||||
private:
|
||||
std::string m_hint;
|
||||
|
||||
Reference in New Issue
Block a user