Ejemplo n.º 1
0
void
update_sensitivity(ProcData *data)
{
	const char * const selected_actions[] = { "StopProcess",
						  "ContProcess",
						  "EndProcess",
						  "KillProcess",
						  "ChangePriority",
						  "MemoryMaps",
						  "OpenFiles" };

	const char * const processes_actions[] = { "ShowActiveProcesses",
						   "ShowAllProcesses",
						   "ShowMyProcesses",
						   "ShowDependencies",
						   "Refresh"
	};

	size_t i;
	gboolean processes_sensitivity, selected_sensitivity;
	GtkAction *action;

	processes_sensitivity = (data->config.current_tab == PROCMAN_TAB_PROCESSES);
	selected_sensitivity = (processes_sensitivity && data->selected_process != NULL);

	if(data->endprocessbutton) {
		/* avoid error on startup if endprocessbutton
		   has not been built yet */
		gtk_widget_set_sensitive(data->endprocessbutton, selected_sensitivity);
	}

	for (i = 0; i != G_N_ELEMENTS(processes_actions); ++i) {
		action = gtk_action_group_get_action(data->action_group,
						     processes_actions[i]);
		gtk_action_set_sensitive(action, processes_sensitivity);
	}

	for (i = 0; i != G_N_ELEMENTS(selected_actions); ++i) {
		action = gtk_action_group_get_action(data->action_group,
						     selected_actions[i]);
		gtk_action_set_sensitive(action, selected_sensitivity);
	}
}
Ejemplo n.º 2
0
/** Since Gtk+ 2.6 you cannot press a button twice, without moving the
 *  mouse.
 */
void action_set_sensitive(GtkAction * action, gboolean sensitive)
{
	GSList *widgets;
	widgets = gtk_action_get_proxies(action);
	while (widgets) {
		widget_set_sensitive(GTK_WIDGET(widgets->data), sensitive);
		widgets = g_slist_next(widgets);
	}
	gtk_action_set_sensitive(action, sensitive);
}
GtkAction *
nautilus_toolbar_action_from_menu_item (NautilusMenuItem *item)
{
	char *name, *label, *tip, *icon_name;
	gboolean sensitive, priority;
	GtkAction *action;
	GdkPixbuf *pixbuf;
	NautilusIconInfo *info;
	int icon_size;
	
	g_object_get (G_OBJECT (item), 
		      "name", &name, "label", &label, 
		      "tip", &tip, "icon", &icon_name,
		      "sensitive", &sensitive,
		      "priority", &priority,
		      NULL);
	
	action = gtk_action_new (name,
				 label,
				 tip,
				 icon_name);
	
	if (icon_name != NULL) {
		icon_size = nautilus_get_icon_size_for_stock_size (GTK_ICON_SIZE_LARGE_TOOLBAR);
		info = nautilus_icon_info_lookup_from_name (icon_name, icon_size);

		pixbuf = nautilus_icon_info_get_pixbuf_nodefault_at_size (info, icon_size);
		if (pixbuf != NULL) {
			g_object_set_data_full (G_OBJECT (action), "toolbar-icon",
						pixbuf,
						g_object_unref);
		}
		g_object_unref (info);
	}
	
	gtk_action_set_sensitive (action, sensitive);
	g_object_set (action, "is-important", priority, NULL);
	
	g_signal_connect_data (action, "activate",
			       G_CALLBACK (extension_action_callback),
			       g_object_ref (item), 
			       (GClosureNotify)g_object_unref, 0);

	g_signal_connect_object (item, "notify::sensitive",
				 G_CALLBACK (extension_action_sensitive_callback),
				 action,
				 0);

	g_free (name);
	g_free (label);
	g_free (tip);
	g_free (icon_name);

	return action;
}
Ejemplo n.º 4
0
/** 
 * Update the clickable list of closed accounts and target
 * accounts to move a transaction, in menu.
 *
 * \param
 * \return FALSE
 * */
