After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676120 - The hint bars aren't very nice
The hint bars aren't very nice
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
3.4.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 602366 665327 (view as bug list)
Depends on: 676429
Blocks:
 
 
Reported: 2012-05-15 18:00 UTC by William Jon McCann
Modified: 2012-08-14 19:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (61.91 KB, image/png)
2012-05-15 18:00 UTC, William Jon McCann
  Details
wireframe (48.04 KB, image/png)
2012-05-15 18:16 UTC, William Jon McCann
  Details
Only place one x-content-bar at a time (11.29 KB, patch)
2012-05-20 15:25 UTC, William Jon McCann
needs-work Details | Review
Simplify the content type labels (3.18 KB, patch)
2012-05-20 15:25 UTC, William Jon McCann
accepted-commit_now Details | Review
Always show icon in application launchers (1.48 KB, patch)
2012-05-20 16:08 UTC, William Jon McCann
accepted-commit_now Details | Review
Only place one x-content-bar at a time (11.31 KB, patch)
2012-05-21 17:26 UTC, William Jon McCann
needs-work Details | Review
Simplify the content type labels (3.63 KB, patch)
2012-05-21 17:27 UTC, William Jon McCann
committed Details | Review
Always show icon in application launchers (1.48 KB, patch)
2012-05-21 17:27 UTC, William Jon McCann
committed Details | Review
screenshot with patches (65.80 KB, image/png)
2012-05-21 17:28 UTC, William Jon McCann
  Details
Only place one x-content-bar at a time (11.47 KB, patch)
2012-05-21 18:01 UTC, William Jon McCann
committed Details | Review

Description William Jon McCann 2012-05-15 18:00:02 UTC
Created attachment 214140 [details]
screenshot

We can do a lot better with the bars that show up to suggest you something besides browse a removable device.
Comment 1 William Jon McCann 2012-05-15 18:16:18 UTC
Created attachment 214143 [details]
wireframe
Comment 2 William Jon McCann 2012-05-20 15:25:30 UTC
Created attachment 214497 [details] [review]
Only place one x-content-bar at a time
Comment 3 William Jon McCann 2012-05-20 15:25:33 UTC
Created attachment 214498 [details] [review]
Simplify the content type labels
Comment 4 William Jon McCann 2012-05-20 15:28:52 UTC
The app icons aren't shown currently because we disable showing icons in all buttons. Perhaps we should add a property to gtkbutton to allow forcing the icon to show?
Comment 5 William Jon McCann 2012-05-20 16:08:09 UTC
Created attachment 214503 [details] [review]
Always show icon in application launchers
Comment 6 Cosimo Cecchi 2012-05-21 15:17:17 UTC
Review of attachment 214497 [details] [review]:

Makes a lot of sense; I have some comments on the code:

::: src/nautilus-x-content-bar.c
@@ +190,3 @@
+
+		if (g_content_type_is_a (bar->priv->x_content_types[n], "x-content/win32-software"))
+			continue;

I think these filters on the values of x_content_types should be applied before assigning the value to priv->x_content_types, since the number of valid content types will influence the string shown by the bar.
I think it's OK not to show the bar (e.g. make it commit harakiri by calling gtk_widget_destroy() on itself) when after filtering, we find no useful content types to display, as you hint to in a comment above.

@@ +312,3 @@
         g_object_class_install_property (object_class,
+					 PROP_X_CONTENT_TYPES,
+					 g_param_spec_variant (

Why GVariant? Since you don't seem to store the variant anyway (but you do store the strv), I think it's better to just use g_param_spec_boxed with G_TYPE_STRV here (and the part above in _set/get_property would just use g_value_set/get_boxed())
Comment 7 Cosimo Cecchi 2012-05-21 15:20:59 UTC
Review of attachment 214498 [details] [review]:

Looks good; maybe add a comment for translator to disambiguate the context of those "Contains..." strings?
Comment 8 Cosimo Cecchi 2012-05-21 15:23:58 UTC
Review of attachment 214503 [details] [review]:

Provided the GTK patch is accepted, looks good.
Comment 9 William Jon McCann 2012-05-21 17:26:59 UTC
Created attachment 214573 [details] [review]
Only place one x-content-bar at a time
Comment 10 William Jon McCann 2012-05-21 17:27:02 UTC
Created attachment 214574 [details] [review]
Simplify the content type labels
Comment 11 William Jon McCann 2012-05-21 17:27:04 UTC
Created attachment 214575 [details] [review]
Always show icon in application launchers
Comment 12 William Jon McCann 2012-05-21 17:28:30 UTC
Created attachment 214576 [details]
screenshot with patches
Comment 13 Cosimo Cecchi 2012-05-21 17:43:24 UTC
Review of attachment 214573 [details] [review]:

::: src/nautilus-x-content-bar.c
@@ +166,3 @@
+		default_app = g_app_info_get_default_for_type (x_content_types[n], FALSE);
+		if (default_app == NULL)
+		message = get_message_for_x_content_type (x_content_types[0]);

You're leaking default_app here.
Since you will iterate again on the GPtrArray later calling again g_app_info_get_default_for_type() on each of the types, I think it's cleaner if you do:

GPtrArray *types, *apps;

for (n = 0; x_content_types[n] != NULL; n++) {
  // add the type to types and the default_app to apps if they're valid
}

and then iterate on the apps array to add buttons later.
Comment 14 Cosimo Cecchi 2012-05-21 17:44:26 UTC
Review of attachment 214574 [details] [review]:

Looks good.
Comment 15 Cosimo Cecchi 2012-05-21 17:44:55 UTC
Review of attachment 214575 [details] [review]:

[ Need to wait for the GTK patch ]
Comment 16 William Jon McCann 2012-05-21 18:01:26 UTC
Created attachment 214578 [details] [review]
Only place one x-content-bar at a time
Comment 17 Cosimo Cecchi 2012-05-21 18:07:22 UTC
Review of attachment 214578 [details] [review]:

Looks good.
Comment 18 William Jon McCann 2012-05-21 18:21:08 UTC
Attachment 214574 [details] pushed as 631a070 - Simplify the content type labels
Attachment 214575 [details] pushed as f02cafd - Always show icon in application launchers
Attachment 214578 [details] pushed as dde03f7 - Only place one x-content-bar at a time
Comment 19 Luca Ferretti 2012-05-21 21:24:09 UTC
Just a note: the translator comments will not appear in PO files, because they are not placed exactly before _().

If you want to show them in PO files (could be good) it should be

 	/* Customize greeting for well-known x-content types */
-	/* translators: these describe the contents of removable media */
 	if (strcmp (x_content_type, "x-content/audio-cdda") == 0) {
+	/* translators: these describe the contents of removable media */
		message = g_strdup (_("Audio CD"));
Comment 20 William Jon McCann 2012-07-16 16:03:06 UTC
*** Bug 665327 has been marked as a duplicate of this bug. ***
Comment 21 William Jon McCann 2012-08-14 19:10:32 UTC
*** Bug 602366 has been marked as a duplicate of this bug. ***