sábado, 31 de julio de 2010

New plugins and more problems...

It has been a week since my last post. I didn't though that I was going to spend that much time working on only two plugins, but I have an excuse. Let's start from the beginning.

As I said in my last post, I was going to work on !google-maps-streetview and !google-maps-route plugins. I finished them both and you can see them in SVN. That's how !google-maps-route looks like:


You can also read a short description on forums (Yes! Jake-PyQT4 has it's own forums now! And a few more things). After finishing them I started testing and I noticed that my current implementation of the text area can't handle images sizes, and that's a really big problem. I'm thinking in possible solutions, and till now the only thing that I see kind-of-possible is a complete web browser (QWebView). That won't be easy to implement at all, because my actual code relies heavily on QTextCursor. Anyways, I'll be working on it. Let's hope that I'll make it.

Good news is that, as some of you may have noticed, this page now has a Screenshots, Downloads and Forum areas. Also, now Jake-PyQT4 has a forum. I started writing in it. There isn't too much to read for now, but I'll keep writing.  andresmcid will be acting like moderator (I can't do everything because of lack of time). He has already written a few posts here, and the forum rules here, so, make sure you don't make him angry or he'll delete your posts :p

So, what now?
I'll be working on the QWebView thing, but not at full-time. Maybe some of you know that I'm working on aMSN2, and billiob and me (main devs) want to release 0.1 ASAP. Anyways, this doesn't mean that you won't see commits. It's just that you'll see 1 commit per day rather than 5.

I'll write next post probably after finishing that QWebView thing. Till then, feel free to write suggestions/ideas/comments/whatever in forums, enjoy released plugins, test Jake-PyQT4 and most important, have a good time!

Bye!

sábado, 24 de julio de 2010

I made big progress (thanks to mgrant)

As I said in my last post, I was having problems with how Linux manages the focus. Well, thanks to mgrant and python-xlib I finally fixed that problem. Well, there's still some really little bug, but I'll try to fix it next weekend.
The little bug: Run Jake-PyQT4 but don't click on it's window. Now it doesn't have the focus. Hide it and show it. It won't get the focus, but it should get it.
Now quit Jake-PyQT4. Run it again, and this time click on it's window. Hide it and show it. It has the focus! Hide and show it as many times as you want. It will get the focus.
So, the bug is that it won't get the focus if the main app never had the focus. Kind of weird...

Next problem I talked about in my last post was Mac and Xlib for it. After a short conversation in #macports somebody told me that the only way of doing it is using cocoa (wtf?). I really would like to use something else, if not python-pure, at least not cocoa. If I'm not able to do that, sorry Mac users, but I'll have to drop hook system for Mac until I know how to do it.

Last problem was Symbian. Well, I'mm really too far from releasing for Symbian, so I won't even talk for it right now.

So, what have I done last week or so? I did the keyboard hook system! It's on it's own class/file (you can have a look at SVN log for commit 30 here). Also, I did another plugin. !google-maps-distance Realle easy to use. It will return the distance (in km) from point A to point B. I'll do two more plugins using gmaps API. The first one is !google-maps-streetview and the second one is !google-maps-route.

What's next?
After finishing those plugins, I'll work a little bit on the skining manager, I'll fix the look of the config dialog (right now really fscked), I'll right the special config dialog for the main app, and then make the app use those settings.

What about after those changes? 
Most probably I'll do some plugins. I really want to make the !mp3 plugin.
Also, I'm looking at whoosh and I'm starting to think about making a file indexer and searcher plugin. It won't be like strigi and it won't have any fancy things. It will just search for files given a string. Anyways, if you wish to see something more advanced, make a patch, send it to me and I could merge it if it doesn't break anything nor it kills my dog. :)

Next post will appear shortly after finishing !google-maps plugins and it will have some screenshots. Until then, have a good time.
Bye!

domingo, 18 de julio de 2010

[Devs] Blocking problems

One major problem that I'm having is the way that Linux manages the focus. On Windows, the top window has the focus after hiding and showing it, but on Linux things are different.
A top window can exist, but this doesn't mean that it will have the focus.
Also, windows with AlwaysOnTop flag won't have the focus (after hiding and showing the window)
There is also another problem. Most desktop environments have a thing called focus-steal-prevention-system. Yes! People get annoyed when they are typing something and a window pops up and steals the focus. I hate that too. But the nature of my app is different. The idea is to have a global key that will show/hide the app. Once the app is shown, it should steal the focus (really, this sounds annoying, but it isn't at all. In fact, it's usefull. Just try yakuake.)

So, what am I going to do to fix (or work-arround) this problem? I'm talking with mgrant, python-xlib maintainer, and he told me that he's going to merge some fixes into current 0.15rc1 branch, and that he'll work on my problem. Once it gets fixed, I could use his code to make my app steal the focus.
Meanwhile, I'll keep working on plugins.

Another big problem is Mac. Recently VirtualBox added native support for Mac, and I already have a basic install, but I'm lazy I haven't tested Jake-PyQT4 at all on Mac. Also, I don't know what could I use to hook the keyboard (that will let me implement the global key show/hide option). This has low priority for now. I'll try to release first for Linux and Windows. Then for Mac, and finally for Symbian.

Yes, Symbian. That's my last problem. Jake-PyQT4 is written in python and qt4, and both things run perfectly on Symbian devices. Also I don't do any fancy things (well, except the keyboard hook thingy), so it should work somehow on that platform. Or not... I guess that it will work fine on my phone (Nokia N97) because it has a keyboard, but how will users with only touch-screen-keyboard-devices type? If you have any ideas, feel free to share them here.
I'll post again once mgrant has added my feature-request.
Bye!

jueves, 15 de julio de 2010

[Devs] Basic design

In this post I'll explain a little bit more how Jake-PyQT4 works. If you're not a developer or if you don't have any coding skills, you can skip this post (if you want :p)

First part: Plugin system

The plugin system is loaded at start up. Once loaded, it will search in "plugins" directory. For each found folder it will search "main.py". If found, it will import it.
Once all plugins have been imported, plugin system will send a "get_capabilities" event.  All plugins can register to events, and every time the plugin system sends that event, all plugins that are currently registered to that event will run certain part of code. NOTES:

* more than one plugin can be registered for the same event.
* events are sent to each plugin synchronously, that means that only one plugin will run at the same time, so don't worry about printing things to the console, as it won't get mixed with the output of another plugins.
* each plugin can return a list of commands that can handle, and also, two plugins can handle the same command. Both plugins will be ran synchronously.

Second part: Libs

Currently I'm using Xlib on Linux and pyHook on Windows to handle the global keys. I'm still missing a Mac OS library, so if you know about some library that I could use, please write me an email, or comment here. I was thinking in using Xlib from darwin ports, but I'm not sure if it will work. Anyways, I guess I'll just have to setup a virtual machine and try it myself.
Also, I'm using googlepy for searching in google. But I have rewriten some parts from that lib because it wasn't working at all or as I wanted.
I'll write one lib per each website that I want to search in, and then I'll use that lib from a plugin. This will keep things simpler, and let more people code plugins without having to rewrite the same code for making queries in the same website.

Third part: Configuration system

Plugins must have the option to store settings. That's why the configuration system exists.
Plugins can have a list of options that will be passed to the configuration system. That list will be parsed and converted in a nice dialog. Settings will be stored in current user home folder.
If you want to look how does that list of options looks like, I suggest you to open up configsystem.py and see it yourself.
There is a large comment section will all types of settins, and a little example.


Forth and last part: Skin system

In fact, there is no skin system :p
I'll make a configuration dialog for Jake-PyQT4 (the main app) and I'll let users to choose a skin from there.
All UI elements can be styled using QSS. Also, tab position and transparency can be set with styles. If you need some help trying to make Jake-PyQT4 look as you like it you may need to read this and this. 

That's all for today! I'll post soon about what problems I think I'll have and what problems I'm having right now.
Bye! 

miércoles, 14 de julio de 2010

So, what can I do with this?

As I said in my last post, plugins can/will do almost anything.
A really simple example is a search in google:


Nothing special, but really quick. Think about using this instead of having to open a web browser. Jake-PyQT4 is as quick as hitting the global hide/show key (by default F8) and typing the search command. Also, as every unix/linux console, Jake-PyQT4 has the ability to autocomplete commands.
At start up the plugin system searches for all plugins, then makes them declare what commands do they accept and stores them. After that, you can easy access all of them with the autocomplete button (TAB by default).

Let's see another example! Searching photos:


Pretty cool. Well, also you can change how does every query looks like. You can change every single data color. Oh, best thing is that every plugin can have it's own query style. You're able to make !google to output everything in green, !google-images to output images size in red, images format en blue, images description in yellow, etc.
If you're thinking in a complex file-edit based config system, you're totally wrong. All that is done using a dynamically created configuration window dialog. Every plugin can have it's own array-of-options code block, and when that plugin calls plugin system's dialog, that array-of-options code block will be parsed and a dialog will be created according to those options. This way all plugins can use the same config dialog. I know you wanna some screenshots, don't you?


Finished looking the configuration dialog and wondering what are all those options? Yes! Exactly! !google-images supports everything that a normal search in google images can offer you. You can sort images by their type, size, color, style...
(A little bug, configuration window tabs are looking somehow bad, but don't worry, I'll fix that ASAP)

Another great thing about Jake-PyQT4 is that you can have as much console's as you wish! It's tab based. Look again on one of the screenshots. You'll notice that there is a little minus button at the left down edge, and a little plus button at the right down edge. Those are used to remove and add tabs. You can also remove tabs by clicking the little red cross on the right size of each tab.

Finally, the general appearence of Jake-PyQT4 is not hard-coded, so don't worry if you don't like transparency. You'll be able to choose the skin that you most love, or even make our own skin, as Jake-PyQT4 skin system is QSS based.

That's all for today! I'll post again tomorrow or maybe friday.
Bye

martes, 13 de julio de 2010

Hello World! (What's all that about?)

Hello world!
So, now that you're already here, you'd like to know what's all that about, right? Well, Jake-PyQT4 is a console based app written in Python and Qt4 bindings that aims to make your life easy searching those things that you want, for example search in google, show the weather, find a download link for an mp3, and a lot more stuff.
Actually, Jake-PyQT4 doesn't do anything of that. What Jake-PyQT4 does is:

* manage plugins, configs, skins
* behave like yakuake (linux console app that looks like quake's console)
* manage global keys / focus

Everything else is done by plugins. And plugins are able to print almost anything to the console (Jake-PyQT4), like photos, rich text, basic html, etc.

The project is hosted here, on sourceforge. You can wait for official releases or use SVN. I don't like breaking things, so SVN will be really stable too.

I'll post some screenshots soon.
Bye