Example #1
0
File: sview.c Project: A1ve5/slurm
static void _set_grid(GtkToggleAction *action)
{
	if (action)
		working_sview_config.show_grid
			= gtk_toggle_action_get_active(action);
	if (!working_sview_config.show_grid)
		gtk_widget_hide(grid_window);
	else
		gtk_widget_show(grid_window);

	return;
}
Example #2
0
static void
on_document_toggled (GtkAction* action,
					 AnjutaDocman* docman)
{
	gint n;

	if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION(action)) == FALSE)
		return;

	n = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
	gtk_notebook_set_current_page (GTK_NOTEBOOK (docman), n);
}
Example #3
0
void
error_console_highlight_info_cmd_callback (GtkAction *action,
                                           gpointer   data)
{
  GimpErrorConsole *console = GIMP_ERROR_CONSOLE (data);
  gboolean          active;

  active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));

  g_object_set (console->gimp->config,
                "error-console-highlight-info", active,
                NULL);
}
Example #4
0
static void
composer_actions_toolbar_option_toggled_cb (GtkToggleAction *toggle_action,
					    EMsgComposer *composer)
{
	GtkAction *action;

	action = GTK_ACTION (toggle_action);

	/* Show the action only after the first time the option is used */
	if (!gtk_action_get_visible (action) &&
	    gtk_toggle_action_get_active (toggle_action))
		gtk_action_set_visible (action, TRUE);
}
Example #5
0
static void
toggle_toolbar_cb (GtkAction * action, GtkWidget * toolbar)
{
  gboolean state;

  state = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
  if (state) {
    gtk_widget_hide (toolbar); /* hack to unfocus the toolbar */
    gtk_widget_show (toolbar);
  } else {
    gtk_widget_hide (toolbar);
  }
}
static void		
cb_toggle_tree (GtkAction *action, gpointer data)
{
	ProcData *procdata = static_cast<ProcData*>(data);
	MateConfClient *client = procdata->client;
	gboolean show;

	show = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
	if (show == procdata->config.show_tree)
		return;

	mateconf_client_set_bool (client, "/apps/procman/show_tree", show, NULL);
}
Example #7
0
static void
cb_toggle_tree (GtkAction *action, gpointer data)
{
    ProcData *procdata = static_cast<ProcData*>(data);
    GSettings *settings = procdata->settings;
    gboolean show;

    show = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
    if (show == procdata->config.show_tree)
        return;

    g_settings_set_boolean (settings, "show-tree", show);
}
Example #8
0
void
view_snap_to_vectors_cmd_callback (GtkAction *action,
                                   gpointer   data)
{
  GimpDisplayShell *shell;
  gboolean          active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
  return_if_no_shell (shell, data);

  if (active == gimp_display_shell_get_snap_to_vectors (shell))
    return;

  gimp_display_shell_set_snap_to_vectors (shell, active);
}
Example #9
0
static void
toggle_display( GtkToggleAction* action, debugger_pane pane_id )
{
  GtkWidget *pane;

  pane = get_pane( pane_id ); if( !pane ) return;

  if( gtk_toggle_action_get_active( action ) ) {
    gtk_widget_show_all( pane );
  } else {
    gtk_widget_hide( pane );
  }
}
Example #10
0
void
vinagre_cmd_view_show_statusbar	(GtkAction     *action,
				 VinagreWindow *window)
{
  gboolean active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
  g_return_if_fail (VINAGRE_IS_WINDOW (window));

  vinagre_utils_set_widget_visible (window->priv->statusbar, active);

  vinagre_cache_prefs_set_boolean ("window",
				   "statusbar-visible",
				   gtk_widget_get_visible (window->priv->statusbar));
}
Example #11
0
int
clip_GTK_TOGGLEACTIONGETACTIVE(ClipMachine * ClipMachineMemory)
{
   C_object *caction = _fetch_co_arg(ClipMachineMemory);

   CHECKARG2(1, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType);
   CHECKCOBJ(caction, GTK_IS_TOGGLE_ACTION(caction->object));

   _clip_retl(ClipMachineMemory, gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(caction->object)));

   return 0;
 err:
   return 1;
}
Example #12
0
static void
action_show_hide_sidebar_callback (GtkAction *action, 
				   gpointer user_data)
{
	NemoWindow *window;

	window = NEMO_WINDOW (user_data);

	if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
		nemo_window_show_sidebar (window);
	} else {
		nemo_window_hide_sidebar (window);
	}
}
Example #13
0
static void
main_window_view_show_protocols_cb (GtkToggleAction *action,
					EmpathyMainWindow *window)
{
	gboolean value;

	value = gtk_toggle_action_get_active (action);

	empathy_conf_set_bool (empathy_conf_get (),
					 EMPATHY_PREFS_UI_SHOW_PROTOCOLS,
					 value == TRUE);
	empathy_contact_list_store_set_show_protocols (window->list_store,
					 value == TRUE);
}
Example #14
0
void equalizerwin_show (gboolean show)
{
    GtkAction * a = gtk_action_group_get_action (toggleaction_group_others,
                    "show equalizer");

    if (a && gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (a)) != show)
        gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (a), show);
    else
    {
        config.equalizer_visible = show;
        button_set_active (mainwin_eq, show);
        equalizerwin_real_show (show && gtk_widget_get_visible (mainwin));
    }
}
Example #15
0
/* View->Notepad */
void
action_view_notepad_toggled(GtkToggleAction *action, I7Story *story)
{
	gboolean show = gtk_toggle_action_get_active(action);

	/* Set the default value for the next time a window is opened */
	GSettings *state = i7_app_get_state(i7_app_get());
	g_settings_set_boolean(state, PREFS_STATE_SHOW_NOTEPAD, show);

	if(show)
		gtk_widget_show(story->notes_window);
	else
		gtk_widget_hide(story->notes_window);
}
static void
action_show_hide_statusbar_callback (GtkAction *action,
				     gpointer user_data)
{
	NautilusNavigationWindow *window;

	window = NAUTILUS_NAVIGATION_WINDOW (user_data);

	if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
		nautilus_navigation_window_show_status_bar (window);
	} else {
		nautilus_navigation_window_hide_status_bar (window);
	}
}
Example #17
0
/* View->Statusbar */
void
action_view_statusbar_toggled(GtkToggleAction *action, I7Document *document)
{
	gboolean show = gtk_toggle_action_get_active(action);

	/* Set the default value for the next time a window is opened */
	GSettings *state = i7_app_get_state(i7_app_get());
	g_settings_set_boolean(state, PREFS_STATE_SHOW_STATUSBAR, show);

	if(show)
		gtk_widget_show(document->statusline);
	else
		gtk_widget_hide(document->statusline);
}
Example #18
0
int
clip_GTK_TOGGLEACTIONGETACTIVE(ClipMachine * cm)
{
    C_object *caction   = _fetch_co_arg(cm);

    CHECKARG2(1,MAP_t, NUMERIC_t);
    CHECKCOBJ(caction, GTK_IS_TOGGLE_ACTION(caction->object));

    _clip_retl(cm, gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(caction->object)));

    return 0;
