Category Archives: General

Glom’s Initial Dialog

Glom now lets you browse the local network to open a document already opened by someone else, so you can easily both use the same database system.

That adds a new button in a file chooser dialog (though it doesn’t use the file system or URIs). This has complicated our already odd start-up dialog. We have some thoughts about the initial Glom dialog in the wiki but, to summarize, this is my current best mock-up for what we should have. Apologies for the inept use of Glade and Inkscape:

glom_initial_dialog_mockup_from_inkscape.png

The treeview row buttons are to avoid having to select and then click a separate button. I think that’s easier. I generally hate start-up dialogs, so I’d avoid it if I could and I’d welcome suggestions. I do think it’s better than having a wizard and I do think something like this is needed to deal with the two common cases:

  • The first-time user starts Glom and has no idea what he could do.
  • The regular user starts Glom and wants to open the database that he uses every day. Unlike with a word processor, people will rarely use more than one or two Glom files.

Glom in Maemo Chinook extras

After much struggling with branch merging and fighting with incompatible scratchbox rootstraps, an alpha version of Glom is now available for Maemo’s new Chinook SDK, in the extras repository. Thanks to Armin and Johannes.

glom_maemo_screenshot.png

Software developers might also be interested in the dependencies that we packaged, in addition to the existing gtkmm and hildon*mm libraries: libglademm, libpq (postgres client), libgda, libgdamm.

I think Glom on Maemo could be very useful for tasks such as

  • Restaurant order-taking
  • Stock taking in warehouses
  • Surveying of property
  • Note-taking for deliveries or checkpoints
  • Portable databases
  • Jack Bauer fighting crime

But so far this is purely a proof of concept. Some work would be needed to make it really useful. For instance,

  • The screenshot shows that there is a huge amount of wasted space. The spacing and padding needs to be reduced to 1 pixel everywhere, and the table title and mode can be removed. We use libglade and don’t want to have a separate .glade file for the two platforms, so maybe a new feature in Glade/libglade could help us.
  • Obviously it shouldn’t say it’s in developer mode. This client-only version can’t even do developer mode.
  • The Details/List tabs and navigation buttons need to go into the menu so they are not seen normally.
  • The treeviews needs to have column headers. Applications must do this explicitly when porting to Maemo because it GTK+ changes the GtkTreeView defaults – this is unnecessary and frustrates people.
  • Entry widgets need the hildon keyboard hints so appropriate on-screen keyboards are used for numeric or text fields, plus auto-capitalization where appropriate.
  • Use hildon widgets such as the time and date widgets (needs modifications to hildon to allow them to be empty (NULL), though these should probably be in GTK+ anyway).
  • Special layouts for the Maemo version. We need to let the developer specify a full layouts for the regular desktop version and a cut-down layout for the handheld version, so he doesn’t need to keep two separate copies of the .glom file.
  • We probably need Mathias’ height-for-width extended layout to make sure that we only have vertical scrollbars, though I think we can fit a lot into the horizontal space, at least in full-screen mode.
  • Keyboard navigation: Make sure that this works well by default and allow the developer to specify a tab sequence.
  • Dealing with loss and reconnection of the network, requesting new connections when necessary, using libconic.
  • Support Maemo’s offline mode and other states (suspend).
  • Avoid excessive network re-connections and duplicate SQL queries
  • Self-hosting of databases. Glom on maemo is currently client-only, though the desktop version has self-hosting by starting its own postgres instances. So at the moment you need a central database server and a constant network connection. It would be nice to allow the database to exist on the handheld itself. We’d probably want to port the client-only version to sqlite, though I suppose we should check postgres’s performance on the internet tablet before dismissing it. Our use of libgda should make it fairly easy to use sqlite if necessary, though some generated SQL will need attention.
  • A simple replication feature. People will often need to add or edit data while offline and then have everything reconciled when they get back to base. This is a complex issue, but I hope we can offer some simple strategies for this which don’t require much human intervention.

I hope Openismus can find funding for that work somewhere.

By the way, Armin is now working on the Windows port.

Update: Here is a new screenshot after making some of the easiest small changes:
Glom 1.6.6 on Maemo

libepc

I’m very pleased with the libepc library that Mathias Hasselmann created for Glom. I much prefer having the Avahi and network communication wrapped up in a simple separate library rather than mixing it in with Glom’s source code. I don’t want to deal with avahi, libsoup and gnutls if I don’t have to.

