Entries Tagged 'Uncategorized' ↓

Hotplug hotness

Back in the GNOME 2.x days, device hotplug management was done entirely by Nautilus; you know, those dialogs that pop up when you plug your photo camera or your USB drive. This worked fine, as Nautilus was always running in the session, being it also the process drawing the desktop. The desktop itself provided a way to eject the devices, by right clicking on their icon and selecting the appropriate menu action.

In the 3.0 era Nautilus moved away from being a central component of the user experience, and if you used GNOME 3, you will have seen we actually dropped the desktop metaphor by default already; that unfortunately left us with no place to access the list of devices plugged into our machine; in fact, in 3.0 you have to open Nautilus manually to eject an USB drive. Also, the code for handling autorun notifications was moved to gnome-settings-daemon, which will trigger the old-style GTK+ dialog when a device is plugged in.

Clearly, we could do a lot better. A while ago I started a design whiteboard page to analyse the current state of the art in this area, and last week I finally sat with Jon thinking about the user experience we want to achieve here. You can read more about it in the tentative design section of the whiteboard page.

Shell Integration

We decided to implement the feature with using notifications in gnome-shell

When a new device is plugged, the shell will trigger a notification (after having consulted the settings from the ‘Removable Media’ panel in gnome-control-center) containing a list of applications suitable for handling that device. This is similar to what we used to have in 2.x; if you plug in a blank optical disc, you will find “CD/DVD Creator” (Brasero) in that list, if you plug an iPod we’ll show “Rhythmbox” or your default music player, if you plug your photo camera Shotwell will be shown…you get the idea; you can also eject the device directly from the notification.

After you dismiss the notification, you will be able to access the list of your devices from the message tray, which will grow a ‘Removable Devices’ item as long as there’s at least one device connected to the system.

From this menu you can still activate the default autorun action by clicking on the device name/icon, or you can eject it, by clicking on the button on the right hand side. If the device cannot unmount, due to a file still open on it, we will show a nice dialog from where you can get to the application directly, or force unmount if you prefer.

Generic drives

One problem the 2.x implementation didn’t really tackle is what to do when generic drives (like, say, an external hard disk, or a random USB pendrive) were attached. I believe the default was just to run Nautilus in those cases, or worse, we would show a meaningless autorun dialog with no choices inside it.
In my new implementation, I wrote a small crawler program that gets DBus-activated by the mounter process (in this case the shell) and tries to gather as much information as it can about the content type of the files in the device. Of course, we don’t want to hammer your 2TB drive with a full scan, so the crawler has a hard time-limit not to do I/O for more than a fixed amount of time (I empirically found 1.5 seconds is a good value for this). The crawler doesn’t care about the specific mime type of the files (say, FLAC vs OGG) but rather what the file is about (say, Music vs. Video), so it will return a list of up to three “generic” mimetypes for the drive content, ordered by relevance; applications that claim to handle those generic mimetypes will appear in the notification. As a last fallback, if we don’ t have any of these applications available, we will show an entry to open the drive in Nautilus from the notification. This aims to integrate with the upcoming application design for Finding and Reminding.

What’s next

I need to post my current iteration of the patchset for review, but I already have some further improvements and polish planned in the pipeline:

  • we need to handle password-protected volumes (e.g. encrypted USB sticks) directly from the notification, e.g. having an entry there to unlock the device directly
  • we probably want to show an entry in the device list if the laptop is plugged into a docking station. Clicking the eject button there would be equivalent to pushing the hardware button on the dock itself.
  • we need to find a good story for fallback mode. I think we can just keep the current gnome-settings-daemon plugin in place, and activate it only if fallback mode is detected, but this is currently not implemented.

Adventures in the CSS land

Some time ago I blogged about a number of improvements which made its way into the GNOME 3.0 theme, thanks to the new GTK3 CSS-powered theming engine.

