Firefox 4.0 pre-beta released

July 4th, 2010

Lifehacker shown a screenshot of the new Firefox 4.0 pre-beta for Windows. Here it is (Mozilla names Firefox beta versions “Minefield”):

Nice, isn’t it? So, I downloaded the new beta for Linux, and it looks like the screenshot below. I had to set the tabs to be on top; Windows version brings this for default (at least the one that I installed using Wine).

Firefox 4.0 pre-beta on Linux

Compare. The screenshot below is Firefox 3.6.4.

Firefox 3.6.4 on Linux

It’s a little far from the mockups of Firefox for Linux at Mozilla’s site. I hope I can see it soon. :)

VolumeSlider’s tooltip misbehaviour

June 29th, 2010

I was developing a Qt application that makes use of a Phonon::VolumeSlider object. But after clicking the mute button beside of the VolumeSlider and verifying its tooltip, I noticed it was showing the wrong volume. A video can explain this better than me:

If you want to reproduce this problem, you can download its source code as a Qt Creator project. Please keep in mind that it’s the source code with errors!  But there’s a workaround to this problem:

1. In the class where you create the Phonon::AudioOutput whose volume is handled by the VolumeSlider, put this:

connect(audioOutput, SIGNAL(mutedChanged(bool)), this, SLOT(handleMute(bool)));
connect(audioOutput, SIGNAL(volumeChanged(qreal)), this, SLOT(handleVolume(qreal)));

2. Create the slots you used above using the following code:

void MainWindow::handleMute(bool mute) {
    if (!mute) {
        audioOutput->setVolume(outputVolume);
    }
}
void MainWindow::handleVolume(qreal volume) {
    outputVolume = volume;
}

3. Declare the slots and the outputVolume variable in your header file:

private:
    qreal outputVolume;

private slots:
    void handleMute(bool mute);
    void handleVolume(qreal volume);

You can download the fixed source code. I don’t know if this behaviour is the expected in Qt, but I filed a bug for it.

Haiku OS R1 alpha 2

June 28th, 2010

I’ve been reading about Haiku OS for some years. Haiku is an operating system inspired by the extinct BeOS, and for me it’s like an Unix clone with a good and clean interface, like Mac OS, but free.

Some months ago its developers released their first alpha, that I’ve already talked about and shown some screenshots. Some days ago they released a new version, Haiku R1 alpha 2. The interface is even better than before and the new features are great. My favourite one is WebPositive, a WebKit-based browser:

WebPositive

I maximised the WebPositive window and its menubar became like a Mac OS apllication menubar:

WebPositive's menubar

Something I didn’t notice in the latest release: Haiku has support for desktop applets. And OpenGL support is already there too:

Haiku Desktop

Upgrading packages built from AUR

June 22nd, 2010

Some Arch Linux users, like me, are used to build packages from AUR. After some time they become out-of-date and it’s a hard work to upgrade them.

But yaourt comes to save us, with a single line:

yaourt -Su --aur

It upgrades all packages that aren’t in Arch Linux official repositories. And you can see its friendly output below:

Yaourt

Windows 95: someone still loves you

May 28th, 2010

Or at least uses you.

I use StatPress to get statistics of the last readers of this blog. One of the informations I have access to are the operating systems that the last visitors were using. And how surprising it was to discover that I still have a visitor that was using Windows 95:

I really hope this person is using some extension to change his/her browser’s user agent header or just woke up from a sleep of 10 years or more.

Fixing problem with Subclipse and svn+ssh repositories

May 27th, 2010

I was trying to synchronise a Java project with a SVN repository that runs over a SSH tunnel. It was working right in the command line, but in Subclipse it was showing a “network connection closed unexpectedly” error.

It was fixed changing the SVN interface from JavaHL to SVNKit in Eclipse preferences (click to zoom):

Changing SVN interface in Eclipse

Open Sonic

May 26th, 2010

I was looking for some good games for Linux a few days ago and I found an incredible one: Open Sonic. It’s a free, open-source game featuring Sonic The Hedgehog (don’t tell Sega about this) and it’s available for Linux, Mac and Windows. And it’s very, very fun, just like the old Sonic games for Master System and Genesis I used to play fifteen years ago. I’m getting old.

The game is still under development (only two levels until now), but it’s a good game anyway. It has a cooperative play mode which lets you control three characters simultaneously (Sonic, Tails and Knuckles), and at some parts you need to use two of them (Tails must open a door so Sonic can pass, for example).