Glom will effectively use it to discover and load .glom documents over the network from other Glom instances. I suspect that it will be useful to a few other applications, but if not then it will still have been a good exercise in modularity.

I’ve already reviewed a few iterations of the library. Mathias and I are both fussy coders, though in different ways, so that’s why it already has full and meaningful documentation, tests, and examples. But we would welcome feedback so we can show how seriously we take documentation and API. I’ve added it to jhbuild.

My WordPress cracked

A couple of days ago, Google sent me an email complaining that my blog (this one) contained hidden text advertising viagra, and threatening to remove it from their index. To my surprise, they were right.

The HTML was coming from the WordPress code itself, somehow via the call to wp_footer() in the theme’s footer.php. My theme is a simple one based on the standard WordPress theme, so I don’t think the exploit is in the theme.

I wasn’t using the version of WordPress (2.1.1) that was known to be cracked, but I upgraded to the latest WordPress anyway (2.3.1). Two days later, it was cracked again. I noticed because the change broke the site, causing php errors. This time I got a diff of the change. (Ignore the missing files in plugins/. I made a mess of restoring my plugins when upgrading.)

Both times, it was trying to add HTML with a <div id=”goro”> block. wordpress.net.in seems to be involved too. Googling showed me that others (1, 2) have had the same problem, though I haven’t found any real fix to stop it happening again. I feel vulnerable.

Update: Here are some lines from the access log that seem to be relevant. I don’t know whether they are the original hack.

Eightysevened

After years of loyal effort, I conclude that I have Bruce-related anterograde amnesia: The inability to form new memories of any song by Springsteen after Tunnel Of Love.

It happens with Prince too, triggered halfway through Lovesexy.

gtkmm book as pdf

Jonathon Jongsma recently fixed up the “Programming with gtkmm” book so the result of docbook2pdf is fairly useable. We’d like to improve it even more and maybe sell hard copies online. But I think we need more control over docbook2pdf (a wrapper for jw). For instance:

  • We need to scale images down instead of cropping them.
  • Ideally, the links to the reference documentation would be real hyperlinks in the PDF.
  • It would be nice to specify a different base URL (an XML entity in our Docbook) for the PDF than for the HTML, to make the URLs absolute instead of relative.
  • A background block for the source code examples would provide some structure.
  • Syntax highlighting of the source code examples would be really nice, but we don’t have that in the HTML either. (It’s inserted in the Docbook automatically, from our real source code.)

Does anyone have experience with this?

Of course, I also plan to review all the text and make improvements to the content where necessary. It’s been a few years since I read it all through.

goocanvas experiences

I’ve got to know goocanvas (API documentation, browse CVS) better over the last week. I achieved what I needed, but it could have been easier.

No generic positioning of items

You can’t set the position of goocanvas items. Well, you can set the x,y position of a GooCanvasRect, and you can set the points in a GooCanvasPolyline, but there is no generic position API in the base GooCanvasItem interface.

This makes it very difficult to write generic code for dragging, loading, and saving. All the items could support a generic API – it wouldn’t matter if the x,y is some arbitrary point in the item. I have implemented this in derived classes in C++, with some multiple inheritance awkwardness, but life would be far easier if it was in the GooCanvasItem base class itself. Erik Osheim did this in Python too. You wouldn’t want to do it in C. It seems to be a regression compared to libgnomecanvas, which has gnome_canvas_item_move().

Note that you can “translate” generic GooCanvasItem items, but

  • Two APIs for the same thing, to be used at different times, is annoying.
  • You can’t easily discover the actual position after translating. For instance, the GooCanvasRect x,y properties are not changed by goo_canvas_item_translate(). That function just changes a translation matrix which is applied to the x,y, rather than changing x,y.

I guess this is the cairo drawing system, but the canvas API shouldn’t force that on me. This is a major problem in the API for me, so I hope I can persuade Damon to let us add this.

Update: We created a GooCanvas generic positioning patch for this.

No high-level funtionality

You have to implement too much yourself. Not every application needs the ability to drag and resize items, but many do, and it would be nice if this was easy and consistent. I implemented drag-to-move, snap to grid, snap to rules, ctrl-to-restrict-drag-to-one-axis, resizing via corners and edges with appropriate arrow cursors, and signalling for a context menu on right-click. I still need to do selection highlighting and moving of multiple selections. I did that with a CanvasGroupResizable class that can take a child to be manipulated, though it currently only works with a rectangle child. It uses the generically-movable rectangles and lines that I mentioned above.