This cycle, Benjamin and I have been working on making the CSS parser in GTK3 more conforming to the W3C specifications, while adding some cool new features in the meanwhile.

What’s already there

  • The parser from GTK master will now report errors consistently when it fails to parse the CSS data, including the position in the data where the error occurred. This can be used nicely e.g. to highlight the broken line in an editor, such as Carlos’ nice gedit-cossa plugin (GTK master also recently grew a very simple live-editor too if you feel like toying with this).
  • It’s really easy to hook up parsing for new properties; CSS features such as inheritance and shorthand properties are now supported natively by GtkThemingEngine. Existing properties have been extended to be shorthands according to the CSS specification (e.g. border-width, padding, border-radius), and the non-shorthand versions have been added too (e.g. setting border-right will now do the right thing).
  • nth-child structural pseudo-class support have been extended to work for generic containers. GtkBox already supports this, with other popular containers (e.g. GtkToolbar) to follow shortly. This means it’s easy now for themes to visually connect contiguous borders.

New properties

We’re adding support for new CSS properties, to allow themes to specify subtle eye-candy directly from the stylesheet. Here’s a list of additions targeting GTK 3.2.

  • text-shadow is supported already in GTK master.

  • icon-shadow is a custom property which behaves similar to text-shadow for icons. It looks great with symbolic icons. It’s also generic enough to be used with icon-like UI elements such as arrows, spinners and whatnot in the future – git branch

  • box-shadow allows to render inset and outset frame shadows. Outset box-shadow support is unfortunately really hard to implement within the current GTK drawing process, so it won’t make it in 3.2.

  • border-image will be expanded to be a shorthand property as well, and match the CSS3 specification for drawing.

Considerations

CSS is huge and complete property coverage is not interesting for GTK. We plan to incrementally add support for new properties/pseudo-classes based on the requirements of the designs to be implemented; help/feedback is gladly appreciated. If you have a CSS attribute in mind that should be supported at the GTK level, please file a bug, possibly with a patch attached :)

We’re still carrying over a legacy of many per-widget style properties that specify paddings/borders; I think we should try to get rid of them where possible, and try to use standard CSS and style classes (e.g. to define different areas inside a widget) as much as possible: CSS is documented very well, and we can trust the specification for any semantic of the properties, not reinventing the wheel for every widget. This is a GTK4-ish goal, but I think it’d be great to start soon porting and deprecating.

I also think native theming engines should be as small as possible; ideally they should be able to get any desired effect using the CSS stylesheet only. This means the builtin GTK theming engine should be flexible enough for most of the use cases.

Sushi

With the 3.0 release out, I kind of wanted to breath some fresh air and try something new, so I decided to experiment a bit with GtkClutter and Javascript, which I’ve been meaning to for a long time. I ended up writing a quick previewer for Nautilus, a-la Quick Look.

Here is the obligatory screencast of what’s currently in git.

The content type viewers are implemented with a simple plugin system, which Javascript and gjs make it very easy to have. I plan to add other viewers in the future for at least plain text and font files, and it would be nice to also have HTML, source code files with syntax highlight and maybe archives.

Although I’m not completely familiar with it yet, I found the JS experience quite positive, with most of the introspected methods I tried using working out of the box. It’s also perfect for developing nice UIs much faster. The project has in fact a mixed C/Javascript codebase, with some low-level object helpers written in C + GObject and all the UI in JS, like other projects such as gnome-shell and The Board (from which I copied most of the autofoo/build infrastructure and some code to play audio files, thanks Lucas!!) already do.

How do I get it?

I didn’t make a release out of it yet, as it still has a few minor bugs, but it’s actually quite usable already, and you can try it by downloading it from here

http://git.gnome.org/browse/sushi

Note that you will also need the “previewer” branch of Nautilus I published here to enable Nautilus integration

http://git.gnome.org/browse/nautilus/log/?h=previewer

Once a release is out I plan to merge the Nautilus branch and start using it by default, if it’s installed.

