gnome-main-menu r535 - in trunk: . libslab main-menu/etc main-menu/src po



Author: sreeves
Date: Wed Dec 31 19:23:54 2008
New Revision: 535
URL: http://svn.gnome.org/viewvc/gnome-main-menu?rev=535&view=rev

Log:
Fix system-items translation and redo entire flow

Added:
   trunk/main-menu/etc/gnome-session-logout.desktop
   trunk/main-menu/etc/gnome-session-shutdown.desktop
   trunk/main-menu/etc/system-items.xbel.in
Removed:
   trunk/main-menu/etc/gnome-session-kill.desktop
   trunk/main-menu/etc/system-items.xbel
Modified:
   trunk/ChangeLog
   trunk/libslab/bookmark-agent.c
   trunk/main-menu/etc/Makefile.am
   trunk/main-menu/etc/gnome-screensaver-lock.desktop
   trunk/main-menu/src/main-menu-migration.c
   trunk/main-menu/src/main-menu-migration.h
   trunk/main-menu/src/main-menu-ui.c
   trunk/main-menu/src/main-menu.c
   trunk/po/POTFILES.in

Modified: trunk/libslab/bookmark-agent.c
==============================================================================
--- trunk/libslab/bookmark-agent.c	(original)
+++ trunk/libslab/bookmark-agent.c	Wed Dec 31 19:23:54 2008
@@ -1038,8 +1038,6 @@
 
 	GnomeDesktopItem *ditem;
 	gchar *uri_new = NULL;
-	gchar *name;
-
 
 	ditem = libslab_gnome_desktop_item_new_from_unknown_id (uri);
 
@@ -1051,18 +1049,6 @@
 	if (! uri_new)
 		return;
 
-	name = g_bookmark_file_get_title (priv->store, uri, NULL);
-	if (! libslab_strcmp (name, "Help"))
-		g_bookmark_file_set_title (priv->store, uri, _("Help"));
-	else if (! libslab_strcmp (name, "Lock Screen"))
-		g_bookmark_file_set_title (priv->store, uri, _("Lock Screen"));
-	else if (! libslab_strcmp (name, "Logout"))
-		g_bookmark_file_set_title (priv->store, uri, _("Logout"));
-	else if (! libslab_strcmp (name, "Shutdown"))
-		g_bookmark_file_set_title (priv->store, uri, _("Shutdown"));
-
-	g_free (name);
-
 	if (libslab_strcmp (uri, uri_new))
 		g_bookmark_file_move_item (priv->store, uri, uri_new, NULL);
 

Modified: trunk/main-menu/etc/Makefile.am
==============================================================================
--- trunk/main-menu/etc/Makefile.am	(original)
+++ trunk/main-menu/etc/Makefile.am	Wed Dec 31 19:23:54 2008
@@ -10,11 +10,14 @@
 ui_DATA = GNOME_MainMenu_ContextMenu.xml
 
 desktopdir   = $(datadir)/applications
-desktop_DATA = gnome-screensaver-lock.desktop gnome-session-kill.desktop trigger-panel-run-dialog.desktop
+desktop_DATA = gnome-screensaver-lock.desktop gnome-session-logout.desktop gnome-session-shutdown.desktop trigger-panel-run-dialog.desktop
 @INTLTOOL_DESKTOP_RULE@
 
 bookmarkdir = $(datadir)/gnome-main-menu
-bookmark_DATA = applications.xbel documents.xbel system-items.xbel places.xbel empty.ots empty.ott
+bookmark_DATA = applications.xbel documents.xbel places.xbel empty.ots empty.ott
+
+systemitemsdir = $(datadir)/gnome-main-menu
+systemitems_DATA = system-items.xbel
 
 $(server_DATA).in: $(server_DATA).in.in
 	sed -e "s|\ LIBEXECDIR\@|$(libexecdir)|" $< > $@
@@ -22,6 +25,9 @@
 $(schemas_DATA).in: $(schemas_DATA).in.in
 	sed -e "s|\ DATADIR\@|$(datadir)|g" $< > $@
 
+$(systemitems_DATA): $(systemitems_DATA).in
+	sed -e "s|_title>|title>|g" $< > $@
+
 install-data-local:
 	if test -z "$(DESTDIR)" ; then \
 		for p in $(schemas_DATA) ; do \