The next person to reimplement this will probably make it behave subtly differently.

Now that I finally have a canvas with the basic functionality that I need, I was able to reimplement and improve Glom’s Relationships Overview. I’ll now start using it to implement print layouts showing field data.

Printing is easy

goo_canvas_render() makes printing really easy with GtkPrintOperation.

Minor issues

  • Instead of having a GooCanvasContainer type, there’s a goo_canvas_item_is_container() function that tells you whether goo_canvas_item_get_child() and friends are useful.
    Damon seems to like the idea of correcting this. Update: We created a GooCanvas Container-type patch for this.
  • The root item idea doesn’t seem useful. You always have to use goo_canvas_get_root_item() to actually add or remove items to the canvas. I’d like to make the GooCanvas widget implement the GooCanvasContainer interface instead.
  • The model/view separation doesn’t seem useful, though I might be persuaded by a real life example. I don’t see a big need to display the same canvas twice in the same UI. In GtkTreeView the model/view separation allows you to show two views with differently sorted or filtered models, but I don’t see an equivalent in goocanvas. I can imagine using different zoom levels or different visibility (at different zooms) levels, but I don’t see a way to specify that for a canvas “view”.
  • The *_new() functions need to be fixed to just use g_object_new(), for language bindings. Bug filed.
  • The *_new() functions, such as goo_canvas_rect_new() correctly return an initial reference if you pass NULL for the parent parameter, but do not return a reference if you specify a parent. That’s maybe convenient if you can remember, but its’ an invitation to make mistakes.

At first glance, libccc has many of the same problems. Note that I was dissuaded from trying libccc first because it was started after goocanvas, without any stated reason, and due to the lack of documentation on the functions that I looked at.

I should look at HippoCanvas too.

Glom: Print layouts

As mentioned before, Glom needs a more precise way to specify print layouts, for instance to print on a pre-printed form. I’m looking at the problem again. At the same time, Johannes is working on a prettier drag-and-drop UI for Glom’s regular (automatic) view layouts.

For now, I think I’ll start with text areas that don’t move or shrink depending on their content. But for later I would like to gather some examples of how other software does this. I wasn’t impressed with what I found, though FileMaker is the best of the bunch:

FileMaker print layouts

FileMaker offers two ways to achieve this: You can use the <<fieldname>> placeholder format in static text, or you can specify that a field’s text box will be moved left, right, up or down until it hits another box. Both techniques can be seen in this screenshot:

FileMaker designing print layout

Kexi print layouts

Kexi (version 1.1.3) doesn’t seem to have any support for printing, but please correct me if I’m wrong. (Update: It doesn’t support printing of details forms – the print menu is grayed out in that case. It does support printing of list views, though the result is arranged differently than what’s on screen. It has a reports feature, available under “queries”. For me, a report is for multiple records, not a single record, and I’d like to keep them separate to keep things simple.) However, the regular layout is pixel-perfect rather than automatic, which would be suitable for precise printing, though awful for all other situations.

kexi_layout.png

Knoda print layouts

Knoda (version 0.8.3) seems to support printing, but I didn’t find any features to support flowing of variable sized text. Its layout is pixel-perfect rather than automatic, as with Knoda and Access.

knoda_form_editor.png

Microsoft Access

It looks like Access (the version in Office 2007) also doesn’t have special printing support. I think you are just meant to design a regular custom form and print it. But I couldn’t find a way to print an invoice in their “Northwind” example, so I’m guessing. The regular layout is pixel-perfect, with the ability to make widgets stretch to fill available screen space, with the new “Anchoring” feature in Access 2007.

As seen in this screenshot they also use an invented markup (or mini programming language) to show data, as in FileMaker, but it’s even more complicated here.

access_2007_layout.png

libgda reports

libgda has some reports support (example). It uses custom XML tags (and a custom mini programming language for conditionals) to replace XML nodes (arbitrarily named, without any libgda prefix, it seems, such as <row>) with query results in, for instance, DocBook. So that’s not really useful for the precise layout problem and seems targeted more at multiple rows reports rather than single record printouts. Glom already has its reports feature which seems equivalent, though it is more integrated with Glom concepts such as Relationships and Related Fields.

