The best editor for IDL files?

Whenever I’ve edited my IDL files which defining components in Mozilla applications I never seen any outline in all editors I’m commonly using (Komodo Edit, Eclipse, NetBeans etc.) but than I’ve tried Geany (where I switch accidentally document type to C# language) and see what I’ve got :) :

Returning array of components

As I worked on next version of Boogie I encountered a really big problem with returning of an array of instances of my components returned from another component’s method.

Here is the introduction: I have component odIBoogieDatatypeProject and also component odIBoogieDbService where is method getProjects(aWhere) which should returns array of all projects which matching given WHERE part of SQL query. The returned array should contains instances of odIBoogieDatatypeProject.

The final solution (I’m omitting implementation of odIBoogieDatatypeProject component here becouse is not needed) – the important parts are highlighted by yellow background:

Implementation in odIBoogieDbService.idl:

  /**
   * Returns projects which match given pattern.
   *
   * aWhere      WHERE part of the SQL query.
   */
  void selectProjects(in AString aWhere,
                      out unsigned long aCount,
                      [array, size_is(aCount), retval] out odIBoogieDatatypeProject aRetVal);

Implementation in odIBoogieDbService.js:

  /**
   * Returns projects which match given pattern.
   *
   * @param aWhere {string} WHERE part of the SQL query.
   * @param aCount {object}
   * @returns {array} Returns array of instances of odIBoogieDatatypePerson.
   * @throws Exception Throws exception whenever the SQL query failed.
   */
  selectProjects: function(aWhere, aCount, aRetVal)
  {
     let ret = new Array();

     // ... I'm creating a array 'ret' here with projects to return...

     aCount.value = ret.length;
     return ret;
  }, // end selectPersons(aWhere, aCount, aRetVal)

And here is how I’m using it in target JavaScript:

  let db = Components.classes["@ondrejd.info/boogie/db-service;1"].
           getService(Components.interfaces.nsIBoogieDbService);
  let projects = db.selectProjects("", {});
  for(let i=0; i
    let project = projects[i];
    // ...
  }

  // ...

The best documentation which shows me the right way I found on page FAQ on XPConnect and XPIDL

PHP support for Geany’s Classbuilder plugin

Update: Enrico Tröger just submitted the patch so from now this change is included in Geany sources. I started working on feature request #2972547.

With a new notebook which I got in my new work (PHP developer in Pears Health Cyber) I started using Geany editor. I’m mainly using it for PHP development and because I’m pleased with it I switched from the Komodo Edit for PHP scripts.

Geany comes with Classbuilder plugin which creates source files for new class types – but it generates only C++ or GTK+ classes so I’ve decided to add support for PHP classes. Here are screenshots of what I’m talking about (yes, it’s that PHP class menu entry :) ):

Geany's Classbuilder plugin screen 1

Geany's Classbuilder plugin screen 2

Geany's Classbuilder plugin screen 3

I sended the patch to the Geany‘s devel mailing list and I hope that will be accepted. For now you can download it and try it by yourself (it’s a patch to the latest Geany‘s trunk). Here you can download the patch.

Top Ten Reasons You Should Quit Facebook

Everyone who have Facebook account should read this: http://www.rocket.ly/home/2010/4/26/top-ten-reasons-you-should-quit-facebook.html.

Using XULRunner for (small) business

Here is a story: for a one customer of mine I created a simple site with contest – visitors can register and got chance to win a notebook (http://thinkpadedge.cz/soutez/ – but this is not important) … after a while I was asked if I can quickly (I’ve got a night for it) develop a tiny application which draw a winners – specifications were simple:

Create an application with installer for Microsoft Windows which from the given range draw a specified count of numbers (IDs in the database of original site). Drawen numbers should be easilly copied to the clipboard or saved as a plain text file.

Solution: XulRunner-based application with installer created using Inno Setup.

Result: Application was created in less then three hours (and significant amount of time was spent with icons) and customer was fully satisfied :) .

Here are screenshots of the application:

I hope that this show to all of you the advantages of XulRunner and using of it :)

Progress on tbTimer

I got together the basic functionality of tbTimer addon – currently is working counting of time spent on selected task and also UI is near to finishing. What now is missing the most is the view with the reports but I’m working on it (currently I’m collecting the test data :) ).

As obviously here are some screenshots with the description (watch the toolbar and the statusbar):

Tasks view without any task selected.

Tasks view without any task selected.

Starting work on the selected task

Starting work on the selected task

Now we are working on the task

Now we are working on the task




I hope that the first release will be this week.

tbNotes 0.3.1

Hi, just before a while I’ve uploaded a new fixed version of tbNotes on the AMO. This release fixes bug that note without the target was not created. You can download it on well known address: https://addons.mozilla.org/en-US/thunderbird/addon/14395.

tbTimer

tbTimer mockup

tbTimer mockup

As I’m working with Thunderbird with Lightning addon I missing time-tracking functionality on Lightning’s tasks (previously I used SlimTimer but tasks are part of Lightning and I want to use only a single application for all). The addon should be tiny with clean and simple UI. I’ve created an initial mockup of what I want.

Here is a list of planned features:

  • each task can be started and stopped – this will produce single timeunit
  • timeunit contains only id of belonged task, timestamps for start and end and optional text as note
  • from these timeunits can be built a report about overall time spent on the single task
  • reports can be also generated for all/selected task for a selected time period (e.g. last month, last week etc.)
  • these reports can be exported as CSV
  • enable importing/exporting from/to SlimTimer service.

tbNotes 0.3

On AMO I’ve just uploaded version 0.3. This version implements some feauters requested by many users:

  • shortcut key for adding new notes (Ctrl+Shift+n)
  • to single message can be attached more notes
  • notes can be sended with message as an attachments
  • user can change font family and size in the note editormessage header overlay redesigned
  • added de_DE locales – this translation was created by Martin Giger and really thank to him for his work

Here are few screenshots with new features:

Creating attachment from a note #1

Creating attachment from a note #2

Changed font style in the note dialog editor

Styling XUL elements

I allways have a troubles with styling XUL elements and without DOM Inspector it could be even worse. Today I’ve tried to style <button type="menu"/> and it also was a hard work but result is pretty good:

As you see I have two types of menu buttons – with label and without – the most difficult part was to disable flex on inner <hbox> element inside the button element.

Here is the final CSS:

  1. /* Styles for menu buttons on message header overlay */
  2. .noteMsghdrButton, .noteMsghdrButtonIconic {
  3.   border: 0px none !important;
  4.   background-color: -moz-field !important;
  5. }
  6. .noteMsghdrButton > hbox,
  7. .noteMsghdrButton > hbox > hbox,
  8. .noteMsghdrButtonIconic > hbox,
  9. .noteMsghdrButtonIconic > hbox > hbox {
  10.   background-color: -moz-field !important;
  11.   -moz-box-flex: 0 !important;
  12. }
  13. /* we expecting 16 x 16 icon */
  14. .noteMsghdrButtonIconic  { min-width: 30px !important; }
  15. .noteMsghdrButtonIconic > hbox > hbox { width: 20px !important; }
  16. .noteMsghdrButtonIconic > hbox > hbox > label { display: none; }
  17.