@@ -29,6 +35,6 @@
 		done \
 	fi
 
-EXTRA_DIST = $(server_DATA).in.in $(schemas_DATA).in.in $(ui_DATA) $(desktop_DATA) $(bookmark_DATA)
+EXTRA_DIST = $(server_DATA).in.in $(schemas_DATA).in.in $(ui_DATA) $(desktop_DATA) $(bookmark_DATA) $(systemitems_DATA).in
 
-CLEANFILES = $(server_DATA) $(schemas_DATA) $(server_DATA).in $(schemas_DATA).in
+CLEANFILES = $(server_DATA) $(schemas_DATA) $(server_DATA).in $(schemas_DATA).in $(systemitems_DATA)

Modified: trunk/main-menu/etc/gnome-screensaver-lock.desktop
==============================================================================
--- trunk/main-menu/etc/gnome-screensaver-lock.desktop	(original)
+++ trunk/main-menu/etc/gnome-screensaver-lock.desktop	Wed Dec 31 19:23:54 2008
@@ -8,3 +8,5 @@
 Type=Application
 Categories=GNOME;Application;System
 OnlyShowIn=GNOME;
+Hidden=true
+

Added: trunk/main-menu/etc/gnome-session-logout.desktop
==============================================================================
--- (empty file)
+++ trunk/main-menu/etc/gnome-session-logout.desktop	Wed Dec 31 19:23:54 2008
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Session Logout Dialog
+Comment=Prompt the user to log out of their session
+Exec=gnome-session-save --logout-dialog
+Terminal=false
+Type=Application
+Icon=system-log-out
+Hidden=true
+Categories=System;SystemSetup;
+OnlyShowIn=GNOME;

Added: trunk/main-menu/etc/gnome-session-shutdown.desktop
==============================================================================
--- (empty file)
+++ trunk/main-menu/etc/gnome-session-shutdown.desktop	Wed Dec 31 19:23:54 2008
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=System Shutdown Dialog
+Comment=Prompt the user to shutdown their computer
+Exec=gnome-session-save --shutdown-dialog
+Terminal=false
+Type=Application
+Icon=system-shutdown
+Hidden=true
+Categories=System;SystemSetup;
+OnlyShowIn=GNOME;

