~quickly/quickly/quickly-po

« back to all changes in this revision

Viewing changes to data/templates/ubuntu-application/help/po/de.po

  • Committer: Launchpad Translations on behalf of quickly
  • Date: 2011-02-16 05:11:20 UTC
  • Revision ID: launchpad_translations_on_behalf_of_quickly-20110216051120-gohiuaojqvcam3h1
Launchpad automatic translations update.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
"MIME-Version: 1.0\n"
15
15
"Content-Type: text/plain; charset=UTF-8\n"
16
16
"Content-Transfer-Encoding: 8bit\n"
17
 
"X-Launchpad-Export-Date: 2010-10-08 04:44+0000\n"
18
 
"X-Generator: Launchpad (build Unknown)\n"
19
 
 
20
 
#: data/templates/ubuntu-application/help/tutorial.xml:13(firstname)
21
 
msgid "Shane"
22
 
msgstr "Shane"
23
 
 
24
 
#: data/templates/ubuntu-application/help/tutorial.xml:14(surname)
25
 
msgid "Fagan"
26
 
msgstr "Fagan"
27
 
 
28
 
#: data/templates/ubuntu-application/help/tutorial.xml:17(firstname)
 
17
"X-Launchpad-Export-Date: 2011-02-16 05:11+0000\n"
 
18
"X-Generator: Launchpad (build 12351)\n"
 
19
 
 
20
#: data/templates/ubuntu-pygame/help/tutorial.xml:13(firstname)
29
21
msgid "Rick"
30
22
msgstr "Rick"
31
23
 
32
 
#: data/templates/ubuntu-application/help/tutorial.xml:18(surname)
 
24
#: data/templates/ubuntu-pygame/help/tutorial.xml:14(surname)
33
25
msgid "Spencer"
34
26
msgstr "Spencer"
35
27
 
36
 
#: data/templates/ubuntu-application/help/tutorial.xml:20(corpauthor)
 
28
#: data/templates/ubuntu-pygame/help/tutorial.xml:16(corpauthor)
37
29
msgid "Canonical ltd"
38
30
msgstr "Canonical ltd"
39
31
 
40
 
#: data/templates/ubuntu-application/help/tutorial.xml:24(date) data/templates/ubuntu-application/help/tutorial.xml:29(invpartnumber)
 
32
#: data/templates/ubuntu-pygame/help/tutorial.xml:20(date) data/templates/ubuntu-pygame/help/tutorial.xml:25(invpartnumber)
41
33
msgid "2010"
42
34
msgstr "2010"
43
35
 
44
 
#: data/templates/ubuntu-application/help/tutorial.xml:0(application) data/templates/ubuntu-application/help/tutorial.xml:1160(application) data/templates/ubuntu-application/help/tutorial.xml:1160(application) data/templates/ubuntu-application/help/tutorial.xml:1163(application)
45
 
msgid "Quickly"
46
 
msgstr "Quickly"
 
36
#: data/templates/ubuntu-pygame/help/tutorial.xml:0(application)
 
37
msgid "Quickly PyGame Template"
 
38
msgstr ""
47
39
 
48
 
#: data/templates/ubuntu-application/help/tutorial.xml:28(productnumber)
 
40
#: data/templates/ubuntu-pygame/help/tutorial.xml:24(productnumber)
49
41
msgid "0.6.1"
50
42
msgstr "0.6.1"
51
43
 
52
 
#: data/templates/ubuntu-application/help/tutorial.xml:30(title)
53
 
msgid "<application>Quickly</application> 0.6.1 User Guide"
54
 
msgstr "<application>Quickly</application> 0.6.1 Anleitung"
 
44
#: data/templates/ubuntu-pygame/help/tutorial.xml:26(title)
 
45
msgid "<application>Quickly PyGame Template</application> 0.6.1 Tutorial"
 
46
msgstr ""
55
47
 
56
 
#: data/templates/ubuntu-application/help/tutorial.xml:35(title)
 
48
#: data/templates/ubuntu-pygame/help/tutorial.xml:31(title)
57
49
msgid "About This Guide"
58
50
msgstr "Über diese Anleitung"
59
51
 
60
 
#: data/templates/ubuntu-application/help/tutorial.xml:36(para)
61
 
msgid ""
62
 
"<application>Quickly</application> is a set of choices about writing apps "
63
 
"for Ubuntu. Out of all the wonderful richness and variety of programming for "
64
 
"Linux, <application>Quickly</application> make some very opinionated choices "
65
 
"about what tools to use, and how to combine them. The criteria for these "
66
 
"choices was to make it easy and fun to write and release Linux applications, "
67
 
"even if it's your first time trying, but also in a way that delivers the "
68
 
"full power and flexibility of the platform. One benefit of these choices, is "
69
 
"that it's also easier to write tools that make it even easier and more fun. "
70
 
"So <application>Quickly</application> is also a set of commands."
71
 
msgstr ""
72
 
 
73
 
#: data/templates/ubuntu-application/help/tutorial.xml:39(link) data/templates/ubuntu-application/help/tutorial.xml:45(title)
74
 
msgid "Getting Started"
75
 
msgstr "Erste Schritte"
76
 
 
77
 
#: data/templates/ubuntu-application/help/tutorial.xml:46(para)
78
 
msgid ""
79
 
"This part 1 of the <application>Quickly</application> tutorial. This part is "
80
 
"will introduce some key <application>Quickly</application> commands, editing "
81
 
"a user interface in Glade, and editing code in Gedit. This part of the "
82
 
"tutorial will familiarize you with these three tools, and how they work "
83
 
"together with python and pygtk so that you can "
84
 
"<application>Quickly</application> build applications."
85
 
msgstr ""
86
 
 
87
 
#: data/templates/ubuntu-application/help/tutorial.xml:48(title)
88
 
msgid "Creating a <application>Quickly</application> Project"
89
 
msgstr "Ein <application>Quickly</application>-Projekt erstellen"
90
 
 
91
 
#: data/templates/ubuntu-application/help/tutorial.xml:48(para)
92
 
msgid ""
93
 
"<placeholder-1/>Creating an empty but working program couldn't be simpler. "
94
 
"First, open a terminal window to type commands into. When it's open, type "
95
 
"the command:"
96
 
msgstr ""
97
 
 
98
 
#: data/templates/ubuntu-application/help/tutorial.xml:49(programlisting)
99
 
#, no-wrap
100
 
msgid "quickly create ubuntu-application jotty"
101
 
msgstr "quickly create ubuntu-application jotty"
102
 
 
103
 
#: data/templates/ubuntu-application/help/tutorial.xml:53(para)
104
 
msgid ""
105
 
"This will create a jotty sub directory containing a complete directory tree "
106
 
"and files for an empty python application. The command finishes by running "
107
 
"the newly created empty application."
108
 
msgstr ""
109
 
 
110
 
#: data/templates/ubuntu-application/help/tutorial.xml:57(title)
111
 
msgid "Testing the Empty Application"
112
 
msgstr "Die leere Anwendung testen"
113
 
 
114
 
#: data/templates/ubuntu-application/help/tutorial.xml:57(para)
115
 
msgid ""
116
 
"<placeholder-1/> They are populated and set up, and you can resize the "
117
 
"window. Notice that <application>Quickly</application> inferred that the "
118
 
"application title is \"Jotty\". Only a few of menu items do anything in the "
119
 
"empty application, Help-&gt;About, Edit-&gt;Preferences, and File-&gt;Quit."
120
 
msgstr ""
121
 
 
122
 
#: data/templates/ubuntu-application/help/tutorial.xml:61(title)
123
 
msgid "Running the Application"
124
 
msgstr "Die Anwendung ausführen"
125
 
 
126
 
#: data/templates/ubuntu-application/help/tutorial.xml:61(para)
127
 
msgid ""
128
 
"<placeholder-1/> Close the application by closing the window or using the "
129
 
"Quit command. Since the empty application isn't installed into Ubuntu yet, "
130
 
"you can't start the application from the application menu yet. To start the "
131
 
"applicaton, use the terminal to first cd into the new subdirectory, and then "
132
 
"use \"quickly run\" to start the program."
133
 
msgstr ""
134
 
 
135
 
#: data/templates/ubuntu-application/help/tutorial.xml:63(programlisting)
136
 
#, no-wrap
137
 
msgid ""
138
 
"\n"
139
 
"cd jotty\n"
140
 
"quickly run\n"
141
 
msgstr ""
142
 
"\n"
143
 
"cd jotty\n"
144
 
"quickly run\n"
145
 
 
146
 
#: data/templates/ubuntu-application/help/tutorial.xml:70(title)
147
 
msgid "Editing an Application"
148
 
msgstr "Eine Anwendung bearbeiten"
149
 
 
150
 
#: data/templates/ubuntu-application/help/tutorial.xml:71(title)
151
 
msgid "Edit the User Interface in Glade"
152
 
msgstr "Die Oberfläche in Glade bearbeiten"
153
 
 
154
 
#: data/templates/ubuntu-application/help/tutorial.xml:71(para)
155
 
msgid ""
156
 
"<placeholder-1/><application>Quickly</application> programs use Glade to "
157
 
"edit the user interface. Start Glade with \"quickly design\" in order to set "
158
 
"up Glade for editing the empty applicaton. Don't start glade directly, or it "
159
 
"won't load the necessary catalogue files for editing the classes that were "
160
 
"automaticaly generated by <application>Quickly</application>."
161
 
msgstr ""
162
 
 
163
 
#: data/templates/ubuntu-application/help/tutorial.xml:73(programlisting) data/templates/ubuntu-application/help/tutorial.xml:128(programlisting)
164
 
#, no-wrap
165
 
msgid "quickly design"
166
 
msgstr "quickly design"
167
 
 
168
 
#: data/templates/ubuntu-application/help/tutorial.xml:77(para)
169
 
msgid "Glade will open with the project loaded up and ready to edit."
170
 
msgstr ""
171
 
 
172
 
#: data/templates/ubuntu-application/help/tutorial.xml:81(para)
173
 
msgid "Use the Project Menu to choose \"JottytWindow.ui\" for editing."
174
 
msgstr ""
175
 
 
176
 
#: data/templates/ubuntu-application/help/tutorial.xml:85(para)
177
 
msgid ""
178
 
"We want to create a text area for typing into. There are some default "
179
 
"Widgets added to the Window. We won't need these so we'll start with "
180
 
"deleting them. Click on the label, and press delete, and it will disappear "
181
 
"from the window."
182
 
msgstr ""
183
 
 
184
 
#: data/templates/ubuntu-application/help/tutorial.xml:92(para)
185
 
msgid "Do the same with the image widget. This leave us two free slots."
186
 
msgstr ""
187
 
 
188
 
#: data/templates/ubuntu-application/help/tutorial.xml:96(para)
189
 
msgid ""
190
 
"We'll use the bottom slot to add a TextView widget for the user to type "
191
 
"into. In the toolbox, click on the TextView widget. Then click in the empty "
192
 
"slot."
193
 
msgstr ""
194
 
 
195
 
#: data/templates/ubuntu-application/help/tutorial.xml:100(para)
196
 
msgid ""
197
 
"Make sure you save the file in Glade, or your changes won't take! Then run "
198
 
"the application from terminal again. The window now has a place where the "
199
 
"user can type."
200
 
msgstr ""
201
 
 
202
 
#: data/templates/ubuntu-application/help/tutorial.xml:104(para)
203
 
msgid ""
204
 
"Now we'll add the entry field for the title, and also a label for it. We'll "
205
 
"use the top empty slot for that. First, click on Horizontal Box (HBox) from "
206
 
"the \"Containers\" section of the pallette, and then click on the top slot. "
207
 
"A dialog box will open, tell it that you want two items."
208
 
msgstr ""
209
 
 
210
 
#: data/templates/ubuntu-application/help/tutorial.xml:108(para)
211
 
msgid ""
212
 
"The HBox is a container that arranges it's children horizontally. Add a "
213
 
"label to the empty left hand box, and a Text Entry to the right hand one."
214
 
msgstr ""
215
 
 
216
 
#: data/templates/ubuntu-application/help/tutorial.xml:112(para)
217
 
msgid ""
218
 
"Before going on, let's clean up the UI just a tad here. Select the new HBox "
219
 
"from the treeview in the inspector window. Then go to the Packing tab, and "
220
 
"set Expand and Fill to \"No\"."
221
 
msgstr ""
222
 
 
223
 
#: data/templates/ubuntu-application/help/tutorial.xml:116(para)
224
 
msgid "Go to the General tab, and set spacing to 5."
225
 
msgstr ""
226
 
 
227
 
#: data/templates/ubuntu-application/help/tutorial.xml:120(para)
228
 
msgid ""
229
 
"Select the label. On the general tab, set \"Label\" to \"Name:\". Set expand "
230
 
"and fill to \"no\" for the label, but keep it \"yes\" for the entry. Set the "
231
 
"padding for both to 5 (also on the Packing tab)."
232
 
msgstr ""
233
 
 
234
 
#: data/templates/ubuntu-application/help/tutorial.xml:124(title)
235
 
msgid "Add the Save, Open, and New Features"
236
 
msgstr ""
237
 
 
238
 
#: data/templates/ubuntu-application/help/tutorial.xml:124(para)
239
 
msgid ""
240
 
"<placeholder-1/> After the user types something, they may want to save it. A "
241
 
"File-&gt;Save menu item was automatically created when the empty applicaton "
242
 
"was created, but it's not hooked up to any code. To make Save work, we need "
243
 
"tell the menu item what function to call, and then create a function to "
244
 
"actually do the saving."
245
 
msgstr ""
246
 
 
247
 
#: data/templates/ubuntu-application/help/tutorial.xml:126(title)
248
 
msgid "Set the Signal Handler in Glade"
249
 
msgstr ""
250
 
 
251
 
#: data/templates/ubuntu-application/help/tutorial.xml:126(para)
252
 
msgid ""
253
 
"<placeholder-1/> To tell the menu item what function to call. If glade is "
254
 
"not still open, open up the application in glade:"
255
 
msgstr ""
256
 
 
257
 
#: data/templates/ubuntu-application/help/tutorial.xml:129(para)
258
 
msgid ""
259
 
"Click on the file menu, and the menu opens as if the application were "
260
 
"running."
261
 
msgstr ""
262
 
 
263
 
#: data/templates/ubuntu-application/help/tutorial.xml:133(para)
264
 
msgid "Choose the Save menu item, and it will be selected in Glade."
265
 
msgstr ""
266
 
 
267
 
#: data/templates/ubuntu-application/help/tutorial.xml:137(para)
268
 
msgid "Then choose the \"Signals\" tab of the properties window."
269
 
msgstr ""
270
 
 
271
 
#: data/templates/ubuntu-application/help/tutorial.xml:141(para)
272
 
msgid ""
273
 
"In pygtk, menu items are \"activated\" when a user chooses the item from the "
274
 
"menu. Since we want a function to run when the user chooses Save, we want to "
275
 
"specify a function to respond to the activate signal from the menu item. "
276
 
"We'll call the function \"save_file\". Simply type the function name into "
277
 
"the box for the activate signal.Make sure to save the glade file."
278
 
msgstr ""
279
 
 
280
 
#: data/templates/ubuntu-application/help/tutorial.xml:145(para)
281
 
msgid ""
282
 
"Note that you will need to setup the \"open_file\" signal and the "
283
 
"\"new_file\" signal as well when you get to those functions later."
284
 
msgstr ""
285
 
 
286
 
#: data/templates/ubuntu-application/help/tutorial.xml:146(title)
287
 
msgid "Edit the Code in Gedit"
288
 
msgstr "Den Quelltext in Gedit bearbeiten"
289
 
 
290
 
#: data/templates/ubuntu-application/help/tutorial.xml:147(title)
291
 
msgid "Set Up Tabs Correctly"
292
 
msgstr ""
293
 
 
294
 
#: data/templates/ubuntu-application/help/tutorial.xml:147(para)
295
 
msgid ""
296
 
"<placeholder-1/> Note a major gotcha here. In python spaces and tabs are "
297
 
"totally different, but they look just the same in an editor. So being "
298
 
"indented one tab stop is not the same as being indented four spaces, even "
299
 
"though they might look the same. And indentation level is very important in "
300
 
"python. You will get a lot of errors if you mix tab indentation with space "
301
 
"indentation. Your generated project follows the python standard of using "
302
 
"four spaces for each indentation level. So you'll either have to hit the "
303
 
"space bar four time every time you indent, or set up your editor to use the "
304
 
"right number of spaces for tabs."
305
 
msgstr ""
306
 
 
307
 
#: data/templates/ubuntu-application/help/tutorial.xml:149(para)
308
 
msgid ""
309
 
"The upshot is that you should take a moment to set up your Gedit (or "
310
 
"whatever editor you are using) to use spaces for tabs. In Gedit, select "
311
 
"Preferences from the Edit menu, and choose the Editor tab. Then set Tab "
312
 
"width to 4, and turn on \"Insert spaces instead of tabs\". Your preferences "
313
 
"should look like this:"
314
 
msgstr ""
315
 
 
316
 
#: data/templates/ubuntu-application/help/tutorial.xml:153(title)
317
 
msgid "Create the Save File Signal Handler"
318
 
msgstr ""
319
 
 
320
 
#: data/templates/ubuntu-application/help/tutorial.xml:153(para)
321
 
msgid ""
322
 
"<placeholder-1/> Now you're ready to write some code. Of course just telling "
323
 
"the glade file what signal to emit won't make the file actually save, "
324
 
"because we haven't created the \"save_file\" function yet. The code for "
325
 
"JottyWindow is stored in the file jotty. jotty is a special python file that "
326
 
"is the entry point for your application. Other python files in your "
327
 
"application have the \".py\" suffix."
328
 
msgstr ""
329
 
 
330
 
#: data/templates/ubuntu-application/help/tutorial.xml:155(para)
331
 
msgid ""
332
 
"Use the <application>Quickly</application> edit command to start editing "
333
 
"your code files:"
334
 
msgstr ""
335
 
 
336
 
#: data/templates/ubuntu-application/help/tutorial.xml:156(programlisting)
337
 
#, no-wrap
338
 
msgid "quickly edit"
339
 
msgstr "quickly edit"
340
 
 
341
 
#: data/templates/ubuntu-application/help/tutorial.xml:157(para)
342
 
msgid ""
343
 
"This will open the default Ubuntu text editor \"Gedit\" with any python "
344
 
"files in the python directory."
345
 
msgstr ""
346
 
 
347
 
#: data/templates/ubuntu-application/help/tutorial.xml:161(para)
348
 
msgid ""
349
 
"JottyWindow.ui is now expecting to find a function JottyWindow.save_file(), "
350
 
"so we simply add one to the JottyWindow class in the jotty file right under "
351
 
"the on_destroy funtion.:"
352
 
msgstr ""
353
 
 
354
 
#: data/templates/ubuntu-application/help/tutorial.xml:163(programlisting)
355
 
#, no-wrap
356
 
msgid ""
357
 
"\n"
358
 
"    def save_file(self, widget, data=None):\n"
359
 
"        print \"save\"\n"
360
 
"\n"
361
 
msgstr ""
362
 
"\n"
363
 
"    def save_file(self, widget, data=None):\n"
364
 
"        print \"speichern\"\n"
365
 
"\n"
366
 
 
367
 
#: data/templates/ubuntu-application/help/tutorial.xml:169(para)
368
 
msgid ""
369
 
"This will print the word \"save\" to the terminal when run. The method "
370
 
"signature is the standard signature expected in a signal handler. If you are "
371
 
"new to python, be sure to copy the indentations exactly, as the indentation "
372
 
"level is very important in python."
373
 
msgstr ""
374
 
 
375
 
#: data/templates/ubuntu-application/help/tutorial.xml:170(para)
376
 
msgid "Save the file, and run it again:"
377
 
msgstr ""
378
 
 
379
 
#: data/templates/ubuntu-application/help/tutorial.xml:171(programlisting)
380
 
#, no-wrap
381
 
msgid ""
382
 
" \n"
383
 
"quickly run\n"
384
 
msgstr ""
385
 
" \n"
386
 
"quickly run\n"
387
 
 
388
 
#: data/templates/ubuntu-application/help/tutorial.xml:174(para)
389
 
msgid ""
390
 
"Choose \"File-&gt;Save\" from the menu, and you'll see the word \"save\" "
391
 
"printing out interminal. That's all there is to hookig up the functions!"
392
 
msgstr ""
393
 
 
394
 
#: data/templates/ubuntu-application/help/tutorial.xml:178(title)
395
 
msgid "Implementing Save"
396
 
msgstr ""
397
 
 
398
 
#: data/templates/ubuntu-application/help/tutorial.xml:178(para)
399
 
msgid ""
400
 
"<placeholder-1/> Now we'll write a little code in the signal handler to "
401
 
"actually save the text. Because we want it to be easy for users to do things "
402
 
"like syncronize their Jotty documents between computers, back it up, etc... "
403
 
"we'll use couchdb as our backend, and we'll use desktopcouch for our api. "
404
 
"We'll also use a widget from the Quickly Widgets library to make it really "
405
 
"easy to use desktopcouch. Desktop couch and the desktopcouch records API "
406
 
"should be installed for you already, but you may need to install Quickly "
407
 
"Widgets. The fastest way to do this is from the terminal:"
408
 
msgstr ""
409
 
 
410
 
#: data/templates/ubuntu-application/help/tutorial.xml:181(programlisting)
411
 
#, no-wrap
412
 
msgid ""
413
 
"\n"
414
 
"sudo apt-get install quickly-widgets\n"
415
 
msgstr ""
416
 
"\n"
417
 
"sudo apt-get install quickly-widgets\n"
418
 
 
419
 
#: data/templates/ubuntu-application/help/tutorial.xml:184(para)
420
 
msgid ""
421
 
"This will install the api, and everything you need for the api to run. After "
422
 
"desktopcouch is installed, you can write the code. The code will do the "
423
 
"following:"
424
 
msgstr ""
425
 
 
426
 
#: data/templates/ubuntu-application/help/tutorial.xml:187(para)
427
 
msgid "Import the stuff you'll need from Quickly Widgets and desktopcouch."
428
 
msgstr ""
429
 
 
430
 
#: data/templates/ubuntu-application/help/tutorial.xml:190(para)
431
 
msgid "Get a reference to the couchdb database to save into."
432
 
msgstr ""
433
 
 
434
 
#: data/templates/ubuntu-application/help/tutorial.xml:193(para)
435
 
msgid "Get the title of the document and the text from the user interface."
436
 
msgstr ""
437
 
 
438
 
#: data/templates/ubuntu-application/help/tutorial.xml:196(para)
439
 
msgid ""
440
 
"Check if there is already a document with the same title, and if so "
441
 
"overwrite it."
442
 
msgstr ""
443
 
 
444
 
#: data/templates/ubuntu-application/help/tutorial.xml:199(para)
445
 
msgid "If there is not a document already, create one."
446
 
msgstr ""
447
 
 
448
 
