Skip to content

Commit

Permalink
Bugfix: timewnd initial values not taken into account
Browse files Browse the repository at this point in the history
  • Loading branch information
nbourdau committed Nov 7, 2011
1 parent 097b587 commit f33a931
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/mcp_gui.c
Expand Up @@ -225,12 +225,13 @@ void get_initial_values(mcpanel* pan)
GtkTreeIter iter;
GValue value;
GtkComboBox* combo;
gboolean res;

// Get the display length
combo = GTK_COMBO_BOX(pan->gui.widgets[TIME_WINDOW_COMBO]);
memset(&value, 0, sizeof(value));
model = gtk_combo_box_get_model(combo);
gtk_combo_box_get_active_iter(combo, &iter);
res = gtk_combo_box_get_active_iter(combo, &iter);
gtk_tree_model_get_value(model, &iter, 1, &value);
pan->display_length = g_value_get_float(&value);
}
Expand Down Expand Up @@ -275,10 +276,16 @@ int poll_widgets(mcpanel* pan, GtkBuilder* builder)
static
int initialize_widgets(mcpanel* pan)
{
int active;
GtkComboBox* combo;

gtk_widget_set_sensitive(GTK_WIDGET(pan->gui.widgets[PAUSE_RECORDING_BUTTON]),FALSE);

// Time window combo
gtk_combo_box_set_active(GTK_COMBO_BOX(pan->gui.widgets[TIME_WINDOW_COMBO]), 0);
combo = GTK_COMBO_BOX(pan->gui.widgets[TIME_WINDOW_COMBO]);
active = gtk_combo_box_get_active(combo);
if (active < 0)
gtk_combo_box_set_active(combo, 0);

return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/mcpanel.c
Expand Up @@ -179,7 +179,7 @@ mcpanel* mcp_create(const char* uifilename, const struct PanelCb* cb,
}

get_initial_values(pan);
set_data_length(pan, 1.0f);
set_data_length(pan, pan->display_length);

return pan;
}
Expand Down
1 change: 1 addition & 0 deletions src/scopetab.c
Expand Up @@ -594,6 +594,7 @@ void scopetab_define_input(struct signaltab* tab, const char** labels)
init_buffers(sctab);
init_filter(sctab, 0);
init_filter(sctab, 1);
scopetab_set_xticks(sctab, sctab->wndlen);
}


Expand Down

0 comments on commit f33a931

Please sign in to comment.