Others?

What other systems should I look at? Note that I’m not interested in anything that requires the user to edit XML or SQL queries, though it’s possible that I could reuse some of that implementation some day.
By the way, having to use all these other systems for a while convinced me once again how badly Glom is needed. They are so unnecessarily low level and complicated, instead of directly helping people to achieve their actual goals.

Playstation 3

September was a pleasantly quiet month, giving me time to do all kinds of paperwork and minor jobs that have been lingering on my to-do list for a while.

It also gave me time to get a Playstation 3 and feel a little less out-of-date. My experiences:

  • I felt incredibly uncoordinated after years of no gaming. It got better, but I still feel like I need to upgrade my nervous system.
  • The Metalstorm off-road car racing game is great fun and looks amazing.
  • Resistance Fall Of Man doesn’t seem like a significant update compared to Doom/Quake/Unreal of years ago. I miss a run button. Single player was the same old monotonous moving forwards, shooting, opening doors, shooting bigger things, moving forwards. Even after finishing the single player mode, I am still helpless in the face of online players. That’s me flailing around wondering who is shooting me.
  • The PS3 can’t find Rhythmbox’s “media server”, though the “UPnP sharing support” plugin should have made this possible. Bastian had the same problem.
  • Rub-A-Dub is a great game. It makes people laugh. It uses the motion detector on the controller.
  • You’re not allowed to register an online name that’s anything like your real name or email address. So everyone has stupid names involving random punctuation and numbers. This is probably to protect children or other unsophisticated users. But online identities aren’t very interesting without a link to real identities. People like to find their real friends, and like to know where their new friends are. Heavy users don’t want to be anonymous. It misses out on a large part of the online community experience. I am Moorai, until Sony figure out that it’s phonetically similar to my real name.
  • When you register an online account (needed to use the Playstation online store), you have to choose your country of residence. Then you can choose your language, but you are forced to choose the German language if you live in Germany. But I don’t want the UI in German. When I lied and said that I lived in the UK then all the prices were in UK pounds instead of Euros. This is annoying. I created a second user so I can use the PS3 in one language and change users when I need to purchase something – I haven’t tested that idea yet.
  • It took me a while to figure out that the PS button in the middle of the controller could be long-pressed to turn off the machine, or pressed to quit a game.
  • The browser is pretty crappy and never zooms to a useful size. It can’t play Apple’s movie trailers or YouTube videos (Update: It can play YouTube, though it’s not smooth). I would have used them lots.
  • The Playstation store has some movie trailers, but just a tiny selection that hasn’t been updated recently. I like movie trailers. Please give me more.
  • The playstation can show images and play music (not Ogg Vorbis though), but you’ll have to get past a bug that I am amazed is not fixed: When you select the memory card or USB Stick, it will show a “no files available” (or similar) message. Only when you click the options (green triangle) and select “show all files” (or similar) will it actually let you browse through your files.
  • The 3D photo slideshow is amazing and useful, particularly when you manage to make the PS3 play music at the same time.
  • Even if the PS3 became a really usable media server/player, TV tuner/PVR, etc with access to internet TV, I’d feel bad about having an always-on device that has a fan, suggesting that it draws a lot of power.

Overall, I’m happy with the PS3. It provides simple distraction, with some extra gimmicks. I feel vaguely part of the proper gaming world again – the one that has lots of buttons and needs to figure out what they do. It’s nice that they will update the software over the internet every now and then.

Horrible Compiz in Ubuntu betas

The October 18th release date for Ubuntu “Gutsy” approaches fast. It currently defaults to using desktop effects (the Compiz window manager instead of Metacity). But compiz is still appalling. In particular, it behaves terribly together with the GNOME Panel, with windows appearing under the panels or over the panels, and sometimes drawing its shadows over the panels while otherwise being in the correct position. In the past I experienced various focus problems, leading, for instance, to unclickable foreground windows. I don’t know whether those focus problems have been fixed – it’s hard to have the patience to test it completely.

Window managers are meant to be irrelevant to users, just doing obvious things so you don’t have to think about them. But Compiz generally makes Ubuntu feel so utterly broken that some average non-technical users may suspect intermittent hardware failure or a malicious virus. I wonder if this is likely to improve before the release.

screenshot_compiz_window_and_shadow_over_panel.png