Wednesday, April 6, 2011

Social Extension Now Opens Gwibber Window

Yesterday after class, I discussed with my team the method I found for extracting currently playing track information from Banshee and Brandon mentioned that he found another extension that was utilizing a right click menu and a pop up window just like we wanted to utilize. The name of the extension was LastFMFingerPrint and if I remember correctly it was used to find track information about a song by searching through LastFM. What we all ended up doing was taking parts of the code that we would need from the LastFM extension and implementing it into our extension's code. It took us the rest of class and even well after class to get everything to work right, but by the time 4 or 5 o'clock rolled around we had our extension's action showing up in the right click menu of all songs. We were really happy about that!

The core issue that we faced with getting our extension event action to show up in the right click menu had to do with an XML file in the LastFM extension. This XML file contained elements and attributes about where to add your action (in our case called ActionEntry) in the Banshee menus. This XML file was called in the code and probably parsed in order to properly place the action to the correct menu. What we did with this XML file was copy its contents, rename it "Social.xml", and alter some of the attribute values to fit our social extension. Once we altered that file and added it to a resources folder we created in our project, we were able to right click on a song and our action appeared in the menu.

After getting our action to show up in a right click menu, our group decided to call it a day. I went home and messed with the code a little more to see if I could get our Gwibber window to pop up upon clicking on our social action. I got it to work with in no time. All I did was take the Gwibber window code that we had in a separate file and created a new class for the Gwibber window in our social extension project. From there we have an action event method in the main social extension code that creates and instance of the Gwibber window class and calls a method to run the window when the social action receives an action event (in this case a mouse click). That was all there was to it and we are now almost caught up with our schedule. From, here we have to figure out how to load the track information into the Gwibber window, test it, write documentation for it, format the code to fit the Banshee coding standards and then submit it to Bertrand Lorentz for review. Yesterday was a very productive and a breakthrough of a day. I have more confidence that we now have a better handle on our project and we are learning everyday the inner workings of the Banshee project.

No comments:

Post a Comment