#: data/templates/ubuntu-application/help/tutorial.xml:202(title)
449
 
msgid "Import the stuff you'll need from python-desktopcouch-records."
450
 
msgstr ""
451
 
 
452
 
#: data/templates/ubuntu-application/help/tutorial.xml:202(para)
453
 
msgid ""
454
 
"<placeholder-1/> Add these import statements along with the other imports to "
455
 
"the top of the jotty file:"
456
 
msgstr ""
457
 
 
458
 
#: data/templates/ubuntu-application/help/tutorial.xml:205(programlisting)
459
 
#, no-wrap
460
 
msgid ""
461
 
"\n"
462
 
"from desktopcouch.records.server import CouchDatabase\n"
463
 
"from desktopcouch.records.record import Record\n"
464
 
msgstr ""
465
 
"\n"
466
 
"from desktopcouch.records.server import CouchDatabase\n"
467
 
"from desktopcouch.records.record import Record\n"
468
 
 
469
 
#: data/templates/ubuntu-application/help/tutorial.xml:209(title)
470
 
msgid "Get a Reference to the Database"
471
 
msgstr ""
472
 
 
473
 
#: data/templates/ubuntu-application/help/tutorial.xml:209(para)
474
 
msgid ""
475
 
"<placeholder-1/> Desktopcouch will set up a database for us, or create a new "
476
 
"one if it's needed. We'll use \"jotty\" for the name of the database. Since "
477
 
"we want this line to run every time the Jotty Window is created, put it at "
478
 
"the end of the finish_initializing function:"
479
 
msgstr ""
480
 
 
481
 
#: data/templates/ubuntu-application/help/tutorial.xml:211(programlisting)
482
 
#, no-wrap
483
 
msgid ""
484
 
" \n"
485
 
"        self.database = CouchDatabase(\"jotty\", create=True)\n"
486
 
msgstr ""
487
 
" \n"
488
 
"        self.database = CouchDatabase(\"jotty\", create=True)\n"
489
 
 
490
 
#: data/templates/ubuntu-application/help/tutorial.xml:214(para)
491
 
msgid ""
492
 
"Now that we have an instance-wide reference to the database, we'll add code "
493
 
"to the save_file function to run whenever the Save command is issued."
494
 
msgstr ""
495
 
 
496
 
#: data/templates/ubuntu-application/help/tutorial.xml:215(para)
497
 
msgid "Here's the code to pull the title out of the title entry:"
498
 
msgstr ""
499
 
 
500
 
#: data/templates/ubuntu-application/help/tutorial.xml:218(programlisting)
501
 
#, no-wrap
502
 
msgid ""
503
 
"\n"
504
 
"        #get the title for the note\n"
505
 
"        title = self.builder.get_object(\"entry1\").get_text()\n"
506
 
msgstr ""
507
 
"\n"
508
 
"        #Den Titel der Notiz erhalten\n"
509
 
"        title = self.builder.get_object(\"entry1\").get_text()\n"
510
 
 
511
 
#: data/templates/ubuntu-application/help/tutorial.xml:222(title)
512
 
msgid "Here's the code to get pull the text out of the TextView:"
513
 
msgstr ""
514
 
 
515
 
#: data/templates/ubuntu-application/help/tutorial.xml:222(para)
516
 
msgid ""
517
 
"<placeholder-1/> In pygtk, TextView widgets have a text buffer that stores "
518
 
"the text. So you ask the TextView for it's TextBuffer, and then you ask the "
519
 
"TextBuffer for the text. You use iters to determine from which part of the "
520
 
"text buffer you want text. Since we want all the text, it's easy to just get "
521
 
"the start and end iters."
522
 
msgstr ""
523
 
 
524
 
#: data/templates/ubuntu-application/help/tutorial.xml:225(programlisting)
525
 
#, no-wrap
526
 
msgid ""
527
 
"\n"
528
 
"        #get the string\n"
529
 
"        buff = self.builder.get_object(\"textview1\").get_buffer()\n"
530
 
"        start_iter = buff.get_start_iter()\n"
531
 
"        end_iter = buff.get_end_iter()\n"
532
 
"        text = buff.get_text(start_iter,end_iter)\n"
533
 
msgstr ""
534
 
"\n"
535
 
"        #Den String erhalten\n"
536
 
"        buff = self.builder.get_object(\"textview1\").get_buffer()\n"
537
 
"        start_iter = buff.get_start_iter()\n"
538
 
"        end_iter = buff.get_end_iter()\n"
539
 
"        text = buff.get_text(start_iter,end_iter)\n"
540
 
 
541
 
#: data/templates/ubuntu-application/help/tutorial.xml:232(title)
542
 
msgid "Saving a document to Couchdb"
543
 
msgstr ""
544
 
 
545
 
#: data/templates/ubuntu-application/help/tutorial.xml:232(para)
546
 
msgid ""
547
 
"<placeholder-1/> A record in couch is essentially a python dictionary with "
548
 
"some extra key/value pairs to make the database work. So we can save the "
549
 
"document to couch like this:"
550
 
msgstr ""
551
 
 
552
 
#: data/templates/ubuntu-application/help/tutorial.xml:235(programlisting)
553
 
#, no-wrap
554
 
msgid ""
555
 
"\n"
556
 
"        record_type = \"http://wiki.ubuntu.com/Quickly/JottyDoc\"\n"
557
 
"        new_rec = Record({\"record_type\": record_type,\"title\":title, "
558
 
"\"text\":text})\n"
559
 
"        self.database.put(new_rec)\n"
560
 
msgstr ""
561
 
"\n"
562
 
"        record_type = \"http://wiki.ubuntu.com/Quickly/JottyDoc\"\n"
563
 
"        new_rec = Record({\"record_type\": record_type,\"title\":title, "
564
 
"\"text\":text})\n"
565
 
"        self.database.put(new_rec)\n"
566
 
 
567
 
#: data/templates/ubuntu-application/help/tutorial.xml:240(para)
568
 
msgid ""
569
 
"The \"record_type\" field is not strictly required, but among other things, "
570
 
"it makes it easy to fetch the documents later. By convention, we use a url "
571
 
"to specify the record type. This provides a place for other developers to go "
572
 
"to read about the record type. The description only needs to be human "
573
 
"readable. Couchdb is not a typed database, so don't expect that the url will "
574
 
"have any kind of schema definition or anything. You can use whatever url you "
575
 
"want, and put whatever you want at that URL."
576
 
msgstr ""
577
 
 
578
 
#: data/templates/ubuntu-application/help/tutorial.xml:243(title)
579
 
msgid "Check for a pre-existing note with the same title"
580
 
msgstr ""
581
 
 
582
 
#: data/templates/ubuntu-application/help/tutorial.xml:241(para)
583
 
msgid ""
584
 
"<placeholder-1/> Before we just write the new document though, we have to "
585
 
"take note of the fact that couch will allow you to create as many documents "
586
 
"as you want with the same title. We probably don't want this, so we we'll "
587
 
"have to write a little code to check if there is already a document in couch "
588
 
"with the same title, and if there is, update that document rather than "
589
 
"create a new one."
590
 
msgstr ""
591
 
 
592
 
#: data/templates/ubuntu-application/help/tutorial.xml:247(para)
593
 
msgid ""
594
 
"In CouchDB, you don't do a lot of data processing in the database like you "
595
 
"would with a relational database. To be most efficient, we could use the "
596
 
"desktopcouch API to create a view in CouchDB, but it's probably simplest "
597
 
"just to do the necessary processing on the client for now. To do this, we'll "
598
 
"use a desktopcouch function to retrieve all of the records of a specified "
599
 
"record type."
600
 
msgstr ""
601
 
 
602
 
#: data/templates/ubuntu-application/help/tutorial.xml:249(para)
603
 
msgid "To find and update documents with a matching title we will:"
604
 
msgstr ""
605
 
 
606
 
#: data/templates/ubuntu-application/help/tutorial.xml:252(para) data/templates/ubuntu-application/help/tutorial.xml:321(para)
607
 
msgid ""
608
 
"Retrieve all of the documents with the CouchDatabase.get_records function."
609
 
msgstr ""
610
 
 
611
 
#: data/templates/ubuntu-application/help/tutorial.xml:255(para) data/templates/ubuntu-application/help/tutorial.xml:324(para)
612
 
msgid "Check each of the returned records for a matching title."
613
 
msgstr ""
614
 
 
615
 
#: data/templates/ubuntu-application/help/tutorial.xml:258(para)
616
 
msgid ""
617
 
"If there is a match, update the record using the CouchDatabase.update_fields "
618
 
"function and return."
619
 
msgstr ""
620
 
 
621
 
#: data/templates/ubuntu-application/help/tutorial.xml:261(para)
622
 
msgid ""
623
 
"This all may sound very weird, but in code, it's not quite so complicated:"
624
 
msgstr ""
625
 
 
626
 
#: data/templates/ubuntu-application/help/tutorial.xml:263(programlisting)
627
 
#, no-wrap
628
 
msgid ""
629
 
"\n"
630
 
"        #get all the records\n"
631
 
"        record_type = \"http://wiki.ubuntu.com/Quickly/JottyDoc\"\n"
632
 
"        results = self.database.get_records(record_type = "
633
 
"record_type,create_view = True)\n"
634
 
"        #update a record that has the same title\n"
635
 
"        for result in results:\n"
636
 
"            document = result.value\n"
637
 
"            if document[\"title\"] == title:\n"
638
 
"                key = document[\"_id\"]\n"
639
 
"                self.database.update_fields(key, {\"text\":text})\n"
640
 
"                return\n"
641
 
"\n"
642
 
msgstr ""
643
 
"\n"
644
 
"        #Alle Einträge erhalten\n"
645
 
"        record_type = \"http://wiki.ubuntu.com/Quickly/JottyDoc\"\n"
646
 
"        results = self.database.get_records(record_type = "
647
 
"record_type,create_view = True)\n"
648
 
"        #Einen Eintrag mit selbem Titel aktualisieren\n"
649
 
"        for result in results:\n"
650
 
"            document = result.value\n"
651
 
"            if document[\"title\"] == title:\n"
652
 
"                key = document[\"_id\"]\n"
653
 
"                self.database.update_fields(key, {\"text\":text})\n"
654
 
"                return\n"
655
 
"\n"
656
 
 
657
 
#: data/templates/ubuntu-application/help/tutorial.xml:276(para)
658
 
msgid "So the whole function should look like this:"
659
 
msgstr ""
660
 
 
661
 
#: data/templates/ubuntu-application/help/tutorial.xml:278(programlisting)
662
 
#, no-wrap
663
 
msgid ""
664
 
"\n"
665
 
"    def save_file(self, widget, data=None): \n"
666
 
"        #get the title for the note \n"
667
 
"        title = self.builder.get_object(\"entry1\").get_text() \n"
668
 
"\n"
669
 
"        #get the text to save \n"
670
 
"        buff = self.builder.get_object(\"textview1\").get_buffer() \n"
671
 
"        start_iter = buff.get_start_iter() \n"
672
 
"        end_iter = buff.get_end_iter() \n"
673
 
"        text = buff.get_text(start_iter,end_iter) \n"
674
 
"\n"
675
 
"        #get all the records \n"
676
 
"        record_type = \"http://wiki.ubuntu.com/Quickly/JottyDoc\" \n"
677
 
"        results = self.database.get_records(record_type = "
678
 
"record_type,create_view = True) \n"
679
 
"\n"
680
 
"        #update a record that has the same title \n"
681
 
"        for result in results: \n"
682
 
"            document = result.value \n"
683
 
"            if document[\"title\"] == title: \n"
684
 
"                key = document[\"_id\"]\n"
685
 
"                self.database.update_fields(key, {\"text\":text}) \n"
686
 
"                return\n"
687
 
" \n"
688
 
"        #if no records had the title, create it \n"
689
 
"        new_rec = Record({\"record_type\":record_type,\"title\":title, "
690
 
"\"text\":text})\n"
691
 
"        self.database.put_record(new_rec)\n"
692
 
msgstr ""
693
 
"\n"
694
 
"    def save_file(self, widget, data=None): \n"
695
 
"        #Den Titel der Notiz erhalten\n"
696
 
"        title = self.builder.get_object(\"entry1\").get_text() \n"
697
 
"\n"
698
 
"        #Den zu speichernden Text erhalten\n"
699
 
"        buff = self.builder.get_object(\"textview1\").get_buffer() \n"
700
 
"        start_iter = buff.get_start_iter() \n"
701
 
"        end_iter = buff.get_end_iter() \n"
702
 
"        text = buff.get_text(start_iter,end_iter) \n"
703
 
"\n"
704
 
"        #Alle Einträge erhalten\n"
705
 
"        record_type = \"http://wiki.ubuntu.com/Quickly/JottyDoc\" \n"
706
 
"        results = self.database.get_records(record_type = "
707
 
"record_type,create_view = True) \n"
708
 
"\n"
709
 
"        #Einen Eintrag mit selbem Titel aktualisieren\n"
710
 
"        for result in results: \n"
711
 
"            document = result.value \n"
712
 
"            if document[\"title\"] == title: \n"
713
 
"                key = document[\"_id\"]\n"
714
 
"                self.database.update_fields(key, {\"text\":text}) \n"
715
 
"                return\n"
716
 
" \n"
717
 
"        #Eintrag erstellen, falls keiner mit diesem Titel existierte\n"
718
 
"        new_rec = Record({\"record_type\":record_type,\"title\":title, "
719
 
"\"text\":text})\n"
720
 
"        self.database.put_record(new_rec)\n"
721
 
 
722
 
#: data/templates/ubuntu-application/help/tutorial.xml:306(para)
723
 
msgid ""
724
 
"Couchdb makes it really easy to see if your save function is working. You "
725
 
"can just point your web browser at it and explore the database:"
726
 
msgstr ""
727
 
 
728
 
#: data/templates/ubuntu-application/help/tutorial.xml:307(para)
729
 
msgid "file:///home/your_user_name/.local/share/desktop-couch/couchdb.html"
730
 
msgstr ""
731
 
"file:///home/ihr_benutzername/.local/share/desktop-couch/couchdb.html"
732
 
 
733
 
#: data/templates/ubuntu-application/help/tutorial.xml:311(para)
734
 
msgid ""
735
 
"If you are redirected to a page that doesn't work, you probably just need to "
736
 
"clear your browser cache and try again."
737
 
msgstr ""
738
 
 
739
 
#: data/templates/ubuntu-application/help/tutorial.xml:312(title)
740
 
msgid "Implementing Open and New"
741
 
msgstr ""
742
 
 
743
 
#: data/templates/ubuntu-application/help/tutorial.xml:312(para)
744
 
msgid ""
745
 
"<placeholder-1/> To open a saved document, the user will type the title of "
746
 
"the document that they want to open in the text entry, and choose \"Open\" "
747
 
"from the main menu. If there is no matching document there, it will just "
748
 
"clear out the text view, ready for input. This is probably not too "
749
 
"intuitive, so we'll add a dialog box for prompting the user for the title, "
750
 
"but that's for later in the tutorial. For now, we'll just use the same text "
751
 
"entry field."
752
 
msgstr ""
753
 
 
754
 
#: data/templates/ubuntu-application/help/tutorial.xml:314(title)
755
 
msgid "Implementing Open is essentially the reverse of Save:"
756
 
msgstr ""
757
 
 
758
 
#: data/templates/ubuntu-application/help/tutorial.xml:314(para)
759
 
msgid "<placeholder-1/> Follow these steps:"
760
 
msgstr ""
761
 
 
762
 
#: data/templates/ubuntu-application/help/tutorial.xml:318(para)
763
 
msgid "Add the open_file signal to the menu item in Glade."
764
 
msgstr ""
765
 
 
766
 
#: data/templates/ubuntu-application/help/tutorial.xml:327(para)
767
 
msgid ""
768
 
"If there is a match, pull out the text and display it in the text view."
769
 
msgstr ""
770
 
 
771
 
#: data/templates/ubuntu-application/help/tutorial.xml:330(para)
772
 
msgid "So the open_file function looks like so:"
773
 
msgstr ""
774
 
 
775
 
#: data/templates/ubuntu-application/help/tutorial.xml:332(programlisting)
776
 
#, no-wrap
777
 
msgid ""
778
 
"\n"
779
 
"    def open_file(self, widget, data=None):\n"
780
 
"        #get the name of the document to open\n"
781
 
"        title = self.builder.get_object(\"entry1\").get_text()\n"
782
 
"        text = \"\"\n"
783
 
" \n"
784
 
"        #get all the records\n"
785
 
"        record_type = \"http://wiki.ubuntu.com/Quickly/JottyDoc\"\n"
786
 
"        results = self.database.get_records(record_type = "
787
 
"record_type,create_view = True)\n"
788
 
" \n"
789
 
"        #get the text if there is a matching title\n"
790
 
"        for result in results:\n"
791
 
"            document = result.value\n"
792
 
"            if document[\"title\"] == title:\n"
793
 
"                text = document[\"text\"]\n"
794
 
"        \n"
795
 
"        #set the UI to display the string\n"
796
 
"        buff = self.builder.get_object(\"textview1\").get_buffer()\n"
797
 
"        buff.set_text(text)\n"
798
 
msgstr ""
799
 
 
800
 
#: data/templates/ubuntu-application/help/tutorial.xml:352(title)
801
 
msgid "Implement New"
802
 
msgstr ""
803
 
 
804
 
#: data/templates/ubuntu-application/help/tutorial.xml:352(para)
805
 
msgid ""
806
 
"<placeholder-1/> First, add the new_file signal to the menu item in Glade, "
807
 
"then add this code to clear out the text:"
808
 
msgstr ""
809
 
 
810
 
#: data/templates/ubuntu-application/help/tutorial.xml:355(programlisting)
811
 
#, no-wrap
812
 
msgid ""
813
 
"\n"
814
 
"    def new_file(self, widget, data=None):\n"
815
 
"        self.builder.get_object(\"entry1\").set_text(\"Note Title\")\n"
816
 
"        buff = self.builder.get_object(\"textview1\").get_buffer()\n"
817
 
"        buff.set_text(\"\")\n"
818
 
msgstr ""
819
 
 
820
 
#: data/templates/ubuntu-application/help/tutorial.xml:361(para)
821
 
msgid ""
822
 
"To make them work, add these functions to the JottyWindow class, and save. "
823
 
"Then go back and connect the functions to the activate signals for the Open "
824
 
"and New menu items."
825
 
msgstr ""
826
 
 
827
 
#: data/templates/ubuntu-application/help/tutorial.xml:362(ulink)
828
 
msgid "Complete jotty file"
829
 
msgstr ""
830
 
 
831
 
#: data/templates/ubuntu-application/help/tutorial.xml:363(title)
832
 
msgid "Saving Your Work"
833
 
msgstr ""
834
 
 
835
 
#: data/templates/ubuntu-application/help/tutorial.xml:363(para)
836
 
msgid ""
837
 
"<placeholder-1/> When <application>Quickly</application> created your "
838
 
"application, it automatically added it to Bazaar, a source code versioning "
839
 
"system. You can use Bazaar to roll back mistake, see code history, compare "
840
 
"versions, etc... <application>Quickly</application> has a convenience "
841
 
"function for backing up your work:"
842
 
msgstr ""
843
 
 
844
 
#: data/templates/ubuntu-application/help/tutorial.xml:365(programlisting)
845
 
#, no-wrap
846
 
msgid ""
847
 
" \n"
848
 
"<application>Quickly</application> save \"First working version of Jotty\"\n"
849
 
msgstr ""
850
 
 
851
 
#: data/templates/ubuntu-application/help/tutorial.xml:368(programlisting)
852
 
#, no-wrap
853
 
msgid "bzr add"
854
 
msgstr ""
855
 
 
856
 
#: data/templates/ubuntu-application/help/tutorial.xml:368(programlisting)
857
 
#, no-wrap
858
 
msgid "bzr commit -m [your message]"
859
 
msgstr ""
860
 
 
861
 
#: data/templates/ubuntu-application/help/tutorial.xml:368(para)
862
 
msgid "This will call <placeholder-1/> and then <placeholder-2/> for you."
863
 
msgstr ""
864
 
 
865
 
#: data/templates/ubuntu-application/help/tutorial.xml:371(title)
866
 
msgid "Using Dialogs"
867
 
msgstr ""
868
 
 
869
 
#: data/templates/ubuntu-application/help/tutorial.xml:372(para)
870
 
msgid ""
871
 
"In part 1, we created an application that can read and write text files, and "
872
 
"persist them in the couchdb backend. However, the application has a hideous "
873
 
"usability flaw, in the text box for specifying titles when saving and "
874
 
"opening files is very confusing. In part 2, we'll fix that by adding a save "
875
 
"and an open dialog."
876
 
msgstr ""
877
 
 
878
 
#: data/templates/ubuntu-application/help/tutorial.xml:374(title)
879
 
msgid "Creating an Empty Dialog"
880
 
msgstr ""
881
 
 
882
 
#: data/templates/ubuntu-application/help/tutorial.xml:374(para)
883
 
msgid ""
884
 
"<placeholder-1/> It's simple to add an empty, but working dialog to your "
885
 
"project. Simply specify the name of the new dialog, and it will be added "
886
 
"automatically. Assuming that you are in the jotty project directory:"
887
 
msgstr ""
888
 
 
889
 
#: data/templates/ubuntu-application/help/tutorial.xml:376(programlisting)
890
 
#, no-wrap
891
 
msgid ""
892
 
"\n"
893
 
"quickly add dialog save\n"
894
 
msgstr ""
895
 
 
896
 
#: data/templates/ubuntu-application/help/tutorial.xml:379(para)
897
 
msgid "This will add the dialog to your project."
898
 
msgstr ""
899
 
 
900
 
#: data/templates/ubuntu-application/help/tutorial.xml:380(title) data/templates/ubuntu-application/help/tutorial.xml:502(title)
901
 
msgid "Editing the New Dialog"
902
 
msgstr ""
903
 
 
904
 
#: data/templates/ubuntu-application/help/tutorial.xml:380(para)
905
 
msgid ""
906
 
"<placeholder-1/> To edit the UI for the dialog, you'll need to load it into "
907
 
"Glade again. If you already have an instance of glade running, you might "
908
 
"want to go ahead and close it first, as it may get confusing if you have "
909
 
"more than one open at a time. After closing glade, simply open it again:"
910
 
msgstr ""
911
 
 
912
 
#: data/templates/ubuntu-application/help/tutorial.xml:382(programlisting) data/templates/ubuntu-application/help/tutorial.xml:504(programlisting)
913
 
#, no-wrap
914
 
msgid ""
915
 
"\n"
916
 
"quickly design\n"
917
 
msgstr ""
918
 
 
919
 
#: data/templates/ubuntu-application/help/tutorial.xml:385(para)
920
 
msgid ""
921
 
"Then use the project menu to switch to newly created SaveDialog.ui file."
922
 
msgstr ""
923
 
 
924
 
#: data/templates/ubuntu-application/help/tutorial.xml:389(para)
925
 
msgid ""
926
 
"Then add some widgets for the UI. Start with a Vertical Box (VBox) with two "
927
 
"items. Put a label in the top, and an HBox in the bottom slot. In the HBox, "
928
 
"add a label and an edit widget, just like you did for JottyWindow in part 1. "
929
 
"Set the padding and expand properties as well."
930
 
msgstr ""
931
 
 
932
 
#: data/templates/ubuntu-application/help/tutorial.xml:393(title)
933
 
msgid "Code the Dialog"
934
 
msgstr ""
935
 
 
936
 
#: data/templates/ubuntu-application/help/tutorial.xml:393(para)
937
 
msgid ""
938
 
"<placeholder-1/> You can use the \"<application>Quickly</application> edit\" "
939
 
"command to open the SaveDialog.py file. This dialog needs very little "
940
 
"additional code to work. Essentially, you just need a way to retrieve the "
941
 
"string specified by the user. We'll add a qiuck accessor method for this:"
942
 
msgstr ""
943
 
 
944
 
#: data/templates/ubuntu-application/help/tutorial.xml:396(programlisting)
945
 
#, no-wrap
946
 
msgid ""
947
 
"\n"
948
 
"    @property\n"
949
 
"    def title_text(self):\n"
950
 
"        return self.builder.get_object(\"entry1\").get_text()\n"
951
 
msgstr ""
952
 
 
953
 
#: data/templates/ubuntu-application/help/tutorial.xml:401(para)
954
 
msgid ""
955
 
"We don't need to write any code for the Ok and Cancel buttons, as they were "
956
 
"automatically hooked up by <application>Quickly</application> when it "
957
 
"created the dialog."
958
 
msgstr ""
959
 
 
960
 
#: data/templates/ubuntu-application/help/tutorial.xml:402(para)
961
 
msgid ""
962
 
"Before we go on to invoking the dialog, delete HBox from JottyWindow that "
963
 
"holds the text entry and label, as we won't be needing those."
964
 
msgstr ""
965
 
 
966
 
#: data/templates/ubuntu-application/help/tutorial.xml:406(title)
967
 
msgid "Calling the Save Dialog"
968
 
msgstr ""
969
 
 
970
 
#: data/templates/ubuntu-application/help/tutorial.xml:406(para)
971
 
msgid ""
972
 
"<placeholder-1/> To use the dialog in JottyWindow, we need to follow these "
973
 
"steps:"
974
 
msgstr ""
975
 
 
976
 
#: data/templates/ubuntu-application/help/tutorial.xml:410(para)
977
 
msgid "Import SaveDialog in JottyWindow"
978
 
msgstr ""
979
 
 
980
 
#: data/templates/ubuntu-application/help/tutorial.xml:413(para)
981
 
msgid "In the save_file function, create an instance of SaveDialog"
982
 
msgstr ""
983
 
 
984
 
#: data/templates/ubuntu-application/help/tutorial.xml:416(para) data/templates/ubuntu-application/help/tutorial.xml:590(para)
985
 
msgid "Run the Dialog"
986
 
msgstr ""
987
 
 
988
 
#: data/templates/ubuntu-application/help/tutorial.xml:419(para)
989
 
msgid "Get the String"
990
 
msgstr ""
991
 
 
992
 
#: data/templates/ubuntu-application/help/tutorial.xml:422(para) data/templates/ubuntu-application/help/tutorial.xml:596(para)
993
 
msgid "Destroy the dialog"
994
 
msgstr ""
995
 
 
996
 
#: data/templates/ubuntu-application/help/tutorial.xml:426(title)
997
 
msgid "Importing the SaveDialog"
998
 
msgstr ""
999
 
 
1000
 
#: data/templates/ubuntu-application/help/tutorial.xml:426(para)
1001
 
msgid ""
1002
 
"<placeholder-1/> Add the SaveDialog to the list of the imported modules at "
1003
 
"the top of the bin file of your project, so it looks like this:"
1004
 
msgstr ""
1005
 
 
1006
 
#: data/templates/ubuntu-application/help/tutorial.xml:428(programlisting)
1007
 
#, no-wrap
1008
 
msgid ""
1009
 
"\n"
1010
 
"from jotty import (\n"
1011
 
"    AboutJottyDialog, PreferencesJottyDialog, SaveDialog)\n"
1012
 
msgstr ""
1013
 
 
1014
 
#: data/templates/ubuntu-application/help/tutorial.xml:433(title) data/templates/ubuntu-application/help/tutorial.xml:616(title)
1015
 
msgid "Create an instance of the dialog and run it"
1016
 
msgstr ""
1017
 
 
1018
 
#: data/templates/ubuntu-application/help/tutorial.xml:433(para)
1019
 
msgid ""
1020
 
"<placeholder-1/> When the user chooses Save, we want to open the SaveDialog "
1021
 
"and collect the title of the note from the user. So we need to modify our "
1022
 
"save_file function."
1023
 
msgstr ""
1024
 
 
1025
 
#: data/templates/ubuntu-application/help/tutorial.xml:436(para)
1026
 
msgid "First, create an instance of the SaveDialog like this:"
1027
 
msgstr ""
1028
 
 
1029
 
#: data/templates/ubuntu-application/help/tutorial.xml:437(programlisting)
1030
 
#, no-wrap
1031
 
msgid ""
1032
 
"\n"
1033
 
"        saver = SaveDialog.SaveDialog()\n"
1034
 
msgstr ""
1035
 
 
1036
 
#: data/templates/ubuntu-application/help/tutorial.xml:440(para)
1037
 
msgid ""
1038
 
"To make the dialog appear, simply use the run() method. However, we want to "
1039
 
"check the result, so we'll need to store that in a variable. After it runs, "
1040
 
"we want to collect the string from the user, like this:"
1041
 
msgstr ""
1042
 
 
1043
 
#: data/templates/ubuntu-application/help/tutorial.xml:441(programlisting)
1044
 
#, no-wrap
1045
 
msgid ""
1046
 
"\n"
1047
 
"        result = saver.run()\n"
1048
 
"        title = saver.title_text\n"
1049
 
msgstr ""
1050
 
 
1051
 
#: data/templates/ubuntu-application/help/tutorial.xml:445(title)
1052
 
msgid "Clean up the dialog"
1053
 
msgstr ""
1054
 
 
1055
 
#: data/templates/ubuntu-application/help/tutorial.xml:445(para)
1056
 
msgid ""
1057
 
"<placeholder-1/> We need to tell the dialog to not show itself anymore. We "
1058
 
"could call saver.hide() to make it hide, but since we don't need it hanging "
1059
 
"around, we'll just destroy it. Before we go on, though, we need to ensure "
1060
 
"that the user actually wants to save, so if we didn't get the Ok result, we "
1061
 
"should just return out of the function:"
1062
 
msgstr ""
1063
 
 
1064
 
#: data/templates/ubuntu-application/help/tutorial.xml:448(programlisting)
1065
 
#, no-wrap
1066
 
msgid ""
1067
 
"\n"
1068
 
"        saver.destroy()\n"
1069
 
"        if result != gtk.RESPONSE_OK:\n"
1070
 
"            return\n"
1071
 
msgstr ""
1072
 
 
1073
 
#: data/templates/ubuntu-application/help/tutorial.xml:454(para)
1074
 
msgid ""
1075
 
"Since we're now getting the title from the dialog instead of the text entry, "
1076
 
"we should delete the line of the code that sents it from entry1. So except "
1077
 
"for the addition of the dialog code, the save_file function looks pretty "
1078
 
"much the same as it did in part 1:"
1079
 
msgstr ""
1080
 
 
1081
 
#: data/templates/ubuntu-application/help/tutorial.xml:457(programlisting)
1082
 
#, no-wrap
1083
 
msgid ""
1084
 
"\n"
1085
 
"    def save_file(self, widget, data=None):\n"
1086
 
"        #get the titel from the user\n"
1087
 
"        saver = SaveDialog.SaveDialog()\n"
1088
 
"        result = saver.run()\n"
1089
 
"        title = saver.title_text\n"
1090
 
"\n"
1091
 
"        saver.destroy()\n"
1092
 
"        if result != gtk.RESPONSE_OK:\n"
1093
 
"            return\n"
1094
 
"\n"
1095
 
"        #get the text to save\n"
1096
 
"        buff = self.builder.get_object(\"textview1\").get_buffer()\n"
1097
 
"        start_iter = buff.get_start_iter()\n"
1098
 
"        end_iter = buff.get_end_iter()\n"
1099
 
"        text = buff.get_text(start_iter,end_iter)\n"
1100
 
"\n"
1101
 
"        #get all the records\n"
1102
 
"        record_type = \"http://wiki.ubuntu.com/Quickly/JottyDoc\"\n"
1103
 
"        results = self.database.get_records(record_type = "
1104
 
"record_type,create_view = True)\n"
1105
 
"\n"
1106
 
"        #update a record that has the same title\n"
1107
 
"        for result in results:\n"
1108
 
"            record = result.value\n"
1109
 
"            if record[\"title\"] == title:\n"
1110
 
"                key = result.key\n"
1111
 
"                self.database.update_fields(key, {\"text\":text})\n"
1112
 
"                return\n"
1113
 
"        \n"
1114
 
"        #if no records had the title, create it  \n"
1115
 
"        new_rec = Record({\"record_type\":record_type,\"title\":title, "
1116
 
"\"text\":text})\n"
1117
 
"        self.database.put_record(new_rec)\n"
1118
 
msgstr ""
1119
 
 
1120
 
#: data/templates/ubuntu-application/help/tutorial.xml:490(para)
1121
 
msgid "Now when we choose save, we get the SaveDialog instead:"
1122
 
msgstr ""
1123
 
 
1124
 
#: data/templates/ubuntu-application/help/tutorial.xml:495(title)
1125
 
msgid "Creating a Dialog with a CouchGrid"
1126
 
msgstr ""
1127
 
 
1128
 
#: data/templates/ubuntu-application/help/tutorial.xml:495(para)
1129
 
msgid ""
1130
 
"<placeholder-1/> We'll use a similar approach in the Open dialog that we did "
1131
 
"with Save. However, there is one big difference, we want to provide the user "
1132
 
"with a list of documents that you could choose to open. We'll use a widget "
1133
 
"called CouchGrid, which is included in the quickly-widgets package for this."
1134
 
msgstr ""
1135
 
 
1136
 
#: data/templates/ubuntu-application/help/tutorial.xml:498(title)
1137
 
msgid "Create the Open Dialog"
1138
 
msgstr ""
1139
 
 
1140
 
#: data/templates/ubuntu-application/help/tutorial.xml:499(programlisting)
1141
 
#, no-wrap
1142
 
msgid ""
1143
 
"\n"
1144
 
"quickly add dialog open\n"
1145
 
msgstr ""
1146
 
 
1147
 
#: data/templates/ubuntu-application/help/tutorial.xml:502(para)
1148
 
msgid ""
1149
 
"<placeholder-1/> Start out by closing, and then reopening glade again:"
1150
 
msgstr ""
1151
 
 
1152
 
#: data/templates/ubuntu-application/help/tutorial.xml:507(para)
1153
 
msgid ""
1154
 
"Start by adding a VBox and a label in the same manner as in the Save Dialog "
1155
 
"above. Leave an empty space in the VBox. We will use code to put the "
1156
 
"CouchGrid there."
1157
 
msgstr ""
1158
 
 
1159
 
#: data/templates/ubuntu-application/help/tutorial.xml:511(title)
1160
 
msgid "Coding the Open Dialog"
1161
 
msgstr ""
1162
 
 
1163
 
#: data/templates/ubuntu-application/help/tutorial.xml:512(title)
1164
 
msgid "Creating and Adding a CouchGrid"
1165
 
msgstr ""
1166
 
 
1167
 
#: data/templates/ubuntu-application/help/tutorial.xml:512(para)
1168
 
msgid ""
1169
 
"<placeholder-1/> It just takes a little bit of code to add a CouchGrid to "
1170
 
"the dialog. We need to:"
1171
 
msgstr ""
1172
 
 
1173
 
#: data/templates/ubuntu-application/help/tutorial.xml:516(para)
1174
 
msgid "Import the CouchGrid class."
1175
 
msgstr ""
1176
 
 
1177
 
#: data/templates/ubuntu-application/help/tutorial.xml:519(para)
1178
 
msgid ""
1179
 
"Create a CouchGrid pointing at the jotty database, and the desired record "
1180
 
"type."
1181
 
msgstr ""
1182
 
 
1183
 
#: data/templates/ubuntu-application/help/tutorial.xml:522(para)
1184
 
msgid "Add the CouchGrid to the dialog."
1185
 
msgstr ""
1186
 
 
1187
 
#: data/templates/ubuntu-application/help/tutorial.xml:526(title)
1188
 
msgid "Import the CouchGrid class"
1189
 
msgstr ""
1190
 
 
1191
 
#: data/templates/ubuntu-application/help/tutorial.xml:526(para)
1192
 
msgid ""
1193
 
"<placeholder-1/> CouchGrid is part of the quickly.widgets api, so we import "
1194
 
"it like this:"
1195
 
msgstr ""
1196
 
 
1197
 
#: data/templates/ubuntu-application/help/tutorial.xml:528(programlisting)
1198
 
#, no-wrap
1199
 
msgid ""
1200
 
"\n"
1201
 
"from quickly.widgets.couch_grid import CouchGrid\n"
1202
 
msgstr ""
1203
 
 
1204
 
#: data/templates/ubuntu-application/help/tutorial.xml:531(title)
1205
 
msgid "Create the CouchGrid"
1206
 
msgstr ""
1207
 
 
1208
 
#: data/templates/ubuntu-application/help/tutorial.xml:531(para)
1209
 
msgid ""
1210
 
"<placeholder-1/> A CouchGrid needs to know three things, the name of the "
1211
 
"database, the name of the record type, and the name of the keys to use. "
1212
 
"\"keys\" is a list of fields that the widget will display, and by default "
1213
 
"will also use the same text for the heading of any columns. This set up "
1214
 
"should be done in the OpenDialog's finish_initalizing function. All this is "
1215
 
"easily done in code like this:"
1216
 
msgstr ""
1217
 
 
1218
 
#: data/templates/ubuntu-application/help/tutorial.xml:535(programlisting)
1219
 
#, no-wrap
1220
 
msgid ""
1221
 
"\n"
1222
 
"        database = \"jotty\"\n"
1223
 
"        keys = [\"title\"]\n"
1224
 
"        record_type = \"http://wiki.ubuntu.com/Quickly/JottyDoc\"\n"
1225
 
"        self.couchgrid = CouchGrid(database, "
1226
 
"record_type=record_type,keys=keys)\n"
1227
 
"\n"
1228
 
msgstr ""
1229
 
 
1230
 
#: data/templates/ubuntu-application/help/tutorial.xml:542(title)
1231
 
msgid "Add the CouchGrid to the Dialog"
1232
 
msgstr ""
1233
 
 
1234
 
#: data/templates/ubuntu-application/help/tutorial.xml:542(para)
1235
 
msgid ""
1236
 
"<placeholder-1/> we added the VBox to the dialog, we left an open space at "
1237
 
"the bottom. We'll use this by \"packing\" the CouchGrid into the VBox. We "
1238
 
"need to show it as well. So add the following lines to the "
1239
 
"finish_initializing function as well:"
1240
 
msgstr ""
1241
 
 
1242
 
#: data/templates/ubuntu-application/help/tutorial.xml:546(programlisting)
1243
 
#, no-wrap
1244
 
msgid ""
1245
 
"\n"
1246
 
"        self.couchgrid.show()\n"
1247
 
"        self.builder.get_object(\"vbox1\").pack_end(self.couchgrid)\n"
1248
 
"\n"
1249
 
msgstr ""
1250
 
 
1251
 
#: data/templates/ubuntu-application/help/tutorial.xml:552(title)
1252
 
msgid "Create the get_selection function"
1253
 
msgstr ""
1254
 
 
1255
 
#: data/templates/ubuntu-application/help/tutorial.xml:552(para)
1256
 
msgid ""
1257
 
"<placeholder-1/> The dialog still needs a bit more code to work. It needs to "
1258
 
"return the user's selection, if there is one. To do this, we need to ask the "
1259
 
"CouchGrid what is selected. This is easy using the widgets "
1260
 
"selected_record_ids function. But the CouchGrid supports multiple selection, "
1261
 
"so we'll do the following:"
1262
 
msgstr ""
1263
 
 
1264
 
#: data/templates/ubuntu-application/help/tutorial.xml:556(para)
1265
 
msgid "Use a decorator to define the function as a property accessor."
1266
 
msgstr ""
1267
 
 
1268
 
#: data/templates/ubuntu-application/help/tutorial.xml:559(para)
1269
 
msgid "Get all the selected record ids."
1270
 
msgstr ""
1271
 
 
1272
 
#: data/templates/ubuntu-application/help/tutorial.xml:562(para)
1273
 
msgid "If none are selected, return None."
1274
 
msgstr ""
1275
 
 
1276
 
#: data/templates/ubuntu-application/help/tutorial.xml:565(para)
1277
 
msgid "Pick the first one and return it."
1278
 
msgstr ""
1279
 
 
1280
 
#: data/templates/ubuntu-application/help/tutorial.xml:568(para)
1281
 
msgid "So the function to add to OpenDialog looks like this:"
1282
 
msgstr ""
1283
 
 
1284
 
#: data/templates/ubuntu-application/help/tutorial.xml:570(programlisting)
1285
 
#, no-wrap
1286
 
msgid ""
1287
 
"\n"
1288
 
"    @property\n"
1289
 
"    def selected_record_id(self):\n"
1290
 
"        ids = self.couchgrid.selected_record_ids\n"
1291
 
"        if len(ids) &lt; 1:\n"
1292
 
"            return None\n"
1293
 
"        else:\n"
1294
 
"            return ids[0]\n"
1295
 
"\n"
1296
 
msgstr ""
1297
 
 
1298
 
#: data/templates/ubuntu-application/help/tutorial.xml:580(title)
1299
 
msgid "Using the Open Dialog"
1300
 
msgstr ""
1301
 
 
1302
 
#: data/templates/ubuntu-application/help/tutorial.xml:580(para)
1303
 
msgid ""
1304
 
"<placeholder-1/> Now we want to use the Open Dialog in the JottyWindow "
1305
 
"open_file function. To use it,we'll follow these steps:"
1306
 
msgstr ""
1307
 
 
1308
 
#: data/templates/ubuntu-application/help/tutorial.xml:584(para)
1309
 
msgid "Import OpenDialog in JottyWindow"
1310
 
msgstr ""
1311
 
 
1312
 
#: data/templates/ubuntu-application/help/tutorial.xml:587(para)
1313
 
msgid "In the open_file function, create an instance of OpenDialog"
1314
 
msgstr ""
1315
 
 
1316
 
#: data/templates/ubuntu-application/help/tutorial.xml:593(para)
1317
 
msgid "Get the id for the selected title."
1318
 
msgstr ""
1319
 
 
1320
 
#: data/templates/ubuntu-application/help/tutorial.xml:599(para)
1321
 
msgid "Check the response before proceeding"
1322
 
msgstr ""
1323
 
 
1324
 
#: data/templates/ubuntu-application/help/tutorial.xml:602(para) data/templates/ubuntu-application/help/tutorial.xml:634(title)
1325
 
msgid "Use the id to get the record from CouchDB"
1326
 
msgstr ""
1327
 
 
1328
 
#: data/templates/ubuntu-application/help/tutorial.xml:605(para) data/templates/ubuntu-application/help/tutorial.xml:644(title)
1329
 
msgid "Update the UI"
1330
 
msgstr ""
1331
 
 
1332
 
#: data/templates/ubuntu-application/help/tutorial.xml:609(title)
1333
 
msgid "Import OpenDialog"
1334
 
msgstr ""
1335
 
 
1336
 
#: data/templates/ubuntu-application/help/tutorial.xml:609(para)
1337
 
msgid ""
1338
 
"<placeholder-1/> Just like the SaveDialog, add the import line to the list "
1339
 
"of imports:"
1340
 
msgstr ""
1341
 
 
1342
 
#: data/templates/ubuntu-application/help/tutorial.xml:611(programlisting)
1343
 
#, no-wrap
1344
 
msgid ""
1345
 
"\n"
1346
 
"from jotty import (\n"
1347
 
"    AboutJottyDialog, PreferencesJottyDialog, SaveDialog, OpenDialog)\n"
1348
 
msgstr ""
1349
 
 
1350
 
#: data/templates/ubuntu-application/help/tutorial.xml:616(para)
1351
 
msgid ""
1352
 
"<placeholder-1/> So now we're ready to call the dialog from the "
1353
 
"JottyWindow's open_file function. Creating the OpenDialog is exactly the "
1354
 
"same as creating the SaveDialog, except we also want to tell it to load the "
1355
 
"titles before we run it:"
1356
 
msgstr ""
1357
 
 
1358
 
#: data/templates/ubuntu-application/help/tutorial.xml:619(programlisting)
1359
 
#, no-wrap
1360
 
msgid ""
1361
 
"opener = OpenDialog.NewODialog()\n"
1362
 
"        result = opener.run()"
1363
 
msgstr ""
1364
 
 
1365
 
#: data/templates/ubuntu-application/help/tutorial.xml:622(title)
1366
 
msgid "Get the id for the selected title"
1367
 
msgstr ""
1368
 
 
1369
 
#: data/templates/ubuntu-application/help/tutorial.xml:622(para)
1370
 
msgid ""
1371
 
"<placeholder-1/> Now use the property that we created to retrieve the title "
1372
 
"and text from the dialog. Don't forget to check the response type before "
1373
 
"going on."
1374
 
msgstr ""
1375
 
 
1376
 
#: data/templates/ubuntu-application/help/tutorial.xml:625(programlisting)
1377
 
#, no-wrap
1378
 
msgid ""
1379
 
"\n"
1380
 
"        rec_id = opener.selected_record_id\n"
1381
 
"\n"
1382
 
"        #close the dialog, and check whether to proceed\n"
1383
 
"        opener.destroy()\n"
1384
 
"        if result != gtk.RESPONSE_OK:\n"
1385
 
"            return"
1386
 
msgstr ""
1387
 
 
1388
 
#: data/templates/ubuntu-application/help/tutorial.xml:634(para)
1389
 
msgid ""
1390
 
"<placeholder-1/> If nothing was selected, we'll just return. Otherwise, "
1391
 
"we'll retrieve the record from CouchDB and pull out the text for the "
1392
 
"document:"
1393
 
msgstr ""
1394
 
 
1395
 
#: data/templates/ubuntu-application/help/tutorial.xml:637(programlisting)
1396
 
#, no-wrap
1397
 
msgid ""
1398
 
"\n"
1399
 
"        #get the record from CouchDB and extract the text\n"
1400
 
"        if rec_id == None:\n"
1401
 
"            return\n"
1402
 
"        record = self.database.get_record(rec_id)\n"
1403
 
"        text = record[\"text\"]"
1404
 
msgstr ""
1405
 
 
1406
 
#: data/templates/ubuntu-application/help/tutorial.xml:644(para)
1407
 
msgid "<placeholder-1/> Now just put the text into the texview:"
1408
 
msgstr ""
1409
 
 
1410
 
#: data/templates/ubuntu-application/help/tutorial.xml:647(programlisting)
1411
 
#, no-wrap
1412
 
msgid ""
1413
 
"\n"
1414
 
"        #set the UI to display the string\n"
1415
 
"        buff = self.builder.get_object(\"textview1\").get_buffer()\n"
1416
 
"        buff.set_text(text)"
1417
 
msgstr ""
1418
 
 
1419
 
#: data/templates/ubuntu-application/help/tutorial.xml:651(para)
1420
 
msgid ""
1421
 
"That's all there is to it. So the whole open_file function looks like this:"
1422
 
msgstr ""
1423
 
 
1424
 
#: data/templates/ubuntu-application/help/tutorial.xml:653(programlisting)
1425
 
#, no-wrap
1426
 
msgid ""
1427
 
"\n"
1428
 
"    def open_file(self, widget, data=None):\n"
1429
 
"        #run the open dialog\n"
1430
 
"        opener = OpenDialog.OpenDialog()\n"
1431
 
"        result = opener.run()\n"
1432
 
"\n"
1433
 
"        #get the record id from the dialog\n"
1434
 
"        rec_id = opener.selected_record_id\n"
1435
 
"\n"
1436
 
"        #close the dialog, and check whether to proceed\n"
1437
 
"        opener.destroy()\n"
1438
 
"        if result != gtk.RESPONSE_OK:\n"
1439
 
"            return\n"
1440
 
"\n"
1441
 
"        #get the record from CouchDB and extract the text\n"
1442
 
"        if rec_id == None:\n"
1443
 
"            return\n"
1444
 
"        record = self.database.get_record(rec_id)\n"
1445
 
"        text = record[\"text\"]\n"
1446
 
"\n"
1447
 
"        #set the UI to display the string\n"
1448
 
"        buff = self.builder.get_object(\"textview1\").get_buffer()\n"
1449
 
"        buff.set_text(text)\n"
1450
 
"\n"
1451
 
msgstr ""
1452
 
 
1453
 
#: data/templates/ubuntu-application/help/tutorial.xml:678(para)
1454
 
msgid "Now users get a nice open dialog:"
1455
 
msgstr ""
1456
 
 
1457
 
#: data/templates/ubuntu-application/help/tutorial.xml:683(para)
1458
 
msgid ""
1459
 
"However, the application is not complete. There are a few things left for "
1460
 
"you to do:"
1461
 
msgstr ""
1462
 
 
1463
 
#: data/templates/ubuntu-application/help/tutorial.xml:686(para)
1464
 
msgid ""
1465
 
"Set the title of the JottyWindow to display the note title. Try "
1466
 
"self.set_text(title)."
1467
 
msgstr ""
1468
 
 
1469
 
#: data/templates/ubuntu-application/help/tutorial.xml:689(para)
1470
 
msgid ""
1471
 
"The Save command works more like \"Save As\". The application probably "
1472
 
"shouldn't pop up a SaveDialog every time you want to save. If it's already "
1473
 
"been saved, you probably just want to save it, but use a SaveDialog when the "
1474
 
"user choose Save As, or is saving a document for the first time."
1475
 
msgstr ""
1476
 
 
1477
 
#: data/templates/ubuntu-application/help/tutorial.xml:692(para)
1478
 
msgid ""
1479
 
"The OpenDialog should probably return when the user double clicks on an item "
1480
 
"in the list. Try connecting to the \"select-cursor-row\" signal on the "
1481
 
"TreeView, and calling self.response(gtk.RESPONSE_OK) in the handler."
1482
 
msgstr ""
1483
 
 
1484
 
#: data/templates/ubuntu-application/help/tutorial.xml:695(para)
1485
 
msgid ""
1486
 
"Perhaps the Ok button in the OpenDialog should be disabled if nothing is "
1487
 
"selected. Try setting the \"sensitivity\" in Glade, and the set_sensitive "
1488
 
"function for the Ok button."
1489
 
msgstr ""
1490
 
 
1491
 
#: data/templates/ubuntu-application/help/tutorial.xml:698(para)
1492
 
msgid ""
1493
 
"It would be more consistent for the Open and Close dialogs to have \"Open\" "
1494
 
"and \"Close\" for buttons instead of \"Ok\". You can set a different type in "
1495
 
"the properties window in Glade."
1496
 
msgstr ""
1497
 
 
1498
 
#: data/templates/ubuntu-application/help/tutorial.xml:701(para)
1499
 
msgid ""
1500
 
"Loading every document into the open dialog is probably a bit inefficient. "
1501
 
"Perhaps storing the document id and using that to retrieve the document "
1502
 
"would be a better implementation."
1503
 
msgstr ""
1504
 
 
1505
 
#: data/templates/ubuntu-application/help/tutorial.xml:707(title)
1506
 
msgid "Packaging"
1507
 
msgstr ""
1508
 
 
1509
 
#: data/templates/ubuntu-application/help/tutorial.xml:708(para)
1510
 
msgid ""
1511
 
"In parts 1 and 2, we showed how to create a simple Ubuntu application using "
1512
 
"<application>Quickly</application>. This section will cover how to package "
1513
 
"an application so that it is easy for you to share, and easy for other "
1514
 
"people to install."
1515
 
msgstr ""
1516
 
 
1517
 
#: data/templates/ubuntu-application/help/tutorial.xml:709(title)
1518
 
msgid "License your Application"
1519
 
msgstr ""
1520
 
 
1521
 
#: data/templates/ubuntu-application/help/tutorial.xml:709(para)
1522
 
msgid ""
1523
 
"<placeholder-1/> It's important to license your code so users and other "
1524
 
"programmers know their rights in terms of redistributing or modifying it. To "
1525
 
"<application>Quickly</application> grant a GPL license to your code, simply:"
1526
 
msgstr ""
1527
 
 
1528
 
#: data/templates/ubuntu-application/help/tutorial.xml:713(para)
1529
 
msgid "Specify your name and email address in the Copyright file."
1530
 
msgstr ""
1531
 
 
1532
 
#: data/templates/ubuntu-application/help/tutorial.xml:716(para)
1533
 
msgid "Run the \"license\" command."
1534
 
msgstr ""
1535
 
 
1536
 
#: data/templates/ubuntu-application/help/tutorial.xml:720(title)
1537
 
msgid "Specify your name and email"
1538
 
msgstr ""
1539
 
 
1540
 
#: data/templates/ubuntu-application/help/tutorial.xml:720(para)
1541
 
msgid ""
1542
 
"<placeholder-1/> When <application>Quickly</application> created your ubuntu "
1543
 
"application, it added a file named Copyright in the top level of the "
1544
 
"directory. Open this file in your text editor, and modify the top line so it "
1545
 
"has your name and email included. Be sure not to modify other lines as it "
1546
 
"will interfere with the next step. For example, I would change the entire "
1547
 
"file to look like this:"
1548
 
msgstr ""
1549
 
 
1550
 
#: data/templates/ubuntu-application/help/tutorial.xml:723(programlisting)
1551
 
#, no-wrap
1552
 
msgid ""
1553
 
"# Copyright (C) 2009 Rick Spencer rick.spencer@canonical.com\n"
1554
 
"### BEGIN AUTOMATIC LICENSE GENERATION\n"
1555
 
"### END AUTOMATIC LICENSE GENERATION\n"
1556
 
msgstr ""
1557
 
 
1558
 
#: data/templates/ubuntu-application/help/tutorial.xml:727(title)
1559
 
msgid "Run the \"License\" Command"
1560
 
msgstr ""
1561
 
 
1562
 
#: data/templates/ubuntu-application/help/tutorial.xml:727(para)
1563
 
msgid ""
1564
 
"<placeholder-1/> By default, <application>Quickly</application> will use a "
1565
 
"GPL 3 license for your project. To use this license, use this command:"
1566
 
msgstr ""
1567
 
 
1568
 
#: data/templates/ubuntu-application/help/tutorial.xml:729(programlisting) data/templates/ubuntu-application/help/tutorial.xml:751(programlisting)
1569
 
#, no-wrap
1570
 
msgid ""
1571
 
"\n"
1572
 
"<application>Quickly</application> license\n"
1573
 
msgstr ""
1574
 
 
1575
 
#: data/templates/ubuntu-application/help/tutorial.xml:732(para)
1576
 
msgid ""
1577
 
"This will add the GPL 3 license to all of your code files that you've added "
1578
 
"to your project using <application>Quickly</application>."
1579
 
msgstr ""
1580
 
 
1581
 
#: data/templates/ubuntu-application/help/tutorial.xml:733(para)
1582
 
msgid "Keep in mind a couple of things:"
1583
 
msgstr ""
1584
 
 
1585
 
#: data/templates/ubuntu-application/help/tutorial.xml:736(para)
1586
 
msgid ""
1587
 
"This is a one way trip. Once you license the project, changes to the license "
1588
 
"must be done manually."
1589
 
msgstr ""
1590
 
 
1591
 
#: data/templates/ubuntu-application/help/tutorial.xml:739(para)
1592
 
msgid ""
1593
 
"If you prefer a GPL 2 license, you can specify that when you issue the "
1594
 
"license command:"
1595
 
msgstr ""
1596
 
 
1597
 
#: data/templates/ubuntu-application/help/tutorial.xml:740(programlisting)
1598
 
#, no-wrap
1599
 
msgid ""
1600
 
"\n"
1601
 
"<application>Quickly</application> license GPL-2\n"
1602
 
msgstr ""
1603
 
 
1604
 
#: data/templates/ubuntu-application/help/tutorial.xml:745(para)
1605
 
msgid ""
1606
 
"<application>Quickly</application> doesn't care what license you use, but "
1607
 
"only knows natively what files and headers to include for BSD, GPL-2, GPL-3, "
1608
 
"LGPL-2 and LGPL-3. If you prefer another license, you can simply add "
1609
 
"whatever you license you like by adding your own license in the Copyright "
1610
 
"file:"
1611
 
msgstr ""
1612
 
 
1613
 
#: data/templates/ubuntu-application/help/tutorial.xml:747(programlisting)
1614
 
#, no-wrap
1615
 
msgid ""
1616
 
"### BEGIN AUTOMATIC LICENSE GENERATION\n"
1617
 
"# My personal license here\n"
1618
 
"### END AUTOMATIC LICENSE GENERATION"
1619
 
msgstr ""
1620
 
 
1621
 
#: data/templates/ubuntu-application/help/tutorial.xml:750(para)
1622
 
msgid "and then run:"
1623
 
msgstr ""
1624
 
 
1625
 
#: data/templates/ubuntu-application/help/tutorial.xml:754(para)
1626
 
msgid "to license every files."
1627
 
msgstr ""
1628
 
 
1629
 
#: data/templates/ubuntu-application/help/tutorial.xml:757(para)
1630
 
msgid ""
1631
 
"If you've added code files or other files to your project manually, you will "
1632
 
"need to add the license to those files manually or add those tags at the "
1633
 
"beginning of the file:"
1634
 
msgstr ""
1635
 
 
1636
 
#: data/templates/ubuntu-application/help/tutorial.xml:759(programlisting)
1637
 
#, no-wrap
1638
 
msgid ""
1639
 
"### BEGIN LICENSE\n"
1640
 
"### END LICENSE"
1641
 
msgstr ""
1642
 
 
1643
 
#: data/templates/ubuntu-application/help/tutorial.xml:764(title)
1644
 
msgid "Translate Your Application"
1645
 
msgstr ""
1646
 
 
1647
 
#: data/templates/ubuntu-application/help/tutorial.xml:764(para)
1648
 
msgid ""
1649
 
"<placeholder-1/> To allow for users from other countries to use your "
1650
 
"application you may want to translate it. Glade automatically creates a pot "
1651
 
"file for you but to translate strings in your code you have to:"
1652
 
msgstr ""
1653
 
 
1654
 
#: data/templates/ubuntu-application/help/tutorial.xml:766(programlisting)
1655
 
#, no-wrap
1656
 
msgid "import gettext"
1657
 
msgstr ""
1658
 
 
1659
 
#: data/templates/ubuntu-application/help/tutorial.xml:767(programlisting)
1660
 
#, no-wrap
1661
 
msgid "gettext.gettext(\"What you want translated\")"
1662
 
msgstr ""
1663
 
 
1664
 
#: data/templates/ubuntu-application/help/tutorial.xml:769(title)
1665
 
msgid "Specify Application Settings"
1666
 
msgstr ""
1667
 
 
1668
 
#: data/templates/ubuntu-application/help/tutorial.xml:769(para)
1669
 
msgid ""
1670
 
"<placeholder-1/> You should personalize your application a little before "
1671
 
"creating the archive. This is very easy to do, as all of the files that you "
1672
 
"need have already been created, and only need a few lines changed to make "
1673
 
"them your own. To do this you should:"
1674
 
msgstr ""
1675
 
 
1676
 
#: data/templates/ubuntu-application/help/tutorial.xml:773(para)
1677
 
msgid "Personalize the Application Icon"
1678
 
msgstr ""
1679
 
 
1680
 
#: data/templates/ubuntu-application/help/tutorial.xml:774(para) data/templates/ubuntu-application/help/tutorial.xml:788(title)
1681
 
msgid "Edit the Desktop File"
1682
 
msgstr ""
1683
 
 
1684
 
#: data/templates/ubuntu-application/help/tutorial.xml:775(para)
1685
 
msgid "Edit the setup.py File"
1686
 
msgstr ""
1687
 
 
1688
 
#: data/templates/ubuntu-application/help/tutorial.xml:778(title)
1689
 
msgid "Personalize your Application Icon"
1690
 
msgstr ""
1691
 
 
1692
 
#: data/templates/ubuntu-application/help/tutorial.xml:778(para)
1693
 
msgid ""
1694
 
"<placeholder-1/> When users install your application, Ubuntu will display an "
1695
 
"icon next to it in the menus. You can create your own icon or edit the file "
1696
 
"called \"icon.png\" in the media directory (jotty/data/media). Ubuntu comes "
1697
 
"with a great image editing program called \"Gimp.\" So you can go:"
1698
 
msgstr ""
1699
 
 
1700
 
#: data/templates/ubuntu-application/help/tutorial.xml:780(programlisting)
1701
 
#, no-wrap
1702
 
msgid ""
1703
 
"\n"
1704
 
"gimp data/media/icon.png\n"
1705
 
msgstr ""
1706
 
 
1707
 
#: data/templates/ubuntu-application/help/tutorial.xml:786(para)
1708
 
msgid ""
1709
 
"If you don't personalize the icon, it's ok, your app will just have the "
1710
 
"default icon, such as in the image below."
1711
 
msgstr ""
1712
 
 
1713
 
#: data/templates/ubuntu-application/help/tutorial.xml:788(para)
1714
 
msgid ""
1715
 
"<placeholder-1/> By default, <application>Quickly</application> Ubuntu "
1716
 
"applications are classified as \"utilities\", so they show up under the "
1717
 
"Accessories menu in Ubuntu. If we wanted to make Jotty show up in another "
1718
 
"category, we can do this by editing the desktop file. A desktop file is a "
1719
 
"file that describes your application to a Linux desktop. The file "
1720
 
"\"jottydesktop.in\" was automatically created in the jotty project "
1721
 
"directory. To change Jotty from a Utility to an Office application, edit "
1722
 
"jotty.desktop.in and change this:"
1723
 
msgstr ""
1724
 
 
1725
 
#: data/templates/ubuntu-application/help/tutorial.xml:792(programlisting)
1726
 
#, no-wrap
1727
 
msgid ""
1728
 
"[Desktop Entry]\n"
1729
 
"Name=Jotty\n"
1730
 
"Comment=Jotty application\n"
1731
 
"Categories=GNOME;Utility;\n"
1732
 
"Exec=jotty\n"
1733
 
"Icon=jotty\n"
1734
 
"Terminal=false\n"
1735
 
"Type=Application\n"
1736
 
msgstr ""
1737
 
 
1738
 
#: data/templates/ubuntu-application/help/tutorial.xml:802(para)
1739
 
msgid "to this:"
1740
 
msgstr ""
1741
 
 
1742
 
#: data/templates/ubuntu-application/help/tutorial.xml:806(programlisting)
1743
 
#, no-wrap
1744
 
msgid ""
1745
 
"[Desktop Entry]\n"
1746
 
"Name=Jotty\n"
1747
 
"Comment=Jotty application\n"
1748
 
"Categories=GNOME;Office;\n"
1749
 
"Exec=jotty\n"
1750
 
"Icon=jotty\n"
1751
 
"Terminal=false\n"
1752
 
"Type=Application"
1753
 
msgstr ""
1754
 
 
1755
 
#: data/templates/ubuntu-application/help/tutorial.xml:814(para)
1756
 
msgid ""
1757
 
"There are lots more categories that you can use, all defined by the "
1758
 
"FreeDesktop spec. You can see the complete list in the <ulink "
1759
 
"url=\"http://standards.freedesktop.org/menu-spec/latest/apa.html\">menu "
1760
 
"spec</ulink>."
1761
 
msgstr ""
1762
 
 
1763
 
#: data/templates/ubuntu-application/help/tutorial.xml:818(title)
1764
 
msgid "Edit Setup.py"
1765
 
msgstr ""
1766
 
 
1767
 
#: data/templates/ubuntu-application/help/tutorial.xml:817(para)
1768
 
msgid ""
1769
 
"<placeholder-1/> Finally, you should include some information in the "
1770
 
"setup.py file to tell your users a little about yourself. The setup.py file "
1771
 
"was created for you, just like the desktop file. Most of of the setup.py "
1772
 
"file shouldn't be modified, as it is just boiler plate that makes your "
1773
 
"application work properly after it has been installed. However, there is a "
1774
 
"section at the bottom of the setup.py file that you should edit to describe "
1775
 
"yourself and the application."
1776
 
msgstr ""
1777
 
 
1778
 
#: data/templates/ubuntu-application/help/tutorial.xml:821(para)
1779
 
msgid "So I would change this section:"
1780
 
msgstr ""
1781
 
 
1782
 
#: data/templates/ubuntu-application/help/tutorial.xml:825(programlisting)
1783
 
#, no-wrap
1784
 
msgid ""
1785
 
"DistUtilsExtra.auto.setup(\n"
1786
 
"    name='jotty',\n"
1787
 
"    version='0.1',\n"
1788
 
"    license='GPL v3',\n"
1789
 
"    #author='Your Name',\n"
1790
 
"    #author_email='email@ubuntu.com',\n"
1791
 
"    #description='UI for managing …',\n"
1792
 
"    #long_description='Here a longer description',\n"
1793
 
"    #url='https://launchpad.net/jotty',\n"
1794
 
"    cmdclass={'install': InstallAndUpdateDataDirectory}\n"
1795
 
"    )\n"
1796
 
msgstr ""
1797
 
 
1798
 
#: data/templates/ubuntu-application/help/tutorial.xml:837(para)
1799
 
msgid "To look like this:"
1800
 
msgstr ""
1801
 
 
1802
 
#: data/templates/ubuntu-application/help/tutorial.xml:841(programlisting)
1803
 
#, no-wrap
1804
 
msgid ""
1805
 
"DistUtilsExtra.auto.setup(\n"
1806
 
"    name='jotty',\n"
1807
 
"    version='0.1',\n"
1808
 
"    license='GPL v3',\n"
1809
 
"    author='Rick Spencer',\n"
1810
 
"    author_email='rick.spencer@canonical.com',\n"
1811
 
"    description='Note taking application',\n"
1812
 
"    long_description='Note taking application that uses CouchDB as the "
1813
 
"backend to support easy replication across users and computers.',\n"
1814
 
"    #url='https://launchpad.net/jotty',\n"
1815
 
"    cmdclass={'install': InstallAndUpdateDataDirectory}\n"
1816
 
"    )"
1817
 
msgstr ""
1818
 
 
1819
 
#: data/templates/ubuntu-application/help/tutorial.xml:852(para)
1820
 
msgid ""
1821
 
"Note that the license has already been set up for you. author and "
1822
 
"author_email are updated each time you connect to Launchpad (with "
1823
 
"<application>Quickly</application> release or "
1824
 
"<application>Quickly</application> share) with your Launchpad real name and "
1825
 
"preferred email adress."
1826
 
msgstr ""
1827
 
 
1828
 
#: data/templates/ubuntu-application/help/tutorial.xml:853(para)
1829
 
msgid ""
1830
 
"Notice that Jotty doesn't have a web page yet, so I just left that line "
1831
 
"commented out. Also, you don't have to increment version number as "
1832
 
"<application>Quickly</application> share and "
1833
 
"<application>Quickly</application> release commands will make it for you.."
1834
 
msgstr ""
1835
 
 
1836
 
#: data/templates/ubuntu-application/help/tutorial.xml:857(title)
1837
 
msgid "Create and Test the Debian Archive"
1838
 
msgstr ""
1839
 
 
1840
 
#: data/templates/ubuntu-application/help/tutorial.xml:857(para)
1841
 
msgid ""
1842
 
"<placeholder-1/> After personalizing the project, we are now ready to create "
1843
 
"the package. This is easily done by issuing the package command:"
1844
 
msgstr ""
1845
 
 
1846
 
#: data/templates/ubuntu-application/help/tutorial.xml:860(programlisting) data/templates/ubuntu-application/help/tutorial.xml:1062(programlisting)
1847
 
#, no-wrap
1848
 
msgid ""
1849
 
"\n"
1850
 
"<application>Quickly</application> package\n"
1851
 
msgstr ""
1852
 
 
1853
 
#: data/templates/ubuntu-application/help/tutorial.xml:863(para)
1854
 
msgid ""
1855
 
"This command will take a little while to discover dependencies and create "
1856
 
"all the required archives, etc... It will also report some errors as we "
1857
 
"haven't created a PGP key, for instance. None the less, when it is done, the "
1858
 
"package will be created. Using the file browser, you can see the created "
1859
 
"package next to the project directory:"
1860
 
msgstr ""
1861
 
 
1862
 
#: data/templates/ubuntu-application/help/tutorial.xml:867(para)
1863
 
msgid ""
1864
 
"Right now, the specific file we are interested in is \"jotty_0.1_all.deb\". "
1865
 
"To test it out, double click on it, to open it in Ubuntu's graphical "
1866
 
"installer program:"
1867
 
msgstr ""
1868
 
 
1869
 
#: data/templates/ubuntu-application/help/tutorial.xml:871(para)
1870
 
msgid ""
1871
 
"Click \"Install Package\" to see how it installs onto your desktop. After "
1872
 
"chugging for a bit, you'll see that it is installed in the Applications-"
1873
 
"&gt;Office menu. If you customized your icon, you'll see that the menu uses "
1874
 
"your custom icon as well."
1875
 
msgstr ""
1876
 
 
1877
 
#: data/templates/ubuntu-application/help/tutorial.xml:875(title)
1878
 
msgid "Now that you have a package"
1879
 
msgstr ""
1880
 
 
1881
 
#: data/templates/ubuntu-application/help/tutorial.xml:875(para)
1882
 
msgid ""
1883
 
"<placeholder-1/> Now that you've packaged your application, you can share "
1884
 
"the .deb file. However, if your users install their application this way, "
1885
 
"and you update the application, your users will have to find this out and "
1886
 
"resinstall. This hassle can be avoided in Ubuntu by using Personal Package "
1887
 
"Archives (or PPAs). Distrubuting your applications in this manner is covered "
1888
 
"in section 4 (not yet available)."
1889
 
msgstr ""
1890
 
 
1891
 
#: data/templates/ubuntu-application/help/tutorial.xml:879(title)
1892
 
msgid ""
1893
 
"<application>Quickly</application>: <application>Quickly</application> "
1894
 
"Command Reference"
1895
 
msgstr ""
1896
 
 
1897
 
#: data/templates/ubuntu-application/help/tutorial.xml:880(para)
1898
 
msgid ""
1899
 
"The ubuntu-application template template contains the following commands."
1900
 
msgstr ""
1901
 
 
1902
 
#: data/templates/ubuntu-application/help/tutorial.xml:883(xref) data/templates/ubuntu-application/help/tutorial.xml:916(title) data/templates/ubuntu-application/help/tutorial.xml:917(title)
1903
 
msgid "create"
1904
 
msgstr ""
1905
 
 
1906
 
#: data/templates/ubuntu-application/help/tutorial.xml:886(xref) data/templates/ubuntu-application/help/tutorial.xml:943(title)
1907
 
msgid "add dialog"
1908
 
msgstr ""
1909
 
 
1910
 
#: data/templates/ubuntu-application/help/tutorial.xml:889(xref) data/templates/ubuntu-application/help/tutorial.xml:988(title) data/templates/ubuntu-application/help/tutorial.xml:989(title)
1911
 
msgid "edit"
1912
 
msgstr ""
1913
 
 
1914
 
#: data/templates/ubuntu-application/help/tutorial.xml:892(xref)
1915
 
msgid "design"
1916
 
msgstr ""
1917
 
 
1918
 
#: data/templates/ubuntu-application/help/tutorial.xml:895(xref) data/templates/ubuntu-application/help/tutorial.xml:1012(title) data/templates/ubuntu-application/help/tutorial.xml:1013(title)
1919
 
msgid "help"
1920
 
msgstr ""
1921
 
 
1922
 
#: data/templates/ubuntu-application/help/tutorial.xml:898(xref) data/templates/ubuntu-application/help/tutorial.xml:1021(title) data/templates/ubuntu-application/help/tutorial.xml:1022(title)
1923
 
msgid "license"
1924
 
msgstr ""
1925
 
 
1926
 
#: data/templates/ubuntu-application/help/tutorial.xml:901(xref) data/templates/ubuntu-application/help/tutorial.xml:1060(title) data/templates/ubuntu-application/help/tutorial.xml:1061(title)
1927
 
msgid "package"
1928
 
msgstr ""
1929
 
 
1930
 
#: data/templates/ubuntu-application/help/tutorial.xml:904(xref) data/templates/ubuntu-application/help/tutorial.xml:1077(title) data/templates/ubuntu-application/help/tutorial.xml:1078(title)
1931
 
msgid "release"
1932
 
msgstr ""
1933
 
 
1934
 
#: data/templates/ubuntu-application/help/tutorial.xml:907(xref) data/templates/ubuntu-application/help/tutorial.xml:1112(title) data/templates/ubuntu-application/help/tutorial.xml:1113(title)
1935
 
msgid "run"
1936
 
msgstr ""
1937
 
 
1938
 
#: data/templates/ubuntu-application/help/tutorial.xml:910(xref) data/templates/ubuntu-application/help/tutorial.xml:1122(title) data/templates/ubuntu-application/help/tutorial.xml:1123(title)
1939
 
msgid "save"
1940
 
msgstr ""
1941
 
 
1942
 
#: data/templates/ubuntu-application/help/tutorial.xml:913(xref) data/templates/ubuntu-application/help/tutorial.xml:1137(title) data/templates/ubuntu-application/help/tutorial.xml:1139(title)
1943
 
msgid "share"
1944
 
msgstr ""
1945
 
 
1946
 
#: data/templates/ubuntu-application/help/tutorial.xml:917(para) data/templates/ubuntu-application/help/tutorial.xml:944(para) data/templates/ubuntu-application/help/tutorial.xml:989(para) data/templates/ubuntu-application/help/tutorial.xml:1000(para) data/templates/ubuntu-application/help/tutorial.xml:1013(para) data/templates/ubuntu-application/help/tutorial.xml:1022(para) data/templates/ubuntu-application/help/tutorial.xml:1061(para) data/templates/ubuntu-application/help/tutorial.xml:1078(para) data/templates/ubuntu-application/help/tutorial.xml:1113(para) data/templates/ubuntu-application/help/tutorial.xml:1123(para) data/templates/ubuntu-application/help/tutorial.xml:1138(para)
1947
 
msgid "<placeholder-1/> Usage:"
1948
 
msgstr ""
1949
 
 
1950
 
#: data/templates/ubuntu-application/help/tutorial.xml:919(programlisting)
1951
 
#, no-wrap
1952
 
msgid ""
1953
 
"\n"
1954
 
"<application>Quickly</application> create ubuntu-application "
1955
 
"path/to/project_name"
1956
 
msgstr ""
1957
 
 
1958
 
#: data/templates/ubuntu-application/help/tutorial.xml:921(para)
1959
 
msgid ""
1960
 
"where \"project_name\" is one or more words separated by an underscore and "
1961
 
"path/to can be any existing path."
1962
 
msgstr ""
1963
 
 
1964
 
#: data/templates/ubuntu-application/help/tutorial.xml:924(para)
1965
 
msgid ""
1966
 
"This will create and run a new project, including Python code, Glade files, "
1967
 
"and packaging files to make the project work. After creating the project, "
1968
 
"get started by:"
1969
 
msgstr ""
1970
 
 
1971
 
#: data/templates/ubuntu-application/help/tutorial.xml:930(para)
1972
 
msgid "Changing your working directory to the new project:"
1973
 
msgstr ""
1974
 
 
1975
 
#: data/templates/ubuntu-application/help/tutorial.xml:932(programlisting)
1976
 
#, no-wrap
1977
 
msgid "cd path/to/project_name"
1978
 
msgstr ""
1979
 
 
1980
 
#: data/templates/ubuntu-application/help/tutorial.xml:934(para)
1981
 
msgid "Edit the UI with Glade:"
1982
 
msgstr ""
1983
 
 
1984
 
#: data/templates/ubuntu-application/help/tutorial.xml:935(programlisting)
1985
 
#, no-wrap
1986
 
msgid "<application>Quickly</application> design"
1987
 
msgstr ""
1988
 
 
1989
 
#: data/templates/ubuntu-application/help/tutorial.xml:937(para)
1990
 
msgid "Edit the Python code:"
1991
 
msgstr ""
1992
 
 
1993
 
#: data/templates/ubuntu-application/help/tutorial.xml:938(programlisting) data/templates/ubuntu-application/help/tutorial.xml:967(programlisting)
1994
 
#, no-wrap
1995
 
msgid "<application>Quickly</application> edit"
1996
 
msgstr ""
1997
 
 
1998
 
#: data/templates/ubuntu-application/help/tutorial.xml:944(title)
1999
 
msgid "dialog"
2000
 
msgstr ""
2001
 
 
2002
 
#: data/templates/ubuntu-application/help/tutorial.xml:946(programlisting)
2003
 
#, no-wrap
2004
 
msgid "<application>Quickly</application> add dialog dialog_name"
2005
 
msgstr ""
2006
 
 
2007
 
#: data/templates/ubuntu-application/help/tutorial.xml:947(para)
2008
 
msgid "where dialog_name is one or more words seperated with underscore"
2009
 
msgstr ""
2010
 
 
2011
 
#: data/templates/ubuntu-application/help/tutorial.xml:948(para)
2012
 
msgid "This will create:"
2013
 
msgstr ""
2014
 
 
2015
 
#: data/templates/ubuntu-application/help/tutorial.xml:952(para)
2016
 
msgid ""
2017
 
"A subclass of gtk.Dialog called DialogNameDialog in the module "
2018
 
"DialogNameDialog.py"
2019
 
msgstr ""
2020
 
 
2021
 
#: data/templates/ubuntu-application/help/tutorial.xml:955(para)
2022
 
msgid "A glade file called DialogNameDialog.ui in the ui directory"
2023
 
msgstr ""
2024
 
 
2025
 
#: data/templates/ubuntu-application/help/tutorial.xml:958(para)
2026
 
msgid "A catalog file called dialog_name_dialog.xml also in the ui directory"
2027
 
msgstr ""
2028
 
 
2029
 
#: data/templates/ubuntu-application/help/tutorial.xml:961(para)
2030
 
msgid "To edit the UI for the dialog, run:"
2031
 
msgstr ""
2032
 
 
2033
 
#: data/templates/ubuntu-application/help/tutorial.xml:963(programlisting)
2034
 
#, no-wrap
2035
 
msgid "<application>Quickly</application> design\n"
2036
 
msgstr ""
2037
 
 
2038
 
#: data/templates/ubuntu-application/help/tutorial.xml:965(para)
2039
 
msgid "To edit the behavior, run:"
2040
 
msgstr ""
2041
 
 
2042
 
#: data/templates/ubuntu-application/help/tutorial.xml:968(para)
2043
 
msgid "To use the dialog you have to invoke it from another python file:"
2044
 
msgstr ""
2045
 
 
2046
 
#: data/templates/ubuntu-application/help/tutorial.xml:972(programlisting)
2047
 
#, no-wrap
2048
 
msgid ""
2049
 
"\n"
2050
 
"Import the dialog\n"
2051
 
"import DialogNameDialog\n"
2052
 
msgstr ""
2053
 
 
2054
 
#: data/templates/ubuntu-application/help/tutorial.xml:976(programlisting)
2055
 
#, no-wrap
2056
 
msgid ""
2057
 
"\n"
2058
 
"Create an instance of the dialog\n"
2059
 
"dialog = DialogNameDialog.NewDialogNameDialog()\n"
2060
 
msgstr ""
2061
 
 
2062
 
#: data/templates/ubuntu-application/help/tutorial.xml:980(programlisting)
2063
 
#, no-wrap
2064
 
msgid ""
2065
 
"\n"
2066
 
"Run the dialog and hide the dialog\n"
2067
 
"result = dialog.run()\n"
2068
 
"dialog.hide()\n"
2069
 
msgstr ""
2070
 
 
2071
 
#: data/templates/ubuntu-application/help/tutorial.xml:991(programlisting)
2072
 
#, no-wrap
2073
 
msgid ""
2074
 
"\n"
2075
 
"<application>Quickly</application> edit\n"
2076
 
msgstr ""
2077
 
 
2078
 
#: data/templates/ubuntu-application/help/tutorial.xml:993(para)
2079
 
msgid ""
2080
 
"A convenience command to open all of your python files in your project "
2081
 
"directory in your default editor, ready for editing."
2082
 
msgstr ""
2083
 
 
2084
 
#: data/templates/ubuntu-application/help/tutorial.xml:999(title) data/templates/ubuntu-application/help/tutorial.xml:1000(title)
2085
 
msgid "glade"
2086
 
msgstr ""
2087
 
 
2088
 
#: data/templates/ubuntu-application/help/tutorial.xml:1001(programlisting)
2089
 
#, no-wrap
2090
 
msgid ""
2091
 
"\n"
2092
 
"<application>Quickly</application> design\n"
2093
 
msgstr ""
2094
 
 
2095
 
#: data/templates/ubuntu-application/help/tutorial.xml:1003(para)
2096
 
msgid ""
2097
 
"Opens Glade UI editor so that you can edit the UI for dialogs and windows in "
2098
 
"your project. Note that you *must* open Glade in this manner for "
2099
 
"<application>Quickly</application> to work. If you try to open Glade "
2100
 
"directly, and the open the UI files, Glade will throw errors and won't open "
2101
 
"the files."
2102
 
msgstr ""
2103
 
 
2104
 
#: data/templates/ubuntu-application/help/tutorial.xml:1014(programlisting)
2105
 
#, no-wrap
2106
 
msgid ""
2107
 
"\n"
2108
 
"<application>Quickly</application> help\n"
2109
 
msgstr ""
2110
 
 
2111
 
#: data/templates/ubuntu-application/help/tutorial.xml:1016(para)
2112
 
msgid "Opens a web browser with the help index."
2113
 
msgstr ""
2114
 
 
2115
 
#: data/templates/ubuntu-application/help/tutorial.xml:1023(programlisting)
2116
 
#, no-wrap
2117
 
msgid ""
2118
 
"\n"
2119
 
"<application>Quickly</application> license &lt;Your_Licence=\n"
2120
 
msgstr ""
2121
 
 
2122
 
#: data/templates/ubuntu-application/help/tutorial.xml:1025(para)
2123
 
msgid "Adds license to project files. Before using this command, you should:"
2124
 
msgstr ""
2125
 
 
2126
 
#: data/templates/ubuntu-application/help/tutorial.xml:1029(para)
2127
 
msgid ""
2128
 
"run <application>Quickly</application> save in case something goes wrong"
2129
 
msgstr ""
2130
 
 
2131
 
#: data/templates/ubuntu-application/help/tutorial.xml:1032(para)
2132
 
msgid "Edit the file Copyright to include your authorship."
2133
 
msgstr ""
2134
 
 
2135
 
#: data/templates/ubuntu-application/help/tutorial.xml:1034(para)
2136
 
msgid ""
2137
 
"If you want to put your own <application>Quickly</application> unsupported "
2138
 
"Licence, remove and replace the tags ### BEGIN AUTOMATIC LICENCE GENERATION "
2139
 
"and ### END AUTOMATIC LICENCE GENERATION in it by your own licence."
2140
 
msgstr ""
2141
 
 
2142
 
#: data/templates/ubuntu-application/help/tutorial.xml:1039(programlisting)
2143
 
#, no-wrap
2144
 
msgid "<application>Quickly</application> license"
2145
 
msgstr ""
2146
 
 
2147
 
#: data/templates/ubuntu-application/help/tutorial.xml:1039(programlisting)
2148
 
#, no-wrap
2149
 
msgid "<application>Quickly</application> licence &lt;License="
2150
 
msgstr ""
2151
 
 
2152
 
#: data/templates/ubuntu-application/help/tutorial.xml:1038(para)
2153
 
msgid ""
2154
 
"Executes either <placeholder-1/> or <placeholder-2/> where &lt;License= can "
2155
 
"be either: - GPL-3 (default) - GPL-2"
2156
 
msgstr ""
2157
 
 
2158
 
#: data/templates/ubuntu-application/help/tutorial.xml:1045(para)
2159
 
msgid ""
2160
 
"This will modify the Copyright file with the chosen licence (with GPL-3 by "
2161
 
"default). Updating previous chosen Licence if needed. If you previously "
2162
 
"removed the tags to add your own licence, it will leave it pristine. If no "
2163
 
"name is attributed to the Copyright, it will try to retrieve it from "
2164
 
"Launchpad (in <application>Quickly</application> release or "
2165
 
"<application>Quickly</application> share command only)"
2166
 
msgstr ""
2167
 
 
2168
 
#: data/templates/ubuntu-application/help/tutorial.xml:1051(para)
2169
 
msgid "Finally, this will copy the Copyright at the head of every files."
2170
 
msgstr ""
2171
 
 
2172
 
#: data/templates/ubuntu-application/help/tutorial.xml:1053(para)
2173
 
msgid ""
2174
 
"Note that if you don't run <application>Quickly</application> licence before "
2175
 
"calling <application>Quickly</application> release or "
2176
 
"<application>Quickly</application> share, this one will execute it for you "
2177
 
"and guess the copyright holder from your launchpad account if you didn't "
2178
 
"update it."
2179
 
msgstr ""
2180
 
 
2181
 
#: data/templates/ubuntu-application/help/tutorial.xml:1064(para)
2182
 
msgid ""
2183
 
"Creates a debian file (deb) from your project. Before running the package "
2184
 
"command you can edit the Icon and Category entry of *.desktop.in file, where "
2185
 
"* is the name of your project."
2186
 
msgstr ""
2187
 
 
2188
 
#: data/templates/ubuntu-application/help/tutorial.xml:1068(para)
2189
 
msgid ""
2190
 
"Note that if you didn't run <application>Quickly</application> release, "
2191
 
"<application>Quickly</application> share or "
2192
 
"<application>Quickly</application> change-lp-project you may miss the name, "
2193
 
"email in setup.py. You can edit them if you don't want to use any of these "
2194
 
"commands afterwards. Those changes are not a mandatory at all for testing "
2195
 
"purpose."
2196
 
msgstr ""
2197
 
 
2198
 
#: data/templates/ubuntu-application/help/tutorial.xml:1079(programlisting)
2199
 
#, no-wrap
2200
 
msgid ""
2201
 
"\n"
2202
 
"<application>Quickly</application> release\n"
2203
 
msgstr ""
2204
 
 
2205
 
#: data/templates/ubuntu-application/help/tutorial.xml:1081(para)
2206
 
msgid ""
2207
 
"Posts a release of your project to a PPA on launchpad so that users can "
2208
 
"install the application on their system."
2209
 
msgstr ""
2210
 
 
2211
 
#: data/templates/ubuntu-application/help/tutorial.xml:1086(programlisting) data/templates/ubuntu-application/help/tutorial.xml:1089(programlisting)
2212
 
#, no-wrap
2213
 
msgid "<application>Quickly</application> release &lt;release_number="
2214
 
msgstr ""
2215
 
 
2216
 
#: data/templates/ubuntu-application/help/tutorial.xml:1084(para)
2217
 
msgid ""
2218
 
"You can also execute: <placeholder-1/> of you don't want to use current "
2219
 
"release_number. The release_number must be a number."
2220
 
msgstr ""
2221
 
 
2222
 
#: data/templates/ubuntu-application/help/tutorial.xml:1088(para)
2223
 
msgid ""
2224
 
"<placeholder-1/> notes about changes where \"notes about changes\" is "
2225
 
"optional text describing what changes were made since the last save"
2226
 
msgstr ""
2227
 
 
2228
 
#: data/templates/ubuntu-application/help/tutorial.xml:1092(para)
2229
 
msgid ""
2230
 
"Before running <application>Quickly</application> release, you should: "
2231
 
"create your account and a project page on http://launchpad.net. You also "
2232
 
"have to add a PPA to your launchpad account."
2233
 
msgstr ""
2234
 
 
2235
 
#: data/templates/ubuntu-application/help/tutorial.xml:1096(para)
2236
 
msgid ""
2237
 
"Name, email and version setup.py will be automatically changed. (version "
2238
 
"will be &lt;current_release= and bzr will commit and tagged. Once the "
2239
 
"release is done, &lt;current_release= will be incremented by 0.1 to be ready "
2240
 
"for next release."
2241
 
msgstr ""
2242
 
 
2243
 
#: data/templates/ubuntu-application/help/tutorial.xml:1101(para)
2244
 
msgid ""
2245
 
"If you previously used <application>Quickly</application> shared "
2246
 
"&lt;current_release=~publicX will be dropped to release &lt;current_release= "
2247
 
"version (&lt;current_release=~publicX &lt;current_release=) You can modify "
2248
 
"the description and long description if you wish."
2249
 
msgstr ""
2250
 
 
2251
 
#: data/templates/ubuntu-application/help/tutorial.xml:1107(programlisting)
2252
 
#, no-wrap
2253
 
msgid "<application>Quickly</application> package"
2254
 
msgstr ""
2255
 
 
2256
 
#: data/templates/ubuntu-application/help/tutorial.xml:1106(para)
2257
 
msgid ""
2258
 
"You can run <placeholder-1/> and test your package to make sure it installs "
2259
 
"as expected. (This is not mandatory)"
2260
 
msgstr ""
2261
 
 
2262
 
#: data/templates/ubuntu-application/help/tutorial.xml:1114(programlisting)
2263
 
#, no-wrap
2264
 
msgid ""
2265
 
"\n"
2266
 
"<application>Quickly</application> run\n"
2267
 
msgstr ""
2268
 
 
2269
 
#: data/templates/ubuntu-application/help/tutorial.xml:1116(para)
2270
 
msgid ""
2271
 
"Runs your application. This is the best way to try test it out while you are "
2272
 
"developing it. It starts up the main project window."
2273
 
msgstr ""
2274
 
 
2275
 
#: data/templates/ubuntu-application/help/tutorial.xml:1124(programlisting)
2276
 
#, no-wrap
2277
 
msgid ""
2278
 
"\n"
2279
 
"<application>Quickly</application> save notes about changes\n"
2280
 
msgstr ""
2281
 
 
2282
 
#: data/templates/ubuntu-application/help/tutorial.xml:1126(para)
2283
 
msgid ""
2284
 
"where \"notes about changes\" is optional text describing what changes were "
2285
 
"made since the last save."
2286
 
msgstr ""
2287
 
 
2288
 
#: data/templates/ubuntu-application/help/tutorial.xml:1133(programlisting)
2289
 
#, no-wrap
2290
 
msgid "bzr help"
2291
 
msgstr ""
2292
 
 
2293
 
#: data/templates/ubuntu-application/help/tutorial.xml:1129(para)
2294
 
msgid ""
2295
 
"This command commits all changes since the last save to bzr. Note that it "
2296
 
"does not push changes to any back up location. If you need revert or "
2297
 
"otherwise use the revision control, use bzr directly: <placeholder-1/>"
2298
 
msgstr ""
2299
 
 
2300
 
#: data/templates/ubuntu-application/help/tutorial.xml:1140(programlisting)
2301
 
#, no-wrap
2302
 
msgid ""
2303
 
"\n"
2304
 
"<application>Quickly</application> share"
2305
 
msgstr ""
2306
 
 
2307
 
#: data/templates/ubuntu-application/help/tutorial.xml:1142(para)
2308
 
msgid "Updates your PPA with the the latest saved project changes."
2309
 
msgstr ""
2310
 
 
2311
 
#: data/templates/ubuntu-application/help/tutorial.xml:1144(para)
2312
 
msgid ""
2313
 
"Before running <application>Quickly</application> release, you should: "
2314
 
"create your account on http://launchpad.net. You also have to add a PPA to "
2315
 
"your launchpad account."
2316
 
msgstr ""
2317
 
 
2318
 
#: data/templates/ubuntu-application/help/tutorial.xml:1148(para)
2319
 
msgid ""
2320
 
"Name, email and version setup.py will be automatically changed. (version "
2321
 
"will be &lt;current_release~publicX= where X will be incremented at each "
2322
 