err:
    return 1;
}
Example #19
0
void
windows_use_single_window_mode_cmd_callback (GtkAction *action,
                                             gpointer   data)
{
  gboolean  active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
  Gimp     *gimp;
  return_if_no_gimp (gimp, data);

  if (GIMP_GUI_CONFIG (gimp->config)->single_window_mode == active)
    return;

  g_object_set (gimp->config,
                "single-window-mode", active,
                NULL);
}
Example #20
0
void
view_toggle_sample_points_cmd_callback (GtkAction *action,
                                        gpointer   data)
{
  GimpDisplayShell *shell;
  gboolean          active;
  return_if_no_shell (shell, data);

  active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));

  if (active != gimp_display_shell_get_show_sample_points (shell))
    {
      gimp_display_shell_set_show_sample_points (shell, active);
    }
}
void
_gedit_cmd_view_show_statusbar (GtkAction   *action,
			       GeditWindow *window)
{
	gboolean visible;

	gedit_debug (DEBUG_COMMANDS);

	visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));

	if (visible)
		gtk_widget_show (window->priv->statusbar);
	else
		gtk_widget_hide (window->priv->statusbar);
}
Example #22
0
static void set_update_timeout(AWeatherGui *self)
{
	GObject *action = aweather_gui_get_object(self, "update");
	gint freq = grits_prefs_get_integer(self->prefs, "aweather/update_freq", NULL);
	if (self->update_source) {
		g_debug("AWeatherGui: set_update_timeout - clear");
		g_source_remove(self->update_source);
	}
	self->update_source = 0;
	if (gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action)) && freq > 0) {
		g_debug("AWeatherGui: set_update_timeout - %d min", freq);
		self->update_source = g_timeout_add_seconds(freq*60,
				(GSourceFunc)on_update_timeout, self);
	}
}
Example #23
0
void
windows_hide_docks_cmd_callback (GtkAction *action,
                                 gpointer   data)
{
  gboolean  active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
  Gimp     *gimp;
  return_if_no_gimp (gimp, data);

  if (GIMP_GUI_CONFIG (gimp->config)->hide_docks == active)
    return;

  g_object_set (gimp->config,
                "hide-docks", active,
                NULL);
}
Example #24
0
static void
charset_combo_box_notify_charset_cb (ECharsetComboBox *combo_box)
{
	GtkToggleAction *action;

	action = GTK_TOGGLE_ACTION (combo_box->priv->other_action);
	if (!gtk_toggle_action_get_active (action))
		return;

	if (combo_box->priv->block_dialog)
		return;

	/* "Other" action was selected by user. */
	charset_combo_box_run_dialog (combo_box);
}
Example #25
0
void
quick_mask_toggle_cmd_callback (GtkAction *action,
                                gpointer   data)
{
  GimpImage *image;
  gboolean   active;
  return_if_no_image (image, data);

  active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));

  if (active != gimp_image_get_quick_mask_state (image))
    {
      gimp_image_set_quick_mask_state (image, active);
      gimp_image_flush (image);
    }
}
Example #26
0
static void
main_window_view_show_offline_cb (GtkToggleAction   *action,
				  EmpathyMainWindow *window)
{
	gboolean current;

	current = gtk_toggle_action_get_active (action);
	empathy_conf_set_bool (empathy_conf_get (),
			      EMPATHY_PREFS_CONTACTS_SHOW_OFFLINE,
			      current);

	/* Turn off sound just while we alter the contact list. */
	// FIXME: empathy_sound_set_enabled (FALSE);
	empathy_contact_list_store_set_show_offline (window->list_store, current);
	//empathy_sound_set_enabled (TRUE);
}
Example #27
0
void
view_zoom_other_cmd_callback (GtkAction *action,
                              gpointer   data)
{
  GimpDisplayShell *shell;
  return_if_no_shell (shell, data);

  /* check if we are activated by the user or from
   * view_actions_set_zoom()
   */
  if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) &&
      shell->other_scale != gimp_zoom_model_get_factor (shell->zoom))
    {
      gimp_display_shell_scale_dialog (shell);
    }
}
Example #28
0
void
dock_toggle_auto_cmd_callback (GtkAction *action,
                               gpointer   data)
{
  GtkWidget      *widget      = NULL;
  GimpDockWindow *dock_window = NULL;
  return_if_no_widget (widget, data);

  dock_window = dock_commands_get_dock_window_from_widget (widget);

  if (dock_window)
    {
      gboolean active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
      gimp_dock_window_set_auto_follow_active (dock_window, active);
    }
}
Example #29
0
static void
galeon_encoding_menu_automatic_cb (GtkAction *action, GaleonEncodingMenu *menu)
{
	GaleonEmbed *embed;

	if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) == FALSE
	    || menu->priv->update_tag)
	{
		return;
	}

	embed = galeon_window_get_active_embed (menu->priv->window);

	/* setting "" will clear the forced encoding */
	galeon_embed_set_encoding (embed, "");
}
Example #30
0
static void _set_page_opts(GtkToggleAction *action)
{
	char *tmp;
	if (action)
		working_sview_config.save_page_opts
			= gtk_toggle_action_get_active(action);
	if (working_sview_config.save_page_opts)
		tmp = g_strdup_printf("Save Page Options now ON");
	else
		tmp = g_strdup_printf("Save Page Options now OFF");

	refresh_main(NULL, NULL);
	display_edit_note(tmp);
	g_free(tmp);
	return;
}