Skip to content

Commit d840951

Browse files
committed
Add Map Caps to the UI, Fix Cancel for EM Placement dialog
1 parent f62e5d8 commit d840951

4 files changed

Lines changed: 39 additions & 19 deletions

File tree

src/create-menu-item-actions.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4005,6 +4005,15 @@ molecular_surface_action(G_GNUC_UNUSED GSimpleAction *simple_action,
40054005
graphics_info_t::graphics_grab_focus();
40064006
}
40074007

4008+
void
4009+
map_caps_action(G_GNUC_UNUSED GSimpleAction *simple_action,
4010+
G_GNUC_UNUSED GVariant *parameter,
4011+
G_GNUC_UNUSED gpointer user_data) {
4012+
4013+
add_density_map_cap();
4014+
graphics_info_t::graphics_grab_focus();
4015+
}
4016+
40084017
void
40094018
electrostatic_surface_action(G_GNUC_UNUSED GSimpleAction *simple_action,
40104019
G_GNUC_UNUSED GVariant *parameter,
@@ -6294,6 +6303,7 @@ create_actions(GtkApplication *application) {
62946303
add_action( "bond_parameters_action", bond_parameters_action);
62956304
add_action( "bond_colours_action", bond_colours_action);
62966305
add_action( "fullscreen_action", fullscreen_action);
6306+
add_action( "map_caps_action", map_caps_action);
62976307
add_action( "go_to_atom_action", go_to_atom_action);
62986308
add_action( "label_CA_atoms_action", label_CA_atoms_action);
62996309
add_action( "map_parameters_action", map_parameters_action);

src/generic-objects.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ PyObject *generic_object_name_py(unsigned int obj_number_in) {
765765
Py_INCREF(r);
766766
}
767767
return r;
768-
}
768+
}
769769
#endif /* USE_PYTHON */
770770

771771

@@ -802,17 +802,20 @@ void close_generic_object(int object_number) {
802802
std::string label_name = stub + "_label";
803803
// GtkWidget *toggle_button = lookup_widget(g.generic_objects_dialog, toggle_button_name.c_str());
804804
// GtkWidget *label = lookup_widget(g.generic_objects_dialog, label_name.c_str());
805-
std::cout << "WARNING:: in close_generic_object() set the toggle_button and label correctly " << std::endl;
805+
std::cout << "WARNING:: in close_generic_object() set the toggle_button and label correctly "
806+
<< std::endl;
806807
GtkWidget *toggle_button = 0;
807808
GtkWidget *label = 0;
808809
if (toggle_button)
809810
gtk_widget_set_visible(toggle_button, FALSE);
810811
if (label)
811812
gtk_widget_set_visible(label, FALSE);
812813
}
814+
815+
g.graphics_draw();
813816
}
814817

815-
/*! \brief has the generic object been closed?
818+
/*! \brief has the generic object been closed?
816819
817820
@return 1 for yes, 0 othersize
818821
*/

src/glade-callbacks-main-window.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ typedef const char entry_char_type;
4949
#include "graphics-info.h"
5050

5151
#include "cc-interface.hh" // for read_ccp4_map()
52+
#include "c-interface-generic-objects.h"
5253

5354
#include "utils/logging.hh"
5455
extern logging logger;
@@ -2197,10 +2198,12 @@ void
21972198
on_emplacement_cancel_button_clicked(G_GNUC_UNUSED GtkButton *button,
21982199
G_GNUC_UNUSED gpointer user_data) {
21992200

2200-
GtkWidget *frame = widget_from_builder("emplacement_frame");
2201-
2202-
gtk_widget_set_visible(frame, FALSE);
2201+
GtkWidget *dialog = widget_from_builder("emplacement_dialog");
2202+
gtk_widget_set_visible(dialog, FALSE);
22032203

2204+
int obj = generic_object_index("Emplacement Sphere");
2205+
if (obj >= 0)
2206+
close_generic_object(obj);
22042207
}
22052208

22062209
extern "C" G_MODULE_EXPORT

ui/coot.ui

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -723,15 +723,6 @@
723723
<!-- <attribute name="label">Central Atom Label...</attribute> -->
724724
<!-- <attribute name="action">app.draw_central_atom_label_action</attribute> -->
725725
<!-- </item> -->
726-
<item>
727-
<!-- this needs an atom selection overlay -->
728-
<attribute name="label">Electrostatic Surface</attribute>
729-
<attribute name="action">app.electrostatic_surface_action</attribute>
730-
</item>
731-
<item>
732-
<attribute name="label">Gaussian Surface...</attribute>
733-
<attribute name="action">app.gaussian_surface_action</attribute>
734-
</item>
735726
<item>
736727
<attribute name="label">Go To Atom...</attribute>
737728
<attribute name="action">app.go_to_atom_action</attribute>
@@ -740,10 +731,6 @@
740731
<attribute name="label">Map Parameters...</attribute>
741732
<attribute name="action">app.map_parameters_action</attribute>
742733
</item>
743-
<item>
744-
<attribute name="label">Molecular Surface</attribute>
745-
<attribute name="action">app.molecular_surface_action</attribute>
746-
</item>
747734
<item>
748735
<attribute name="label">NCS Ghost Control...</attribute>
749736
<attribute name="action">app.ghost_control_action</attribute>
@@ -788,6 +775,23 @@
788775
</item>
789776
</section>
790777
<section>
778+
<item>
779+
<attribute name="label">Gaussian Surface...</attribute>
780+
<attribute name="action">app.gaussian_surface_action</attribute>
781+
</item>
782+
<item>
783+
<attribute name="label">Molecular Surface</attribute>
784+
<attribute name="action">app.molecular_surface_action</attribute>
785+
</item>
786+
<item>
787+
<attribute name="label">Map Caps</attribute>
788+
<attribute name="action">app.map_caps_action</attribute>
789+
</item>
790+
<item>
791+
<!-- this needs an atom selection overlay -->
792+
<attribute name="label">Electrostatic Surface</attribute>
793+
<attribute name="action">app.electrostatic_surface_action</attribute>
794+
</item>
791795
<item>
792796
<attribute name="label">Ribbons: By Chain</attribute>
793797
<attribute name="action">app.ribbons_colour_by_chain_action</attribute>

0 commit comments

Comments
 (0)