[07:32] <Skilly>  p
[11:18] <ilias> hi
[11:18] <ilias> anyone?
[11:19] <ilias> help
[11:19] <ilias> cuc
[15:14] <P05TMAN> Hello
[16:59] <dpm> hello everyone, Ubuntu App Developer Week is starting in a few minutes!
[16:59] <c2tarun> hellp dpm
[16:59] <c2tarun> hello :)
[16:59] <yofel> o/
[17:00] <c2tarun> yofel: surprise to see you here :/
[17:00] <yofel> :P
[17:00] <dpm> :)
[17:01]  * DraZoro says hi all 
[17:01] <c2tarun> I think its time :/
[17:01] <c2tarun> !time
[17:02] <dpm> let's wait for a few minutes for the first speaker to turn up...
[17:02] <TheEvilPhoenix> c2tarun:  uh... lol?
[17:03] <jryannel> sorry I'm late
[17:03] <TheEvilPhoenix> !time
[17:03] <TheEvilPhoenix> :P
[17:04] <dpm> jryannel, no worries
[17:05] <dpm> Everyone welcome the first speaker of today. It's Qt's jryannel, who's going to talk about Qt Quick: Elements/Animations/States
[17:05] <c2tarun> jryannel: hello :)
[17:06] <jryannel> Hi all,
[17:06] <jryannel> Before we do, plase download: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/slides/qml-composing-uis.pdf
[17:06] <TheEvilPhoenix> wait a sec, why hasnt Classbot +m'd the place yet?  shouldn't it be doing that?
[17:07] <jryannel> Can I continue?
[17:08] <jryannel> There are also the examples/labs available at: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/addons/addon-qml-composing-uis.zip
[17:09] <jryannel> This is part of our Qt Quick Essentials Training Material. Available to download from: http://qt.nokia.com/developer/learning/online/training/materials/qt-essentials-qt-quick-edition
[17:10] <jryannel> We skip the first slides (we covered it roughtly yesterday) and go ahead to slide 21 (Anchors)
[17:10] <jryannel> We learned yesterday we can position elements by x, y and width/height.
[17:11] <jryannel> Often we want to layout elements
[17:11] <jryannel> this is done with anchors
[17:11] <jryannel> A anchors is another contract
[17:12] <jryannel> It says roughly this element shall always be on the left site of the other element
[17:12] <jryannel> anchors.left: other.left
[17:12] <jryannel> So also when you move one element the other will always follow
[17:13] <jryannel> You have top/bottom/left/right anchors
[17:13] <jryannel> and also horizontalCenter/verticalCenter
[17:13] <jryannel> Slide 22:Anchors
[17:13] <jryannel> This is an example how to use anchors
[17:14] <jryannel> remember you can reference other elements by id
[17:14] <jryannel> anchors.centerIn: rectangle1
[17:14] <jryannel> centerIn centers rectangle1 in this element (width and height is not changed)
[17:15] <jryannel> We jump to slide 25: Margins
[17:16] <jryannel> An anchors fixes on eelement to another element.
[17:16] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.
[17:17] <jryannel> For reference: We use the slides at: http://qt.nokia.com/developer/learning/online/training/materials/qt-essentials-qt-quick-edition
[17:17] <jryannel> Called; Composing User Interfaces
[17:17] <jryannel> We are on slide 25
[17:17] <jryannel> A margin provides some space between the anchoring
[17:17] <jryannel> Slide: 26
[17:18] <jryannel> Here we see a rectangle containing 2 elements (image + text)
[17:18] <jryannel> image and text shall be vertical centered and have some spacing between
[17:19] <jryannel> The image is anchored on the left side of the parent's left side
[17:19] <jryannel> and has on the left side 1/16th of space of the width of the parent
[17:19] <jryannel> and sure the image is vertical centered
[17:20] <jryannel> similar applies to the text. But instead of anchored to the parent it's anchored to the image
[17:20] <jryannel> The anchors.baseline is important for text to anchors according to the textbaseline
[17:21] <jryannel> Anchors are also described in more detail at: http://doc.qt.nokia.com/4.7-snapshot/qml-anchor-layout.html#anchor-layout
[17:21] <jryannel> So besides of positioning elements by x,y we can also anchors them with margins.
[17:22] <jryannel> Often you want to anchor element in a row or column or a grid. For this we have spezialised elements
[17:23] <jryannel> They are called Column, Row, Grid
[17:23] <jryannel> They are helper elements to avoid writing common code
[17:24] <jryannel> See http://doc.qt.nokia.com/4.7-snapshot/qml-positioners.html for more information
[17:25] <jryannel> anchors can be used to produce very powerful ui and also felxible from the screen dimensions
[17:26] <jryannel> Okay. Let's go to the next module. We jump over module user interaction and go direct to states
[17:26] <jryannel> Please download: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/slides/qml-states-transitions.pdf
[17:27] <jryannel> A state describes your ui in different "phases"
[17:27] <jryannel> E.g. in simple terms it defines how properties values shall be in these different phases
[17:28] <jryannel> If you problem downloading: http://qt.nokia.com/developer/learning/online/training/materials/qt-essentials-qt-quick-edition
[17:28] <jryannel> Then choose: States and Transitions
[17:29] <jryannel> So think about a stop and a go light. Both are represented by a rectangle
[17:29] <jryannel> See 6
[17:29] <jryannel> Slide Nr. 6
[17:30] <jryannel> in a "go" state we want one rectangle green in the "stop" state we want the other rectangle red.
[17:30] <jryannel> Slide: 7
[17:31] <jryannel> We describe the states with the states property.
[17:31] <jryannel> Which is an array of State elements
[17:31] <jryannel> a property array is marked with [ ]
[17:32] <jryannel> state go has the name "go" and state "stop" is names stop.
[17:32] <jryannel> Both describe changes to properties to elements declared earlier
[17:32] <jryannel> "stop" state changes the color of stop_light to red
[17:32] <jryannel> and go_light's color to "black"
[17:33] <jryannel> How to switch between the states?
[17:33] <jryannel> use the state property and assign the state name
[17:33] <jryannel> Slide: 8
[17:33] <jryannel> Setting the State
[17:34] <jryannel> each element has a state property and a states property
[17:34] <jryannel> states is the array of states and state contains the name of the current state.
[17:35] <jryannel> onClicked: parent.state == "stop" ? parent.state = "go" : parent.state = "stop"
[17:35] <jryannel> onClicked is a clicked handler from the mousearea.
[17:35] <jryannel> A mousearea is an area which received mouse clicks, presses, releases...
[17:36] <jryannel> we first ask for the current state and if it's "stop" we change it to "go".
[17:36] <jryannel> Qt Quick recognizes the change and updates the ui based on the state
[17:37] <jryannel> very simple
[17:37] <jryannel> We jump to slide: 12
[17:37] <jryannel> Another example, little bit more complicated.
[17:38] <jryannel> Qe have a text in a rectangle
[17:38] <jryannel> Additional we have a image (clear_button) which is clickable through the mousearea.
[17:38] <jryannel> When the image is clicked the text of the text_field is set to ""
[17:39] <jryannel> Slide: 13
[17:39] <jryannel> we define 2 states "with text" and "without text"
[17:40] <jryannel> "with text" shall be active when the text_field is NOT empty
[17:40] <jryannel> the "without text" shall be active when text_field is empty
[17:42] <jryannel> Based on the property change notification which allows the property binding "when" is evaluated everytime the text changes
[17:42] <jryannel> Side note: A text element will only accept input when it's focused.
[17:43] <jryannel> This can be done by clicking in the TextInput or requesting focus with "focus : true"
[17:43] <jryannel> When going from one state to another we have a state transition
[17:44] <jryannel> State A -> (Transition) -> State B
[17:44] <jryannel> Slide: 16 (Transition)
[17:45] <jryannel> The red button changes it's color to black via a transition.
[17:45] <jryannel> This transition in this case shall be a color animation.
[17:45] <jryannel> (Same applies to the black/green button our go button)
[17:46] <jryannel> Slide: 17
[17:46] <jryannel> Remember we have the states "go" and "stop" in an earlier example
[17:47] <jryannel> We add transitions with the transitions [ ] array property
[17:47] <jryannel> Each Transition element describes a transition from one state to another state
[17:47] <jryannel> from, to describe when transition is called
[17:48] <jryannel> Inside we use an animation (more about animations later)
[17:48] <jryannel> so States -> Transitions -> Animations
[17:48] <jryannel> We will see animations can also be used standalone and in other situations.
[17:49] <jryannel> Let's leave this module and go to: QML Animations
[17:49] <jryannel> Please download: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/slides/qml-animations.pdf
[17:49] <jryannel> I hope you all have flatrates :_)
[17:50] <jryannel> An animation generally describes a property change according to a easing curve and duration.
[17:51] <jryannel> So instead for example an elements position shall be changes from x:0 to x:100 it shall not go immediately
[17:51] <jryannel> It should go in a defined way from 0 to 100 in maybe 1second and first a little bit faster and then slower.
[17:52] <ClassBot> There are 10 minutes remaining in the current session.
[17:52] <jryannel> Slide: 6 in the qml-animations.pdf titled "Number Animations"
[17:53] <jryannel> We have in general NumberAnimation, ColorAnimations, RotationAnimations and PropertyAnimations
[17:54] <jryannel> We use here: NumberAnimation on x { .... }
[17:54] <jryannel> Means it will animate x from 0 to 150 in 1 sec (1000msecs)
[17:55] <jryannel> This will done automatically when the component (qml file) is loaded
[17:55] <jryannel> Slide 8: PropertAnimations
[17:56] <jryannel> Here we use an animation as a standalone animation. We need to specify the target and which properties we want to animate. with running: true you specify it shall run when the component is loaded.
[17:57] <ClassBot> There are 5 minutes remaining in the current session.
[17:57] <jryannel> If you would give the animation an id (e.g. id: anim ) you could also start it with anim.start()
[17:57] <jryannel> You can find more about Animations and Transitions at: http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeanimation.html
[17:58] <jryannel> I think this it it for now. I will make a 10min break and be back with the next session
[17:59] <jryannel> Thanks for listening :)
[18:02] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.
[18:10] <jryannel> Before I continue on rapid prototyping... some remarks to animations
[18:10] <jryannel> There are several ways to use animtions:
[18:10] <jryannel> * Animation on <property>
[18:11] <jryannel> * Animation { } // standalone
[18:11] <jryannel> * Animation during a state transition
[18:12] <jryannel> * Behavior on <property> // when property changes than always with the specified animation
[18:12] <jryannel> You can nest animations with ParallelAnimation and Sequential Animation.
[18:13] <jryannel> There is also a PauseAnimation, which waits some time before continue with the next animation in a group
[18:13] <jryannel> IMPORTANT!!: If an element is anchored for example on the left and right, x can't be animated!!
[18:14] <jryannel> anchoring is stronger!!
[18:14] <jryannel> if an element is anchored on left and right, sure y can be animated and also the height. but not the width and x
[18:16] <jryannel> All of this is available as a 5 1/2 hour talk here: http://qt.nokia.com/developer/learning/online/training/training-day-at-developer-days-2010
[18:16] <jryannel> Just make yourself a nice video evening instead of watching lord of the rings
[18:16] <jryannel> Coming to "Qt Quick Prototyping"
[18:17] <jryannel> Please have a look at: http://qt.nokia.com/developer/learning/online/talks/developerdays2010/tech-talks/qt-quick-rapid-user-interface-prototyping
[18:18] <jryannel> Sorry I planned to have a screen sharing available. I hope at least some of you can watch the video
[18:18] <jryannel> Anyway I will explain about the thoughts behind...
[18:19] <jryannel> Qt Quick was designed to bridge the gap between "designers" and "developers"
[18:20] <jryannel> In a normal design driven project you have
[18:20] <jryannel> designers, which think about the user interaction, graphics and nowadays animation (e.g. motions)
[18:21] <jryannel> Then they use tools like Flash or paper or PhotoShop to sketch the ui.
[18:21] <jryannel> Present beautiful design to their bosses and then ...
[18:21] <jryannel> They throw these design to the c++ developer and ask them to implement this.
[18:22] <jryannel> Sure the result will be miles away from the the sketch. It's a different technology maybe even different HW on embedded
[18:23] <jryannel> Qt Quick allows designers early on to work with the same technologies as all the other developers
[18:23] <jryannel> Sure these kind of designers should now how to work e.g. with HTML/JavaScript of Flash/ActionScript. For them it's pretty easy to come to Qt Quick
[18:24] <jryannel> The result is that at any time developers and designers work on the same code base and it's easy to sketch a first ui prototype ...
[18:25] <jryannel> and then the prototype goes over nicely into production code
[18:26] <jryannel> By this you can shorten the time to market but also ensure the that the UI is really that what someone asked for. Pixelperfect
[18:27] <jryannel> Qt Quick is fast to code. So that you can create many different prototypes easily and then just ask you users, which one they like best
[18:27] <jryannel> Another aspect id that the ui code is cleanly seprated from the c++ code.
[18:28] <jryannel> This allows you to unit test your models and business logic and heavy lifting...
[18:28] <jryannel> and push a simple and clean qml API towards the ui developers
[18:29] <jryannel> Qt Creator contains a design mode, which allows you to drag-n-drop ui elements (and your custom components) on a surface to sketch your ui
[18:30] <jryannel> When you are in a qml file hit the button on the left "Design"
[18:30] <jryannel> in Qt Creator
[18:31] <jryannel> Here you can create a first sketch. But finally you want to switch to your code (editor) to make the more complicated stuff
[18:31] <jryannel> So an interaction designer creates "wireframes" e.g. like on http://balsamiq.com/
[18:32] <jryannel> A graphics designer makes nice graphics to the wireframe, e.g. with photoshop, gimp, inkscape, ...
[18:33] <jryannel> A motion designer thinks about how ui elements should be animated.
[18:33] <jryannel> This is currently how I see designers. I'm not a designer I'm a programmer and I always wondered how they work
[18:35] <jryannel> We have material for designers ready at: http://qt.nokia.com/developer/learning/online/training/materials/qt-quick-for-designers
[18:35] <jryannel> Especially module 6 talks about the different designer roles.
[18:36] <jryannel> If you target a UI different from a standard desktop UI you want to have a design affine person in your team.
[18:36] <jryannel> Especially with Qt Quick. This makes it really efficient.
[18:37] <jryannel> If you target a standard desktop UI you want to create a set of standard UI elements or use/extend the elements produce by the Qt Components project
[18:37] <jryannel> See https://qt.gitorious.org/qt-components
[18:39] <jryannel> I posted this link already yesterday: http://labs.qt.nokia.com/2011/03/10/qml-components-for-desktop/
[18:39] <jryannel> When I prototype a UI I always start with rectangles
[18:40] <jryannel> I normally use black background and white borders.
[18:40] <jryannel> Just make sure you get the dimensions right. Maybe add some text to label an element
[18:40] <jryannel> Then concentrate on the application logic
[18:41] <jryannel> E.g. when I press here what should be happen?
[18:41] <jryannel> At then end you look into the animations.
[18:41] <jryannel> When something changes, then how. Should it fade (animation on opacity), should it fly in (animation on x)
[18:42] <jryannel> Should it fly and fade (parallel animation on opacity and x)
[18:43] <jryannel> You should extract components early on (e.g. mybutton, mytextedit, mycheckbox, etc...
[18:43] <jryannel> Then you concentrate on the more details and bring in the graphics, colors, gradients, etc...
[18:44] <jryannel> Make sure you get the structure right. give application wide used elements a good id.
[18:45] <jryannel> Mark internal properties with '_<property-name>
[18:46] <jryannel> Try to avoid to be to dependent on your c++ backend, I use a bool _debug property to guard sometimes those dependencies
[18:46] <jryannel> Try not to create a reusable component which can be reused in all projects in the future.
[18:47] <jryannel> Designers think more in reuse by copy. Just make the element work for your needs. Qt Quick can be fast adapted anyway
[18:47] <jryannel> I guess that's it is for now. Any questions?
[18:49] <jryannel> Take care and hope you enjoined this lengthy talk :)
[18:49] <jryannel> Ohh, one link at the end
[18:50] <jryannel> https://gitorious.org/qtmediahub, a XMBC (MediaCenter) clone in qt
[18:50] <jryannel> And https://gitorious.org/qmlshowcase.
[18:51] <jryannel> qmlshowcase was produced for a customer in one afternoon! Check it out
[18:52] <ClassBot> There are 10 minutes remaining in the current session.
[18:57] <ClassBot> There are 5 minutes remaining in the current session.
[18:59] <dpm> Thanks jryannel for this Qt Quick marathon as a great starter for the day! Next up: mterry will tell us about Rapid Application Development with a tool you can never get enough of: Quickly!
[18:59] <mterry> yay
[18:59] <mterry> Just real quick: I have notes here if you're interested: https://wiki.ubuntu.com/Quickly/AppDeveloperWeek11.04
[18:59] <mterry> I'll add a link to the meeting logs there after the fact too
[19:00] <mterry> So, I'm Michael Terry, a maintainer of Quickly
[19:00] <mterry> https://wiki.ubuntu.com/Quickly
[19:00] <mterry> Quickly is a template-based system for writing applications
[19:00] <mterry> quickly, easily, and hopefully fun
[19:01] <mterry> At it's heart, it's just a system of templates with boilerplate code and a few commands
[19:01] <mterry> But all the templates are currently Ubuntu-focused, so that's where it gets the most attention
[19:01] <mterry> Each template makes opinionated choices for you, so the app author can just focus on writing their app
[19:02] <mterry> We try to give him/her the recommended technologies by default
[19:02] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.
[19:02] <mterry> oh, whoops
[19:02] <mterry> well, the logs might not have that starting part
[19:03] <mterry> Quickly in Ubuntu 10.10 has three templates: ubuntu-application, ubuntu-cli, and ubuntu-pygame
[19:03] <mterry> In Ubuntu 11.04, we're adding a new template, ubuntu-flash-game
[19:03] <mterry> A new command "submitubuntu" which helps get your app into the Software Center
[19:03] <mterry> And we've redesigned the project layouts a bit
[19:04] <mterry> I'll note when I'm talking if something applies only to the 11.04 version or not
[19:04] <mterry> If anyone has any questions as I go through this, please let me know in the classroom
[19:04] <mterry> classroom-chat that is
[19:04] <mterry> So today, I'm just going to give a bit of an overview for how to use Quickly
[19:04] <mterry> And what it can do
[19:05] <mterry> It's simple enough to get started.  Just "sudo apt-get install quickly"
[19:05] <mterry> This will install a bunch of packages, which are development tools and documentation
[19:05] <mterry> But most importantly, it will install Quickly  :)
[19:06] <mterry> Now I'll show you how to create a little throw-away app we can practice on here
[19:06] <mterry> "quickly create ubuntu-application test-project"
[19:06] <mterry> This will create a new directory "test-project", put a lot of boilerplate in there, and open your new project
[19:06] <mterry> You'll see that a window and some widgets and dialogs have been created for you
[19:07] <mterry> That's part of the boilerplate I mentioned before
[19:07] <mterry> You can customize this as much as you want, but Quickly gives you something to hit the ground running with
[19:07] <mterry> Now you want to enter your project directory: "cd test-project"
[19:08] <mterry> And here, if you typed "quickly tutorial" you would get a nice tutorial about how to make changes in the project you've just created
[19:08] <mterry> That's a good command to note for later
[19:08] <mterry> But I'm going to move on and explain some of that myself
[19:08] <mterry> Though the tutorial is valuable, and you should consider running through it later
[19:08] <mterry> So the first thing you're likely to want to change is how the app looks
[19:09] <mterry> In your project directory, you can type "quickly design"
[19:09] <mterry> And Glade will open up
[19:09] <mterry> Glade is a tool that lets you edit GTK interfaces by clicking around
[19:09] <mterry> Kinda like Visual Basic, but without any of the code elements
[19:09] <mterry> Glade by itself doesn't integrate with code
[19:10] <mterry> But Quickly matches them up for you
[19:10]  * mterry pauses for a sec, any questions?
[19:11] <mterry> OK, so let's talk a bit about Glade.  If you're not familiar with it, it can be a bit intimidating
[19:11] <mterry> You've got your "tool palette" of widgets on the left
[19:11] <mterry> The middle is where you see what you're building
[19:11] <mterry> And the right is where you can select widgets from the widget tree or edit the currently selected widget
[19:11] <mterry> If you just click directly in the middle on the widget you want, it will be selected
[19:11] <mterry> Or if you find it in the widget tree in the upper right
[19:12] <mterry> In GTK, widgets are layed out in boxes, either horizontal (HBox) or vertical (VBox)
[19:12] <mterry> So you first create a box, then add widgets to it.  And you can next boxes for more complicated layouts
[19:13] <mterry> Once you add a widget to a box, you can change its position in the box by going to the Packing tab in its properties box in the bottom right
[19:13] <mterry> There you'll also be able to change how any widget is given space
[19:13] <mterry> You can see the Expand and Fill properties
[19:13] <mterry> Most things start taking up all the space they can, but that's not always the effect you want
[19:14] <mterry> Those are common properties to adjust to get the layout you want
[19:14] <mterry> Another thing to note is that when adding icons or menu items, you often want to use stock items where possible.  That will use the correctly themed icon and automatically add translated text where appropriate
[19:15] <mterry> Speaking of translations, you can choose translation options for any label in the properties box (like whether it is translated or to leave comments for the translator)
[19:15] <mterry> OK, enough Glade
[19:16] <mterry> You can play with it as needed and just remember that you can always Undo any mistake you make or don't know how to correct  :)
[19:16] <mterry> So remember, "quickly design" to edit your UI
[19:16] <mterry> You can make new dialogs inside Glade, but it's better to let Quickly make them for you, so that they are hooked up correctly in code
[19:17] <mterry> So let's say you want to add a cool new dialog.  You can type the following: "quickly add dialog save-dialog" (for a fictional Save dialog you wanted to add)
[19:17] <mterry> After you do this, you should probably close Glade and re-open it with "quickly design"
[19:17] <mterry> Now Glade will see your new dialog and you can edit it as you like
[19:18] <mterry> Specifics and code examples of adding dialogs are also in the "quickly tutorial" tutorial
[19:18] <mterry> But I'll be brief here
[19:18] <mterry> From your main window, you need to import the new code module that Quickly made: "from project_name.DialogName import DialogName"
[19:19] <mterry> So for this project, that would actually be "from test_project.SaveDialog import SaveDialog"
[19:19] <mterry> Then you use normal GTK code to run it and check the result:
[19:19] <mterry> d = DialogName()
[19:19] <mterry> response = d.run()
[19:19] <mterry> if response == gtk.RESPONSE_OK:
[19:20] <mterry>   #do your stuff
[19:20] <mterry> d.destroy()
[19:20] <mterry> And that's it!
[19:20] <mterry> Pretty simple to make a dialog
[19:21] <mterry> Now, if you want to respond to what the user does, you're going to need to listen to GTK signals
[19:21] <mterry> Real briefly, when the user does something like click a button, GTK emits a signal that you can respond to, like "clicked"
[19:22] <mterry> Important signals that you may care about are that buttons emit the "clicked" signal, menu items emit the "activated" signal
[19:22] <mterry> It's really easy to handle these signals
[19:22] <mterry> Let's say you want to handle a menu item press in your main window
[19:22] <mterry> You first note what the menu item is called in Glade
[19:22] <mterry> You can check this from the widget tree in the upper right
[19:22] <mterry> Remember that name
[19:23] <mterry> Now in the code, you can add a new function named like:
[19:23] <mterry> def on_menuitem1_activated(self, widget, data=None):
[19:23] <mterry> and inside that function, add the code that should happen when the menu item is pressed
[19:24] <mterry> Quickly already provides some code for common menu items like Quit and About, but not all of the default menu items have code already
[19:24] <mterry> In Ubuntu 10.10, you'll also need to go into Glade and point it at your new function
[19:24] <mterry> There is a "Signals" tab in the bottom right
[19:24] <mterry> And go there and enter the name of the function you just created next to the "clicked" signal
[19:25] <mterry> In Ubuntu 11.04, Quickly can do this for you, as long as you name it like above: on_WIDGET_SIGNAL
[19:25] <mterry> So a "clicked" signal on "button1" would be on_button1_clicked
[19:25]  * mterry pauses for a sec.  Any questions?
[19:26] <ClassBot> hobbsc asked: Is quickly generating gtk2 or 3?
[19:26] <mterry> hobbsc, GTK 2 for now.  I'd like to move it to 3 next cycle
[19:27] <mterry> But in keeping with using the recommended tools, GTK 2 is still the default toolkit for Ubuntu 11.04
[19:27] <mterry> I believe Ubuntu will be ported to 3 next cycle, so Quickly should move along with it
[19:27] <mterry> OK.  So if you want to edit the code that Quickly makes
[19:28] <mterry> incorrect, asked about PyGI vs PyGTK
[19:28] <mterry> PyGTK won't support GTK 3, so we'd have to move to PyGI at the same time.  Quickly doesn't currently use PyGI
[19:29] <mterry> So if you want to edit the code, you can just open up the test_project folder in your project and look at all the code.  Or run "quickly edit"
[19:30] <mterry> You'll see for example that your main TestProjectWindow class has a function "finish_initializing".  This is the recommended hook for inserting your own startup code
[19:30] <mterry> In Ubuntu 11.04, there will be a test_project_lib folder that contains code that Quickly "owns" and it isn't recommended you touch it.  But you can take or leave the code there yourself.  There will be one entry point in the main TestProjectWindow class that you control
[19:31] <mterry> So let me talk about debugging real briefly
[19:31] <mterry> The usual recommended method is just adding print statements and seeing what effect that has.  :)
[19:31] <mterry> It's quick, dirty, and easy
[19:32] <mterry> If you are interested in more comprehensive debugging, especially if you want to be able to ask your users for log files, you can use the logging framework
[19:32] <mterry> The sample code Quickly makes does that, so you can see code examples
[19:32] <mterry> It by default won't spit out messages unless you're running your app in verbose mode
[19:32] <mterry> Or if you're debugging something very complicated, you can use pdb, which is a python debugger
[19:33] <mterry> It's a bit difficult to use, so I just recommend using print statements
[19:33] <mterry> Oh, I forgot!  If you want to run your app after you close it, use "quickly run"
[19:33] <mterry> And "quickly help" should give you a list of commands
[19:34] <mterry> So now we come to the exciting stuff.  So far, Quickly has just been a jump-start to your app development
[19:34] <mterry> But it also integrates with Launchpad to help you publish, share, and maintain your software
[19:35] <mterry> For example, it keeps your code in bzr and you can save your changes with "quickly save"
[19:35] <mterry> Or if you have a Launchpad project, it can upload tarballs and make announcements
[19:35] <ClassBot> crazedpsyc asked: When might logging be better than print statements? I think printing some error messages that identify the line of code that has the problem and what the problem is is much more useful, because users usually don't bother to find and read log files
[19:36] <mterry> crazedpsyc, for errors that you "expect" to see in the field like a file that didn't open or an unexpected corner of your code
[19:36] <mterry> I would recommend logging
[19:37] <mterry> I think print statements are most useful just for yourself when you're hunting down some problem
[19:37] <mterry> So that is, your app should probably ship with just logging lines
[19:37] <mterry> But when I'm futzing with it, I like to add print lines to find where the problem is
[19:38] <mterry> So let's talk a bit about packaging
[19:38] <mterry> This is something that is normally difficult to do, but Quickly tries to make easy
[19:39] <mterry> You have different "levels" of complexity here.  You can create a local Ubuntu package, you can share your package with testers, you can publish a new final version of your package, or you can even put your package in the Software Center
[19:39] <mterry> Let's start simple
[19:39] <mterry> "quickly package" will package up your current code and create a .deb file for you
[19:40] <mterry> But before you do that, actually, it's probably a good idea to set up some metadata
[19:40] <mterry> You can open the setup.py file that Quickly made for you: "gedit setup.py"
[19:40] <mterry> Near the bottom are some fields like author name, etc
[19:40] <mterry> You also probably want to edit the AUTHORS file and put your name and email there
[19:41] <mterry> And if you had a particular license in mind besides GPL-3, you can run "quickly license BSD" or whatever license you like
[19:41] <mterry> GPL-3 is the default though
[19:41] <mterry> You may also want to edit test-project.desktop.in and change the application properties so it shows up in the right application category in the menus
[19:41] <mterry> You can see a list of the correct categories here: http://standards.freedesktop.org/menu-spec/latest/apa.html
[19:42] <mterry> OK, now that we did all that bookkeeping, you can make your package
[19:42] <mterry> You could have made it before too, Quickly will just fill in bogus info for you
[19:42] <mterry> But it's better to have it all nice and correct :)
[19:42] <mterry> So now after a "quickly package" you'll have a .deb file
[19:42] <mterry> You can double click on this in the file manager and install it into your system for testing
[19:43] <mterry> And you can share that .deb via email or a web site for a small number of people
[19:43] <mterry> But if you want wider testing
[19:43] <mterry> You may want to consider creating a PPA
[19:43] <mterry> PPAs are a little bit more involvement for you, but it makes it so much easier to test your app that it's probably worth it for you in order to have more testers
[19:44] <mterry> So Launchpad has some good documentation on what you need to do here, https://help.launchpad.net/Packaging/PPA
[19:44] <mterry> But you'll need an SSH key and a GPG key
[19:44] <mterry> https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair
[19:44] <mterry> https://help.launchpad.net/YourAccount/ImportingYourPGPKey
[19:44] <mterry> Those are a couple more Launchpad help pages for how to make those
[19:45] <mterry> Once Launchpad knows about you and you've created the PPA, you're ready to tell Quickly
[19:45] <mterry> You should set DEBEMAIL and DEBFULLNAME environment variables for the benefit of "quickly package".  This will note that you were the one that created the package, otherwise Launchpad won't accept it
[19:45] <mterry> So set them like:
[19:45] <mterry> export DEBEMAIL="oliver.twist@example.com"
[19:46] <mterry> export DEBFULLNAME="Oliver Twist"
[19:46] <mterry> If you put those lines in your ~/.bashrc file, they will be set up for you every time you log in
[19:46] <mterry> OK, now you're all set
[19:47] <mterry> So if you enter "quickly share --ppa testing" it will create a new in-progress package with a version like 0.1~public1 and push it to the PPA you specify on the command line
[19:47] <mterry> So if you have a testing PPA, which is recommended, you can easily get feedback by sharing a new package every now and then
[19:48] <mterry> If you want to actually make a full release, you can do "quickly release --ppa release" and Quickly will increment the number for you and push it to the the PPA you specify
[19:48] <mterry> Just like the share command
[19:48] <mterry> By default, Quickly will pick YEAR.MONTH versioning
[19:48] <mterry> But you can specify the version you want to the release command
[19:48] <mterry> Run "quickly help release" for details
[19:49] <mterry> And now finally, there is a new command in Ubuntu 11.04 that lets you prepare an upload for acceptance into the Ubuntu Software Center
[19:49] <mterry> "quickly submitubuntu"
[19:50] <mterry> This creates and publishes a package to a PPA just as quickly release does
[19:50] <mterry> So you can pass --ppa and such
[19:50] <mterry> The package will have files installed into /opt as required
[19:50] <mterry> The package will also have special metadata that is used by the Software Center (like where the screenshot lives and such)
[19:50] <mterry> (See https://wiki.ubuntu.com/AppReviews for how to get approved)
[19:51] <mterry> You can create the same kind of package without uploading it by using "quickly package --extras"
[19:51] <mterry> This will generate the /opt packaging and such for you to test with
[19:51] <ClassBot> There are 10 minutes remaining in the current session.
[19:51] <mterry> incorrect mentioned integration with Eclipse
[19:52] <mterry> That is something I'd like to see happen too, but we haven't focused on that yet
[19:52] <mterry> Also integration with Anjuta and any other IDEs out there
[19:52] <mterry> We'd like to make it easy for that to happen
[19:52] <mterry> But we figured most programmers are familiar with the command line so we haven't rushed to IDE interaction
[19:53] <mterry> Again, the current set of templates (ubuntu-application, ubuntu-cli, ubuntu-pygame, and ubuntu-flash-game) are just what we've done
[19:53] <mterry> But it's hopefully easy to make a template of your own
[19:53] <mterry> See "quickly quickly"
[19:53] <mterry> And we'd love any help!  :)
[19:54] <mterry> I also recommend trying out the ubuntu-pygame template: "quickly create ubuntu-pygame test-game"
[19:54] <mterry> It's very neat
[19:54] <ClassBot> crazedpsyc asked: wouldn't that (IDE integration) be something for the IDE developers themselves to do? They could just run os.popen("quickly [...]") right?
[19:54] <mterry> crazedpsyc, yes, ideally.  There's nothing quite stopping them from doing it.
[19:55] <mterry> crazedpsyc, but since we care more than the Eclipse developers probably do about it, it likely won't happen until we make it happen  :)
[19:55] <mterry> And since we haven't actually done the work for even one IDE yet, there may be hidden gotchas in adding support
[19:55] <mterry> So it would be good for us to try making one ourselves, so we can make it super easy to do from the Quickly side
[19:56] <mterry> But we'd definitely work with any IDE developers that were intereste
[19:56] <mterry> d
[19:56] <ClassBot> There are 5 minutes remaining in the current session.
[19:56] <mterry> That's all I had.  Hopefully Quickly is fun and easy to mess around with
[19:56] <mterry> We hang out in #quickly and #ubuntu-app-devel channels on Freenode
[19:57] <mterry> If there are any questions you have after this, feel free to poke me there
[20:00] <mterry> Oh, and if I'm not around in the channel, rickspencer3 and didrocks are experts too
[20:00] <mterry> And the original Quickly devs
[20:00] <mterry> (they are the originals I meant)
[20:01] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.
[20:02] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.
[20:02] <dpm> Thanks a lot mterry for a great session, and let's clear the floor for allison_, Ubuntu's Technical Architect, who's going to tell us how to get your applications into Ubuntu
[20:02] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.
[20:03] <dpm> allison_, all yours!
[20:05] <dpm> (let's wait for a sec while we sort out some IRC issues)
[20:05] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.
[20:06] <wendar> Hi all.
[20:06] <wendar> mterry has given an excellent session on Quickly. This session is a "next step".
[20:07] <wendar> Once you have an application packaged, there are a few ways to get it into Ubuntu.
[20:07] <wendar> I'll be going over one of those ways, through the Application Review Board.
[20:08] <wendar> The basic idea is to make it very quick and easy to get lightweight applications into Ubuntu.
[20:09] <wendar> You can submit them today, and have them available to download in a couple of weeks, instead of waiting for the next release of Ubuntu.
[20:11] <wendar> The first step is to submit a ticket to the review board.
[20:12] <wendar> They need a few essential details for the proposal.
[20:12] <wendar> Some are obvious: the name of the project, your name, and how to contact you.
[20:13] <wendar> We also ask for you to have already set up your project in a PPA.
[20:13] <wendar> That can catch a lot of common errors, so it's as helpful for you as it is for the reviewers.
[20:14] <wendar> One thing that submitters often miss is a description of the project and what it does.
[20:15] <wendar> You've probably been working on your app for months, but it's brand-new to the reviewers, so it's helpful to guide them to understanding what's wonderful about the app.
[20:17] <wendar> It's worth taking a look at the submission guide, it has a good example of what to include in the proposal.
[20:17] <wendar> https://wiki.ubuntu.com/AppReviewBoard/Submissions/Request
[20:18] <wendar> The next step is the initial review. One of the reviewers will volunteer as "shepherd" for your proposal.
[20:19] <wendar> Your shepherd will read through your code and the packaging, and may offer suggestions on improvements, or help you find more details on the requirements for apps.
[20:21] <wendar> You and the sheperd may repeat a few rounds of changes and releasing a new version into your PPA.
[20:23] <wendar> In some cases the shepherd may recommend that your app is too big, too complex, or too important for the Application Review Board process and will ask you to take it to the full revue process for inclusion in Ubuntu's universe repository.
[20:24] <wendar> In most cases, you and the shepherd will work together and bring your app to a point where it's ready for a final review.
[20:25] <wendar> In the final review, the shepherd will recommend your app in one of the App Review Board meetings.
[20:25] <wendar> These happen every two weeks on the #ubuntu-meeting channel.
[20:26] <wendar> You can find the next meeting listed on https://wiki.ubuntu.com/AppReviewBoard/Agenda
[20:26] <wendar> or on the Ubuntu Fridge calendar.
[20:27] <wendar> The board will vote on your app, and accept it for inclusion, recommend changes, or (in very rare cases) reject it.
[20:28] <wendar> If they ask for changes, you'll just work with your shepherd to get those made, and bring the app back in the next meeting.
[20:29] <wendar> Once your app is accepted, there's a little bit of work needed to set up screenshots for the app.
[20:30] <wendar> This is a bit of a hassle right now, but soon there will be a web form to submit your screenshots.
[20:31] <wendar> After the screenshots are set up, the review board will launch your app in the extras repository.
[20:33] <wendar> Extras is turned on for everyone in Maverick and Natty, so your app will be immediately available in the Software Center, and other package management tools.
[20:35] <wendar> That's pretty much it. We've tried to make the process quite simple.
[20:35] <wendar> Are there any questions?
[20:35] <wendar> Or, any steps you'd like to go through in more detail?
[20:37] <ClassBot> titeuf_87 asked: the apps for purchase in the software center, are they submitted this way too?
[20:38] <wendar> At the moment, apps for purchase are handled manually.
[20:38] <wendar> They will soon have a web interface for submissions.
[20:39] <wendar> The same web interface that App Review Board apps will use for screenshots.
[20:39] <wendar> We'll try that out for a bit, and if it looks good, will start using that same web interface for all the App Review Board apps.
[20:42] <ClassBot> dpm asked: who can review an app? Only those who are Review Board members?
[20:43] <wendar> The proposals are all in a public queue, so anyone can review them.
[20:43] <wendar> It's very welcome to have people trying out the apps and commenting on the tickets while they're under review.
[20:44] <wendar> Only the Review Board members vote in the final review, but in our vote we'll consider all the feedback we get.
[20:44] <wendar> Reviewing and trying out other developer's apps is a great way to build up experience for your own apps.
[20:45] <wendar> Any more questions?
[20:50] <ClassBot> dpm asked: if I'm an app developer and I want to go through the App Review Process, where should I first start? What's the place where I find the documentation?
[20:51] <ClassBot> There are 10 minutes remaining in the current session.
[20:53] <wendar> We've got a wiki page to help walk developers through the steps.
[20:54] <wendar> https://wiki.ubuntu.com/AppReviewBoard/Submissions
[20:54] <wendar> You can always go back there for more information.
[20:54] <wendar> A few tips to send you on your way:
[20:54] <wendar> The basic idea for this process is that it's a good fit for lightweight applications.
[20:55] <wendar> Games, small single-purpose apps.
[20:55] <wendar> If you're writing a large or complext application, it's probably not right for this process.
[20:56] <ClassBot> There are 5 minutes remaining in the current session.
[20:56] <wendar> Libraries to be used by other applications also don't fit here.
[20:56] <wendar> But, for anything that doesn't fit in the App Review process, there's always the usual process.
[20:57] <wendar> And, the advantage of the usual process is that once you get into universe, your package will be updated and maintained by MOTU.
[20:58] <wendar> That's all, thanks everybody!
[21:00] <dpm> Great, thanks a lot wendar for this clear overview on the App Review process. There is now no excuse for getting your applications into Ubuntu!
[21:01] <dpm> Next up is tedg_, the person who knows all about indicators, and who'll be thrilled to tell you how to add them to your applications
[21:01] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.
[21:10] <tedg> Voice?
[21:10] <tedg> Woot!
[21:10] <tedg> Thanks Pendulum!
[21:10] <tedg> Hey everyone, sorry about the delay.
[21:10] <tedg> So my name is Ted Gould and I work with application indicators.
[21:11] <tedg> Application indicators are menus that appear in the Unity panel and represent various applications.
[21:11] <tedg> These, in general, shouldn't be used just because your project's logo is so cool.  Users. hate. that.
[21:12] <tedg> But, it's more designed as a feature for long running applications, those that are more services to users, to expose that functionality.
[21:12] <tedg> A good example of this would be Tomboy, so you can use your notes all the time and keep it running.
[21:12] <tedg> Which is definitely useful.
[21:13] <tedg> There's a set of design guidelines for using the app indicators.
[21:13] <tedg> And that is here: https://wiki.ubuntu.com/CustomStatusMenuDesignGuidelines
[21:13] <tedg> It goes through the various features and what the layout should be.
[21:14] <tedg> If you've got any questions whether or not something should be an appindicator, that'd be a good place to get started.
[21:14] <tedg> I'm not going to dwell on that though, as this is Dev week, so let's assume that you're application *really* needs an appindicator :-)
[21:15] <tedg> For most applications that involves using libappindicator
[21:15] <tedg> It's a small library that makes it easy to create application indicators.
[21:15] <tedg> The LP page for it is here: https://launchpad.net/libappindicator
[21:15] <tedg> You can browse through the source code if you'd like.
[21:16] <tedg> But I think that examples are a bit more interesting.
[21:16] <tedg> We've put together a few: https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators#Porting%20Guide%20for%20Applications
[21:16] <tedg> libappindicator uses the GObject Introspection framework so that it can be accesses from any language that support it.
[21:17] <tedg> That includes languages like Javascript and Python.
[21:17] <tedg> But there are others as well.
[21:17] <tedg> We also have direct Python bindings, though those will probably be dropped as soon as the GObject Introspection ones start to mature.
[21:17] <tedg> I expect the API to stay very much the same though.
[21:18] <tedg> So as we start to look at some of the examples (your language of choice) we start to see what you can do with libappindicator.
[21:18] <tedg> You need to provide a few things starting out.
[21:19] <tedg> The first is a name.  The idea is that this is a unique string, usually the package name is good.  Though any unique string will work.
[21:19] <tedg> If you want to have more than one for some reason, each of them should be unique.  "my-project-left" "my-project-right"
[21:19] <tedg> You also need to provide an icon name, which is the name of the icon in the icon theme.
[21:20] <tedg> For many projects this is the main icon for the project, though it could be anything really.
[21:20] <tedg> You also need to provide a category.  This is mostly use for sorting the indicators, so that similar things end up next to each other.
[21:21] <tedg> The next thing that needs to happen is you need to build a menu for that app indicator.
[21:22] <tedg> You can do this in GTK+ and libappindicator will take care of making sure that gets translated over the bus.
[21:22] <tedg> You can also attach to the normal GTK signals and those will be synthesized from the DBus signals as well.
[21:23] <tedg> I'm not going to go much into building menus, the examples there all have ways to do it.
[21:23] <tedg> You should look at GTK resources like http://gtk.org/documentation.html to learn more about that.
[21:24] <tedg> This is all that is needed for a basic application indicator -- but you shouldn't stop there!
[21:24] <tedg> There are some other features that can really improve your application indicator.
[21:24] <tedg> One of those is providing an accessible name for the icon.
[21:25] <tedg> Users who are disabled can't tell what the icon is, so a screenreader need some information to learn about the icon.  This is the accessible label.
[21:25] <tedg> It's important for making your application work well for everyone.
[21:25] <tedg> You can also put a label next to your application indicator.
[21:26] <tedg> For instance, indicator-weather uses this to put the current temperature on the unity panel.
[21:26] <tedg> In general, we recommend that you provide a way to disable the label feature as it can be disruptive to some users.
[21:27] <tedg> There are definitely use cases for small strings though, and this provides a way to do those.
[21:27] <tedg> Also, Application Indicators provide a built in attention state.
[21:28] <tedg> The idea here is that you could pre-configure the attention icon and then just toggle between the attention and the normal icon when the state in the application changes.
[21:28] <tedg> For instance if there was inclement weather or if the application lost a network connection.
[21:29] <tedg> From the developer's perspective this is just "another icon" but it can provide an easy to implement experience.
[21:30] <tedg> Since you can always query the state in the program, you don't have to keep track of which icon is being shown and you can set it all once in the initialization of the program.
[21:31] <tedg> There is also a few little things in the API, like being able to get mouse wheel events that can be fun.
[21:31] <tedg> It's good to remember that it's nearly impossible for anyone other than power users to realize the mouse wheel behavior.
[21:31] <tedg> But that can be a fun feature to provide those users with something extra.
[21:32] <tedg> That's the basics of implementing an app indicator, let me take a little break for questions before I go on.
[21:32] <tedg> Any questions?
[21:33] <tedg> Okay, seeing none, I'll assume I was perfectly clear ;-)
[21:34] <tedg> An advanced topic that I'd like to cover is fallbacks.
[21:34] <tedg> One thing that application developers told us is that they don't want to build applications that can only run on Unity.
[21:34] <tedg> But, they don't want working with everyone else to be a lot of work either.
[21:35] <tedg> So we built in fallbacks into libappindicator so that you don't have to worry about that.
[21:35] <tedg> What the basic fallback is using GtkStatusIcon to create a systray icon.
[21:36] <tedg> This icon can then be shown in environments not currently using the KSNI interface.
[21:36] <tedg> This would include XFCE, GNOME Shell or GNU Step.
[21:37] <tedg> What will happen is that the same icons will be shown in the systray as you specified to libappindicator.
[21:37] <tedg> When you click on the icon, the menu will be shown.
[21:37] <tedg> In a nutshell, it should be roughly the same as what happens on the unity panel.
[21:38] <tedg> Some application authors might not want that though.
[21:38] <tedg> They may want to take advantage of environment specific features.
[21:38] <tedg> Or they could just want to fallback to a different interface all together.
[21:39] <tedg> To account for that the AppIndicator object is subclassable with two overridable functions: fallback and unfallback.
[21:39] <tedg> fallback() gets called when libappindicator determines that there is no KSNI interface to connect to.
[21:39] <tedg> If that interface comes up in the mean time, it'll call unfallback.
[21:40] <tedg> This takes care of cases where the KSNI interface may crash or start up in a different order than is normally expected.
[21:41] <tedg> This can be pretty straightforward, if you're planning on doing this I'd look to the fallback functions that are in the libappindicator codebase for implementing GtkStatusIcon and base your's on those.
[21:41] <tedg> They provide all the basic functionality, and can be extended.
[21:42] <tedg> So does anyone have questions on fallbacks?
[21:43] <tedg> Seeing none, I'll continue on.
[21:44] <tedg> So the last thing I wanted to talk about is the future of application indicators.
[21:44] <tedg> But, it's not very exciting :-)
[21:44] <tedg> We've got plans to clean up the API some to make the introspection better.
[21:44] <tedg> And mostly maintenance task surrounding that.
[21:45] <tedg> We expect that application indicator should stay stable at least through the 12.04 release which will hopefully be an LTS.
[21:46] <tedg> We do expect to drop the custom Python bindings for a GObject Introspected version.
[21:46] <tedg> We hope to do the same with the C# bindings, but it's less clear when the GObject Introspection interface will be complete there.
[21:47] <tedg> So that's mostly what I had hoped to cover in today's session.
[21:47] <tedg> Is there anything else you guys would like me to talk about?
[21:48] <tedg> Okay, I'll call it a wrap then.
[21:48] <tedg> Thanks everyone!
[21:48] <tedg> dpm, Who's up next?
[21:51] <ClassBot> There are 10 minutes remaining in the current session.
[21:52] <dpm> ok, thanks tedg for a great talk
[21:54] <dpm> Next in a few minutes is Launchpad rockstar henninge, from the former Launchpad Translations team, who is going to talk about how you can make your application talk any language. Don't miss that one!
[21:56] <ClassBot> There are 5 minutes remaining in the current session.
[22:01] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.
[22:01] <henninge> Hello and welcome to this session on "Using Launchpad to get your application translated".
[22:02] <henninge> This session is about how Launchpad can help you to get your application translated and includes a hands-on demonstration of the setup needed to get you going.
[22:02] <henninge> It is not about making your application translatable. David Planella gave a presentation on that on Monday and I encourage you to read the session log if you have not already done so.[1] I will paste the URL at the end.
[22:03] <henninge> Feel free to interrupt and ask questions any time but we also have a lot of ground to cover.
[22:03] <henninge> David explained a lot about the basic concepts and software needed to get your application internationalized. I will only repeat a little of that here as a summary to make sure we are all on the same page.
[22:03] <henninge> I have often seen people come to Launchpad Translations wanting to translate their application saying "I don't know anything about translations or gettext." I have to tell them that, sorry, even as a maintainer they will have to be familiar with the gettext system in general and how it makes your application appear in different languages.
[22:04] <henninge> On the other hand, let me quote from the gettext manual:
[22:04] <henninge> "As a maintainer, you do not have to take on your shoulders the responsibility of checking if the translations are adequate or complete, and should avoid diving into linguistic matters. Translation teams drive themselves and are fully responsible of their linguistic choices for the Translation Project. Keep in mind that translator teams are not driven by maintainers. You can help by carefully redirecting all communications and re
[22:04] <henninge> ports from users about linguistic matters to the appropriate translation team, or explain users how to reach or join their team." [2]
[22:05] <henninge> What is true for the GNU Translation Project is also true for the translations teams working on translations in Launchpad. Your responsibilty is to provide them with the English strings they need to translate and to publish their translations with your application as often as possible. Translators don't like doing translations only to find out they never make it to the application users.
[22:05] <henninge> Launchpad Translations is there to help you with that responsibility.
[22:05] <henninge> Demo project and staging server
[22:05] <henninge> ------------------------------------------------
[22:06] <henninge> For this session I will be using a fictional project called 'mytranslatable' on our demo server 'staging'. You will notice that all URLs contain 'staging' but apart from that they are identical to the real Launchpad. Similar for the URLs to Bazaar branches which contain an extra '//staging/' component that needs to be left out for the live code hosting server.
[22:06] <henninge> In order for all of you to be able to follow along, 'mytranslatable' is owned by an open team I created so anybody in that team can see the configuration pages. Go and join that team now but please don't change any settings on 'mytranslatable' because that would cause confusion. (No damage, though, because this is just the staging server.)
[22:06] <henninge> https://staging.launchpad.net/~mytranslatable-maintainers/+join
[22:07] <henninge> Alternatively you can create your own project on staging and follow along with that. In that case you need to replace 'mytranslatable' with the name of your project in all URLs.
[22:07] <henninge> Please be aware that the staging server is a bit slower and more like to time out. Please be patient.
[22:09] <henninge> I don't see anybody joining the team yet. Please be aware that a lot of the URLs I'll be posting won't be accessible unless you  are in that team
[22:09] <henninge> or maybe everybody wants to create their own projects ... ;)
[22:09] <henninge> OK, let's dive in with some basic concepts you should be familiar with.
[22:09] <henninge> Marking strings as translatable
[22:09] <henninge> ---------------------------------------------
[22:09] <henninge> To be able to extract translatable strings for translation they must be marked in the source code. This is done by applying the 'gettext()' function which is usually aliased to _() for brevity.
[22:10] <henninge> Oh, I forgot
[22:10] <henninge> The source tree to the demo project is found here:
[22:10] <henninge> http://people.canonical.com/mytranslatable.tar.gz
[22:11] <henninge> Here is the source code of the two source files in that project:
[22:11] <henninge> http://paste.ubuntu.com/593926/
[22:11] <henninge> http://paste.ubuntu.com/593927/
[22:11] <henninge> You will notice the 'textdomain' call which sets the translation domain for your application. This is later used in the global translations database on the user's system (usually in /usr/share/locale) to identify your application's translations. It must therefore be unique and that's why it is often identical to the name of the application istself.
[22:12] <henninge> For other file types that may contain translatable strings in your project, other ways of marking and extraction will exist. The intltool package (which extends gettext) that David also mentioned is able to deal with a lot more types than plain gettext is. [3]
[22:12] <henninge> PO templates and PO files
[22:12] <henninge> --------------------------------------
[22:12] <henninge> When gettext extracts translatable strings from the source code they are placed in a PO template file. It is called a 'template' because really PO files contain the actual translations and a 'template' looks just like such a file but without any translations filled in.
[22:13] <henninge> Here is an example from our two example source files.
[22:13] <henninge> http://paste.ubuntu.com/593932/
[22:13] <henninge> *Without* Lauchpad translations, translators would take this file, fill out the empty translations (msgstr) and adapt the header information (ALL THE CAPITALS) to produce a PO file for their language. This file they'd submit back to your project for inclusion in the source tree.
[22:13] <henninge> *With* Launchpad Translations you need to get this file into Launchpad so that translators can translate it *in* Launchpad Translations. When it is time to create a new release for your project, you can just pull out the translations as PO files and put them in your tree.  Launchpad helps you with that, too.
[22:14] <henninge> PO files are kept in a subdirectory called 'po' on your project. That is also where the template file will be created.
[22:14] <henninge> Creating the template is best done using intltool. If you have followed David's session on Monday using quickly, you can simply do 'quickly build_i18n' and it will build your template in the 'po' subdirectory.
[22:15] <henninge> Otherwise you will have to manually configure your project for intltool. To configure your project for intltool you need to create two files.
[22:15] <henninge> 1. po/POTFILES.in contains a list of the source files that translatable strings will be extracted from.
[22:15] <henninge> 2. po/Makevars contains some variables for the build process. intltool will look here and in other places to find the translation domain to use. If your project uses Automake or Autoconf intltool will scan those files as well but that is out of scope here.
[22:16] <henninge> Here are the the files for our example:
[22:16] <henninge> http://paste.ubuntu.com/594052/
[22:16] <henninge> http://paste.ubuntu.com/594054/
[22:16] <henninge> Now you need to go into the 'po' directory and run 'intltool-update -p' which tells intltool to create a new template. I get an error message in the run about a newline in a file name but it seems to work fine. You end up with a file called 'mytranslatable.pot'.
[22:17] <henninge> Everybody following along? This was mostly repetition, we will now move over to Launchpad.
[22:18] <henninge> Set up a project in Launchpad
[22:18] <henninge> --------------------------------------------
[22:18] <henninge> Before we can push our source tree with the template we need a project that it can be associated with. A project is created here:
[22:18] <henninge> https://staging.launchpad.net/projects/+new
[22:18] <henninge> Let's assume you created a project called 'mytranslatable', then it's home page will be here:
[22:18] <henninge> https://staging.launchpad.net/mytranslatable/
[22:19] <henninge> I actually created that project on staging, so you can go to that URL and have a look.
[22:19] <henninge> Once the project is created, you need to configure it for translations. Click on 'Configure translations' on the right hand side of the projects home page and it'll take you there.
[22:19] <henninge> https://staging.launchpad.net/mytranslatable/+configure-translations
[22:19] <henninge> Choose these settings:
[22:19] <henninge>   Type of service: Launchpad
[22:19] <henninge>   Translation focus: trunk
[22:19] <henninge>   Translation group: Launchpad Translators (We'll talk about that in a bit)
[22:19] <henninge>   Translation permission policy: Structured
[22:20] <henninge> Next we need a branch to import to. From the projects home page click 'Configure project' branch.
[22:20] <henninge> https://staging.launchpad.net/mytranslatable/trunk/+setbranch
[22:21] <henninge> Chose 'Create a new, empty branch ...' and enter the Branch name as 'trunk'.
[22:22] <henninge> Since I already did that, the current branch is already filled out in the top input field.
[22:22] <henninge> Finally we need to tell Launchpad to import the translation template from this branch. For this we go to the Translations page of the trunk series. From the project homepage go to the 'Translations' tab at the top of the page. There under 'Set up translations for a series' click on 'automatic import'. This will take you here:
[22:22] <henninge> https://translations.staging.launchpad.net/mytranslatable/trunk/+translations-settings
[22:23] <henninge> This page should mention the branch we just created as 'lp://staging/mytranslatable'. Under Import settings chose 'Import template files' and save the settings.
[22:24] <henninge> Now the project is ready to receive the template.
[22:25] <henninge> Getting the PO template into Launchpad
[22:25] <henninge> -------------------------------------------------------
[22:25] <henninge> This is done by creating a bazaar branch containing the template file. The branch we just created in Launchpad is just an empty directory so far that we need to fill.
[22:25] <henninge> If you used quickly it already created a branch for you. Otherwise create the branch by calling 'bzr init' in the projects root directory.
[22:26] <henninge> I will do that now here on my machine and paste the output.
[22:26] <henninge> [~/canonical/playground]
[22:26] <henninge> henning@hobbes:$ cd mytranslatable
[22:26] <henninge> [~/canonical/playground/mytranslatable]
[22:26] <henninge> henning@hobbes:$ bzr init
[22:26] <henninge> Created a standalone tree (format: 2a)
[22:27] <henninge> Now add the files to the branch by calling 'bzr add'. It automatically adds all files that were not in the branch yet. Make sure your template is among them.
[22:28] <henninge> Again, doing it locally now.
[22:28] <henninge> [~/canonical/playground/mytranslatable]
[22:28] <henninge> henning@hobbes:$ bzr add
[22:28] <henninge> adding po
[22:28] <henninge> adding src
[22:28] <henninge> adding po/Makevars
[22:28] <henninge> adding po/POTFILES.in
[22:28] <henninge> adding po/mytranslatble.pot
[22:28] <henninge> adding src/main.c
[22:28] <henninge> adding src/main.py
[22:29] <henninge> Now commit those changes to the branch.
[22:29] <henninge> [~/canonical/playground/mytranslatable]
[22:29] <henninge> henning@hobbes:$ bzr commit -m "Initial commit."
[22:29] <henninge> Committing to: /home/henning/canonical/playground/mytranslatable/
[22:29] <henninge> added po
[22:29] <henninge> added src
[22:29] <henninge> added po/Makevars
[22:29] <henninge> added po/POTFILES.in
[22:29] <henninge> added po/mytranslatble.pot
[22:29] <henninge> added src/main.c
[22:29] <henninge> added src/main.py
[22:29] <henninge> Committed revision 1.
[22:30] <henninge> Finally push it to the branch we created on Launchpad. We need to tell bzr not to complain about the already existing directory on Launchpad. Also it is nice to remember where we pushed to so that that information can be ommitted in the future.
[22:30] <henninge> [~/canonical/playground/mytranslatable]
[22:30] <henninge> henning@hobbes:$ bzr push --remember --use-existing-dir lp://staging/mytranslatable
[22:30] <henninge> Host key fingerprint is 9d:38:3a:63:b1:d5:6f:c4:44:67:53:49:2e:ee:fc:89
[22:31] <henninge> Created new branch.
[22:31] <henninge> You can look at the branch on Launchpad now and see that push is being processed.
[22:32] <henninge> https://code.staging.launchpad.net/~mytranslatable-maintainers/mytranslatable/trunk
[22:32] <henninge> It says "Updating branch..."
[22:32] <henninge> This is almost it.
[22:33] <henninge> We'll have to wait a little for the branch to be procecssed and the template to be imported.
[22:33] <henninge> You can see it happening in the import queue of the project series.
[22:33] <henninge> https://translations.staging.launchpad.net/project-no1/trunk/+imports
[22:33] <henninge> oops, wrong URL.
[22:34] <henninge> I was trying this out earlier today.
[22:34] <henninge> https://translations.staging.launchpad.net/mytranslatable/trunk/+imports
[22:34] <henninge> Yeah, empty queue is correct. ;-)
[22:35] <henninge> The branch has been processed and you can now actually browse the code on Launchpad.
[22:35] <henninge> Click 'Browse the code' on the branch page.
[22:35] <henninge> http://bazaar.staging.launchpad.net/~mytranslatable-maintainers/mytranslatable/trunk/files
[22:36] <henninge> While we are waiting for the import to be processed, let's talk about the next step.
[22:36] <henninge> Finding translators
[22:36] <henninge> --------------------------
[22:36] <henninge> So, who will do the translations?
[22:37] <henninge> You remember that during the configuration we chose 'Launchpad Translators' as the translation group for the project. A translation group assigns translation teams to languages. Together with the the 'Structure' translation permission that we specfied this means that only members of those teams are allowed to actually add and/or approve translations. This restriction is there to ensure that translations are of good quality.
[22:37] <henninge> sorry, that is 'Structured'
[22:38] <henninge> The Launchpad Tranlators group has translation teams assigned for 42 languages. You should familiarize yourself with their policies and ask them to start translating your project. You can find all information about Launchpad Translators here:
[22:38] <henninge> https://translations.launchpad.net/+groups/launchpad-translators
[22:38] <henninge> (Not a staging URL on purpose)
[22:40] <henninge> Of course it is possible to start your own translation group and assign translation teams yourself.
[22:41] <henninge> But that will make you responsible to find translators yourself and organize them. This is the hard part about translation applications.
[22:41] <henninge> s/translation/translating/
[22:41] <henninge> Another option would be not to choose a translation group at all and leave the permissions "Open" so that anyone can translate.
[22:42] <henninge> The problem here is that nobody feels responsible for the translations and experience has shown that "Open" permissions lead to bad quality translations.
[22:43] <henninge> Ah, the template has been extracted from the branch and placed in the queue.
[22:43] <henninge> https://translations.staging.launchpad.net/mytranslatable/trunk/+imports
[22:43] <henninge> It is automatically 'Approved' as is the case with imports from branches.
[22:44] <henninge> Now the import script will pick it up.
[22:44] <henninge> Already happened!
[22:45] <henninge> (reload the queue page)
[22:45] <henninge> Once the template is imported, you can go to its overview page in Launchpad.
[22:45] <henninge> https://translations.staging.launchpad.net/mytranslatable/trunk/+pots/mytranslatable
[22:45] <henninge> uh-oh, wrong link.
[22:45] <henninge> But you can get there from the queue ...
[22:45] <henninge> https://translations.staging.launchpad.net/mytranslatable/trunk/+pots/mytranslatble
[22:46] <henninge> yeah, my bad typing
[22:46] <henninge> You will notice that no or just a few languages will be displayed. Don't worry about that. Every Launchpad user will only see those untranslated languages that they have configured as their preferred languages. So a Chinese translator will see Chinese in the listing and be able to click on it to start translating. Once the first string is translated to a language, that language will be visible for all in the template. You can cha
[22:46] <henninge> nge your language preferences here:
[22:46] <henninge> https://translations.staging.launchpad.net/people/+me/+editlanguages
[22:47] <henninge> So, the template is in place, we have translators translating it, what is missing?
[22:47] <henninge> Retrieving translations
[22:47] <henninge> --------------------------------
[22:47] <henninge> One last step remains. How do you benefit from all the translation work done in Launchpad?
[22:48] <henninge> Remember the settings for branch synchronization? There is a second colmun on that page.
[22:48] <henninge> https://translations.staging.launchpad.net/mytranslatable/trunk/+translations-settings
[22:48] <henninge> Click on 'choose a target branch'. You can now select the same branch that was used to synchronize the template from. Make sure that you have *not* selected 'Import templates and translation files' in the left column of the settings page because that would create an unwanted loop.
[22:49] <henninge> Doing that now ...
[22:50] <henninge> Now the settings page says "Exporting translations to branch: lp://staging/mytranslatable"
[22:50] <henninge> The PO files with the translations will be exported daily (if they have changed) to your branch from where you can retrieve them with "bzr pull" or "bzr merge".
[22:51] <ClassBot> There are 10 minutes remaining in the current session.
[22:51] <henninge> They will be placed in the 'po' directory of your branch from where you can process them to MO files which you can distribute with your application.
[22:52] <henninge> I cannot demonstrate that here because the export will only happen in a few hours but we can check back tomorrow.
[22:52] <henninge> I'll do some translations that can be exported.
[22:52] <henninge> So, this is it.
[22:53] <henninge> Your created a template of English strings to be translated.
[22:53] <henninge> You created a project in Launchpad and configured it for translations.
[22:53] <henninge> You created a branch with the source code and the template and pushed that to Launchpad.
[22:54] <henninge> You asked the translators to start translating.
[22:54] <henninge> You are able to retrieve the translations back into your source tree for distribution.
[22:54] <henninge> I hope you could follow along.
[22:54] <henninge> There is help on https://help.launchpad.net/Translations/
[22:55] <henninge> A good starting point is here: https://help.launchpad.net/Translations/YourProject/BestPractices
[22:55] <henninge> Which will guide you through the process, similar to what I just did.
[22:55] <henninge> Questions?
[22:56] <ClassBot> There are 5 minutes remaining in the current session.
[22:56] <henninge> Ok, here are the promised links ;)
[22:56] <henninge> Links
[22:56] <henninge> -------
[22:56] <henninge> [1] David's session log:
[22:56] <henninge> https://wiki.ubuntu.com/MeetingLogs/appdevweek1104/InternationalizingApps
[22:56] <henninge> [2] Gettext manual, The Maintainer's View
[22:56] <henninge> http://www.gnu.org/software/gettext/manual/gettext.html#Maintainers
[22:56] <henninge> [3] Intltool
[22:56] <henninge> https://launchpad.net/intltool
[22:56] <henninge> (apt-get install intltool ; man intltool)
[22:57] <henninge> Thank you for reading. Good night. ;-)
[22:58] <dpm> Thanks a lot henninge, and with this we wrap up day 4 of Ubuntu App Developer Week! See you tomorrow with lots more of great content!
[23:01] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html