Need more?

I have other things in the pipeline for Nautilus and Adwaita this next cycle, which I will write soon about, so stay tuned!

Adwaita 3.0 coolness

Quite a lot of things have happened in my life since I last had the occasion to write on this blog…the most important is I moved to Boston last January, to work in the awesome Red Hat Desktop Team. It’s very exciting and inspiring to work together with this great people, and it is even more cool these days when we’re all working hard to delivery the best GNOME 3 experience possible; I think it’s going to be great!

Here’s some of the things I’ve been working on in the last month I want to show you.

Nautilus 3.0

Allan has been doing a great job showing off the mockups for Nautilus 3.0 by the design team; the good news is that now those mockups are mostly implemented in the latest beta tarballs. Here’s how Nautilus from git master looks like

The most outstanding changes are the new streamlined toolbar, a new sidebar design, and the use of “floating” statusbars to reduce the UI chrome. Another important change is that “spatial” mode is now gone for good; we still allow opening new folders in separate windows, but we use a single UI now.

Adwaita

Adwaita is the GNOME 3 default theme, which include themes for GTK+ applications, the window manager, cursors and the background. In the last week I’ve been implementing the gnome design team mockups for the GTK+ theme, and I must say I’m quite pleased with the result. Here are some screenshots of what you get with the current theme (the Nautilus screenshot above uses the new theme too):

The changes are too many to describe them one by one, but notable improvements include toolbars, checkbuttons, radiobuttons, notebook tabs and treeviews.

We’re almost there, April 2011 is around the corner now…

Long time no blog

Hi there! It’s been a long time since I last wrote something on this blog, which reminds me how many things have happened in my life in the last year and a half.

As some of you might know, I’ve been working part-time for Collabora (on Empathy), helping fixing misc bugs and implementing nice things like file transfer, the accounts dialog user interface and the transition to the Mission Control 5 framework.

In the meanwhile I kept myself busy with my university and finally, last week, I took the last exam of my course! This means I’ll hopefully graduate on April :) Since November, I already started digging into my thesis, which will be aTelepathy implementation of the XTLS protocol, an end to end solution to crypt communication over XMPP.

In order for Telepathy to support channel encryption, some new interfaces need to be written. I drafted some proposals for this on the telepathy mailing list in the last few months, and I’m happy that Eitan Isaacson picked them up and turned them into something more concrete. In order to discuss with him and the rest of Collabora about the proposal, I’ll visit the Cambridge office at the end of the month, right in time to attend FOSDEM and the XMPP summit together with the Collabora gang.

After that, the items on my TODO list include:

  • draft a proof-of-concept implementation of the XTLS handshake into Wocky(I already started coding for this before I had to stop for my exams).
  • make sure the new Telepathy interfaces work fine in telepathy-glib
  • implement the interfaces into Gabble.

Hope to see you all in FOSDEM :)

MediaManager, week 7

Hi everyone,

Last week I have been to Istanbul, to attend GUADEC. It has been an amazing time there, and I have been really happy to meet, socialize and share ideas with the other SoC students and some of the GNOME gurus :P

Together with Bastien, Clemens and Felix, we planned the next final steps for the MediaManager project. Also, it seems that Felix’ project (Cheese integration) will be one of the first clients to use my MediaManager library to expose cool features in the GtkFileChooser! :)

== Work to be done ==

– Write a set of widgets wrapping around the backend code
– Write a GtkModule that hooks up into the GtkFileChooser to achieve my ultimate SoC goal of integration with it.

== Timeline ==

I don’t know how much work I will be able to do in this following week until the 23rd of July, as I’m having some exams in this timeframe. Anyway, afterwards I’ll be home until the 10th of August at least and working again full-time on the project, so I came up with this plan, which would be perfectly synced with both the SoC timeline and my holidays :)

– 24th of July to 31st of July, writing of the widgets
– 1st of August to 5th of August, writing of the GtkModule
– 6th of August to 10th of August, final bugfixing & release