gboolean gsb_menu_update_accounts_in_menus ( void )
{
    GSList *list_tmp;
    GtkActionGroup * action_group;

    if ( move_to_account_merge_id != -1 ) 
	gtk_ui_manager_remove_ui ( ui_manager, move_to_account_merge_id );

    move_to_account_merge_id = gtk_ui_manager_new_merge_id ( ui_manager );
    action_group = gtk_action_group_new ( "Group3" );

    /* create the closed accounts and accounts in the menu to move a transaction */
    list_tmp = gsb_data_account_get_list_accounts ();

    while ( list_tmp )
    {
	gint i;

	i = gsb_data_account_get_no_account ( list_tmp -> data );

	if ( !gsb_data_account_get_closed_account ( i ))
	{
	    gchar * tmp_name = g_strdup_printf ( "MoveToAccount%d", i );
	    gchar * account_name = gsb_data_account_get_name(i);
	    GtkAction * action;

	    if ( ! account_name )
	    {
		account_name = _("Unnamed account");
	    }
	    action = gtk_action_new ( tmp_name, account_name, "", "" );

	    if ( gsb_gui_navigation_get_current_account () == i )
		gtk_action_set_sensitive ( action, FALSE );

	    gtk_action_group_add_action ( action_group, action );

	    g_signal_connect ( action, "activate", 
			       G_CALLBACK(move_selected_operation_to_account_nb), 
			       GINT_TO_POINTER(i) );
	    gtk_ui_manager_add_ui ( ui_manager, recent_files_merge_id, 
				    "/menubar/EditMenu/MoveToAnotherAccount/",
				    tmp_name, tmp_name,
				    GTK_UI_MANAGER_MENUITEM, FALSE );
	    g_free ( tmp_name );
	}

	list_tmp = list_tmp -> next;
    }

    gtk_ui_manager_insert_action_group ( ui_manager, action_group, 2 );
    gtk_ui_manager_ensure_update ( ui_manager );

    return FALSE;
}
Ejemplo n.º 5
0
static void
shell_searchbar_update_search_widgets (EShellSearchbar *searchbar)
{
	EShellView *shell_view;
	EShellWindow *shell_window;
	GtkAction *action;
	GtkWidget *widget;
	const gchar *search_text;
	gboolean sensitive;

	/* EShellView subclasses are responsible for actually
	 * executing the search.  This is all cosmetic stuff. */

	widget = searchbar->priv->search_entry;
	shell_view = e_shell_searchbar_get_shell_view (searchbar);
	shell_window = e_shell_view_get_shell_window (shell_view);
	search_text = e_shell_searchbar_get_search_text (searchbar);

	sensitive =
		(search_text != NULL && *search_text != '\0') ||
		(e_shell_view_get_search_rule (shell_view) != NULL);

	if (sensitive) {
		GtkStyle *style;
		const GdkColor *color;

		style = gtk_widget_get_style (widget);
		color = &style->mid[GTK_STATE_SELECTED];

		gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, color);
		gtk_widget_modify_text (widget, GTK_STATE_NORMAL, NULL);
	} else {
		/* Text color will be updated when we move the focus. */
		gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, NULL);
	}

	action = E_SHELL_WINDOW_ACTION_SEARCH_CLEAR (shell_window);
	gtk_action_set_sensitive (action, sensitive);

	action = E_SHELL_WINDOW_ACTION_SEARCH_SAVE (shell_window);
	gtk_action_set_sensitive (action, sensitive);
}
Ejemplo n.º 6
0
void
Tetris::setupdialogDestroy(GtkWidget *widget, void *d)
{
	Tetris *t = (Tetris*) d;
	if (t->setupdialog) {
		delete t->theme_preview;
		gtk_widget_destroy(t->setupdialog);
	}
	t->setupdialog = 0;
	gtk_action_set_sensitive(t->new_game_action, TRUE);
}
Ejemplo n.º 7
0
static gboolean
sync_idle_cb_cleanup (RBMediaPlayerSource *source)
{
	RBMediaPlayerSourcePrivate *priv = MEDIA_PLAYER_SOURCE_GET_PRIVATE (source);

	rb_debug ("cleaning up after sync process");

	gtk_action_set_sensitive (priv->sync_action, TRUE);

	return FALSE;
}
Ejemplo n.º 8
0
void
update_menubar (TboWindow *tbo)
{
    GtkAction *action;
    int i;
    char *actions[20] = {"FlipHObj", "FlipVObj", "OrderUpObj", "OrderDownObj", "DeleteObj", "CloneObj"};
    int elements = 6;
    int obj_n_elements = 4;
    gboolean activated = FALSE;

    tbo_object *obj = selector_tool_get_selected_obj ();
    Frame *frame = selector_tool_get_selected_frame ();

    if (!MENU_ACTION_GROUP)
        return;

    if (get_frame_view () && obj)
    {
        for (i=0; i<elements; i++)
        {
            action = gtk_action_group_get_action (MENU_ACTION_GROUP, actions[i]);
            gtk_action_set_sensitive (action, TRUE);
        }
    }
    else if (!get_frame_view () && frame)
    {
        for (i=obj_n_elements; i<elements; i++)
        {
            action = gtk_action_group_get_action (MENU_ACTION_GROUP, actions[i]);
            gtk_action_set_sensitive (action, TRUE);
        }
    }
    else
    {
        for (i=0; i<elements; i++)
        {
            action = gtk_action_group_get_action (MENU_ACTION_GROUP, actions[i]);
            gtk_action_set_sensitive (action, FALSE);
        }
    }
}
Ejemplo n.º 9
0
void
end_game (gboolean show_splash)
{
  if (main_id) {
    g_source_remove (main_id);
    main_id = 0;
  }

  if (keyboard_id) {
    g_signal_handler_disconnect (G_OBJECT (stage), keyboard_id);
    keyboard_id = 0;
  }

  if (add_bonus_id) {
    g_source_remove (add_bonus_id);
    add_bonus_id = 0;
  }

  if (dummy_id) {
    g_source_remove (dummy_id);
    dummy_id = 0;
  }

  if (restart_id) {
    g_source_remove (restart_id);
    restart_id = 0;
  }

  if (show_splash) {
    render_logo ();
    gtk_action_set_sensitive (new_network_action, TRUE);
    gtk_action_set_sensitive (pause_action, FALSE);
    gtk_action_set_sensitive (resume_action, FALSE);
    gtk_action_set_sensitive (end_game_action, FALSE);
    gtk_action_set_sensitive (preferences_action, TRUE);
  }

  network_gui_update ();
  paused = 0;

}
void
gtk_gui::_update_menus()
{
#if  GTK_MAJOR_VERSION >= 3
	gtk_widget_set_sensitive (m_play, m_mainloop && m_mainloop->is_play_enabled() && ! m_mainloop->is_play_active());
	gtk_widget_set_sensitive (m_pause, m_mainloop && m_mainloop->is_play_enabled() && ! m_mainloop->is_pause_active());
	gtk_widget_set_sensitive (m_stop, m_mainloop && m_mainloop->is_play_enabled() && ! m_mainloop->is_stop_active());
	gtk_widget_set_sensitive (m_reload, m_mainloop != NULL);

#else // GTK_MAJOR_VERSION < 3

	gtk_action_set_sensitive(gtk_action_group_get_action (m_actions, "play"),
		m_mainloop && m_mainloop->is_play_enabled() && ! m_mainloop->is_play_active());
	gtk_action_set_sensitive(gtk_action_group_get_action (m_actions, "pause"),
		m_mainloop && m_mainloop->is_pause_enabled() && ! m_mainloop->is_pause_active());
	gtk_action_set_sensitive(gtk_action_group_get_action (m_actions, "stop"),
		m_mainloop && m_mainloop->is_stop_enabled() && ! m_mainloop->is_stop_active());
	gtk_action_set_sensitive(gtk_action_group_get_action (m_actions, "reload"),
		(m_mainloop != NULL));
#endif // GTK_MAJOR_VERSION < 3
}
Ejemplo n.º 11
0
static void
load_finished (GtkWidget      *view,
               WebKitWebFrame *frame)
{
  GtkAction *action = gtk_ui_manager_get_action (ui_manager,
                                                 "/ui/help-browser-popup/stop");
  gtk_action_set_sensitive (action, FALSE);

  update_actions ();

  select_index (webkit_web_frame_get_uri (frame));
}
Ejemplo n.º 12
0
static void
window_history_update_ui (GiggleWindow *window)
{
	GiggleWindowPriv *priv = GET_PRIV (window);
	gboolean          back = FALSE, forward = FALSE;
	GtkAction        *action;

	if (!priv->ui_manager)
		return;

	if (priv->history) {
		back = (NULL != priv->history->prev);
		forward = (NULL != priv->history->next);
	}

	action = gtk_ui_manager_get_action (priv->ui_manager, HISTORY_GO_BACK_PATH);
	gtk_action_set_sensitive (action, back);

	action = gtk_ui_manager_get_action (priv->ui_manager, HISTORY_GO_FORWARD_PATH);
	gtk_action_set_sensitive (action, forward);
}
Ejemplo n.º 13
0
static void
cedit_prefs_manager_syntax_hl_enable_changed (GSettings *settings,
					      gchar       *key,
					      gpointer     user_data)
{
	cedit_debug (DEBUG_PREFS);

	if (strcmp (key, GPM_SYNTAX_HL_ENABLE) == 0)
	{
		gboolean enable;
		GList *docs;
		GList *l;
		const GList *windows;

		enable = g_settings_get_boolean (settings, key);

		docs = cedit_app_get_documents (cedit_app_get_default ());
		l = docs;

		while (l != NULL)
		{
#if GTK_CHECK_VERSION (3, 0, 0)
			g_return_if_fail (GTK_SOURCE_IS_BUFFER (l->data));
#else
			g_return_if_fail (GTK_IS_SOURCE_BUFFER (l->data));
#endif

			gtk_source_buffer_set_highlight_syntax (GTK_SOURCE_BUFFER (l->data),
								enable);

			l = l->next;
		}

		g_list_free (docs);

		/* update the sensitivity of the Higlight Mode menu item */
		windows = cedit_app_get_windows (cedit_app_get_default ());
		while (windows != NULL)
		{
			GtkUIManager *ui;
			GtkAction *a;

			ui = cedit_window_get_ui_manager (CEDIT_WINDOW (windows->data));

			a = gtk_ui_manager_get_action (ui,
						       "/MenuBar/ViewMenu/ViewHighlightModeMenu");

			gtk_action_set_sensitive (a, enable);

			windows = g_list_next (windows);
		}
	}
}
Ejemplo n.º 14
0
/* Popup html context menu when mouse over hyper link */
static void
html_context_link_cb(ChmseeIhtml *html, const gchar *link, ChmSee* self)
{
	g_debug("html context-link event: %s", link);
	chmsee_set_context_menu_link(self, link);
	gtk_action_set_sensitive(gtk_action_group_get_action(selfp->action_group, "OpenLinkInNewTab"),
			g_str_has_prefix(selfp->context_menu_link, "file://"));

	gtk_menu_popup(GTK_MENU(gtk_ui_manager_get_widget(selfp->ui_manager, "/HtmlContextLink")),
			NULL, NULL, NULL, NULL, 0, GDK_CURRENT_TIME);

}
Ejemplo n.º 15
0
void iconview_menubar_state (gboolean s)
{
    if (s) {
	GtkAction *a = gtk_ui_manager_get_action(mdata->ui, "/menubar/View");

	if (a != NULL && !gtk_action_get_sensitive(a)) {
	    gtk_action_set_sensitive(a, TRUE);
	}
    }

    flip(mdata->ui, "/menubar/View/IconView", s);
}
Ejemplo n.º 16
0
void flip (GtkUIManager *ui, const char *path, gboolean s)
{
    if (ui != NULL) {
	GtkAction *a = gtk_ui_manager_get_action(ui, path);

	if (a != NULL) {
	    gtk_action_set_sensitive(a, s);
	} else {
	    fprintf(stderr, I_("Failed to flip state of \"%s\"\n"), path);
	}
    }
}
Ejemplo n.º 17
0
GtkAction* PopupMenuGtk::createGtkActionForMenuItem(int itemIndex)
{
    GOwnPtr<char> actionName(g_strdup_printf("popup-menu-action-%d", itemIndex));
    GtkAction* action = gtk_action_new(actionName.get(), client()->itemText(itemIndex).utf8().data(), client()->itemToolTip(itemIndex).utf8().data(), 0);
    g_object_set_data(G_OBJECT(action), "popup-menu-action-index", GINT_TO_POINTER(itemIndex));
    g_signal_connect(action, "activate", G_CALLBACK(menuItemActivated), this);
    // FIXME: Apply the PopupMenuStyle from client()->itemStyle(i)
    gtk_action_set_visible(action, !client()->itemStyle(itemIndex).isDisplayNone());
    gtk_action_set_sensitive(action, client()->itemIsEnabled(itemIndex));

    return action;
}
static void
thunar_history_set_current_directory (ThunarNavigator *navigator,
                                      ThunarFile      *current_directory)
{
  ThunarHistory *history = THUNAR_HISTORY (navigator);

  /* verify that we don't already use that directory */
  if (G_UNLIKELY (current_directory == history->current_directory))
    return;

  /* if the new directory is the first one in the forward history, we
   * just move forward one step instead of clearing the whole forward
   * history */
  if (history->forward_list != NULL && history->forward_list->data == current_directory)
    thunar_history_go_forward (history, 1);
  else
    {
      /* clear the "forward" list */
      gtk_action_set_sensitive (history->action_forward, FALSE);
      thunar_file_list_free (history->forward_list);
      history->forward_list = NULL;

      /* prepend the previous current directory to the "back" list */
      if (G_LIKELY (history->current_directory != NULL))
        {
          history->back_list = g_list_prepend (history->back_list, history->current_directory);
          gtk_action_set_sensitive (history->action_back, TRUE);
        }

      /* activate the new current directory */
      history->current_directory = current_directory;

      /* connect to the new current directory */
      if (G_LIKELY (current_directory != NULL))
        g_object_ref (G_OBJECT (current_directory));
    }

  /* notify listeners */
  g_object_notify (G_OBJECT (history), "current-directory");
}
static void
extension_action_sensitive_callback (NautilusMenuItem *item,
                                     GParamSpec *arg1,
                                     gpointer user_data)
{
	gboolean value;
	
	g_object_get (G_OBJECT (item),
	              "sensitive", &value,
		      NULL);

	gtk_action_set_sensitive (GTK_ACTION (user_data), value);
}
Ejemplo n.º 20
0
/*
 * action_set_sensitive:
 * @sensitive: the sensitivity state.
 *
 * Set sensitivity of an action.
 */
