/srv/irclogs.ubuntu.com/2011/04/14/#ubuntu-classroom.txt

=== Jack is now known as Guest63657
=== marrusl is now known as marrusl_afk
=== marrusl_afk is now known as marrusl
=== yofel_ is now known as yofel
Skilly p07:32
=== Quintasan_ is now known as Quintasan
=== davidcalle_ is now known as davidcalle
iliashi11:18
iliasanyone?11:18
iliashelp11:19
iliascuc11:19
=== jbernard_ is now known as jbernard
P05TMANHello15:14
dpmhello everyone, Ubuntu App Developer Week is starting in a few minutes!16:59
c2tarunhellp dpm16:59
c2tarunhello :)16:59
yofelo/16:59
c2tarunyofel: surprise to see you here :/17:00
yofel:P17:00
dpm:)17:00
* DraZoro says hi all 17:01
c2tarunI think its time :/17:01
c2tarun!time17:01
dpmlet's wait for a few minutes for the first speaker to turn up...17:02
TheEvilPhoenixc2tarun:  uh... lol?17:02
jryannelsorry I'm late17:03
TheEvilPhoenix!time17:03
TheEvilPhoenix:P17:03
dpmjryannel, no worries17:04
dpmEveryone welcome the first speaker of today. It's Qt's jryannel, who's going to talk about Qt Quick: Elements/Animations/States17:05
c2tarunjryannel: hello :)17:05
jryannelHi all,17:06
jryannelBefore we do, plase download: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/slides/qml-composing-uis.pdf17:06
TheEvilPhoenixwait a sec, why hasnt Classbot +m'd the place yet?  shouldn't it be doing that?17:06
jryannelCan I continue?17:07
jryannelThere are also the examples/labs available at: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/addons/addon-qml-composing-uis.zip17:08
jryannelThis 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-edition17:09
=== basso_ is now known as basso
jryannelWe skip the first slides (we covered it roughtly yesterday) and go ahead to slide 21 (Anchors)17:10
jryannelWe learned yesterday we can position elements by x, y and width/height.17:10
jryannelOften we want to layout elements17:11
jryannelthis is done with anchors17:11
jryannelA anchors is another contract17:11
jryannelIt says roughly this element shall always be on the left site of the other element17:12
jryannelanchors.left: other.left17:12
jryannelSo also when you move one element the other will always follow17:12
jryannelYou have top/bottom/left/right anchors17:13
jryanneland also horizontalCenter/verticalCenter17:13
jryannelSlide 22:Anchors17:13
jryannelThis is an example how to use anchors17:13
jryannelremember you can reference other elements by id17:14
jryannelanchors.centerIn: rectangle117:14
jryannelcenterIn centers rectangle1 in this element (width and height is not changed)17:14
jryannelWe jump to slide 25: Margins17:15
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Qt Quick: Elements/Animations/States - Instructors: jryannel
jryannelAn anchors fixes on eelement to another element.17:16
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.17:16
jryannelFor reference: We use the slides at: http://qt.nokia.com/developer/learning/online/training/materials/qt-essentials-qt-quick-edition17:17
jryannelCalled; Composing User Interfaces17:17
jryannelWe are on slide 2517:17
jryannelA margin provides some space between the anchoring17:17
jryannelSlide: 2617:17
jryannelHere we see a rectangle containing 2 elements (image + text)17:18
jryannelimage and text shall be vertical centered and have some spacing between17:18
jryannelThe image is anchored on the left side of the parent's left side17:19
jryanneland has on the left side 1/16th of space of the width of the parent17:19
jryanneland sure the image is vertical centered17:19
jryannelsimilar applies to the text. But instead of anchored to the parent it's anchored to the image17:20
jryannelThe anchors.baseline is important for text to anchors according to the textbaseline17:20
jryannelAnchors are also described in more detail at: http://doc.qt.nokia.com/4.7-snapshot/qml-anchor-layout.html#anchor-layout17:21
jryannelSo besides of positioning elements by x,y we can also anchors them with margins.17:21
jryannelOften you want to anchor element in a row or column or a grid. For this we have spezialised elements17:22
jryannelThey are called Column, Row, Grid17:23
jryannelThey are helper elements to avoid writing common code17:23
jryannelSee http://doc.qt.nokia.com/4.7-snapshot/qml-positioners.html for more information17:24
jryannelanchors can be used to produce very powerful ui and also felxible from the screen dimensions17:25
jryannelOkay. Let's go to the next module. We jump over module user interaction and go direct to states17:26
jryannelPlease download: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/slides/qml-states-transitions.pdf17:26
jryannelA state describes your ui in different "phases"17:27
jryannelE.g. in simple terms it defines how properties values shall be in these different phases17:27
jryannelIf you problem downloading: http://qt.nokia.com/developer/learning/online/training/materials/qt-essentials-qt-quick-edition17:28
jryannelThen choose: States and Transitions17:28
jryannelSo think about a stop and a go light. Both are represented by a rectangle17:29
jryannelSee 617:29
jryannelSlide Nr. 617:29
jryannelin a "go" state we want one rectangle green in the "stop" state we want the other rectangle red.17:30
jryannelSlide: 717:30
jryannelWe describe the states with the states property.17:31
jryannelWhich is an array of State elements17:31
jryannela property array is marked with [ ]17:31
jryannelstate go has the name "go" and state "stop" is names stop.17:32
jryannelBoth describe changes to properties to elements declared earlier17:32
jryannel"stop" state changes the color of stop_light to red17:32
jryanneland go_light's color to "black"17:32
jryannelHow to switch between the states?17:33
jryanneluse the state property and assign the state name17:33
jryannelSlide: 817:33
jryannelSetting the State17:33
jryanneleach element has a state property and a states property17:34
jryannelstates is the array of states and state contains the name of the current state.17:34
jryannelonClicked: parent.state == "stop" ? parent.state = "go" : parent.state = "stop"17:35
jryannelonClicked is a clicked handler from the mousearea.17:35
jryannelA mousearea is an area which received mouse clicks, presses, releases...17:35
jryannelwe first ask for the current state and if it's "stop" we change it to "go".17:36
jryannelQt Quick recognizes the change and updates the ui based on the state17:36
jryannelvery simple17:37
jryannelWe jump to slide: 1217:37
jryannelAnother example, little bit more complicated.17:37
jryannelQe have a text in a rectangle17:38
jryannelAdditional we have a image (clear_button) which is clickable through the mousearea.17:38
jryannelWhen the image is clicked the text of the text_field is set to ""17:38
jryannelSlide: 1317:39
jryannelwe define 2 states "with text" and "without text"17:39
jryannel"with text" shall be active when the text_field is NOT empty17:40
jryannelthe "without text" shall be active when text_field is empty17:40
jryannelBased on the property change notification which allows the property binding "when" is evaluated everytime the text changes17:42
jryannelSide note: A text element will only accept input when it's focused.17:42
jryannelThis can be done by clicking in the TextInput or requesting focus with "focus : true"17:43
jryannelWhen going from one state to another we have a state transition17:43
jryannelState A -> (Transition) -> State B17:44
jryannelSlide: 16 (Transition)17:44
jryannelThe red button changes it's color to black via a transition.17:45
jryannelThis transition in this case shall be a color animation.17:45
jryannel(Same applies to the black/green button our go button)17:45
jryannelSlide: 1717:46
jryannelRemember we have the states "go" and "stop" in an earlier example17:46
jryannelWe add transitions with the transitions [ ] array property17:47
jryannelEach Transition element describes a transition from one state to another state17:47
jryannelfrom, to describe when transition is called17:47
jryannelInside we use an animation (more about animations later)17:48
jryannelso States -> Transitions -> Animations17:48
jryannelWe will see animations can also be used standalone and in other situations.17:48
jryannelLet's leave this module and go to: QML Animations17:49
jryannelPlease download: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/slides/qml-animations.pdf17:49
jryannelI hope you all have flatrates :_)17:49
jryannelAn animation generally describes a property change according to a easing curve and duration.17:50
jryannelSo instead for example an elements position shall be changes from x:0 to x:100 it shall not go immediately17:51
jryannelIt should go in a defined way from 0 to 100 in maybe 1second and first a little bit faster and then slower.17:51
ClassBotThere are 10 minutes remaining in the current session.17:52
jryannelSlide: 6 in the qml-animations.pdf titled "Number Animations"17:52
jryannelWe have in general NumberAnimation, ColorAnimations, RotationAnimations and PropertyAnimations17:53
jryannelWe use here: NumberAnimation on x { .... }17:54
jryannelMeans it will animate x from 0 to 150 in 1 sec (1000msecs)17:54
jryannelThis will done automatically when the component (qml file) is loaded17:55
jryannelSlide 8: PropertAnimations17:55
jryannelHere 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:56
ClassBotThere are 5 minutes remaining in the current session.17:57
jryannelIf you would give the animation an id (e.g. id: anim ) you could also start it with anim.start()17:57
jryannelYou can find more about Animations and Transitions at: http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeanimation.html17:57
jryannelI think this it it for now. I will make a 10min break and be back with the next session17:58
jryannelThanks for listening :)17:59
=== tubadaz is now known as tubadaz_away
=== tubadaz_away is now known as tubadaz
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Qt Quick: Rapid prototyping - Instructors: jryannel
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.18:02
jryannelBefore I continue on rapid prototyping... some remarks to animations18:10
jryannelThere are several ways to use animtions:18:10
jryannel* Animation on <property>18:10
jryannel* Animation { } // standalone18:11
jryannel* Animation during a state transition18:11
jryannel* Behavior on <property> // when property changes than always with the specified animation18:12
jryannelYou can nest animations with ParallelAnimation and Sequential Animation.18:12
jryannelThere is also a PauseAnimation, which waits some time before continue with the next animation in a group18:13
jryannelIMPORTANT!!: If an element is anchored for example on the left and right, x can't be animated!!18:13
jryannelanchoring is stronger!!18:14
jryannelif an element is anchored on left and right, sure y can be animated and also the height. but not the width and x18:14
jryannelAll 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-201018:16
jryannelJust make yourself a nice video evening instead of watching lord of the rings18:16
jryannelComing to "Qt Quick Prototyping"18:16
jryannelPlease have a look at: http://qt.nokia.com/developer/learning/online/talks/developerdays2010/tech-talks/qt-quick-rapid-user-interface-prototyping18:17
jryannelSorry I planned to have a screen sharing available. I hope at least some of you can watch the video18:18
jryannelAnyway I will explain about the thoughts behind...18:18
jryannelQt Quick was designed to bridge the gap between "designers" and "developers"18:19
jryannelIn a normal design driven project you have18:20
jryanneldesigners, which think about the user interaction, graphics and nowadays animation (e.g. motions)18:20
jryannelThen they use tools like Flash or paper or PhotoShop to sketch the ui.18:21
jryannelPresent beautiful design to their bosses and then ...18:21
jryannelThey throw these design to the c++ developer and ask them to implement this.18:21
jryannelSure the result will be miles away from the the sketch. It's a different technology maybe even different HW on embedded18:22
jryannelQt Quick allows designers early on to work with the same technologies as all the other developers18:23
jryannelSure 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 Quick18:23
jryannelThe 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:24
jryanneland then the prototype goes over nicely into production code18:25
jryannelBy this you can shorten the time to market but also ensure the that the UI is really that what someone asked for. Pixelperfect18:26
jryannelQt Quick is fast to code. So that you can create many different prototypes easily and then just ask you users, which one they like best18:27
jryannelAnother aspect id that the ui code is cleanly seprated from the c++ code.18:27
jryannelThis allows you to unit test your models and business logic and heavy lifting...18:28
jryanneland push a simple and clean qml API towards the ui developers18:28
jryannelQt Creator contains a design mode, which allows you to drag-n-drop ui elements (and your custom components) on a surface to sketch your ui18:29
jryannelWhen you are in a qml file hit the button on the left "Design"18:30
jryannelin Qt Creator18:30
jryannelHere you can create a first sketch. But finally you want to switch to your code (editor) to make the more complicated stuff18:31
jryannelSo an interaction designer creates "wireframes" e.g. like on http://balsamiq.com/18:31
jryannelA graphics designer makes nice graphics to the wireframe, e.g. with photoshop, gimp, inkscape, ...18:32
jryannelA motion designer thinks about how ui elements should be animated.18:33
jryannelThis is currently how I see designers. I'm not a designer I'm a programmer and I always wondered how they work18:33
=== tubadaz is now known as tubadaz_away
jryannelWe have material for designers ready at: http://qt.nokia.com/developer/learning/online/training/materials/qt-quick-for-designers18:35
jryannelEspecially module 6 talks about the different designer roles.18:35
jryannelIf you target a UI different from a standard desktop UI you want to have a design affine person in your team.18:36
jryannelEspecially with Qt Quick. This makes it really efficient.18:36
jryannelIf 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 project18:37
jryannelSee https://qt.gitorious.org/qt-components18:37
jryannelI posted this link already yesterday: http://labs.qt.nokia.com/2011/03/10/qml-components-for-desktop/18:39
jryannelWhen I prototype a UI I always start with rectangles18:39
jryannelI normally use black background and white borders.18:40
jryannelJust make sure you get the dimensions right. Maybe add some text to label an element18:40
jryannelThen concentrate on the application logic18:40
jryannelE.g. when I press here what should be happen?18:41
jryannelAt then end you look into the animations.18:41
jryannelWhen something changes, then how. Should it fade (animation on opacity), should it fly in (animation on x)18:41
=== tubadaz_away is now known as tubadaz
jryannelShould it fly and fade (parallel animation on opacity and x)18:42
jryannelYou should extract components early on (e.g. mybutton, mytextedit, mycheckbox, etc...18:43
jryannelThen you concentrate on the more details and bring in the graphics, colors, gradients, etc...18:43
jryannelMake sure you get the structure right. give application wide used elements a good id.18:44
jryannelMark internal properties with '_<property-name>18:45
jryannelTry to avoid to be to dependent on your c++ backend, I use a bool _debug property to guard sometimes those dependencies18:46
jryannelTry not to create a reusable component which can be reused in all projects in the future.18:46
jryannelDesigners think more in reuse by copy. Just make the element work for your needs. Qt Quick can be fast adapted anyway18:47
jryannelI guess that's it is for now. Any questions?18:47
jryannelTake care and hope you enjoined this lengthy talk :)18:49
jryannelOhh, one link at the end18:49
jryannelhttps://gitorious.org/qtmediahub, a XMBC (MediaCenter) clone in qt18:50
jryannelAnd https://gitorious.org/qmlshowcase.18:50
jryannelqmlshowcase was produced for a customer in one afternoon! Check it out18:51
ClassBotThere are 10 minutes remaining in the current session.18:52
ClassBotThere are 5 minutes remaining in the current session.18:57
dpmThanks 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
mterryyay18:59
mterryJust real quick: I have notes here if you're interested: https://wiki.ubuntu.com/Quickly/AppDeveloperWeek11.0418:59
mterryI'll add a link to the meeting logs there after the fact too18:59
mterrySo, I'm Michael Terry, a maintainer of Quickly19:00
mterryhttps://wiki.ubuntu.com/Quickly19:00
mterryQuickly is a template-based system for writing applications19:00
mterryquickly, easily, and hopefully fun19:00
mterryAt it's heart, it's just a system of templates with boilerplate code and a few commands19:01
mterryBut all the templates are currently Ubuntu-focused, so that's where it gets the most attention19:01
mterryEach template makes opinionated choices for you, so the app author can just focus on writing their app19:01
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Rapid App Development with Quickly - Instructors: mterry
mterryWe try to give him/her the recommended technologies by default19:02
ClassBotLogs 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
mterryoh, whoops19:02
mterrywell, the logs might not have that starting part19:02
mterryQuickly in Ubuntu 10.10 has three templates: ubuntu-application, ubuntu-cli, and ubuntu-pygame19:03
mterryIn Ubuntu 11.04, we're adding a new template, ubuntu-flash-game19:03
mterryA new command "submitubuntu" which helps get your app into the Software Center19:03
mterryAnd we've redesigned the project layouts a bit19:03
mterryI'll note when I'm talking if something applies only to the 11.04 version or not19:04
mterryIf anyone has any questions as I go through this, please let me know in the classroom19:04
mterryclassroom-chat that is19:04
mterrySo today, I'm just going to give a bit of an overview for how to use Quickly19:04
mterryAnd what it can do19:04
mterryIt's simple enough to get started.  Just "sudo apt-get install quickly"19:05
mterryThis will install a bunch of packages, which are development tools and documentation19:05
mterryBut most importantly, it will install Quickly  :)19:05
mterryNow I'll show you how to create a little throw-away app we can practice on here19:06
mterry"quickly create ubuntu-application test-project"19:06
mterryThis will create a new directory "test-project", put a lot of boilerplate in there, and open your new project19:06
mterryYou'll see that a window and some widgets and dialogs have been created for you19:06
mterryThat's part of the boilerplate I mentioned before19:07
mterryYou can customize this as much as you want, but Quickly gives you something to hit the ground running with19:07
mterryNow you want to enter your project directory: "cd test-project"19:07
mterryAnd here, if you typed "quickly tutorial" you would get a nice tutorial about how to make changes in the project you've just created19:08
mterryThat's a good command to note for later19:08
mterryBut I'm going to move on and explain some of that myself19:08
mterryThough the tutorial is valuable, and you should consider running through it later19:08
mterrySo the first thing you're likely to want to change is how the app looks19:08
mterryIn your project directory, you can type "quickly design"19:09
mterryAnd Glade will open up19:09
mterryGlade is a tool that lets you edit GTK interfaces by clicking around19:09
mterryKinda like Visual Basic, but without any of the code elements19:09
mterryGlade by itself doesn't integrate with code19:09
mterryBut Quickly matches them up for you19:10
* mterry pauses for a sec, any questions?19:10
mterryOK, so let's talk a bit about Glade.  If you're not familiar with it, it can be a bit intimidating19:11
mterryYou've got your "tool palette" of widgets on the left19:11
mterryThe middle is where you see what you're building19:11
mterryAnd the right is where you can select widgets from the widget tree or edit the currently selected widget19:11
mterryIf you just click directly in the middle on the widget you want, it will be selected19:11
mterryOr if you find it in the widget tree in the upper right19:11
mterryIn GTK, widgets are layed out in boxes, either horizontal (HBox) or vertical (VBox)19:12
mterrySo you first create a box, then add widgets to it.  And you can next boxes for more complicated layouts19:12
mterryOnce 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 right19:13
mterryThere you'll also be able to change how any widget is given space19:13
mterryYou can see the Expand and Fill properties19:13
mterryMost things start taking up all the space they can, but that's not always the effect you want19:13
mterryThose are common properties to adjust to get the layout you want19:14
=== AndrewMC is now known as Guest80546
mterryAnother 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 appropriate19:14
=== Guest80546 is now known as AndrewMC
mterrySpeaking 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
mterryOK, enough Glade19:15
mterryYou 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
mterrySo remember, "quickly design" to edit your UI19:16
mterryYou 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 code19:16
mterrySo 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
mterryAfter you do this, you should probably close Glade and re-open it with "quickly design"19:17
mterryNow Glade will see your new dialog and you can edit it as you like19:17
mterrySpecifics and code examples of adding dialogs are also in the "quickly tutorial" tutorial19:18
mterryBut I'll be brief here19:18
mterryFrom your main window, you need to import the new code module that Quickly made: "from project_name.DialogName import DialogName"19:18
mterrySo for this project, that would actually be "from test_project.SaveDialog import SaveDialog"19:19
mterryThen you use normal GTK code to run it and check the result:19:19
mterryd = DialogName()19:19
mterryresponse = d.run()19:19
mterryif response == gtk.RESPONSE_OK:19:19
mterry  #do your stuff19:20
mterryd.destroy()19:20
mterryAnd that's it!19:20
mterryPretty simple to make a dialog19:20
mterryNow, if you want to respond to what the user does, you're going to need to listen to GTK signals19:21
mterryReal briefly, when the user does something like click a button, GTK emits a signal that you can respond to, like "clicked"19:21
mterryImportant signals that you may care about are that buttons emit the "clicked" signal, menu items emit the "activated" signal19:22
mterryIt's really easy to handle these signals19:22
mterryLet's say you want to handle a menu item press in your main window19:22
mterryYou first note what the menu item is called in Glade19:22
mterryYou can check this from the widget tree in the upper right19:22
mterryRemember that name19:22
mterryNow in the code, you can add a new function named like:19:23
mterrydef on_menuitem1_activated(self, widget, data=None):19:23
mterryand inside that function, add the code that should happen when the menu item is pressed19:23
mterryQuickly already provides some code for common menu items like Quit and About, but not all of the default menu items have code already19:24
mterryIn Ubuntu 10.10, you'll also need to go into Glade and point it at your new function19:24
mterryThere is a "Signals" tab in the bottom right19:24
mterryAnd go there and enter the name of the function you just created next to the "clicked" signal19:24
mterryIn Ubuntu 11.04, Quickly can do this for you, as long as you name it like above: on_WIDGET_SIGNAL19:25
mterrySo a "clicked" signal on "button1" would be on_button1_clicked19:25
* mterry pauses for a sec. Any questions?19:25
ClassBothobbsc asked: Is quickly generating gtk2 or 3?19:26
mterryhobbsc, GTK 2 for now.  I'd like to move it to 3 next cycle19:26
mterryBut in keeping with using the recommended tools, GTK 2 is still the default toolkit for Ubuntu 11.0419:27
mterryI believe Ubuntu will be ported to 3 next cycle, so Quickly should move along with it19:27
mterryOK.  So if you want to edit the code that Quickly makes19:27
mterryincorrect, asked about PyGI vs PyGTK19:28
mterryPyGTK won't support GTK 3, so we'd have to move to PyGI at the same time.  Quickly doesn't currently use PyGI19:28
mterrySo 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:29
mterryYou'll see for example that your main TestProjectWindow class has a function "finish_initializing".  This is the recommended hook for inserting your own startup code19:30
mterryIn 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 control19:30
mterrySo let me talk about debugging real briefly19:31
mterryThe usual recommended method is just adding print statements and seeing what effect that has.  :)19:31
mterryIt's quick, dirty, and easy19:31
mterryIf 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 framework19:32
mterryThe sample code Quickly makes does that, so you can see code examples19:32
mterryIt by default won't spit out messages unless you're running your app in verbose mode19:32
mterryOr if you're debugging something very complicated, you can use pdb, which is a python debugger19:32
mterryIt's a bit difficult to use, so I just recommend using print statements19:33
mterryOh, I forgot!  If you want to run your app after you close it, use "quickly run"19:33
mterryAnd "quickly help" should give you a list of commands19:33
mterrySo now we come to the exciting stuff.  So far, Quickly has just been a jump-start to your app development19:34
mterryBut it also integrates with Launchpad to help you publish, share, and maintain your software19:34
mterryFor example, it keeps your code in bzr and you can save your changes with "quickly save"19:35
mterryOr if you have a Launchpad project, it can upload tarballs and make announcements19:35
ClassBotcrazedpsyc 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 files19:35
mterrycrazedpsyc, for errors that you "expect" to see in the field like a file that didn't open or an unexpected corner of your code19:36
mterryI would recommend logging19:36
mterryI think print statements are most useful just for yourself when you're hunting down some problem19:37
mterrySo that is, your app should probably ship with just logging lines19:37
mterryBut when I'm futzing with it, I like to add print lines to find where the problem is19:37
mterrySo let's talk a bit about packaging19:38
mterryThis is something that is normally difficult to do, but Quickly tries to make easy19:38
mterryYou 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 Center19:39
mterryLet's start simple19:39
mterry"quickly package" will package up your current code and create a .deb file for you19:39
mterryBut before you do that, actually, it's probably a good idea to set up some metadata19:40
mterryYou can open the setup.py file that Quickly made for you: "gedit setup.py"19:40
mterryNear the bottom are some fields like author name, etc19:40
mterryYou also probably want to edit the AUTHORS file and put your name and email there19:40
mterryAnd if you had a particular license in mind besides GPL-3, you can run "quickly license BSD" or whatever license you like19:41
mterryGPL-3 is the default though19:41
mterryYou 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 menus19:41
mterryYou can see a list of the correct categories here: http://standards.freedesktop.org/menu-spec/latest/apa.html19:41
mterryOK, now that we did all that bookkeeping, you can make your package19:42
mterryYou could have made it before too, Quickly will just fill in bogus info for you19:42
mterryBut it's better to have it all nice and correct :)19:42
mterrySo now after a "quickly package" you'll have a .deb file19:42
mterryYou can double click on this in the file manager and install it into your system for testing19:42
mterryAnd you can share that .deb via email or a web site for a small number of people19:43
mterryBut if you want wider testing19:43
mterryYou may want to consider creating a PPA19:43
mterryPPAs 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 testers19:43
mterrySo Launchpad has some good documentation on what you need to do here, https://help.launchpad.net/Packaging/PPA19:44
mterryBut you'll need an SSH key and a GPG key19:44
mterryhttps://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair19:44
mterryhttps://help.launchpad.net/YourAccount/ImportingYourPGPKey19:44
mterryThose are a couple more Launchpad help pages for how to make those19:44
mterryOnce Launchpad knows about you and you've created the PPA, you're ready to tell Quickly19:45
mterryYou 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 it19:45
mterrySo set them like:19:45
mterryexport DEBEMAIL="oliver.twist@example.com"19:45
mterryexport DEBFULLNAME="Oliver Twist"19:46
mterryIf you put those lines in your ~/.bashrc file, they will be set up for you every time you log in19:46
mterryOK, now you're all set19:46
mterrySo 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 line19:47
mterrySo if you have a testing PPA, which is recommended, you can easily get feedback by sharing a new package every now and then19:47
mterryIf 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 specify19:48
mterryJust like the share command19:48
mterryBy default, Quickly will pick YEAR.MONTH versioning19:48
mterryBut you can specify the version you want to the release command19:48
mterryRun "quickly help release" for details19:48
mterryAnd now finally, there is a new command in Ubuntu 11.04 that lets you prepare an upload for acceptance into the Ubuntu Software Center19:49
mterry"quickly submitubuntu"19:49
mterryThis creates and publishes a package to a PPA just as quickly release does19:50
mterrySo you can pass --ppa and such19:50
mterryThe package will have files installed into /opt as required19:50
mterryThe 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:50
mterryYou can create the same kind of package without uploading it by using "quickly package --extras"19:51
mterryThis will generate the /opt packaging and such for you to test with19:51
ClassBotThere are 10 minutes remaining in the current session.19:51
mterryincorrect mentioned integration with Eclipse19:51
mterryThat is something I'd like to see happen too, but we haven't focused on that yet19:52
mterryAlso integration with Anjuta and any other IDEs out there19:52
mterryWe'd like to make it easy for that to happen19:52
mterryBut we figured most programmers are familiar with the command line so we haven't rushed to IDE interaction19:52
mterryAgain, the current set of templates (ubuntu-application, ubuntu-cli, ubuntu-pygame, and ubuntu-flash-game) are just what we've done19:53
mterryBut it's hopefully easy to make a template of your own19:53
mterrySee "quickly quickly"19:53
mterryAnd we'd love any help!  :)19:53
mterryI also recommend trying out the ubuntu-pygame template: "quickly create ubuntu-pygame test-game"19:54
mterryIt's very neat19:54
ClassBotcrazedpsyc 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
mterrycrazedpsyc, yes, ideally.  There's nothing quite stopping them from doing it.19:54
mterrycrazedpsyc, 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
mterryAnd since we haven't actually done the work for even one IDE yet, there may be hidden gotchas in adding support19:55
mterrySo it would be good for us to try making one ourselves, so we can make it super easy to do from the Quickly side19:55
mterryBut we'd definitely work with any IDE developers that were intereste19:56
mterryd19:56
ClassBotThere are 5 minutes remaining in the current session.19:56
mterryThat's all I had.  Hopefully Quickly is fun and easy to mess around with19:56
mterryWe hang out in #quickly and #ubuntu-app-devel channels on Freenode19:56
mterryIf there are any questions you have after this, feel free to poke me there19:57
mterryOh, and if I'm not around in the channel, rickspencer3 and didrocks are experts too20:00
mterryAnd the original Quickly devs20:00
mterry(they are the originals I meant)20:00
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Getting Your App in the Distro: The Application Review Process - Instructors: allison
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.20:01
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Getting Your App in the Distro: The Application Review Process - Instructors: allison
ClassBotLogs 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
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Getting Your App in the Distro: The Application Review Process - Instructors: allison_
dpmThanks 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 Ubuntu20:02
ClassBotLogs 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
dpmallison_, all yours!20:03
dpm(let's wait for a sec while we sort out some IRC issues)20:05
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Getting Your App in the Distro: The Application Review Process - Instructors: allison_, wendar
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.20:05
wendarHi all.20:06
wendarmterry has given an excellent session on Quickly. This session is a "next step".20:06
wendarOnce you have an application packaged, there are a few ways to get it into Ubuntu.20:07
wendarI'll be going over one of those ways, through the Application Review Board.20:07
wendarThe basic idea is to make it very quick and easy to get lightweight applications into Ubuntu.20:08
wendarYou 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:09
wendarThe first step is to submit a ticket to the review board.20:11
wendarThey need a few essential details for the proposal.20:12
wendarSome are obvious: the name of the project, your name, and how to contact you.20:12
wendarWe also ask for you to have already set up your project in a PPA.20:13
wendarThat can catch a lot of common errors, so it's as helpful for you as it is for the reviewers.20:13
wendarOne thing that submitters often miss is a description of the project and what it does.20:14
wendarYou'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:15
wendarIt's worth taking a look at the submission guide, it has a good example of what to include in the proposal.20:17
wendarhttps://wiki.ubuntu.com/AppReviewBoard/Submissions/Request20:17
wendarThe next step is the initial review. One of the reviewers will volunteer as "shepherd" for your proposal.20:18
wendarYour 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:19
wendarYou and the sheperd may repeat a few rounds of changes and releasing a new version into your PPA.20:21
wendarIn 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:23
wendarIn 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:24
wendarIn the final review, the shepherd will recommend your app in one of the App Review Board meetings.20:25
wendarThese happen every two weeks on the #ubuntu-meeting channel.20:25
wendarYou can find the next meeting listed on https://wiki.ubuntu.com/AppReviewBoard/Agenda20:26
wendaror on the Ubuntu Fridge calendar.20:26
wendarThe board will vote on your app, and accept it for inclusion, recommend changes, or (in very rare cases) reject it.20:27
wendarIf 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:28
wendarOnce your app is accepted, there's a little bit of work needed to set up screenshots for the app.20:29
wendarThis is a bit of a hassle right now, but soon there will be a web form to submit your screenshots.20:30
wendarAfter the screenshots are set up, the review board will launch your app in the extras repository.20:31
wendarExtras 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:33
wendarThat's pretty much it. We've tried to make the process quite simple.20:35
wendarAre there any questions?20:35
wendarOr, any steps you'd like to go through in more detail?20:35
ClassBottiteuf_87 asked: the apps for purchase in the software center, are they submitted this way too?20:37
wendarAt the moment, apps for purchase are handled manually.20:38
wendarThey will soon have a web interface for submissions.20:38
wendarThe same web interface that App Review Board apps will use for screenshots.20:39
wendarWe'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:39
ClassBotdpm asked: who can review an app? Only those who are Review Board members?20:42
wendarThe proposals are all in a public queue, so anyone can review them.20:43
wendarIt's very welcome to have people trying out the apps and commenting on the tickets while they're under review.20:43
wendarOnly the Review Board members vote in the final review, but in our vote we'll consider all the feedback we get.20:44
wendarReviewing and trying out other developer's apps is a great way to build up experience for your own apps.20:44
wendarAny more questions?20:45
ClassBotdpm 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:50
ClassBotThere are 10 minutes remaining in the current session.20:51
wendarWe've got a wiki page to help walk developers through the steps.20:53
wendarhttps://wiki.ubuntu.com/AppReviewBoard/Submissions20:54
wendarYou can always go back there for more information.20:54
wendarA few tips to send you on your way:20:54
wendarThe basic idea for this process is that it's a good fit for lightweight applications.20:54
wendarGames, small single-purpose apps.20:55
wendarIf you're writing a large or complext application, it's probably not right for this process.20:55
ClassBotThere are 5 minutes remaining in the current session.20:56
wendarLibraries to be used by other applications also don't fit here.20:56
wendarBut, for anything that doesn't fit in the App Review process, there's always the usual process.20:56
wendarAnd, the advantage of the usual process is that once you get into universe, your package will be updated and maintained by MOTU.20:57
wendarThat's all, thanks everybody!20:58
dpmGreat, 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:00
dpmNext up is tedg_, the person who knows all about indicators, and who'll be thrilled to tell you how to add them to your applications21:01
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Adding Indicator Support to Your Apps - Instructors: tedg
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.21:01
=== tedg_ is now known as tedg
tedgVoice?21:10
tedgWoot!21:10
tedgThanks Pendulum!21:10
tedgHey everyone, sorry about the delay.21:10
tedgSo my name is Ted Gould and I work with application indicators.21:10
tedgApplication indicators are menus that appear in the Unity panel and represent various applications.21:11
tedgThese, in general, shouldn't be used just because your project's logo is so cool.  Users. hate. that.21:11
tedgBut, it's more designed as a feature for long running applications, those that are more services to users, to expose that functionality.21:12
tedgA good example of this would be Tomboy, so you can use your notes all the time and keep it running.21:12
tedgWhich is definitely useful.21:12
tedgThere's a set of design guidelines for using the app indicators.21:13
tedgAnd that is here: https://wiki.ubuntu.com/CustomStatusMenuDesignGuidelines21:13
tedgIt goes through the various features and what the layout should be.21:13
tedgIf you've got any questions whether or not something should be an appindicator, that'd be a good place to get started.21:14
tedgI'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:14
tedgFor most applications that involves using libappindicator21:15
tedgIt's a small library that makes it easy to create application indicators.21:15
tedgThe LP page for it is here: https://launchpad.net/libappindicator21:15
tedgYou can browse through the source code if you'd like.21:15
tedgBut I think that examples are a bit more interesting.21:16
tedgWe've put together a few: https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators#Porting%20Guide%20for%20Applications21:16
tedglibappindicator uses the GObject Introspection framework so that it can be accesses from any language that support it.21:16
tedgThat includes languages like Javascript and Python.21:17
tedgBut there are others as well.21:17
tedgWe also have direct Python bindings, though those will probably be dropped as soon as the GObject Introspection ones start to mature.21:17
tedgI expect the API to stay very much the same though.21:17
tedgSo 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
tedgYou need to provide a few things starting out.21:18
tedgThe 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
tedgIf you want to have more than one for some reason, each of them should be unique.  "my-project-left" "my-project-right"21:19
tedgYou also need to provide an icon name, which is the name of the icon in the icon theme.21:19
tedgFor many projects this is the main icon for the project, though it could be anything really.21:20
tedgYou 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:20
tedgThe next thing that needs to happen is you need to build a menu for that app indicator.21:21
tedgYou can do this in GTK+ and libappindicator will take care of making sure that gets translated over the bus.21:22
tedgYou can also attach to the normal GTK signals and those will be synthesized from the DBus signals as well.21:22
tedgI'm not going to go much into building menus, the examples there all have ways to do it.21:23
=== tubadaz_ is now known as tubadaz
tedgYou should look at GTK resources like http://gtk.org/documentation.html to learn more about that.21:23
tedgThis is all that is needed for a basic application indicator -- but you shouldn't stop there!21:24
tedgThere are some other features that can really improve your application indicator.21:24
tedgOne of those is providing an accessible name for the icon.21:24
tedgUsers 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
tedgIt's important for making your application work well for everyone.21:25
tedgYou can also put a label next to your application indicator.21:25
tedgFor instance, indicator-weather uses this to put the current temperature on the unity panel.21:26
tedgIn general, we recommend that you provide a way to disable the label feature as it can be disruptive to some users.21:26
tedgThere are definitely use cases for small strings though, and this provides a way to do those.21:27
tedgAlso, Application Indicators provide a built in attention state.21:27
tedgThe 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
tedgFor instance if there was inclement weather or if the application lost a network connection.21:28
tedgFrom the developer's perspective this is just "another icon" but it can provide an easy to implement experience.21:29
tedgSince 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:30
tedgThere is also a few little things in the API, like being able to get mouse wheel events that can be fun.21:31
tedgIt's good to remember that it's nearly impossible for anyone other than power users to realize the mouse wheel behavior.21:31
tedgBut that can be a fun feature to provide those users with something extra.21:31
tedgThat's the basics of implementing an app indicator, let me take a little break for questions before I go on.21:32
tedgAny questions?21:32
tedgOkay, seeing none, I'll assume I was perfectly clear ;-)21:33
tedgAn advanced topic that I'd like to cover is fallbacks.21:34
tedgOne thing that application developers told us is that they don't want to build applications that can only run on Unity.21:34
tedgBut, they don't want working with everyone else to be a lot of work either.21:34
tedgSo we built in fallbacks into libappindicator so that you don't have to worry about that.21:35
tedgWhat the basic fallback is using GtkStatusIcon to create a systray icon.21:35
tedgThis icon can then be shown in environments not currently using the KSNI interface.21:36
tedgThis would include XFCE, GNOME Shell or GNU Step.21:36
tedgWhat will happen is that the same icons will be shown in the systray as you specified to libappindicator.21:37
tedgWhen you click on the icon, the menu will be shown.21:37
tedgIn a nutshell, it should be roughly the same as what happens on the unity panel.21:37
tedgSome application authors might not want that though.21:38
tedgThey may want to take advantage of environment specific features.21:38
tedgOr they could just want to fallback to a different interface all together.21:38
tedgTo account for that the AppIndicator object is subclassable with two overridable functions: fallback and unfallback.21:39
tedgfallback() gets called when libappindicator determines that there is no KSNI interface to connect to.21:39
tedgIf that interface comes up in the mean time, it'll call unfallback.21:39
tedgThis takes care of cases where the KSNI interface may crash or start up in a different order than is normally expected.21:40
tedgThis 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
tedgThey provide all the basic functionality, and can be extended.21:41
tedgSo does anyone have questions on fallbacks?21:42
tedgSeeing none, I'll continue on.21:43
tedgSo the last thing I wanted to talk about is the future of application indicators.21:44
tedgBut, it's not very exciting :-)21:44
tedgWe've got plans to clean up the API some to make the introspection better.21:44
tedgAnd mostly maintenance task surrounding that.21:44
tedgWe expect that application indicator should stay stable at least through the 12.04 release which will hopefully be an LTS.21:45
tedgWe do expect to drop the custom Python bindings for a GObject Introspected version.21:46
tedgWe hope to do the same with the C# bindings, but it's less clear when the GObject Introspection interface will be complete there.21:46
tedgSo that's mostly what I had hoped to cover in today's session.21:47
tedgIs there anything else you guys would like me to talk about?21:47
tedgOkay, I'll call it a wrap then.21:48
tedgThanks everyone!21:48
tedgdpm, Who's up next?21:48
ClassBotThere are 10 minutes remaining in the current session.21:51
dpmok, thanks tedg for a great talk21:52
dpmNext 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:54
ClassBotThere are 5 minutes remaining in the current session.21:56
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Using Launchpad to Get Your Application Translated - Instructors: henninge
ClassBotLogs 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
henningeHello and welcome to this session on "Using Launchpad to get your application translated".22:01
henningeThis 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
henningeIt 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:02
henningeFeel free to interrupt and ask questions any time but we also have a lot of ground to cover.22:03
henningeDavid 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
henningeI 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:03
henningeOn 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 re22:04
henningeports from users about linguistic matters to the appropriate translation team, or explain users how to reach or join their team." [2]22:04
henningeWhat 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
henningeLaunchpad Translations is there to help you with that responsibility.22:05
henningeDemo project and staging server22:05
henninge------------------------------------------------22:05
henningeFor 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
henningeIn 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
henningehttps://staging.launchpad.net/~mytranslatable-maintainers/+join22:06
henningeAlternatively 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
henningePlease be aware that the staging server is a bit slower and more like to time out. Please be patient.22:07
henningeI 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 team22:09
henningeor maybe everybody wants to create their own projects ... ;)22:09
henningeOK, let's dive in with some basic concepts you should be familiar with.22:09
henningeMarking strings as translatable22:09
henninge---------------------------------------------22:09
henningeTo 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:09
henningeOh, I forgot22:10
henningeThe source tree to the demo project is found here:22:10
henningehttp://people.canonical.com/mytranslatable.tar.gz22:10
henningeHere is the source code of the two source files in that project:22:11
henningehttp://paste.ubuntu.com/593926/22:11
henningehttp://paste.ubuntu.com/593927/22:11
henningeYou 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:11
henningeFor 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
henningePO templates and PO files22:12
henninge--------------------------------------22:12
henningeWhen 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:12
henningeHere is an example from our two example source files.22:13
henningehttp://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:13
henningePO files are kept in a subdirectory called 'po' on your project. That is also where the template file will be created.22:14
henningeCreating 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:14
henningeOtherwise you will have to manually configure your project for intltool. To configure your project for intltool you need to create two files.22:15
henninge1. po/POTFILES.in contains a list of the source files that translatable strings will be extracted from.22:15
henninge2. 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:15
henningeHere are the the files for our example:22:16
henningehttp://paste.ubuntu.com/594052/22:16
henningehttp://paste.ubuntu.com/594054/22:16
henningeNow 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:16
henningeEverybody following along? This was mostly repetition, we will now move over to Launchpad.22:17
henningeSet up a project in Launchpad22:18
henninge--------------------------------------------22:18
henningeBefore 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
henningehttps://staging.launchpad.net/projects/+new22:18
henningeLet's assume you created a project called 'mytranslatable', then it's home page will be here:22:18
henningehttps://staging.launchpad.net/mytranslatable/22:18
henningeI actually created that project on staging, so you can go to that URL and have a look.22:19
henningeOnce 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
henningehttps://staging.launchpad.net/mytranslatable/+configure-translations22:19
henningeChoose these settings:22:19
henninge  Type of service: Launchpad22:19
henninge  Translation focus: trunk22:19
henninge  Translation group: Launchpad Translators (We'll talk about that in a bit)22:19
henninge  Translation permission policy: Structured22:19
henningeNext we need a branch to import to. From the projects home page click 'Configure project' branch.22:20
henningehttps://staging.launchpad.net/mytranslatable/trunk/+setbranch22:20
henningeChose 'Create a new, empty branch ...' and enter the Branch name as 'trunk'.22:21
henningeSince I already did that, the current branch is already filled out in the top input field.22:22
henningeFinally 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
henningehttps://translations.staging.launchpad.net/mytranslatable/trunk/+translations-settings22:22
henningeThis page should mention the branch we just created as 'lp://staging/mytranslatable'. Under Import settings chose 'Import template files' and save the settings.22:23
henningeNow the project is ready to receive the template.22:24
henningeGetting the PO template into Launchpad22:25
henninge-------------------------------------------------------22:25
henningeThis 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
henningeIf you used quickly it already created a branch for you. Otherwise create the branch by calling 'bzr init' in the projects root directory.22:25
henningeI will do that now here on my machine and paste the output.22:26
henninge[~/canonical/playground]22:26
henningehenning@hobbes:$ cd mytranslatable22:26
henninge[~/canonical/playground/mytranslatable]22:26
henningehenning@hobbes:$ bzr init22:26
henningeCreated a standalone tree (format: 2a)22:26
henningeNow 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:27
henningeAgain, doing it locally now.22:28
henninge[~/canonical/playground/mytranslatable]22:28
henningehenning@hobbes:$ bzr add22:28
henningeadding po22:28
henningeadding src22:28
henningeadding po/Makevars22:28
henningeadding po/POTFILES.in22:28
henningeadding po/mytranslatble.pot22:28
henningeadding src/main.c22:28
henningeadding src/main.py22:28
henningeNow commit those changes to the branch.22:29
henninge[~/canonical/playground/mytranslatable]22:29
henningehenning@hobbes:$ bzr commit -m "Initial commit."22:29
henningeCommitting to: /home/henning/canonical/playground/mytranslatable/22:29
henningeadded po22:29
henningeadded src22:29
henningeadded po/Makevars22:29
henningeadded po/POTFILES.in22:29
henningeadded po/mytranslatble.pot22:29
henningeadded src/main.c22:29
henningeadded src/main.py22:29
henningeCommitted revision 1.22:29
henningeFinally 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
henningehenning@hobbes:$ bzr push --remember --use-existing-dir lp://staging/mytranslatable22:30
henningeHost key fingerprint is 9d:38:3a:63:b1:d5:6f:c4:44:67:53:49:2e:ee:fc:8922:30
henningeCreated new branch.22:31
henningeYou can look at the branch on Launchpad now and see that push is being processed.22:31
henningehttps://code.staging.launchpad.net/~mytranslatable-maintainers/mytranslatable/trunk22:32
henningeIt says "Updating branch..."22:32
henningeThis is almost it.22:32
henningeWe'll have to wait a little for the branch to be procecssed and the template to be imported.22:33
henningeYou can see it happening in the import queue of the project series.22:33
henningehttps://translations.staging.launchpad.net/project-no1/trunk/+imports22:33
=== tubadaz is now known as tubadaz_away
henningeoops, wrong URL.22:33
henningeI was trying this out earlier today.22:34
henningehttps://translations.staging.launchpad.net/mytranslatable/trunk/+imports22:34
henningeYeah, empty queue is correct. ;-)22:34
=== tubadaz_away is now known as tubadaz
henningeThe branch has been processed and you can now actually browse the code on Launchpad.22:35
henningeClick 'Browse the code' on the branch page.22:35
henningehttp://bazaar.staging.launchpad.net/~mytranslatable-maintainers/mytranslatable/trunk/files22:35
henningeWhile we are waiting for the import to be processed, let's talk about the next step.22:36
henningeFinding translators22:36
henninge--------------------------22:36
henningeSo, who will do the translations?22:36
henningeYou 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
henningesorry, that is 'Structured'22:37
henningeThe 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
henningehttps://translations.launchpad.net/+groups/launchpad-translators22:38
henninge(Not a staging URL on purpose)22:38
henningeOf course it is possible to start your own translation group and assign translation teams yourself.22:40
henningeBut that will make you responsible to find translators yourself and organize them. This is the hard part about translation applications.22:41
henninges/translation/translating/22:41
henningeAnother option would be not to choose a translation group at all and leave the permissions "Open" so that anyone can translate.22:41
henningeThe problem here is that nobody feels responsible for the translations and experience has shown that "Open" permissions lead to bad quality translations.22:42
henningeAh, the template has been extracted from the branch and placed in the queue.22:43
henningehttps://translations.staging.launchpad.net/mytranslatable/trunk/+imports22:43
henningeIt is automatically 'Approved' as is the case with imports from branches.22:43
henningeNow the import script will pick it up.22:44
henningeAlready happened!22:44
henninge(reload the queue page)22:45
henningeOnce the template is imported, you can go to its overview page in Launchpad.22:45
henningehttps://translations.staging.launchpad.net/mytranslatable/trunk/+pots/mytranslatable22:45
henningeuh-oh, wrong link.22:45
henningeBut you can get there from the queue ...22:45
henningehttps://translations.staging.launchpad.net/mytranslatable/trunk/+pots/mytranslatble22:45
henningeyeah, my bad typing22:46
henningeYou 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 cha22:46
henningenge your language preferences here:22:46
henningehttps://translations.staging.launchpad.net/people/+me/+editlanguages22:46
henningeSo, the template is in place, we have translators translating it, what is missing?22:47
henningeRetrieving translations22:47
henninge--------------------------------22:47
henningeOne last step remains. How do you benefit from all the translation work done in Launchpad?22:47
henningeRemember the settings for branch synchronization? There is a second colmun on that page.22:48
henningehttps://translations.staging.launchpad.net/mytranslatable/trunk/+translations-settings22:48
henningeClick 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:48
henningeDoing that now ...22:49
henningeNow the settings page says "Exporting translations to branch: lp://staging/mytranslatable"22:50
henningeThe 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:50
ClassBotThere are 10 minutes remaining in the current session.22:51
henningeThey 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:51
henningeI cannot demonstrate that here because the export will only happen in a few hours but we can check back tomorrow.22:52
henningeI'll do some translations that can be exported.22:52
henningeSo, this is it.22:52
henningeYour created a template of English strings to be translated.22:53
henningeYou created a project in Launchpad and configured it for translations.22:53
henningeYou created a branch with the source code and the template and pushed that to Launchpad.22:53
henningeYou asked the translators to start translating.22:54
henningeYou are able to retrieve the translations back into your source tree for distribution.22:54
henningeI hope you could follow along.22:54
henningeThere is help on https://help.launchpad.net/Translations/22:54
henningeA good starting point is here: https://help.launchpad.net/Translations/YourProject/BestPractices22:55
henningeWhich will guide you through the process, similar to what I just did.22:55
henningeQuestions?22:55
ClassBotThere are 5 minutes remaining in the current session.22:56
henningeOk, here are the promised links ;)22:56
henningeLinks22:56
henninge-------22:56
henninge[1] David's session log:22:56
henningehttps://wiki.ubuntu.com/MeetingLogs/appdevweek1104/InternationalizingApps22:56
henninge[2] Gettext manual, The Maintainer's View22:56
henningehttp://www.gnu.org/software/gettext/manual/gettext.html#Maintainers22:56
henninge[3] Intltool22:56
henningehttps://launchpad.net/intltool22:56
henninge(apt-get install intltool ; man intltool)22:56
henningeThank you for reading. Good night. ;-)22:57
dpmThanks 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!22:58
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html23:01
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat ||

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!