Beispiel #1
0
void menu_view_changed(void)
{
  graph_view_handle view;

  view = get_current_view();

  gtk_widget_set_sensitive(g_menu_item_start_app, is_new_app_allowed(view));
  gtk_widget_set_sensitive(g_menu_item_destroy_room, is_room_view(view));
  gtk_widget_set_sensitive(g_menu_item_project, is_room_view(view) && get_studio_state() == STUDIO_STATE_STARTED);
}
Beispiel #2
0
void menu_studio_state_changed(unsigned int studio_state)
{
  graph_view_handle view;

  gtk_widget_set_sensitive(g_menu_item_start_studio, studio_state == STUDIO_STATE_STOPPED);
  gtk_widget_set_sensitive(g_menu_item_stop_studio, studio_state == STUDIO_STATE_STARTED);
  gtk_widget_set_sensitive(g_menu_item_save_studio, studio_state == STUDIO_STATE_STARTED);
  gtk_widget_set_sensitive(g_menu_item_save_as_studio, studio_state == STUDIO_STATE_STARTED);
  gtk_widget_set_sensitive(g_menu_item_unload_studio, studio_state != STUDIO_STATE_UNLOADED);
  gtk_widget_set_sensitive(g_menu_item_rename_studio, studio_state == STUDIO_STATE_STOPPED || studio_state == STUDIO_STATE_STARTED);
  gtk_widget_set_sensitive(g_menu_item_create_room, studio_state == STUDIO_STATE_STOPPED || studio_state == STUDIO_STATE_STARTED);

  view = get_current_view();
  gtk_widget_set_sensitive(g_menu_item_project, studio_state == STUDIO_STATE_STARTED && view != NULL && is_room_view(view));
  gtk_widget_set_sensitive(g_menu_item_start_app, is_new_app_allowed(view));
}
Beispiel #3
0
widget
texmacs_input_widget (tree doc, tree style, url wname) {
    doc= enrich_embedded_document (doc, style);
    url       base = get_master_buffer (get_current_buffer ());
    tm_view   curvw= concrete_view (get_current_view ());
    url       name = embedded_name (wname);
    if (contains (name, get_all_buffers ())) set_buffer_tree (name, doc);
    else create_buffer (name, doc);
    tm_view   vw   = concrete_view (get_passive_view (name));
    tm_window win  = tm_new<tm_window_rep> (doc, command ());
    set_master_buffer (name, base);
    vw->win= win;
    set_scrollable (win->wid, vw->ed);
    vw->ed->cvw= win->wid.rep;
    vw->ed->mvw= curvw;
    return wrapped_widget (win->wid, close_embedded_command (vw));
}
Beispiel #4
0
static
bool
fill_project_dynmenu(
  void (* callback)(
    void * context,
    const char * name,
    void * data,
    void (* item_activate_callback)(const char * name, void * data),
    void (* data_free)()),
  void * context)
{
  struct ladish_recent_projects_list_closure closure;
  bool has_project;
  graph_view_handle view;

  closure.callback = callback;
  closure.context = context;

  view = get_current_view();

  if (ladish_room_proxy_get_recent_projects(graph_view_get_room(view), 10, add_recent_project, &closure))
  {
    callback(context, NULL, NULL, NULL, NULL); /* add separator */
  }

  callback(context, _("Load Project..."), NULL, (ladish_dynmenu_item_activate_callback)menu_request_load_project, NULL);

  has_project = room_has_project(view);

  if (!has_project)
  {
    callback(context, _("Create Project..."), NULL, (ladish_dynmenu_item_activate_callback)menu_request_save_as_project, NULL);
  }

  callback(context, has_project ? _("Unload Project") : _("Clear Room"), NULL, (ladish_dynmenu_item_activate_callback)menu_request_unload_project, NULL);

  if (has_project)
  {
    callback(context, _("Save Project"), NULL, (ladish_dynmenu_item_activate_callback)menu_request_save_project, NULL);
    callback(context, _("Save Project As..."), NULL, (ladish_dynmenu_item_activate_callback)menu_request_save_as_project, NULL);
    callback(context, _("Project Properties..."), NULL, (ladish_dynmenu_item_activate_callback)ladish_project_properties_dialog_run, NULL);
  }

  return true;
}
static void
action_zoom_normal_callback (GtkAction *action,
                             gpointer user_data)
{
    nautilus_view_restore_default_zoom_level (get_current_view (user_data));
}
static void
action_zoom_out_callback (GtkAction *action,
                          gpointer user_data)
{
    nautilus_view_bump_zoom_level (get_current_view (user_data), -1);
}