Commit c831aa63 authored by Scott Reeves's avatar Scott Reeves

Add proper categories to .desktop files and actually remove

control-center dirs

svn path=/trunk/; revision=273
parent 908ac7d7
2007-05-08 Scott Reeves <sreeves@novell.com>
* control-center/
* main-menu/etc/gnome-*.desktop:
Actually remove control-center dir.
Add proper categories to .desktop files
2007-04-09 Scott Reeves <sreeves@novell.com>
* configure.in
* main-menu/etc/system-items.xbel
......
control-center.desktop
control-center.desktop.in
Makefile
Makefile.in
control-center.schemas
desktopdir = $(datadir)/applications
desktop_DATA = control-center.desktop
@INTLTOOL_DESKTOP_RULE@
schemasdir = @GCONF_SCHEMA_FILE_DIR@
schemas_DATA = control-center.schemas
@INTLTOOL_SCHEMAS_RULE@
$(desktop_DATA).in: $(desktop_DATA).in.in
sed -e "s|\@BINDIR\@|$(bindir)|" $< > $@
install-data-local:
if test -z "$(DESTDIR)" ; then \
for p in $(schemas_DATA) ; do \
GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $$p; \
done \
fi
EXTRA_DIST = $(desktop_DATA).in.in $(schemas_DATA).in
CLEANFILES = $(desktop_DATA) $(schemas_DATA) $(desktop_DATA).in
[Desktop Entry]
X-SuSE-translate=true
_Name=Control Center
Icon=gnome-control-center
Exec=@BINDIR@/control-center
Terminal=false
Type=Application
StartupNotify=true
Encoding=UTF-8
Categories=GNOME;Application;Settings;
OnlyShowIn=GNOME;
<gconfschemafile>
<schemalist>
<schema>
<key>/schemas/desktop/gnome/applications/main-menu/cc_actions_list</key>
<applyto>/desktop/gnome/applications/main-menu/cc_actions_list</applyto>
<owner>control-center</owner>
<type>list</type>
<list_type>string</list_type>
<locale name="C">
<default><!-- Translators: The format of this string is the task name to be displayed (translate that part) followed by a ";" separator then the filename (DONT translate the file name) of a .desktop file to launch. Multiple entries are separated by a "," -->[Change Desktop Background;background.desktop,Add Printer;gnome-cups-manager.desktop,Configure Network;YaST2/lan.desktop,Change Password;gnome-passwd.desktop,Add User;YaST2/users.desktop,Open Administrator Settings;YaST.desktop]</default>
<short>Task names and associated .desktop files</short>
<long>The task name to be displayed in the control-center (thus needing to be translated) followed by a ";" separator then the filename of an associated .desktop file to launch for that task.</long>
</locale>
</schema>
<schema>
<key>/schemas/desktop/gnome/applications/main-menu/cc_exit_shell_on_static_action</key>
<applyto>/desktop/gnome/applications/main-menu/cc_exit_shell_on_static_action</applyto>
<owner>control-center</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Close the control-center when a task is activated</short>
<long>if true, the control-center will close when a "Common Task" is activated</long>
</locale>
</schema>
<schema>
<key>/schemas/desktop/gnome/applications/main-menu/cc_exit_shell_on_action_start</key>
<applyto>/desktop/gnome/applications/main-menu/cc_exit_shell_on_action_start</applyto>
<owner>control-center</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Exit shell on start action performed</short>
<long>Indicates whether to close the shell when a start action is performed</long>
</locale>
</schema>
<schema>
<key>/schemas/desktop/gnome/applications/main-menu/cc_exit_shell_on_action_help</key>
<applyto>/desktop/gnome/applications/main-menu/cc_exit_shell_on_action_help</applyto>
<owner>control-center</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Exit shell on help action performed</short>
<long>Indicates whether to close the shell when a help action is performed</long>
</locale>
</schema>
<schema>
<key>/schemas/desktop/gnome/applications/main-menu/cc_exit_shell_on_action_add_remove</key>
<applyto>/desktop/gnome/applications/main-menu/cc_exit_shell_on_action_add_remove</applyto>
<owner>control-center</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Exit shell on add or remove action performed</short>
<long>Indicates whether to close the shell when an add or remove action is performed</long>
</locale>
</schema>
<schema>
<key>/schemas/desktop/gnome/applications/main-menu/cc_exit_shell_on_action_upgrade_uninstall</key>
<applyto>/desktop/gnome/applications/main-menu/cc_exit_shell_on_action_upgrade_uninstall</applyto>
<owner>control-center</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Exit shell on upgrade or uninstall action performed</short>
<long>Indicates whether to close the shell when an upgrade or uninstall action is performed</long>
</locale>
</schema>
</schemalist>
</gconfschemafile>
.deps
.libs
control-center
Makefile
Makefile.in
INCLUDES = \
$(CONTROL_CENTER_CFLAGS) \
-I$(top_srcdir)/libslab \
$(WARN_CFLAGS)
bin_PROGRAMS = control-center
control_center_SOURCES = \
control-center.c
control_center_LDADD = \
$(CONTROL_CENTER_LIBS) \
$(top_builddir)/libslab/libslab.la
AM_CPPFLAGS = \
-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
/*
* This file is part of the Control Center.
*
* Copyright (c) 2006 Novell, Inc.
*
* The Control Center is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* The Control Center is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* the Control Center; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include <gtk/gtkhbox.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkimage.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtktable.h>
#include <gtk/gtkbutton.h>
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkentry.h>
#include <panel-applet.h>
#include <libgnome/gnome-desktop-item.h>
#include <libgnomeui/libgnomeui.h>
#include <dirent.h>
#include "app-shell.h"
#include "app-shell-startup.h"
#include "slab-gnome-util.h"
void handle_static_action_clicked (Tile * tile, TileEvent * event, gpointer data);
static GSList *get_actions_list ();
#define CONTROL_CENTER_PREFIX "/desktop/gnome/applications/main-menu/cc_"
#define CONTROL_CENTER_ACTIONS_LIST_KEY (CONTROL_CENTER_PREFIX "actions_list")
#define CONTROL_CENTER_ACTIONS_SEPARATOR ";"
#define EXIT_SHELL_ON_STATIC_ACTION "exit_shell_on_static_action"
static GSList *
get_actions_list ()
{
GSList *l;
GSList *key_list;
GSList *actions_list = NULL;
AppAction *action;
key_list = get_slab_gconf_slist (CONTROL_CENTER_ACTIONS_LIST_KEY);
if (!key_list)
{
g_warning (_("key not found [%s]\n"), CONTROL_CENTER_ACTIONS_LIST_KEY);
return NULL;
}
for (l = key_list; l != NULL; l = l->next)
{
gchar *entry = (gchar *) l->data;
gchar **temp;
action = g_new (AppAction, 1);
temp = g_strsplit (entry, CONTROL_CENTER_ACTIONS_SEPARATOR, 2);
action->name = g_strdup (temp[0]);
if ((action->item = load_desktop_item_from_unknown (temp[1])) == NULL)
{
g_warning ("get_actions_list() - PROBLEM - Can't load %s\n", temp[1]);
}
else
{
actions_list = g_slist_prepend (actions_list, action);
}
g_strfreev (temp);
g_free (entry);
}
g_slist_free (key_list);
return g_slist_reverse (actions_list);
}
void
handle_static_action_clicked (Tile * tile, TileEvent * event, gpointer data)
{
if (event->type == TILE_EVENT_ACTIVATED_DOUBLE_CLICK)
return;
gchar *temp;
AppShellData *app_data = (AppShellData *) data;
GnomeDesktopItem *item =
(GnomeDesktopItem *) g_object_get_data (G_OBJECT (tile), APP_ACTION_KEY);
open_desktop_item_exec (item);
temp = g_strdup_printf("%s%s", app_data->gconf_prefix, EXIT_SHELL_ON_STATIC_ACTION);
if (get_slab_gconf_bool(temp))
{
if (app_data->exit_on_close)
gtk_main_quit ();
else
hide_shell (app_data);
}
g_free (temp);
}
int
main (int argc, char *argv[])
{
BonoboApplication *bonobo_app = NULL;
gboolean hidden = FALSE;
gchar * startup_id;
AppShellData *app_data;
GSList *actions;
GnomeProgram *program;
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
#endif
if (argc > 1)
{
if (argc != 2 || strcmp ("-h", argv[1]))
{
printf ("Usage - control-center [-h]\n");
printf ("Options: -h : hide on start\n");
printf ("\tUseful if you want to autostart the control-center singleton so it can get all it's slow loading done\n");
exit (1);
}
hidden = TRUE;
}
startup_id = g_strdup (g_getenv (DESKTOP_STARTUP_ID));
program = gnome_program_init ("GNOME Control Center", "0.1", LIBGNOMEUI_MODULE,
argc, argv, NULL, NULL);
if (apss_already_running (argc, argv, &bonobo_app, "GNOME-NLD-ControlCenter", startup_id))
{
gdk_notify_startup_complete ();
bonobo_debug_shutdown ();
g_free (startup_id);
exit (1);
}
app_data = appshelldata_new ("preferences.menu", NULL, CONTROL_CENTER_PREFIX,
GTK_ICON_SIZE_DND, FALSE, TRUE);
generate_categories (app_data);
actions = get_actions_list ();
layout_shell (app_data, _("Filter"), _("Groups"), _("Common Tasks"), actions,
handle_static_action_clicked);
g_signal_connect (bonobo_app, "new-instance", G_CALLBACK (apss_new_instance_cb), app_data);
create_main_window (app_data, "MyControlCenter", _("Control Center"),
"gnome-control-center", 975, 600, hidden);
if (bonobo_app)
bonobo_object_unref (bonobo_app);
bonobo_debug_shutdown ();
g_free (startup_id);
return 0;
};
......@@ -6,5 +6,5 @@ Icon=gnome-lockscreen
Exec=gnome-screensaver-command --lock
Terminal=false
Type=Application
Categories=GNOME;Application;
Categories=GNOME;Application;System
OnlyShowIn=GNOME;
......@@ -6,5 +6,5 @@ Icon=gnome-logout
Exec=gnome-session-save --kill
Terminal=false
Type=Application
Categories=GNOME;Application;
Categories=GNOME;Application;System
OnlyShowIn=GNOME;
......@@ -3,9 +3,6 @@
application-browser/etc/application-browser.desktop.in.in
application-browser/etc/application-browser.schemas.in
application-browser/src/application-browser.c
control-center/etc/control-center.desktop.in.in
control-center/etc/control-center.schemas.in
control-center/src/control-center.c
libslab/application-tile.c
libslab/app-shell.c
libslab/bookmark-agent.c
......@@ -18,6 +15,7 @@ libslab/system-tile.c
main-menu/etc/GNOME_MainMenu.server.in.in
main-menu/etc/GNOME_MainMenu_ContextMenu.xml
main-menu/etc/gnome-screensaver-lock.desktop
main-menu/etc/gnome-session-kill.desktop
main-menu/etc/slab.schemas.in.in
main-menu/src/hard-drive-status-tile.c
main-menu/src/main-menu-migration.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment