Matthias Schoettle

Software Developer

Page 2 of 5

Thunderbird Extension: Hide Badge Icon

About two years ago (a few months after switching to Mac OSX) I noticed that the badge on the Thunderbird app icon, which notifies about new and how many emails were received, is quite distracting for me when I work. As soon as it pops up I would notice it and felt an urge to immediately check what the new email is about. Then of course, the current focus and concentration is lost.

I wanted to turn the badge of, as this is generally supported on OSX, but found out that this is not the case with Thunderbird. I didn’t give up easily and went to search the Internet. Unfortunately, no one had attempted this, complained about it or filed a bug report. Also, I could not find any documentation about this on the Thunderbird pages.

I wanted to know more and started digging into the source code of Thunderbird. An advantage of open source software. Because this is a Mac OSX specific thing, searching for files related to OSX seemed logical. Eventually, I found a file nsMessengerOSXIntegration.cpp (it is now nsMessengerOSXIntegration.mm) where the logic for this functionality is implemented. While I did find an interesting piece of code, the revisions also were helpful, which led me to bug report #274688. In this bug report, a hook was introduced, which allows to observe a property called before-unread-count-display. Upon notification, the desired badge label can be modified/adjusted (e.g., making 100+ for all counts greater than 100) before it is displayed. If an empty string is returned, however, the badge will be hidden.

And that was it. I digged into it and found an (unfortunately) undocumented extension feature. This allowed to write an extension with the purpose of hiding the badge in all situations. I have actually used it for more than two years. My intention was always to release it and share it with others, but kind of put it off. Since I was updating my other extension anyway, I finally did it.

To my surprise, it was fully reviewed without any complaints right away. So if you want to work without distractions, you can now use Hide Badge Icon to hide the badge of the Thunderbird app icon.

 

Thunderbird Extension: Toggle Headers Updated

My Thunderbird extension Toggle Headers was running smoothly for a long time. It only needed to be kept aligned with the Thunderbird version updates (for the maximum supported version of the extension). Everything was fine until the third-party extension CompactHeader, which is supported by Toggle Headers, released a new version with internal changes. These changes involved some refactoring, which meant the function to toggle between the compact and expanded header pane had a different name (or namespace).

The way I noticed this, since I don’t use CompactHeader myself, was by receiving a 1-star review. Of course, no proud developer likes this. Generally, I prefer to be contacted directly with bug reports and be able to respond before receiving a review. If a developer doesn’t respond, a bad review is then necessary. However, in this case bad reviews could be turned into very good ones, so no complaints in the end :).

Long story short, a new version of Toggle Headers was released. Basically, Toggle Headers v1.0 restores support for CompactHeader 2.1.0 and higher, but at the same time, it still works with older versions. Unfortunately, the new version of CompactHeader contains a bug that prevents toggling between the header modes (Normal/All) to work properly. I reported the bug in the referenced support forums, but haven’t received a response to date.

This required a workaround to be integrated into the new version. When switching from collapsed header pane and Normal to All headers and then back to Normal, the header pane would stay expanded. The Compact option however is checked in the menu. The workaround simply disables and enables the compact header again to make it work until a fixed version gets released.

The same kind of story happened with another one, where an extension I never heard of named Phoenity Buttons made my extension not work anymore. This was due to the usage of the same key shortcut (H). Somehow Thunderbird gave precedence for the key binding to that extension. Fortunately, the developer of this extension was very helpful and even willing to change his key binding to another one.

All in all, a great experience with the Thunderbird extension and user community.

MT4j with Processing 2

In our TouchCORE project at the Software Engineering Lab at McGill University, we use MT4j (Multitouch for Java) for the multitouch-enabled user interface.

For a long time, we had the problem that we couldn’t run it on OSX using Java 7 and newer, because it is based on an older version of Processing (1.x), which in turn uses an old version of JOGL (Java Binding for the OpenGL API). That version is only compatible with the Java supplied by Apple. As we know, they stopped support with Java 6.

We grudgingly lived with this state for a long time, which meant that OSX users needed to download and use an old version of Java. Now, with the new release of Eclipse Mars, support for Java 6 was dropped, i.e., Java 7 or greater is required. We wanted to update to Mars, and since we use some Eclipse plugins, such as the Eclipse Modeling Framework (EMF), we needed to use at least Java 7.

This finally pushed us to update MT4j ourselves. With the help of the UltraCom project who did the same but added a ton of other stuff. Based on their commits we managed to update it on our copy (which already had some minor improvements) of MT4j’s last official release v0.98.

We put it up on GitHub so hopefully other people can benefit from it: https://github.com/mschoettle/mt4j

How to use OCL when running EMF standalone with Eclipse Mars

I previously explained on how to use OCL when running EMF in standalone (not as an Eclipse application). This method works until Eclipse Luna. With Eclipse Mars, OCL was heavily updated again. For instance, it was promoted out of the examples space.

The good thing is it seems to be much easier to initialize it now. Add a dependency to org.eclipse.ocl.xtext.completeocl and use the following code:

PivotStandaloneSetup.doSetup();
CompleteOCLStandaloneSetup.doSetup();

Move more than one directory into a new repository

I just realized that my previous post on how to move one directory from one repository to another really only works for one directory.

Fortunately, there is a very easy solution to that using a nice little tool called git_filter.

Basically follow the instructions of it’s README. Then, all I did was put the two directories into the filter file. It is important to note here that this file had to end with an empty line in my case, otherwise the last directory will be ignored.

You will get a new branch, which can be pushed to an empty repository:

git remote add origin_repoB <url of repo>
git push origin_repoB <localBranch>:master

It also works for one directory and is a lot faster compared to the other method.

« Older posts Newer posts »

© 2019 Matthias Schoettle

Theme by Anders NorenUp ↑