diff options
author | Thomas White <taw@physics.org> | 2021-12-02 15:48:26 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-12-02 16:19:20 +0100 |
commit | 70bf4744ce51d52f439dcb6a652cad7c6daab466 (patch) | |
tree | 2bc65587d1eed7e6e35b077ad8eb2de76521d852 /src/crystfel_gui.c | |
parent | 381931b8360520ca5d6decef884ce07226b06008 (diff) |
GUI: Always set toggle actions at startup
Otherwise, setting the defaults won't work properly.
Diffstat (limited to 'src/crystfel_gui.c')
-rw-r--r-- | src/crystfel_gui.c | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/src/crystfel_gui.c b/src/crystfel_gui.c index 6268d64c..165ed666 100644 --- a/src/crystfel_gui.c +++ b/src/crystfel_gui.c @@ -887,8 +887,8 @@ int main(int argc, char *argv[]) GtkWidget *results_toolbar; GtkWidget *button; GtkWidget *label; - GtkWidget *w; int load_result; + GtkAction *act; /* Long options */ const struct option longopts[] = { @@ -1082,7 +1082,6 @@ int main(int argc, char *argv[]) if ( load_result == 0 ) { DataTemplate *dtempl; - GtkAction *act; proj.cur_frame = 0; if ( proj.geom_filename != NULL ) { @@ -1093,33 +1092,28 @@ int main(int argc, char *argv[]) } } - act = gtk_ui_manager_get_action(proj.ui, "/mainwindow/view/centre"); - gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(act), - proj.show_centre); + update_imageview(&proj); + } - act = gtk_ui_manager_get_action(proj.ui, "/mainwindow/view/peaks"); - gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(act), - proj.show_peaks); + act = gtk_ui_manager_get_action(proj.ui, "/mainwindow/view/centre"); + gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(act), + proj.show_centre); - act = gtk_ui_manager_get_action(proj.ui, "/mainwindow/view/refls"); - gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(act), - proj.show_refls); + act = gtk_ui_manager_get_action(proj.ui, "/mainwindow/view/peaks"); + gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(act), + proj.show_peaks); - act = gtk_ui_manager_get_action(proj.ui, "/mainwindow/view/labelrefls"); - gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(act), - proj.label_refls); + act = gtk_ui_manager_get_action(proj.ui, "/mainwindow/view/refls"); + gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(act), + proj.show_refls); - update_imageview(&proj); - } + act = gtk_ui_manager_get_action(proj.ui, "/mainwindow/view/labelrefls"); + gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(act), + proj.label_refls); - w = gtk_ui_manager_get_widget(proj.ui, "/ui/mainwindow/view/centre"); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(w), proj.show_centre); - w = gtk_ui_manager_get_widget(proj.ui, "/ui/mainwindow/view/peaks"); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(w), proj.show_peaks); - w = gtk_ui_manager_get_widget(proj.ui, "/ui/mainwindow/view/refls"); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(w), proj.show_refls); - w = gtk_ui_manager_get_widget(proj.ui, "/ui/mainwindow/view/labelrefls"); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(w), proj.label_refls); + act = gtk_ui_manager_get_action(proj.ui, "/mainwindow/tools/rescanonchange"); + gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(act), + proj.rescan_on_change); gtk_window_set_default_size(GTK_WINDOW(proj.window), 1024, 768); gtk_paned_set_position(GTK_PANED(hpaned), 172); |