Saturday, March 28, 2009

Affinity Updates

I've been pretty quiet recently, but Affinity development hasn't been. Affinity now has a shiny new Clock plugin! It's pretty simple and displays the time and date in text form. The clock plugin uses the logo from MacSlow's Cairo-Clock in Affinity Preferences, so it needed an about dialog to give credit. I added a simple about button next to its preferences button. I figured all the applets should have one, so I added one to each. However, I thought all the star icons might be a bit overkill, and malept said that it wasn't obvious what the icons represented. So, instead, I made a plugin button with the plugin's icon. Clicking it pops up a menu like right-clicking an Awn applet would.
Screenshot:



Of course, that's not all the exciting news: the translation template has been updated and there are 12 languages at least partially-translated, and two (Spanish and British) are completely translated. Nine others are over 50% translated. Of course, there are many thanks to the translators. If you want to help with translations, just start here.

The Awn rewrite has still been progressing. Affinity now supports it automatically, but still stays with gilir has been working on Debian packaging and has a Jaunty package of revision 160 in his PPA for testing. Also, he is now a member of ~affinity-devel.

In other Linux news, I've been using the fonts from Android a la these instructions. They look great and use much less space. Also, the beta of Ubuntu 9.04, Jaunty Jackalope, was released. I've been trying it in a VM since alpha 4 and it's been working great, with only a few minor bugs and (surprisingly!) no audio problems. I decided to skip 8.10 because I didn't feel compelled enough to upgrade and I heard of audio problems, so 9.04 should bring plenty of changes (hopefully not including dataloss). I've also added a countdown (24 days as of writing) to the right on my blog.

Friday, February 13, 2009

Awn-Extras Translations

There hasn't been much in Awn-Extras translations: Only 32 strings, all from mail, that weren't imported into awn-extras and wouldn't work even if they were. I uploaded a new template to Launchpad that includes 273 strings from all the applets that at least use the gettext functions. It's been approved, but (as of writing) it hasn't yet been imported. There's also a new file in libawn-extras, 'defs', that tells the prefix and the gettext directory:
>>> from awn.extras import defs
>>> defs.PREFIX
'/usr/local/'
>>> defs.GETTEXTDIR
'/usr/local/share/locale'
This way all the translations are/will be in a single place, and translating will be much easier. To-do now supports translations, and mail will be able to when the new template is imported. The template is created by using 'xgettext'. This is what I ran to get the template:
xgettext src/*/*.py src/*/*.c --keyword=_ -o po/messages.pot --from-code=utf-8
This is the necessary Python code for making an applet translatable:
import gettext
import locale
from awn.extras import defs

APP = "awn-extras-applets"
gettext.bindtextdomain(APP, defs.GETTEXTDIR)
gettext.textdomain(APP)
_ = gettext.gettext
Pass every translatable string to the '_' function. Make sure to put all the text in one long line, as in don't use multiple strings combined by '+'. If you need to use variables, use '%s', etc. This is necessary for xgettext to recognize the string.

I imagine it's mostly the same in C. Some of the applets already have the translation code. When the translations are downloaded from Launchpad, the .po files go in the po folder, the ISO codes are added to the LINGUAS file in po and the ALL_LINGUAS variable in configure.ac. I did some testing with To-do in Spanish, and it works.

Awn Extras Translations

P.S.: If you haven't tried out 0.3.2, what are you waiting for?

Update: The template has been imported!

Saturday, January 24, 2009

It's Been a While

Almost two months. Very much has happened: new year, new presidency, new semester.

Awn Rewrite
The Awn rewrite has been progressing rapidly, with bugfixes and new features. Malept has written up a blog entry about it. The rewrite magic happens here.

Awn Trunk
More work has been done on mostly bugfixes and translations. Even the ages-old bug of Awn crashing when the taskmanager applet is removed was fixed. Check this branch for the changes.

Awn Extras
Awn Extras has had considerable development: Comics, Cairo Clock, Awn Terminal, PyNot, and the build system all had significant work. [Branch]