There’s a demo video available. It’s a little bit outdated but it can show what the game already has to offer:

How to fix ugly fonts in Qt-based applications

May 20th, 2010

I was using Qt Creator and tried to change the editor’s font to Monaco, 9. But hey, Monaco is not that ugly:

Monaco before fix

So I googled a way to fix for this problem, and found the fix at Arch Linux forums. You’ll need to create a file called .fonts.conf in your home directory with this content:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
   <match target="font" >
      <edit mode="assign" name="rgba" >
         <const>rgb</const>
      </edit>
   </match>
   <match target="font" >
      <edit mode="assign" name="hinting" >
         <bool>true</bool>
      </edit>
   </match>
   <match target="font" >
      <edit mode="assign" name="hintstyle" >
         <const>hintslight</const>
      </edit>
   </match>
   <match target="font" >
      <edit mode="assign" name="antialias" >
         <bool>true</bool>
      </edit>
   </match>
</fontconfig>

I closed Qt Creator and reopened it. The result was this:

Monaco after fix

Why I chose Qt

May 13th, 2010

A few months ago, I planned to learn some graphic toolkit. As a GNOME user, GTK was my natural choice. Although I’m a Python lover, I chose C++ because I just wanted to learn a new language and stop being afraid of pointers. So I started to read the gtkmm documentation, like tutorials and API, and to program a simple music player. I was learning gtkmm and it all seemed okay.

But I read a little about Qt and, after talking with some friends about the pros and cons of GTK and Qt, I decided to do with Qt the same things that I’ve already done with GTK up to that point. So I would know what choice was better for me. Notice that I’m not saying that Qt is better for everybody and that GTK must die, but that Qt looked better for me and my personal project. After this disclaimer, and can tell my reasons:

  • Look & feel. I’m a look&feel fanatic, and sometimes I move from GNOME to KDE only to check its new features. But I hate how GTK applications look in KDE. You can use gtk-qt-engine, but you’ll still notice the differences. You can set GTK to use the excellent QtCurve theme, that have identical versions to Qt and GTK, but you’ll get tied to a theme. But look what you have if you run a Qt application in GNOME (gedit is a GTK-based application and Picard is a Qt-based application):

    Thanks to QGtkStyle, Qt applications detect if you are in GNOME and your Qt application gets an almost perfect GTK look & feel. And yeah, it includes open and save dialogs.
  • Documentation. Qt has a very, very rich and well-organised documentation, with tutorials, API references, and examples. gtkmm also have all these items, but they didn’t look very friendly to me. And the documentation of Qt 4.7, still in development, will be even better.
  • A simple, but good IDE. A good programmer must not be dependent on IDEs, but they really help you. I tried to use Anjuta (unstable sometimes), MonoDevelop (very good for .NET platform, but not a good IDE for C/C++ development) and Netbeans as IDE when I was using gtkmm, and I was not satisfied with them. But Qt has its official IDE, Qt Creator:

    Qt Creator is clean, simple, and complete. It has quick access to documentation, breakpoints, project configuration, native support for CVS, Subversion and Git, good code completion, a good GUI designer (like the GTK’s Glade), among other features.
  • Runs well on many platforms. Qt is smart enough to run well – and with native look & feel, I really like this – in Linux, Mac, Windows, and others.

But Qt still has some cons:

  • Users should have it installed to run Qt applications, and this is not very usual in Linux environments based on GNOME, neither on Windows systems.
  • Qt is free only if you’re using it in a free project. For commercial applications, you must obtain a commercial Qt licenceUpdate: this is not exactly a con. You still can use Qt under LGPL in commercial applications, but if you make any change to Qt you must publish them or purchase a commercial Qt licence (thanks, krok, for the comment).

If you’re beginning to learn to program for graphical environments or you’re looking for a good graphical library to use in your project, you really should give Qt a try, implement some examples and feel which option is better for you.


Mudança de planos

May 12th, 2010

O blog está passando por mudanças. São elas:

  • O nome e o endereço mudaram. :) Decidi colocá-lo em meu próprio domínio, esdrasbeleza.com. Quem assinar o feed RSS do blog, por favor atualize o endereço.
  • Os textos passarão a ser em inglês. Já que o intuito é compartilhar o conhecimento, achei que em inglês eu atingiria um público maior de pessoas.

:)