"<application>Quickly</application> share execution) You can modify the "
2323
 
"description and long description if you wish."
2324
 
msgstr ""
2325
 
 
2326
 
#: data/templates/ubuntu-application/help/tutorial.xml:1158(title)
2327
 
msgid "Links"
2328
 
msgstr ""
2329
 
 
2330
 
#: data/templates/ubuntu-application/help/tutorial.xml:1160(link)
2331
 
msgid "<placeholder-1/>: <placeholder-2/> Command Reference"
2332
 
msgstr ""
2333
 
 
2334
 
#: data/templates/ubuntu-application/help/tutorial.xml:1163(ulink)
2335
 
msgid "Blog post on <placeholder-1/>"
2336
 
msgstr ""
2337
 
 
2338
 
#: data/templates/ubuntu-application/help/tutorial.xml:1166(ulink)
2339
 
msgid "Language: Python Language Reference"
2340
 
msgstr ""
2341
 
 
2342
 
#: data/templates/ubuntu-application/help/tutorial.xml:1169(ulink)
2343
 
msgid "Core Library: Python 2.6 Library Reference"
2344
 
msgstr ""
2345
 
 
2346
 
#: data/templates/ubuntu-application/help/tutorial.xml:1172(ulink)
2347
 
msgid "UI Library: PyGtk"
2348
 
msgstr ""
2349
 
 
2350
 
#: data/templates/ubuntu-application/help/tutorial.xml:1175(ulink)
2351
 
msgid "Database: CouchDB Reference"
2352
 
msgstr ""
2353
 
 
2354
 
#: data/templates/ubuntu-application/help/tutorial.xml:1178(ulink)
2355
 
msgid "UI Editing: Glade User Documenation"
2356
 
msgstr ""
2357
 
 
2358
 
#: data/templates/ubuntu-application/help/tutorial.xml:1181(ulink)
2359
 
msgid "Editor: Gedit Help"
2360
 
msgstr ""
2361
 
 
2362
 
#: data/templates/ubuntu-application/help/tutorial.xml:1184(ulink)
2363
 
msgid "Version Control: Bazaar"
 
52
#: data/templates/ubuntu-pygame/help/tutorial.xml:32(para)
 
53
msgid ""
 
54
"Use <application>The Quickly Pygame Template</application> to write old "
 
55
"school arcade games for running on Ubuntu. PyGame is a framework that "
 
56
"handles sprites, collisons, sounds, and everything you need to make a game. "
 
57
"You just need to add the game play. The Quickly template creates a starter "
 
58
"game for you and comes ready for you to turn into your fun game, and then "
 
59
"easily package and share it with other Ubuntu users."
 
60
msgstr ""
 
61
 
 
62
#: data/templates/ubuntu-pygame/help/tutorial.xml:35(para)
 
63
msgid ""
 
64
"The Quickly Pygame Template inherits from the Quickly Application template. "
 
65
"So you get all the commands that you get from the that template, except "
 
66
"\"design\"."
 
67
msgstr ""
 
68
 
 
69
#: data/templates/ubuntu-pygame/help/tutorial.xml:41(title)
 
70
msgid "Creating and Running Your Game"
 
71
msgstr ""
 
72
 
 
73
#: data/templates/ubuntu-pygame/help/tutorial.xml:44(para)
 
74
msgid ""
 
75
"In this tutorial we will start making a top down shooter reminiscent of the "
 
76
"space arcade shooters of the 1980s."
 
77
msgstr ""
 
78
 
 
79
#: data/templates/ubuntu-pygame/help/tutorial.xml:50(para)
 
80
msgid ""
 
81
"We'll do this by creating a default game, editing some of the generated "
 
82
"code, writing some new code, and adding our images for sprits."
 
83
msgstr ""
 
84
 
 
85
#: data/templates/ubuntu-pygame/help/tutorial.xml:53(para)
 
86
msgid ""
 
87
"Creating a default working game couldn't be simpler. First, open a terminal "
 
88
"window to type commands into. When it's open, type the command:"
 
89
msgstr ""
 
90
 
 
91
#: data/templates/ubuntu-pygame/help/tutorial.xml:56(programlisting)
 
92
#, no-wrap
 
93
msgid ""
 
94
"\n"
 
95
"$quickly create ubuntu-pygame shooter\n"
 
96
" "
 
97
msgstr ""
 
98
 
 
99
#: data/templates/ubuntu-pygame/help/tutorial.xml:60(para)
 
100
msgid ""
 
101
"This will create a shooter sub directory containing a complete directory "
 
102
"tree and files for an empty python application. The command finishes by "
 
103
"running the newly created game. The game is played by using the \"s\" and "
 
104
"\"f\" keys to rotate the guy, the \"j\" key to shoot, and the \"l\" key to "
 
105
"thrust."
 
106
msgstr ""
 
107
 
 
108
#: data/templates/ubuntu-pygame/help/tutorial.xml:63(para)
 
109
msgid ""
 
110
"You can play the newly created game. Notice that the <application>Quickly "
 
111
"PyGame Template</application> inferred that the game title is \"Shooter\". "
 
112
"Also note that there is a guy that you can control with the s,f,j, and l "
 
113
"keys. There is an enemy and a homing missle. You also get a \"Game Over\" "
 
114
"screen, scoring, and levels build in for free."
 
115
msgstr ""
 
116
 
 
117
#: data/templates/ubuntu-pygame/help/tutorial.xml:66(para)
 
118
msgid ""
 
119
"Close the game by closing the window or using the Esc key. Since the game "
 
120
"isn't installed into Ubuntu yet, you can't start the game from the "
 
121
"application menu yet. To start the game, use the terminal to first cd into "
 
122
"the new subdirectory, and then use \"quickly run\" to start the program."
 
123
msgstr ""
 
124
 
 
125
#: data/templates/ubuntu-pygame/help/tutorial.xml:69(programlisting)
 
126
#, no-wrap
 
127
msgid ""
 
128
"\n"
 
129
"$cd shooter\n"
 
130
"$quickly run\n"
 
131
" "
 
132
msgstr ""
 
133
 
 
134
#: data/templates/ubuntu-pygame/help/tutorial.xml:75(title)
 
135
msgid "Creating your own Sprites"
 
136
msgstr ""
 
137
 
 
138
#: data/templates/ubuntu-pygame/help/tutorial.xml:79(listitem)
 
139
msgid ""
 
140
"Ink Scape is a great and free tool for creating your sprites. It's in the "
 
141
"Featured Applications section of the Software Center."
 
142
msgstr ""
 
143
 
 
144
#: data/templates/ubuntu-pygame/help/tutorial.xml:80(listitem)
 
145
msgid ""
 
146
"If you use Ink Scape, you'll want to export the images as PNGs. But keep the "
 
147
"Ink Scape files around in case you want to edit the sprites later."
 
148
msgstr ""
 
149
 
 
150
#: data/templates/ubuntu-pygame/help/tutorial.xml:81(listitem)
 
151
msgid ""
 
152
"Whatever size you make the sprites, that's the size they will be in the game."
 
153
msgstr ""
 
154
 
 
155
#: data/templates/ubuntu-pygame/help/tutorial.xml:82(listitem)
 
156
msgid ""
 
157
"The game will look for sprites in the data/media folder, so make sure you "
 
158
"put them there."
 
159
msgstr ""
 
160
 
 
161
#: data/templates/ubuntu-pygame/help/tutorial.xml:76(para)
 
162
msgid ""
 
163
"The first think you probably noticed about the game is that the graphics are "
 
164
"so blah! Let's start by adding our own sprites. We;ll do a compbination of "
 
165
"replacing sprites with our own images, and also add a new sprite which we'll "
 
166
"use later. Here's a few things to keep in mind: <placeholder-1/>"
 
167
msgstr ""
 
168
 
 
169
#: data/templates/ubuntu-pygame/help/tutorial.xml:85(para)
 
170
msgid ""
 
171
"I made new images for the guy (the sprite the player controls), enemies, "
 
172
"bullets, and the game background. I also made a new sprite called "
 
173
"\"enemy_bullet.png\" which we'll add into the game later. <placeholder-1/> "
 
174
"Just drag your new sprite images into the shooter/data/media and tell it to "
 
175
"replace the images. Now when you run the game, you'll see your new sprites "
 
176
"at work. <placeholder-2/> Oops. As you can see, the background image I "
 
177
"created was for a game of different dimensions. It's for a game that's 400 "
 
178
"pixels wide by 500 pixels high. In the next section, we'll make the game "
 
179
"that size."
 
180
msgstr ""
 
181
 
 
182
#: data/templates/ubuntu-pygame/help/tutorial.xml:98(title)
 
183
msgid "Changing the Screen Dimensions"
 
184
msgstr ""
 
185
 
 
186
#: data/templates/ubuntu-pygame/help/tutorial.xml:99(para)
 
187
msgid ""
 
188
"The first change we'll make is to change the screen dimensions to be "
 
189
"oriented from top to bottom. We do this by changing a little code. So let's "
 
190
"fire up the code editor first. Run the edit command to fire up the editor."
 
191
msgstr ""
 
192
 
 
193
#: data/templates/ubuntu-pygame/help/tutorial.xml:102(programlisting)
 
194
#, no-wrap
 
195
msgid "$quickly edit"
 
196
msgstr ""
 
197
 
 
198
#: data/templates/ubuntu-pygame/help/tutorial.xml:104(programlisting)
 
199
#, no-wrap
 
200
msgid ""
 
201
"\n"
 
202
"#screen dimensions\n"
 
203
"screen_width = 400\n"
 
204
"screen_height = 500\n"
 
205
msgstr ""
 
206
 
 
207
#: data/templates/ubuntu-pygame/help/tutorial.xml:103(para)
 
208
msgid ""
 
209
"This command should open your code in Gedit. The screen dimensions are set "
 
210
"in the file \"shooterconfig.py\". So just go to that file and change the "
 
211
"width to 400 and the height to 500. <placeholder-1/> Save the file and run "
 
212
"the game again. Notice that the screen wrapping and centering and everything "
 
213
"was taken care of for you. That's because you made the change in the "
 
214
"shooterconfig.py file. This is the right place to add and change variables "
 
215
"that should be availble throughout the game. We'll be make a few more "
 
216
"changes here later."
 
217
msgstr ""
 
218
 
 
219
#: data/templates/ubuntu-pygame/help/tutorial.xml:114(title)
 
220
msgid "Programming the Guy"
 
221
msgstr ""
 
222
 
 
223
#: data/templates/ubuntu-pygame/help/tutorial.xml:115(para)
 
224
msgid ""
 
225
"For this game, what we want is the guy to move left and right across the "
 
226
"bottom and not wrap through the screen. Also, we want to make the bullets "
 
227
"look like they are coming out of the guy's front."
 
228
msgstr ""
 
229
 
 
230
#: data/templates/ubuntu-pygame/help/tutorial.xml:121(listitem)
 
231
msgid ""
 
232
"Place the guy at the beginning of each level at the middle and bottom of the "
 
233
"screen."
 
234
msgstr ""
 
235
 
 
236
#: data/templates/ubuntu-pygame/help/tutorial.xml:122(listitem)
 
237
msgid ""
 
238
"Add functions to guy.py for moving and stop movig right and left, and remove "
 
239
"the rotate functions."
 
240
msgstr ""
 
241
 
 
242
#: data/templates/ubuntu-pygame/help/tutorial.xml:123(listitem)
 
243
msgid ""
 
244
"Change the keyboard input in the bin/shooter file to call these new "
 
245
"functions."
 
246
msgstr ""
 
247
 
 
248
#: data/templates/ubuntu-pygame/help/tutorial.xml:118(para)
 
249
msgid "To make the guy move just left and right we need to: <placeholder-1/>"
 
250
msgstr ""
 
251
 
 
252
#: data/templates/ubuntu-pygame/help/tutorial.xml:128(programlisting)
 
253
#, no-wrap
 
254
msgid ""
 
255
"\n"
 
256
"     def init_position(self):\n"
 
257
"        \"\"\"init_position - resets the Guy's position near the\n"
 
258
"        bottom of the screen\n"
 
259
"        \n"
 
260
"        \"\"\"\n"
 
261
"        sw = shooterconfig.screen_width\n"
 
262
"        sh = shooterconfig.screen_height\n"
 
263
"\n"
 
264
"        self.x = sw/2\n"
 
265
"        self.y = sh - 80\n"
 
266
msgstr ""
 
267
 
 
268
#: data/templates/ubuntu-pygame/help/tutorial.xml:143(listitem)
 
269
msgid "start_moving_left: the user pressed the \"s\" key"
 
270
msgstr ""
 
271
 
 
272
#: data/templates/ubuntu-pygame/help/tutorial.xml:144(listitem)
 
273
msgid "stop_moving_left: the user released the \"s\" key"
 
274
msgstr ""
 
275
 
 
276
#: data/templates/ubuntu-pygame/help/tutorial.xml:145(listitem)
 
277
msgid "start_moving_right: the user pressed the \"f\" key"
 
278
msgstr ""
 
279
 
 
280
#: data/templates/ubuntu-pygame/help/tutorial.xml:146(listitem)
 
281
msgid "stop_moving_right: the user released the \"f\" key"
 
282
msgstr ""
 
283
 
 
284
#: data/templates/ubuntu-pygame/help/tutorial.xml:150(listitem)
 
285
msgid "Create two tracking variables, _moving_left and _moving_right"
 
286
msgstr ""
 
287
 
 
288
#: data/templates/ubuntu-pygame/help/tutorial.xml:151(listitem)
 
289
msgid ""
 
290
"Set these tracking variables to True or False in the "
 
291
"start/stop_moving_left/right functions"
 
292
msgstr ""
 
293
 
 
294
#: data/templates/ubuntu-pygame/help/tutorial.xml:152(listitem)
 
295
msgid ""
 
296
"In the guy's update function, change the x coordinates of the guy based on "
 
297
"these variables"
 
298
msgstr ""
 
299
 
 
300
#: data/templates/ubuntu-pygame/help/tutorial.xml:126(para)
 
301
msgid ""
 
302
"The functionaly that is specific to the player's sprite is in the guy.py "
 
303
"file. The first thing we will do is work on placing the guy properly. "
 
304
"Fortunately, the is an existing function that we can modify for this. The "
 
305
"function init_position is called to each time the guy needs to be placed on "
 
306
"the screen, like after he gets killed for instance . When created, the guy "
 
307
"calls the based class function center_on_screen. As you may guess, we will "
 
308
"want to change this function. so the guys is positionedhalfway down the "
 
309
"screen, and we want him to start a few pixels from the bottom. Fortunaately "
 
310
"we know how to get the screen dimensions, so it's easy make the change to "
 
311
"init_position. <placeholder-1/> Now when you run the game, the guy starts at "
 
312
"the bottom, which is what we want, but he also rotates when we use the s and "
 
313
"the d button, which we do not want. So let's change that next by "
 
314
"implementing four new functions: <placeholder-2/> Here's how we will "
 
315
"implement these functions: <placeholder-3/>"
 
316
msgstr ""
 
317
 
 
318
#: data/templates/ubuntu-pygame/help/tutorial.xml:158(programlisting)
 
319
#, no-wrap
 
320
msgid ""
 
321
"\n"
 
322
"        self._moving_left = False\n"
 
323
"        self._moving_right = False\n"
 
324
msgstr ""
 
325
 
 
326
#: data/templates/ubuntu-pygame/help/tutorial.xml:164(programlisting)
 
327
#, no-wrap
 
328
msgid ""
 
329
"\n"
 
330
"    def start_moving_right(self):\n"
 
331
"        self._moving_left = False\n"
 
332
"        self._moving_right = True\n"
 
333
"\n"
 
334
"    def start_moving_left(self):\n"
 
335
"        self._moving_left = True\n"
 
336
"        self._moving_right = False\n"
 
337
"\n"
 
338
"    def stop_moving_left(self):\n"
 
339
"        self._moving_left = False\n"
 
340
"\n"
 
341
"    def stop_moving_right(self):\n"
 
342
"        self._moving_right = False\n"
 
343
"\n"
 
344
msgstr ""
 
345
 
 
346
#: data/templates/ubuntu-pygame/help/tutorial.xml:156(para)
 
347
msgid ""
 
348
"First, add the tracking variables to the Guy.__init__function. Add these "
 
349
"after the call to BaseSprite.__init__(). <placeholder-1/> Now the functions "
 
350
"for responding to keys simply set those tracking variables as appropriate. "
 
351
"So we add these four new functions to guy.py. <placeholder-2/>"
 
352
msgstr ""
 
353
 
 
354
#: data/templates/ubuntu-pygame/help/tutorial.xml:181(para)
 
355
msgid ""
 
356
"Now we need change the guy's coordinates based on the tracking variable. "
 
357
"Every sprite has an update function. This function is called for every "
 
358
"\"tick\" in the game, and the sprite looks at it's internal data, and "
 
359
"updates itself appropriately. By default, the guy's rotation is handled by "
 
360
"BaseSprite, so we can ignore that, especially since we won't be using "
 
361
"rotation anyway. We're also not using acceleration for the guy, so we can "
 
362
"delete a bit of code. Funally, we don't want the guy to \"wrap\" though the "
 
363
"screen, so we whould catch that condition."
 
364
msgstr ""
 
365
 
 
366
#: data/templates/ubuntu-pygame/help/tutorial.xml:186(programlisting)
 
367
#, no-wrap
 
368
msgid ""
 
369
"\n"
 
370
"    def update(self):\n"
 
371
"        \"\"\"update - Update internal data for a game tick\"\"\" \n"
 
372
"    \n"
 
373
"        BaseSprite.update(self)\n"
 
374
"\n"
 
375
"        if self._moving_left:\n"
 
376
"            self.x -= 5\n"
 
377
"            if self.x &lt; 0:\n"
 
378
"                self.x = 0\n"
 
379
"        if self._moving_right:\n"
 
380
"            self.x += 5\n"
 
381
"            if self.x + self.rect.width &gt; shooterconfig.screen_width:\n"
 
382
"                self.x = shooterconfig.screen_width - self.rect.width\n"
 
383
msgstr ""
 
384
 
 
385
#: data/templates/ubuntu-pygame/help/tutorial.xml:184(para)
 
386
msgid ""
 
387
"Let's start with moving the guy 5 pixels per tick. So we can change the top "
 
388
"of the update function to look like this: <placeholder-1/>"
 
389
msgstr ""
 
390
 
 
391
#: data/templates/ubuntu-pygame/help/tutorial.xml:202(para)
 
392
msgid ""
 
393
"So the guy is ready. He starts in the right place, tracks whether he is "
 
394
"moving left or right, and updates his position as desired. Now we just need "
 
395
"to hook him up the keys."
 
396
msgstr ""
 
397
 
 
398
#: data/templates/ubuntu-pygame/help/tutorial.xml:205(para)
 
399
msgid ""
 
400
"Keyboard contol is handled in the shoort file in the bin directory. For each "
 
401
"click of the clock, the controller_tick function is called. Detecting "
 
402
"keyboard input and directing it as appropriate is handled in this funciton. "
 
403
"So what we wante to do is find where the f and s key events are handled, and "
 
404
"call the guy's start/stop_moving_left/right functions there."
 
405
msgstr ""
 
406
 
 
407
#: data/templates/ubuntu-pygame/help/tutorial.xml:211(listitem)
 
408
msgid "Call the start_moving functions instead of rotate functions."
 
409
msgstr ""
 
410
 
 
411
#: data/templates/ubuntu-pygame/help/tutorial.xml:212(listitem)
 
412
msgid "Remove the call to the accelerate function."
 
413
msgstr ""
 
414
 
 
415
#: data/templates/ubuntu-pygame/help/tutorial.xml:213(listitem)
 
416
msgid "Remve the call to the hyperspace function."
 
417
msgstr ""
 
418
 
 
419
#: data/templates/ubuntu-pygame/help/tutorial.xml:216(programlisting)
 
420
#, no-wrap
 
421
msgid ""
 
422
"\n"
 
423
"            #control the guy\n"
 
424
"            if not game.paused: \n"
 
425
"                if event.key == pygame.K_f:\n"
 
426
"                    g.start_moving_right()\n"
 
427
"                if event.key == pygame.K_s:\n"
 
428
"                    g.start_moving_left()\n"
 
429
"                if event.key == pygame.K_j:\n"
 
430
"                    g.shoot()\n"
 
431
"\n"
 
432
msgstr ""
 
433
 
 
434
#: data/templates/ubuntu-pygame/help/tutorial.xml:208(para)
 
435
msgid ""
 
436
"Key down events are handled first, in a section commented \"control\" the "
 
437
"guy. We want to make a few changes here. <placeholder-1/> These last two "
 
438
"functions aren't needed for our new game. So let's make the changes and this "
 
439
"part of the controller_tick function will change to this: <placeholder-2/>"
 
440
msgstr ""
 
441
 
 
442
#: data/templates/ubuntu-pygame/help/tutorial.xml:230(programlisting)
 
443
#, no-wrap
 
444
msgid ""
 
445
"\n"
 
446
"        #key up events, typically stop actions\n"
 
447
"        if event.type == pygame.KEYUP:\n"
 
448
"            if event.key == pygame.K_F11:\n"
 
449
"                pygame.display.toggle_fullscreen() \n"
 
450
"            if event.key == pygame.K_f:\n"
 
451
"                g.stop_moving_right()\n"
 
452
"            if event.key == pygame.K_s:\n"
 
453
"                g.stop_moving_left()\n"
 
454
"\n"
 
455
msgstr ""
 
456
 
 
457
#: data/templates/ubuntu-pygame/help/tutorial.xml:228(para)
 
458
msgid ""
 
459
"We'll handle the key up functions similarly. <placeholder-1/><placeholder-2/>"
 
460
msgstr ""
 
461
 
 
462
#: data/templates/ubuntu-pygame/help/tutorial.xml:248(listitem)
 
463
msgid ""
 
464
"The bullets accelerate and go way to fast, they'll miss enemies by skipping "
 
465
"over them."
 
466
msgstr ""
 
467
 
 
468
#: data/templates/ubuntu-pygame/help/tutorial.xml:249(listitem)
 
469
msgid ""
 
470
"The bullets should go to the top of the screen, and not stop before or wrap "
 
471
"around"
 
472
msgstr ""
 
473
 
 
474
#: data/templates/ubuntu-pygame/help/tutorial.xml:250(listitem)
 
475
msgid ""
 
476
"The bullets should appear to come out of the middle of the guy, instead of "
 
477
"the side."
 
478
msgstr ""
 
479
 
 
480
#: data/templates/ubuntu-pygame/help/tutorial.xml:253(programlisting)
 
481
#, no-wrap
 
482
msgid ""
 
483
"\n"
 
484
"        self.max_velocity = 20\n"
 
485
"        self.max_ticks = 20\n"
 
486
msgstr ""
 
487
 
 
488
#: data/templates/ubuntu-pygame/help/tutorial.xml:258(programlisting)
 
