[ghemical-devel] Fwd: [Fwd: ghemical: Spin Multiplicity unknown]
thassine at messi.uku.fi
thassine at messi.uku.fi
Mon Feb 25 04:30:45 EST 2008
Quoting Jean Bréfort <jean.brefort at normalesup.org>:
> The multiplicity code is just not implemented. The best way at the moment is
> to hide or make insensitive the widget
Yes, this is the case at the moment, unfortunately.
This is how I fixed it, starting from line 122:
// the defaults for the subpages...
if (su_allqm == NULL)
{
GtkWidget * entry_totchrg = glade_xml_get_widget(xml,
"entry_allQM_totchrg"); // total charge
gtk_entry_set_text(GTK_ENTRY(entry_totchrg), "+0");
GtkWidget * entry_spinmult = glade_xml_get_widget(xml,
"entry_allQM_spinmult"); // spin multiplicity
// todo!!! todo!!! todo!!! todo!!! todo!!! todo!!! todo!!!
gtk_entry_set_text(GTK_ENTRY(entry_spinmult), "1"); // not yet implemented!
gtk_widget_set_sensitive (entry_spinmult, false); // not yet implemented!
// todo!!! todo!!! todo!!! todo!!! todo!!! todo!!! todo!!!
}
and from line 156:
// the settings specific to the model::current_setup object...
if (su_allqm != NULL)
{
gtk_option_menu_set_history(GTK_OPTION_MENU(saved_optmenus[0]),
su_allqm->GetCurrEngIndex());
gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook_su), 0);
GtkWidget * entry_totchrg = glade_xml_get_widget(xml,
"entry_allQM_totchrg"); // total charge
GtkWidget * entry_spinmult = glade_xml_get_widget(xml,
"entry_allQM_spinmult"); // spin multiplicity
ostringstream str;
str.setf(ios::showpos); str << prj->GetQMTotalCharge() << ends;
gtk_entry_set_text(GTK_ENTRY(entry_totchrg), str.str().c_str());
// todo!!! todo!!! todo!!! todo!!! todo!!! todo!!! todo!!!
gtk_entry_set_text(GTK_ENTRY(entry_spinmult), "1"); // not yet implemented!
gtk_widget_set_sensitive (entry_spinmult, false); // not yet implemented!
// todo!!! todo!!! todo!!! todo!!! todo!!! todo!!! todo!!!
}
This will completely block the item and show the correct default value "1" all
the time.
Thanks,
Tommi
More information about the ghemical-devel
mailing list