static void
action_set_sensitive (LdWindowMain *self, const gchar *name, gboolean sensitive)
{
	GtkAction *action;

	g_return_if_fail (LD_IS_WINDOW_MAIN (self));
	g_return_if_fail (name != NULL);

	action = gtk_action_group_get_action (self->priv->action_group, name);
	g_return_if_fail (action != NULL);

	gtk_action_set_sensitive (action, sensitive);
}
static void
athena_desktop_window_constructed (GObject *obj)
{
	GtkActionGroup *action_group;
	GtkAction *action;
	AtkObject *accessible;
	AthenaDesktopWindow *window = ATHENA_DESKTOP_WINDOW (obj);
	AthenaWindow *nwindow = ATHENA_WINDOW (obj);

	G_OBJECT_CLASS (athena_desktop_window_parent_class)->constructed (obj);
	
	gtk_widget_hide (nwindow->details->statusbar);
	gtk_widget_hide (nwindow->details->menubar);

	action_group = athena_window_get_main_action_group (nwindow);

	/* Don't allow close action on desktop */
	action = gtk_action_group_get_action (action_group,
					      ATHENA_ACTION_CLOSE);
	gtk_action_set_sensitive (action, FALSE);

	/* Don't allow new tab on desktop */
	action = gtk_action_group_get_action (action_group,
					      ATHENA_ACTION_NEW_TAB);
	gtk_action_set_sensitive (action, FALSE);

	/* Set the accessible name so that it doesn't inherit the cryptic desktop URI. */
	accessible = gtk_widget_get_accessible (GTK_WIDGET (window));

	if (accessible) {
		atk_object_set_name (accessible, _("Desktop"));
	}

	/* Monitor the preference to have the desktop */
	/* point to the Unix home folder */
	g_signal_connect_swapped (athena_preferences, "changed::" ATHENA_PREFERENCES_DESKTOP_IS_HOME_DIR,
				  G_CALLBACK (athena_desktop_window_update_directory),
				  window);
}
static void
playlist_entries_changed (GtkTreeModel         *model,
			  RhythmDBEntry        *entry,
			  RBDiscRecorderPlugin *pi)
{
	int        num_tracks;
	GtkAction *action;

	num_tracks = gtk_tree_model_iter_n_children (model, NULL);

	action = gtk_action_group_get_action (pi->action_group, "MusicPlaylistBurnToDiscPlaylist");
	gtk_action_set_sensitive (action, (num_tracks > 0));
}
Ejemplo n.º 23
0
void on_ui_chmfile_model_changed(ChmSee* self, ChmseeIchmfile* chm_file) {
	gboolean has_model = (chm_file != NULL);

	gtk_action_set_sensitive(gtk_action_group_get_action(selfp->action_group, "NewTab"), has_model);
	gtk_action_set_sensitive(gtk_action_group_get_action(selfp->action_group, "CloseTab"), has_model);
	gtk_action_set_sensitive(gtk_action_group_get_action(selfp->action_group, "Home"), has_model);
	gtk_action_set_sensitive(gtk_action_group_get_action(selfp->action_group, "SidePane"), has_model);
	gtk_action_set_sensitive(gtk_action_group_get_action(selfp->action_group, "ZoomIn"), has_model);
	gtk_action_set_sensitive(gtk_action_group_get_action(selfp->action_group, "ZoomOut"), has_model);
	gtk_action_set_sensitive(gtk_action_group_get_action(selfp->action_group, "ZoomReset"), has_model);
}  
Ejemplo n.º 24
0
static void
on_game_hint (GtkMenuItem * m, gpointer data)
{
  gchar *s;
  gint c;

  if (timeout)
    return;
  if (gameover)
    return;

  gtk_action_set_sensitive (hint_action, FALSE);
  gtk_action_set_sensitive (undo_action, FALSE);

  set_status_message (_("Thinking..."));

  vstr[0] = vlevel[LEVEL_STRONG];
  c = playgame (vstr, vboard) - 1;

  column_moveto = c;
  if (p.do_animate) {
    while (timeout)
      gtk_main_iteration ();
    anim = ANIM_HINT;
    timeout = g_timeout_add (SPEED_MOVE, (GSourceFunc) on_animate, NULL);
  } else {
    move_cursor (column_moveto);
  }

  blink_tile (0, c, gboard[0][c], 6);

  s = g_strdup_printf (_("Hint: Column %d"), c + 1);
  set_status_message (s);
  g_free (s);

  gtk_action_set_sensitive (hint_action, TRUE);
  gtk_action_set_sensitive (undo_action, (moves > 0));
}
Ejemplo n.º 25
0
static void
glide_window_update_undo_ui (GlideWindow *w)
{
  GtkAction *undo_action, *redo_action;
  GtkMenuItem *undo_item, *redo_item;
  
  undo_action = GTK_ACTION (GLIDE_WINDOW_UI_OBJECT (w, "undo-action"));
  redo_action = GTK_ACTION (GLIDE_WINDOW_UI_OBJECT (w, "redo-action"));

  undo_item = GTK_MENU_ITEM (GLIDE_WINDOW_UI_OBJECT (w, "undo-menuitem"));
  redo_item = GTK_MENU_ITEM (GLIDE_WINDOW_UI_OBJECT (w, "redo-menuitem"));
  
  if (glide_undo_manager_get_can_undo (w->priv->undo_manager))
    {
      gchar *label = g_strdup_printf("Undo: %s", glide_undo_manager_get_undo_label (w->priv->undo_manager));
      gtk_action_set_sensitive (undo_action, TRUE);
      gtk_menu_item_set_label (undo_item, label);
      g_free (label);
    }
  else
    {
      gtk_action_set_sensitive (undo_action, FALSE);
      gtk_menu_item_set_label (undo_item, "Undo");
    }

  if (glide_undo_manager_get_can_redo (w->priv->undo_manager))
    {
      gchar *label = g_strdup_printf("Redo: %s", glide_undo_manager_get_redo_label (w->priv->undo_manager));
      gtk_action_set_sensitive (redo_action, TRUE);
      gtk_menu_item_set_label (redo_item, label);
      g_free (label);
    }
  else
    {
      gtk_action_set_sensitive (redo_action, FALSE);
      gtk_menu_item_set_label (redo_item, "Redo");
    }
}
Ejemplo n.º 26
0
static void
status_icon_status_changed_cb (TpAccount *account,
			       TpConnectionStatus current,
			       TpConnectionStatus previous,
			       TpConnectionStatusReason reason,
			       gchar *dbus_error_name,
			       GHashTable *details,
			       EmpathyStatusIcon *icon)
{
	EmpathyStatusIconPriv *priv = GET_PRIV (icon);

	gtk_action_set_sensitive (priv->new_message_item,
				  empathy_account_manager_get_accounts_connected (NULL));
}
static void
gdm_password_extension_ask_question (GdmLoginExtension *login_extension,
                                     const char          *message)
{
        GdmPasswordExtension *extension = GDM_PASSWORD_EXTENSION (login_extension);
        gtk_widget_show (extension->priv->prompt_label);
        gtk_label_set_text (GTK_LABEL (extension->priv->prompt_label), message);
        gtk_entry_set_text (GTK_ENTRY (extension->priv->prompt_entry), "");
        gtk_entry_set_visibility (GTK_ENTRY (extension->priv->prompt_entry), TRUE);
        gtk_widget_show (extension->priv->prompt_entry);
        gtk_widget_grab_focus (extension->priv->prompt_entry);
        extension->priv->answer_pending = TRUE;

        gtk_action_set_sensitive (extension->priv->login_action, TRUE);
}
Ejemplo n.º 28
0
static void
glide_window_document_n_slides_changed (GlideDocument *document,
					GlideSlide *slide,
					gpointer data)
{
  GlideWindow *w = (GlideWindow *)data;
  gboolean sensitive;

  if (glide_document_get_n_slides (document) > 1)
    sensitive = TRUE;
  else
    sensitive = FALSE;
  
  gtk_action_set_sensitive (GTK_ACTION (GLIDE_WINDOW_UI_OBJECT (w, "remove-slide-action")), sensitive);
}
static void
gdm_smartcard_extension_ask_secret (GdmLoginExtension *login_extension,
                                    const char          *message)
{
        GdmSmartcardExtension *extension = GDM_SMARTCARD_EXTENSION (login_extension);
        gtk_widget_show (extension->priv->prompt_label);
        gtk_label_set_text (GTK_LABEL (extension->priv->prompt_label), message);
        gtk_entry_set_visibility (GTK_ENTRY (extension->priv->prompt_entry), FALSE);
        gtk_entry_set_text (GTK_ENTRY (extension->priv->prompt_entry), "");
        gtk_widget_show (extension->priv->prompt_entry);
        gtk_widget_grab_focus (extension->priv->prompt_entry);
        gtk_action_set_visible (extension->priv->login_action, TRUE);
        gtk_action_set_sensitive (extension->priv->login_action, TRUE);
        extension->priv->answer_pending = TRUE;
}
Ejemplo n.º 30
0
void
athena_navigation_state_set_boolean (AthenaNavigationState *self,
                                     const gchar *action_name,
                                     gboolean value)
{
    GtkAction *action;

    action = gtk_action_group_get_action (self->priv->master,
                                          action_name);

    if (action == NULL) {
        return;
    }

    gtk_action_set_sensitive (action, value);
}