Пример #1
0
/****************************************************************
  Help button clicked
*****************************************************************/
static void help_callback(GtkWidget *w, gpointer data)
{
  struct worklist_data *ptr;
  GtkTreeSelection *selection;
  GtkTreeModel *model;
  GtkTreeIter it;

  ptr = data;
  selection = ptr->src_selection;

  if (gtk_tree_selection_get_selected(selection, &model, &it)) {
    gint cid;
    struct universal target;

    gtk_tree_model_get(model, &it, 0, &cid, -1);
    target = cid_decode(cid);

    if (VUT_UTYPE == target.kind) {
      popup_help_dialog_typed(utype_name_translation(target.value.utype),
			      HELP_UNIT);
    } else if (is_great_wonder(target.value.building)) {
      popup_help_dialog_typed(improvement_name_translation(target.value.building),
			      HELP_WONDER);
    } else {
      popup_help_dialog_typed(improvement_name_translation(target.value.building),
			      HELP_IMPROVEMENT);
    }
  } else {
    popup_help_dialog_string(HELP_WORKLIST_EDITOR_ITEM);
  }
}
Пример #2
0
/**************************************************************************
  Popup the help dialog to get help on the given string topic.  Note
  that the topic may appear in multiple sections of the help (it may
  be both an improvement and a unit, for example).

  The given string should be untranslated.
**************************************************************************/
void popup_help_dialog_string(const char *item)
{
  popup_help_dialog_typed(_(item), HELP_ANY);
}