489
#, no-wrap
 
490
msgid ""
 
491
"\n"
 
492
"    def update(self):\n"
 
493
"        \"\"\"update - update internal data and position.\n"
 
494
"        Typically called by the game controller each game\n"
 
495
"        tick.\n"
 
496
"\n"
 
497
"        \"\"\"\n"
 
498
"\n"
 
499
"        BaseSprite.update(self)\n"
 
500
"\n"
 
501
"        if self.y &lt; 1:\n"
 
502
"            self.kill()\n"
 
503
"        if self.y == shooterconfig.screen_height:\n"
 
504
"            self.kill()\n"
 
505
msgstr ""
 
506
 
 
507
#: data/templates/ubuntu-pygame/help/tutorial.xml:282(programlisting)
 
508
#, no-wrap
 
509
msgid ""
 
510
"\n"
 
511
"    def shoot(self):\n"
 
512
"        \"\"\"shoot - fire a bullet. Adds the bullet to the bullet sprite "
 
513
"group.\n"
 
514
"        If the maximum number of bullets premitted would be exceeded, \n"
 
515
"        the bullet will not fire. If the guy is exploding, the guy will no\n"
 
516
"        fire.\n"
 
517
"\n"
 
518
"        \"\"\"\n"
 
519
"\n"
 
520
"        if self.alive:\n"
 
521
"            #only allow max numbe of  bullets on the screen at a time\n"
 
522
"            if len(self.bullets.sprites()) &lt; self.max_bullets:\n"
 
523
"                center_x = (self.x + self.rect.width / 2) - 3\n"
 
524
"                b = Bullet(center_x,self.y,self.orientation)\n"
 
525
"                self.bullets.add(b)\n"
 
526
msgstr ""
 
527
 
 
528
#: data/templates/ubuntu-pygame/help/tutorial.xml:245(para)
 
529
msgid ""
 
530
"Now we've got the guy working the way we want, but we need to make a few "
 
531
"changes to to how the guy's bullets are working: <placeholder-1/> We'll "
 
532
"handle the first problem my changing the Bullet class in the bullet.py file. "
 
533
"The acceleration and speed of bullets in the game is configured in the "
 
534
"__init__ function of this file. The rate at whcih a bullet accelerates is "
 
535
"controlled by member variable acceleration_divisor. We won't need to change "
 
536
"that. However, the maximum speed a bullet will reach is defined ny "
 
537
"max_velocity, and the lifetme of the bullet is defined by max_ticks. Let's "
 
538
"make the bullets go slower, but last longer, by changing max_velocity to 20, "
 
539
"and max_ticks to 20 in the Bullet __init__ funciton. <placeholder-2/> This "
 
540
"simple change is all that is necessary to control the bullets throughout the "
 
541
"game. Note that making this change in the Bullet class means all bullets in "
 
542
"the game, including enemy bullets, will now work this way. So let's quickly "
 
543
"deal with stopping bullets from wrapping as well. We'll add to the Bullet "
 
544
"class's update function to see if the bullet is above or below the screen, "
 
545
"and if so, we'll remove it. So we'll change the to of the update function in "
 
546
"bullet.py to look like this: <placeholder-3/> Note that a Sprite's kill "
 
547
"function, removes it from the game immediately, and with no fanfare. "
 
548
"Finally, we need to adjust the bullet so it comes out from the guys the way "
 
549
"we want it to. Since this is only related to the way the guy shoots bullets "
 
550
"and won't have anything to do with enemy bullets, we'll configure how "
 
551
"bullets emerge in the guy.py file. Let's just tweak the shoot function a "
 
552
"bit. As you can see in this function, when you create a bullet, you provide "
 
553
"it x and y coordinates. We'll just calculate at better x coordinate to "
 
554
"start. We'll find the middle of the width of the guy's image, and offset it "
 
555
"a bit so the bullet sprite looks like it comes out correctly. "
 
556
"<progamlisting> center_x = (self.x + self.rect.width / 2) - 3 "
 
557
"</progamlisting> So we change change the ugy's shoot funciton to look like "
 
558
"this: <placeholder-4/>"
 
559
msgstr ""
 
560
 
 
561
#: data/templates/ubuntu-pygame/help/tutorial.xml:299(para)
 
562
msgid ""
 
563
"<placeholder-1/> Now we have the guy working as desired. Moves back and "
 
564
"forth across the bottom and shoots bullets the way we want. Next we'll go on "
 
565
"to changing the way the enemies work."
 
566
msgstr ""
 
567
 
 
568
#: data/templates/ubuntu-pygame/help/tutorial.xml:308(title)
 
569
msgid "Programming Enemies"
 
570
msgstr ""
 
571
 
 
572
#: data/templates/ubuntu-pygame/help/tutorial.xml:309(para)
 
573
msgid ""
 
574
"The generated game always adds two enemies for each level, a homing missle "
 
575
"and a stock \"enemy\". The homing missle does pretty much what's it name "
 
576
"suggests, homes in on the guy and kills him. The Enemy doesn't do much of "
 
577
"anything. Just kind of plunks down and waits to get killed. First we're "
 
578
"going to remove the homing missle from the game, and then we'll customize "
 
579
"the enemies to be a bit more menancing."
 
580
msgstr ""
 
581
 
 
582
#: data/templates/ubuntu-pygame/help/tutorial.xml:314(programlisting)
 
583
#, no-wrap
 
584
msgid ""
 
585
"\n"
 
586
"    #TODO: set up enemies here\n"
 
587
"    #You can add more enemies or use different enemies\n"
 
588
"    #depening on the level\n"
 
589
"    for i in xrange(0,game.level + 3):\n"
 
590
"        enemies.add(Enemy())\n"
 
591
msgstr ""
 
592
 
 
593
#: data/templates/ubuntu-pygame/help/tutorial.xml:312(para)
 
594
msgid ""
 
595
"The bin/shooter fileset up a SpriteGroup already. It's called \"enemies\" "
 
596
"and gets populated each time a new level is created. New levels are created "
 
597
"in the next_level function in the bin/shooter file. The next_level function "
 
598
"is pretty simple, it increments the game level bu 1, removes any remaining "
 
599
"emenemities for the SpriteGroup and then repulates the enemies SpriteGroup. "
 
600
"Let's make a couple of basic chagnnges here. First, we'll change the xrange "
 
601
"so that it creates more enemies with each level, and second, we'll just "
 
602
"delete the line that creates the homing missle. Change the next_level "
 
603
"function to make the last few lines as below. <placeholder-1/> So for the "
 
604
"first level, there will by for enemies, and each time there is an new level "
 
605
"created the number of enemies will increase by 1. Aslo, no more homing "
 
606
"missles. <placeholder-2/>"
 
607
msgstr ""
 
608
 
 
609
#: data/templates/ubuntu-pygame/help/tutorial.xml:326(para)
 
610
msgid ""
 
611
"However, there are two things we need to do to enhance the game play with "
 
612
"our enemies. First, as you can see, they can start quite close to the guy, "
 
613
"even under. We'll need to fix that. Also, we should put them in motion so "
 
614
"they are a bit more of a challenge to shoot. We'll do both of the things by "
 
615
"modifying the Enemy class in the enemy.py file. Specifically in the "
 
616
"init_postion function."
 
617
msgstr ""
 
618
 
 
619
#: data/templates/ubuntu-pygame/help/tutorial.xml:329(para)
 
620
msgid ""
 
621
"If you open the enemy.py file and look for the init_position function, "
 
622
"you'll see there is a call to the function in __init__ but there is no "
 
623
"function for it. That's because enemy inherits from BaseSprite, which has a "
 
624
"default init_position implementation that randomly places it on the screen. "
 
625
"So we'll simply override the init_position function in the Enemy class in "
 
626
"enemy.py."
 
627
msgstr ""
 
628
 
 
629
#: data/templates/ubuntu-pygame/help/tutorial.xml:334(programlisting)
 
630
#, no-wrap
 
631
msgid ""
 
632
"\n"
 
633
"        sh = shooterconfig.screen_height\n"
 
634
"        sw = shooterconfig.screen_width\n"
 
635
msgstr ""
 
636
 
 
637
#: data/templates/ubuntu-pygame/help/tutorial.xml:339(programlisting)
 
638
#, no-wrap
 
639
msgid ""
 
640
"\n"
 
641
"import random\n"
 
642
msgstr ""
 
643
 
 
644
#: data/templates/ubuntu-pygame/help/tutorial.xml:343(programlisting)
 
645
#, no-wrap
 
646
msgid ""
 
647
"\n"
 
648
"        self.x = random.randint(20,sw - self.rect.width - 20)\n"
 
649
"        self.y = random.randint(20,sh/2)\n"
 
650
msgstr ""
 
651
 
 
652
#: data/templates/ubuntu-pygame/help/tutorial.xml:348(programlisting)
 
653
#, no-wrap
 
654
msgid ""
 
655
"\n"
 
656
"        self.velocity_x = random.randint(-30,30)\n"
 
657
msgstr ""
 
658
 
 
659
#: data/templates/ubuntu-pygame/help/tutorial.xml:352(programlisting)
 
660
#, no-wrap
 
661
msgid ""
 
662
"\n"
 
663
"    def init_position(self):\n"
 
664
"        sh = shooterconfig.screen_height\n"
 
665
"        sw = shooterconfig.screen_width\n"
 
666
"\n"
 
667
"        self.x = random.randint(20,sw - self.rect.width - 20)\n"
 
668
"        self.y = random.randint(20,sh/2)\n"
 
669
"        self.velocity_x = random.randint(-30,30)\n"
 
670
msgstr ""
 
671
 
 
672
#: data/templates/ubuntu-pygame/help/tutorial.xml:332(para)
 
673
msgid ""
 
674
"First, to make it a bitter easier to code, grab a reference to the screen "
 
675
"height and widgth that you configured and keep those in easier to use "
 
676
"variables. <placeholder-1/> Next, we want to choose random start position "
 
677
"along the X axis. But we don't want the enemy to start too close to either "
 
678
"side or it might get stuck in a spot where the guy can't shoot it. To "
 
679
"generate random integers, use the randome module, so you'll have to add an "
 
680
"import to the top of the file. <placeholder-2/> We can use the screenwidth "
 
681
"to and the enemies own width to determine the right most starting position. "
 
682
"For the Y axis, we want the enemies to be far enough away that they can't "
 
683
"too easily kill the guy. We'll also make sure they don't get out of reach of "
 
684
"the guy's bullets. So between 20 and half way down seems about right. "
 
685
"<placeholder-3/> Finally, let's put each enemy in motion by picking a random "
 
686
"velocity_x within some reasonable bounds. <placeholder-4/> Notice that one "
 
687
"in 60 of the enemies won't be moving. That's okay because we added padding "
 
688
"to keep the enemies from ending up too close to the sides. The full "
 
689
"init_position function you need to add looks like this: <placeholder-5/> "
 
690
"When you run the game, you can see that the enemies are moving and are good "
 
691
"targets to shoot at. But next we'll make the enemies fight back."
 
692
msgstr ""
 
693
 
 
694
#: data/templates/ubuntu-pygame/help/tutorial.xml:366(listitem)
 
695
msgid "Figure out where to place the bullet on the screen"
 
696
msgstr ""
 
697
 
 
698
#: data/templates/ubuntu-pygame/help/tutorial.xml:367(listitem)
 
699
msgid "Configure the bullet's velocity and maximum speed"
 
700
msgstr ""
 
701
 
 
702
#: data/templates/ubuntu-pygame/help/tutorial.xml:368(listitem)
 
703
msgid "Create the bullet object and add it to a SpriteGroup"
 
704
msgstr ""
 
705
 
 
706
#: data/templates/ubuntu-pygame/help/tutorial.xml:371(programlisting)
 
707
#, no-wrap
 
708
msgid ""
 
709
"\n"
 
710
"#create the player's guy and some enemies\n"
 
711
"bullets = pygame.sprite.RenderUpdates()\n"
 
712
"g = Guy(bullets)\n"
 
713
"enemies = pygame.sprite.RenderUpdates()\n"
 
714
"enemy_bullets = pygame.sprite.RenderUpdates()\n"
 
715
msgstr ""
 
716
 
 
717
#: data/templates/ubuntu-pygame/help/tutorial.xml:380(listitem)
 
718
msgid ""
 
719
"Clear out all the sprites in the group when creating a new level or "
 
720
"resetting a level after the guy dies."
 
721
msgstr ""
 
722
 
 
723
#: data/templates/ubuntu-pygame/help/tutorial.xml:381(listitem)
 
724
msgid ""
 
725
"Tell the bullets in the sprite group to update themselves at the right time."
 
726
msgstr ""
 
727
 
 
728
#: data/templates/ubuntu-pygame/help/tutorial.xml:382(listitem)
 
729
msgid "Tell the bullets to draw themselves at the right time."
 
730
msgstr ""
 
731
 
 
732
#: data/templates/ubuntu-pygame/help/tutorial.xml:383(listitem)
 
733
msgid ""
 
734
"Pass a reference to the sprite group to each enemy that is created, so it "
 
735
"can add it's bullets to the group."
 
736
msgstr ""
 
737
 
 
738
#: data/templates/ubuntu-pygame/help/tutorial.xml:386(programlisting)
 
739
#, no-wrap
 
740
msgid ""
 
741
"\n"
 
742
"    enemies.empty()\n"
 
743
msgstr ""
 
744
 
 
745
#: data/templates/ubuntu-pygame/help/tutorial.xml:390(programlisting)
 
746
#, no-wrap
 
747
msgid ""
 
748
"\n"
 
749
"def update_sprites():\n"
 
750
"    \"\"\"update_sprites - call update() for all sprites\"\"\"\n"
 
751
"    g.update()\n"
 
752
"    bullets.update()\n"
 
753
"    enemies.update() \n"
 
754
"    enemy_bullets.update()\n"
 
755
msgstr ""
 
756
 
 
757
#: data/templates/ubuntu-pygame/help/tutorial.xml:399(programlisting)
 
758
#, no-wrap
 
759
msgid ""
 
760
"\n"
 
761
"    #draw enemies\n"
 
762
"    enemies.draw(screen)\n"
 
763
"    enemy_bullets.draw(screen)\n"
 
764
msgstr ""
 
765
 
 
766
#: data/templates/ubuntu-pygame/help/tutorial.xml:405(programlisting)
 
767
#, no-wrap
 
768
msgid ""
 
769
"\n"
 
770
"    def __init__(self,enemy_bullets):\n"
 
771
"        \"\"\"Creates an Enemy \"\"\"\n"
 
772
"        self.enemy_bullets = enemy_bullets\n"
 
773
"\n"
 
774
msgstr ""
 
775
 
 
776
#: data/templates/ubuntu-pygame/help/tutorial.xml:412(programlisting)
 
777
#, no-wrap
 
778
msgid ""
 
779
"\n"
 
780
"        enemies.add(Enemy(enemy_bullets))\n"
 
781
msgstr ""
 
782
 
 
783
#: data/templates/ubuntu-pygame/help/tutorial.xml:416(programlisting)
 
784
#, no-wrap
 
785
msgid ""
 
786
"\n"
 
787
"from bullet import Bullet\n"
 
788
msgstr ""
 
789
 
 
790
#: data/templates/ubuntu-pygame/help/tutorial.xml:421(programlisting)
 
791
#, no-wrap
 
792
msgid ""
 
793
"\n"
 
794
"    def shoot(self):\n"
 
795
"        if self.alive:\n"
 
796
"            b = Bullet(self.x,self.y, 180)\n"
 
797
"            b.max_velocity = 6\n"
 
798
"            b.max_ticks = 50\n"
 
799
"            self.enemy_bullets.add(b)\n"
 
800
msgstr ""
 
801
 
 
802
#: data/templates/ubuntu-pygame/help/tutorial.xml:431(programlisting)
 
803
#, no-wrap
 
804
msgid ""
 
805
"\n"
 
806
"    if not game.paused:\n"
 
807
"        for e in enemies:\n"
 
808
"            if random.randint(0,20) == 1:\n"
 
809
"                e.shoot()\n"
 
810
msgstr ""
 
811
 
 
812
#: data/templates/ubuntu-pygame/help/tutorial.xml:441(programlisting)
 
813
#, no-wrap
 
814
msgid ""
 
815
"\n"
 
816
"enemy_bullet_image = image_path + \"enemy_bullet.png\"\n"
 
817
msgstr ""
 
818
 
 
819
#: data/templates/ubuntu-pygame/help/tutorial.xml:445(programlisting)
 
820
#, no-wrap
 
821
msgid ""
 
822
"\n"
 
823
"    def shoot(self):\n"
 
824
"        if self.alive:\n"
 
825
"            img = shooterconfig.enemy_bullet_image\n"
 
826
"            b = Bullet(self.x,self.y, 180, img)\n"
 
827
"            b.max_velocity = 6\n"
 
828
"            b.max_ticks = 50\n"
 
829
"            self.enemy_bullets.add(b)\n"
 
830
msgstr ""
 
831
 
 
832
#: data/templates/ubuntu-pygame/help/tutorial.xml:363(para)
 
833
msgid ""
 
834
"Let's add the ability for an enemy to drop a bomb. By default, enemies can't "
 
835
"do anything like that, so we'll have to add a new function. The function "
 
836
"will need to do the following things: <placeholder-1/> We should probably "
 
837
"start with this last part. We'll want to create a special sprite group for "
 
838
"the bullets to go into. This is primarily so that we can use the "
 
839
"SpriteGroups collision detection capabilities later. Also it's easier to "
 
840
"manage updates of sprites when they are in a group. First things first, "
 
841
"we'll create the sprite group. There's a place in the bin/shooter for "
 
842
"setting up enemies and such, so create another sprite group there. You "
 
843
"create a sprite group by calling a function in the pygame.sprite module "
 
844
"called \"RenderUpdates\". Lookk for the code block below, and notice the new "
 
845
"line creating the new sprite group by calling RenderUpdates. <placeholder-"
 
846
"2/> Now that we have the sprite group called enemy_bullets we want to do "
 
847
"three more things with it for now. <placeholder-3/> So for the first part, "
 
848
"we'll call the sprite group's empty function in next_level and reset_level "
 
849
"This function simply removes each sprite in the sprite group from game play. "
 
850
"Do this as the first thing for each of these function. <placeholder-4/> For "
 
851
"the second point, we'll add to the function in bin/shooter called "
 
852
"update_sprites. As you may have guessed, this function is called each tick "
 
853
"and tells each sprite to update. For sprites in a sprite group, this is "
 
854
"easy, because the SpriteGroup class includes an update function that calls "
 
855
"update for each of it's sprites. So just add that to the end of the "
 
856
"update_sprites function in bin/shooter, so it looks like the listing here: "
 
857
"<placeholder-5/> The view_tick function is called once per tick as well. "
 
858
"This funciton updates the view on the screen. We'll add a line of code to "
 
859
"tell the bullets to draw themselves right under where the enemies draw "
 
860
"themselves. <placeholder-6/> Finally, we need to pass a reference to each "
 
861
"enemy as it is created and create a member variable to store that reference. "
 
862
"So we need to make a change in the enemy.py fil, to add an argument for the "
 
863
"SpriteGroup in the __init__ function, and also we need to pass the "
 
864
"SpriteGroup when creating enemies. So change the Enemy class in enemy.py so "
 
865
"the top of the __init__ function looks like so: <placeholder-7/> And then "
 
866
"back in the bin/shooter file in the next_level function when creating "
 
867
"enemies, pass in enemy_bullets. <placeholder-8/> Now we have a functioning "
 
868
"sprite group and the enemies have a reference to it, we are ready to start "
 
869
"actually adding some bullets to it. We'll do this by adding a member "
 
870
"function called \"shoot\" to the enemy. Don't forget to import the Bullet "
 
871
"class into the enemy.py file. <placeholder-9/> First thing is we'll check "
 
872
"that the enemy is alive. We don't have to do this, but for this game, we "
 
873
"don't want it to shoot if it's int the process of exploding. Then we'll just "
 
874
"create a bullet and add it to the SpriteGroup. The last argument we'll pass "
 
875
"in is to set the orientatin to 180. Orientation goes clockwise for 360 "
 
876
"degrees, with zero being directly up, and 180 being directly down. In code, "
 
877
"it looks like the listing below. <placeholder-10/> So now we just need to "
 
878
"tell the enemies to shoot. We'll do this back in the bin/shooter file, in "
 
879
"the\"controller_tick function. After the section where we respond to "
 
880
"keyboard input, we'll add a few lines to make the enemies shoot. First, "
 
881
"we'll make sure the game is not paused, not very fair to shoot in a paused "
 
882
"game, is it? Next we'll loop through the enemies and desider if we should "
 
883
"call shoot. using our friend random.randint, we'll do this say, one time "
 
884
"twenty. So if you add this code to the end of the controller_tick function, "
 
885
"your enemies will start dropping bombs. <placeholder-11/><placeholder-12/> "
 
886
"So if you run the game, you'll see that the enemies are dropping bulltes "
 
887
"like bombs. Nice. However, maybe it would be nicer if the sprites for the "
 
888
"enemy bullets were different than the sprites for the guy's bullets. "
 
889
"Remember at the beginning of the tutorial we added an image called "
 
890
"enemy_bullet.png to the data/media directory. Now we'll write a bit of code "
 
891
"to use that image. First thing, we should add a reference to it in the "
 
892
"shooterconfig.py file. In this way, the Enemy class will be able to find it. "
 
893
"Just add the following line along with the other image path setting code in "
 
894
"shooterconfig.py. <placeholder-13/> So now we need to tell the bullets in "
 
895
"the Enemy class to use that image. Fortunately the Bullet class takes an "
 
896
"optional parameter for the name of an image to use. So just modify the shoot "
 
897
"function in the Enemy class to include the path. <placeholder-14/> Now the "
 
898
"enemies are dropping bombs with our new image. <placeholder-15/>"
 
899
msgstr ""
 
900
 
 
901
#: data/templates/ubuntu-pygame/help/tutorial.xml:459(para)
 
902
msgid ""
 
903
"But of course, you many notice the bombs aren't too menancing. In the next "
 
904
"chapter we'll add collision detection to make the bombs kill the guy."
 
905
msgstr ""
 
906
 
 
907
#: data/templates/ubuntu-pygame/help/tutorial.xml:464(title)
 
908
msgid "Collision Detection"
 
909
msgstr ""
 
910
 
 
911
#: data/templates/ubuntu-pygame/help/tutorial.xml:465(para)
 
912
msgid ""
 
913
"Collision detection is when you check for sprites that are overlapping, and "
 
914
"run code based on what happened. PyGame makes this very easy by providing "
 
915
"some functions to check for overlapping sprites for you. As you will see, it "
 
916
"works for individual sprites as well as sprite groups."
 
917
msgstr ""
 
918
 
 
919
#: data/templates/ubuntu-pygame/help/tutorial.xml:470(programlisting)
 
920
#, no-wrap
 
921
msgid ""
 
922
"\n"
 