Affinity
Affinity development hasn't been very active over this time, though there's been a bit more development recently. Affinity now correctly detects Beagle if it's installed and now installs an Awn applet if Awn's installed. [Forum thread]

Monday, December 08, 2008

Happy Uzbekistan Constitution Day!

Although it's not as exciting as Halloween or Thanksgiving to most, there's some exciting news for Affinity:



AffWindow now allows for multiple instances! This can be used for dialogs, such as preferences and about dialogs, as seen in the screenshot. If it's not the main window, Affinity will draw a nice little X in the top right corner to close the window. It even changes color on hover and button press.
Also, though more on the minor side, AffFrame allows plugins to place arbitrary widgets in an HBox with the label. This allows for the preferences button in To-Do and the clear button in Favorites.
Otherwise, there are only some minor fixes and enhancements, and a new translation template with new strings.

In the Awn world, there are (at least) three new applets out on the forum. The 'exit' problem has been fixed in the terminal applet, and (I think) it now has initial tab support. Triggerhapp has been working on RGBA support in PyNot. Both the comic (Dilbert) and the Comics! applets got new comics and other enhancements. And, of course, work on the rewrite has been progressing, with partial thanks to a nvidia driver bugfix.

Sunday, November 30, 2008

Happy Belated Thanksgiving!

To those who don't celebrate Thanksgiving, happy belated November 27th. :)

It's been a month since I last posted about Affinity (or anything else for that matter). That's not because there hasn't been much to talk about. Actually, it's quite the opposite.




Here's the most exciting stuff:
  • A to-do list plugin. (!) Currently it's bare-bones but eventually it'll be more like Awn's to-do list applet. It's not yet committed as of posting, but it will be soon.
  • AffSettings is now a GObject, which allows for multiple instances, allowing plugins (such as to-do), etc. to manage their own separate config files. It also uses GKeyFile instead of gconf. This is one step closer to making Affinity desktop agnostic.
  • AffButton and AffFrame now use GObject properties and are much more robust. AffButton can now take the icon name and size instead of a GtkImage.
  • An AffPlugin class, which should simplify and reduce code. As Affinity's plugin system becomes more robust, AffPlugin will probably serve more of a purpose.
  • Recent searches and files plugins are both fixed.
  • Of course, many bugfixes, some minor, some blocking.
And, of course, there are many other things, all of which can be found on the bzr changelog.
Also, Affinity is now translatable! Six languages are currently translated or almost translated. (Thanks to the translators :)

Thursday, October 30, 2008

Trick or Treat!

To celebrate the mass consumption of sugary candy on this Hallowed Eve, I present to you some chocolate coated eye candy:



That's njpatel's Affinity, which hasn't been worked on in a while until the past month or so. Here are some things that I got done on it:
  • a right-click context menu,
  • an about dialog,
  • a recent searches / clear current search button,
  • the option to only hide the window when forced,
  • the option to have the buttons draw as normal Gtk buttons,
  • the option to get the colors from Gtk,
  • the option to draw borders and a gradient around the frames,
  • automatic refresh of colors when changed,
  • and, most notably, plugins!
  • Also a "Run" plugin, like Alt-F2.
Affinity lives in Launchpad and has a wiki with some screenshots. Want to try out Affinity?
bzr co lp:affinity
cd affinity
./autogen.sh
make
sudo make install

I'd love to say more, but I have to go hand out candy to ghosts and goblins in costumes, and I can't think of much else to say. :)

Saturday, September 13, 2008

To-Do Progress Button; Other Updates

As suggested by onox, to-do now has a visual way of displaying an item's progress in the main listing. There's now a small button to the left of the edit details button. It's in pie chart form, and the colors come from the main icon. Scrolling on the button will increase or decrease the progress by 5%. Clicking it will edit the item's details, giving focus to the SpinButton for progress. It also has a tooltip that displays the progress. Of course, a screenshot is in order, so:


There are also a few new applets: CPU Frequency Monitor, Firefox 3 Bookmarks, and Media Player. Off the top of my head, these applets have been committed to trunk recently: Animal Farm, CPU Frequency Monitor, DesktopManager, and Media Player.

Thursday, August 14, 2008

