Feature/source plugins #1

Merged
martino merged 130 commits from feature/source-plugins into main 2026-11-04 07:35:21 +01:00
3 changed files with 20 additions and 5 deletions
Showing only changes of commit dad424f1de - Show all commits

No files matched your search

+8 -2
View File
@@ -4654,10 +4654,16 @@ void run_app_action(App& app, AppAction action) {
toggle(app.cursors_toggle); toggle(app.cursors_toggle);
break; break;
case AppAction::ShowMeasure: dock_show_section(app, "measure"); break; case AppAction::ShowMeasure: dock_show_section(app, "measure"); break;
case AppAction::ShowSignals: case AppAction::ShowSignals: {
// The `+` badge is insensitive without signals; so is its shortcut. // The `+` badge is insensitive without signals; so is its shortcut.
if (!app.model->signals().empty()) slideover_toggle(app, "signals"); bool have_signals = false;
{
std::lock_guard<std::mutex> lock(app.model->mutex());
have_signals = !app.model->signals().empty();
}
if (have_signals) slideover_toggle(app, "signals");
break; break;
}
case AppAction::LayoutEditor: case AppAction::LayoutEditor:
toggle(app.layout_toggle); toggle(app.layout_toggle);
break; break;
+7 -2
View File
@@ -256,12 +256,17 @@ void sync_badge_bar(App& app) {
set_text_if_changed(bb.trigger.state, trigger_badge_state(enabled, armed, pending, has_event)); set_text_if_changed(bb.trigger.state, trigger_badge_state(enabled, armed, pending, has_event));
set_open(bb.trigger.button, slideover_page(app) == bb.trigger.page); set_open(bb.trigger.button, slideover_page(app) == bb.trigger.page);
bool have_signals = false;
{
std::lock_guard<std::mutex> lock(app.model->mutex());
have_signals = !app.model->signals().empty();
}
if (bb.plus.button != nullptr) { if (bb.plus.button != nullptr) {
gtk_widget_set_sensitive(bb.plus.button, !app.model->signals().empty()); gtk_widget_set_sensitive(bb.plus.button, have_signals);
set_open(bb.plus.button, slideover_page(app) == "signals"); set_open(bb.plus.button, slideover_page(app) == "signals");
} }
if (bb.overflow.button != nullptr) { if (bb.overflow.button != nullptr) {
gtk_widget_set_sensitive(bb.overflow.button, !app.model->signals().empty()); gtk_widget_set_sensitive(bb.overflow.button, have_signals);
// The overflow stands for every signal's badge too: a signal page opened from a list row marks it. // The overflow stands for every signal's badge too: a signal page opened from a list row marks it.
set_open(bb.overflow.button, set_open(bb.overflow.button,
slideover_page(app) == bb.overflow.page || slideover_page(app).rfind("signal:", 0) == 0); slideover_page(app) == bb.overflow.page || slideover_page(app).rfind("signal:", 0) == 0);
+5 -1
View File
@@ -557,7 +557,11 @@ gboolean on_drop_channel(GtkDropTarget*, const GValue* value, double x, double y
// Where the drop landed decides the row: one area covers them all. // Where the drop landed decides the row: one area covers them all.
const int row = row_at(*app, x, y); const int row = row_at(*app, x, y);
const char* text = g_value_get_string(value); const char* text = g_value_get_string(value);
const std::size_t signal = static_cast<std::size_t>(std::atoll(text ? text : "0")); if (text == nullptr || *text == '\0') return FALSE;
char* end = nullptr;
const unsigned long long parsed = std::strtoull(text, &end, 10);
if (end == nullptr || *end != '\0') return FALSE;
const std::size_t signal = static_cast<std::size_t>(parsed);
if (!assign_signal_to_row(*app, signal, row)) return FALSE; if (!assign_signal_to_row(*app, signal, row)) return FALSE;
cancel_drag_on(*app, row); cancel_drag_on(*app, row);
return TRUE; return TRUE;