Feel free to mail me for any suggestions on the widget part or if you think your application needs some specific widget to use my library. I will start coding them in the next week, so there’s still time for thinking/designing.

GNOME 3.0 = Tabs!

It seems that the GNOME community has finally reached the long-awaited wide consensus about the future direction for the project. It’s all about tabs!

We’ve been discussing the issue here at GUADEC and it seems that many guys really agree this is the path we want to follow. I am pretty sure the guys from the release team will just support it as well, as all the community is so excited by the new stuff that is happening that we really don’t want to stop the effort now.

Also, it seems that GTK+ will help us by providing a cool API for that, so let’s just make it happen!

Arrived in Istanbul

I just arrived in Istanbul…I’m writing this post from the Orient Express hotel lobby!

I’m really looking forward to meet many of you GNOME people…see you soon! If you want to meet me, drop me a mail, add me on twitter (cosimoc) or contact me on IRC (always cosimoc).

See you soon! :)

MediaManager, week 5

Hi everyone!

This is the report for my fifth week of work in my SoC project.
This week I managed to dedicate three days of almost full-time hacking
on the project, and I almost completed the DBus interface.

== Work done this week ==

I splitted the MMApplication and MMCategory classes into abstract
interfaces, implemented by MMSoApplication/Category and
MMDBusApplication/Category. This was needed, as the implementation of
the methods which get the categories and the hits are very different. To
pass the objects (i.e. the filters and the hit collection) over the bus,
I serialized their members into a XML tree. So I spent some time
familiarizing with the libxml2 reader/writer API and finally wrote
methods that transform my objects into strings to be sent over DBus.
I also had to refactor some code into the Manager itself to make it more
DBus friendly. In the end, the DBus interface that an app should expose
is very simple:
– GetApplicationInfo, which returns the desktop id and the supported
types
– GetCategories, which returns two string arrays; one for the names and
the other for icon names
– GetHits, which takes as arguments the category name and a filter, and
returns a hit collection.

I am quite happy with the work so far, and I think I will have finished
a first implementation of the “backend” (i.e. non-UI) part by the next
week, just like I originally planned in my proposal! :)

== Work for the next week ==

I don’t know if I will be able to do much hacking next week, as on the
next Monday (July 7th) I’ll be leaving for GUADEC, in Istanbul and I
have to prepare many things. Though, there’s some things that I want to
do:
– GErrorize the _unserialize () methods
– Write more tests for the DBus interface
– Re-read the code written so far and look for possible
optimizations/bugs
– (optional) Try to implement the first widgets.

So I’m looking forward to meet everyone of you in Istanbul, I hope we’ll
have a great time!

MediaManager, week 4

Hi everyone, this is my report for the fourth week of coding for my SoC
project.

This week hasn’t been as productive as the first three, as I have been
quite busy with some personal things.

== Work done this week ==

I spent quite some time on DBus: first reading the documentation and
learning the basics and then fighting to solve some nasty crashers in
the code I was writing.
In the end, I made a separate executable helper, mm-dbus-manager, whose
activation should be auto-activated on request (i.e. when the library
wants to know the applications registered on the DBus interface or
interact with them). The helper puts a manager on the bus, which takes
care of spawning the application-specific executables, which in turn
register themselves to the manager and should expose and implement the
methods of my interface.
The manager discovers the available application-specific executables by
looking for GKeyFiles installed in a known location.
Apart from setting this up, I spend some other time autofooizing the
whole project in a much nicer way; the test suite is getting better too,
and I also wrote tests for the DBus interface.

== Work for the next week ==

– Keep the work and hopefully finish the DBus parts (i.e. implement the
queriable interface and the serialization and deserialization of library
objects).
– (optional) Do the other tasks I had setup for this week and didn’t
have the time to do.

== Resources ==

As usual, you can find my work in my git repo tagged “week4″ now.

Cheers!