Adding custom items to the panel – unity-2d

That was tricky!
There is no way to drag&drop push/pull/faceroll favorite app to launcher in unity-2d if you started it from terminal (or by other hacky way) except:
Read carefully the http://standards.freedesktop.org/desktop-entry-spec/latest/, or search for an existing .desktop files and modify that (#win):

akoskm@turing:~$ dpkg-query -S nautilus-home.desktop
nautilus: /usr/share/applications/nautilus-home.desktop

Now you know the location, let’s go and delete unnecessary things and modify patches according to your application:

gksu gedit /usr/share/applications/nautilus-home.desktop &

then File > Save As with the name of your application (I did this for eclipse so it will be eclipse-indigo.desktop).
Finally here is how my eclipse-indigo.desktop launcher looks like:

[Desktop Entry]
Version=1.0
Name=Eclipse Indigo
GenericName=IDE
Exec=/home/akoskm/Applications/eclipse-indigo/eclipse %U
Terminal=false
Icon=/home/akoskm/Applications/eclipse-indigo/icon.xpm
Type=Application
Categories=Programming;IDE;

Finally you should add it to the launcher. Start gconf-editor then navigate to /desktop/unity-2d/launcher.
Right-click to favorites key, Edit Key, Add and as New list value type the name of previously created .desktop file. Okay. You can move up/down the entries as you discovered already.
Now restart the panel:

killall unity-2d-launcher
.
You should see a launcher for your app.

Advertisements

Adding items to the panel – unity-2d

Not a big trick but if you were using unity (not the 2D one rather the Compiz version) you should expect that right clicking on an application brings up a menu where you can add your favorite application to the panel.
But this is not the case!
You should start the application, and _while_ it is running do a right-click on its icon in the panel and select “Keep In Launcher”.
Keep in Launcher

Building Qt Jambi from source on Ubuntu 11.04

To build it from sources you have to install the following dependencies:
ant, java (either the sun-java6-jre or the openjdk one), qt development libraries .
If you don’t know what I’m talking about paste the following line to your terminal:

sudo apt-get install default-jdk default-jre ant libqt4-dev libqtwebkit-dev libphonon-dev phonon-backed-gstreamer

Modify qtjambi.java.library.path in your buildpath.properties according to libstdc++.so.6 location.
In my case it is:

akoskm@turing:~/qtjambi/akoskm-unittests$ dpkg-query -S libstdc++.so.6
libstdc++6: /usr/lib/i386-linux-gnu/libstdc++.so.6.0.14
libstdc++6: /usr/lib/i386-linux-gnu/libstdc++.so.6

after replacing the default path it looks like:
qtjambi.java.library.path = /usr/lib/i386-linux-gnu
Build it:
ant all
Happy hacking !

The packages in ppa should arrive soon, stay tunned.

Phonon VideoPlayer in Qt Jambi – Screencast

Hi!
I made this short screencast to show you some of the Phonon functionalities inside Qt Jambi. Enjoy:

-left my internal mic. on, sorry for the background noise-
The code is pretty self-explanatory, you should point with MediaSource to a media file (audio/video):

package org.qtjambi;

import com.trolltech.qt.gui.*;
import com.trolltech.qt.phonon.*;

public class Demo extends QWidget {

private VideoPlayer vp = new VideoPlayer();
private QPushButton play = new QPushButton("Play");
private MediaSource ms = new MediaSource("demo.ogv");

public Demo() {
setWindowTitle("Phonon Demo");
QVBoxLayout qvb = new QVBoxLayout();

vp.load(ms);
play.clicked.connect(vp, "play()");

qvb.addWidget(vp);
qvb.addWidget(play);

setLayout(qvb);
}

public static void main(String [] args) {
QApplication.initialize(args);
Demo demo = new Demo();
demo.show();
QApplication.exec();
}

}

Qt Jambi Unit Tests

Here is a quick report about the ongoing development around unit tests.
We had a few autotests for different parts of Qt Jambi, now most of these tests are running properly and producing a report.
My generator tests were also added and they should appear in the same report.
A tests.properties file is added to the root directory where you should point to your junit and hamcrest jars (it’s possible that hamcrest is included in junit.jar, in this case leave hamcrest path empty).
I made 2 ant targets available to get the tests compiled and running, first

tests.compile

will compile and build the required library/sources for autotests, and

tests.run

should run the tests.
Finally you can open the generated test report build/TestResults/index.html.