Added: trunk/main-menu/etc/system-items.xbel.in
==============================================================================
--- (empty file)
+++ trunk/main-menu/etc/system-items.xbel.in	Wed Dec 31 19:23:54 2008
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xbel version="1.0"
+      xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks";
+      xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info";
+>
+  <bookmark href="yelp.desktop" added="2007-01-16T05:53:36Z" modified="2007-01-16T05:53:36Z" visited="2007-01-16T05:53:36Z">
+    <_title>Help</_title>
+    <info>
+      <metadata owner="http://freedesktop.org";>
+        <mime:mime-type type="application/x-desktop"/>
+        <bookmark:groups>
+          <bookmark:group>rank-0</bookmark:group>
+        </bookmark:groups>
+        <bookmark:applications>
+          <bookmark:application name="Yelp" exec="yelp" timestamp="1168926816" count="1"/>
+        </bookmark:applications>
+      </metadata>
+    </info>
+  </bookmark>
+  <bookmark href="gnomecc.desktop" added="2007-01-16T05:53:36Z" modified="2007-01-16T05:53:36Z" visited="2007-01-16T05:53:36Z">
+    <info>
+      <metadata owner="http://freedesktop.org";>
+        <mime:mime-type type="application/x-desktop"/>
+        <bookmark:groups>
+          <bookmark:group>rank-1</bookmark:group>
+        </bookmark:groups>
+        <bookmark:applications>
+          <bookmark:application name="Control Center" exec="/opt/gnome/bin/control-center" timestamp="1168926816" count="1"/>
+        </bookmark:applications>
+      </metadata>
+    </info>
+  </bookmark>
+  <bookmark href="YaST.desktop" added="2008-06-04T15:58:58Z" modified="2008-06-04T15:58:58Z" visited="2008-06-04T15:58:58Z">
+    <info>
+      <metadata owner="http://freedesktop.org";>
+        <mime:mime-type type="application/x-desktop"/>
+        <bookmark:groups>
+          <bookmark:group>rank-2</bookmark:group>
+        </bookmark:groups>
+        <bookmark:applications>
+          <bookmark:application name="YaST" exec="gnomesu -c /sbin/yast2" timestamp="1212587938" count="1"/>
+        </bookmark:applications>
+      </metadata>
+    </info>
+  </bookmark>
+  <bookmark href="package-manager.desktop" added="2007-01-16T05:53:36Z" modified="2007-01-16T05:53:36Z" visited="2007-01-16T05:53:36Z">
+    <info>
+      <metadata owner="http://freedesktop.org";>
+        <mime:mime-type type="application/x-desktop"/>
+        <bookmark:groups>
+          <bookmark:group>rank-3</bookmark:group>
+        </bookmark:groups>
+        <bookmark:applications>
+          <bookmark:application name="Install Software" exec="package-manager %F" timestamp="1168926816" count="1"/>
+        </bookmark:applications>
+      </metadata>
+    </info>
+  </bookmark>
+  <bookmark href="gnome-screensaver-lock.desktop" added="2007-01-16T05:53:36Z" modified="2007-01-16T05:53:36Z" visited="2007-01-16T05:53:36Z">
+    <_title>Lock Screen</_title>
+    <info>
+      <metadata owner="http://freedesktop.org";>
+        <mime:mime-type type="application/x-desktop"/>
+        <bookmark:groups>
+          <bookmark:group>rank-4</bookmark:group>
+        </bookmark:groups>
+        <bookmark:applications>
+          <bookmark:application name="Lock Screen" exec="gnome-screensaver-command --lock" timestamp="1168926816" count="1"/>
+        </bookmark:applications>
+      </metadata>
+    </info>
+  </bookmark>
+  <bookmark href="gnome-session-logout.desktop" added="2007-01-16T05:53:36Z" modified="2007-01-16T05:53:36Z" visited="2007-01-16T05:53:36Z">
+    <_title>Logout</_title>
+    <info>
+      <metadata owner="http://freedesktop.org";>
+        <mime:mime-type type="application/x-desktop"/>
+        <bookmark:groups>
+          <bookmark:group>rank-5</bookmark:group>
+        </bookmark:groups>
+        <bookmark:applications>
+          <bookmark:application name="Session Logout Dialog" exec="gnome-session-save" timestamp="1168926816" count="1"/>
+        </bookmark:applications>
+      </metadata>
+    </info>
+  </bookmark>
+  <bookmark href="gnome-session-shutdown.desktop" added="2007-01-16T05:53:36Z" modified="2007-01-16T05:53:36Z" visited="2007-01-16T05:53:36Z">
+    <_title>Shutdown</_title>
+    <info>
+      <metadata owner="http://freedesktop.org";>
+        <mime:mime-type type="application/x-desktop"/>
+        <bookmark:groups>
+          <bookmark:group>rank-6</bookmark:group>
+        </bookmark:groups>
+        <bookmark:applications>
+          <bookmark:application name="Session Shutdown Dialog" exec="gnome-session-save" timestamp="1168926816" count="1"/>
+        </bookmark:applications>
+      </metadata>
+    </info>
+  </bookmark>
+</xbel>

Modified: trunk/main-menu/src/main-menu-migration.c
==============================================================================
--- trunk/main-menu/src/main-menu-migration.c	(original)
+++ trunk/main-menu/src/main-menu-migration.c	Wed Dec 31 19:23:54 2008
@@ -37,6 +37,7 @@
 #include "libslab-utils.h"
 
 #define SYSTEM_BOOKMARK_FILENAME "system-items.xbel"
+#define SYSTEM_BOOKMARK_MIGRATED_TO_NEW_SET "system-items.migrated"
 #define APPS_BOOKMARK_FILENAME   "applications.xbel"
 
 #define SYSTEM_ITEM_GCONF_KEY    "/desktop/gnome/applications/main-menu/system-area/system_item_list"
@@ -50,6 +51,43 @@
 #define LOGOUT_DESKTOP_ITEM      "gnome-session-kill.desktop"
 
 void
