Ejemplo n.º 1
0
void panel_menu_bar_create(PanelToplevel* toplevel, int position)
{
	char* id;

	id = panel_profile_prepare_object(PANEL_OBJECT_MENU_BAR, toplevel, position, FALSE);
	panel_profile_add_to_list(PANEL_GSETTINGS_OBJECTS, id);
	g_free(id);
}
gboolean
panel_menu_button_create (PanelToplevel *toplevel,
			  int            position,
			  const char    *filename,
			  const char    *menu_path,
			  gboolean       use_menu_path,
			  const char    *tooltip)
{
	MateConfClient *client;
	const char  *scheme;
	const char  *key;
	char        *id;

	client  = panel_mateconf_get_client ();

	id = panel_profile_prepare_object (PANEL_OBJECT_MENU, toplevel, position, FALSE);

	key = panel_mateconf_full_key (PANEL_MATECONF_OBJECTS, id, "use_menu_path");
	mateconf_client_set_bool (client, key, use_menu_path, NULL);

	scheme = panel_menu_filename_to_scheme (filename);

	if (filename && !scheme) {
		g_warning ("Failed to find menu scheme for %s\n", filename);
		g_free (id);
		return FALSE;
	}

	if (use_menu_path && menu_path && menu_path [0] && scheme) {
		char       *menu_uri;

		menu_uri = g_strconcat (scheme, ":", menu_path, NULL);

		key = panel_mateconf_full_key (PANEL_MATECONF_OBJECTS, id, "menu_path");
		mateconf_client_set_string (client, key, menu_uri, NULL);

		g_free (menu_uri);
	}

	if (tooltip && tooltip [0]) {
		key = panel_mateconf_full_key (PANEL_MATECONF_OBJECTS, id, "tooltip");
		mateconf_client_set_string (client, key, tooltip, NULL);
	}

	panel_profile_add_to_list (PANEL_MATECONF_OBJECTS, id);
	g_free (id);

	return TRUE;
}
Ejemplo n.º 3
0
gboolean
panel_menu_button_create (PanelToplevel *toplevel,
			  int            position,
			  const char    *filename,
			  const char    *menu_path,
			  gboolean       use_menu_path,
			  const char    *tooltip)
{
	GSettings   *settings;
	gchar       *path;
	const char  *scheme;
	char        *id;

	id = panel_profile_prepare_object (PANEL_OBJECT_MENU, toplevel, position, FALSE);

	path = g_strdup_printf (PANEL_OBJECT_PATH "%s/", id);
	settings = g_settings_new_with_path (PANEL_OBJECT_SCHEMA, path);

	g_settings_set_boolean (settings, PANEL_OBJECT_USE_MENU_PATH_KEY, use_menu_path);

	scheme = panel_menu_filename_to_scheme (filename);

	if (filename && !scheme) {
		g_warning ("Failed to find menu scheme for %s\n", filename);
		g_free (id);
		g_free (path);
		g_object_unref (settings);
		return FALSE;
	}

	if (use_menu_path && menu_path && menu_path [0] && scheme) {
		char *menu_uri;
		menu_uri = g_strconcat (scheme, ":", menu_path, NULL);
		g_settings_set_string (settings, PANEL_OBJECT_MENU_PATH_KEY, menu_uri);
		g_free (menu_uri);
	}

	if (tooltip && tooltip [0]) {
		g_settings_set_string (settings, PANEL_OBJECT_TOOLTIP_KEY, tooltip);
	}

	panel_profile_add_to_list (PANEL_GSETTINGS_OBJECTS, id);
	g_free (id);
	g_free (path);
	g_object_unref (settings);

	return TRUE;
}
Ejemplo n.º 4
0
void
panel_drawer_create (PanelToplevel *toplevel,
                     int            position,
                     GIcon         *custom_icon,
                     gboolean       use_custom_icon,
                     const char    *tooltip)
{
    char *id;

    id = panel_profile_prepare_object (PANEL_OBJECT_DRAWER, toplevel, position, FALSE);

    panel_drawer_prepare (id, custom_icon, use_custom_icon, tooltip, NULL);

    panel_profile_add_to_list (PANEL_GSETTINGS_OBJECTS, id);

    g_free (id);
}
void
panel_action_button_create (PanelToplevel         *toplevel,
			    int                    position,
			    PanelActionButtonType  type)
{
	MateConfClient *client;
	const char  *key;
	char        *id;

	client  = panel_mateconf_get_client ();

	id = panel_profile_prepare_object (PANEL_OBJECT_ACTION, toplevel, position, FALSE);

	key = panel_mateconf_full_key (PANEL_MATECONF_OBJECTS, id, "action_type");
	mateconf_client_set_string (client,
				 key,
				 mateconf_enum_to_string (panel_action_type_map, type),
				 NULL);

	panel_profile_add_to_list (PANEL_MATECONF_OBJECTS, id);

	g_free (id);
}
Ejemplo n.º 6
0
void
panel_action_button_create (PanelToplevel         *toplevel,
			    int                    position,
			    PanelActionButtonType  type)
{
	GSettings   *settings;
	char        *id;
	char        *path;

	id = panel_profile_prepare_object (PANEL_OBJECT_ACTION, toplevel, position, FALSE);

	path = g_strdup_printf (PANEL_OBJECT_PATH "%s/", id);
	settings = g_settings_new_with_path (PANEL_OBJECT_SCHEMA, path);

	g_settings_set_enum (settings,
						 PANEL_OBJECT_ACTION_TYPE_KEY,
						 type);

	panel_profile_add_to_list (PANEL_GSETTINGS_OBJECTS, id);

	g_free (id);
	g_free (path);
	g_object_unref (settings);
}