Detach in C again, but in AwnApplet

I switched development of Detach to these two branches:
lp:~sharkbaitbobby/awn/awn-detach2
lp:~awn-extras/awn-extras/awn-detach3

Instead of being a separate GObject in libawn-extras, Detach is now a bunch of functions integrated into AwnApplet in libawn. It now does everything but save the position when Awn is restarted. As far as I can tell, to use Detach, most applets only have to add 4-5 lines and modify another one. As of writing this, only two applets, main-menu and to-do have been converted. Also, Python bindings work well now.

There is a wiki page with documentation here.

Thursday, August 07, 2008

Gedit Web Browser Plugin

If you've ever been typing away on Gedit and needed to look for some obscure Gtk reference, then this plugin might be for you. It adds an address bar between the toolbar and main Gedit pane, along with buttons for back, forward, new tab, and, of course, go. If you are currently editing a text file and hit the go button, it'll open a new tab with the page in the address bar. The plugin makes it look like it's integrated, so that one tab could be a text document, another a web page, the next a text document, etc.

Screenshot

Download
Current version: 0.1.0.0.1rc2
You can download the plugin here. Unpack it in ~/.gnome2/gedit/plugins (the directory might not exist, so create it if neccessary) or /usr/share/gedit-2/plugins. It will show up in Gedit's list of plugins as "Web Browser."

Problems
It's not really integrated, and could conflict with other plugins that do things certain things like adding other widgets to Gedit's main VBox. Also, doing things like saving and printing the "current document" when it is actually a web page will do so to a blank document, because Gedit itself doesn't actually know about the web page.

Wednesday, July 30, 2008

Some Updates

Detach
The first version of Detach is out, and is fully functional. Two applets, Awn Main Menu and Awn Terminal Applet, have been converted. The Python bindings unfortunately currently don't work. [Link to Branch] [Screenshot 1] [Screenshot 2]

Wiki
Malept has rewritten the "How to use Bazaar" page on the wiki. It shows how to set up Bazaar for Launchpad. Even if you're not using Bazaar + Launchpad for Awn [Extras], it's worth a look.

Applets
We now have three new applets. The first, "Desktop Switcher," can organize your desktop backgrounds and even cycle through them. The second, Xfce Menu, is a main menu for Xfce users. And the third, Netflix Applet, views the RSS feeds from Netflix.

Thursday, July 24, 2008

Detach now detaches

Detach now detaches. (!) It handles the showing and hiding of an Awn dialog and can also detach. Right-click the applet and click 'Detach', and a new window will popup. The default is the applet icon. Click it to show the dialog, with a transparent background. So far, the only applet converted to use Detach (in C) is the Main Menu Applet. See Screenshot. The are many, many little things that have to be fixed or implemented, such as not hiding the dialog when clicking it, and a few large things, such as attaching.

Get Detach in C at my branch.
bzr co lp:~sharkbaitbobby/awn-extras/awn-detach
./autogen.sh
cd src/libawn-extras
make
sudo make install
cd ../main-menu
make
sudo make install

Here's an example of what the code will look like now:
Detach *d;
d = detach_new(applet);
detach_add(d, widget);
GdkPixbuf *icon = awn_applet_simple_set_awn_icon(applet, APPLET_NAME, APPLET_ICON);
detach_set_pixbuf(d, icon);
detach_add_menu_item(d, detach_menu_item_simple(d));
...
detach_hide_dialog(d); //Would be used to force the dialog to hide, even if focus isn't lost

Monday, July 21, 2008

Detach now compiles

The Detach library now compiles. (!) It's written in C and is included in libawn-extras in my branch. This will allow any applet to detach just like to-do, run, and SlickSwitcher do. Unfortunately, there's not too much to see now. You can look at the source code to get an idea of what the it'll be like. Here's some examples:
GObject *d;
d = detach_new(applet);
detach_add(d, widget);
detach_set_icon_type(d,DETACH_ICON_SURFACE);
detach_set_surface(d, surface);
This is only the second thing I've done in C, and, for me, the process has been surprisingly easy. C does seem somewhat intimidating with pointers and type casting, etc., but it's really not that hard. I learned a lot by just looking at Awn's (and -Extras') source code.