923
"        b = pygame.sprite.spritecollideany(g, enemy_bullets)\n"
 
924
"        if b != None:\n"
 
925
"            g.explode()\n"
 
926
"            b.kill()\n"
 
927
msgstr ""
 
928
 
 
929
#: data/templates/ubuntu-pygame/help/tutorial.xml:481(programlisting)
 
930
#, no-wrap
 
931
msgid ""
 
932
"\n"
 
933
"    hits_dict = pygame.sprite.groupcollide(bullets, enemy_bullets, True, "
 
934
"False)\n"
 
935
msgstr ""
 
936
 
 
937
#: data/templates/ubuntu-pygame/help/tutorial.xml:468(para)
 
938
msgid ""
 
939
"Ok, so let's start by making the bombs that the enemies drop actually kill "
 
940
"the guy. To do this, we want to check if the bombs ever collide with the "
 
941
"guy, and if they do, we'll tell the guy to explode, and then we'll remove "
 
942
"the bomb from the screen. So the logic is \"tell me if the guy collides with "
 
943
"any enemy_bullets\". There is a funciton for this called, "
 
944
"pygame.sprite.spritecollideany, which takes a single sprite and a sprite "
 
945
"group and returns a reference to any sprite in the sprite group that "
 
946
"collided with the single sprite. If there were no collisions, than e will be "
 
947
"None. Otherwise, we'll want to tell the guy to explode and tell the bullet "
 
948
"to just \"kill\", which will remove it from play. So we can call it like "
 
949
"this: <placeholder-1/> There is a function in bin/shooter called "
 
950
"check_collisions which is called once per tick, and is the perfect place to "
 
951
"add this code. Add it right under the similar test for the guy colliding "
 
952
"with enemies. Now those bombs can kill the guys. <placeholder-2/> If you "
 
953
"play for a bit, you may notice that the bullets and the bombs just kind of "
 
954
"pass by each other. We can ramp up the game play by making the enemy bullets "
 
955
"destroy the guy's bullets, but not visa versa. So that logic here is, have "
 
956
"any of the sprites in the bullets sprite group collided with the bullets in "
 
957
"the enemy bullets sprite group. There is function for this as well, "
 
958
"pygame.sprite.groupcollide. groupcollide takes two sprite lists and returns "
 
959
"a dictionary. The keys in the dictionary are any sprites from the first "
 
960
"group that are involved in a collision, and the values are the sprites from "
 
961
"the second group that collided with the sprite that for key. It's a bit hard "
 
962
"to explain, but I bet the code is pretty readable. Add this line to the "
 
963
"check_collisions function. <placeholder-3/> Now if you run the game, it's a "
 
964
"bit more challenging as the enemies are a bit more offensive. This code just "
 
965
"kills the bullets involed in any collisions. Notice that I passed in True "
 
966
"False at the end of this function. These paramaters determine whether to "
 
967
"kill sprites form either group involved in the collusion. The True tells the "
 
968
"function to kill any bullets involved in collisions, so this was simple to "
 
969
"code."
 
970
msgstr ""
 
971
 
 
972
#: data/templates/ubuntu-pygame/help/tutorial.xml:488(title)
 
973
msgid "Playing Sounds"
 
974
msgstr ""
 
975
 
 
976
#: data/templates/ubuntu-pygame/help/tutorial.xml:491(programlisting)
 
977
#, no-wrap
 
978
msgid ""
 
979
"\n"
 
980
"tink_sound = sound_path + \"tink.wav\" \n"
 
981
" "
 
982
msgstr ""
 
983
 
 
984
#: data/templates/ubuntu-pygame/help/tutorial.xml:495(programlisting)
 
985
#, no-wrap
 
986
msgid ""
 
987
"\n"
 
988
"#set up some objects and models\n"
 
989
"tink_sound = pygame.mixer.Sound(shooter.shooterconfig.tink_sound) \n"
 
990
" "
 
991
msgstr ""
 
992
 
 
993
#: data/templates/ubuntu-pygame/help/tutorial.xml:500(programlisting)
 
994
#, no-wrap
 
995
msgid ""
 
996
"\n"
 
997
"    hits_dict = pygame.sprite.groupcollide(bullets, enemy_bullets, True, "
 
998
"False)\n"
 
999
"    if len(hits_dict) &gt; 0:\n"
 
1000
"        tink_sound.play() \n"
 
1001
" "
 
1002
msgstr ""
 
1003
 
 
1004
#: data/templates/ubuntu-pygame/help/tutorial.xml:506(programlisting)
 
1005
#, no-wrap
 
1006
msgid ""
 
1007
"\n"
 
1008
"        self.launch_sound = "
 
1009
"pygame.mixer.Sound(shooterconfig.guy_shoot_sound)\n"
 
1010
"        self.launch_sound.set_volume(.2)\n"
 
1011
"        self.launch_sound.play() \n"
 
1012
" "
 
1013
msgstr ""
 
1014
 
 
1015
#: data/templates/ubuntu-pygame/help/tutorial.xml:489(para)
 
1016
msgid ""
 
1017
"The game is pretty much done in terms of game play, but I want to make one "
 
1018
"small enhancement. When the enemy bullets kill one of the guy's bullets, I'd "
 
1019
"like to play a little sound to signify this. So first, I added a little "
 
1020
"\"tink\" sound to the data/media directory. After you add your sound, you "
 
1021
"need to add a reference to it in the shootercongif.py file. <placeholder-1/> "
 
1022
"Now, I want to add a little code after the collision detection between the "
 
1023
"bullets to play that sound if they collided. I can't just hop straight to "
 
1024
"that though, first I have to create a sound object.In pygame you manage "
 
1025
"sounds with the \"mixer\" module. I don't want to create this object over "
 
1026
"and over again. So I'll add it to the bin/shooter file where the other "
 
1027
"objects and such for the game are set up. <placeholder-2/> Now that I've "
 
1028
"told the mixer module to give me a sound, I can go ahead and check if there "
 
1029
"were any collisions between bullets, and play my sound. <placeholder-3/> So "
 
1030
"it seems to be working well, but what if you are finding that one of the "
 
1031
"sounds is too quiet or too loud? Or perhpas you want a certain sound to be "
 
1032
"loud sometimes and queit other times, for example to simulate distance. This "
 
1033
"is easy to do because each sound object has a set_volume function that you "
 
1034
"can use to set the sound between 0 (for slient) and 1 (for normal volume). "
 
1035
"The bullet launch sound I used was a bit loud, so in the bullet.py file, "
 
1036
"I'll adjust the Bullet class to play the sound a bit more quietly. "
 
1037
"<placeholder-4/>"
 
1038
msgstr ""
 
1039
 
 
1040
#: data/templates/ubuntu-pygame/help/tutorial.xml:514(title)
 
1041
msgid "Conclusion"
 
1042
msgstr ""
 
1043
 
 
1044
#: data/templates/ubuntu-pygame/help/tutorial.xml:518(listitem)
 
1045
msgid "Creating a game using $quickly create ubuntu-pygame"
 
1046
msgstr ""
 
1047
 
 
1048
#: data/templates/ubuntu-pygame/help/tutorial.xml:519(listitem)
 
1049
msgid "Adding your own sprites to the game"
 
1050
msgstr ""
 
1051
 
 
1052
#: data/templates/ubuntu-pygame/help/tutorial.xml:520(listitem)
 
1053
msgid "Setting the screen size and other info in the config file"
 
1054
msgstr ""
 
1055
 
 
1056
#: data/templates/ubuntu-pygame/help/tutorial.xml:521(listitem)
 
1057
msgid "Programming a player's guy to respond to keyboard input and to shoot"
 
1058
msgstr ""
 
1059
 
 
1060
#: data/templates/ubuntu-pygame/help/tutorial.xml:522(listitem)
 
1061
msgid "Programming enemies to move and shoot"
 
1062
msgstr ""
 
1063
 
 
1064
#: data/templates/ubuntu-pygame/help/tutorial.xml:523(listitem)
 
1065
msgid "Using collision detection to blow up Sprites"
 
1066
msgstr ""
 
1067
 
 
1068
#: data/templates/ubuntu-pygame/help/tutorial.xml:524(listitem)
 
1069
msgid "Playing and adjusting sounds"
 
1070
msgstr ""
 
1071
 
 
1072
#: data/templates/ubuntu-pygame/help/tutorial.xml:528(listitem)
 
1073
msgid ""
 
1074
"The bullets that the guy shoots and the bombs that the enemies drop make the "
 
1075
"same sound, it would probably be nicer if they each made a different sounds."
 
1076
msgstr ""
 
1077
 
 
1078
#: data/templates/ubuntu-pygame/help/tutorial.xml:529(listitem)
 
1079
msgid ""
 
1080
"The default explosions are crayon drawings, they don't fit in much with the "
 
1081
"look of the game. Perhaps some new images for the explosion stages would be "
 
1082
"good."
 
1083
msgstr ""
 
1084
 
 
1085
#: data/templates/ubuntu-pygame/help/tutorial.xml:530(listitem)
 
1086
msgid ""
 
1087
"There are no power ups! You could create power up classes the derive from "
 
1088
"BaseSprite to give the guy extra powers, like bigger bullets, more bullets, "
 
1089
"or extra lives."
 
1090
msgstr ""
 
1091
 
 
1092
#: data/templates/ubuntu-pygame/help/tutorial.xml:531(listitem)
 
1093
msgid ""
 
1094
"More special enemies, for example you could use the HomingMissle class to "
 
1095
"create harder to kill enemies."
 
1096
msgstr ""
 
1097
 
 
1098
#: data/templates/ubuntu-pygame/help/tutorial.xml:532(listitem)
 
1099
msgid ""
 
1100
"There is no high scores list. You could use desktopcouch to store high "
 
1101
"scores and use the code in view_tick to see how to present the scores."
 
1102
msgstr ""
 
1103
 
 
1104
#: data/templates/ubuntu-pygame/help/tutorial.xml:515(para)
 
1105
msgid ""
 
1106
"So now you have a working game! This tutorial introduced the following key "
 
1107
"concepts for using the Quickly PyGame Template. <placeholder-1/> But there "
 
1108
"is still a lot to do to have a propper game. For example: <placeholder-2/>"
2364
1109
msgstr ""
2365
1110
 
2366
1111
#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2
2367
 
#: data/templates/ubuntu-application/help/tutorial.xml:0(None)
 
1112
#: data/templates/ubuntu-pygame/help/tutorial.xml:0(None)
2368
1113
msgid "translator-credits"
2369
1114
msgstr ""
2370
1115
"Launchpad Contributions:\n"
2371
1116
"  Didier Roche https://launchpad.net/~didrocks\n"
2372
1117
"  Jan-Christoph Borchardt https://launchpad.net/~jancborchardt\n"
2373
1118
"  lineak https://launchpad.net/~lineak"
 
1119
 
 
1120
#~ msgid "Fagan"
 
1121
#~ msgstr "Fagan"
 
1122
 
 
1123
#~ msgid "Shane"
 
1124
#~ msgstr "Shane"
 
1125
 
 
1126
#~ msgid "0.4"
 
1127
#~ msgstr "0.4"
 
1128
 
 
1129
#~ msgid "Quickly"
 
1130
#~ msgstr "Quickly"
 
1131
 
 
1132
#~ msgid "Getting Started"
 
1133
#~ msgstr "Erste Schritte"
 
1134
 
 
1135
#~ msgid "<application>Quickly</application> 0.4 User Guide"
 
1136
#~ msgstr "<application>Quickly</application> 0.4 Anleitung"
 
1137
 
 
1138
#, no-wrap
 
1139
#~ msgid "quickly create ubuntu-application jotty"
 
1140
#~ msgstr "quickly create ubuntu-application jotty"
 
1141
 
 
1142
#~ msgid "Running the Application"
 
1143
#~ msgstr "Die Anwendung ausführen"
 
1144
 
 
1145
#~ msgid "Creating a <application>Quickly</application> Project"
 
1146
#~ msgstr "Ein <application>Quickly</application>-Projekt erstellen"
 
1147
 
 
1148
#~ msgid "Testing the Empty Application"
 
1149
#~ msgstr "Die leere Anwendung testen"
 
1150
 
 
1151
#~ msgid "Edit the User Interface in Glade"
 
1152
#~ msgstr "Die Oberfläche in Glade bearbeiten"
 
1153
 
 
1154
#, no-wrap
 
1155
#~ msgid ""
 
1156
#~ "\n"
 
1157
#~ "cd jotty\n"
 
1158
#~ "quickly run\n"
 
1159
#~ msgstr ""
 
1160
#~ "\n"
 
1161
#~ "cd jotty\n"
 
1162
#~ "quickly run\n"
 
1163
 
 
1164
#~ msgid "Editing an Application"
 
1165
#~ msgstr "Eine Anwendung bearbeiten"
 
1166
 
 
1167
#, no-wrap
 
1168
#~ msgid "quickly design"
 
1169
#~ msgstr "quickly design"
 
1170
 
 
1171
#~ msgid "Edit the Code in Gedit"
 
1172
#~ msgstr "Den Quelltext in Gedit bearbeiten"
 
1173
 
 
1174
#, no-wrap
 
1175
#~ msgid ""
 
1176
#~ " \n"
 
1177
#~ "quickly run\n"
 
1178
#~ msgstr ""
 
1179
#~ " \n"
 
1180
#~ "quickly run\n"
 
1181
 
 
1182
#, no-wrap
 
1183
#~ msgid ""
 
1184
#~ "\n"
 
1185
#~ "    def save_file(self, widget, data=None):\n"
 
1186
#~ "        print \"save\"\n"
 
1187
#~ "\n"
 
1188
#~ msgstr ""
 
1189
#~ "\n"
 
1190
#~ "    def save_file(self, widget, data=None):\n"
 
1191
#~ "        print \"speichern\"\n"
 
1192
#~ "\n"
 
1193
 
 
1194
#, no-wrap
 
1195
#~ msgid "quickly edit"
 
1196
#~ msgstr "quickly edit"
 
1197
 
 
1198
#, no-wrap
 
1199
#~ msgid ""
 
1200
#~ "\n"
 
1201
#~ "sudo apt-get install quickly-widgets\n"
 
1202
#~ msgstr ""
 
1203
#~ "\n"
 
1204
#~ "sudo apt-get install quickly-widgets\n"
 
1205
 
 
1206
#, no-wrap
 
1207
#~ msgid ""
 
1208
#~ " \n"
 
1209
#~ "        self.database = CouchDatabase(\"jotty\", create=True)\n"
 
1210
#~ msgstr ""
 
1211
#~ " \n"
 
1212
#~ "        self.database = CouchDatabase(\"jotty\", create=True)\n"
 
1213
 
 
1214
#, no-wrap
 
1215
#~ msgid ""
 
1216
#~ "\n"
 
1217
#~ "from desktopcouch.records.server import CouchDatabase\n"
 
1218
#~ "from desktopcouch.records.record import Record\n"
 
1219
#~ msgstr ""
 
1220
#~ "\n"
 
1221
#~ "from desktopcouch.records.server import CouchDatabase\n"
 
1222
#~ "from desktopcouch.records.record import Record\n"
 
1223
 
 
1224
#, no-wrap
 
1225
#~ msgid ""
 
1226
#~ "\n"
 
1227
#~ "        #get the title for the note\n"
 
1228
#~ "        title = self.builder.get_object(\"entry1\").get_text()\n"
 
1229
#~ msgstr ""
 
1230
#~ "\n"
 
1231
#~ "        #Den Titel der Notiz erhalten\n"
 
1232
#~ "        title = self.builder.get_object(\"entry1\").get_text()\n"
 
1233
 
 
1234
#, no-wrap
 
1235
#~ msgid ""
 
1236
#~ "\n"
 
1237
#~ "        record_type = \"http://wiki.ubuntu.com/Quickly/JottyDoc\"\n"
 
1238
#~ "        new_rec = Record({\"record_type\": record_type,\"title\":title, "
 
1239
#~ "\"text\":text})\n"
 
1240
#~ "        self.database.put(new_rec)\n"
 
1241
#~ msgstr ""
 
1242
#~ "\n"
 
1243
#~ "        record_type = \"http://wiki.ubuntu.com/Quickly/JottyDoc\"\n"
 
1244
#~ "        new_rec = Record({\"record_type\": record_type,\"title\":title, "
 
1245
#~ "\"text\":text})\n"
 
1246
#~ "        self.database.put(new_rec)\n"
 
1247
 
 
1248
#, no-wrap
 
1249
#~ msgid ""
 
1250
#~ "\n"
 
1251
#~ "        #get the string\n"
 
1252
#~ "        buff = self.builder.get_object(\"textview1\").get_buffer()\n"
 
1253
#~ "        start_iter = buff.get_start_iter()\n"
 
1254
#~ "        end_iter = buff.get_end_iter()\n"
 
1255
#~ "        text = buff.get_text(start_iter,end_iter)\n"
 
1256
#~ msgstr ""
 
1257
#~ "\n"
 
1258
#~ "        #Den String erhalten\n"
 
1259
#~ "        buff = self.builder.get_object(\"textview1\").get_buffer()\n"
 
1260
#~ "        start_iter = buff.get_start_iter()\n"
 
1261
#~ "        end_iter = buff.get_end_iter()\n"
 
1262
#~ "        text = buff.get_text(start_iter,end_iter)\n"
 
1263
 
 
1264
#, no-wrap
 
1265
#~ msgid ""
 
1266
#~ "\n"
 
1267
#~ "    def save_file(self, widget, data=None): \n"
 
1268
#~ "        #get the title for the note \n"
 
1269
#~ "        title = self.builder.get_object(\"entry1\").get_text() \n"
 
1270
#~ "\n"
 
1271
#~ "        #get the text to save \n"
 
1272
#~ "        buff = self.builder.get_object(\"textview1\").get_buffer() \n"
 
1273
#~ "        start_iter = buff.get_start_iter() \n"
 
1274
#~ "        end_iter = buff.get_end_iter() \n"
 
1275
#~ "        text = buff.get_text(start_iter,end_iter) \n"
 
1276
#~ "\n"
 
1277
#~ "        #get all the records \n"
 
1278
#~ "        record_type = \"http://wiki.ubuntu.com/Quickly/JottyDoc\" \n"
 
1279
#~ "        results = self.database.get_records(record_type = "
 
1280
#~ "record_type,create_view = True) \n"
 
1281
#~ "\n"
 
1282
#~ "        #update a record that has the same title \n"
 
1283
#~ "        for result in results: \n"
 
1284
#~ "            document = result.value \n"
 
1285
#~ "            if document[\"title\"] == title: \n"
 
1286
#~ "                key = document[\"_id\"]\n"
 
1287
#~ "                self.database.update_fields(key, {\"text\":text}) \n"
 
1288
#~ "                return\n"
 
1289
#~ " \n"
 
1290
#~ "        #if no records had the title, create it \n"
 
1291
#~ "        new_rec = Record({\"record_type\":record_type,\"title\":title, "
 
1292
#~ "\"text\":text})\n"
 
1293
#~ "        self.database.put_record(new_rec)\n"
 
1294
#~ msgstr ""
 
1295
#~ "\n"
 
1296
#~ "    def save_file(self, widget, data=None): \n"
 
1297
#~ "        #Den Titel der Notiz erhalten\n"
 
1298
#~ "        title = self.builder.get_object(\"entry1\").get_text() \n"
 
1299
#~ "\n"
 
1300
#~ "        #Den zu speichernden Text erhalten\n"
 
1301
#~ "        buff = self.builder.get_object(\"textview1\").get_buffer() \n"
 
1302
#~ "        start_iter = buff.get_start_iter() \n"
 
1303
#~ "        end_iter = buff.get_end_iter() \n"
 
1304
#~ "        text = buff.get_text(start_iter,end_iter) \n"
 
1305
#~ "\n"
 
1306
#~ "        #Alle Einträge erhalten\n"
 
1307
#~ "        record_type = \"http://wiki.ubuntu.com/Quickly/JottyDoc\" \n"
 
1308
#~ "        results = self.database.get_records(record_type = "
 
1309
#~ "record_type,create_view = True) \n"
 
1310
#~ "\n"
 
1311
#~ "        #Einen Eintrag mit selbem Titel aktualisieren\n"
 
1312
#~ "        for result in results: \n"
 
1313
#~ "            document = result.value \n"
 
1314
#~ "            if document[\"title\"] == title: \n"
 
1315
#~ "                key = document[\"_id\"]\n"
 
1316
#~ "                self.database.update_fields(key, {\"text\":text}) \n"
 
1317
#~ "                return\n"
 
1318
#~ " \n"
 
1319
#~ "        #Eintrag erstellen, falls keiner mit diesem Titel existierte\n"
 
1320
#~ "        new_rec = Record({\"record_type\":record_type,\"title\":title, "
 
1321
#~ "\"text\":text})\n"
 
1322
#~ "        self.database.put_record(new_rec)\n"
 
1323
 
 
1324
#~ msgid "file:///home/your_user_name/.local/share/desktop-couch/couchdb.html"
 
1325
#~ msgstr ""
 
1326
#~ "file:///home/ihr_benutzername/.local/share/desktop-couch/couchdb.html"
 
1327
 
 
1328
#, no-wrap
 
1329
#~ msgid ""
 
1330
#~ "\n"
 
1331
#~ "        #get all the records\n"
 
1332
#~ "        record_type = \"http://wiki.ubuntu.com/Quickly/JottyDoc\"\n"
 
1333
#~ "        results = self.database.get_records(record_type = "
 
1334
#~ "record_type,create_view = True)\n"
 
1335
#~ "        #update a record that has the same title\n"
 
1336
#~ "        for result in results:\n"
 
1337
#~ "            document = result.value\n"
 
1338
#~ "            if document[\"title\"] == title:\n"
 
1339
#~ "                key = document[\"_id\"]\n"
 
1340
#~ "                self.database.update_fields(key, {\"text\":text})\n"
 
1341
#~ "                return\n"
 
1342
#~ "\n"
 
1343
#~ msgstr ""
 
1344
#~ "\n"
 
1345
#~ "        #Alle Einträge erhalten\n"
 
1346
#~ "        record_type = \"http://wiki.ubuntu.com/Quickly/JottyDoc\"\n"
 
1347
#~ "        results = self.database.get_records(record_type = "
 
1348
#~ "record_type,create_view = True)\n"
 
1349
#~ "        #Einen Eintrag mit selbem Titel aktualisieren\n"
 
1350
#~ "        for result in results:\n"
 
1351
#~ "            document = result.value\n"
 
1352
#~ "            if document[\"title\"] == title:\n"
 
1353
#~ "                key = document[\"_id\"]\n"
 
1354
#~ "                self.database.update_fields(key, {\"text\":text})\n"
 
1355
#~ "                return\n"
 
1356
#~ "\n"
 
1357
 
 
1358
#~ msgid "<application>Quickly</application> 0.6.1 User Guide"
 
1359
#~ msgstr "<application>Quickly</application> 0.6.1 Anleitung"