Slab

Attachment 'places.patch'

Download

   1 diff -urN slab-vanilla/main-menu/etc/slab.schemas.in.in slab/main-menu/etc/slab.schemas.in.in
   2 --- slab-vanilla/main-menu/etc/slab.schemas.in.in	2006-07-12 11:27:07.000000000 -0400
   3 +++ slab/main-menu/etc/slab.schemas.in.in	2006-07-12 13:49:36.000000000 -0400
   4 @@ -14,6 +14,19 @@
   5  		</schema>
   6  
   7  		<schema>
   8 +			<key>/schemas/desktop/gnome/applications/main-menu/file-area/places</key>
   9 +			<applyto>/desktop/gnome/applications/main-menu/file-area/places</applyto>
  10 +			<owner>gnome-main-menu</owner>
  11 +			<type>list</type>
  12 +			<list_type>string</list_type>
  13 +			<default>[nautilus-computer.desktop,nautilus-home.desktop,network-scheme.desktop,nautilus-cd-burner.desktop,beagle-search.desktop]</default>
  14 +			<locale name="C">
  15 +				<short>.desktop files for "Places"</short>
  16 +				<long>.desktop files for "Places"</long>
  17 +			</locale>
  18 +		</schema>
  19 +
  20 +		<schema>
  21  			<key>/schemas/desktop/gnome/applications/main-menu/uninstall_package_command</key>
  22  			<applyto>/desktop/gnome/applications/main-menu/uninstall_package_command</applyto>
  23  			<owner>gnome-main-menu</owner>
  24 diff -urN slab-vanilla/main-menu/src/file-area-widget.c slab/main-menu/src/file-area-widget.c
  25 --- slab-vanilla/main-menu/src/file-area-widget.c	2006-07-12 11:27:07.000000000 -0400
  26 +++ slab/main-menu/src/file-area-widget.c	2006-07-12 13:40:24.000000000 -0400
  27 @@ -43,6 +43,7 @@
  28  #define APP_BROWSER_GCONF_KEY      MAIN_MENU_GCONF_DIR "/application_browser"
  29  #define FILE_CLASS_GCONF_KEY       FILE_AREA_GCONF_DIR "/file_class"
  30  #define USER_SPEC_APPS_GCONF_KEY   FILE_AREA_GCONF_DIR "/user_specified_apps"
  31 +#define PLACES_GCONF_KEY  	   FILE_AREA_GCONF_DIR "/places"
  32  #define ITEM_LIMIT_GCONF_KEY       FILE_AREA_GCONF_DIR "/item_limit"
  33  #define AB_LINK_VISIBLE_GCONF_KEY  LOCK_DOWN_GCONF_DIR "/application_browser_link_visible"
  34  #define SHOWABLE_TYPES_GCONF_KEY   LOCK_DOWN_GCONF_DIR "/showable_file_types"
  35 @@ -94,10 +95,6 @@
  36       static void tile_action_triggered_cb (Tile *, TileEvent *, TileAction *,
  37  					   gpointer);
  38  
  39 -     static void recent_apps_store_monitor_cb (GnomeVFSMonitorHandle *,
  40 -					       const gchar *, const gchar *,
  41 -					       GnomeVFSMonitorEventType,
  42 -					       gpointer);
  43       static void recent_files_store_monitor_cb (GnomeVFSMonitorHandle *,
  44  						const gchar *, const gchar *,
  45  						GnomeVFSMonitorEventType,
  46 @@ -109,7 +106,8 @@
  47  					  TileTableURIAddedEvent *, gpointer);
  48       static void tile_table_n_rows_notify_cb (GObject *, GParamSpec *,
  49  					      gpointer);
  50 -
  51 +     static void places_gconf_notify_cb (GConfClient *, guint,
  52 +						 GConfEntry *, gpointer);
  53       static void user_spec_apps_gconf_notify_cb (GConfClient *, guint,
  54  						 GConfEntry *, gpointer);
  55  
  56 @@ -232,25 +230,32 @@
  57  				break;
  58  
  59  			case RECENTLY_USED_APPS:
  60 -				markup = _("Recently Used Applications");
  61 +				markup = _("Places");
  62  
  63 -				filename =
  64 -					g_build_filename (g_get_home_dir (),
  65 -							  RECENT_APPS_FILE_PATH,
  66 -							  NULL);
  67 +				connect_gconf_notify
  68 +					(PLACES_GCONF_KEY,
  69 +					 places_gconf_notify_cb,
  70 +					 this);
  71  
  72 -				uri = gnome_vfs_get_uri_from_local_path
  73 -					(filename);
  74 +				g_signal_connect (G_OBJECT (table),
  75 +						  "tile-table-update",
  76 +						  G_CALLBACK
  77 +						  (tile_table_update_cb),
  78 +						  this);
  79  
  80 -				gnome_vfs_monitor_add (&handle,
  81 -						       uri,
  82 -						       GNOME_VFS_MONITOR_FILE,
  83 -						       recent_apps_store_monitor_cb,
  84 -						       this);
  85 +				g_signal_connect (G_OBJECT (table),
  86 +						  "tile-table-uri-added",
  87 +						  G_CALLBACK
  88 +						  (tile_table_uri_added_cb),
  89 +						  this);
  90  
  91 -				g_free (filename);
  92 -				g_free (uri);
  93 +				g_signal_connect (G_OBJECT (table),
  94 +						  "notify::n-rows",
  95 +						  G_CALLBACK
  96 +						  (tile_table_n_rows_notify_cb),
  97 +						  this);
  98  				break;
  99 +				
 100  
 101  			case RECENT_FILES:
 102  				markup = _("Recent Documents");
 103 @@ -515,42 +520,35 @@
 104  	}
 105  
 106  	else if (file_class == RECENTLY_USED_APPS) {
 107 -		files = get_recent_files (RECENT_APPS_FILE_PATH);
 108 +		files = get_gconf_value (PLACES_GCONF_KEY);
 109  
 110  		for (node = files; node; node = node->next) {
 111 -			desktop_item_url =
 112 -				egg_recent_item_get_uri ((EggRecentItem *)
 113 -							 node->data);
 114 -
 115 -			if (!application_is_blacklisted (desktop_item_url)) {
 116 -				tile = application_tile_new
 117 -					(desktop_item_url);
 118 -
 119 -				if (disable_term) {
 120 -					item = application_tile_get_desktop_item (APPLICATION_TILE (tile));
 121 -					categories =
 122 -						gnome_desktop_item_get_string
 123 -						(item,
 124 -						 GNOME_DESKTOP_ITEM_CATEGORIES);
 125 -
 126 -					if (strstr
 127 -					    (categories,
 128 -					     DESKTOP_ITEM_TERMINAL_EMULATOR_FLAG))
 129 -					{
 130 -						gtk_widget_destroy (tile);
 131 -						tile = NULL;
 132 -					}
 133 -				}
 134 +			tile = application_tile_new ((gchar *) node->data);
 135 +
 136 +			if (disable_term) {
 137 +				item = application_tile_get_desktop_item
 138 +					(APPLICATION_TILE (tile));
 139 +				categories =
 140 +					gnome_desktop_item_get_string (item,
 141 +								       GNOME_DESKTOP_ITEM_CATEGORIES);
 142  
 143 -				if (tile)
 144 -					tiles = g_list_append (tiles, tile);
 145 +				if (strstr
 146 +				    (categories,
 147 +				     DESKTOP_ITEM_TERMINAL_EMULATOR_FLAG)) {
 148 +					gtk_widget_destroy (tile);
 149 +					tile = NULL;
 150 +				}
 151  			}
 152  
 153 -			g_free (desktop_item_url);
 154 -			egg_recent_item_unref (node->data);
 155 +			if (tile)
 156 +				tiles = g_list_append (tiles, tile);
 157 +
 158 +			g_free (node->data);
 159  		}
 160  	}
 161  
 162 +
 163 +
 164  	else {
 165  		files = get_recent_files (RECENT_FILES_FILE_PATH);
 166  
 167 @@ -743,15 +741,7 @@
 168  		main_menu_ui_close (priv->ui, FALSE);
 169  }
 170  
 171 -static void
 172 -recent_apps_store_monitor_cb (GnomeVFSMonitorHandle * handle,
 173 -			      const gchar * monitor_uri,
 174 -			      const gchar * info_uri,
 175 -			      GnomeVFSMonitorEventType type,
 176 -			      gpointer user_data)
 177 -{
 178 -	update_table (FILE_AREA_WIDGET (user_data), RECENTLY_USED_APPS);
 179 -}
 180 +
 181  
 182  static void
 183  recent_files_store_monitor_cb (GnomeVFSMonitorHandle * handle,
 184 @@ -864,3 +854,9 @@
 185  {
 186  	update_table (FILE_AREA_WIDGET (user_data), USER_SPECIFIED_APPS);
 187  }
 188 +static void
 189 +places_gconf_notify_cb (GConfClient * client, guint conn_id,
 190 +				GConfEntry * entry, gpointer user_data)
 191 +{
 192 +	update_table (FILE_AREA_WIDGET (user_data), RECENTLY_USED_APPS);
 193 +}
 194 

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2006-07-11 18:24:40, 434.0 KB) [[attachment:appbrowser.png]]
  • [get | view] (2006-07-11 18:25:42, 449.9 KB) [[attachment:controlcenter.png]]
  • [get | view] (2006-07-11 18:25:51, 109.8 KB) [[attachment:mainmenu.png]]
  • [get | view] (2006-07-22 17:54:50, 119.8 KB) [[attachment:missing icon table.jpg]]
  • [get | view] (2006-07-19 19:31:53, 5.9 KB) [[attachment:places.patch]]
  • [get | view] (2006-10-06 06:28:48, 445.0 KB) [[attachment:uslabbeta3.1.tar.bz2]]
  • [get | view] (2006-07-19 14:12:34, 627.0 KB) [[attachment:uslabbeta3.tar.gz]]
 All files | Selected Files: delete move to page

You are not allowed to attach a file to this page.