Next I'm probably going to do Python bindings for it so I can test it more easily.

Wednesday, July 16, 2008

SlickSwitcher it is!

I recently decided on the name SlickSwitcher... and, um...
You can download it here, however the forum thread will always have the most recent version, until it is included in Awn Extras. :)

Monday, July 14, 2008

Sin Nombre dialog colors

You can now change the colors of the Awn dialog in Sin Nombre, via the Preferences window. Personally, I currently don't use this as I like my black background-blue border dialogs. :)

See Screenshot

In other news, I'm very close to choosing "SlickSwitcher" as the name. isaac_j87 started an Ubuntu Forums thread asking for name suggestions. Most people agreed with SlickSwitch[er], but there are some other suggestions. [Link]

Sunday, July 13, 2008

Awn Icons

moonbeam has been working on a new feature in Awn called awn-icons, which allows users to drag an icon onto the applet itself and change the icon. The user can choose from the applet instance, the applet, or the type of icon for applying. So, if a user drags a new icon onto File Browser Launcher and chooses icon type, all of the applets that use the 'folder' icon will change. (AFAIK, this would require a restart of Awn/ the applets.)
This enables users to change icons for applets that they couldn't before, such as the media icons and MiMenu. Use Ubuntu but want the translucent GNOME logo on MiMenu? Just drag and drop it on MiMenu. Got some nice back, play, and forward icons? Just drag them on to the media icons applets.

Applets that have been converted (note: I'll try my best to keep this updated):
*Affinity
*aRSS
*AWNLib (not an applet, but still)
*Awn Notification Daemon
*Awn Terminal
*Cairo Menu
*Cairo Menu Classic
*Comic
*Comics
*File Browser Launcher
*Main Menu
*Media Control
*Media Icons
*MiMenu
*Mount Applet
*Mobile Meebo
*Pandora
*Places
*Quit Applet
*RTM
*Run (not in Awn Extras)
*Show Desktop
*Tomboy Applet
*TsClient
*Web Applet
IIRC, every applet that should use Awn Icons does. (!)

Several applets distribute icons that aren't found in a normal theme and use them as their icons. One example is the Quit Applet. You have to modify Makefiles to place the icons in the appropriate directory. I'll show the Quit Applet's [Make]files.

src/quit-applet
Makefile.am
quit-applet.py
quit-applet.desktop.in.in
icons/
Makefile.am
application-exit.svg

src/quit-applet/Makefile.am:

SUBDIRS = icons
APPLET_NAME = quit-applet
APPLET_MAIN_FILE = quit-applet.py
include $(top_srcdir)/Makefile.python-applet
dist_applet_DATA = \
COPYING \
$(NULL)

src/quit-applet/quit-applet.desktop.in.in:

[Desktop Entry]
Version=1.0
Name=Quit-Logoff applet
Type=Application
X-AWN-AppletType=Python
Comment=A applet to exit your session
Exec=quit-applet/quit-applet.py
Icon=quit-applet/icons/scalable/apps/application-exit.svg
Name[en_US]=Quit-Logoff applet
X-AWN-AppletCategory=System

src/quit-applet/icons/Makefile.am:

dist_quitapplet_DATA = \
application-exit.svg \
COPYING \
LGPL

quitappletdir = ${prefix}/share/avant-window-navigator/applets/quit-applet/icons/scalable/apps/

You must place the icon[s] in a separate directory named "icons," otherwise this won't work. Note that you can actually omit the instances of "scalable/apps," which would be better if you have only one icon. Also, if your icon is not an SVG image, either change "scalable" or just omit that part.

Now all the quit applet has to do to get the icon is this:
self.set_awn_icon('quit-applet', 'application-exit')

If an applet needs the icon as a Pixbuf, such as for preferences dialogs, etc., the set_awn_icon method returns the Pixbuf. It's owned by awn-icons, so you would want to use the awn-icons API directly, which currently doesn't have Python bindings.


Note: If you are using this as a tutorial for converting these applets and you need anything clarified, etc., just tell me. :)