+move_system_area_to_new_set ()
+{
+	/* for libslab 0.9.12 start with the new default system area because
+	* 1. We have significantly changed the default set and want these new values to show up
+	* 2. bug (BNC #447550) caused translated title entry to overwrite valid one
+		 causing errors and a customized file when user did not explicitly want it
+	* 3. bug in the default system-items.xbel ranking also caused a customized file
+	     again without the user explicitly wanting one.
+	*/
+	gchar * filename;
+	GFile *file;
+	GFileOutputStream *filestream;
+
+	filename = g_build_filename (
+		g_get_user_data_dir (), PACKAGE, SYSTEM_BOOKMARK_MIGRATED_TO_NEW_SET, NULL);
+	if (! g_file_test (filename, G_FILE_TEST_EXISTS))
+	{
+		file = g_file_new_for_path (filename);
+		filestream = g_file_create (file, G_FILE_CREATE_NONE, NULL, NULL);
+		if (filestream)
+			g_object_unref (filestream);
+		g_object_unref (file);
+		g_free (filename);
+		
+		filename = g_build_filename (
+			g_get_user_data_dir (), PACKAGE, SYSTEM_BOOKMARK_FILENAME, NULL);
+		if (g_file_test (filename, G_FILE_TEST_EXISTS))
+		{
+			file = g_file_new_for_path (filename);
+			g_file_delete (file, NULL, NULL);
+			g_object_unref (file);
+		}
+	}
+	g_free (filename);
+}
+
+void
 migrate_system_gconf_to_bookmark_file ()
 {
 	BookmarkAgent        *agent;

Modified: trunk/main-menu/src/main-menu-migration.h
==============================================================================
--- trunk/main-menu/src/main-menu-migration.h	(original)
+++ trunk/main-menu/src/main-menu-migration.h	Wed Dec 31 19:23:54 2008
@@ -25,6 +25,7 @@
 
 G_BEGIN_DECLS
 
+void move_system_area_to_new_set (void);
 void migrate_system_gconf_to_bookmark_file    (void);
 void migrate_user_apps_gconf_to_bookmark_file (void);
 void migrate_showable_file_types              (void);

Modified: trunk/main-menu/src/main-menu-ui.c
==============================================================================
--- trunk/main-menu/src/main-menu-ui.c	(original)
+++ trunk/main-menu/src/main-menu-ui.c	Wed Dec 31 19:23:54 2008
@@ -1130,13 +1130,17 @@
 {
 	Tile  *tile;
 	gchar *basename;
-
+	gchar *translated_title;
 
 	if (app_is_in_blacklist (item->uri))
 		return NULL;
+	
+	translated_title = item->title ? _(item->title) : NULL;
 
-	tile = TILE (system_tile_new (item->uri, item->title));
+	tile = TILE (system_tile_new (item->uri, translated_title));
 
+	/* with 0.9.12 we start with clean system area - see move_system_area_to_new_set
+	   no longer need this code to clean up old junk
 	if (tile)
 		return tile;
 
@@ -1147,9 +1151,10 @@
 		basename = item->uri;
 
 	if (! libslab_strcmp (basename, "control-center.desktop"))
-		tile = TILE (system_tile_new ("gnomecc.desktop", item->title));
+		tile = TILE (system_tile_new ("gnomecc.desktop", translated_title));
 	else if (! libslab_strcmp (basename, "zen-installer.desktop"))
-		tile = TILE (system_tile_new ("package-manager.desktop", item->title));
+		tile = TILE (system_tile_new ("package-manager.desktop", translated_title));
+	*/
 
 	return tile;
 }

Modified: trunk/main-menu/src/main-menu.c
==============================================================================
--- trunk/main-menu/src/main-menu.c	(original)
+++ trunk/main-menu/src/main-menu.c	Wed Dec 31 19:23:54 2008
@@ -67,7 +67,8 @@
 	gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, 1, argv, NULL, NULL);
 
 	libslab_checkpoint ("Migrating old configurations");
-	migrate_system_gconf_to_bookmark_file    ();
+	move_system_area_to_new_set ();
+	//migrate_system_gconf_to_bookmark_file    ();
 	migrate_user_apps_gconf_to_bookmark_file ();
 	migrate_showable_file_types              ();
 

Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in	(original)
+++ trunk/po/POTFILES.in	Wed Dec 31 19:23:54 2008
@@ -13,7 +13,6 @@
 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
@@ -21,3 +20,4 @@
 main-menu/src/network-status-tile.c
 main-menu/src/slab-window.glade
 nautilus-main-menu/nautilus-main-menu.c
+[type: gettext/xml] main-menu/etc/system-items.xbel.in



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]