Beispiel #1
0
static void
om_node_init(OMNode *obj)
{
	GtkWidget *hb;

	hb = gtk_hbox_new(FALSE, 3);
	gtk_widget_show(hb);
	gtk_box_pack_start(GTK_BOX(obj), hb, FALSE, TRUE, 0);

	// icon and name
	obj->icon = gtk_image_new();
	gtk_widget_show(obj->icon);
	gtk_box_pack_start(GTK_BOX(hb), obj->icon, FALSE, TRUE, 0);

	obj->name = gtk_entry_new();
	gtk_entry_set_editable(GTK_ENTRY(obj->name), FALSE);
	gtk_widget_show(obj->name);
	gtk_box_pack_start(GTK_BOX(hb), obj->name, TRUE, TRUE, 0);

	// edit area
	obj->edit_area = gtk_vbox_new(FALSE, 3);
	gtk_widget_show(obj->edit_area);
	gtk_box_pack_start(GTK_BOX(obj), obj->edit_area, TRUE, TRUE, 0);

	add_editor(obj, node_desc_get_editor());
	add_editor(obj, node_retval_get_editor());
	add_editor(obj, node_param_get_editor());
	add_editor(obj, node_oper_get_editor());
	add_editor(obj, node_acl_get_editor());
}
/**
 * @brief Opens a file with a language strings list editor in a new tab.
 * @param quest A Solarus quest.
 * @param language_id Language id of the strings file to open.
 */
void EditorTabs::open_strings_editor(
    Quest& quest, const QString& language_id) {

  // Get the strings file path.
  QString path = quest.get_strings_path(language_id);

  if (!quest.is_in_root_path(path)) {
    // Not a file of this quest.
    return;
  }

  // Find the existing tab if any.
  int index = find_editor(path);
  if (index != -1) {
    // Already open.
    setCurrentIndex(index);
    return;
  }

  try {
    add_editor(new StringsEditor(quest, language_id));
  }
  catch (const EditorException& ex) {
    ex.show_dialog();
  }
}
/**
 * @brief Shows a tab to edit the quest properties.
 * @param quest A Solarus quest.
 */
void EditorTabs::open_quest_properties_editor(Quest& quest) {

  // Find the existing tab if any.
  int index = find_editor(quest.get_properties_path());
  if (index != -1) {
    // Already open.
    setCurrentIndex(index);
    return;
  }

  try {
    add_editor(new QuestPropertiesEditor(quest));
  }
  catch (const EditorException& ex) {
    ex.show_dialog();
  }
}
/**
 * @brief Opens a file with a sprite editor in a new tab.
 * @param quest A Solarus quest.
 * @param path Path of the sprite data file to open.
 */
void EditorTabs::open_sprite_editor(
    Quest& quest, const QString& path) {

  if (!quest.is_in_root_path(path)) {
    // Not a file of this quest.
    return;
  }

  // Find the existing tab if any.
  int index = find_editor(path);
  if (index != -1) {
    // Already open.
    setCurrentIndex(index);
    return;
  }

  try {
    add_editor(new SpriteEditor(quest, path));
  }
  catch (const EditorException& ex) {
    ex.show_dialog();
  }
}
Beispiel #5
0
	void EditorManager::react_edition_session_begin( const core::EditionSession& edition_session )
	{
		add_editor( edition_session );
	}