Merge lp:~shanepatrickfagan/quickly/quickly_docbook into lp:quickly
- quickly_docbook
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~shanepatrickfagan/quickly/quickly_docbook |
Merge into: | lp:quickly |
Diff against target: |
6627 lines (+5098/-1282) 12 files modified
data/templates/ubuntu-application/help/index.html (+0/-46) data/templates/ubuntu-application/help/po/ie.po (+1420/-0) data/templates/ubuntu-application/help/po/quickly-ubuntu-application-tutorial.pot (+2387/-0) data/templates/ubuntu-application/help/quickly-dialogs.html (+0/-286) data/templates/ubuntu-application/help/quickly-getting-started.html (+0/-315) data/templates/ubuntu-application/help/quickly-package.html (+0/-176) data/templates/ubuntu-application/help/quickly-reference.html (+0/-278) data/templates/ubuntu-application/help/quickly-release.html (+0/-27) data/templates/ubuntu-application/help/quickly-ubuntu-application-tutorial.xml (+1150/-0) data/templates/ubuntu-application/tutorial.py (+8/-2) po/quickly.pot (+132/-151) quickly/quicklyconfig.py (+1/-1) |
To merge this branch: | bzr merge lp:~shanepatrickfagan/quickly/quickly_docbook |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Didier Roche-Tolomelli | Needs Information | ||
Review via email: mp+19147@code.launchpad.net |
Commit message
Description of the change
Shane Fagan (shanepatrickfagan) wrote : | # |
Shane Fagan (shanepatrickfagan) wrote : | # |
I dont know why the diff has stuff I didnt change. I used the main branch. Ill look into it.
Shane Fagan (shanepatrickfagan) wrote : | # |
I think its right now
Didier Roche-Tolomelli (didrocks) wrote : | # |
Hey Fagan, thanks for your work, awesome :)
Just a quick question as I requested you on IRC. As the main purpose of using docbook is to be able to translate the tutorial, did you try to build it, translate some strings in a diffrent language and set it as your language to ensure the translated version is taken into account?
If you didn't have the time to test that, can you test it before I merge the branch? (as it's directly related this feature).
Thanks a lot again ;)
- 414. By Didier Roche-Tolomelli
-
fix copyright as copyright wasn't canonical
- 415. By Didier Roche-Tolomelli
-
Some fixes in share/transitio
n/competion. Kudos to v0xel - 416. By Didier Roche-Tolomelli
-
fix quickly help configure
- 417. By Didier Roche-Tolomelli
-
remove not pushing to ppa for debugging
- 418. By Didier Roche-Tolomelli
-
simplify versionning computation (v0xel)
- 419. By Didier Roche-Tolomelli
-
split the quickly package in multiple package
- 420. By Didier Roche-Tolomelli
-
stop on unlicensed project
- 421. By Didier Roche-Tolomelli
-
enable adding manual dependencies to quickly project
- 422. By Didier Roche-Tolomelli
-
don't care anymore about --root option. --prefix should be use
- 423. By Didier Roche-Tolomelli
-
fix licensing call in release and share raising an Exception (LP: #524805)
- 424. By Philip Peitsch
-
Fixing license upgrade to correctly skip files that already have a license line present
- 425. By Didier Roche-Tolomelli
-
fix license issue on first licensing
- 426. By Didier Roche-Tolomelli
-
some license fix
- 427. By Didier Roche-Tolomelli
-
enable configure its own bzr branch and resetting parent branch even once
already configured (quickly configure bzr <branch-path>) - 428. By Didier Roche-Tolomelli
-
now recommends seahorse-plugins to have a graphical prompt for signing
package - 429. By Didier Roche-Tolomelli
-
rename quickly glade to quickly design
- 430. By Didier Roche-Tolomelli
-
refresh pot file
- 431. By Didier Roche-Tolomelli
-
fix quickly --version with last move
- 432. By Didier Roche-Tolomelli
-
create command is now more flexible and enable people to inherit from
other template more easily - 433. By Didier Roche-Tolomelli
-
don't launch the project if file isn't present
- 434. By Didier Roche-Tolomelli
-
* fix bad formatted catalog file
* Move some file to be more explicit in the folder layout
* fix quickly add dialog to put the python file as well
* misc pep compliance rewriting - 435. By Didier Roche-Tolomelli
-
* factorizing some os.abspath() code
- 436. By Didier Roche-Tolomelli
-
take add dialog path in the origin template set if doesn't exist
- 437. By Didier Roche-Tolomelli
-
add translation domain to gtkbuilder and fix some items that shouldn't
been translatable (Łukasz Jernaś) - 438. By Shane Fagan
-
Added translations and yelp opens the correct one for your locale. Needs lots of testing and some setup.py work
- 439. By Shane Fagan
-
Moved the pot to the right folder and updated it.
- 440. By Shane Fagan
-
Rebuilt the pot again because of new changes
Preview Diff
1 | === removed file 'data/templates/ubuntu-application/help/index.html' |
2 | --- data/templates/ubuntu-application/help/index.html 2009-10-24 14:03:39 +0000 |
3 | +++ data/templates/ubuntu-application/help/index.html 1970-01-01 00:00:00 +0000 |
4 | @@ -1,46 +0,0 @@ |
5 | -<HTML> |
6 | -<HEAD> |
7 | -<TITLE>Quickly Help Index</TITLE> |
8 | -<STYLE> |
9 | -img |
10 | -{ |
11 | - display: block; |
12 | - width:668px; |
13 | - padding-top:10px; |
14 | -} |
15 | -p |
16 | -{ |
17 | - width: 800px; |
18 | -} |
19 | -.emphasis |
20 | -{ |
21 | - font-weight: bold; |
22 | -} |
23 | -</STYLE> |
24 | -</HEAD> |
25 | -<BODY> |
26 | - <H1>What is Quickly?</H1> |
27 | - <P> |
28 | - <span class="emphasis">Quickly is a set of choices</span> about writing apps for Ubuntu. Out of all the wonderful richness and variety of programming for Linux, Quickly make some very opinionated choices about what tools to use, and how to combine them. The criteria for these choices was to make it easy and fun to write and release Linux applications, even if it's your first time trying, but also in a way that delivers the full power and flexibility of the platform. One benefit of these choices, is that it's also easier to write tools that make it even easier and more fun. So <span class="emphasis">Quickly is also a set of commands</span>. |
29 | - </P> |
30 | - |
31 | - <H1>Quickly Tutorial</H2> |
32 | - <OL> |
33 | - <LI><A HREF="quickly-getting-started.html">Part 1 - Getting Started</A></LI> |
34 | - <LI><A HREF="quickly-dialogs.html">Part 2 - Using Dialogs</A></LI> |
35 | - <LI><A HREF="quickly-package.html">Part 3 - Packaging</A></LI> |
36 | - </OL> |
37 | - |
38 | - <H1>Reference</H1> |
39 | - <UL> |
40 | - <LI><A HREF="quickly-reference.html">Quickly: Quickly Command Reference</A></LI> |
41 | - <LI><A HREF="http://blog.didrocks.fr/index.php/post/Build-your-application-quickly-with-Quickly%3A-part1">Blog post suit on Quickly</A></LI> |
42 | - <LI><A HREF="http://docs.python.org/reference/">Language: Python Language Reference</A></LI> |
43 | - <LI><A HREF="http://www.python.org/doc/2.6/library/index.html">Core Library: Python 2.6 Library Reference</A></LI> |
44 | - <LI><A HREF="http://www.pygtk.org/docs/pygtk/">UI Library: PyGtk</A></LI> |
45 | - <LI><A HREF="http://wiki.apache.org/couchdb/Reference">Database: CouchDB Reference</LI> |
46 | - <LI><A HREF="http://library.gnome.org/devel/glade/stable/">UI Editing: Glade User Documenation</A></LI> |
47 | - <LI><A HREF="http://library.gnome.org/users/gedit/stable/index.html">Editor: Gedit Help</A></LI> |
48 | - <LI><A HREF="http://doc.bazaar-vcs.org/bzr.dev/en/user-reference/bzr_man.html">Version Control: Bazaar</A></LI> |
49 | - </UL> |
50 | -</BODY> |
51 | |
52 | === added directory 'data/templates/ubuntu-application/help/po' |
53 | === added file 'data/templates/ubuntu-application/help/po/ie.po' |
54 | --- data/templates/ubuntu-application/help/po/ie.po 1970-01-01 00:00:00 +0000 |
55 | +++ data/templates/ubuntu-application/help/po/ie.po 2010-03-12 17:35:32 +0000 |
56 | @@ -0,0 +1,1420 @@ |
57 | +msgid "" |
58 | +msgstr "" |
59 | +"Project-Id-Version: PACKAGE VERSION\n" |
60 | +"POT-Creation-Date: 2010-03-04 15:41+0000\n" |
61 | +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
62 | +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
63 | +"Language-Team: LANGUAGE <LL@li.org>\n" |
64 | +"MIME-Version: 1.0\n" |
65 | +"Content-Type: text/plain; charset=UTF-8\n" |
66 | +"Content-Transfer-Encoding: 8bit\n" |
67 | + |
68 | +#: quickly-ubuntu-application-tutorial.xml:13(firstname) |
69 | +msgid "Shane" |
70 | +msgstr "" |
71 | + |
72 | +#: quickly-ubuntu-application-tutorial.xml:14(surname) |
73 | +msgid "Fagan" |
74 | +msgstr "" |
75 | + |
76 | +#: quickly-ubuntu-application-tutorial.xml:17(firstname) |
77 | +msgid "Rick" |
78 | +msgstr "" |
79 | + |
80 | +#: quickly-ubuntu-application-tutorial.xml:18(surname) |
81 | +msgid "Spencer" |
82 | +msgstr "" |
83 | + |
84 | +#: quickly-ubuntu-application-tutorial.xml:20(corpauthor) |
85 | +msgid "Canonical ltd" |
86 | +msgstr "" |
87 | + |
88 | +#: quickly-ubuntu-application-tutorial.xml:24(date) quickly-ubuntu-application-tutorial.xml:29(invpartnumber) |
89 | +msgid "2010" |
90 | +msgstr "" |
91 | + |
92 | +#: quickly-ubuntu-application-tutorial.xml:30(title) |
93 | +msgid "<application>Quickly</application> 0.4 User Guide" |
94 | +msgstr "" |
95 | + |
96 | +#: quickly-ubuntu-application-tutorial.xml:35(title) |
97 | +msgid "About This Guide" |
98 | +msgstr "Maidir leis an treoir" |
99 | + |
100 | +#: quickly-ubuntu-application-tutorial.xml:36(para) |
101 | +msgid "<application>Quickly</application> is a set of choices about writing apps for Ubuntu. Out of all the wonderful richness and variety of programming for Linux, <application>Quickly</application> make some very opinionated choices about what tools to use, and how to combine them. The criteria for these choices was to make it easy and fun to write and release Linux applications, even if it's your first time trying, but also in a way that delivers the full power and flexibility of the platform. One benefit of these choices, is that it's also easier to write tools that make it even easier and more fun. So <application>Quickly</application> is also a set of commands." |
102 | +msgstr "" |
103 | + |
104 | +#: quickly-ubuntu-application-tutorial.xml:39(link) quickly-ubuntu-application-tutorial.xml:45(title) |
105 | +msgid "Getting Started" |
106 | +msgstr "" |
107 | + |
108 | +#: quickly-ubuntu-application-tutorial.xml:46(para) |
109 | +msgid "Welcome to the <application>Quickly</application> tutorial. In this guide you will learn how to get started using <application>Quickly</application>." |
110 | +msgstr "" |
111 | + |
112 | +#: quickly-ubuntu-application-tutorial.xml:49(application) quickly-ubuntu-application-tutorial.xml:52(application) quickly-ubuntu-application-tutorial.xml:55(application) quickly-ubuntu-application-tutorial.xml:65(application) quickly-ubuntu-application-tutorial.xml:80(application) quickly-ubuntu-application-tutorial.xml:87(application) quickly-ubuntu-application-tutorial.xml:142(application) quickly-ubuntu-application-tutorial.xml:170(application) quickly-ubuntu-application-tutorial.xml:182(application) quickly-ubuntu-application-tutorial.xml:238(application) quickly-ubuntu-application-tutorial.xml:260(application) quickly-ubuntu-application-tutorial.xml:280(application) quickly-ubuntu-application-tutorial.xml:325(application) quickly-ubuntu-application-tutorial.xml:349(application) quickly-ubuntu-application-tutorial.xml:361(application) quickly-ubuntu-application-tutorial.xml:367(application) quickly-ubuntu-application-tutorial.xml:453(application) quickly-ubuntu-application-tutorial.xml:477(application) quickly-ubuntu-application-tutorial.xml:482(application) quickly-ubuntu-application-tutorial.xml:514(application) quickly-ubuntu-application-tutorial.xml:691(application) quickly-ubuntu-application-tutorial.xml:702(application) quickly-ubuntu-application-tutorial.xml:713(application) quickly-ubuntu-application-tutorial.xml:822(application) quickly-ubuntu-application-tutorial.xml:881(application) quickly-ubuntu-application-tutorial.xml:896(application) quickly-ubuntu-application-tutorial.xml:899(application) quickly-ubuntu-application-tutorial.xml:907(application) quickly-ubuntu-application-tutorial.xml:924(application) quickly-ubuntu-application-tutorial.xml:928(application) quickly-ubuntu-application-tutorial.xml:953(application) quickly-ubuntu-application-tutorial.xml:963(application) quickly-ubuntu-application-tutorial.xml:976(application) quickly-ubuntu-application-tutorial.xml:985(application) quickly-ubuntu-application-tutorial.xml:1024(application) quickly-ubuntu-application-tutorial.xml:1041(application) quickly-ubuntu-application-tutorial.xml:1076(application) quickly-ubuntu-application-tutorial.xml:1086(application) quickly-ubuntu-application-tutorial.xml:1102(application) quickly-ubuntu-application-tutorial.xml:1121(application) quickly-ubuntu-application-tutorial.xml:1121(application) quickly-ubuntu-application-tutorial.xml:1124(application) |
113 | +msgid "Quickly" |
114 | +msgstr "" |
115 | + |
116 | +#: quickly-ubuntu-application-tutorial.xml:49(link) |
117 | +msgid "Introduction to <placeholder-1/> Part 1" |
118 | +msgstr "" |
119 | + |
120 | +#: quickly-ubuntu-application-tutorial.xml:52(link) |
121 | +msgid "Introduction to <placeholder-1/> Part 2" |
122 | +msgstr "" |
123 | + |
124 | +#: quickly-ubuntu-application-tutorial.xml:55(link) |
125 | +msgid "Introduction to <placeholder-1/> Part 3" |
126 | +msgstr "" |
127 | + |
128 | +#: quickly-ubuntu-application-tutorial.xml:61(title) |
129 | +msgid "Introduction to <application>Quickly</application> Part 1" |
130 | +msgstr "" |
131 | + |
132 | +#: quickly-ubuntu-application-tutorial.xml:62(para) |
133 | +msgid "This part 1 of the <application>Quickly</application> tutorial. This part is will introduce some key <application>Quickly</application> commands, editing a user interface in Glade, and editing code in Gedit. This part of the tutorial will familiarize you with these three tools, and how they work together with python and pygtk so that you can <application>Quickly</application> build applications." |
134 | +msgstr "" |
135 | + |
136 | +#: quickly-ubuntu-application-tutorial.xml:64(title) |
137 | +msgid "Creating a <application>Quickly</application> Project" |
138 | +msgstr "" |
139 | + |
140 | +#: quickly-ubuntu-application-tutorial.xml:64(para) |
141 | +msgid "<placeholder-1/>Creating an empty but working program couldn't be simpler. First, open a terminal window to type commands into. When it's open, type the command:" |
142 | +msgstr "" |
143 | + |
144 | +#: quickly-ubuntu-application-tutorial.xml:65(code) |
145 | +msgid "<placeholder-1/> create ubuntu-application jotty" |
146 | +msgstr "" |
147 | + |
148 | +#: quickly-ubuntu-application-tutorial.xml:69(para) |
149 | +msgid "This will create a jotty sub directory containing a complete directory tree and files for an empty python application. The command finishes by running the newly created empty application." |
150 | +msgstr "" |
151 | + |
152 | +#: quickly-ubuntu-application-tutorial.xml:73(title) |
153 | +msgid "Testing the Empty Application" |
154 | +msgstr "" |
155 | + |
156 | +#: quickly-ubuntu-application-tutorial.xml:73(para) |
157 | +msgid "<placeholder-1/> They are populated and set up, and you can resize the window. Notice that <application>Quickly</application> inferred that the application title is \"Jotty\". Only a few of menu items do anything in the empty application, Help->About, Edit->Preferences, and File->Quit." |
158 | +msgstr "" |
159 | + |
160 | +#: quickly-ubuntu-application-tutorial.xml:77(title) |
161 | +msgid "Running the Application" |
162 | +msgstr "" |
163 | + |
164 | +#: quickly-ubuntu-application-tutorial.xml:77(para) |
165 | +msgid "<placeholder-1/> Close the application by closing the window or using the Quit command. Since the empty application isn't installed into Ubuntu yet, you can't start the application from the application menu yet. To start the applicaton, use the terminal to first cd into the new subdirectory, and then use \"<application>Quickly</application> run\" to start the program." |
166 | +msgstr "" |
167 | + |
168 | +#: quickly-ubuntu-application-tutorial.xml:79(code) |
169 | +msgid "cd jotty" |
170 | +msgstr "" |
171 | + |
172 | +#: quickly-ubuntu-application-tutorial.xml:80(code) quickly-ubuntu-application-tutorial.xml:181(code) quickly-ubuntu-application-tutorial.xml:1075(code) |
173 | +msgid "<placeholder-1/> run" |
174 | +msgstr "" |
175 | + |
176 | +#: quickly-ubuntu-application-tutorial.xml:84(title) |
177 | +msgid "Editing an Application" |
178 | +msgstr "" |
179 | + |
180 | +#: quickly-ubuntu-application-tutorial.xml:85(title) |
181 | +msgid "Edit the User Interface in Glade" |
182 | +msgstr "" |
183 | + |
184 | +#: quickly-ubuntu-application-tutorial.xml:85(para) |
185 | +msgid "<placeholder-1/><application>Quickly</application> programs use Glade to edit the user interface. Start Glade with <application>Quickly</application> in order to set up Glade for editing the empty applicaton. Don't start glade directly, or it won't load the necessary catalogue files for editing the classes that were automaticaly generated by <application>Quickly</application>." |
186 | +msgstr "" |
187 | + |
188 | +#: quickly-ubuntu-application-tutorial.xml:87(code) quickly-ubuntu-application-tutorial.xml:142(code) quickly-ubuntu-application-tutorial.xml:481(code) quickly-ubuntu-application-tutorial.xml:896(code) quickly-ubuntu-application-tutorial.xml:924(code) quickly-ubuntu-application-tutorial.xml:962(code) |
189 | +msgid "<placeholder-1/> design" |
190 | +msgstr "" |
191 | + |
192 | +#: quickly-ubuntu-application-tutorial.xml:91(para) |
193 | +msgid "Glade will open with the project loaded up and ready to edit." |
194 | +msgstr "" |
195 | + |
196 | +#: quickly-ubuntu-application-tutorial.xml:95(para) |
197 | +msgid "Use the Project Menu to choose \"JottytWindow.ui\" for editing." |
198 | +msgstr "" |
199 | + |
200 | +#: quickly-ubuntu-application-tutorial.xml:99(para) |
201 | +msgid "We want to create a text area for typing into. There are some default Widgets added to the Window. We won't need these so we'll start with deleting them. Click on the label, and press delete, and it will disappear from the window." |
202 | +msgstr "" |
203 | + |
204 | +#: quickly-ubuntu-application-tutorial.xml:106(para) |
205 | +msgid "Do the same with the image widget. This leave us two free slots." |
206 | +msgstr "" |
207 | + |
208 | +#: quickly-ubuntu-application-tutorial.xml:110(para) |
209 | +msgid "We'll use the bottom slot to add a TextView widget for the user to type into. In the toolbox, click on the TextView widget. Then click in the empty slot." |
210 | +msgstr "" |
211 | + |
212 | +#: quickly-ubuntu-application-tutorial.xml:114(para) |
213 | +msgid "Make sure you save the file in Glade, or your changes won't take! Then run the application from terminal again. The window now has a place where the user can type." |
214 | +msgstr "" |
215 | + |
216 | +#: quickly-ubuntu-application-tutorial.xml:118(para) |
217 | +msgid "Now we'll add the entry field for the title, and also a label for it. We'll use the top empty slot for that. First, click on Horizontal Box (HBox) from the \"Containers\" section of the pallette, and then click on the top slot. A dialog box will open, tell it that you want two items." |
218 | +msgstr "" |
219 | + |
220 | +#: quickly-ubuntu-application-tutorial.xml:122(para) |
221 | +msgid "The HBox is a container that arranges it's children horizontally. Add a label to the empty left hand box, and a Text Entry to the right hand one." |
222 | +msgstr "" |
223 | + |
224 | +#: quickly-ubuntu-application-tutorial.xml:126(para) |
225 | +msgid "Before going on, let's clean up the UI just a tad here. Select the new HBox from the treeview in the inspector window. Then go to the Packing tab, and set Expand and Fill to \"No\"." |
226 | +msgstr "" |
227 | + |
228 | +#: quickly-ubuntu-application-tutorial.xml:130(para) |
229 | +msgid "Go to the General tab, and set spacing to 5." |
230 | +msgstr "" |
231 | + |
232 | +#: quickly-ubuntu-application-tutorial.xml:134(para) |
233 | +msgid "Select the label. On the general tab, set \"Label\" to \"Name:\". Set expand and fill to \"no\" for the label, but keep it \"yes\" for the entry. Set the padding for both to 5 (also on the Packing tab)." |
234 | +msgstr "" |
235 | + |
236 | +#: quickly-ubuntu-application-tutorial.xml:138(title) |
237 | +msgid "Add the Save, Open, and New Features" |
238 | +msgstr "" |
239 | + |
240 | +#: quickly-ubuntu-application-tutorial.xml:138(para) |
241 | +msgid "<placeholder-1/> After the user types something, they may want to save it. A File->Save menu item was automatically created when the empty applicaton was created, but it's not hooked up to any code. To make Save work, we need tell the menu item what function to call, and then create a function to actually do the saving." |
242 | +msgstr "" |
243 | + |
244 | +#: quickly-ubuntu-application-tutorial.xml:140(title) |
245 | +msgid "Set the Signal Handler in Glade" |
246 | +msgstr "" |
247 | + |
248 | +#: quickly-ubuntu-application-tutorial.xml:140(para) |
249 | +msgid "<placeholder-1/> To tell the menu item what function to call. If glade is not still open, open up the application in glade:" |
250 | +msgstr "" |
251 | + |
252 | +#: quickly-ubuntu-application-tutorial.xml:143(para) |
253 | +msgid "Click on the file menu, and the menu opens as if the application were running." |
254 | +msgstr "" |
255 | + |
256 | +#: quickly-ubuntu-application-tutorial.xml:147(para) |
257 | +msgid "Choose the Save menu item, and it will be selected in Glade." |
258 | +msgstr "" |
259 | + |
260 | +#: quickly-ubuntu-application-tutorial.xml:151(para) |
261 | +msgid "Then choose the \"Signals\" tab of the properties window." |
262 | +msgstr "" |
263 | + |
264 | +#: quickly-ubuntu-application-tutorial.xml:155(para) |
265 | +msgid "In pygtk, menu items are \"activated\" when a user chooses the item from the menu. Since we want a function to run when the user chooses Save, we want to specify a function to respond to the activate signal from the menu item. We'll call the function \"save_file\". Simply type the function name into the box for the activate signal.Make sure to save the glade file." |
266 | +msgstr "" |
267 | + |
268 | +#: quickly-ubuntu-application-tutorial.xml:159(para) |
269 | +msgid "Note that you will need to setup the \"open_file\" signal and the \"new_file\" signal as well when you get to those functions later." |
270 | +msgstr "" |
271 | + |
272 | +#: quickly-ubuntu-application-tutorial.xml:160(title) |
273 | +msgid "Edit the Code in Gedit" |
274 | +msgstr "" |
275 | + |
276 | +#: quickly-ubuntu-application-tutorial.xml:161(title) |
277 | +msgid "Set Up Tabs Correctly" |
278 | +msgstr "" |
279 | + |
280 | +#: quickly-ubuntu-application-tutorial.xml:161(para) |
281 | +msgid "<placeholder-1/> Note a major gotcha here. In python spaces and tabs are totally different, but they look just the same in an editor. So being indented one tab stop is not the same as being indented four spaces, even though they might look the same. And indentation level is very important in python. You will get a lot of errors if you mix tab indentation with space indentation. Your generated project follows the python standard of using four spaces for each indentation level. So you'll either have to hit the space bar four time every time you indent, or set up your editor to use the right number of spaces for tabs." |
282 | +msgstr "" |
283 | + |
284 | +#: quickly-ubuntu-application-tutorial.xml:163(para) |
285 | +msgid "The upshot is that you should take a moment to set up your Gedit (or whatever editor you are using) to use spaces for tabs. In Gedit, select Preferences from the Edit menu, and choose the Editor tab. Then set Tab width to 4, and turn on \"Insert spaces instead of tabs\". Your preferences should look like this:" |
286 | +msgstr "" |
287 | + |
288 | +#: quickly-ubuntu-application-tutorial.xml:167(title) |
289 | +msgid "Create the Save File Signal Handler" |
290 | +msgstr "" |
291 | + |
292 | +#: quickly-ubuntu-application-tutorial.xml:167(para) |
293 | +msgid "<placeholder-1/> Now you're ready to write some code. Of course just telling the glade file what signal to emit won't make the file actually save, because we haven't created the \"save_file\" function yet. The code for JottyWindow is stored in the file jotty. jotty is a special python file that is the entry point for your application. Other python files in your application have the \".py\" suffix." |
294 | +msgstr "" |
295 | + |
296 | +#: quickly-ubuntu-application-tutorial.xml:169(para) |
297 | +msgid "Use the <application>Quickly</application> edit command to start editing your code files:" |
298 | +msgstr "" |
299 | + |
300 | +#: quickly-ubuntu-application-tutorial.xml:170(code) quickly-ubuntu-application-tutorial.xml:899(code) quickly-ubuntu-application-tutorial.xml:928(code) quickly-ubuntu-application-tutorial.xml:952(code) |
301 | +msgid "<placeholder-1/> edit" |
302 | +msgstr "" |
303 | + |
304 | +#: quickly-ubuntu-application-tutorial.xml:171(para) |
305 | +msgid "This will open the default Ubuntu text editor \"Gedit\" with any python files in the python directory." |
306 | +msgstr "" |
307 | + |
308 | +#: quickly-ubuntu-application-tutorial.xml:175(para) |
309 | +msgid "JottyWindow.ui is now expecting to find a function JottyWindow.save_file(), so we simply add one to the JottyWindow class in the jotty file right under the on_destroy funtion.:" |
310 | +msgstr "" |
311 | + |
312 | +#: quickly-ubuntu-application-tutorial.xml:177(code) |
313 | +msgid "def save_file(self, widget, data=None): print \"save\"" |
314 | +msgstr "" |
315 | + |
316 | +#: quickly-ubuntu-application-tutorial.xml:179(para) |
317 | +msgid "This will print the word \"save\" to the terminal when run. The method signature is the standard signature expected in a signal handler. If you are new to python, be sure to copy the indentations exactly, as the indentation level is very important in python." |
318 | +msgstr "" |
319 | + |
320 | +#: quickly-ubuntu-application-tutorial.xml:180(para) |
321 | +msgid "Save the file, and run it again:" |
322 | +msgstr "" |
323 | + |
324 | +#: quickly-ubuntu-application-tutorial.xml:184(para) |
325 | +msgid "Choose \"File->Save\" from the menu, and you'll see the word \"save\" printing out interminal. That's all there is to hookig up the functions!" |
326 | +msgstr "" |
327 | + |
328 | +#: quickly-ubuntu-application-tutorial.xml:188(title) |
329 | +msgid "Implementing Save" |
330 | +msgstr "" |
331 | + |
332 | +#: quickly-ubuntu-application-tutorial.xml:188(para) |
333 | +msgid "<placeholder-1/> Now we'll write a little code in the signal handler to actually save the text. Because we want it to be easy for users to do things like syncronize their Jotty documents between computers, back it up, etc... we'll use couchdb as our backend, and we'll use desktopcouch for our api. Note that if you are not interested in learning about how to save to and read from couchdb, you can just snipe the code. Mostly likely you already have everything you need installed when you installed <application>Quickly</application>. But, you may need to install couchdb, desktopcouch, and the desktopcouch records api. The fastest way to do this is from the terminal:" |
334 | +msgstr "" |
335 | + |
336 | +#: quickly-ubuntu-application-tutorial.xml:191(code) |
337 | +msgid "sudo apt-get install python-desktopcouch-records" |
338 | +msgstr "" |
339 | + |
340 | +#: quickly-ubuntu-application-tutorial.xml:194(para) |
341 | +msgid "This will install the api, and everything you need for the api to run. After desktopcouch is installed, you can write the code. The code will do the following:" |
342 | +msgstr "" |
343 | + |
344 | +#: quickly-ubuntu-application-tutorial.xml:197(para) |
345 | +msgid "Import the stuff you'll need from desktopcouch." |
346 | +msgstr "" |
347 | + |
348 | +#: quickly-ubuntu-application-tutorial.xml:200(para) |
349 | +msgid "Get a reference to the couchdb database to save into." |
350 | +msgstr "" |
351 | + |
352 | +#: quickly-ubuntu-application-tutorial.xml:203(para) |
353 | +msgid "Get the title of the document and the text from the user interface." |
354 | +msgstr "" |
355 | + |
356 | +#: quickly-ubuntu-application-tutorial.xml:206(para) |
357 | +msgid "Check if there is already a document with the same title, and if so overwrite it." |
358 | +msgstr "" |
359 | + |
360 | +#: quickly-ubuntu-application-tutorial.xml:209(para) |
361 | +msgid "If there is not a document already, create one." |
362 | +msgstr "" |
363 | + |
364 | +#: quickly-ubuntu-application-tutorial.xml:212(title) |
365 | +msgid "Import the stuff you'll need from python-desktopcouch-records." |
366 | +msgstr "" |
367 | + |
368 | +#: quickly-ubuntu-application-tutorial.xml:212(para) |
369 | +msgid "<placeholder-1/> Add these import statements along with the other imports to the top of the jotty file:" |
370 | +msgstr "" |
371 | + |
372 | +#: quickly-ubuntu-application-tutorial.xml:214(code) |
373 | +msgid "from desktopcouch.records.server import CouchDatabase from desktopcouch.records.record import Record" |
374 | +msgstr "" |
375 | + |
376 | +#: quickly-ubuntu-application-tutorial.xml:216(title) |
377 | +msgid "Get a Reference to the Database" |
378 | +msgstr "" |
379 | + |
380 | +#: quickly-ubuntu-application-tutorial.xml:216(para) |
381 | +msgid "<placeholder-1/> Desktopcouch will set up a database for us, or create a new one if it's needed. We'll use \"jotty\" for the name of the database. Since we want this line to run every time the Jotty Window is created, put it at the end of the finish_initializing function:" |
382 | +msgstr "" |
383 | + |
384 | +#: quickly-ubuntu-application-tutorial.xml:218(code) |
385 | +msgid "self.database = CouchDatabase(\"jotty\", create=True)" |
386 | +msgstr "" |
387 | + |
388 | +#: quickly-ubuntu-application-tutorial.xml:221(para) |
389 | +msgid "Now that we have an instance-wide reference to the database, we'll add code to the save_file function to run whenever the Save command is issued." |
390 | +msgstr "" |
391 | + |
392 | +#: quickly-ubuntu-application-tutorial.xml:222(para) |
393 | +msgid "Here's the code to pull the title out of the title entry:" |
394 | +msgstr "" |
395 | + |
396 | +#: quickly-ubuntu-application-tutorial.xml:224(code) |
397 | +msgid "#get the title for the note title = self.builder.get_object(\"entry1\").get_text()" |
398 | +msgstr "" |
399 | + |
400 | +#: quickly-ubuntu-application-tutorial.xml:226(title) |
401 | +msgid "Here's the code to get pull the text out of the TextView:" |
402 | +msgstr "" |
403 | + |
404 | +#: quickly-ubuntu-application-tutorial.xml:226(para) |
405 | +msgid "<placeholder-1/> In pygtk, TextView widgets have a text buffer that stores the text. So you ask the TextView for it's TextBuffer, and then you ask the TextBuffer for the text. You use iters to determine from which part of the text buffer you want text. Since we want all the text, it's easy to just get the start and end iters." |
406 | +msgstr "" |
407 | + |
408 | +#: quickly-ubuntu-application-tutorial.xml:229(code) |
409 | +msgid "#get the string buff = self.builder.get_object(\"textview1\").get_buffer() start_iter = buff.get_start_iter() end_iter = buff.get_end_iter() text = buff.get_text(start_iter,end_iter)" |
410 | +msgstr "" |
411 | + |
412 | +#: quickly-ubuntu-application-tutorial.xml:235(title) |
413 | +msgid "Saving a document to Couchdb" |
414 | +msgstr "" |
415 | + |
416 | +#: quickly-ubuntu-application-tutorial.xml:235(para) |
417 | +msgid "<placeholder-1/> A record in couch is essentially a python dictionary with some extra key/value pairs to make the database work. So we can save the document to couch like this:" |
418 | +msgstr "" |
419 | + |
420 | +#: quickly-ubuntu-application-tutorial.xml:238(code) |
421 | +msgid "record_type = \"http://wiki.ubuntu.com/<placeholder-1/>/JottyDoc\" new_rec = Record({\"record_type\": record_type,\"title\":title, \"text\":text}) self.database.put(new_rec)" |
422 | +msgstr "" |
423 | + |
424 | +#: quickly-ubuntu-application-tutorial.xml:241(para) |
425 | +msgid "The \"record_type\" field is not strictly required, but among other things, it makes it easy to fetch the documents later. By convention, we use a url to specify the record type. This provides a place for other developers to go to read about the record type. The description only needs to be human readable. Couchdb is not a typed database, so don't expect that the url will have any kind of schema definition or anything. You can use whatever url you want, and put whatever you want at that URL." |
426 | +msgstr "" |
427 | + |
428 | +#: quickly-ubuntu-application-tutorial.xml:242(title) |
429 | +msgid "Check for a pre-existing note with the same title" |
430 | +msgstr "" |
431 | + |
432 | +#: quickly-ubuntu-application-tutorial.xml:242(para) |
433 | +msgid "<placeholder-1/> Before we just write the new document though, we have to take note of the fact that couch will allow you to create as many documents as you want with the same title. We probably don't want this, so we we'll have to write a little code to check if there is already a document in couch with the same title, and if there is, update that document rather than create a new one." |
434 | +msgstr "" |
435 | + |
436 | +#: quickly-ubuntu-application-tutorial.xml:244(para) |
437 | +msgid "In CouchDB, you don't do a lot of data processing in the database like you would with a relational database. To be most efficient, we could use the desktopcouch API to create a view in CouchDB, but it's probably simplest just to do the necessary processing on the client for now. To do this, we'll use a desktopcouch function to retrieve all of the records of a specified record type." |
438 | +msgstr "" |
439 | + |
440 | +#: quickly-ubuntu-application-tutorial.xml:245(para) |
441 | +msgid "To find and update documents with a matching title we will:" |
442 | +msgstr "" |
443 | + |
444 | +#: quickly-ubuntu-application-tutorial.xml:248(para) quickly-ubuntu-application-tutorial.xml:308(para) |
445 | +msgid "Retrieve all of the documents with the CouchDatabase.get_records function." |
446 | +msgstr "" |
447 | + |
448 | +#: quickly-ubuntu-application-tutorial.xml:251(para) quickly-ubuntu-application-tutorial.xml:311(para) |
449 | +msgid "Check each of the returned records for a matching title." |
450 | +msgstr "" |
451 | + |
452 | +#: quickly-ubuntu-application-tutorial.xml:254(para) |
453 | +msgid "If there is a match, update the record using the CouchDatabase.update_fields function and return." |
454 | +msgstr "" |
455 | + |
456 | +#: quickly-ubuntu-application-tutorial.xml:257(para) |
457 | +msgid "This all may sound very weird, but in code, it's not quite so complicated:" |
458 | +msgstr "" |
459 | + |
460 | +#: quickly-ubuntu-application-tutorial.xml:259(code) |
461 | +msgid "#get all the records record_type = \"http://wiki.ubuntu.com/<placeholder-1/>/JottyDoc\" results = self.database.get_records(record_type = record_type,create_view = True) #update a record that has the same title for result in results: document = result.value if document[\"title\"] == title: key = document[\"_id\"] self.database.update_fields(key, {\"text\":text}) return" |
462 | +msgstr "" |
463 | + |
464 | +#: quickly-ubuntu-application-tutorial.xml:269(para) |
465 | +msgid "So the whole function should look like this:" |
466 | +msgstr "" |
467 | + |
468 | +#: quickly-ubuntu-application-tutorial.xml:271(code) |
469 | +msgid "def save_file(self, widget, data=None): #get the title for the note title = self.builder.get_object(\"entry1\").get_text() #get the text to save buff = self.builder.get_object(\"textview1\").get_buffer() start_iter = buff.get_start_iter() end_iter = buff.get_end_iter() text = buff.get_text(start_iter,end_iter) #get all the records record_type = \"http://wiki.ubuntu.com/<placeholder-1/>/JottyDoc\" results = self.database.get_records(record_type = record_type,create_view = True) #update a record that has the same title for result in results: document = result.value if document[\"title\"] == title: key = result.key self.database.update_fields(key, {\"text\":text}) return #if no records had the title, create it new_rec = Record({\"record_type\":record_type,\"title\":title, \"text\":text}) self.database.put_record(new_rec)" |
470 | +msgstr "" |
471 | + |
472 | +#: quickly-ubuntu-application-tutorial.xml:293(para) |
473 | +msgid "Couchdb makes it really easy to see if your save function is working. You can just point your web browser at it and explore the database:" |
474 | +msgstr "" |
475 | + |
476 | +#: quickly-ubuntu-application-tutorial.xml:294(para) |
477 | +msgid "file:///home/your_user_name>/.local/share/desktop-couch/couchdb.html" |
478 | +msgstr "" |
479 | + |
480 | +#: quickly-ubuntu-application-tutorial.xml:298(para) |
481 | +msgid "If you are redirected to a page that doesn't work, you probably just need to clear your browser cache and try again." |
482 | +msgstr "" |
483 | + |
484 | +#: quickly-ubuntu-application-tutorial.xml:299(title) |
485 | +msgid "Implementing Open and New" |
486 | +msgstr "" |
487 | + |
488 | +#: quickly-ubuntu-application-tutorial.xml:299(para) |
489 | +msgid "<placeholder-1/> To open a saved document, the user will type the title of the document that they want to open in the text entry, and choose \"Open\" from the main menu. If there is no matching document there, it will just clear out the text view, ready for input. This is probably not too intuitive, so we'll add a dialog box for prompting the user for the title, but that's for later in the tutorial. For now, we'll just use the same text entry field." |
490 | +msgstr "" |
491 | + |
492 | +#: quickly-ubuntu-application-tutorial.xml:301(title) |
493 | +msgid "Implementing Open is essentially the reverse of Save:" |
494 | +msgstr "" |
495 | + |
496 | +#: quickly-ubuntu-application-tutorial.xml:301(para) |
497 | +msgid "<placeholder-1/> Follow these steps:" |
498 | +msgstr "" |
499 | + |
500 | +#: quickly-ubuntu-application-tutorial.xml:305(para) |
501 | +msgid "Add the open_file signal to the menu item in Glade." |
502 | +msgstr "" |
503 | + |
504 | +#: quickly-ubuntu-application-tutorial.xml:314(para) |
505 | +msgid "If there is a match, pull out the text and display it in the text view." |
506 | +msgstr "" |
507 | + |
508 | +#: quickly-ubuntu-application-tutorial.xml:317(para) |
509 | +msgid "So the open_file function looks like so:" |
510 | +msgstr "" |
511 | + |
512 | +#: quickly-ubuntu-application-tutorial.xml:319(code) |
513 | +msgid "def open_file(self, widget, data=None): #get the name of the document to open title = self.builder.get_object(\"entry1\").get_text() text = \"\" #get all the records record_type = \"http://wiki.ubuntu.com/<placeholder-1/>/JottyDoc\" results = self.database.get_records(record_type = record_type,create_view = True) #get the text if there is a matching title for result in results: document = result.value if document[\"title\"] == title: text = document[\"text\"] #set the UI to display the string buff = self.builder.get_object(\"textview1\").get_buffer() buff.set_text(text)" |
514 | +msgstr "" |
515 | + |
516 | +#: quickly-ubuntu-application-tutorial.xml:337(title) |
517 | +msgid "Implement New" |
518 | +msgstr "" |
519 | + |
520 | +#: quickly-ubuntu-application-tutorial.xml:337(para) |
521 | +msgid "<placeholder-1/> First, add the new_file signal to the menu item in Glade, then add this code to clear out the text:" |
522 | +msgstr "" |
523 | + |
524 | +#: quickly-ubuntu-application-tutorial.xml:340(code) |
525 | +msgid "def new_file(self, widget, data=None): self.builder.get_object(\"entry1\").set_text(\"Note Title\") buff = self.builder.get_object(\"textview1\").get_buffer() buff.set_text(\"\")" |
526 | +msgstr "" |
527 | + |
528 | +#: quickly-ubuntu-application-tutorial.xml:344(para) |
529 | +msgid "To make them work, add these functions to the JottyWindow class, and save. Then go back and connect the functions to the activate signals for the Open and New menu items." |
530 | +msgstr "" |
531 | + |
532 | +#: quickly-ubuntu-application-tutorial.xml:345(ulink) |
533 | +msgid "Complete jotty file" |
534 | +msgstr "" |
535 | + |
536 | +#: quickly-ubuntu-application-tutorial.xml:346(title) |
537 | +msgid "Saving Your Work" |
538 | +msgstr "" |
539 | + |
540 | +#: quickly-ubuntu-application-tutorial.xml:346(para) |
541 | +msgid "<placeholder-1/> When <application>Quickly</application> created your application, it automatically added it to Bazaar, a source code versioning system. You can use Bazaar to roll back mistake, see code history, compare versions, etc... <application>Quickly</application> has a convenience function for backing up your work:" |
542 | +msgstr "" |
543 | + |
544 | +#: quickly-ubuntu-application-tutorial.xml:348(code) |
545 | +msgid "<placeholder-1/> save \"First working version of Jotty\"" |
546 | +msgstr "" |
547 | + |
548 | +#: quickly-ubuntu-application-tutorial.xml:351(para) |
549 | +msgid "This will call <code>bzr add</code> and then <code>bzr commit -m [your message]</code> for you." |
550 | +msgstr "" |
551 | + |
552 | +#: quickly-ubuntu-application-tutorial.xml:354(title) |
553 | +msgid "Introduction to <application>Quickly</application> Part 2" |
554 | +msgstr "" |
555 | + |
556 | +#: quickly-ubuntu-application-tutorial.xml:355(para) |
557 | +msgid "In part 1, we created an application that can read and write text files, and persist them in the couchdb backend. However, the application has a hideous usability flaw, in the text box for specifying titles when saving and opening files is very confusing. In part 2, we'll fix that by adding a save and an open dialog." |
558 | +msgstr "" |
559 | + |
560 | +#: quickly-ubuntu-application-tutorial.xml:357(title) |
561 | +msgid "Creating a <application>Quickly</application> Dialog" |
562 | +msgstr "" |
563 | + |
564 | +#: quickly-ubuntu-application-tutorial.xml:358(title) |
565 | +msgid "Creating the Empty Dialog" |
566 | +msgstr "" |
567 | + |
568 | +#: quickly-ubuntu-application-tutorial.xml:358(para) |
569 | +msgid "<placeholder-1/> It's simple to add an empty, but working dialog to your project. Simply specify the name of the new dialog, and it will be added automatically. Assuming that you are in the jotty project directory:" |
570 | +msgstr "" |
571 | + |
572 | +#: quickly-ubuntu-application-tutorial.xml:360(code) |
573 | +msgid "<placeholder-1/> dialog save" |
574 | +msgstr "" |
575 | + |
576 | +#: quickly-ubuntu-application-tutorial.xml:363(para) |
577 | +msgid "This will add the dialog to your project." |
578 | +msgstr "" |
579 | + |
580 | +#: quickly-ubuntu-application-tutorial.xml:364(title) quickly-ubuntu-application-tutorial.xml:479(title) |
581 | +msgid "Editing the New Dialog" |
582 | +msgstr "" |
583 | + |
584 | +#: quickly-ubuntu-application-tutorial.xml:364(para) |
585 | +msgid "<placeholder-1/> To edit the UI for the dialog, you'll need to load it into Glade again. If you already have an instance of glade running, you might want to go ahead and close it first, as it may get confusing if you have more than one open at a time. After closing glade, simply open it again:" |
586 | +msgstr "" |
587 | + |
588 | +#: quickly-ubuntu-application-tutorial.xml:366(code) |
589 | +msgid "<placeholder-1/> Design" |
590 | +msgstr "" |
591 | + |
592 | +#: quickly-ubuntu-application-tutorial.xml:369(para) |
593 | +msgid "Then use the project menu to switch to newly created SaveDialog.ui file." |
594 | +msgstr "" |
595 | + |
596 | +#: quickly-ubuntu-application-tutorial.xml:373(para) |
597 | +msgid "Then add some widgets for the UI. Start with a Vertical Box (VBox) with two items. Put a label in the top, and an HBox in the bottom slot. In the HBox, add a label and an edit widget, just like you did for JottyWindow in part 1. Set the padding and expand properties as well." |
598 | +msgstr "" |
599 | + |
600 | +#: quickly-ubuntu-application-tutorial.xml:377(title) |
601 | +msgid "Code the Dialog" |
602 | +msgstr "" |
603 | + |
604 | +#: quickly-ubuntu-application-tutorial.xml:377(para) |
605 | +msgid "<placeholder-1/> You can use the \"<application>Quickly</application> edit\" command to open the SaveDialog.py file. This dialog needs very little additional code to work. Essentially, you just need a way to retrieve the string specified by the user. We'll add a qiuck accessor method for this:" |
606 | +msgstr "" |
607 | + |
608 | +#: quickly-ubuntu-application-tutorial.xml:380(code) |
609 | +msgid "@property def title_text(self): return self.builder.get_object(\"entry1\").get_text()" |
610 | +msgstr "" |
611 | + |
612 | +#: quickly-ubuntu-application-tutorial.xml:383(para) |
613 | +msgid "We don't need to write any code for the Ok and Cancel buttons, as they were automatically hooked up by <application>Quickly</application> when it created the dialog." |
614 | +msgstr "" |
615 | + |
616 | +#: quickly-ubuntu-application-tutorial.xml:384(para) |
617 | +msgid "Before we go on to invoking the dialog, delete HBox from JottyWindow that holds the text entry and label, as we won't be needing those." |
618 | +msgstr "" |
619 | + |
620 | +#: quickly-ubuntu-application-tutorial.xml:388(title) |
621 | +msgid "Calling the Save Dialog" |
622 | +msgstr "" |
623 | + |
624 | +#: quickly-ubuntu-application-tutorial.xml:388(para) |
625 | +msgid "<placeholder-1/> To use the dialog in JottyWindow, we need to follow these steps:" |
626 | +msgstr "" |
627 | + |
628 | +#: quickly-ubuntu-application-tutorial.xml:392(para) |
629 | +msgid "Import SaveDialog in JottyWindow" |
630 | +msgstr "" |
631 | + |
632 | +#: quickly-ubuntu-application-tutorial.xml:395(para) |
633 | +msgid "In the save_file function, create an instance of SaveDialog" |
634 | +msgstr "" |
635 | + |
636 | +#: quickly-ubuntu-application-tutorial.xml:398(para) quickly-ubuntu-application-tutorial.xml:558(para) |
637 | +msgid "Run the Dialog" |
638 | +msgstr "" |
639 | + |
640 | +#: quickly-ubuntu-application-tutorial.xml:401(para) |
641 | +msgid "Get the String" |
642 | +msgstr "" |
643 | + |
644 | +#: quickly-ubuntu-application-tutorial.xml:404(para) quickly-ubuntu-application-tutorial.xml:564(para) |
645 | +msgid "Destroy the dialog" |
646 | +msgstr "" |
647 | + |
648 | +#: quickly-ubuntu-application-tutorial.xml:408(title) |
649 | +msgid "Importing the SaveDialog" |
650 | +msgstr "" |
651 | + |
652 | +#: quickly-ubuntu-application-tutorial.xml:408(para) |
653 | +msgid "<placeholder-1/> Add the SaveDialog to the list of the imported modules at the top of the bin file of your project, so it looks like this:" |
654 | +msgstr "" |
655 | + |
656 | +#: quickly-ubuntu-application-tutorial.xml:410(code) |
657 | +msgid "from jotty import AboutJottyDialog, PreferencesJottyDialog, SaveDialog" |
658 | +msgstr "" |
659 | + |
660 | +#: quickly-ubuntu-application-tutorial.xml:414(title) quickly-ubuntu-application-tutorial.xml:583(title) |
661 | +msgid "Create an instance of the dialog and run it" |
662 | +msgstr "" |
663 | + |
664 | +#: quickly-ubuntu-application-tutorial.xml:414(para) |
665 | +msgid "<placeholder-1/> When the user chooses Save, we want to open the SaveDialog and collect the title of the note from the user. So we need to modify our save_file function." |
666 | +msgstr "" |
667 | + |
668 | +#: quickly-ubuntu-application-tutorial.xml:417(para) |
669 | +msgid "To create an instance of the dialog, use the NewSaveDialog() function in the SaveDialog module. It's important that you don't create an instance of SaveDialog directly, as it won't have a chance to load up it's UI that way, and it won't work. So whenever you use a <application>Quickly</application> dialog, do it like this:" |
670 | +msgstr "" |
671 | + |
672 | +#: quickly-ubuntu-application-tutorial.xml:418(code) |
673 | +msgid "saver = SaveDialog.NewSaveDialog()" |
674 | +msgstr "" |
675 | + |
676 | +#: quickly-ubuntu-application-tutorial.xml:421(para) |
677 | +msgid "To make the dialog appear, simply use the run() method. However, we want to check the result, so we'll need to store that in a variable. After it runs, we want to collect the string from the user, like this:" |
678 | +msgstr "" |
679 | + |
680 | +#: quickly-ubuntu-application-tutorial.xml:422(code) |
681 | +msgid "result = saver.run() title = saver.title_text" |
682 | +msgstr "" |
683 | + |
684 | +#: quickly-ubuntu-application-tutorial.xml:426(title) |
685 | +msgid "Clean up the dialog" |
686 | +msgstr "" |
687 | + |
688 | +#: quickly-ubuntu-application-tutorial.xml:426(para) |
689 | +msgid "<placeholder-1/> We need to tell the dialog to not show itself anymore. We could call saver.hide() to make it hide, but since we don't need it hanging around, we'll just destroy it. Before we go on, though, we need to ensure that the user actually wants to save, so if we didn't get the Ok result, we should just return out of the function:" |
690 | +msgstr "" |
691 | + |
692 | +#: quickly-ubuntu-application-tutorial.xml:429(code) |
693 | +msgid "saver.destroy() if result != gtk.RESPONSE_OK: return" |
694 | +msgstr "" |
695 | + |
696 | +#: quickly-ubuntu-application-tutorial.xml:433(para) |
697 | +msgid "Since we're now getting the title from the dialog instead of the text entry, we should delete the line of the code that sents it from entry1. So except for the addition of the dialog code, the save_file function looks pretty much the same as it did in part 1:" |
698 | +msgstr "" |
699 | + |
700 | +#: quickly-ubuntu-application-tutorial.xml:436(code) |
701 | +msgid "def save_file(self, widget, data=None): #get the titel from the user saver = SaveDialog.NewSaveDialog() result = saver.run() title = saver.title_text saver.destroy() if result != gtk.RESPONSE_OK: return #get the text to save buff = self.builder.get_object(\"textview1\").get_buffer() start_iter = buff.get_start_iter() end_iter = buff.get_end_iter() text = buff.get_text(start_iter,end_iter) #get all the records record_type = \"http://wiki.ubuntu.com/<placeholder-1/>/JottyDoc\" results = self.database.get_records(record_type = record_type,create_view = True) #update a record that has the same title for result in results: record = result.value if record[\"title\"] == title: key = result.key self.database.update_fields(key, {\"text\":text}) return #if no records had the title, create it new_rec = Record({\"record_type\":record_type,\"title\":title, \"text\":text}) self.database.put_record(new_rec)" |
702 | +msgstr "" |
703 | + |
704 | +#: quickly-ubuntu-application-tutorial.xml:467(para) |
705 | +msgid "Now when we choose save, we get the SaveDialog instead:" |
706 | +msgstr "" |
707 | + |
708 | +#: quickly-ubuntu-application-tutorial.xml:472(title) |
709 | +msgid "Creating a Dialog with a CouchGrid" |
710 | +msgstr "" |
711 | + |
712 | +#: quickly-ubuntu-application-tutorial.xml:472(para) |
713 | +msgid "<placeholder-1/> We'll use a similar approach in the Open dialog that we did with Save. However, there is one big difference, we want to provide the user with a list of documents that you could choose to open. We'll use a widget called CouchGrid, which is included in the desktopcouch api for this." |
714 | +msgstr "" |
715 | + |
716 | +#: quickly-ubuntu-application-tutorial.xml:475(title) |
717 | +msgid "Create the Open Dialog" |
718 | +msgstr "" |
719 | + |
720 | +#: quickly-ubuntu-application-tutorial.xml:476(code) |
721 | +msgid "<placeholder-1/> dialog open" |
722 | +msgstr "" |
723 | + |
724 | +#: quickly-ubuntu-application-tutorial.xml:479(para) |
725 | +msgid "<placeholder-1/> Start out by closing, and then reopening glade again:" |
726 | +msgstr "" |
727 | + |
728 | +#: quickly-ubuntu-application-tutorial.xml:484(para) |
729 | +msgid "Start by adding a VBox and a label in the same manner as in the Save Dialog above. Leave an empty space in the VBox. We will use code to put the CouchGrid there." |
730 | +msgstr "" |
731 | + |
732 | +#: quickly-ubuntu-application-tutorial.xml:488(title) |
733 | +msgid "Coding the Open Dialog" |
734 | +msgstr "" |
735 | + |
736 | +#: quickly-ubuntu-application-tutorial.xml:489(title) |
737 | +msgid "Creating and Adding a CouchGrid" |
738 | +msgstr "" |
739 | + |
740 | +#: quickly-ubuntu-application-tutorial.xml:489(para) |
741 | +msgid "<placeholder-1/> It just takes a little bit of code to add a CouchGrid to the dialog. We need to:" |
742 | +msgstr "" |
743 | + |
744 | +#: quickly-ubuntu-application-tutorial.xml:493(para) |
745 | +msgid "Import the CouchGrid class." |
746 | +msgstr "" |
747 | + |
748 | +#: quickly-ubuntu-application-tutorial.xml:496(para) |
749 | +msgid "Create a CouchGrid pointing at the jotty database, and the desired record type." |
750 | +msgstr "" |
751 | + |
752 | +#: quickly-ubuntu-application-tutorial.xml:499(para) |
753 | +msgid "Add the CouchGrid to the dialog." |
754 | +msgstr "" |
755 | + |
756 | +#: quickly-ubuntu-application-tutorial.xml:503(title) |
757 | +msgid "Import the CouchGrid class" |
758 | +msgstr "" |
759 | + |
760 | +#: quickly-ubuntu-application-tutorial.xml:503(para) |
761 | +msgid "<placeholder-1/> CouchGrid is part of the desktopcouch records api, so we import it like this:" |
762 | +msgstr "" |
763 | + |
764 | +#: quickly-ubuntu-application-tutorial.xml:505(code) |
765 | +msgid "from desktopcouch.records.couchgrid import CouchGrid" |
766 | +msgstr "" |
767 | + |
768 | +#: quickly-ubuntu-application-tutorial.xml:508(title) |
769 | +msgid "Create the CouchGrid" |
770 | +msgstr "" |
771 | + |
772 | +#: quickly-ubuntu-application-tutorial.xml:508(para) |
773 | +msgid "<placeholder-1/> A CouchGrid needs to know three things, the name of the database, the name of the record type, and the name of the keys to use. \"keys\" is a list of fields that the widget will display, and by default will also use the same text for the heading of any columns. This set up should be done in the OpenDialog's finish_initalizing function. All this is easily done in code like this:" |
774 | +msgstr "" |
775 | + |
776 | +#: quickly-ubuntu-application-tutorial.xml:512(code) |
777 | +msgid "database = \"jotty\" keys = [\"title\"] record_type = \"http://wiki.ubuntu.com/<placeholder-1/>/JottyDoc\" self.couchgrid = CouchGrid(database, record_type=record_type,keys=keys)" |
778 | +msgstr "" |
779 | + |
780 | +#: quickly-ubuntu-application-tutorial.xml:516(title) |
781 | +msgid "Add the CouchGrid to the Dialog" |
782 | +msgstr "" |
783 | + |
784 | +#: quickly-ubuntu-application-tutorial.xml:516(para) |
785 | +msgid "<placeholder-1/> we added the VBox to the dialog, we left an open space at the bottom. We'll use this by \"packing\" the CouchGrid into the VBox. We need to show it as well. So add the following lines to the finish_initializing function as well:" |
786 | +msgstr "" |
787 | + |
788 | +#: quickly-ubuntu-application-tutorial.xml:520(code) |
789 | +msgid "self.couchgrid.show() self.builder.get_object(\"vbox1\").pack_end(self.couchgrid)" |
790 | +msgstr "" |
791 | + |
792 | +#: quickly-ubuntu-application-tutorial.xml:523(title) |
793 | +msgid "Create the get_selection function" |
794 | +msgstr "" |
795 | + |
796 | +#: quickly-ubuntu-application-tutorial.xml:523(para) |
797 | +msgid "<placeholder-1/> The dialog still needs a bit more code to work. It needs to return the user's selection, if there is one. To do this, we need to ask the CouchGrid what is selected. This is easy using the widgets selected_record_ids function. But the CouchGrid supports multiple selection, so we'll do the following:" |
798 | +msgstr "" |
799 | + |
800 | +#: quickly-ubuntu-application-tutorial.xml:527(para) |
801 | +msgid "Use a decorator to define the function as a property accessor." |
802 | +msgstr "" |
803 | + |
804 | +#: quickly-ubuntu-application-tutorial.xml:530(para) |
805 | +msgid "Get all the selected record ids." |
806 | +msgstr "" |
807 | + |
808 | +#: quickly-ubuntu-application-tutorial.xml:533(para) |
809 | +msgid "If none are selected, return None." |
810 | +msgstr "" |
811 | + |
812 | +#: quickly-ubuntu-application-tutorial.xml:536(para) |
813 | +msgid "Pick the first one and return it." |
814 | +msgstr "" |
815 | + |
816 | +#: quickly-ubuntu-application-tutorial.xml:539(para) |
817 | +msgid "So the function to add to OpenDialog looks like this:" |
818 | +msgstr "" |
819 | + |
820 | +#: quickly-ubuntu-application-tutorial.xml:541(code) |
821 | +msgid "@property def selected_record_id(self): ids = self.couchgrid.selected_record_ids if len(ids) < 1: return None else: return ids[0]" |
822 | +msgstr "" |
823 | + |
824 | +#: quickly-ubuntu-application-tutorial.xml:548(title) |
825 | +msgid "Using the Open Dialog" |
826 | +msgstr "" |
827 | + |
828 | +#: quickly-ubuntu-application-tutorial.xml:548(para) |
829 | +msgid "<placeholder-1/> Now we want to use the Open Dialog in the JottyWindow open_file function. To use it,we'll follow these steps:" |
830 | +msgstr "" |
831 | + |
832 | +#: quickly-ubuntu-application-tutorial.xml:552(para) |
833 | +msgid "Import OpenDialog in JottyWindow" |
834 | +msgstr "" |
835 | + |
836 | +#: quickly-ubuntu-application-tutorial.xml:555(para) |
837 | +msgid "In the open_file function, create an instance of OpenDialog" |
838 | +msgstr "" |
839 | + |
840 | +#: quickly-ubuntu-application-tutorial.xml:561(para) |
841 | +msgid "Get the id for the selected title." |
842 | +msgstr "" |
843 | + |
844 | +#: quickly-ubuntu-application-tutorial.xml:567(para) |
845 | +msgid "Check the response before proceeding" |
846 | +msgstr "" |
847 | + |
848 | +#: quickly-ubuntu-application-tutorial.xml:570(para) quickly-ubuntu-application-tutorial.xml:600(title) |
849 | +msgid "Use the id to get the record from CouchDB" |
850 | +msgstr "" |
851 | + |
852 | +#: quickly-ubuntu-application-tutorial.xml:573(para) quickly-ubuntu-application-tutorial.xml:609(title) |
853 | +msgid "Update the UI" |
854 | +msgstr "" |
855 | + |
856 | +#: quickly-ubuntu-application-tutorial.xml:577(title) |
857 | +msgid "Import OpenDialog" |
858 | +msgstr "" |
859 | + |
860 | +#: quickly-ubuntu-application-tutorial.xml:577(para) |
861 | +msgid "<placeholder-1/> Just like the SaveDialog, add the import line to the list of imports:" |
862 | +msgstr "" |
863 | + |
864 | +#: quickly-ubuntu-application-tutorial.xml:579(code) |
865 | +msgid "from jotty import AboutJottyDialog, PreferencesJottyDialog, SaveDialog, OpenDialog" |
866 | +msgstr "" |
867 | + |
868 | +#: quickly-ubuntu-application-tutorial.xml:583(para) |
869 | +msgid "<placeholder-1/> So now we're ready to call the dialog from the JottyWindow's open_file function. Creating the OpenDialog is exactly the same as creating the SaveDialog, except we also want to tell it to load the titles before we run it:" |
870 | +msgstr "" |
871 | + |
872 | +#: quickly-ubuntu-application-tutorial.xml:586(code) |
873 | +msgid "opener = OpenDialog.NewOpenDialog() result = opener.run()" |
874 | +msgstr "" |
875 | + |
876 | +#: quickly-ubuntu-application-tutorial.xml:589(title) |
877 | +msgid "Get the id for the selected title" |
878 | +msgstr "" |
879 | + |
880 | +#: quickly-ubuntu-application-tutorial.xml:589(para) |
881 | +msgid "<placeholder-1/> Now use the property that we created to retrieve the title and text from the dialog. Don't forget to check the response type before going on." |
882 | +msgstr "" |
883 | + |
884 | +#: quickly-ubuntu-application-tutorial.xml:592(code) |
885 | +msgid "rec_id = opener.selected_record_id #close the dialog, and check whether to proceed opener.destroy() if result != gtk.RESPONSE_OK: return" |
886 | +msgstr "" |
887 | + |
888 | +#: quickly-ubuntu-application-tutorial.xml:600(para) |
889 | +msgid "<placeholder-1/> If nothing was selected, we'll just return. Otherwise, we'll retrieve the record from CouchDB and pull out the text for the document:" |
890 | +msgstr "" |
891 | + |
892 | +#: quickly-ubuntu-application-tutorial.xml:603(code) |
893 | +msgid "#get the record from CouchDB and extract the text if rec_id == None: return record = self.database.get_record(rec_id) text = record[\"text\"]" |
894 | +msgstr "" |
895 | + |
896 | +#: quickly-ubuntu-application-tutorial.xml:609(para) |
897 | +msgid "<placeholder-1/> Now just put the text into the texview:" |
898 | +msgstr "" |
899 | + |
900 | +#: quickly-ubuntu-application-tutorial.xml:612(code) |
901 | +msgid "#set the UI to display the string buff = self.builder.get_object(\"textview1\").get_buffer() buff.set_text(text)" |
902 | +msgstr "" |
903 | + |
904 | +#: quickly-ubuntu-application-tutorial.xml:615(para) |
905 | +msgid "That's all there is to it. So the whole open_file function looks like this:" |
906 | +msgstr "" |
907 | + |
908 | +#: quickly-ubuntu-application-tutorial.xml:617(code) |
909 | +msgid "def open_file(self, widget, data=None): #run the open dialog opener = OpenDialog.NewOpenDialog() result = opener.run() #get the record id from the dialog rec_id = opener.selected_record_id #close the dialog, and check whether to proceed opener.destroy() if result != gtk.RESPONSE_OK: return #get the record from CouchDB and extract the text if rec_id == None: return record = self.database.get_record(rec_id) text = record[\"text\"] #set the UI to display the string buff = self.builder.get_object(\"textview1\").get_buffer() buff.set_text(text)" |
910 | +msgstr "" |
911 | + |
912 | +#: quickly-ubuntu-application-tutorial.xml:639(para) |
913 | +msgid "Now users get a nice open dialog:" |
914 | +msgstr "" |
915 | + |
916 | +#: quickly-ubuntu-application-tutorial.xml:644(para) |
917 | +msgid "However, the application is not complete. There are a few things left for you to do:" |
918 | +msgstr "" |
919 | + |
920 | +#: quickly-ubuntu-application-tutorial.xml:647(para) |
921 | +msgid "Set the title of the JottyWindow to display the note title. Try self.set_text(title)." |
922 | +msgstr "" |
923 | + |
924 | +#: quickly-ubuntu-application-tutorial.xml:650(para) |
925 | +msgid "The Save command works more like \"Save As\". The application probably shouldn't pop up a SaveDialog every time you want to save. If it's already been saved, you probably just want to save it, but use a SaveDialog when the user choose Save As, or is saving a document for the first time." |
926 | +msgstr "" |
927 | + |
928 | +#: quickly-ubuntu-application-tutorial.xml:653(para) |
929 | +msgid "The OpenDialog should probably return when the user double clicks on an item in the list. Try connecting to the \"select-cursor-row\" signal on the TreeView, and calling self.response(gtk.RESPONSE_OK) in the handler." |
930 | +msgstr "" |
931 | + |
932 | +#: quickly-ubuntu-application-tutorial.xml:656(para) |
933 | +msgid "Perhaps the Ok button in the OpenDialog should be disabled if nothing is selected. Try setting the \"sensitivity\" in Glade, and the set_sensitive function for the Ok button." |
934 | +msgstr "" |
935 | + |
936 | +#: quickly-ubuntu-application-tutorial.xml:659(para) |
937 | +msgid "It would be more consistent for the Open and Close dialogs to have \"Open\" and \"Close\" for buttons instead of \"Ok\". You can set a different type in the properties window in Glade." |
938 | +msgstr "" |
939 | + |
940 | +#: quickly-ubuntu-application-tutorial.xml:662(para) |
941 | +msgid "Loading every document into the open dialog is probably a bit inefficient. Perhaps storing the document id and using that to retrieve the document would be a better implementation." |
942 | +msgstr "" |
943 | + |
944 | +#: quickly-ubuntu-application-tutorial.xml:668(title) |
945 | +msgid "Introduction to <application>Quickly</application> Part 3" |
946 | +msgstr "" |
947 | + |
948 | +#: quickly-ubuntu-application-tutorial.xml:669(para) |
949 | +msgid "In parts 1 and 2, we showed how to create a simple Ubuntu application using <application>Quickly</application>. This section will cover how to package an application so that it is easy for you to share, and easy for other people to install." |
950 | +msgstr "" |
951 | + |
952 | +#: quickly-ubuntu-application-tutorial.xml:670(title) |
953 | +msgid "License your Application" |
954 | +msgstr "" |
955 | + |
956 | +#: quickly-ubuntu-application-tutorial.xml:670(para) |
957 | +msgid "<placeholder-1/> It's important to license your code so users and other programmers know their rights in terms of redistributing or modifying it. To <application>Quickly</application> grant a GPL license to your code, simply:" |
958 | +msgstr "" |
959 | + |
960 | +#: quickly-ubuntu-application-tutorial.xml:674(para) |
961 | +msgid "Specify your name and email address in the Copyright file." |
962 | +msgstr "" |
963 | + |
964 | +#: quickly-ubuntu-application-tutorial.xml:677(para) |
965 | +msgid "Run the \"license\" command." |
966 | +msgstr "" |
967 | + |
968 | +#: quickly-ubuntu-application-tutorial.xml:681(title) |
969 | +msgid "Specify your name and email" |
970 | +msgstr "" |
971 | + |
972 | +#: quickly-ubuntu-application-tutorial.xml:681(para) |
973 | +msgid "<placeholder-1/> When <application>Quickly</application> created your ubuntu application, it added a file named Copyright in the top level of the directory. Open this file in your text editor, and modify the top line so it has your name and email included. Be sure not to modify other lines as it will interfere with the next step. For example, I would change the entire file to look like this:" |
974 | +msgstr "" |
975 | + |
976 | +#: quickly-ubuntu-application-tutorial.xml:684(code) |
977 | +msgid "# Copyright (C) 2009 Rick Spencer rick.spencer@canonical.com ### BEGIN AUTOMATIC LICENSE GENERATION ### END AUTOMATIC LICENSE GENERATION" |
978 | +msgstr "" |
979 | + |
980 | +#: quickly-ubuntu-application-tutorial.xml:688(title) |
981 | +msgid "Run the \"License\" Command" |
982 | +msgstr "" |
983 | + |
984 | +#: quickly-ubuntu-application-tutorial.xml:688(para) |
985 | +msgid "<placeholder-1/> By default, <application>Quickly</application> will use a GPL 3 license for your project. To use this license, use this command:" |
986 | +msgstr "" |
987 | + |
988 | +#: quickly-ubuntu-application-tutorial.xml:690(code) quickly-ubuntu-application-tutorial.xml:712(code) |
989 | +msgid "<placeholder-1/> license" |
990 | +msgstr "" |
991 | + |
992 | +#: quickly-ubuntu-application-tutorial.xml:693(para) |
993 | +msgid "This will add the GPL 3 license to all of your code files that you've added to your project using <application>Quickly</application>." |
994 | +msgstr "" |
995 | + |
996 | +#: quickly-ubuntu-application-tutorial.xml:694(para) |
997 | +msgid "Keep in mind a couple of things:" |
998 | +msgstr "" |
999 | + |
1000 | +#: quickly-ubuntu-application-tutorial.xml:697(para) |
1001 | +msgid "This is a one way trip. Once you license the project, changes to the license must be done manually." |
1002 | +msgstr "" |
1003 | + |
1004 | +#: quickly-ubuntu-application-tutorial.xml:700(para) |
1005 | +msgid "If you prefer a GPL 2 license, you can specify that when you issue the license command:" |
1006 | +msgstr "" |
1007 | + |
1008 | +#: quickly-ubuntu-application-tutorial.xml:701(code) |
1009 | +msgid "<placeholder-1/> license GPL-2" |
1010 | +msgstr "" |
1011 | + |
1012 | +#: quickly-ubuntu-application-tutorial.xml:706(para) |
1013 | +msgid "<application>Quickly</application> doesn't care what license you use, but only knows natively what files and headers to include for BSD, GPL-2, GPL-3, LGPL-2 and LGPL-3. If you prefer another license, you can simply add whatever you license you like by adding your own license in the Copyright file:" |
1014 | +msgstr "" |
1015 | + |
1016 | +#: quickly-ubuntu-application-tutorial.xml:708(code) |
1017 | +msgid "### BEGIN AUTOMATIC LICENSE GENERATION # My personal license here ### END AUTOMATIC LICENSE GENERATION" |
1018 | +msgstr "" |
1019 | + |
1020 | +#: quickly-ubuntu-application-tutorial.xml:711(para) |
1021 | +msgid "and then run:" |
1022 | +msgstr "" |
1023 | + |
1024 | +#: quickly-ubuntu-application-tutorial.xml:715(para) |
1025 | +msgid "to license every files." |
1026 | +msgstr "" |
1027 | + |
1028 | +#: quickly-ubuntu-application-tutorial.xml:718(para) |
1029 | +msgid "If you've added code files or other files to your project manually, you will need to add the license to those files manually or add those tags at the beginning of the file:" |
1030 | +msgstr "" |
1031 | + |
1032 | +#: quickly-ubuntu-application-tutorial.xml:720(code) |
1033 | +msgid "### BEGIN LICENSE ### END LICENSE" |
1034 | +msgstr "" |
1035 | + |
1036 | +#: quickly-ubuntu-application-tutorial.xml:725(title) |
1037 | +msgid "Translate Your Application" |
1038 | +msgstr "" |
1039 | + |
1040 | +#: quickly-ubuntu-application-tutorial.xml:725(para) |
1041 | +msgid "<placeholder-1/> To allow for users from other countries to use your application you may want to translate it. Glade automatically creates a pot file for you but to translate strings in your code you have to:" |
1042 | +msgstr "" |
1043 | + |
1044 | +#: quickly-ubuntu-application-tutorial.xml:727(code) |
1045 | +msgid "import gettext" |
1046 | +msgstr "" |
1047 | + |
1048 | +#: quickly-ubuntu-application-tutorial.xml:728(code) |
1049 | +msgid "gettext.gettext(\"What you want translated\")" |
1050 | +msgstr "" |
1051 | + |
1052 | +#: quickly-ubuntu-application-tutorial.xml:730(title) |
1053 | +msgid "Specify Application Settings" |
1054 | +msgstr "" |
1055 | + |
1056 | +#: quickly-ubuntu-application-tutorial.xml:730(para) |
1057 | +msgid "<placeholder-1/> You should personalize your application a little before creating the archive. This is very easy to do, as all of the files that you need have already been created, and only need a few lines changed to make them your own. To do this you should:" |
1058 | +msgstr "" |
1059 | + |
1060 | +#: quickly-ubuntu-application-tutorial.xml:734(para) |
1061 | +msgid "Personalize the Application Icon" |
1062 | +msgstr "" |
1063 | + |
1064 | +#: quickly-ubuntu-application-tutorial.xml:735(para) quickly-ubuntu-application-tutorial.xml:749(title) |
1065 | +msgid "Edit the Desktop File" |
1066 | +msgstr "" |
1067 | + |
1068 | +#: quickly-ubuntu-application-tutorial.xml:736(para) |
1069 | +msgid "Edit the setup.py File" |
1070 | +msgstr "" |
1071 | + |
1072 | +#: quickly-ubuntu-application-tutorial.xml:739(title) |
1073 | +msgid "Personalize your Application Icon" |
1074 | +msgstr "" |
1075 | + |
1076 | +#: quickly-ubuntu-application-tutorial.xml:739(para) |
1077 | +msgid "<placeholder-1/> When users install your application, Ubuntu will display an icon next to it in the menus. You can create your own icon or edit the file called \"icon.png\" in the media directory (jotty/data/media). Ubuntu comes with a great image editing program called \"Gimp.\" So you can go:" |
1078 | +msgstr "" |
1079 | + |
1080 | +#: quickly-ubuntu-application-tutorial.xml:741(code) |
1081 | +msgid "gimp data/media/icon.png" |
1082 | +msgstr "" |
1083 | + |
1084 | +#: quickly-ubuntu-application-tutorial.xml:747(para) |
1085 | +msgid "If you don't personalize the icon, it's ok, your app will just have the default icon, such as in the image below." |
1086 | +msgstr "" |
1087 | + |
1088 | +#: quickly-ubuntu-application-tutorial.xml:749(para) |
1089 | +msgid "<placeholder-1/> By default, <application>Quickly</application> Ubuntu applications are classified as \"utilities\", so they show up under the Accessories menu in Ubuntu. If we wanted to make Jotty show up in another category, we can do this by editing the desktop file. A desktop file is a file that describes your application to a Linux desktop. The file \"jottydesktop.in\" was automatically created in the jotty project directory. To change Jotty from a Utility to an Office application, edit jotty.desktop.in and change this:" |
1090 | +msgstr "" |
1091 | + |
1092 | +#: quickly-ubuntu-application-tutorial.xml:753(code) |
1093 | +msgid "[Desktop Entry] Name=Jotty Comment=Jotty application Categories=GNOME;Utility; Exec=jotty Icon=jotty Terminal=false Type=Application" |
1094 | +msgstr "" |
1095 | + |
1096 | +#: quickly-ubuntu-application-tutorial.xml:763(para) |
1097 | +msgid "to this:" |
1098 | +msgstr "" |
1099 | + |
1100 | +#: quickly-ubuntu-application-tutorial.xml:767(code) |
1101 | +msgid "[Desktop Entry] Name=Jotty Comment=Jotty application Categories=GNOME;Office; Exec=jotty Icon=jotty Terminal=false Type=Application" |
1102 | +msgstr "" |
1103 | + |
1104 | +#: quickly-ubuntu-application-tutorial.xml:775(para) |
1105 | +msgid "There are lots more categories that you can use, all defined by the FreeDesktop spec. You can see the complete list in the <ulink url=\"http://standards.freedesktop.org/menu-spec/latest/apa.html\">menu spec</ulink>." |
1106 | +msgstr "" |
1107 | + |
1108 | +#: quickly-ubuntu-application-tutorial.xml:779(title) |
1109 | +msgid "Edit Setup.py" |
1110 | +msgstr "" |
1111 | + |
1112 | +#: quickly-ubuntu-application-tutorial.xml:778(para) |
1113 | +msgid "<placeholder-1/> Finally, you should include some information in the setup.py file to tell your users a little about yourself. The setup.py file was created for you, just like the desktop file. Most of of the setup.py file shouldn't be modified, as it is just boiler plate that makes your application work properly after it has been installed. However, there is a section at the bottom of the setup.py file that you should edit to describe yourself and the application." |
1114 | +msgstr "" |
1115 | + |
1116 | +#: quickly-ubuntu-application-tutorial.xml:782(para) |
1117 | +msgid "So I would change this section:" |
1118 | +msgstr "" |
1119 | + |
1120 | +#: quickly-ubuntu-application-tutorial.xml:786(code) |
1121 | +msgid "DistUtilsExtra.auto.setup( name='jotty', version='0.1', license='GPL v3', #author='Your Name', #author_email='email@ubuntu.com', #description='UI for managing …', #long_description='Here a longer description', #url='https://launchpad.net/jotty', cmdclass={'install': InstallAndUpdateDataDirectory} )" |
1122 | +msgstr "" |
1123 | + |
1124 | +#: quickly-ubuntu-application-tutorial.xml:798(para) |
1125 | +msgid "To look like this:" |
1126 | +msgstr "" |
1127 | + |
1128 | +#: quickly-ubuntu-application-tutorial.xml:802(code) |
1129 | +msgid "DistUtilsExtra.auto.setup( name='jotty', version='0.1', license='GPL v3', author='Rick Spencer', author_email='rick.spencer@canonical.com', description='Note taking application', long_description='Note taking application that uses CouchDB as the backend to support easy replication across users and computers.', #url='https://launchpad.net/jotty', cmdclass={'install': InstallAndUpdateDataDirectory} )" |
1130 | +msgstr "" |
1131 | + |
1132 | +#: quickly-ubuntu-application-tutorial.xml:813(para) |
1133 | +msgid "Note that the license has already been set up for you. author and author_email are updated each time you connect to Launchpad (with <application>Quickly</application> release or <application>Quickly</application> share) with your Launchpad real name and preferred email adress." |
1134 | +msgstr "" |
1135 | + |
1136 | +#: quickly-ubuntu-application-tutorial.xml:814(para) |
1137 | +msgid "Notice that Jotty doesn't have a web page yet, so I just left that line commented out. Also, you don't have to increment version number as <application>Quickly</application> share and <application>Quickly</application> release commands will make it for you.." |
1138 | +msgstr "" |
1139 | + |
1140 | +#: quickly-ubuntu-application-tutorial.xml:818(title) |
1141 | +msgid "Create and Test the Debian Archive" |
1142 | +msgstr "" |
1143 | + |
1144 | +#: quickly-ubuntu-application-tutorial.xml:818(para) |
1145 | +msgid "<placeholder-1/> After personalizing the project, we are now ready to create the package. This is easily done by issuing the package command:" |
1146 | +msgstr "" |
1147 | + |
1148 | +#: quickly-ubuntu-application-tutorial.xml:821(code) quickly-ubuntu-application-tutorial.xml:1023(code) |
1149 | +msgid "<placeholder-1/> package" |
1150 | +msgstr "" |
1151 | + |
1152 | +#: quickly-ubuntu-application-tutorial.xml:824(para) |
1153 | +msgid "This command will take a little while to discover dependencies and create all the required archives, etc... It will also report some errors as we haven't created a PGP key, for instance. None the less, when it is done, the package will be created. Using the file browser, you can see the created package next to the project directory:" |
1154 | +msgstr "" |
1155 | + |
1156 | +#: quickly-ubuntu-application-tutorial.xml:828(para) |
1157 | +msgid "Right now, the specific file we are interested in is \"jotty_0.1_all.deb\". To test it out, double click on it, to open it in Ubuntu's graphical installer program:" |
1158 | +msgstr "" |
1159 | + |
1160 | +#: quickly-ubuntu-application-tutorial.xml:832(para) |
1161 | +msgid "Click \"Install Package\" to see how it installs onto your desktop. After chugging for a bit, you'll see that it is installed in the Applications->Office menu. If you customized your icon, you'll see that the menu uses your custom icon as well." |
1162 | +msgstr "" |
1163 | + |
1164 | +#: quickly-ubuntu-application-tutorial.xml:836(title) |
1165 | +msgid "Now that you have a package" |
1166 | +msgstr "" |
1167 | + |
1168 | +#: quickly-ubuntu-application-tutorial.xml:836(para) |
1169 | +msgid "<placeholder-1/> Now that you've packaged your application, you can share the .deb file. However, if your users install their application this way, and you update the application, your users will have to find this out and resinstall. This hassle can be avoided in Ubuntu by using Personal Package Archives (or PPAs). Distrubuting your applications in this manner is covered in section 4 (not yet available)." |
1170 | +msgstr "" |
1171 | + |
1172 | +#: quickly-ubuntu-application-tutorial.xml:840(title) |
1173 | +msgid "<application>Quickly</application>: <application>Quickly</application> Command Reference" |
1174 | +msgstr "" |
1175 | + |
1176 | +#: quickly-ubuntu-application-tutorial.xml:841(para) |
1177 | +msgid "The ubuntu-application template template contains the following commands." |
1178 | +msgstr "" |
1179 | + |
1180 | +#: quickly-ubuntu-application-tutorial.xml:844(xref) quickly-ubuntu-application-tutorial.xml:877(title) quickly-ubuntu-application-tutorial.xml:878(title) |
1181 | +msgid "create" |
1182 | +msgstr "" |
1183 | + |
1184 | +#: quickly-ubuntu-application-tutorial.xml:847(xref) quickly-ubuntu-application-tutorial.xml:904(title) quickly-ubuntu-application-tutorial.xml:905(title) |
1185 | +msgid "dialog" |
1186 | +msgstr "" |
1187 | + |
1188 | +#: quickly-ubuntu-application-tutorial.xml:850(xref) quickly-ubuntu-application-tutorial.xml:949(title) quickly-ubuntu-application-tutorial.xml:950(title) |
1189 | +msgid "edit" |
1190 | +msgstr "" |
1191 | + |
1192 | +#: quickly-ubuntu-application-tutorial.xml:853(xref) |
1193 | +msgid "design" |
1194 | +msgstr "" |
1195 | + |
1196 | +#: quickly-ubuntu-application-tutorial.xml:856(xref) quickly-ubuntu-application-tutorial.xml:973(title) quickly-ubuntu-application-tutorial.xml:974(title) |
1197 | +msgid "help" |
1198 | +msgstr "" |
1199 | + |
1200 | +#: quickly-ubuntu-application-tutorial.xml:859(xref) quickly-ubuntu-application-tutorial.xml:982(title) quickly-ubuntu-application-tutorial.xml:983(title) |
1201 | +msgid "license" |
1202 | +msgstr "" |
1203 | + |
1204 | +#: quickly-ubuntu-application-tutorial.xml:862(xref) quickly-ubuntu-application-tutorial.xml:1021(title) quickly-ubuntu-application-tutorial.xml:1022(title) |
1205 | +msgid "package" |
1206 | +msgstr "" |
1207 | + |
1208 | +#: quickly-ubuntu-application-tutorial.xml:865(xref) quickly-ubuntu-application-tutorial.xml:1038(title) quickly-ubuntu-application-tutorial.xml:1039(title) |
1209 | +msgid "release" |
1210 | +msgstr "" |
1211 | + |
1212 | +#: quickly-ubuntu-application-tutorial.xml:868(xref) quickly-ubuntu-application-tutorial.xml:1073(title) quickly-ubuntu-application-tutorial.xml:1074(title) |
1213 | +msgid "run" |
1214 | +msgstr "" |
1215 | + |
1216 | +#: quickly-ubuntu-application-tutorial.xml:871(xref) quickly-ubuntu-application-tutorial.xml:1083(title) quickly-ubuntu-application-tutorial.xml:1084(title) |
1217 | +msgid "save" |
1218 | +msgstr "" |
1219 | + |
1220 | +#: quickly-ubuntu-application-tutorial.xml:874(xref) quickly-ubuntu-application-tutorial.xml:1098(title) quickly-ubuntu-application-tutorial.xml:1100(title) |
1221 | +msgid "share" |
1222 | +msgstr "" |
1223 | + |
1224 | +#: quickly-ubuntu-application-tutorial.xml:878(para) quickly-ubuntu-application-tutorial.xml:905(para) quickly-ubuntu-application-tutorial.xml:950(para) quickly-ubuntu-application-tutorial.xml:961(para) quickly-ubuntu-application-tutorial.xml:974(para) quickly-ubuntu-application-tutorial.xml:983(para) quickly-ubuntu-application-tutorial.xml:1022(para) quickly-ubuntu-application-tutorial.xml:1039(para) quickly-ubuntu-application-tutorial.xml:1074(para) quickly-ubuntu-application-tutorial.xml:1084(para) quickly-ubuntu-application-tutorial.xml:1099(para) |
1225 | +msgid "<placeholder-1/> Usage:" |
1226 | +msgstr "" |
1227 | + |
1228 | +#: quickly-ubuntu-application-tutorial.xml:880(code) |
1229 | +msgid "<placeholder-1/> create ubuntu-application path/to/project_name" |
1230 | +msgstr "" |
1231 | + |
1232 | +#: quickly-ubuntu-application-tutorial.xml:882(para) |
1233 | +msgid "where \"project_name\" is one or more words separated by an underscore and path/to can be any existing path." |
1234 | +msgstr "" |
1235 | + |
1236 | +#: quickly-ubuntu-application-tutorial.xml:885(para) |
1237 | +msgid "This will create and run a new project, including Python code, Glade files, and packaging files to make the project work. After creating the project, get started by:" |
1238 | +msgstr "" |
1239 | + |
1240 | +#: quickly-ubuntu-application-tutorial.xml:891(para) |
1241 | +msgid "Changing your working directory to the new project:" |
1242 | +msgstr "" |
1243 | + |
1244 | +#: quickly-ubuntu-application-tutorial.xml:893(code) |
1245 | +msgid "cd path/to/project_name" |
1246 | +msgstr "" |
1247 | + |
1248 | +#: quickly-ubuntu-application-tutorial.xml:895(para) |
1249 | +msgid "Edit the UI with Glade:" |
1250 | +msgstr "" |
1251 | + |
1252 | +#: quickly-ubuntu-application-tutorial.xml:898(para) |
1253 | +msgid "Edit the Python code:" |
1254 | +msgstr "" |
1255 | + |
1256 | +#: quickly-ubuntu-application-tutorial.xml:907(code) |
1257 | +msgid "<placeholder-1/> dialog dialog_name" |
1258 | +msgstr "" |
1259 | + |
1260 | +#: quickly-ubuntu-application-tutorial.xml:908(para) |
1261 | +msgid "where dialog_name is one or more words seperated with underscore" |
1262 | +msgstr "" |
1263 | + |
1264 | +#: quickly-ubuntu-application-tutorial.xml:909(para) |
1265 | +msgid "This will create:" |
1266 | +msgstr "" |
1267 | + |
1268 | +#: quickly-ubuntu-application-tutorial.xml:913(para) |
1269 | +msgid "A subclass of gtk.Dialog called DialogNameDialog in the module DialogNameDialog.py" |
1270 | +msgstr "" |
1271 | + |
1272 | +#: quickly-ubuntu-application-tutorial.xml:916(para) |
1273 | +msgid "A glade file called DialogNameDialog.ui in the ui directory" |
1274 | +msgstr "" |
1275 | + |
1276 | +#: quickly-ubuntu-application-tutorial.xml:919(para) |
1277 | +msgid "A catalog file called dialog_name_dialog.xml also in the ui directory" |
1278 | +msgstr "" |
1279 | + |
1280 | +#: quickly-ubuntu-application-tutorial.xml:922(para) |
1281 | +msgid "To edit the UI for the dialog, run:" |
1282 | +msgstr "" |
1283 | + |
1284 | +#: quickly-ubuntu-application-tutorial.xml:926(para) |
1285 | +msgid "To edit the behavior, run:" |
1286 | +msgstr "" |
1287 | + |
1288 | +#: quickly-ubuntu-application-tutorial.xml:929(para) |
1289 | +msgid "To use the dialog you have to invoke it from another python file:" |
1290 | +msgstr "" |
1291 | + |
1292 | +#: quickly-ubuntu-application-tutorial.xml:933(code) |
1293 | +msgid "Import the dialog import DialogNameDialog" |
1294 | +msgstr "" |
1295 | + |
1296 | +#: quickly-ubuntu-application-tutorial.xml:937(code) |
1297 | +msgid "Create an instance of the dialog dialog = DialogNameDialog.NewDialogNameDialog()" |
1298 | +msgstr "" |
1299 | + |
1300 | +#: quickly-ubuntu-application-tutorial.xml:941(code) |
1301 | +msgid "Run the dialog and hide the dialog result = dialog.run() dialog.hide()" |
1302 | +msgstr "" |
1303 | + |
1304 | +#: quickly-ubuntu-application-tutorial.xml:954(para) |
1305 | +msgid "A convenience command to open all of your python files in your project directory in your default editor, ready for editing." |
1306 | +msgstr "" |
1307 | + |
1308 | +#: quickly-ubuntu-application-tutorial.xml:960(title) quickly-ubuntu-application-tutorial.xml:961(title) |
1309 | +msgid "glade" |
1310 | +msgstr "" |
1311 | + |
1312 | +#: quickly-ubuntu-application-tutorial.xml:964(para) |
1313 | +msgid "Opens Glade UI editor so that you can edit the UI for dialogs and windows in your project. Note that you *must* open Glade in this manner for <application>Quickly</application> to work. If you try to open Glade directly, and the open the UI files, Glade will throw errors and won't open the files." |
1314 | +msgstr "" |
1315 | + |
1316 | +#: quickly-ubuntu-application-tutorial.xml:975(code) |
1317 | +msgid "<placeholder-1/> help" |
1318 | +msgstr "" |
1319 | + |
1320 | +#: quickly-ubuntu-application-tutorial.xml:977(para) |
1321 | +msgid "Opens a web browser with the help index." |
1322 | +msgstr "" |
1323 | + |
1324 | +#: quickly-ubuntu-application-tutorial.xml:984(code) |
1325 | +msgid "<placeholder-1/> license <Your_Licence=" |
1326 | +msgstr "" |
1327 | + |
1328 | +#: quickly-ubuntu-application-tutorial.xml:986(para) |
1329 | +msgid "Adds license to project files. Before using this command, you should:" |
1330 | +msgstr "" |
1331 | + |
1332 | +#: quickly-ubuntu-application-tutorial.xml:990(para) |
1333 | +msgid "run <application>Quickly</application> save in case something goes wrong" |
1334 | +msgstr "" |
1335 | + |
1336 | +#: quickly-ubuntu-application-tutorial.xml:993(para) |
1337 | +msgid "Edit the file Copyright to include your authorship." |
1338 | +msgstr "" |
1339 | + |
1340 | +#: quickly-ubuntu-application-tutorial.xml:995(para) |
1341 | +msgid "If you want to put your own <application>Quickly</application> unsupported Licence, remove and replace the tags ### BEGIN AUTOMATIC LICENCE GENERATION and ### END AUTOMATIC LICENCE GENERATION in it by your own licence." |
1342 | +msgstr "" |
1343 | + |
1344 | +#: quickly-ubuntu-application-tutorial.xml:999(para) |
1345 | +msgid "Executes either <code><application>Quickly</application> license</code> or <code><application>Quickly</application> licence <License=</code> where <License= can be either: - GPL-3 (default) - GPL-2" |
1346 | +msgstr "" |
1347 | + |
1348 | +#: quickly-ubuntu-application-tutorial.xml:1006(para) |
1349 | +msgid "This will modify the Copyright file with the chosen licence (with GPL-3 by default). Updating previous chosen Licence if needed. If you previously removed the tags to add your own licence, it will leave it pristine. If no name is attributed to the Copyright, it will try to retrieve it from Launchpad (in <application>Quickly</application> release or <application>Quickly</application> share command only)" |
1350 | +msgstr "" |
1351 | + |
1352 | +#: quickly-ubuntu-application-tutorial.xml:1012(para) |
1353 | +msgid "Finally, this will copy the Copyright at the head of every files." |
1354 | +msgstr "" |
1355 | + |
1356 | +#: quickly-ubuntu-application-tutorial.xml:1014(para) |
1357 | +msgid "Note that if you don't run <application>Quickly</application> licence before calling <application>Quickly</application> release or <application>Quickly</application> share, this one will execute it for you and guess the copyright holder from your launchpad account if you didn't update it." |
1358 | +msgstr "" |
1359 | + |
1360 | +#: quickly-ubuntu-application-tutorial.xml:1025(para) |
1361 | +msgid "Creates a debian file (deb) from your project. Before running the package command you can edit the Icon and Category entry of *.desktop.in file, where * is the name of your project." |
1362 | +msgstr "" |
1363 | + |
1364 | +#: quickly-ubuntu-application-tutorial.xml:1029(para) |
1365 | +msgid "Note that if you didn't run <application>Quickly</application> release, <application>Quickly</application> share or <application>Quickly</application> change-lp-project you may miss the name, email in setup.py. You can edit them if you don't want to use any of these commands afterwards. Those changes are not a mandatory at all for testing purpose." |
1366 | +msgstr "" |
1367 | + |
1368 | +#: quickly-ubuntu-application-tutorial.xml:1040(code) |
1369 | +msgid "<placeholder-1/> release" |
1370 | +msgstr "" |
1371 | + |
1372 | +#: quickly-ubuntu-application-tutorial.xml:1042(para) |
1373 | +msgid "Posts a release of your project to a PPA on launchpad so that users can install the application on their system." |
1374 | +msgstr "" |
1375 | + |
1376 | +#: quickly-ubuntu-application-tutorial.xml:1045(para) |
1377 | +msgid "You can also execute: <code><application>Quickly</application> release <release_number=</code> of you don't want to use current release_number. The release_number must be a number." |
1378 | +msgstr "" |
1379 | + |
1380 | +#: quickly-ubuntu-application-tutorial.xml:1049(para) |
1381 | +msgid "<code><application>Quickly</application> release <release_number=</code> notes about changes where \"notes about changes\" is optional text describing what changes were made since the last save" |
1382 | +msgstr "" |
1383 | + |
1384 | +#: quickly-ubuntu-application-tutorial.xml:1053(para) |
1385 | +msgid "Before running <application>Quickly</application> release, you should: create your account and a project page on http://launchpad.net. You also have to add a PPA to your launchpad account." |
1386 | +msgstr "" |
1387 | + |
1388 | +#: quickly-ubuntu-application-tutorial.xml:1057(para) |
1389 | +msgid "Name, email and version setup.py will be automatically changed. (version will be <current_release= and bzr will commit and tagged. Once the release is done, <current_release= will be incremented by 0.1 to be ready for next release." |
1390 | +msgstr "" |
1391 | + |
1392 | +#: quickly-ubuntu-application-tutorial.xml:1062(para) |
1393 | +msgid "If you previously used <application>Quickly</application> shared <current_release=~publicX will be dropped to release <current_release= version (<current_release=~publicX <current_release=) You can modify the description and long description if you wish." |
1394 | +msgstr "" |
1395 | + |
1396 | +#: quickly-ubuntu-application-tutorial.xml:1067(para) |
1397 | +msgid "You can run <code><application>Quickly</application> package</code> and test your package to make sure it installs as expected. (This is not mandatory)" |
1398 | +msgstr "" |
1399 | + |
1400 | +#: quickly-ubuntu-application-tutorial.xml:1077(para) |
1401 | +msgid "Runs your application. This is the best way to try test it out while you are developing it. It starts up the main project window." |
1402 | +msgstr "" |
1403 | + |
1404 | +#: quickly-ubuntu-application-tutorial.xml:1085(code) |
1405 | +msgid "<placeholder-1/> save notes about changes" |
1406 | +msgstr "" |
1407 | + |
1408 | +#: quickly-ubuntu-application-tutorial.xml:1087(para) |
1409 | +msgid "where \"notes about changes\" is optional text describing what changes were made since the last save." |
1410 | +msgstr "" |
1411 | + |
1412 | +#: quickly-ubuntu-application-tutorial.xml:1090(para) |
1413 | +msgid "This command commits all changes since the last save to bzr. Note that it does not push changes to any back up location. If you need revert or otherwise use the revision control, use bzr directly: <code>bzr help</code>" |
1414 | +msgstr "" |
1415 | + |
1416 | +#: quickly-ubuntu-application-tutorial.xml:1101(code) |
1417 | +msgid "<placeholder-1/> share" |
1418 | +msgstr "" |
1419 | + |
1420 | +#: quickly-ubuntu-application-tutorial.xml:1103(para) |
1421 | +msgid "Updates your PPA with the the latest saved project changes." |
1422 | +msgstr "" |
1423 | + |
1424 | +#: quickly-ubuntu-application-tutorial.xml:1105(para) |
1425 | +msgid "Before running <application>Quickly</application> release, you should: create your account on http://launchpad.net. You also have to add a PPA to your launchpad account." |
1426 | +msgstr "" |
1427 | + |
1428 | +#: quickly-ubuntu-application-tutorial.xml:1109(para) |
1429 | +msgid "Name, email and version setup.py will be automatically changed. (version will be <current_release~publicX= where X will be incremented at each <application>Quickly</application> share execution) You can modify the description and long description if you wish." |
1430 | +msgstr "" |
1431 | + |
1432 | +#: quickly-ubuntu-application-tutorial.xml:1119(title) |
1433 | +msgid "Links" |
1434 | +msgstr "" |
1435 | + |
1436 | +#: quickly-ubuntu-application-tutorial.xml:1121(link) |
1437 | +msgid "<placeholder-1/>: <placeholder-2/> Command Reference" |
1438 | +msgstr "" |
1439 | + |
1440 | +#: quickly-ubuntu-application-tutorial.xml:1124(ulink) |
1441 | +msgid "Blog post on <placeholder-1/>" |
1442 | +msgstr "" |
1443 | + |
1444 | +#: quickly-ubuntu-application-tutorial.xml:1127(ulink) |
1445 | +msgid "Language: Python Language Reference" |
1446 | +msgstr "" |
1447 | + |
1448 | +#: quickly-ubuntu-application-tutorial.xml:1130(ulink) |
1449 | +msgid "Core Library: Python 2.6 Library Reference" |
1450 | +msgstr "" |
1451 | + |
1452 | +#: quickly-ubuntu-application-tutorial.xml:1133(ulink) |
1453 | +msgid "UI Library: PyGtk" |
1454 | +msgstr "" |
1455 | + |
1456 | +#: quickly-ubuntu-application-tutorial.xml:1136(ulink) |
1457 | +msgid "Database: CouchDB Reference" |
1458 | +msgstr "" |
1459 | + |
1460 | +#: quickly-ubuntu-application-tutorial.xml:1139(ulink) |
1461 | +msgid "UI Editing: Glade User Documenation" |
1462 | +msgstr "" |
1463 | + |
1464 | +#: quickly-ubuntu-application-tutorial.xml:1142(ulink) |
1465 | +msgid "Editor: Gedit Help" |
1466 | +msgstr "" |
1467 | + |
1468 | +#: quickly-ubuntu-application-tutorial.xml:1145(ulink) |
1469 | +msgid "Version Control: Bazaar" |
1470 | +msgstr "" |
1471 | + |
1472 | +#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2 |
1473 | +#: quickly-ubuntu-application-tutorial.xml:0(None) |
1474 | +msgid "translator-credits" |
1475 | +msgstr "" |
1476 | + |
1477 | |
1478 | === added file 'data/templates/ubuntu-application/help/po/quickly-ubuntu-application-tutorial.pot' |
1479 | --- data/templates/ubuntu-application/help/po/quickly-ubuntu-application-tutorial.pot 1970-01-01 00:00:00 +0000 |
1480 | +++ data/templates/ubuntu-application/help/po/quickly-ubuntu-application-tutorial.pot 2010-03-12 17:35:32 +0000 |
1481 | @@ -0,0 +1,2387 @@ |
1482 | +# SOME DESCRIPTIVE TITLE. |
1483 | +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
1484 | +# |
1485 | +#, fuzzy |
1486 | +msgid "" |
1487 | +msgstr "" |
1488 | +"Project-Id-Version: PACKAGE VERSION\n" |
1489 | +"Report-Msgid-Bugs-To: http://bugs.kde.org\n" |
1490 | +"POT-Creation-Date: 2010-03-04 15:22+0000\n" |
1491 | +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
1492 | +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
1493 | +"Language-Team: LANGUAGE <kde-i18n-doc@kde.org>\n" |
1494 | +"MIME-Version: 1.0\n" |
1495 | +"Content-Type: application/x-xml2pot; charset=UTF-8\n" |
1496 | +"Content-Transfer-Encoding: 8bit\n" |
1497 | + |
1498 | +#. Tag: author |
1499 | +#: quickly-ubuntu-application-tutorial.xml:12 |
1500 | +#, no-c-format |
1501 | +msgid "<firstname>Shane</firstname> <surname>Fagan</surname>" |
1502 | +msgstr "" |
1503 | + |
1504 | +#. Tag: author |
1505 | +#: quickly-ubuntu-application-tutorial.xml:16 |
1506 | +#, no-c-format |
1507 | +msgid "<firstname>Rick</firstname> <surname>Spencer</surname>" |
1508 | +msgstr "" |
1509 | + |
1510 | +#. Tag: corpauthor |
1511 | +#: quickly-ubuntu-application-tutorial.xml:20 |
1512 | +#, no-c-format |
1513 | +msgid "Canonical ltd" |
1514 | +msgstr "" |
1515 | + |
1516 | +#. Tag: title |
1517 | +#: quickly-ubuntu-application-tutorial.xml:30 |
1518 | +#, no-c-format |
1519 | +msgid "&appname; &appversion; User Guide" |
1520 | +msgstr "" |
1521 | + |
1522 | +#. Tag: title |
1523 | +#: quickly-ubuntu-application-tutorial.xml:35 |
1524 | +#, no-c-format |
1525 | +msgid "About This Guide" |
1526 | +msgstr "" |
1527 | + |
1528 | +#. Tag: para |
1529 | +#: quickly-ubuntu-application-tutorial.xml:36 |
1530 | +#, no-c-format |
1531 | +msgid "<application>Quickly</application> is a set of choices about writing apps for Ubuntu. Out of all the wonderful richness and variety of programming for Linux, <application>Quickly</application> make some very opinionated choices about what tools to use, and how to combine them. The criteria for these choices was to make it easy and fun to write and release Linux applications, even if it's your first time trying, but also in a way that delivers the full power and flexibility of the platform. One benefit of these choices, is that it's also easier to write tools that make it even easier and more fun. So <application>Quickly</application> is also a set of commands." |
1532 | +msgstr "" |
1533 | + |
1534 | +#. Tag: link |
1535 | +#: quickly-ubuntu-application-tutorial.xml:39 |
1536 | +#, no-c-format |
1537 | +msgid "<link>Getting Started</link>" |
1538 | +msgstr "" |
1539 | + |
1540 | +#. Tag: title |
1541 | +#: quickly-ubuntu-application-tutorial.xml:45 |
1542 | +#, no-c-format |
1543 | +msgid "<title>Getting Started</title>" |
1544 | +msgstr "" |
1545 | + |
1546 | +#. Tag: para |
1547 | +#: quickly-ubuntu-application-tutorial.xml:46 |
1548 | +#, no-c-format |
1549 | +msgid "Welcome to the <application>Quickly</application> tutorial. In this guide you will learn how to get started using <application>Quickly</application>." |
1550 | +msgstr "" |
1551 | + |
1552 | +#. Tag: link |
1553 | +#: quickly-ubuntu-application-tutorial.xml:49 |
1554 | +#, no-c-format |
1555 | +msgid "<link>Introduction to <application>Quickly</application> Part 1</link>" |
1556 | +msgstr "" |
1557 | + |
1558 | +#. Tag: link |
1559 | +#: quickly-ubuntu-application-tutorial.xml:52 |
1560 | +#, no-c-format |
1561 | +msgid "<link>Introduction to <application>Quickly</application> Part 2</link>" |
1562 | +msgstr "" |
1563 | + |
1564 | +#. Tag: link |
1565 | +#: quickly-ubuntu-application-tutorial.xml:55 |
1566 | +#, no-c-format |
1567 | +msgid "<link>Introduction to <application>Quickly</application> Part 3</link>" |
1568 | +msgstr "" |
1569 | + |
1570 | +#. Tag: title |
1571 | +#: quickly-ubuntu-application-tutorial.xml:61 |
1572 | +#, no-c-format |
1573 | +msgid "<title>Introduction to <application>Quickly</application> Part 1</title>" |
1574 | +msgstr "" |
1575 | + |
1576 | +#. Tag: para |
1577 | +#: quickly-ubuntu-application-tutorial.xml:62 |
1578 | +#, no-c-format |
1579 | +msgid "This part 1 of the <application>Quickly</application> tutorial. This part is will introduce some key <application>Quickly</application> commands, editing a user interface in Glade, and editing code in Gedit. This part of the tutorial will familiarize you with these three tools, and how they work together with python and pygtk so that you can <application>Quickly</application> build applications." |
1580 | +msgstr "" |
1581 | + |
1582 | +#. Tag: title |
1583 | +#: quickly-ubuntu-application-tutorial.xml:64 |
1584 | +#, no-c-format |
1585 | +msgid "Creating a <application>Quickly</application> Project" |
1586 | +msgstr "" |
1587 | + |
1588 | +#. Tag: para |
1589 | +#: quickly-ubuntu-application-tutorial.xml:64 |
1590 | +#, no-c-format |
1591 | +msgid "Creating an empty but working program couldn't be simpler. First, open a terminal window to type commands into. When it's open, type the command:" |
1592 | +msgstr "" |
1593 | + |
1594 | +#. Tag: code |
1595 | +#: quickly-ubuntu-application-tutorial.xml:65 |
1596 | +#, no-c-format |
1597 | +msgid "<application>Quickly</application> create ubuntu-application jotty" |
1598 | +msgstr "" |
1599 | + |
1600 | +#. Tag: para |
1601 | +#: quickly-ubuntu-application-tutorial.xml:69 |
1602 | +#, no-c-format |
1603 | +msgid "This will create a jotty sub directory containing a complete directory tree and files for an empty python application. The command finishes by running the newly created empty application." |
1604 | +msgstr "" |
1605 | + |
1606 | +#. Tag: title |
1607 | +#: quickly-ubuntu-application-tutorial.xml:73 |
1608 | +#, no-c-format |
1609 | +msgid "Testing the Empty Application" |
1610 | +msgstr "" |
1611 | + |
1612 | +#. Tag: para |
1613 | +#: quickly-ubuntu-application-tutorial.xml:73 |
1614 | +#, no-c-format |
1615 | +msgid "They are populated and set up, and you can resize the window. Notice that <application>Quickly</application> inferred that the application title is \"Jotty\". Only a few of menu items do anything in the empty application, Help->About, Edit->Preferences, and File->Quit." |
1616 | +msgstr "" |
1617 | + |
1618 | +#. Tag: title |
1619 | +#: quickly-ubuntu-application-tutorial.xml:77 |
1620 | +#, no-c-format |
1621 | +msgid "Running the Application" |
1622 | +msgstr "" |
1623 | + |
1624 | +#. Tag: para |
1625 | +#: quickly-ubuntu-application-tutorial.xml:77 |
1626 | +#, no-c-format |
1627 | +msgid "Close the application by closing the window or using the Quit command. Since the empty application isn't installed into Ubuntu yet, you can't start the application from the application menu yet. To start the applicaton, use the terminal to first cd into the new subdirectory, and then use \"<application>Quickly</application> run\" to start the program." |
1628 | +msgstr "" |
1629 | + |
1630 | +#. Tag: code |
1631 | +#: quickly-ubuntu-application-tutorial.xml:79 |
1632 | +#, no-c-format |
1633 | +msgid "cd jotty" |
1634 | +msgstr "" |
1635 | + |
1636 | +#. Tag: code |
1637 | +#: quickly-ubuntu-application-tutorial.xml:80 quickly-ubuntu-application-tutorial.xml:180 quickly-ubuntu-application-tutorial.xml:897 |
1638 | +#, no-c-format |
1639 | +msgid "<application>Quickly</application> run" |
1640 | +msgstr "" |
1641 | + |
1642 | +#. Tag: title |
1643 | +#: quickly-ubuntu-application-tutorial.xml:84 |
1644 | +#, no-c-format |
1645 | +msgid "Editing an Application" |
1646 | +msgstr "" |
1647 | + |
1648 | +#. Tag: title |
1649 | +#: quickly-ubuntu-application-tutorial.xml:85 |
1650 | +#, no-c-format |
1651 | +msgid "Edit the User Interface in Glade" |
1652 | +msgstr "" |
1653 | + |
1654 | +#. Tag: para |
1655 | +#: quickly-ubuntu-application-tutorial.xml:85 |
1656 | +#, no-c-format |
1657 | +msgid "<application>Quickly</application> programs use Glade to edit the user interface. Start Glade with <application>Quickly</application> in order to set up Glade for editing the empty applicaton. Don't start glade directly, or it won't load the necessary catalogue files for editing the classes that were automaticaly generated by <application>Quickly</application>." |
1658 | +msgstr "" |
1659 | + |
1660 | +#. Tag: code |
1661 | +#: quickly-ubuntu-application-tutorial.xml:87 quickly-ubuntu-application-tutorial.xml:142 quickly-ubuntu-application-tutorial.xml:388 quickly-ubuntu-application-tutorial.xml:718 quickly-ubuntu-application-tutorial.xml:746 quickly-ubuntu-application-tutorial.xml:784 |
1662 | +#, no-c-format |
1663 | +msgid "<application>Quickly</application> design" |
1664 | +msgstr "" |
1665 | + |
1666 | +#. Tag: para |
1667 | +#: quickly-ubuntu-application-tutorial.xml:91 |
1668 | +#, no-c-format |
1669 | +msgid "Glade will open with the project loaded up and ready to edit." |
1670 | +msgstr "" |
1671 | + |
1672 | +#. Tag: para |
1673 | +#: quickly-ubuntu-application-tutorial.xml:95 |
1674 | +#, no-c-format |
1675 | +msgid "Use the Project Menu to choose \"JottytWindow.ui\" for editing." |
1676 | +msgstr "" |
1677 | + |
1678 | +#. Tag: para |
1679 | +#: quickly-ubuntu-application-tutorial.xml:99 |
1680 | +#, no-c-format |
1681 | +msgid "We want to create a text area for typing into. There are some default Widgets added to the Window. We won't need these so we'll start with deleting them. Click on the label, and press delete, and it will disappear from the window." |
1682 | +msgstr "" |
1683 | + |
1684 | +#. Tag: para |
1685 | +#: quickly-ubuntu-application-tutorial.xml:106 |
1686 | +#, no-c-format |
1687 | +msgid "Do the same with the image widget. This leave us two free slots." |
1688 | +msgstr "" |
1689 | + |
1690 | +#. Tag: para |
1691 | +#: quickly-ubuntu-application-tutorial.xml:110 |
1692 | +#, no-c-format |
1693 | +msgid "We'll use the bottom slot to add a TextView widget for the user to type into. In the toolbox, click on the TextView widget. Then click in the empty slot." |
1694 | +msgstr "" |
1695 | + |
1696 | +#. Tag: para |
1697 | +#: quickly-ubuntu-application-tutorial.xml:114 |
1698 | +#, no-c-format |
1699 | +msgid "Make sure you save the file in Glade, or your changes won't take! Then run the application from terminal again. The window now has a place where the user can type." |
1700 | +msgstr "" |
1701 | + |
1702 | +#. Tag: para |
1703 | +#: quickly-ubuntu-application-tutorial.xml:118 |
1704 | +#, no-c-format |
1705 | +msgid "Now we'll add the entry field for the title, and also a label for it. We'll use the top empty slot for that. First, click on Horizontal Box (HBox) from the \"Containers\" section of the pallette, and then click on the top slot. A dialog box will open, tell it that you want two items." |
1706 | +msgstr "" |
1707 | + |
1708 | +#. Tag: para |
1709 | +#: quickly-ubuntu-application-tutorial.xml:122 |
1710 | +#, no-c-format |
1711 | +msgid "The HBox is a container that arranges it's children horizontally. Add a label to the empty left hand box, and a Text Entry to the right hand one." |
1712 | +msgstr "" |
1713 | + |
1714 | +#. Tag: para |
1715 | +#: quickly-ubuntu-application-tutorial.xml:126 |
1716 | +#, no-c-format |
1717 | +msgid "Before going on, let's clean up the UI just a tad here. Select the new HBox from the treeview in the inspector window. Then go to the Packing tab, and set Expand and Fill to \"No\"." |
1718 | +msgstr "" |
1719 | + |
1720 | +#. Tag: para |
1721 | +#: quickly-ubuntu-application-tutorial.xml:130 |
1722 | +#, no-c-format |
1723 | +msgid "Go to the General tab, and set spacing to 5." |
1724 | +msgstr "" |
1725 | + |
1726 | +#. Tag: para |
1727 | +#: quickly-ubuntu-application-tutorial.xml:134 |
1728 | +#, no-c-format |
1729 | +msgid "Select the label. On the general tab, set \"Label\" to \"Name:\". Set expand and fill to \"no\" for the label, but keep it \"yes\" for the entry. Set the padding for both to 5 (also on the Packing tab)." |
1730 | +msgstr "" |
1731 | + |
1732 | +#. Tag: title |
1733 | +#: quickly-ubuntu-application-tutorial.xml:138 |
1734 | +#, no-c-format |
1735 | +msgid "Add the Save, Open, and New Features" |
1736 | +msgstr "" |
1737 | + |
1738 | +#. Tag: para |
1739 | +#: quickly-ubuntu-application-tutorial.xml:138 |
1740 | +#, no-c-format |
1741 | +msgid "After the user types something, they may want to save it. A File->Save menu item was automatically created when the empty applicaton was created, but it's not hooked up to any code. To make Save work, we need tell the menu item what function to call, and then create a function to actually do the saving." |
1742 | +msgstr "" |
1743 | + |
1744 | +#. Tag: title |
1745 | +#: quickly-ubuntu-application-tutorial.xml:140 |
1746 | +#, no-c-format |
1747 | +msgid "Set the Signal Handler in Glade" |
1748 | +msgstr "" |
1749 | + |
1750 | +#. Tag: para |
1751 | +#: quickly-ubuntu-application-tutorial.xml:140 |
1752 | +#, no-c-format |
1753 | +msgid "To tell the menu item what function to call. If glade is not still open, open up the application in glade:" |
1754 | +msgstr "" |
1755 | + |
1756 | +#. Tag: para |
1757 | +#: quickly-ubuntu-application-tutorial.xml:143 |
1758 | +#, no-c-format |
1759 | +msgid "Click on the file menu, and the menu opens as if the application were running." |
1760 | +msgstr "" |
1761 | + |
1762 | +#. Tag: para |
1763 | +#: quickly-ubuntu-application-tutorial.xml:147 |
1764 | +#, no-c-format |
1765 | +msgid "Choose the Save menu item, and it will be selected in Glade." |
1766 | +msgstr "" |
1767 | + |
1768 | +#. Tag: para |
1769 | +#: quickly-ubuntu-application-tutorial.xml:151 |
1770 | +#, no-c-format |
1771 | +msgid "Then choose the \"Signals\" tab of the properties window." |
1772 | +msgstr "" |
1773 | + |
1774 | +#. Tag: para |
1775 | +#: quickly-ubuntu-application-tutorial.xml:155 |
1776 | +#, no-c-format |
1777 | +msgid "In pygtk, menu items are \"activated\" when a user chooses the item from the menu. Since we want a function to run when the user chooses Save, we want to specify a function to respond to the activate signal from the menu item. We'll call the function \"save_file\". Simply type the function name into the box for the activate signal.Make sure to save the glade file." |
1778 | +msgstr "" |
1779 | + |
1780 | +#. Tag: para |
1781 | +#: quickly-ubuntu-application-tutorial.xml:159 |
1782 | +#, no-c-format |
1783 | +msgid "Note that you will need to setup the \"open_file\" signal and the \"new_file\" signal as well when you get to those functions later." |
1784 | +msgstr "" |
1785 | + |
1786 | +#. Tag: title |
1787 | +#: quickly-ubuntu-application-tutorial.xml:160 |
1788 | +#, no-c-format |
1789 | +msgid "Edit the Code in Gedit" |
1790 | +msgstr "" |
1791 | + |
1792 | +#. Tag: title |
1793 | +#: quickly-ubuntu-application-tutorial.xml:161 |
1794 | +#, no-c-format |
1795 | +msgid "Set Up Tabs Correctly" |
1796 | +msgstr "" |
1797 | + |
1798 | +#. Tag: para |
1799 | +#: quickly-ubuntu-application-tutorial.xml:161 |
1800 | +#, no-c-format |
1801 | +msgid "Note a major gotcha here. In python spaces and tabs are totally different, but they look just the same in an editor. So being indented one tab stop is not the same as being indented four spaces, even though they might look the same. And indentation level is very important in python. You will get a lot of errors if you mix tab indentation with space indentation. Your generated project follows the python standard of using four spaces for each indentation level. So you'll either have to hit the space bar four time every time you indent, or set up your editor to use the right number of spaces for tabs." |
1802 | +msgstr "" |
1803 | + |
1804 | +#. Tag: para |
1805 | +#: quickly-ubuntu-application-tutorial.xml:163 |
1806 | +#, no-c-format |
1807 | +msgid "The upshot is that you should take a moment to set up your Gedit (or whatever editor you are using) to use spaces for tabs. In Gedit, select Preferences from the Edit menu, and choose the Editor tab. Then set Tab width to 4, and turn on \"Insert spaces instead of tabs\". Your preferences should look like this:" |
1808 | +msgstr "" |
1809 | + |
1810 | +#. Tag: title |
1811 | +#: quickly-ubuntu-application-tutorial.xml:167 |
1812 | +#, no-c-format |
1813 | +msgid "Create the Save File Signal Handler" |
1814 | +msgstr "" |
1815 | + |
1816 | +#. Tag: para |
1817 | +#: quickly-ubuntu-application-tutorial.xml:167 |
1818 | +#, no-c-format |
1819 | +msgid "Now you're ready to write some code. Of course just telling the glade file what signal to emit won't make the file actually save, because we haven't created the \"save_file\" function yet. The code for JottyWindow is stored in the file jotty. jotty is a special python file that is the entry point for your application. Other python files in your application have the \".py\" suffix." |
1820 | +msgstr "" |
1821 | + |
1822 | +#. Tag: para |
1823 | +#: quickly-ubuntu-application-tutorial.xml:169 |
1824 | +#, no-c-format |
1825 | +msgid "Use the <application>Quickly</application> edit command to start editing your code files:" |
1826 | +msgstr "" |
1827 | + |
1828 | +#. Tag: code |
1829 | +#: quickly-ubuntu-application-tutorial.xml:170 quickly-ubuntu-application-tutorial.xml:721 quickly-ubuntu-application-tutorial.xml:750 quickly-ubuntu-application-tutorial.xml:774 |
1830 | +#, no-c-format |
1831 | +msgid "<application>Quickly</application> edit" |
1832 | +msgstr "" |
1833 | + |
1834 | +#. Tag: para |
1835 | +#: quickly-ubuntu-application-tutorial.xml:171 |
1836 | +#, no-c-format |
1837 | +msgid "This will open the default Ubuntu text editor \"Gedit\" with any python files in the python directory." |
1838 | +msgstr "" |
1839 | + |
1840 | +#. Tag: para |
1841 | +#: quickly-ubuntu-application-tutorial.xml:175 |
1842 | +#, no-c-format |
1843 | +msgid "JottyWindow.ui is now expecting to find a function JottyWindow.save_file(), so we simply add one to the JottyWindow class in the jotty file right under the on_destroy funtion.:" |
1844 | +msgstr "" |
1845 | + |
1846 | +#. Tag: literallayout |
1847 | +#: quickly-ubuntu-application-tutorial.xml:177 |
1848 | +#, no-c-format |
1849 | +msgid "" |
1850 | + "<code>def save_file(self, widget, data=None):\n" |
1851 | + " print \"save\"</code>" |
1852 | +msgstr "" |
1853 | + |
1854 | +#. Tag: para |
1855 | +#: quickly-ubuntu-application-tutorial.xml:178 |
1856 | +#, no-c-format |
1857 | +msgid "This will print the word \"save\" to the terminal when run. The method signature is the standard signature expected in a signal handler. If you are new to python, be sure to copy the indentations exactly, as the indentation level is very important in python." |
1858 | +msgstr "" |
1859 | + |
1860 | +#. Tag: para |
1861 | +#: quickly-ubuntu-application-tutorial.xml:179 |
1862 | +#, no-c-format |
1863 | +msgid "Save the file, and run it again:" |
1864 | +msgstr "" |
1865 | + |
1866 | +#. Tag: para |
1867 | +#: quickly-ubuntu-application-tutorial.xml:183 |
1868 | +#, no-c-format |
1869 | +msgid "Choose \"File->Save\" from the menu, and you'll see the word \"save\" printing out interminal. That's all there is to hookig up the functions!" |
1870 | +msgstr "" |
1871 | + |
1872 | +#. Tag: title |
1873 | +#: quickly-ubuntu-application-tutorial.xml:187 |
1874 | +#, no-c-format |
1875 | +msgid "Implementing Save" |
1876 | +msgstr "" |
1877 | + |
1878 | +#. Tag: para |
1879 | +#: quickly-ubuntu-application-tutorial.xml:187 |
1880 | +#, no-c-format |
1881 | +msgid "Now we'll write a little code in the signal handler to actually save the text. Because we want it to be easy for users to do things like syncronize their Jotty documents between computers, back it up, etc... we'll use couchdb as our backend, and we'll use desktopcouch for our api. Note that if you are not interested in learning about how to save to and read from couchdb, you can just snipe the code. Mostly likely you already have everything you need installed when you installed <application>Quickly</application>. But, you may need to install couchdb, desktopcouch, and the desktopcouch records api. The fastest way to do this is from the terminal:" |
1882 | +msgstr "" |
1883 | + |
1884 | +#. Tag: code |
1885 | +#: quickly-ubuntu-application-tutorial.xml:190 |
1886 | +#, no-c-format |
1887 | +msgid "sudo apt-get install python-desktopcouch-records" |
1888 | +msgstr "" |
1889 | + |
1890 | +#. Tag: para |
1891 | +#: quickly-ubuntu-application-tutorial.xml:193 |
1892 | +#, no-c-format |
1893 | +msgid "This will install the api, and everything you need for the api to run. After desktopcouch is installed, you can write the code. The code will do the following:" |
1894 | +msgstr "" |
1895 | + |
1896 | +#. Tag: para |
1897 | +#: quickly-ubuntu-application-tutorial.xml:196 |
1898 | +#, no-c-format |
1899 | +msgid "Import the stuff you'll need from desktopcouch." |
1900 | +msgstr "" |
1901 | + |
1902 | +#. Tag: para |
1903 | +#: quickly-ubuntu-application-tutorial.xml:199 |
1904 | +#, no-c-format |
1905 | +msgid "Get a reference to the couchdb database to save into." |
1906 | +msgstr "" |
1907 | + |
1908 | +#. Tag: para |
1909 | +#: quickly-ubuntu-application-tutorial.xml:202 |
1910 | +#, no-c-format |
1911 | +msgid "Get the title of the document and the text from the user interface." |
1912 | +msgstr "" |
1913 | + |
1914 | +#. Tag: para |
1915 | +#: quickly-ubuntu-application-tutorial.xml:205 |
1916 | +#, no-c-format |
1917 | +msgid "Check if there is already a document with the same title, and if so overwrite it." |
1918 | +msgstr "" |
1919 | + |
1920 | +#. Tag: para |
1921 | +#: quickly-ubuntu-application-tutorial.xml:208 |
1922 | +#, no-c-format |
1923 | +msgid "If there is not a document already, create one." |
1924 | +msgstr "" |
1925 | + |
1926 | +#. Tag: title |
1927 | +#: quickly-ubuntu-application-tutorial.xml:211 |
1928 | +#, no-c-format |
1929 | +msgid "Import the stuff you'll need from python-desktopcouch-records." |
1930 | +msgstr "" |
1931 | + |
1932 | +#. Tag: para |
1933 | +#: quickly-ubuntu-application-tutorial.xml:211 |
1934 | +#, no-c-format |
1935 | +msgid "Add these import statements along with the other imports to the top of the jotty file:" |
1936 | +msgstr "" |
1937 | + |
1938 | +#. Tag: literallayout |
1939 | +#: quickly-ubuntu-application-tutorial.xml:213 |
1940 | +#, no-c-format |
1941 | +msgid "" |
1942 | + "<code>from desktopcouch.records.server import CouchDatabase\n" |
1943 | + "from desktopcouch.records.record import Record</code>" |
1944 | +msgstr "" |
1945 | + |
1946 | +#. Tag: title |
1947 | +#: quickly-ubuntu-application-tutorial.xml:214 |
1948 | +#, no-c-format |
1949 | +msgid "Get a Reference to the Database" |
1950 | +msgstr "" |
1951 | + |
1952 | +#. Tag: para |
1953 | +#: quickly-ubuntu-application-tutorial.xml:214 |
1954 | +#, no-c-format |
1955 | +msgid "Desktopcouch will set up a database for us, or create a new one if it's needed. We'll use \"jotty\" for the name of the database. Since we want this line to run every time the Jotty Window is created, put it at the end of the finish_initializing function:" |
1956 | +msgstr "" |
1957 | + |
1958 | +#. Tag: code |
1959 | +#: quickly-ubuntu-application-tutorial.xml:216 |
1960 | +#, no-c-format |
1961 | +msgid "self.database = CouchDatabase(\"jotty\", create=True)" |
1962 | +msgstr "" |
1963 | + |
1964 | +#. Tag: para |
1965 | +#: quickly-ubuntu-application-tutorial.xml:219 |
1966 | +#, no-c-format |
1967 | +msgid "Now that we have an instance-wide reference to the database, we'll add code to the save_file function to run whenever the Save command is issued." |
1968 | +msgstr "" |
1969 | + |
1970 | +#. Tag: para |
1971 | +#: quickly-ubuntu-application-tutorial.xml:220 |
1972 | +#, no-c-format |
1973 | +msgid "Here's the code to pull the title out of the title entry:" |
1974 | +msgstr "" |
1975 | + |
1976 | +#. Tag: literallayout |
1977 | +#: quickly-ubuntu-application-tutorial.xml:222 |
1978 | +#, no-c-format |
1979 | +msgid "" |
1980 | + "<code>#get the title for the note\n" |
1981 | + "title = self.builder.get_object(\"entry1\").get_text()</code>" |
1982 | +msgstr "" |
1983 | + |
1984 | +#. Tag: title |
1985 | +#: quickly-ubuntu-application-tutorial.xml:223 |
1986 | +#, no-c-format |
1987 | +msgid "Here's the code to get pull the text out of the TextView:" |
1988 | +msgstr "" |
1989 | + |
1990 | +#. Tag: para |
1991 | +#: quickly-ubuntu-application-tutorial.xml:223 |
1992 | +#, no-c-format |
1993 | +msgid "In pygtk, TextView widgets have a text buffer that stores the text. So you ask the TextView for it's TextBuffer, and then you ask the TextBuffer for the text. You use iters to determine from which part of the text buffer you want text. Since we want all the text, it's easy to just get the start and end iters." |
1994 | +msgstr "" |
1995 | + |
1996 | +#. Tag: literallayout |
1997 | +#: quickly-ubuntu-application-tutorial.xml:226 |
1998 | +#, no-c-format |
1999 | +msgid "" |
2000 | + "<code>#get the string\n" |
2001 | + "buff = self.builder.get_object(\"textview1\").get_buffer()\n" |
2002 | + "start_iter = buff.get_start_iter()\n" |
2003 | + "end_iter = buff.get_end_iter()\n" |
2004 | + "text = buff.get_text(start_iter,end_iter)\n" |
2005 | + "</code>" |
2006 | +msgstr "" |
2007 | + |
2008 | +#. Tag: title |
2009 | +#: quickly-ubuntu-application-tutorial.xml:227 |
2010 | +#, no-c-format |
2011 | +msgid "Saving a document to Couchdb" |
2012 | +msgstr "" |
2013 | + |
2014 | +#. Tag: para |
2015 | +#: quickly-ubuntu-application-tutorial.xml:227 |
2016 | +#, no-c-format |
2017 | +msgid "A record in couch is essentially a python dictionary with some extra key/value pairs to make the database work. So we can save the document to couch like this:" |
2018 | +msgstr "" |
2019 | + |
2020 | +#. Tag: literallayout |
2021 | +#: quickly-ubuntu-application-tutorial.xml:230 |
2022 | +#, no-c-format |
2023 | +msgid "" |
2024 | + "<code>record_type = \"http://wiki.ubuntu.com/<application>Quickly</application>/JottyDoc\"\n" |
2025 | + "new_rec = Record({\"record_type\": record_type,\"title\":title, \"text\":text})\n" |
2026 | + "self.database.put(new_rec)</code>" |
2027 | +msgstr "" |
2028 | + |
2029 | +#. Tag: para |
2030 | +#: quickly-ubuntu-application-tutorial.xml:231 |
2031 | +#, no-c-format |
2032 | +msgid "The \"record_type\" field is not strictly required, but among other things, it makes it easy to fetch the documents later. By convention, we use a url to specify the record type. This provides a place for other developers to go to read about the record type. The description only needs to be human readable. Couchdb is not a typed database, so don't expect that the url will have any kind of schema definition or anything. You can use whatever url you want, and put whatever you want at that URL." |
2033 | +msgstr "" |
2034 | + |
2035 | +#. Tag: title |
2036 | +#: quickly-ubuntu-application-tutorial.xml:232 |
2037 | +#, no-c-format |
2038 | +msgid "Check for a pre-existing note with the same title" |
2039 | +msgstr "" |
2040 | + |
2041 | +#. Tag: para |
2042 | +#: quickly-ubuntu-application-tutorial.xml:232 |
2043 | +#, no-c-format |
2044 | +msgid "Before we just write the new document though, we have to take note of the fact that couch will allow you to create as many documents as you want with the same title. We probably don't want this, so we we'll have to write a little code to check if there is already a document in couch with the same title, and if there is, update that document rather than create a new one." |
2045 | +msgstr "" |
2046 | + |
2047 | +#. Tag: para |
2048 | +#: quickly-ubuntu-application-tutorial.xml:234 |
2049 | +#, no-c-format |
2050 | +msgid "In CouchDB, you don't do a lot of data processing in the database like you would with a relational database. To be most efficient, we could use the desktopcouch API to create a view in CouchDB, but it's probably simplest just to do the necessary processing on the client for now. To do this, we'll use a desktopcouch function to retrieve all of the records of a specified record type." |
2051 | +msgstr "" |
2052 | + |
2053 | +#. Tag: para |
2054 | +#: quickly-ubuntu-application-tutorial.xml:235 |
2055 | +#, no-c-format |
2056 | +msgid "To find and update documents with a matching title we will:" |
2057 | +msgstr "" |
2058 | + |
2059 | +#. Tag: para |
2060 | +#: quickly-ubuntu-application-tutorial.xml:238 quickly-ubuntu-application-tutorial.xml:269 |
2061 | +#, no-c-format |
2062 | +msgid "Retrieve all of the documents with the CouchDatabase.get_records function." |
2063 | +msgstr "" |
2064 | + |
2065 | +#. Tag: para |
2066 | +#: quickly-ubuntu-application-tutorial.xml:241 quickly-ubuntu-application-tutorial.xml:272 |
2067 | +#, no-c-format |
2068 | +msgid "Check each of the returned records for a matching title." |
2069 | +msgstr "" |
2070 | + |
2071 | +#. Tag: para |
2072 | +#: quickly-ubuntu-application-tutorial.xml:244 |
2073 | +#, no-c-format |
2074 | +msgid "If there is a match, update the record using the CouchDatabase.update_fields function and return." |
2075 | +msgstr "" |
2076 | + |
2077 | +#. Tag: para |
2078 | +#: quickly-ubuntu-application-tutorial.xml:247 |
2079 | +#, no-c-format |
2080 | +msgid "This all may sound very weird, but in code, it's not quite so complicated:" |
2081 | +msgstr "" |
2082 | + |
2083 | +#. Tag: literallayout |
2084 | +#: quickly-ubuntu-application-tutorial.xml:249 |
2085 | +#, no-c-format |
2086 | +msgid "" |
2087 | + "<code>#get all the records\n" |
2088 | + "record_type = \"http://wiki.ubuntu.com/<application>Quickly</application>/JottyDoc\"\n" |
2089 | + "results = self.database.get_records(record_type = record_type,create_view = True)\n" |
2090 | + "#update a record that has the same title\n" |
2091 | + "for result in results:\n" |
2092 | + " document = result.value\n" |
2093 | + " if document[\"title\"] == title:\n" |
2094 | + " key = document[\"_id\"]\n" |
2095 | + " self.database.update_fields(key, {\"text\":text})\n" |
2096 | + " return</code>" |
2097 | +msgstr "" |
2098 | + |
2099 | +#. Tag: para |
2100 | +#: quickly-ubuntu-application-tutorial.xml:250 |
2101 | +#, no-c-format |
2102 | +msgid "So the whole function should look like this:" |
2103 | +msgstr "" |
2104 | + |
2105 | +#. Tag: literallayout |
2106 | +#: quickly-ubuntu-application-tutorial.xml:252 |
2107 | +#, no-c-format |
2108 | +msgid "" |
2109 | + "<code>def save_file(self, widget, data=None): \n" |
2110 | + "#get the title for the note \n" |
2111 | + " title = self.builder.get_object(\"entry1\").get_text() \n" |
2112 | + "#get the text to save \n" |
2113 | + " buff = self.builder.get_object(\"textview1\").get_buffer() \n" |
2114 | + " start_iter = buff.get_start_iter() \n" |
2115 | + " end_iter = buff.get_end_iter() \n" |
2116 | + " text = buff.get_text(start_iter,end_iter) \n" |
2117 | + "#get all the records \n" |
2118 | + " record_type = \"http://wiki.ubuntu.com/<application>Quickly</application>/JottyDoc\" \n" |
2119 | + " results = self.database.get_records(record_type = record_type,create_view = True) \n" |
2120 | + "#update a record that has the same title \n" |
2121 | + " for result in results: \n" |
2122 | + " document = result.value \n" |
2123 | + " if document[\"title\"] == title: \n" |
2124 | + " key = result.key \n" |
2125 | + " self.database.update_fields(key, {\"text\":text}) \n" |
2126 | + " return \n" |
2127 | + "#if no records had the title, create it \n" |
2128 | + " new_rec = Record({\"record_type\":record_type,\"title\":title, \"text\":text})\n" |
2129 | + " self.database.put_record(new_rec)</code>" |
2130 | +msgstr "" |
2131 | + |
2132 | +#. Tag: para |
2133 | +#: quickly-ubuntu-application-tutorial.xml:254 |
2134 | +#, no-c-format |
2135 | +msgid "Couchdb makes it really easy to see if your save function is working. You can just point your web browser at it and explore the database:" |
2136 | +msgstr "" |
2137 | + |
2138 | +#. Tag: para |
2139 | +#: quickly-ubuntu-application-tutorial.xml:255 |
2140 | +#, no-c-format |
2141 | +msgid "file:///home/your_user_name>/.local/share/desktop-couch/couchdb.html" |
2142 | +msgstr "" |
2143 | + |
2144 | +#. Tag: para |
2145 | +#: quickly-ubuntu-application-tutorial.xml:259 |
2146 | +#, no-c-format |
2147 | +msgid "If you are redirected to a page that doesn't work, you probably just need to clear your browser cache and try again." |
2148 | +msgstr "" |
2149 | + |
2150 | +#. Tag: title |
2151 | +#: quickly-ubuntu-application-tutorial.xml:260 |
2152 | +#, no-c-format |
2153 | +msgid "Implementing Open and New" |
2154 | +msgstr "" |
2155 | + |
2156 | +#. Tag: para |
2157 | +#: quickly-ubuntu-application-tutorial.xml:260 |
2158 | +#, no-c-format |
2159 | +msgid "To open a saved document, the user will type the title of the document that they want to open in the text entry, and choose \"Open\" from the main menu. If there is no matching document there, it will just clear out the text view, ready for input. This is probably not too intuitive, so we'll add a dialog box for prompting the user for the title, but that's for later in the tutorial. For now, we'll just use the same text entry field." |
2160 | +msgstr "" |
2161 | + |
2162 | +#. Tag: title |
2163 | +#: quickly-ubuntu-application-tutorial.xml:262 |
2164 | +#, no-c-format |
2165 | +msgid "Implementing Open is essentially the reverse of Save:" |
2166 | +msgstr "" |
2167 | + |
2168 | +#. Tag: para |
2169 | +#: quickly-ubuntu-application-tutorial.xml:262 |
2170 | +#, no-c-format |
2171 | +msgid "Follow these steps:" |
2172 | +msgstr "" |
2173 | + |
2174 | +#. Tag: para |
2175 | +#: quickly-ubuntu-application-tutorial.xml:266 |
2176 | +#, no-c-format |
2177 | +msgid "Add the open_file signal to the menu item in Glade." |
2178 | +msgstr "" |
2179 | + |
2180 | +#. Tag: para |
2181 | +#: quickly-ubuntu-application-tutorial.xml:275 |
2182 | +#, no-c-format |
2183 | +msgid "If there is a match, pull out the text and display it in the text view." |
2184 | +msgstr "" |
2185 | + |
2186 | +#. Tag: para |
2187 | +#: quickly-ubuntu-application-tutorial.xml:278 |
2188 | +#, no-c-format |
2189 | +msgid "So the open_file function looks like so:" |
2190 | +msgstr "" |
2191 | + |
2192 | +#. Tag: literallayout |
2193 | +#: quickly-ubuntu-application-tutorial.xml:280 |
2194 | +#, no-c-format |
2195 | +msgid "" |
2196 | + "<code>def open_file(self, widget, data=None):\n" |
2197 | + " #get the name of the document to open\n" |
2198 | + " title = self.builder.get_object(\"entry1\").get_text()\n" |
2199 | + " text = \"\"\n" |
2200 | + " \n" |
2201 | + " #get all the records\n" |
2202 | + " record_type = \"http://wiki.ubuntu.com/<application>Quickly</application>/JottyDoc\"\n" |
2203 | + " results = self.database.get_records(record_type = record_type,create_view = True)\n" |
2204 | + " \n" |
2205 | + " #get the text if there is a matching title\n" |
2206 | + " for result in results:\n" |
2207 | + " document = result.value\n" |
2208 | + " if document[\"title\"] == title:\n" |
2209 | + " text = document[\"text\"]\n" |
2210 | + " \n" |
2211 | + " #set the UI to display the string\n" |
2212 | + " buff = self.builder.get_object(\"textview1\").get_buffer()\n" |
2213 | + " buff.set_text(text)</code>" |
2214 | +msgstr "" |
2215 | + |
2216 | +#. Tag: title |
2217 | +#: quickly-ubuntu-application-tutorial.xml:281 |
2218 | +#, no-c-format |
2219 | +msgid "Implement New" |
2220 | +msgstr "" |
2221 | + |
2222 | +#. Tag: para |
2223 | +#: quickly-ubuntu-application-tutorial.xml:281 |
2224 | +#, no-c-format |
2225 | +msgid "First, add the new_file signal to the menu item in Glade, then add this code to clear out the text:" |
2226 | +msgstr "" |
2227 | + |
2228 | +#. Tag: literallayout |
2229 | +#: quickly-ubuntu-application-tutorial.xml:284 |
2230 | +#, no-c-format |
2231 | +msgid "" |
2232 | + "<code>def new_file(self, widget, data=None):\n" |
2233 | + " self.builder.get_object(\"entry1\").set_text(\"Note Title\")\n" |
2234 | + " buff = self.builder.get_object(\"textview1\").get_buffer()\n" |
2235 | + " buff.set_text(\"\")</code>" |
2236 | +msgstr "" |
2237 | + |
2238 | +#. Tag: para |
2239 | +#: quickly-ubuntu-application-tutorial.xml:285 |
2240 | +#, no-c-format |
2241 | +msgid "To make them work, add these functions to the JottyWindow class, and save. Then go back and connect the functions to the activate signals for the Open and New menu items." |
2242 | +msgstr "" |
2243 | + |
2244 | +#. Tag: ulink |
2245 | +#: quickly-ubuntu-application-tutorial.xml:286 |
2246 | +#, no-c-format |
2247 | +msgid "Complete jotty file" |
2248 | +msgstr "" |
2249 | + |
2250 | +#. Tag: title |
2251 | +#: quickly-ubuntu-application-tutorial.xml:287 |
2252 | +#, no-c-format |
2253 | +msgid "Saving Your Work" |
2254 | +msgstr "" |
2255 | + |
2256 | +#. Tag: para |
2257 | +#: quickly-ubuntu-application-tutorial.xml:287 |
2258 | +#, no-c-format |
2259 | +msgid "When <application>Quickly</application> created your application, it automatically added it to Bazaar, a source code versioning system. You can use Bazaar to roll back mistake, see code history, compare versions, etc... <application>Quickly</application> has a convenience function for backing up your work:" |
2260 | +msgstr "" |
2261 | + |
2262 | +#. Tag: code |
2263 | +#: quickly-ubuntu-application-tutorial.xml:289 |
2264 | +#, no-c-format |
2265 | +msgid "<application>Quickly</application> save \"First working version of Jotty\"" |
2266 | +msgstr "" |
2267 | + |
2268 | +#. Tag: para |
2269 | +#: quickly-ubuntu-application-tutorial.xml:292 |
2270 | +#, no-c-format |
2271 | +msgid "This will call <code>bzr add</code> and then <code>bzr commit -m [your message]</code> for you." |
2272 | +msgstr "" |
2273 | + |
2274 | +#. Tag: title |
2275 | +#: quickly-ubuntu-application-tutorial.xml:295 |
2276 | +#, no-c-format |
2277 | +msgid "<title>Introduction to <application>Quickly</application> Part 2</title>" |
2278 | +msgstr "" |
2279 | + |
2280 | +#. Tag: para |
2281 | +#: quickly-ubuntu-application-tutorial.xml:296 |
2282 | +#, no-c-format |
2283 | +msgid "In part 1, we created an application that can read and write text files, and persist them in the couchdb backend. However, the application has a hideous usability flaw, in the text box for specifying titles when saving and opening files is very confusing. In part 2, we'll fix that by adding a save and an open dialog." |
2284 | +msgstr "" |
2285 | + |
2286 | +#. Tag: title |
2287 | +#: quickly-ubuntu-application-tutorial.xml:298 |
2288 | +#, no-c-format |
2289 | +msgid "Creating a <application>Quickly</application> Dialog" |
2290 | +msgstr "" |
2291 | + |
2292 | +#. Tag: title |
2293 | +#: quickly-ubuntu-application-tutorial.xml:299 |
2294 | +#, no-c-format |
2295 | +msgid "Creating the Empty Dialog" |
2296 | +msgstr "" |
2297 | + |
2298 | +#. Tag: para |
2299 | +#: quickly-ubuntu-application-tutorial.xml:299 |
2300 | +#, no-c-format |
2301 | +msgid "It's simple to add an empty, but working dialog to your project. Simply specify the name of the new dialog, and it will be added automatically. Assuming that you are in the jotty project directory:" |
2302 | +msgstr "" |
2303 | + |
2304 | +#. Tag: code |
2305 | +#: quickly-ubuntu-application-tutorial.xml:301 |
2306 | +#, no-c-format |
2307 | +msgid "<application>Quickly</application> dialog save" |
2308 | +msgstr "" |
2309 | + |
2310 | +#. Tag: para |
2311 | +#: quickly-ubuntu-application-tutorial.xml:304 |
2312 | +#, no-c-format |
2313 | +msgid "This will add the dialog to your project." |
2314 | +msgstr "" |
2315 | + |
2316 | +#. Tag: title |
2317 | +#: quickly-ubuntu-application-tutorial.xml:305 quickly-ubuntu-application-tutorial.xml:386 |
2318 | +#, no-c-format |
2319 | +msgid "Editing the New Dialog" |
2320 | +msgstr "" |
2321 | + |
2322 | +#. Tag: para |
2323 | +#: quickly-ubuntu-application-tutorial.xml:305 |
2324 | +#, no-c-format |
2325 | +msgid "To edit the UI for the dialog, you'll need to load it into Glade again. If you already have an instance of glade running, you might want to go ahead and close it first, as it may get confusing if you have more than one open at a time. After closing glade, simply open it again:" |
2326 | +msgstr "" |
2327 | + |
2328 | +#. Tag: code |
2329 | +#: quickly-ubuntu-application-tutorial.xml:307 |
2330 | +#, no-c-format |
2331 | +msgid "<application>Quickly</application> Design" |
2332 | +msgstr "" |
2333 | + |
2334 | +#. Tag: para |
2335 | +#: quickly-ubuntu-application-tutorial.xml:310 |
2336 | +#, no-c-format |
2337 | +msgid "Then use the project menu to switch to newly created SaveDialog.ui file." |
2338 | +msgstr "" |
2339 | + |
2340 | +#. Tag: para |
2341 | +#: quickly-ubuntu-application-tutorial.xml:314 |
2342 | +#, no-c-format |
2343 | +msgid "Then add some widgets for the UI. Start with a Vertical Box (VBox) with two items. Put a label in the top, and an HBox in the bottom slot. In the HBox, add a label and an edit widget, just like you did for JottyWindow in part 1. Set the padding and expand properties as well." |
2344 | +msgstr "" |
2345 | + |
2346 | +#. Tag: title |
2347 | +#: quickly-ubuntu-application-tutorial.xml:318 |
2348 | +#, no-c-format |
2349 | +msgid "Code the Dialog" |
2350 | +msgstr "" |
2351 | + |
2352 | +#. Tag: para |
2353 | +#: quickly-ubuntu-application-tutorial.xml:318 |
2354 | +#, no-c-format |
2355 | +msgid "You can use the \"<application>Quickly</application> edit\" command to open the SaveDialog.py file. This dialog needs very little additional code to work. Essentially, you just need a way to retrieve the string specified by the user. We'll add a qiuck accessor method for this:" |
2356 | +msgstr "" |
2357 | + |
2358 | +#. Tag: literallayout |
2359 | +#: quickly-ubuntu-application-tutorial.xml:321 |
2360 | +#, no-c-format |
2361 | +msgid "" |
2362 | + "<code>@property\n" |
2363 | + " def title_text(self):\n" |
2364 | + " return self.builder.get_object(\"entry1\").get_text()</code>" |
2365 | +msgstr "" |
2366 | + |
2367 | +#. Tag: para |
2368 | +#: quickly-ubuntu-application-tutorial.xml:322 |
2369 | +#, no-c-format |
2370 | +msgid "We don't need to write any code for the Ok and Cancel buttons, as they were automatically hooked up by <application>Quickly</application> when it created the dialog." |
2371 | +msgstr "" |
2372 | + |
2373 | +#. Tag: para |
2374 | +#: quickly-ubuntu-application-tutorial.xml:323 |
2375 | +#, no-c-format |
2376 | +msgid "Before we go on to invoking the dialog, delete HBox from JottyWindow that holds the text entry and label, as we won't be needing those." |
2377 | +msgstr "" |
2378 | + |
2379 | +#. Tag: title |
2380 | +#: quickly-ubuntu-application-tutorial.xml:327 |
2381 | +#, no-c-format |
2382 | +msgid "Calling the Save Dialog" |
2383 | +msgstr "" |
2384 | + |
2385 | +#. Tag: para |
2386 | +#: quickly-ubuntu-application-tutorial.xml:327 |
2387 | +#, no-c-format |
2388 | +msgid "To use the dialog in JottyWindow, we need to follow these steps:" |
2389 | +msgstr "" |
2390 | + |
2391 | +#. Tag: para |
2392 | +#: quickly-ubuntu-application-tutorial.xml:331 |
2393 | +#, no-c-format |
2394 | +msgid "Import SaveDialog in JottyWindow" |
2395 | +msgstr "" |
2396 | + |
2397 | +#. Tag: para |
2398 | +#: quickly-ubuntu-application-tutorial.xml:334 |
2399 | +#, no-c-format |
2400 | +msgid "In the save_file function, create an instance of SaveDialog" |
2401 | +msgstr "" |
2402 | + |
2403 | +#. Tag: para |
2404 | +#: quickly-ubuntu-application-tutorial.xml:337 quickly-ubuntu-application-tutorial.xml:455 |
2405 | +#, no-c-format |
2406 | +msgid "Run the Dialog" |
2407 | +msgstr "" |
2408 | + |
2409 | +#. Tag: para |
2410 | +#: quickly-ubuntu-application-tutorial.xml:340 |
2411 | +#, no-c-format |
2412 | +msgid "Get the String" |
2413 | +msgstr "" |
2414 | + |
2415 | +#. Tag: para |
2416 | +#: quickly-ubuntu-application-tutorial.xml:343 quickly-ubuntu-application-tutorial.xml:461 |
2417 | +#, no-c-format |
2418 | +msgid "Destroy the dialog" |
2419 | +msgstr "" |
2420 | + |
2421 | +#. Tag: title |
2422 | +#: quickly-ubuntu-application-tutorial.xml:347 |
2423 | +#, no-c-format |
2424 | +msgid "Importing the SaveDialog" |
2425 | +msgstr "" |
2426 | + |
2427 | +#. Tag: para |
2428 | +#: quickly-ubuntu-application-tutorial.xml:347 |
2429 | +#, no-c-format |
2430 | +msgid "Add the SaveDialog to the list of the imported modules at the top of the bin file of your project, so it looks like this:" |
2431 | +msgstr "" |
2432 | + |
2433 | +#. Tag: code |
2434 | +#: quickly-ubuntu-application-tutorial.xml:349 |
2435 | +#, no-c-format |
2436 | +msgid "from jotty import AboutJottyDialog, PreferencesJottyDialog, SaveDialog" |
2437 | +msgstr "" |
2438 | + |
2439 | +#. Tag: title |
2440 | +#: quickly-ubuntu-application-tutorial.xml:353 quickly-ubuntu-application-tutorial.xml:480 |
2441 | +#, no-c-format |
2442 | +msgid "Create an instance of the dialog and run it" |
2443 | +msgstr "" |
2444 | + |
2445 | +#. Tag: para |
2446 | +#: quickly-ubuntu-application-tutorial.xml:353 |
2447 | +#, no-c-format |
2448 | +msgid "When the user chooses Save, we want to open the SaveDialog and collect the title of the note from the user. So we need to modify our save_file function." |
2449 | +msgstr "" |
2450 | + |
2451 | +#. Tag: para |
2452 | +#: quickly-ubuntu-application-tutorial.xml:356 |
2453 | +#, no-c-format |
2454 | +msgid "To create an instance of the dialog, use the NewSaveDialog() function in the SaveDialog module. It's important that you don't create an instance of SaveDialog directly, as it won't have a chance to load up it's UI that way, and it won't work. So whenever you use a <application>Quickly</application> dialog, do it like this:" |
2455 | +msgstr "" |
2456 | + |
2457 | +#. Tag: code |
2458 | +#: quickly-ubuntu-application-tutorial.xml:357 |
2459 | +#, no-c-format |
2460 | +msgid "saver = SaveDialog.NewSaveDialog()" |
2461 | +msgstr "" |
2462 | + |
2463 | +#. Tag: para |
2464 | +#: quickly-ubuntu-application-tutorial.xml:360 |
2465 | +#, no-c-format |
2466 | +msgid "To make the dialog appear, simply use the run() method. However, we want to check the result, so we'll need to store that in a variable. After it runs, we want to collect the string from the user, like this:" |
2467 | +msgstr "" |
2468 | + |
2469 | +#. Tag: code |
2470 | +#: quickly-ubuntu-application-tutorial.xml:361 |
2471 | +#, no-c-format |
2472 | +msgid "result = saver.run() title = saver.title_text" |
2473 | +msgstr "" |
2474 | + |
2475 | +#. Tag: title |
2476 | +#: quickly-ubuntu-application-tutorial.xml:365 |
2477 | +#, no-c-format |
2478 | +msgid "Clean up the dialog" |
2479 | +msgstr "" |
2480 | + |
2481 | +#. Tag: para |
2482 | +#: quickly-ubuntu-application-tutorial.xml:365 |
2483 | +#, no-c-format |
2484 | +msgid "We need to tell the dialog to not show itself anymore. We could call saver.hide() to make it hide, but since we don't need it hanging around, we'll just destroy it. Before we go on, though, we need to ensure that the user actually wants to save, so if we didn't get the Ok result, we should just return out of the function:" |
2485 | +msgstr "" |
2486 | + |
2487 | +#. Tag: literallayout |
2488 | +#: quickly-ubuntu-application-tutorial.xml:368 |
2489 | +#, no-c-format |
2490 | +msgid "" |
2491 | + "<code>saver.destroy()\n" |
2492 | + " if result != gtk.RESPONSE_OK:\n" |
2493 | + " return</code>" |
2494 | +msgstr "" |
2495 | + |
2496 | +#. Tag: para |
2497 | +#: quickly-ubuntu-application-tutorial.xml:370 |
2498 | +#, no-c-format |
2499 | +msgid "Since we're now getting the title from the dialog instead of the text entry, we should delete the line of the code that sents it from entry1. So except for the addition of the dialog code, the save_file function looks pretty much the same as it did in part 1:" |
2500 | +msgstr "" |
2501 | + |
2502 | +#. Tag: literallayout |
2503 | +#: quickly-ubuntu-application-tutorial.xml:373 |
2504 | +#, no-c-format |
2505 | +msgid "" |
2506 | + "<code>def save_file(self, widget, data=None):\n" |
2507 | + " #get the titel from the user\n" |
2508 | + " saver = SaveDialog.NewSaveDialog()\n" |
2509 | + " result = saver.run()\n" |
2510 | + " title = saver.title_text\n" |
2511 | + "\n" |
2512 | + " saver.destroy()\n" |
2513 | + " if result != gtk.RESPONSE_OK:\n" |
2514 | + " return\n" |
2515 | + "\n" |
2516 | + " #get the text to save\n" |
2517 | + " buff = self.builder.get_object(\"textview1\").get_buffer()\n" |
2518 | + " start_iter = buff.get_start_iter()\n" |
2519 | + " end_iter = buff.get_end_iter()\n" |
2520 | + " text = buff.get_text(start_iter,end_iter)\n" |
2521 | + "\n" |
2522 | + " #get all the records\n" |
2523 | + " record_type = \"http://wiki.ubuntu.com/<application>Quickly</application>/JottyDoc\"\n" |
2524 | + " results = self.database.get_records(record_type = record_type,create_view = True)\n" |
2525 | + "\n" |
2526 | + " #update a record that has the same title\n" |
2527 | + " for result in results:\n" |
2528 | + " record = result.value\n" |
2529 | + " if record[\"title\"] == title:\n" |
2530 | + " key = result.key\n" |
2531 | + " self.database.update_fields(key, {\"text\":text})\n" |
2532 | + " return\n" |
2533 | + " \n" |
2534 | + " #if no records had the title, create it \n" |
2535 | + " new_rec = Record({\"record_type\":record_type,\"title\":title, \"text\":text})\n" |
2536 | + " self.database.put_record(new_rec)</code>" |
2537 | +msgstr "" |
2538 | + |
2539 | +#. Tag: para |
2540 | +#: quickly-ubuntu-application-tutorial.xml:374 |
2541 | +#, no-c-format |
2542 | +msgid "Now when we choose save, we get the SaveDialog instead:" |
2543 | +msgstr "" |
2544 | + |
2545 | +#. Tag: title |
2546 | +#: quickly-ubuntu-application-tutorial.xml:379 |
2547 | +#, no-c-format |
2548 | +msgid "Creating a Dialog with a CouchGrid" |
2549 | +msgstr "" |
2550 | + |
2551 | +#. Tag: para |
2552 | +#: quickly-ubuntu-application-tutorial.xml:379 |
2553 | +#, no-c-format |
2554 | +msgid "We'll use a similar approach in the Open dialog that we did with Save. However, there is one big difference, we want to provide the user with a list of documents that you could choose to open. We'll use a widget called CouchGrid, which is included in the desktopcouch api for this." |
2555 | +msgstr "" |
2556 | + |
2557 | +#. Tag: title |
2558 | +#: quickly-ubuntu-application-tutorial.xml:382 |
2559 | +#, no-c-format |
2560 | +msgid "Create the Open Dialog" |
2561 | +msgstr "" |
2562 | + |
2563 | +#. Tag: code |
2564 | +#: quickly-ubuntu-application-tutorial.xml:383 |
2565 | +#, no-c-format |
2566 | +msgid "<application>Quickly</application> dialog open" |
2567 | +msgstr "" |
2568 | + |
2569 | +#. Tag: para |
2570 | +#: quickly-ubuntu-application-tutorial.xml:386 |
2571 | +#, no-c-format |
2572 | +msgid "Start out by closing, and then reopening glade again:" |
2573 | +msgstr "" |
2574 | + |
2575 | +#. Tag: para |
2576 | +#: quickly-ubuntu-application-tutorial.xml:391 |
2577 | +#, no-c-format |
2578 | +msgid "Start by adding a VBox and a label in the same manner as in the Save Dialog above. Leave an empty space in the VBox. We will use code to put the CouchGrid there." |
2579 | +msgstr "" |
2580 | + |
2581 | +#. Tag: title |
2582 | +#: quickly-ubuntu-application-tutorial.xml:395 |
2583 | +#, no-c-format |
2584 | +msgid "Coding the Open Dialog" |
2585 | +msgstr "" |
2586 | + |
2587 | +#. Tag: title |
2588 | +#: quickly-ubuntu-application-tutorial.xml:396 |
2589 | +#, no-c-format |
2590 | +msgid "Creating and Adding a CouchGrid" |
2591 | +msgstr "" |
2592 | + |
2593 | +#. Tag: para |
2594 | +#: quickly-ubuntu-application-tutorial.xml:396 |
2595 | +#, no-c-format |
2596 | +msgid "It just takes a little bit of code to add a CouchGrid to the dialog. We need to:" |
2597 | +msgstr "" |
2598 | + |
2599 | +#. Tag: para |
2600 | +#: quickly-ubuntu-application-tutorial.xml:400 |
2601 | +#, no-c-format |
2602 | +msgid "Import the CouchGrid class." |
2603 | +msgstr "" |
2604 | + |
2605 | +#. Tag: para |
2606 | +#: quickly-ubuntu-application-tutorial.xml:403 |
2607 | +#, no-c-format |
2608 | +msgid "Create a CouchGrid pointing at the jotty database, and the desired record type." |
2609 | +msgstr "" |
2610 | + |
2611 | +#. Tag: para |
2612 | +#: quickly-ubuntu-application-tutorial.xml:406 |
2613 | +#, no-c-format |
2614 | +msgid "Add the CouchGrid to the dialog." |
2615 | +msgstr "" |
2616 | + |
2617 | +#. Tag: title |
2618 | +#: quickly-ubuntu-application-tutorial.xml:410 |
2619 | +#, no-c-format |
2620 | +msgid "Import the CouchGrid class" |
2621 | +msgstr "" |
2622 | + |
2623 | +#. Tag: para |
2624 | +#: quickly-ubuntu-application-tutorial.xml:410 |
2625 | +#, no-c-format |
2626 | +msgid "CouchGrid is part of the desktopcouch records api, so we import it like this:" |
2627 | +msgstr "" |
2628 | + |
2629 | +#. Tag: code |
2630 | +#: quickly-ubuntu-application-tutorial.xml:412 |
2631 | +#, no-c-format |
2632 | +msgid "from desktopcouch.records.couchgrid import CouchGrid" |
2633 | +msgstr "" |
2634 | + |
2635 | +#. Tag: title |
2636 | +#: quickly-ubuntu-application-tutorial.xml:415 |
2637 | +#, no-c-format |
2638 | +msgid "Create the CouchGrid" |
2639 | +msgstr "" |
2640 | + |
2641 | +#. Tag: para |
2642 | +#: quickly-ubuntu-application-tutorial.xml:415 |
2643 | +#, no-c-format |
2644 | +msgid "A CouchGrid needs to know three things, the name of the database, the name of the record type, and the name of the keys to use. \"keys\" is a list of fields that the widget will display, and by default will also use the same text for the heading of any columns. This set up should be done in the OpenDialog's finish_initalizing function. All this is easily done in code like this:" |
2645 | +msgstr "" |
2646 | + |
2647 | +#. Tag: literallayout |
2648 | +#: quickly-ubuntu-application-tutorial.xml:419 |
2649 | +#, no-c-format |
2650 | +msgid "" |
2651 | + "<code>database = \"jotty\"\n" |
2652 | + " keys = [\"title\"]\n" |
2653 | + " record_type = \"http://wiki.ubuntu.com/<application>Quickly</application>/JottyDoc\"\n" |
2654 | + " self.couchgrid = CouchGrid(database, record_type=record_type,keys=keys)</code>" |
2655 | +msgstr "" |
2656 | + |
2657 | +#. Tag: title |
2658 | +#: quickly-ubuntu-application-tutorial.xml:420 |
2659 | +#, no-c-format |
2660 | +msgid "Add the CouchGrid to the Dialog" |
2661 | +msgstr "" |
2662 | + |
2663 | +#. Tag: para |
2664 | +#: quickly-ubuntu-application-tutorial.xml:420 |
2665 | +#, no-c-format |
2666 | +msgid "we added the VBox to the dialog, we left an open space at the bottom. We'll use this by \"packing\" the CouchGrid into the VBox. We need to show it as well. So add the following lines to the finish_initializing function as well:" |
2667 | +msgstr "" |
2668 | + |
2669 | +#. Tag: literallayout |
2670 | +#: quickly-ubuntu-application-tutorial.xml:424 |
2671 | +#, no-c-format |
2672 | +msgid "" |
2673 | + "<code>self.couchgrid.show()\n" |
2674 | + " self.builder.get_object(\"vbox1\").pack_end(self.couchgrid)</code>" |
2675 | +msgstr "" |
2676 | + |
2677 | +#. Tag: title |
2678 | +#: quickly-ubuntu-application-tutorial.xml:426 |
2679 | +#, no-c-format |
2680 | +msgid "Create the get_selection function" |
2681 | +msgstr "" |
2682 | + |
2683 | +#. Tag: para |
2684 | +#: quickly-ubuntu-application-tutorial.xml:426 |
2685 | +#, no-c-format |
2686 | +msgid "The dialog still needs a bit more code to work. It needs to return the user's selection, if there is one. To do this, we need to ask the CouchGrid what is selected. This is easy using the widgets selected_record_ids function. But the CouchGrid supports multiple selection, so we'll do the following:" |
2687 | +msgstr "" |
2688 | + |
2689 | +#. Tag: para |
2690 | +#: quickly-ubuntu-application-tutorial.xml:430 |
2691 | +#, no-c-format |
2692 | +msgid "Use a decorator to define the function as a property accessor." |
2693 | +msgstr "" |
2694 | + |
2695 | +#. Tag: para |
2696 | +#: quickly-ubuntu-application-tutorial.xml:433 |
2697 | +#, no-c-format |
2698 | +msgid "Get all the selected record ids." |
2699 | +msgstr "" |
2700 | + |
2701 | +#. Tag: para |
2702 | +#: quickly-ubuntu-application-tutorial.xml:436 |
2703 | +#, no-c-format |
2704 | +msgid "If none are selected, return None." |
2705 | +msgstr "" |
2706 | + |
2707 | +#. Tag: para |
2708 | +#: quickly-ubuntu-application-tutorial.xml:439 |
2709 | +#, no-c-format |
2710 | +msgid "Pick the first one and return it." |
2711 | +msgstr "" |
2712 | + |
2713 | +#. Tag: para |
2714 | +#: quickly-ubuntu-application-tutorial.xml:442 |
2715 | +#, no-c-format |
2716 | +msgid "So the function to add to OpenDialog looks like this:" |
2717 | +msgstr "" |
2718 | + |
2719 | +#. Tag: literallayout |
2720 | +#: quickly-ubuntu-application-tutorial.xml:444 |
2721 | +#, no-c-format |
2722 | +msgid "" |
2723 | + "<code>@property\n" |
2724 | + " def selected_record_id(self):\n" |
2725 | + " ids = self.couchgrid.selected_record_ids\n" |
2726 | + " if len(ids) < 1:\n" |
2727 | + " return None\n" |
2728 | + " else:\n" |
2729 | + " return ids[0]</code>" |
2730 | +msgstr "" |
2731 | + |
2732 | +#. Tag: title |
2733 | +#: quickly-ubuntu-application-tutorial.xml:445 |
2734 | +#, no-c-format |
2735 | +msgid "Using the Open Dialog" |
2736 | +msgstr "" |
2737 | + |
2738 | +#. Tag: para |
2739 | +#: quickly-ubuntu-application-tutorial.xml:445 |
2740 | +#, no-c-format |
2741 | +msgid "Now we want to use the Open Dialog in the JottyWindow open_file function. To use it,we'll follow these steps:" |
2742 | +msgstr "" |
2743 | + |
2744 | +#. Tag: para |
2745 | +#: quickly-ubuntu-application-tutorial.xml:449 |
2746 | +#, no-c-format |
2747 | +msgid "Import OpenDialog in JottyWindow" |
2748 | +msgstr "" |
2749 | + |
2750 | +#. Tag: para |
2751 | +#: quickly-ubuntu-application-tutorial.xml:452 |
2752 | +#, no-c-format |
2753 | +msgid "In the open_file function, create an instance of OpenDialog" |
2754 | +msgstr "" |
2755 | + |
2756 | +#. Tag: para |
2757 | +#: quickly-ubuntu-application-tutorial.xml:458 |
2758 | +#, no-c-format |
2759 | +msgid "Get the id for the selected title." |
2760 | +msgstr "" |
2761 | + |
2762 | +#. Tag: para |
2763 | +#: quickly-ubuntu-application-tutorial.xml:464 |
2764 | +#, no-c-format |
2765 | +msgid "Check the response before proceeding" |
2766 | +msgstr "" |
2767 | + |
2768 | +#. Tag: para |
2769 | +#: quickly-ubuntu-application-tutorial.xml:467 |
2770 | +#, no-c-format |
2771 | +msgid "<para>Use the id to get the record from CouchDB</para>" |
2772 | +msgstr "" |
2773 | + |
2774 | +#. Tag: para |
2775 | +#: quickly-ubuntu-application-tutorial.xml:470 |
2776 | +#, no-c-format |
2777 | +msgid "<para>Update the UI</para>" |
2778 | +msgstr "" |
2779 | + |
2780 | +#. Tag: title |
2781 | +#: quickly-ubuntu-application-tutorial.xml:474 |
2782 | +#, no-c-format |
2783 | +msgid "Import OpenDialog" |
2784 | +msgstr "" |
2785 | + |
2786 | +#. Tag: para |
2787 | +#: quickly-ubuntu-application-tutorial.xml:474 |
2788 | +#, no-c-format |
2789 | +msgid "Just like the SaveDialog, add the import line to the list of imports:" |
2790 | +msgstr "" |
2791 | + |
2792 | +#. Tag: code |
2793 | +#: quickly-ubuntu-application-tutorial.xml:476 |
2794 | +#, no-c-format |
2795 | +msgid "from jotty import AboutJottyDialog, PreferencesJottyDialog, SaveDialog, OpenDialog" |
2796 | +msgstr "" |
2797 | + |
2798 | +#. Tag: para |
2799 | +#: quickly-ubuntu-application-tutorial.xml:480 |
2800 | +#, no-c-format |
2801 | +msgid "So now we're ready to call the dialog from the JottyWindow's open_file function. Creating the OpenDialog is exactly the same as creating the SaveDialog, except we also want to tell it to load the titles before we run it:" |
2802 | +msgstr "" |
2803 | + |
2804 | +#. Tag: literallayout |
2805 | +#: quickly-ubuntu-application-tutorial.xml:483 |
2806 | +#, no-c-format |
2807 | +msgid "" |
2808 | + "<code>opener = OpenDialog.NewOpenDialog()\n" |
2809 | + " result = opener.run()</code>" |
2810 | +msgstr "" |
2811 | + |
2812 | +#. Tag: title |
2813 | +#: quickly-ubuntu-application-tutorial.xml:485 |
2814 | +#, no-c-format |
2815 | +msgid "Get the id for the selected title" |
2816 | +msgstr "" |
2817 | + |
2818 | +#. Tag: para |
2819 | +#: quickly-ubuntu-application-tutorial.xml:485 |
2820 | +#, no-c-format |
2821 | +msgid "Now use the property that we created to retrieve the title and text from the dialog. Don't forget to check the response type before going on." |
2822 | +msgstr "" |
2823 | + |
2824 | +#. Tag: literallayout |
2825 | +#: quickly-ubuntu-application-tutorial.xml:488 |
2826 | +#, no-c-format |
2827 | +msgid "" |
2828 | + "<code>rec_id = opener.selected_record_id\n" |
2829 | + "\n" |
2830 | + " #close the dialog, and check whether to proceed\n" |
2831 | + " opener.destroy()\n" |
2832 | + " if result != gtk.RESPONSE_OK:\n" |
2833 | + " return</code>" |
2834 | +msgstr "" |
2835 | + |
2836 | +#. Tag: title |
2837 | +#: quickly-ubuntu-application-tutorial.xml:491 |
2838 | +#, no-c-format |
2839 | +msgid "<title>Use the id to get the record from CouchDB</title>" |
2840 | +msgstr "" |
2841 | + |
2842 | +#. Tag: para |
2843 | +#: quickly-ubuntu-application-tutorial.xml:491 |
2844 | +#, no-c-format |
2845 | +msgid "If nothing was selected, we'll just return. Otherwise, we'll retrieve the record from CouchDB and pull out the text for the document:" |
2846 | +msgstr "" |
2847 | + |
2848 | +#. Tag: literallayout |
2849 | +#: quickly-ubuntu-application-tutorial.xml:494 |
2850 | +#, no-c-format |
2851 | +msgid "" |
2852 | + "<code>#get the record from CouchDB and extract the text\n" |
2853 | + " if rec_id == None:\n" |
2854 | + " return\n" |
2855 | + " record = self.database.get_record(rec_id)\n" |
2856 | + " text = record[\"text\"]</code>" |
2857 | +msgstr "" |
2858 | + |
2859 | +#. Tag: title |
2860 | +#: quickly-ubuntu-application-tutorial.xml:496 |
2861 | +#, no-c-format |
2862 | +msgid "<title>Update the UI</title>" |
2863 | +msgstr "" |
2864 | + |
2865 | +#. Tag: para |
2866 | +#: quickly-ubuntu-application-tutorial.xml:496 |
2867 | +#, no-c-format |
2868 | +msgid "Now just put the text into the texview:" |
2869 | +msgstr "" |
2870 | + |
2871 | +#. Tag: literallayout |
2872 | +#: quickly-ubuntu-application-tutorial.xml:499 |
2873 | +#, no-c-format |
2874 | +msgid "" |
2875 | + "<code>#set the UI to display the string\n" |
2876 | + " buff = self.builder.get_object(\"textview1\").get_buffer()\n" |
2877 | + " buff.set_text(text)</code>" |
2878 | +msgstr "" |
2879 | + |
2880 | +#. Tag: para |
2881 | +#: quickly-ubuntu-application-tutorial.xml:500 |
2882 | +#, no-c-format |
2883 | +msgid "That's all there is to it. So the whole open_file function looks like this:" |
2884 | +msgstr "" |
2885 | + |
2886 | +#. Tag: literallayout |
2887 | +#: quickly-ubuntu-application-tutorial.xml:502 |
2888 | +#, no-c-format |
2889 | +msgid "" |
2890 | + "<code>def open_file(self, widget, data=None):\n" |
2891 | + " #run the open dialog\n" |
2892 | + " opener = OpenDialog.NewOpenDialog()\n" |
2893 | + " result = opener.run()\n" |
2894 | + "\n" |
2895 | + " #get the record id from the dialog\n" |
2896 | + " rec_id = opener.selected_record_id\n" |
2897 | + "\n" |
2898 | + " #close the dialog, and check whether to proceed\n" |
2899 | + " opener.destroy()\n" |
2900 | + " if result != gtk.RESPONSE_OK:\n" |
2901 | + " return\n" |
2902 | + "\n" |
2903 | + " #get the record from CouchDB and extract the text\n" |
2904 | + " if rec_id == None:\n" |
2905 | + " return\n" |
2906 | + " record = self.database.get_record(rec_id)\n" |
2907 | + " text = record[\"text\"]\n" |
2908 | + "\n" |
2909 | + " #set the UI to display the string\n" |
2910 | + " buff = self.builder.get_object(\"textview1\").get_buffer()\n" |
2911 | + " buff.set_text(text)</code>" |
2912 | +msgstr "" |
2913 | + |
2914 | +#. Tag: para |
2915 | +#: quickly-ubuntu-application-tutorial.xml:503 |
2916 | +#, no-c-format |
2917 | +msgid "Now users get a nice open dialog:" |
2918 | +msgstr "" |
2919 | + |
2920 | +#. Tag: para |
2921 | +#: quickly-ubuntu-application-tutorial.xml:508 |
2922 | +#, no-c-format |
2923 | +msgid "However, the application is not complete. There are a few things left for you to do:" |
2924 | +msgstr "" |
2925 | + |
2926 | +#. Tag: para |
2927 | +#: quickly-ubuntu-application-tutorial.xml:511 |
2928 | +#, no-c-format |
2929 | +msgid "Set the title of the JottyWindow to display the note title. Try self.set_text(title)." |
2930 | +msgstr "" |
2931 | + |
2932 | +#. Tag: para |
2933 | +#: quickly-ubuntu-application-tutorial.xml:514 |
2934 | +#, no-c-format |
2935 | +msgid "The Save command works more like \"Save As\". The application probably shouldn't pop up a SaveDialog every time you want to save. If it's already been saved, you probably just want to save it, but use a SaveDialog when the user choose Save As, or is saving a document for the first time." |
2936 | +msgstr "" |
2937 | + |
2938 | +#. Tag: para |
2939 | +#: quickly-ubuntu-application-tutorial.xml:517 |
2940 | +#, no-c-format |
2941 | +msgid "The OpenDialog should probably return when the user double clicks on an item in the list. Try connecting to the \"select-cursor-row\" signal on the TreeView, and calling self.response(gtk.RESPONSE_OK) in the handler." |
2942 | +msgstr "" |
2943 | + |
2944 | +#. Tag: para |
2945 | +#: quickly-ubuntu-application-tutorial.xml:520 |
2946 | +#, no-c-format |
2947 | +msgid "Perhaps the Ok button in the OpenDialog should be disabled if nothing is selected. Try setting the \"sensitivity\" in Glade, and the set_sensitive function for the Ok button." |
2948 | +msgstr "" |
2949 | + |
2950 | +#. Tag: para |
2951 | +#: quickly-ubuntu-application-tutorial.xml:523 |
2952 | +#, no-c-format |
2953 | +msgid "It would be more consistent for the Open and Close dialogs to have \"Open\" and \"Close\" for buttons instead of \"Ok\". You can set a different type in the properties window in Glade." |
2954 | +msgstr "" |
2955 | + |
2956 | +#. Tag: para |
2957 | +#: quickly-ubuntu-application-tutorial.xml:526 |
2958 | +#, no-c-format |
2959 | +msgid "Loading every document into the open dialog is probably a bit inefficient. Perhaps storing the document id and using that to retrieve the document would be a better implementation." |
2960 | +msgstr "" |
2961 | + |
2962 | +#. Tag: title |
2963 | +#: quickly-ubuntu-application-tutorial.xml:532 |
2964 | +#, no-c-format |
2965 | +msgid "<title>Introduction to <application>Quickly</application> Part 3</title>" |
2966 | +msgstr "" |
2967 | + |
2968 | +#. Tag: para |
2969 | +#: quickly-ubuntu-application-tutorial.xml:533 |
2970 | +#, no-c-format |
2971 | +msgid "In parts 1 and 2, we showed how to create a simple Ubuntu application using <application>Quickly</application>. This section will cover how to package an application so that it is easy for you to share, and easy for other people to install." |
2972 | +msgstr "" |
2973 | + |
2974 | +#. Tag: title |
2975 | +#: quickly-ubuntu-application-tutorial.xml:534 |
2976 | +#, no-c-format |
2977 | +msgid "License your Application" |
2978 | +msgstr "" |
2979 | + |
2980 | +#. Tag: para |
2981 | +#: quickly-ubuntu-application-tutorial.xml:534 |
2982 | +#, no-c-format |
2983 | +msgid "It's important to license your code so users and other programmers know their rights in terms of redistributing or modifying it. To <application>Quickly</application> grant a GPL license to your code, simply:" |
2984 | +msgstr "" |
2985 | + |
2986 | +#. Tag: para |
2987 | +#: quickly-ubuntu-application-tutorial.xml:538 |
2988 | +#, no-c-format |
2989 | +msgid "Specify your name and email address in the Copyright file." |
2990 | +msgstr "" |
2991 | + |
2992 | +#. Tag: para |
2993 | +#: quickly-ubuntu-application-tutorial.xml:541 |
2994 | +#, no-c-format |
2995 | +msgid "Run the \"license\" command." |
2996 | +msgstr "" |
2997 | + |
2998 | +#. Tag: title |
2999 | +#: quickly-ubuntu-application-tutorial.xml:545 |
3000 | +#, no-c-format |
3001 | +msgid "Specify your name and email" |
3002 | +msgstr "" |
3003 | + |
3004 | +#. Tag: para |
3005 | +#: quickly-ubuntu-application-tutorial.xml:545 |
3006 | +#, no-c-format |
3007 | +msgid "When <application>Quickly</application> created your ubuntu application, it added a file named Copyright in the top level of the directory. Open this file in your text editor, and modify the top line so it has your name and email included. Be sure not to modify other lines as it will interfere with the next step. For example, I would change the entire file to look like this:" |
3008 | +msgstr "" |
3009 | + |
3010 | +#. Tag: literallayout |
3011 | +#: quickly-ubuntu-application-tutorial.xml:548 |
3012 | +#, no-c-format |
3013 | +msgid "" |
3014 | + "<code># Copyright (C) 2009 Rick Spencer rick.spencer@canonical.com\n" |
3015 | + "### BEGIN AUTOMATIC LICENSE GENERATION\n" |
3016 | + "### END AUTOMATIC LICENSE GENERATION\n" |
3017 | + "</code>" |
3018 | +msgstr "" |
3019 | + |
3020 | +#. Tag: title |
3021 | +#: quickly-ubuntu-application-tutorial.xml:549 |
3022 | +#, no-c-format |
3023 | +msgid "Run the \"License\" Command" |
3024 | +msgstr "" |
3025 | + |
3026 | +#. Tag: para |
3027 | +#: quickly-ubuntu-application-tutorial.xml:549 |
3028 | +#, no-c-format |
3029 | +msgid "By default, <application>Quickly</application> will use a GPL 3 license for your project. To use this license, use this command:" |
3030 | +msgstr "" |
3031 | + |
3032 | +#. Tag: code |
3033 | +#: quickly-ubuntu-application-tutorial.xml:551 quickly-ubuntu-application-tutorial.xml:571 |
3034 | +#, no-c-format |
3035 | +msgid "<application>Quickly</application> license" |
3036 | +msgstr "" |
3037 | + |
3038 | +#. Tag: para |
3039 | +#: quickly-ubuntu-application-tutorial.xml:554 |
3040 | +#, no-c-format |
3041 | +msgid "This will add the GPL 3 license to all of your code files that you've added to your project using <application>Quickly</application>." |
3042 | +msgstr "" |
3043 | + |
3044 | +#. Tag: para |
3045 | +#: quickly-ubuntu-application-tutorial.xml:555 |
3046 | +#, no-c-format |
3047 | +msgid "Keep in mind a couple of things:" |
3048 | +msgstr "" |
3049 | + |
3050 | +#. Tag: para |
3051 | +#: quickly-ubuntu-application-tutorial.xml:558 |
3052 | +#, no-c-format |
3053 | +msgid "This is a one way trip. Once you license the project, changes to the license must be done manually." |
3054 | +msgstr "" |
3055 | + |
3056 | +#. Tag: para |
3057 | +#: quickly-ubuntu-application-tutorial.xml:561 |
3058 | +#, no-c-format |
3059 | +msgid "If you prefer a GPL 2 license, you can specify that when you issue the license command:" |
3060 | +msgstr "" |
3061 | + |
3062 | +#. Tag: code |
3063 | +#: quickly-ubuntu-application-tutorial.xml:562 |
3064 | +#, no-c-format |
3065 | +msgid "<application>Quickly</application> license GPL-2" |
3066 | +msgstr "" |
3067 | + |
3068 | +#. Tag: para |
3069 | +#: quickly-ubuntu-application-tutorial.xml:567 |
3070 | +#, no-c-format |
3071 | +msgid "<application>Quickly</application> doesn't care what license you use, but only knows natively what files and headers to include for BSD, GPL-2, GPL-3, LGPL-2 and LGPL-3. If you prefer another license, you can simply add whatever you license you like by adding your own license in the Copyright file:" |
3072 | +msgstr "" |
3073 | + |
3074 | +#. Tag: literallayout |
3075 | +#: quickly-ubuntu-application-tutorial.xml:569 |
3076 | +#, no-c-format |
3077 | +msgid "" |
3078 | + "<code>### BEGIN AUTOMATIC LICENSE GENERATION\n" |
3079 | + "# My personal license here\n" |
3080 | + "### END AUTOMATIC LICENSE GENERATION</code>" |
3081 | +msgstr "" |
3082 | + |
3083 | +#. Tag: para |
3084 | +#: quickly-ubuntu-application-tutorial.xml:570 |
3085 | +#, no-c-format |
3086 | +msgid "and then run:" |
3087 | +msgstr "" |
3088 | + |
3089 | +#. Tag: para |
3090 | +#: quickly-ubuntu-application-tutorial.xml:574 |
3091 | +#, no-c-format |
3092 | +msgid "to license every files." |
3093 | +msgstr "" |
3094 | + |
3095 | +#. Tag: para |
3096 | +#: quickly-ubuntu-application-tutorial.xml:577 |
3097 | +#, no-c-format |
3098 | +msgid "If you've added code files or other files to your project manually, you will need to add the license to those files manually or add those tags at the beginning of the file:" |
3099 | +msgstr "" |
3100 | + |
3101 | +#. Tag: literallayout |
3102 | +#: quickly-ubuntu-application-tutorial.xml:579 |
3103 | +#, no-c-format |
3104 | +msgid "" |
3105 | + "<code>### BEGIN LICENSE\n" |
3106 | + "### END LICENSE</code>" |
3107 | +msgstr "" |
3108 | + |
3109 | +#. Tag: title |
3110 | +#: quickly-ubuntu-application-tutorial.xml:583 |
3111 | +#, no-c-format |
3112 | +msgid "Translate Your Application" |
3113 | +msgstr "" |
3114 | + |
3115 | +#. Tag: para |
3116 | +#: quickly-ubuntu-application-tutorial.xml:583 |
3117 | +#, no-c-format |
3118 | +msgid "To allow for users from other countries to use your application you may want to translate it. Glade automatically creates a pot file for you but to translate strings in your code you have to:" |
3119 | +msgstr "" |
3120 | + |
3121 | +#. Tag: code |
3122 | +#: quickly-ubuntu-application-tutorial.xml:585 |
3123 | +#, no-c-format |
3124 | +msgid "import gettext" |
3125 | +msgstr "" |
3126 | + |
3127 | +#. Tag: code |
3128 | +#: quickly-ubuntu-application-tutorial.xml:586 |
3129 | +#, no-c-format |
3130 | +msgid "gettext.gettext(\"What you want translated\")" |
3131 | +msgstr "" |
3132 | + |
3133 | +#. Tag: title |
3134 | +#: quickly-ubuntu-application-tutorial.xml:588 |
3135 | +#, no-c-format |
3136 | +msgid "Specify Application Settings" |
3137 | +msgstr "" |
3138 | + |
3139 | +#. Tag: para |
3140 | +#: quickly-ubuntu-application-tutorial.xml:588 |
3141 | +#, no-c-format |
3142 | +msgid "You should personalize your application a little before creating the archive. This is very easy to do, as all of the files that you need have already been created, and only need a few lines changed to make them your own. To do this you should:" |
3143 | +msgstr "" |
3144 | + |
3145 | +#. Tag: para |
3146 | +#: quickly-ubuntu-application-tutorial.xml:592 |
3147 | +#, no-c-format |
3148 | +msgid "Personalize the Application Icon" |
3149 | +msgstr "" |
3150 | + |
3151 | +#. Tag: para |
3152 | +#: quickly-ubuntu-application-tutorial.xml:593 |
3153 | +#, no-c-format |
3154 | +msgid "<para>Edit the Desktop File</para>" |
3155 | +msgstr "" |
3156 | + |
3157 | +#. Tag: para |
3158 | +#: quickly-ubuntu-application-tutorial.xml:594 |
3159 | +#, no-c-format |
3160 | +msgid "Edit the setup.py File" |
3161 | +msgstr "" |
3162 | + |
3163 | +#. Tag: title |
3164 | +#: quickly-ubuntu-application-tutorial.xml:597 |
3165 | +#, no-c-format |
3166 | +msgid "Personalize your Application Icon" |
3167 | +msgstr "" |
3168 | + |
3169 | +#. Tag: para |
3170 | +#: quickly-ubuntu-application-tutorial.xml:597 |
3171 | +#, no-c-format |
3172 | +msgid "When users install your application, Ubuntu will display an icon next to it in the menus. You can create your own icon or edit the file called \"icon.png\" in the media directory (jotty/data/media). Ubuntu comes with a great image editing program called \"Gimp.\" So you can go:" |
3173 | +msgstr "" |
3174 | + |
3175 | +#. Tag: code |
3176 | +#: quickly-ubuntu-application-tutorial.xml:599 |
3177 | +#, no-c-format |
3178 | +msgid "gimp data/media/icon.png" |
3179 | +msgstr "" |
3180 | + |
3181 | +#. Tag: para |
3182 | +#: quickly-ubuntu-application-tutorial.xml:605 |
3183 | +#, no-c-format |
3184 | +msgid "If you don't personalize the icon, it's ok, your app will just have the default icon, such as in the image below." |
3185 | +msgstr "" |
3186 | + |
3187 | +#. Tag: title |
3188 | +#: quickly-ubuntu-application-tutorial.xml:607 |
3189 | +#, no-c-format |
3190 | +msgid "<title>Edit the Desktop File</title>" |
3191 | +msgstr "" |
3192 | + |
3193 | +#. Tag: para |
3194 | +#: quickly-ubuntu-application-tutorial.xml:607 |
3195 | +#, no-c-format |
3196 | +msgid "By default, <application>Quickly</application> Ubuntu applications are classified as \"utilities\", so they show up under the Accessories menu in Ubuntu. If we wanted to make Jotty show up in another category, we can do this by editing the desktop file. A desktop file is a file that describes your application to a Linux desktop. The file \"jottydesktop.in\" was automatically created in the jotty project directory. To change Jotty from a Utility to an Office application, edit jotty.desktop.in and change this:" |
3197 | +msgstr "" |
3198 | + |
3199 | +#. Tag: literallayout |
3200 | +#: quickly-ubuntu-application-tutorial.xml:611 |
3201 | +#, no-c-format |
3202 | +msgid "" |
3203 | + "<code>[Desktop Entry]\n" |
3204 | + "Name=Jotty\n" |
3205 | + "Comment=Jotty application\n" |
3206 | + "Categories=GNOME;Utility;\n" |
3207 | + "Exec=jotty\n" |
3208 | + "Icon=jotty\n" |
3209 | + "Terminal=false\n" |
3210 | + "Type=Application\n" |
3211 | + "</code>" |
3212 | +msgstr "" |
3213 | + |
3214 | +#. Tag: para |
3215 | +#: quickly-ubuntu-application-tutorial.xml:613 |
3216 | +#, no-c-format |
3217 | +msgid "to this:" |
3218 | +msgstr "" |
3219 | + |
3220 | +#. Tag: literallayout |
3221 | +#: quickly-ubuntu-application-tutorial.xml:617 |
3222 | +#, no-c-format |
3223 | +msgid "" |
3224 | + "<code>[Desktop Entry]\n" |
3225 | + "Name=Jotty\n" |
3226 | + "Comment=Jotty application\n" |
3227 | + "Categories=GNOME;Office;\n" |
3228 | + "Exec=jotty\n" |
3229 | + "Icon=jotty\n" |
3230 | + "Terminal=false\n" |
3231 | + "Type=Application</code>" |
3232 | +msgstr "" |
3233 | + |
3234 | +#. Tag: para |
3235 | +#: quickly-ubuntu-application-tutorial.xml:618 |
3236 | +#, no-c-format |
3237 | +msgid "There are lots more categories that you can use, all defined by the FreeDesktop spec. You can see the complete list in the <ulink url=\"http://standards.freedesktop.org/menu-spec/latest/apa.html\">menu spec</ulink>." |
3238 | +msgstr "" |
3239 | + |
3240 | +#. Tag: title |
3241 | +#: quickly-ubuntu-application-tutorial.xml:622 |
3242 | +#, no-c-format |
3243 | +msgid "Edit Setup.py" |
3244 | +msgstr "" |
3245 | + |
3246 | +#. Tag: para |
3247 | +#: quickly-ubuntu-application-tutorial.xml:622 |
3248 | +#, no-c-format |
3249 | +msgid "Finally, you should include some information in the setup.py file to tell your users a little about yourself. The setup.py file was created for you, just like the desktop file. Most of of the setup.py file shouldn't be modified, as it is just boiler plate that makes your application work properly after it has been installed. However, there is a section at the bottom of the setup.py file that you should edit to describe yourself and the application." |
3250 | +msgstr "" |
3251 | + |
3252 | +#. Tag: para |
3253 | +#: quickly-ubuntu-application-tutorial.xml:625 |
3254 | +#, no-c-format |
3255 | +msgid "So I would change this section:" |
3256 | +msgstr "" |
3257 | + |
3258 | +#. Tag: literallayout |
3259 | +#: quickly-ubuntu-application-tutorial.xml:629 |
3260 | +#, no-c-format |
3261 | +msgid "" |
3262 | + "<code>DistUtilsExtra.auto.setup(\n" |
3263 | + " name='jotty',\n" |
3264 | + " version='0.1',\n" |
3265 | + " license='GPL v3',\n" |
3266 | + " #author='Your Name',\n" |
3267 | + " #author_email='email@ubuntu.com',\n" |
3268 | + " #description='UI for managing …',\n" |
3269 | + " #long_description='Here a longer description',\n" |
3270 | + " #url='https://launchpad.net/jotty',\n" |
3271 | + " cmdclass={'install': InstallAndUpdateDataDirectory}\n" |
3272 | + " )\n" |
3273 | + "</code>" |
3274 | +msgstr "" |
3275 | + |
3276 | +#. Tag: para |
3277 | +#: quickly-ubuntu-application-tutorial.xml:630 |
3278 | +#, no-c-format |
3279 | +msgid "To look like this:" |
3280 | +msgstr "" |
3281 | + |
3282 | +#. Tag: literallayout |
3283 | +#: quickly-ubuntu-application-tutorial.xml:634 |
3284 | +#, no-c-format |
3285 | +msgid "" |
3286 | + "<code>DistUtilsExtra.auto.setup(\n" |
3287 | + " name='jotty',\n" |
3288 | + " version='0.1',\n" |
3289 | + " license='GPL v3',\n" |
3290 | + " author='Rick Spencer',\n" |
3291 | + " author_email='rick.spencer@canonical.com',\n" |
3292 | + " description='Note taking application',\n" |
3293 | + " long_description='Note taking application that uses CouchDB as the backend to support easy replication across users and computers.',\n" |
3294 | + " #url='https://launchpad.net/jotty',\n" |
3295 | + " cmdclass={'install': InstallAndUpdateDataDirectory}\n" |
3296 | + " )</code>" |
3297 | +msgstr "" |
3298 | + |
3299 | +#. Tag: para |
3300 | +#: quickly-ubuntu-application-tutorial.xml:635 |
3301 | +#, no-c-format |
3302 | +msgid "Note that the license has already been set up for you. author and author_email are updated each time you connect to Launchpad (with <application>Quickly</application> release or <application>Quickly</application> share) with your Launchpad real name and preferred email adress." |
3303 | +msgstr "" |
3304 | + |
3305 | +#. Tag: para |
3306 | +#: quickly-ubuntu-application-tutorial.xml:636 |
3307 | +#, no-c-format |
3308 | +msgid "Notice that Jotty doesn't have a web page yet, so I just left that line commented out. Also, you don't have to increment version number as <application>Quickly</application> share and <application>Quickly</application> release commands will make it for you.." |
3309 | +msgstr "" |
3310 | + |
3311 | +#. Tag: title |
3312 | +#: quickly-ubuntu-application-tutorial.xml:640 |
3313 | +#, no-c-format |
3314 | +msgid "Create and Test the Debian Archive" |
3315 | +msgstr "" |
3316 | + |
3317 | +#. Tag: para |
3318 | +#: quickly-ubuntu-application-tutorial.xml:640 |
3319 | +#, no-c-format |
3320 | +msgid "After personalizing the project, we are now ready to create the package. This is easily done by issuing the package command:" |
3321 | +msgstr "" |
3322 | + |
3323 | +#. Tag: code |
3324 | +#: quickly-ubuntu-application-tutorial.xml:643 quickly-ubuntu-application-tutorial.xml:845 |
3325 | +#, no-c-format |
3326 | +msgid "<application>Quickly</application> package" |
3327 | +msgstr "" |
3328 | + |
3329 | +#. Tag: para |
3330 | +#: quickly-ubuntu-application-tutorial.xml:646 |
3331 | +#, no-c-format |
3332 | +msgid "This command will take a little while to discover dependencies and create all the required archives, etc... It will also report some errors as we haven't created a PGP key, for instance. None the less, when it is done, the package will be created. Using the file browser, you can see the created package next to the project directory:" |
3333 | +msgstr "" |
3334 | + |
3335 | +#. Tag: para |
3336 | +#: quickly-ubuntu-application-tutorial.xml:650 |
3337 | +#, no-c-format |
3338 | +msgid "Right now, the specific file we are interested in is \"jotty_0.1_all.deb\". To test it out, double click on it, to open it in Ubuntu's graphical installer program:" |
3339 | +msgstr "" |
3340 | + |
3341 | +#. Tag: para |
3342 | +#: quickly-ubuntu-application-tutorial.xml:654 |
3343 | +#, no-c-format |
3344 | +msgid "Click \"Install Package\" to see how it installs onto your desktop. After chugging for a bit, you'll see that it is installed in the Applications->Office menu. If you customized your icon, you'll see that the menu uses your custom icon as well." |
3345 | +msgstr "" |
3346 | + |
3347 | +#. Tag: title |
3348 | +#: quickly-ubuntu-application-tutorial.xml:658 |
3349 | +#, no-c-format |
3350 | +msgid "Now that you have a package" |
3351 | +msgstr "" |
3352 | + |
3353 | +#. Tag: para |
3354 | +#: quickly-ubuntu-application-tutorial.xml:658 |
3355 | +#, no-c-format |
3356 | +msgid "Now that you've packaged your application, you can share the .deb file. However, if your users install their application this way, and you update the application, your users will have to find this out and resinstall. This hassle can be avoided in Ubuntu by using Personal Package Archives (or PPAs). Distrubuting your applications in this manner is covered in section 4 (not yet available)." |
3357 | +msgstr "" |
3358 | + |
3359 | +#. Tag: title |
3360 | +#: quickly-ubuntu-application-tutorial.xml:662 |
3361 | +#, no-c-format |
3362 | +msgid "<title><application>Quickly</application>: <application>Quickly</application> Command Reference</title>" |
3363 | +msgstr "" |
3364 | + |
3365 | +#. Tag: para |
3366 | +#: quickly-ubuntu-application-tutorial.xml:663 |
3367 | +#, no-c-format |
3368 | +msgid "The ubuntu-application template template contains the following commands." |
3369 | +msgstr "" |
3370 | + |
3371 | +#. Tag: listitem |
3372 | +#: quickly-ubuntu-application-tutorial.xml:665 |
3373 | +#, no-c-format |
3374 | +msgid "<listitem>create</listitem>" |
3375 | +msgstr "" |
3376 | + |
3377 | +#. Tag: listitem |
3378 | +#: quickly-ubuntu-application-tutorial.xml:668 |
3379 | +#, no-c-format |
3380 | +msgid "<listitem>dialog</listitem>" |
3381 | +msgstr "" |
3382 | + |
3383 | +#. Tag: listitem |
3384 | +#: quickly-ubuntu-application-tutorial.xml:671 |
3385 | +#, no-c-format |
3386 | +msgid "<listitem>edit</listitem>" |
3387 | +msgstr "" |
3388 | + |
3389 | +#. Tag: listitem |
3390 | +#: quickly-ubuntu-application-tutorial.xml:674 |
3391 | +#, no-c-format |
3392 | +msgid "design" |
3393 | +msgstr "" |
3394 | + |
3395 | +#. Tag: listitem |
3396 | +#: quickly-ubuntu-application-tutorial.xml:677 |
3397 | +#, no-c-format |
3398 | +msgid "<listitem>help</listitem>" |
3399 | +msgstr "" |
3400 | + |
3401 | +#. Tag: listitem |
3402 | +#: quickly-ubuntu-application-tutorial.xml:680 |
3403 | +#, no-c-format |
3404 | +msgid "<listitem>license</listitem>" |
3405 | +msgstr "" |
3406 | + |
3407 | +#. Tag: listitem |
3408 | +#: quickly-ubuntu-application-tutorial.xml:683 |
3409 | +#, no-c-format |
3410 | +msgid "<listitem>package</listitem>" |
3411 | +msgstr "" |
3412 | + |
3413 | +#. Tag: listitem |
3414 | +#: quickly-ubuntu-application-tutorial.xml:686 |
3415 | +#, no-c-format |
3416 | +msgid "<listitem>release</listitem>" |
3417 | +msgstr "" |
3418 | + |
3419 | +#. Tag: listitem |
3420 | +#: quickly-ubuntu-application-tutorial.xml:689 |
3421 | +#, no-c-format |
3422 | +msgid "<listitem>run</listitem>" |
3423 | +msgstr "" |
3424 | + |
3425 | +#. Tag: listitem |
3426 | +#: quickly-ubuntu-application-tutorial.xml:692 |
3427 | +#, no-c-format |
3428 | +msgid "<listitem>save</listitem>" |
3429 | +msgstr "" |
3430 | + |
3431 | +#. Tag: listitem |
3432 | +#: quickly-ubuntu-application-tutorial.xml:695 |
3433 | +#, no-c-format |
3434 | +msgid "<listitem>share</listitem>" |
3435 | +msgstr "" |
3436 | + |
3437 | +#. Tag: title |
3438 | +#: quickly-ubuntu-application-tutorial.xml:699 quickly-ubuntu-application-tutorial.xml:700 |
3439 | +#, no-c-format |
3440 | +msgid "<title>create</title>" |
3441 | +msgstr "" |
3442 | + |
3443 | +#. Tag: para |
3444 | +#: quickly-ubuntu-application-tutorial.xml:700 quickly-ubuntu-application-tutorial.xml:727 quickly-ubuntu-application-tutorial.xml:772 quickly-ubuntu-application-tutorial.xml:783 quickly-ubuntu-application-tutorial.xml:796 quickly-ubuntu-application-tutorial.xml:805 quickly-ubuntu-application-tutorial.xml:844 quickly-ubuntu-application-tutorial.xml:861 quickly-ubuntu-application-tutorial.xml:896 quickly-ubuntu-application-tutorial.xml:906 quickly-ubuntu-application-tutorial.xml:922 |
3445 | +#, no-c-format |
3446 | +msgid "Usage:" |
3447 | +msgstr "" |
3448 | + |
3449 | +#. Tag: code |
3450 | +#: quickly-ubuntu-application-tutorial.xml:702 |
3451 | +#, no-c-format |
3452 | +msgid "<application>Quickly</application> create ubuntu-application path/to/project_name" |
3453 | +msgstr "" |
3454 | + |
3455 | +#. Tag: para |
3456 | +#: quickly-ubuntu-application-tutorial.xml:704 |
3457 | +#, no-c-format |
3458 | +msgid "where \"project_name\" is one or more words separated by an underscore and path/to can be any existing path." |
3459 | +msgstr "" |
3460 | + |
3461 | +#. Tag: para |
3462 | +#: quickly-ubuntu-application-tutorial.xml:707 |
3463 | +#, no-c-format |
3464 | +msgid "This will create and run a new project, including Python code, Glade files, and packaging files to make the project work. After creating the project, get started by:" |
3465 | +msgstr "" |
3466 | + |
3467 | +#. Tag: para |
3468 | +#: quickly-ubuntu-application-tutorial.xml:713 |
3469 | +#, no-c-format |
3470 | +msgid "Changing your working directory to the new project:" |
3471 | +msgstr "" |
3472 | + |
3473 | +#. Tag: code |
3474 | +#: quickly-ubuntu-application-tutorial.xml:715 |
3475 | +#, no-c-format |
3476 | +msgid "cd path/to/project_name" |
3477 | +msgstr "" |
3478 | + |
3479 | +#. Tag: para |
3480 | +#: quickly-ubuntu-application-tutorial.xml:717 |
3481 | +#, no-c-format |
3482 | +msgid "Edit the UI with Glade:" |
3483 | +msgstr "" |
3484 | + |
3485 | +#. Tag: para |
3486 | +#: quickly-ubuntu-application-tutorial.xml:720 |
3487 | +#, no-c-format |
3488 | +msgid "Edit the Python code:" |
3489 | +msgstr "" |
3490 | + |
3491 | +#. Tag: title |
3492 | +#: quickly-ubuntu-application-tutorial.xml:726 quickly-ubuntu-application-tutorial.xml:727 |
3493 | +#, no-c-format |
3494 | +msgid "<title>dialog</title>" |
3495 | +msgstr "" |
3496 | + |
3497 | +#. Tag: code |
3498 | +#: quickly-ubuntu-application-tutorial.xml:729 |
3499 | +#, no-c-format |
3500 | +msgid "<application>Quickly</application> dialog dialog_name" |
3501 | +msgstr "" |
3502 | + |
3503 | +#. Tag: para |
3504 | +#: quickly-ubuntu-application-tutorial.xml:730 |
3505 | +#, no-c-format |
3506 | +msgid "where dialog_name is one or more words seperated with underscore" |
3507 | +msgstr "" |
3508 | + |
3509 | +#. Tag: para |
3510 | +#: quickly-ubuntu-application-tutorial.xml:731 |
3511 | +#, no-c-format |
3512 | +msgid "This will create:" |
3513 | +msgstr "" |
3514 | + |
3515 | +#. Tag: para |
3516 | +#: quickly-ubuntu-application-tutorial.xml:735 |
3517 | +#, no-c-format |
3518 | +msgid "A subclass of gtk.Dialog called DialogNameDialog in the module DialogNameDialog.py" |
3519 | +msgstr "" |
3520 | + |
3521 | +#. Tag: para |
3522 | +#: quickly-ubuntu-application-tutorial.xml:738 |
3523 | +#, no-c-format |
3524 | +msgid "A glade file called DialogNameDialog.ui in the ui directory" |
3525 | +msgstr "" |
3526 | + |
3527 | +#. Tag: para |
3528 | +#: quickly-ubuntu-application-tutorial.xml:741 |
3529 | +#, no-c-format |
3530 | +msgid "A catalog file called dialog_name_dialog.xml also in the ui directory" |
3531 | +msgstr "" |
3532 | + |
3533 | +#. Tag: para |
3534 | +#: quickly-ubuntu-application-tutorial.xml:744 |
3535 | +#, no-c-format |
3536 | +msgid "To edit the UI for the dialog, run:" |
3537 | +msgstr "" |
3538 | + |
3539 | +#. Tag: para |
3540 | +#: quickly-ubuntu-application-tutorial.xml:748 |
3541 | +#, no-c-format |
3542 | +msgid "To edit the behavior, run:" |
3543 | +msgstr "" |
3544 | + |
3545 | +#. Tag: para |
3546 | +#: quickly-ubuntu-application-tutorial.xml:751 |
3547 | +#, no-c-format |
3548 | +msgid "To use the dialog you have to invoke it from another python file:" |
3549 | +msgstr "" |
3550 | + |
3551 | +#. Tag: code |
3552 | +#: quickly-ubuntu-application-tutorial.xml:755 |
3553 | +#, no-c-format |
3554 | +msgid "Import the dialog import DialogNameDialog" |
3555 | +msgstr "" |
3556 | + |
3557 | +#. Tag: code |
3558 | +#: quickly-ubuntu-application-tutorial.xml:759 |
3559 | +#, no-c-format |
3560 | +msgid "Create an instance of the dialog dialog = DialogNameDialog.NewDialogNameDialog()" |
3561 | +msgstr "" |
3562 | + |
3563 | +#. Tag: code |
3564 | +#: quickly-ubuntu-application-tutorial.xml:763 |
3565 | +#, no-c-format |
3566 | +msgid "Run the dialog and hide the dialog result = dialog.run() dialog.hide()" |
3567 | +msgstr "" |
3568 | + |
3569 | +#. Tag: title |
3570 | +#: quickly-ubuntu-application-tutorial.xml:771 quickly-ubuntu-application-tutorial.xml:772 |
3571 | +#, no-c-format |
3572 | +msgid "<title>edit</title>" |
3573 | +msgstr "" |
3574 | + |
3575 | +#. Tag: para |
3576 | +#: quickly-ubuntu-application-tutorial.xml:776 |
3577 | +#, no-c-format |
3578 | +msgid "A convenience command to open all of your python files in your project directory in your default editor, ready for editing." |
3579 | +msgstr "" |
3580 | + |
3581 | +#. Tag: title |
3582 | +#: quickly-ubuntu-application-tutorial.xml:782 quickly-ubuntu-application-tutorial.xml:783 |
3583 | +#, no-c-format |
3584 | +msgid "glade" |
3585 | +msgstr "" |
3586 | + |
3587 | +#. Tag: para |
3588 | +#: quickly-ubuntu-application-tutorial.xml:786 |
3589 | +#, no-c-format |
3590 | +msgid "Opens Glade UI editor so that you can edit the UI for dialogs and windows in your project. Note that you *must* open Glade in this manner for <application>Quickly</application> to work. If you try to open Glade directly, and the open the UI files, Glade will throw errors and won't open the files." |
3591 | +msgstr "" |
3592 | + |
3593 | +#. Tag: title |
3594 | +#: quickly-ubuntu-application-tutorial.xml:795 quickly-ubuntu-application-tutorial.xml:796 |
3595 | +#, no-c-format |
3596 | +msgid "<title>help</title>" |
3597 | +msgstr "" |
3598 | + |
3599 | +#. Tag: code |
3600 | +#: quickly-ubuntu-application-tutorial.xml:797 |
3601 | +#, no-c-format |
3602 | +msgid "<application>Quickly</application> help" |
3603 | +msgstr "" |
3604 | + |
3605 | +#. Tag: para |
3606 | +#: quickly-ubuntu-application-tutorial.xml:799 |
3607 | +#, no-c-format |
3608 | +msgid "Opens a web browser with the help index." |
3609 | +msgstr "" |
3610 | + |
3611 | +#. Tag: title |
3612 | +#: quickly-ubuntu-application-tutorial.xml:804 quickly-ubuntu-application-tutorial.xml:805 |
3613 | +#, no-c-format |
3614 | +msgid "<title>license</title>" |
3615 | +msgstr "" |
3616 | + |
3617 | +#. Tag: code |
3618 | +#: quickly-ubuntu-application-tutorial.xml:806 |
3619 | +#, no-c-format |
3620 | +msgid "<application>Quickly</application> license <Your_Licence=" |
3621 | +msgstr "" |
3622 | + |
3623 | +#. Tag: para |
3624 | +#: quickly-ubuntu-application-tutorial.xml:808 |
3625 | +#, no-c-format |
3626 | +msgid "Adds license to project files. Before using this command, you should:" |
3627 | +msgstr "" |
3628 | + |
3629 | +#. Tag: para |
3630 | +#: quickly-ubuntu-application-tutorial.xml:812 |
3631 | +#, no-c-format |
3632 | +msgid "run <application>Quickly</application> save in case something goes wrong" |
3633 | +msgstr "" |
3634 | + |
3635 | +#. Tag: para |
3636 | +#: quickly-ubuntu-application-tutorial.xml:815 |
3637 | +#, no-c-format |
3638 | +msgid "Edit the file Copyright to include your authorship." |
3639 | +msgstr "" |
3640 | + |
3641 | +#. Tag: para |
3642 | +#: quickly-ubuntu-application-tutorial.xml:817 |
3643 | +#, no-c-format |
3644 | +msgid "If you want to put your own <application>Quickly</application> unsupported Licence, remove and replace the tags ### BEGIN AUTOMATIC LICENCE GENERATION and ### END AUTOMATIC LICENCE GENERATION in it by your own licence." |
3645 | +msgstr "" |
3646 | + |
3647 | +#. Tag: para |
3648 | +#: quickly-ubuntu-application-tutorial.xml:821 |
3649 | +#, no-c-format |
3650 | +msgid "Executes either <code><application>Quickly</application> license</code> or <code><application>Quickly</application> licence <License=</code> where <License= can be either: - GPL-3 (default) - GPL-2" |
3651 | +msgstr "" |
3652 | + |
3653 | +#. Tag: para |
3654 | +#: quickly-ubuntu-application-tutorial.xml:828 |
3655 | +#, no-c-format |
3656 | +msgid "This will modify the Copyright file with the chosen licence (with GPL-3 by default). Updating previous chosen Licence if needed. If you previously removed the tags to add your own licence, it will leave it pristine. If no name is attributed to the Copyright, it will try to retrieve it from Launchpad (in <application>Quickly</application> release or <application>Quickly</application> share command only)" |
3657 | +msgstr "" |
3658 | + |
3659 | +#. Tag: para |
3660 | +#: quickly-ubuntu-application-tutorial.xml:834 |
3661 | +#, no-c-format |
3662 | +msgid "Finally, this will copy the Copyright at the head of every files." |
3663 | +msgstr "" |
3664 | + |
3665 | +#. Tag: para |
3666 | +#: quickly-ubuntu-application-tutorial.xml:836 |
3667 | +#, no-c-format |
3668 | +msgid "Note that if you don't run <application>Quickly</application> licence before calling <application>Quickly</application> release or <application>Quickly</application> share, this one will execute it for you and guess the copyright holder from your launchpad account if you didn't update it." |
3669 | +msgstr "" |
3670 | + |
3671 | +#. Tag: title |
3672 | +#: quickly-ubuntu-application-tutorial.xml:843 quickly-ubuntu-application-tutorial.xml:844 |
3673 | +#, no-c-format |
3674 | +msgid "<title>package</title>" |
3675 | +msgstr "" |
3676 | + |
3677 | +#. Tag: para |
3678 | +#: quickly-ubuntu-application-tutorial.xml:847 |
3679 | +#, no-c-format |
3680 | +msgid "Creates a debian file (deb) from your project. Before running the package command you can edit the Icon and Category entry of *.desktop.in file, where * is the name of your project." |
3681 | +msgstr "" |
3682 | + |
3683 | +#. Tag: para |
3684 | +#: quickly-ubuntu-application-tutorial.xml:851 |
3685 | +#, no-c-format |
3686 | +msgid "Note that if you didn't run <application>Quickly</application> release, <application>Quickly</application> share or <application>Quickly</application> change-lp-project you may miss the name, email in setup.py. You can edit them if you don't want to use any of these commands afterwards. Those changes are not a mandatory at all for testing purpose." |
3687 | +msgstr "" |
3688 | + |
3689 | +#. Tag: title |
3690 | +#: quickly-ubuntu-application-tutorial.xml:860 quickly-ubuntu-application-tutorial.xml:861 |
3691 | +#, no-c-format |
3692 | +msgid "<title>release</title>" |
3693 | +msgstr "" |
3694 | + |
3695 | +#. Tag: code |
3696 | +#: quickly-ubuntu-application-tutorial.xml:862 |
3697 | +#, no-c-format |
3698 | +msgid "<application>Quickly</application> release" |
3699 | +msgstr "" |
3700 | + |
3701 | +#. Tag: para |
3702 | +#: quickly-ubuntu-application-tutorial.xml:864 |
3703 | +#, no-c-format |
3704 | +msgid "Posts a release of your project to a PPA on launchpad so that users can install the application on their system." |
3705 | +msgstr "" |
3706 | + |
3707 | +#. Tag: para |
3708 | +#: quickly-ubuntu-application-tutorial.xml:867 |
3709 | +#, no-c-format |
3710 | +msgid "You can also execute: <code><application>Quickly</application> release <release_number=</code> of you don't want to use current release_number. The release_number must be a number." |
3711 | +msgstr "" |
3712 | + |
3713 | +#. Tag: para |
3714 | +#: quickly-ubuntu-application-tutorial.xml:871 |
3715 | +#, no-c-format |
3716 | +msgid "<code><application>Quickly</application> release <release_number=</code> notes about changes where \"notes about changes\" is optional text describing what changes were made since the last save" |
3717 | +msgstr "" |
3718 | + |
3719 | +#. Tag: para |
3720 | +#: quickly-ubuntu-application-tutorial.xml:875 |
3721 | +#, no-c-format |
3722 | +msgid "Before running <application>Quickly</application> release, you should: create your account and a project page on http://launchpad.net. You also have to add a PPA to your launchpad account." |
3723 | +msgstr "" |
3724 | + |
3725 | +#. Tag: para |
3726 | +#: quickly-ubuntu-application-tutorial.xml:879 |
3727 | +#, no-c-format |
3728 | +msgid "Name, email and version setup.py will be automatically changed. (version will be <current_release= and bzr will commit and tagged. Once the release is done, <current_release= will be incremented by 0.1 to be ready for next release." |
3729 | +msgstr "" |
3730 | + |
3731 | +#. Tag: para |
3732 | +#: quickly-ubuntu-application-tutorial.xml:884 |
3733 | +#, no-c-format |
3734 | +msgid "If you previously used <application>Quickly</application> shared <current_release=~publicX will be dropped to release <current_release= version (<current_release=~publicX <current_release=) You can modify the description and long description if you wish." |
3735 | +msgstr "" |
3736 | + |
3737 | +#. Tag: para |
3738 | +#: quickly-ubuntu-application-tutorial.xml:889 |
3739 | +#, no-c-format |
3740 | +msgid "You can run <code><application>Quickly</application> package</code> and test your package to make sure it installs as expected. (This is not mandatory)" |
3741 | +msgstr "" |
3742 | + |
3743 | +#. Tag: title |
3744 | +#: quickly-ubuntu-application-tutorial.xml:895 quickly-ubuntu-application-tutorial.xml:896 |
3745 | +#, no-c-format |
3746 | +msgid "<title>run</title>" |
3747 | +msgstr "" |
3748 | + |
3749 | +#. Tag: para |
3750 | +#: quickly-ubuntu-application-tutorial.xml:899 |
3751 | +#, no-c-format |
3752 | +msgid "Runs your application. This is the best way to try test it out while you are developing it. It starts up the main project window." |
3753 | +msgstr "" |
3754 | + |
3755 | +#. Tag: title |
3756 | +#: quickly-ubuntu-application-tutorial.xml:905 quickly-ubuntu-application-tutorial.xml:906 |
3757 | +#, no-c-format |
3758 | +msgid "<title>save</title>" |
3759 | +msgstr "" |
3760 | + |
3761 | +#. Tag: code |
3762 | +#: quickly-ubuntu-application-tutorial.xml:907 |
3763 | +#, no-c-format |
3764 | +msgid "<application>Quickly</application> save notes about changes" |
3765 | +msgstr "" |
3766 | + |
3767 | +#. Tag: para |
3768 | +#: quickly-ubuntu-application-tutorial.xml:909 |
3769 | +#, no-c-format |
3770 | +msgid "where \"notes about changes\" is optional text describing what changes were made since the last save." |
3771 | +msgstr "" |
3772 | + |
3773 | +#. Tag: para |
3774 | +#: quickly-ubuntu-application-tutorial.xml:912 |
3775 | +#, no-c-format |
3776 | +msgid "This command commits all changes since the last save to bzr. Note that it does not push changes to any back up location. If you need revert or otherwise use the revision control, use bzr directly: <code>bzr help</code>" |
3777 | +msgstr "" |
3778 | + |
3779 | +#. Tag: title |
3780 | +#: quickly-ubuntu-application-tutorial.xml:920 quickly-ubuntu-application-tutorial.xml:922 |
3781 | +#, no-c-format |
3782 | +msgid "<title>share</title>" |
3783 | +msgstr "" |
3784 | + |
3785 | +#. Tag: code |
3786 | +#: quickly-ubuntu-application-tutorial.xml:923 |
3787 | +#, no-c-format |
3788 | +msgid "<application>Quickly</application> share" |
3789 | +msgstr "" |
3790 | + |
3791 | +#. Tag: para |
3792 | +#: quickly-ubuntu-application-tutorial.xml:925 |
3793 | +#, no-c-format |
3794 | +msgid "Updates your PPA with the the latest saved project changes." |
3795 | +msgstr "" |
3796 | + |
3797 | +#. Tag: para |
3798 | +#: quickly-ubuntu-application-tutorial.xml:927 |
3799 | +#, no-c-format |
3800 | +msgid "Before running <application>Quickly</application> release, you should: create your account on http://launchpad.net. You also have to add a PPA to your launchpad account." |
3801 | +msgstr "" |
3802 | + |
3803 | +#. Tag: para |
3804 | +#: quickly-ubuntu-application-tutorial.xml:931 |
3805 | +#, no-c-format |
3806 | +msgid "Name, email and version setup.py will be automatically changed. (version will be <current_release~publicX= where X will be incremented at each <application>Quickly</application> share execution) You can modify the description and long description if you wish." |
3807 | +msgstr "" |
3808 | + |
3809 | +#. Tag: title |
3810 | +#: quickly-ubuntu-application-tutorial.xml:941 |
3811 | +#, no-c-format |
3812 | +msgid "Links" |
3813 | +msgstr "" |
3814 | + |
3815 | +#. Tag: link |
3816 | +#: quickly-ubuntu-application-tutorial.xml:943 |
3817 | +#, no-c-format |
3818 | +msgid "<link><application>Quickly</application>: <application>Quickly</application> Command Reference</link>" |
3819 | +msgstr "" |
3820 | + |
3821 | +#. Tag: ulink |
3822 | +#: quickly-ubuntu-application-tutorial.xml:946 |
3823 | +#, no-c-format |
3824 | +msgid "Blog post on <application>Quickly</application>" |
3825 | +msgstr "" |
3826 | + |
3827 | +#. Tag: ulink |
3828 | +#: quickly-ubuntu-application-tutorial.xml:949 |
3829 | +#, no-c-format |
3830 | +msgid "Language: Python Language Reference" |
3831 | +msgstr "" |
3832 | + |
3833 | +#. Tag: ulink |
3834 | +#: quickly-ubuntu-application-tutorial.xml:952 |
3835 | +#, no-c-format |
3836 | +msgid "Core Library: Python 2.6 Library Reference" |
3837 | +msgstr "" |
3838 | + |
3839 | +#. Tag: ulink |
3840 | +#: quickly-ubuntu-application-tutorial.xml:955 |
3841 | +#, no-c-format |
3842 | +msgid "UI Library: PyGtk" |
3843 | +msgstr "" |
3844 | + |
3845 | +#. Tag: ulink |
3846 | +#: quickly-ubuntu-application-tutorial.xml:958 |
3847 | +#, no-c-format |
3848 | +msgid "Database: CouchDB Reference" |
3849 | +msgstr "" |
3850 | + |
3851 | +#. Tag: ulink |
3852 | +#: quickly-ubuntu-application-tutorial.xml:961 |
3853 | +#, no-c-format |
3854 | +msgid "UI Editing: Glade User Documenation" |
3855 | +msgstr "" |
3856 | + |
3857 | +#. Tag: ulink |
3858 | +#: quickly-ubuntu-application-tutorial.xml:964 |
3859 | +#, no-c-format |
3860 | +msgid "Editor: Gedit Help" |
3861 | +msgstr "" |
3862 | + |
3863 | +#. Tag: ulink |
3864 | +#: quickly-ubuntu-application-tutorial.xml:967 |
3865 | +#, no-c-format |
3866 | +msgid "Version Control: Bazaar" |
3867 | +msgstr "" |
3868 | + |
3869 | |
3870 | === removed file 'data/templates/ubuntu-application/help/quickly-dialogs.html' |
3871 | --- data/templates/ubuntu-application/help/quickly-dialogs.html 2010-02-26 20:43:39 +0000 |
3872 | +++ data/templates/ubuntu-application/help/quickly-dialogs.html 1970-01-01 00:00:00 +0000 |
3873 | @@ -1,286 +0,0 @@ |
3874 | -<HTML> |
3875 | -<HEAD> |
3876 | -<TITLE>Quickly Tutorial Part 2</TITLE> |
3877 | -<STYLE> |
3878 | -img |
3879 | -{ |
3880 | - display: block; |
3881 | - width:668px; |
3882 | - padding-top:10px; |
3883 | -} |
3884 | -p |
3885 | -{ |
3886 | - width: 800px; |
3887 | -} |
3888 | - |
3889 | -</STYLE> |
3890 | -</HEAD> |
3891 | -<BODY> |
3892 | -<H1>Introduction to Part 2</H1> |
3893 | -<P>In part 1, we created an application that can read and write text files, and persist them in the couchdb backend. However, the application has a hideous usability flaw, in the text box for specifying titles when saving and opening files is very confusing. In part 2, we'll fix thay by adding a save and an open dialog. |
3894 | - |
3895 | -</P> |
3896 | - |
3897 | -<H1>Creating a Quickly Dialog</H1> |
3898 | -<H2>Creating the Empty Dialog</H2> |
3899 | -<P>It's simple to add an empty, but working dialog to your project. Simply specify the name of the new dialog, and it will be added automatically. Assuming that you are in the jotty project directory:</P> |
3900 | -<DIV class="termnial"><TEXTAREA rows = "1" cols="80"> |
3901 | -$quickly dialog save |
3902 | -</TEXTAREA></DIV> |
3903 | -<P>This will add the dialog to your project.</P> |
3904 | -<H2>Editing the New Dialog</H2> |
3905 | -<P>To edit the UI for the dialog, you'll need to load it into Glade again. If you already have an instance of glade running, you might want to go ahead and close it first, as it may get confusing if you have more than one open at a time. After closing glade, simply open it again:</P> |
3906 | -<DIV class="termnial"><TEXTAREA rows = "1" cols="80"> |
3907 | -$quickly design |
3908 | -</TEXTAREA></DIV> |
3909 | -<P>Then use the project menu to switch to newly created SaveDialog.ui file.</P> |
3910 | -<IMG SRC="./images/glade17.png" ALT="save dialog ready to edit" /> |
3911 | -<P>Then add some widgets for the UI. Start with a Vertical Box (VBox) with two items. Put label in the top, and an HBox in the bottom slot. In the HBox, add a label and an edit widget, just like you did for JottyWindow in part 1. Set the padding and expand properties as well.</P> |
3912 | -<IMG SRC="./images/glade18.png" ALT="save dialog all edited" /> |
3913 | -<H2>Code the Dialog</H2> |
3914 | -<P>You can use the "quickly edit" command to open the SaveDialoy.py file. This dialog needs very little additional code to work. Essentially, you just need a way to retrieve the string specified by the user. We'll add a qiuck accessor method for this:</P> |
3915 | -<DIV class="code"><TEXTAREA rows="2" cols="80"> |
3916 | - @property |
3917 | - def title_text(self): |
3918 | - return self.builder.get_object("entry1").get_text() |
3919 | -</TEXTAREA></DIV> |
3920 | -<P>We don't need to write any code for the Ok and Cancel buttons, as they were automatically hooked up by quickly when it created the dialog.</P> |
3921 | -<P>Before we go on to invoking the dialog, delete HBox from JottyWindow that holds the text entry and label, as we won't be needing those.</P> |
3922 | -<IMG SRC="./images/glade19.png" ALT="text entry now deleted" /> |
3923 | - |
3924 | -<H1>Calling the Save Dialog</H1> |
3925 | -<P>To use the dialog in JottyWindow, we need to follow these steps:</P> |
3926 | -<OL> |
3927 | -<LI>Import SaveDialog in JottyWindow</LI> |
3928 | -<LI>In the save_file function, create an instance of SaveDialog</LI> |
3929 | -<LI>Run the Dialog</LI> |
3930 | -<LI>Get the String</LI> |
3931 | -<LI>Destroy the dialog</LI> |
3932 | -</OL> |
3933 | -<H2>Importing the SaveDialog</H2> |
3934 | -Add the SaveDialog to the list of imported modules at the top of the, so it looks like this: |
3935 | -<DIV class="code"><TEXTAREA rows="1" cols="80"> |
3936 | -from jotty import AboutJottyDialog, PreferencesJottyDialog, SaveDialog |
3937 | -</TEXTAREA></DIV> |
3938 | - |
3939 | -<H2>Create an instance of the dialog and run it</H2> |
3940 | -<P>When the user chooses Save, we want to open the SaveDialog and collect the title of the note from the user. So we need to modify our save_file function.</P> |
3941 | - |
3942 | -<P>To create an instance of the dialog, use the NewSaveDialog() function in the SaveDialog module. It's important that you don't create an instance of SaveDialog directly, as it won't have a chance to load up it's UI that way, and it won't work. So whenever you use a quickly dialog, do it like this:</P> |
3943 | -<DIV class="code"><TEXTAREA rows="1" cols="80"> |
3944 | - saver = SaveDialog.NewSaveDialog() |
3945 | -</TEXTAREA></DIV> |
3946 | -<P>To make the dialog appear, simply use the run() method. However, we want to check the result, so we'll need to store that in a variable. After it runs, we want to collect the string from the user, like this:</P> |
3947 | -<DIV class="code"><TEXTAREA rows="2" cols="80"> |
3948 | - result = saver.run() |
3949 | - title = saver.title_text |
3950 | -</TEXTAREA></DIV> |
3951 | - |
3952 | -<H2>Clean up the dialog</H2> |
3953 | -<P>We need to tell the dialog to not show itself anymore. We could call saver.hide() to make it hide, but since we don't need it hanging around, we'll just destroy it. Before we go on, though, we need to ensure that the user actually wants to save, so if we didn't get the Ok result, we should just return out of the function:</P> |
3954 | -<DIV class="code"><TEXTAREA rows="2" cols="80"> |
3955 | - saver.destroy() |
3956 | - if result != gtk.RESPONSE_OK: |
3957 | - return |
3958 | -</TEXTAREA></DIV> |
3959 | - |
3960 | -<P>Since we're now getting the title from the dialog instead of the text entry, we should delete the line of the code that sents it from entry1. So except for the addition of the dialog code, the save_file function looks pretty much the same as it did in part 1:</P> |
3961 | - |
3962 | -<DIV class="code"><TEXTAREA rows="32" cols="80"> |
3963 | - def save_file(self, widget, data=None): |
3964 | - #get the titel from the user |
3965 | - saver = SaveDialog.NewSaveDialog() |
3966 | - result = saver.run() |
3967 | - title = saver.title_text |
3968 | - |
3969 | - saver.destroy() |
3970 | - if result != gtk.RESPONSE_OK: |
3971 | - return |
3972 | - |
3973 | - #get the text to save |
3974 | - buff = self.builder.get_object("textview1").get_buffer() |
3975 | - start_iter = buff.get_start_iter() |
3976 | - end_iter = buff.get_end_iter() |
3977 | - text = buff.get_text(start_iter,end_iter) |
3978 | - |
3979 | - #get all the records |
3980 | - record_type = "http://wiki.ubuntu.com/Quickly/JottyDoc" |
3981 | - results = self.database.get_records(record_type = record_type, |
3982 | - create_view = True) |
3983 | - |
3984 | - #update a record that has the same title |
3985 | - for result in results: |
3986 | - record = result.value |
3987 | - if record["title"] == title: |
3988 | - key = result.key |
3989 | - self.database.update_fields(key, {"text":text}) |
3990 | - return |
3991 | - |
3992 | - #if no records had the title, create it |
3993 | - new_rec = Record({"record_type":record_type , |
3994 | - "title":title, "text":text}) |
3995 | - self.database.put_record(new_rec) |
3996 | -</TEXTAREA></DIV> |
3997 | - |
3998 | -Now when we choose save, we get the SaveDialog instead: |
3999 | -<IMG SRC="./images/application4_5.png" ALT="save file dialog works much better" /> |
4000 | - |
4001 | -<H1>Creating a Dialog with a CouchGrid</H1> |
4002 | -<P> |
4003 | -We'll use a similar approach in the Open dialog that we did with Save. However, there is one big difference, we want to provide the user with a list of documents that you could choose to open. We'll use a widget called CouchGrid, which is included in the desktopcouch api for this. |
4004 | -</P> |
4005 | -<H2>Create the Open Dialog</H2> |
4006 | -<DIV class="termnial"><TEXTAREA rows = "1" cols="80"> |
4007 | -$quickly dialog open |
4008 | -</TEXTAREA></DIV> |
4009 | -<H2>Editing the New Dialog</H2> |
4010 | -<P>Start out by closing, and then reopening glade again:</P> |
4011 | -<DIV class="termnial"><TEXTAREA rows = "1" cols="80"> |
4012 | -$quickly design |
4013 | -</TEXTAREA></DIV> |
4014 | -<P>Start by adding an HBox and label in the sammer manner as in the Save Dialog above. Leave an empty space in the HBox. We will use code to put the CouchGrid there.</P> |
4015 | -<IMG SRC="./images/glade20.png" ALT="save space for the CouchGrid" /> |
4016 | - |
4017 | -<H2>Coding the Open Dialog</H2> |
4018 | -<H3>Creating and Adding a CouchGrid</H3> |
4019 | -<P>It just takes a little bit of code to add a CouchGrid to the dialog. We need to:</P> |
4020 | -<OL> |
4021 | -<LI>Import the CouchGrid class.</LI> |
4022 | -<LI>Create a CouchGrid pointing at the jotty database, and the desired record type.</LI> |
4023 | -<LI>Add the CouchGrid to the dialog.</LI> |
4024 | -</OL> |
4025 | -<H4>Import the CouchGrid class</H4> |
4026 | -<P>CouchGrid is part of the desktopcouch records api, so we import it like this:</P> |
4027 | -<DIV class="code"><TEXTAREA rows="1" cols="80"> |
4028 | -from desktopcouch.records.couchgrid import CouchGrid |
4029 | -</TEXTAREA></DIV> |
4030 | -<H4>Create the CouchGrid</H4> |
4031 | -<P>A CouchGrid needs to know three things, the name of the database, the name of the record type to, and the name of the keys to use. "keys" is a list of fields that the widget will display, and by default will also use the same text for the heading of any columns. This set up should be done in the OpenDialog's finish_initalizing function. All this is easily done in code like this: |
4032 | -<DIV class="code"><TEXTAREA rows="4" cols="80"> |
4033 | - database = "jotty" |
4034 | - keys = ["title"] |
4035 | - record_type = "http://wiki.ubuntu.com/Quickly/JottyDoc" |
4036 | - self.couchgrid = CouchGrid(database, record_type=record_type,keys=keys) |
4037 | -</TEXTAREA></DIV> |
4038 | -<H4>Add the CouchGrid to the Dialog</H4> |
4039 | -<P>When we added the HBox to the dialog, we left an open space at the bottom. We'll use this by "packing" the CouchGrid into the HBox. We need to show it as well. So add the following lines to the finish_initializing function as well: |
4040 | -<DIV class="code"><TEXTAREA rows="2" cols="80"> |
4041 | - self.couchgrid.show() |
4042 | - self.builder.get_object("vbox1").pack_end(self.couchgrid) |
4043 | -</TEXTAREA></DIV> |
4044 | - |
4045 | -<H3>Create the get_selection function</H3> |
4046 | -<P>The dialog still needs a bit more code to work. It needs to return the user's selection, if there is one. To do this, we need to ask the CouchGrid what is selected. This is easy using the widgets selected_record_ids function. But the CouchGrid supports multiple selection, so we'll do the following:</P> |
4047 | -<OL> |
4048 | -<LI>Use a decorator to define the function as a property accessor.</LI> |
4049 | -<LI>Get all the selected record ids.</LI> |
4050 | -<LI>If none are selected, return None.</LI> |
4051 | -<LI>Pick the first one and return it.</LI> |
4052 | -</OL> |
4053 | -<P>So the function to add to OpenDialog looks like this:</P> |
4054 | -<DIV class="code"><TEXTAREA rows="7" cols="80"> |
4055 | - @property |
4056 | - def selected_record_id(self): |
4057 | - ids = self.couchgrid.selected_record_ids |
4058 | - if len(ids) < 1: |
4059 | - return None |
4060 | - else: |
4061 | - return ids[0] |
4062 | -</TEXTAREA></DIV> |
4063 | -<H1>Using the Open Dialog</H1> |
4064 | -<P>Now we want to use the Open Dialog in the JottyWindow open_file function. To use it,we'll follow these steps:</P> |
4065 | -<OL> |
4066 | -<LI>Import OpenDialog in JottyWindow</LI> |
4067 | -<LI>In the open_file function, create an instance of OpenDialog</LI> |
4068 | -<LI>Run the Dialog</LI> |
4069 | -<LI>Get the id for the selected title.</LI> |
4070 | -<LI>Destroy the dialog</LI> |
4071 | -<LI>Check the response before proceeding</LI> |
4072 | -<LI>Use the id to get the record from CouchDB</LI> |
4073 | -<LI>Update the UI</LI> |
4074 | -</OL> |
4075 | - |
4076 | -<H2>Import OpenDialog</H2> |
4077 | -<P>Just like the SaveDialog, add the import line to the list of imports:</P> |
4078 | -<DIV class="code"><TEXTAREA rows="1" cols="80"> |
4079 | -from jotty import AboutJottyDialog, PreferencesJottyDialog, SaveDialog, OpenDialog |
4080 | -</TEXTAREA></DIV> |
4081 | - |
4082 | -<H2>Create an instance of the dialog and run it</H2> |
4083 | -<P>So now we're ready to call the dialog from the JottyWindow's open_file function. Creating the OpenDialog is exactly the same as creating the SaveDialog, except we also want to tell it to load the titles before we run it:</P> |
4084 | -<DIV class="code"><TEXTAREA rows="3" cols="80"> |
4085 | - opener = OpenDialog.NewOpenDialog() |
4086 | - result = opener.run() |
4087 | -</TEXTAREA></DIV> |
4088 | - |
4089 | -<H2>Get the id for the selected title</H2> |
4090 | -<P>Now use the property that we created to retrieve the title and text from the dialog. Don't forget to check the response type before going on.</P> |
4091 | -<DIV class="code"><TEXTAREA rows="5" cols="80"> |
4092 | - rec_id = opener.selected_record_id |
4093 | - |
4094 | - #close the dialog, and check whether to proceed |
4095 | - opener.destroy() |
4096 | - if result != gtk.RESPONSE_OK: |
4097 | - return |
4098 | -</TEXTAREA></DIV> |
4099 | - |
4100 | - |
4101 | -<H2>Use the id to get the record from CouchDB</H2> |
4102 | -<P>If nothing was selected, we'll just return. Otherwise, we'll retrieve the record from CouchDB and pull out the text for the document:</P> |
4103 | -<DIV class="code"><TEXTAREA rows="5" cols="80"> |
4104 | - #get the record from CouchDB and extract the text |
4105 | - if rec_id == None: |
4106 | - return |
4107 | - record = self.database.get_record(rec_id) |
4108 | - text = record["text"] |
4109 | -</TEXTAREA></DIV> |
4110 | - |
4111 | -<H2>Update the UI</H2> |
4112 | -<P>Now just put the text into the texview:</P> |
4113 | -<DIV class="code"><TEXTAREA rows="3" cols="80"> |
4114 | - #set the UI to display the string |
4115 | - buff = self.builder.get_object("textview1").get_buffer() |
4116 | - buff.set_text(text) |
4117 | -</TEXTAREA></DIV> |
4118 | -<P>That's all there is to it. So the whole open_file function looks like this:</P> |
4119 | -<DIV class="code"><TEXTAREA rows="21" cols="80"> |
4120 | - def open_file(self, widget, data=None): |
4121 | - #run the open dialog |
4122 | - opener = OpenDialog.NewOpenDialog() |
4123 | - result = opener.run() |
4124 | - |
4125 | - #get the record id from the dialog |
4126 | - rec_id = opener.selected_record_id |
4127 | - |
4128 | - #close the dialog, and check whether to proceed |
4129 | - opener.destroy() |
4130 | - if result != gtk.RESPONSE_OK: |
4131 | - return |
4132 | - |
4133 | - #get the record from CouchDB and extract the text |
4134 | - if rec_id == None: |
4135 | - return |
4136 | - record = self.database.get_record(rec_id) |
4137 | - text = record["text"] |
4138 | - |
4139 | - #set the UI to display the string |
4140 | - buff = self.builder.get_object("textview1").get_buffer() |
4141 | - buff.set_text(text) |
4142 | -</TEXTAREA></DIV> |
4143 | -<P>Now users get a nice open dialog:</P> |
4144 | -<IMG SRC="./images/application5.png" ALT="open dialog works much better" /> |
4145 | - |
4146 | - |
4147 | -<H1>Finishing the Application</H1> |
4148 | -<P>Now opening a saved document is much more intuitive.</P> |
4149 | -<IMG SRC="./images/application6.png" ALT="open file dialog works much better" /> |
4150 | -<P>However, the application is not complete. There are a few things left for you to do:</P> |
4151 | -<UL> |
4152 | -<LI>Set the title of the JottyWindow to display the note title. Try self.set_text(title).</LI> |
4153 | -<LI>The Save command works more like "Save As". The application probably shouldn't pop up a SaveDialog every time you want to save. If it's already been saved, you probably just want to save it, but use a SaveDialog when the user choose Save As, or is saving a document for the first time.</LI> |
4154 | -<LI>The OpenDialog should probably return when the user double clicks on an item in the list. Try connecting to the "select-cursor-row" signal on the TreeView, and calling self.response(gtk.RESPONSE_OK) in the handler.</LI> |
4155 | -<LI>Perhaps the Ok button in the OpenDialog should be disabled if nothing is selected. Try setting the "sensitivity" in Glade, and the set_sensitive function for the Ok button.</LI> |
4156 | -<LI>It would be more consistent for the Open and Close dialogs to have "Open" and "Close" for buttons instead of "Ok". You can set a different type in the properties window in Glade.</LI> |
4157 | -<LI>Loading every document into the open dialog is probably a bit inefficient. Perhaps storing the document id and using that to retrieve the document would be a better implementation.</LI> |
4158 | -</UL> |
4159 | -</BODY> |
4160 | |
4161 | === removed file 'data/templates/ubuntu-application/help/quickly-getting-started.html' |
4162 | --- data/templates/ubuntu-application/help/quickly-getting-started.html 2010-02-26 20:43:39 +0000 |
4163 | +++ data/templates/ubuntu-application/help/quickly-getting-started.html 1970-01-01 00:00:00 +0000 |
4164 | @@ -1,315 +0,0 @@ |
4165 | -<HTML> |
4166 | -<HEAD> |
4167 | -<TITLE>Quickly Tutorial Part 1</TITLE> |
4168 | -<STYLE> |
4169 | -img |
4170 | -{ |
4171 | - display: block; |
4172 | - width:668px; |
4173 | - padding-top:10px; |
4174 | -} |
4175 | -p |
4176 | -{ |
4177 | - width: 800px; |
4178 | -} |
4179 | - |
4180 | -</STYLE> |
4181 | -</HEAD> |
4182 | -<BODY> |
4183 | -<H1>Introduction to Part 1</H1> |
4184 | -<P>This part 1 of the Quickly tutorial. This part is will introduce some key quickly commands, editing a user interface in Glade, and editing code in Gedit. This part of the tutorial will familiarize you with these three tools, and how they work together with python and pygtk so that you can quickly build applications.</P> |
4185 | - |
4186 | - |
4187 | -<H1>Creating a Quickly Project</H1> |
4188 | -<H2>Creating the Empty Project</H2> |
4189 | -<P>Creating an empty but working program couldn't be simpler. First, open a terminal window to type commands into. When it's open, type the command:</P> |
4190 | -<DIV class="termnial"><TEXTAREA rows = "1" cols="80"> |
4191 | -$quickly create ubuntu-application jotty |
4192 | -</TEXTAREA></DIV> |
4193 | -<IMG SRC="./images/terminal1.png" ALT="type 'quickly create ubuntu-application jotty' into terminal" /> |
4194 | -<P>This will create a jotty sub directory containing a complete directory tree and files for an empty python application. The command finishes by running the newly created empty application.</P> |
4195 | -<IMG SRC="./images/application1.png" ALT="The command finishes by running the empty application." /> |
4196 | - |
4197 | -<H2>Testing the Empty Application</H2> |
4198 | -<P>They are populated and set up, and you can resize the window. Notice that quickly inferred that the application title is "Jotty". Only a few of menu items do anything in the empty application, Help->About, Edit->Preferences, and File->Quit.</P> |
4199 | -<IMG SRC="./images/application2.png" ALT="The menus are populated and set up." /> |
4200 | - |
4201 | -<H2>Running the Application</H2> |
4202 | -<P>Close the application by closing the window or using the Quit command. Since the empty application isn't installed into Ubuntu yet, you can't start the application from the application menu yet. To start the applicaton, use the terminal to first cd into the new subdirectory, and then use "quickly run" to start the program.</P> |
4203 | -<DIV class="termnial"><TEXTAREA rows = "1" cols="80"> |
4204 | -$cd jotty |
4205 | -jottyt$quickly run |
4206 | -</TEXTAREA></DIV> |
4207 | -<IMG SRC="./images/terminal3.png" ALT="run the empty application from the terminal" /> |
4208 | - |
4209 | -<H1>Editing an Application</H1> |
4210 | -<H2>Edit the User Interface in Glade</H2> |
4211 | -<P>Quickly programs use Glade to edit the user interface. Start Glade with quickly in order to set up Glade for editing the empty applicaton. Don't start glade directly, or it won't load the necessary catalogue files for editing the classes that were automaticaly generated by quickly.</P> |
4212 | -<DIV class="termnial"><TEXTAREA rows = "1" cols="80"> |
4213 | -jotty$ quickly design |
4214 | -</TEXTAREA></DIV> |
4215 | -<IMG SRC="./images/terminal4.png" ALT="start glade with the 'quickly glade' command " /> |
4216 | -<P>Glade will open with the project loaded up and ready to edit.</P> |
4217 | -<IMG SRC="./images/glade1.png" ALT="glade loads the project " /> |
4218 | -<P>Use the Project Menu to choose "JottytWindow.ui" for editing.</P> |
4219 | -<IMG SRC="./images/glade2.png" ALT="choose JottyWindow.ui from the project menu " /> |
4220 | -<P>We want to create a text area for typing into. There are some default Widgets added to the Window. We won't need these so we'll start with deleting them. Click on the label, and press delete, and it will disappear from the window.</P> |
4221 | -<IMG SRC="./images/glade3.png" ALT="select the label" /> |
4222 | - |
4223 | -<IMG SRC="./images/glade4.png" ALT="delete the label from the window" /> |
4224 | -<P>Do the same with the image widget. This leave us two free slots.</P> |
4225 | -<IMG SRC="./images/glade6.png" ALT="two empty slots in the window" /> |
4226 | -<P>We'll use the bottom slot to add a TextView widget for the user to type into. In the toolbox, click on the TextView widget. Then click in the empty slot.</P> |
4227 | -<IMG SRC="./images/glade7.png" ALT="click on the text view widget" /> |
4228 | - |
4229 | -<P>Make sure you save the file in Glade, or your changes won't take! Then run the application from terminal again. The window now has a place where the user can type.</P> |
4230 | -<IMG SRC="./images/application3.png" ALT="the applicaton permits typing" /> |
4231 | - |
4232 | -<P>Now we'll add the entry field for the title, and also a label for it. We'll use the top empty slot for that. First, click on Horizontal Box (HBox) from the "Containers" section of the pallette, and then click on the top slot. A dialog box will open, tell it that you want two items.</P> |
4233 | -<IMG SRC="./images/glade8.png" ALT="tell the hbox you want two items" /> |
4234 | -<P>The HBox is a container that arranges it's children horizontally. Add a label to the empty left hand box, and a Text Entry to the right hand one.</P> |
4235 | -<IMG SRC="./images/glade9.png" ALT="text entry is added" /> |
4236 | - |
4237 | -<P>Before going on, let's clean up the UI just a tad here. Select the new HBox from the treeview in the inspector window. Then go to the Packing tab, and set Expand and Fill to "No".</P> |
4238 | -<IMG SRC="./images/glade10.png" ALT="no expand and fill" /> |
4239 | - |
4240 | -<P>Go to the General tab, and set spacing to 5.</P> |
4241 | -<IMG SRC="./images/glade11.png" ALT="spacing is 5" /> |
4242 | - |
4243 | -<P>Select the label. On the general tab, set "Label" to "Name:". Set expand and fill to "no" for the label, but keep it "yes" for the entry. Set the padding for both to 5 (also on the Packing tab).</P> |
4244 | -<IMG SRC="./images/glade12.png" ALT="glade all cleaned up" /> |
4245 | - |
4246 | -<H2>Add the Save, Open, and New Features</H2> |
4247 | -<P>After the user types something, they may want to save it. A File->Save menu item was automatically created when the empty applicaton was created, but it's not hooked up to any code. To make Save work, we need tell the menu item what function to call, and then create a function to actually do the saving.</P> |
4248 | - |
4249 | -<H3>Set the Signal Handler in Glade</H3> |
4250 | -<P>To tell the menu item what function to call. If glade is not still open, open up the application in glade:</P> |
4251 | -<DIV class="termnial"><TEXTAREA rows = "1" cols="80"> |
4252 | -jotty$ quickly design |
4253 | -</TEXTAREA></DIV> |
4254 | - |
4255 | -<P>Click on the file menu, and the menu opens as if the application were running.</P> |
4256 | -<IMG SRC="./images/glade13.png" ALT="choose the menu item" /> |
4257 | - |
4258 | -<P>Choose the Save menu item, and it will be selected in Glade.</P> |
4259 | -<IMG SRC="./images/glade14.png" ALT="the menu item is selcted in glade" /> |
4260 | - |
4261 | -<P>Then choose the "Signals" tab of the properties window.</P> |
4262 | -<IMG SRC="./images/glade15.png" ALT="signals tab in glade" /> |
4263 | -<P>In pygtk, menu items are "activated" when a user chooses the item from the menu. Since we want a function to run when the user chooses Save, we want to specify a function to respond to the activate signal from the menu item. We'll call the function "save_file". Simply type the function name into the box for the activate signal.Make sure to save the glade file.</P> |
4264 | -<IMG SRC="./images/glade16.png" ALT="activate signal set to 'save_file'" /> |
4265 | -<P>Note that you will need to setup the "open_file" signal and the "new_file" signal as well when you get to those functions later.</P> |
4266 | - |
4267 | -<H2>Edit the Code in Gedit</H2> |
4268 | -<H3>Set Up Tabs Correctly</H3> |
4269 | -<P>Note a major gotcha here. In python spaces and tabs are totally different, but they look just the same in an editor. So being indented one tab stop is not the same as being indented four spaces, even though they might look the same. And indentation level is very important in python. You will get a lot of errors if you mix tab indentation with space indentation. Your generated project follows the python standard of using four spaces for each indentation level. So you'll either have to hit the space bar four time every time you indent, or set up your editor to use the right number of spaces for tabs.</P> |
4270 | -<P>The upshot is that you should take a moment to set up your Gedit (or whatever editor you are using) to use spaces for tabs. In Gedit, select Preferences from the Edit menu, and choose the Editor tab. Then set Tab width to 4, and turn on "Insert spaces instead of tabs". Your preferences should look like this:</P> |
4271 | -<IMG SRC="./images/gedit2.png" ALT="python files ready to edit" /> |
4272 | - |
4273 | -<H3>Create the Save File Signal Handler</H3> |
4274 | -<P>Now you're ready to write some code. Of course just telling the glade file what signal to emit won't make the file actually save, because we haven't created the "save_file" function yet. The code for JottyWindow is stored in the file jotty. jotty is a special python file that is the entry point for your application. Other python files in your application have the ".py" suffix.</P> |
4275 | - |
4276 | -<P>Use the quickly edit command to start editing your code files:</P> |
4277 | -<DIV class="termnial"><TEXTAREA rows = "1" cols="80"> |
4278 | -jotty$ quickly edit |
4279 | -</TEXTAREA></DIV> |
4280 | -<P>This will open the default Ubuntu text editor "Gedit" with any python files in the python directory.</P> |
4281 | -<IMG SRC="./images/gedit1.png" ALT="python files ready to edit" /> |
4282 | - |
4283 | - |
4284 | -<P>JottyWindow.ui is now expecting to find a function JottyWindow.save_file(), so we simply add one to the JottyWindow class in the jotty file right under the on_destroy funtion.:</P> |
4285 | -<DIV class="code"><TEXTAREA rows="3" cols="80"> |
4286 | - def save_file(self, widget, data=None): |
4287 | - print "save" |
4288 | -</TEXTAREA></DIV> |
4289 | -<P>This will print the word "save" to the terminal when run. The method signature is the standard signature expected in a signal handler. If you are new to python, be sure to copy the indentations exactly, as the indentation level is very important in python.</P> |
4290 | - |
4291 | -<P>Save the file, and run it again:</P> |
4292 | -<DIV class="termnial"><TEXTAREA rows = "2" cols="80"> |
4293 | -jotty$ quickly run |
4294 | -</TEXTAREA></DIV> |
4295 | -<P>Choose "File->Save" from the menu, and you'll see the word "save" printing out interminal. That's all there is to hookig up the functions!</P> |
4296 | -<IMG SRC="./images/application3_5.png" ALT="'save' gets printed to the terminal" /> |
4297 | - |
4298 | -<H3>Implementing Save</H3> |
4299 | -<P>Now we'll write a little code in the signal handler to actually save the text. Because we want it to be easy for users to do things like syncronize their Jotty documents between computers, back it up, etc... we'll use couchdb as our backend, and we'll use desktopcouch for our api. Note that if you are not interested in learning about how to save to and read from couchdb, you can just snipe the code. |
4300 | - |
4301 | -Mostly likely you already have everything you need installed when you installed quickly. But, you may need to install couchdb, desktopcouch, and the desktopcouch records api. The fastest way to do this is from the terminal:</P> |
4302 | -<DIV class="termnial"><TEXTAREA rows = "1" cols="80"> |
4303 | -$sudo apt-get install python-desktopcouch-records |
4304 | -</TEXTAREA></DIV> |
4305 | - |
4306 | -<P>This will install the api, and everything you need for the api to run. After desktopcouch is installed, you can write the code. The code will do the following:</P> |
4307 | -<OL> |
4308 | -<LI>Import the stuff you'll need from desktopcouch.</LI> |
4309 | -<LI>Get a reference to the couchdb database to save into.</LI> |
4310 | -<LI>Get the title of the document and the text from the user interface.</LI> |
4311 | -<LI>Check if there is already a document with the same title, and if so overwrite it.</LI> |
4312 | -<LI>If there is not a document already, create one.</LI> |
4313 | -</OL> |
4314 | - |
4315 | -<H4>Import the stuff you'll need from python-desktopcouch-records.</H4> |
4316 | -<P>Add these import statements along with the other imports to the top of the jotty file:</P> |
4317 | -<DIV class="code"><TEXTAREA rows="3" cols="80"> |
4318 | -from desktopcouch.records.server import CouchDatabase |
4319 | -from desktopcouch.records.record import Record |
4320 | -</TEXTAREA></DIV> |
4321 | - |
4322 | -<H4>Get a Reference to the Database</H4> |
4323 | -<P>Desktopcouch will set up a database for us, or create a new one if it's needed. We'll use "jotty" for the name of the database. Since we want this line to run every time the Jotty Window is created, put it at the end of the finish_initializing function:</P> |
4324 | -<DIV class="code"><TEXTAREA rows="1" cols="80"> |
4325 | - self.database = CouchDatabase("jotty", create=True) |
4326 | -</TEXTAREA></DIV> |
4327 | - |
4328 | -<P>Now that we have an instance-wide reference to the database, we'll add code to the save_file function to run whenever the Save command is issued.</P> |
4329 | -<H4>Here's the code to pull the title out of the title entry:</H4> |
4330 | -<DIV class="code"><TEXTAREA rows="2" cols="80"> |
4331 | - #get the title for the note |
4332 | - title = self.builder.get_object("entry1").get_text() |
4333 | -</TEXTAREA></DIV> |
4334 | - |
4335 | -<H4>Here's the code to get pull the text out of the TextView:</H4> |
4336 | -<P>In pygtk, TextView widgets have a text buffer that stores the text. So you ask the TextView for it's TextBuffer, and then you ask the TextBuffer for the text. You use iters to determine from which part of the text buffer you want text. Since we want all the text, it's easy to just get the start and end iters.</P> |
4337 | -<DIV class="code"><TEXTAREA rows="7" cols="80"> |
4338 | - #get the string |
4339 | - buff = self.builder.get_object("textview1").get_buffer() |
4340 | - start_iter = buff.get_start_iter() |
4341 | - end_iter = buff.get_end_iter() |
4342 | - |
4343 | - text = buff.get_text(start_iter,end_iter) |
4344 | -</TEXTAREA></DIV> |
4345 | - |
4346 | -<H4>Saving a document to Couchdb</H4> |
4347 | -<P>A record in couch is essentially a python dictionary with some extra key/value pairs to make the database work. So we can save the document to couch like this:</P> |
4348 | -<DIV class="code"><TEXTAREA rows="4" cols="80"> |
4349 | - record_type = "http://wiki.ubuntu.com/Quickly/JottyDoc" |
4350 | - new_rec = Record({"record_type": record_type, |
4351 | - "title":title, "text":text}) |
4352 | - self.database.put(new_rec) |
4353 | -</TEXTAREA></DIV> |
4354 | -<P>The "record_type" field is not strictly required, but among other things, it makes it easy to fetch the documents later. By convention, we use a url to specify the record type. This provides a place for other developers to go to read about the record type. The description only needs to be human readable. Couchdb is not a typed database, so don't expect that the url will have any kind of schema definition or anything. You can use whatever url you want, and put whatever you want at that URL.</P> |
4355 | - |
4356 | -<H4>Check for a pre-existing note with the same title</H4> |
4357 | -<P>Before we just write the new document though, we have to take note of the fact that couch will allow you to create as many documents as you want with the same title. We probably don't want this, so we we'll have to write a little code to check if there is already a document in couch with the same title, and if there is, update that document rather than create a new one.</P> |
4358 | -<P>In CouchDB, you don't do a lot of data processing in the database like you would with a relational database. To be most efficient, we could use the desktopcouch API to create a view in CouchDB, but it's probably simplest just to do the necessary processing on the client for now. To do this, we'll use a desktopcouch function to retrieve all of the records of a specified record type.</P> |
4359 | - |
4360 | -<P>To find and update documents with a matching title we will:</P> |
4361 | -<OL> |
4362 | -<LI>Retrieve all of the documents with the CouchDatabase.get_records function.</LI> |
4363 | -<LI>Check each of the returned records for a matching title.</LI> |
4364 | -<LI>If there is a match, update the record using the CouchDatabase.update_fields function and return.</LI> |
4365 | -</OL> |
4366 | - |
4367 | -<P>This all may sound very weird, but in code, it's not quite so complicated:</P> |
4368 | -<DIV class="code"><TEXTAREA rows="9" cols="80"> |
4369 | - #get all the records |
4370 | - record_type = "http://wiki.ubuntu.com/Quickly/JottyDoc" |
4371 | - results = self.database.get_records(record_type = record_type, |
4372 | - create_view = True) |
4373 | - |
4374 | - #update a record that has the same title |
4375 | - for result in results: |
4376 | - document = result.value |
4377 | - if document["title"] == title: |
4378 | - key = document["_id"] |
4379 | - self.database.update_fields(key, {"text":text}) |
4380 | - return |
4381 | - |
4382 | -</TEXTAREA></DIV> |
4383 | - |
4384 | -<H4>So the whole function should look like this:</H4> |
4385 | -<DIV class="code"><TEXTAREA rows="20" cols="80"> |
4386 | - def save_file(self, widget, data=None): |
4387 | - #get the title for the note |
4388 | - title = self.builder.get_object("entry1").get_text() |
4389 | - |
4390 | - #get the text to save |
4391 | - buff = self.builder.get_object("textview1").get_buffer() |
4392 | - start_iter = buff.get_start_iter() |
4393 | - end_iter = buff.get_end_iter() |
4394 | - text = buff.get_text(start_iter,end_iter) |
4395 | - |
4396 | - #get all the records |
4397 | - record_type = "http://wiki.ubuntu.com/Quickly/JottyDoc" |
4398 | - results = self.database.get_records(record_type = record_type, |
4399 | - create_view = True) |
4400 | - |
4401 | - #update a record that has the same title |
4402 | - for result in results: |
4403 | - document = result.value |
4404 | - if document["title"] == title: |
4405 | - key = result.key |
4406 | - self.database.update_fields(key, {"text":text}) |
4407 | - return |
4408 | - |
4409 | - #if no records had the title, create it |
4410 | - new_rec = Record({"record_type":record_type , |
4411 | - "title":title, "text":text}) |
4412 | - self.database.put_record(new_rec) |
4413 | - |
4414 | -</TEXTAREA></DIV> |
4415 | - |
4416 | -<P>Couchdb makes it really easy to see if your save function is working. You can just point your web browser at it and explore the database:</P> |
4417 | -<DIV><A HREF="file:///home/your_user_name>/.local/share/desktop-couch/couchdb.html">file:///home/rick/.local/share/desktop-couch/couchdb.html</A></DIV> |
4418 | -<IMG SRC="./images/couch1.png" ALT="open couchdb in a browser" /> |
4419 | -<P>If you are redirected to a page that doesn't work, you probably just need to clear your browser cache and try again.</P> |
4420 | - |
4421 | -<H3>Implementing Open and New</H3> |
4422 | -<P>To open a saved document, the user will type the title of the document that they want to open in the text entry, and choose "Open" from the main menu. If there is no matching document there, it will just clear out the text view, ready for input. This is probably not too intuitive, so we'll add a dialog box for prompting the user for the title, but that's for later in the tutorial. For now, we'll just use the same text entry field.</P> |
4423 | - |
4424 | -<H4>Implementing Open is essentially the reverse of Save:</H4> |
4425 | -<P>Follow these steps:</P> |
4426 | -<OL> |
4427 | -<LI>Add the open_file signal to the menu item in Glade.</LI> |
4428 | -<LI>Retrieve all of the documents with the CouchDatabase.get_records function.</LI> |
4429 | -<LI>Check each of the returned records for a matching title.</LI> |
4430 | -<LI>If there is a match, pull out the text and display it in the text view.</LI> |
4431 | -</OL> |
4432 | - |
4433 | -<P>So the open_file function looks like so:</P> |
4434 | -<DIV class="code"><TEXTAREA rows="20" cols="80"> |
4435 | - def open_file(self, widget, data=None): |
4436 | - #get the name of the document to open |
4437 | - title = self.builder.get_object("entry1").get_text() |
4438 | - text = "" |
4439 | - |
4440 | - #get all the records |
4441 | - record_type = "http://wiki.ubuntu.com/Quickly/JottyDoc" |
4442 | - results = self.database.get_records(record_type = record_type, |
4443 | - create_view = True) |
4444 | - |
4445 | - #get the text if there is a matching title |
4446 | - for result in results: |
4447 | - document = result.value |
4448 | - if document["title"] == title: |
4449 | - text = document["text"] |
4450 | - |
4451 | - #set the UI to display the string |
4452 | - buff = self.builder.get_object("textview1").get_buffer() |
4453 | - buff.set_text(text) |
4454 | -</TEXTAREA></DIV> |
4455 | - |
4456 | -<H4>Implement New</H4> |
4457 | -<P>First, add the new_file signal to the menu item in Glade, then add this code to clear out the text:</P> |
4458 | -<DIV class="code"><TEXTAREA rows="4" cols="80"> |
4459 | - def new_file(self, widget, data=None): |
4460 | - self.builder.get_object("entry1").set_text("Note Title") |
4461 | - buff = self.builder.get_object("textview1").get_buffer() |
4462 | - buff.set_text("") |
4463 | -</TEXTAREA rows="20" cols="80"></DIV> |
4464 | - |
4465 | -<P>To make them work, add these functions to the JottyWindow class, and save. Then go back and connect the functions to the activate signals for the Open and New menu items.</P> |
4466 | - |
4467 | -<DIV class="ref_link"> |
4468 | -<A HREF="./code/jotty">Complete jotty file</A> |
4469 | -</DIV> |
4470 | - |
4471 | -<H1>Saving Your Work</H1> |
4472 | -<P>When Quickly created your application, it automatically added it to Bazaar, a source code versioning system. You can use Bazaar to roll back mistake, see code history, compare versions, etc... Quickly has a convenience function for backing up your work:</P> |
4473 | -<DIV class="termina"><TEXTAREA rows="1" cols="80"> |
4474 | -$ quickly save "First working version of Jotty" |
4475 | -</TEXTAREA></DIV> |
4476 | -<P>This will call "$ bzr add" and then "$ bzr commit -m [your message]" for you.</P> |
4477 | - |
4478 | -</BODY> |
4479 | -</HTML> |
4480 | |
4481 | === removed file 'data/templates/ubuntu-application/help/quickly-package.html' |
4482 | --- data/templates/ubuntu-application/help/quickly-package.html 2009-12-27 10:37:40 +0000 |
4483 | +++ data/templates/ubuntu-application/help/quickly-package.html 1970-01-01 00:00:00 +0000 |
4484 | @@ -1,176 +0,0 @@ |
4485 | -<HTML> |
4486 | -<HEAD> |
4487 | -<TITLE>Quickly Tutorial Part 3</TITLE> |
4488 | -<STYLE> |
4489 | -img |
4490 | -{ |
4491 | - display: block; |
4492 | - width:668px; |
4493 | - padding-top:10px; |
4494 | -} |
4495 | -p |
4496 | -{ |
4497 | - width: 800px; |
4498 | -} |
4499 | - |
4500 | -</STYLE> |
4501 | -</HEAD> |
4502 | -<BODY> |
4503 | -<H1>Introduction to Part 3</H1> |
4504 | -<P>In parts 1 and 2, we showed how to create a simple Ubuntu application using Quickly. This section will cover how to package an application so that it is easy for you to share, and easy for other people to install.</P> |
4505 | -<H1>License your Application</H1> |
4506 | -<P>It's important to license your code so users and other programmers know their rights in terms of redistributing or modifying it. To quickly grant a GPL license to your code, simply:</P> |
4507 | -<OL> |
4508 | -<LI>Specify your name and email address in the Copyright file.</LI> |
4509 | -<LI>Run the "license" command.</LI> |
4510 | -</OL> |
4511 | -<H2>Specify your name and email</H2> |
4512 | -<P>When Quickly created your ubuntu application, it added a file named Copyright in the top level of the directory. Open this file in your text editor, and modify the top line so it has your name and email included. Be sure not to modify other lines as it will interfere with the next step. For example, I would change the entire file to look like this:</P> |
4513 | -<DIV class="code"><TEXTAREA rows="3" cols="80"> |
4514 | -# Copyright (C) 2009 Rick Spencer rick.spencer@canonical.com |
4515 | -### BEGIN AUTOMATIC LICENSE GENERATION |
4516 | -### END AUTOMATIC LICENSE GENERATION |
4517 | -</TEXTAREA></DIV> |
4518 | -<H2>Run the "License" Command</H2> |
4519 | -<P>By default, Quickly will use a GPL 3 license for your project. To use this license, use this command:</P> |
4520 | -<DIV class="terminal"><TEXTAREA rows="1" cols="80"> |
4521 | -$quickly license |
4522 | -</TEXTAREA></DIV> |
4523 | -This will add the GPL 3 license to all of your code files that you've added to your project using Quickly. |
4524 | - |
4525 | -<P>Keep in mind a couple of things:<P> |
4526 | -<UL> |
4527 | -<LI>This is a one way trip. Once you license the project, changes to the license must be done manually.</LI> |
4528 | -<LI>If you prefer a GPL 2 license, you can specify that when you issue the license command: |
4529 | -<DIV class="terminal"><TEXTAREA rows="1" cols="80"> |
4530 | -$quickly license GPL-2 |
4531 | -</TEXTAREA></DIV> |
4532 | -</LI> |
4533 | -<LI>Quickly doesn't care what license you use, but only knows natively what files and headers to include for BSD, GPL-2, GPL-3, LGPL-2 and LGPL-3. If you prefer another license, you can simply add whatever you license you like by adding your own license in the Copyright file: |
4534 | -<DIV class="code"><TEXTAREA rows="3" cols="80"> |
4535 | -### BEGIN AUTOMATIC LICENSE GENERATION |
4536 | -# My personal license here |
4537 | -### END AUTOMATIC LICENSE GENERATION |
4538 | -</TEXTAREA></DIV> |
4539 | -and then run: |
4540 | -<DIV class="code"><TEXTAREA rows="1" cols="80"> |
4541 | -quickly license |
4542 | -</TEXTAREA></DIV> |
4543 | -to license every files. |
4544 | -</LI> |
4545 | -<LI>If you've added code files or other files to your project manually, you will need to add the license to those files manually or add those tags at the beginning of the file: |
4546 | -<DIV class="code"><TEXTAREA rows="2" cols="80"> |
4547 | -### BEGIN LICENSE |
4548 | -### END LICENSE |
4549 | -</TEXTAREA></DIV> |
4550 | -</LI> |
4551 | -</UL> |
4552 | -<H1>Specify Application Settings</H1> |
4553 | -<P> |
4554 | -You should personalize your application a little before creating the archive. This is very easy to do, as all of the files that you need have already been created, and only need a few lines changed to make them your own. To do this you should: |
4555 | -</P> |
4556 | -<OL> |
4557 | -<LI>Personalize the Application Icon</LI> |
4558 | -<LI>Edit the Desktop File</LI> |
4559 | -<LI>Edit the setup.py File</LI> |
4560 | -</OL> |
4561 | -<H2>Personalize your Application Icon</H2> |
4562 | -<P> |
4563 | -When users install your application, Ubuntu will display an icon next to it in the menus. You can create your own icon or edit the file called "icon.png" in the media directory (jotty/data/media). Ubuntu comes with a great image editing program called "Gimp." So you can go:</P> |
4564 | -<DIV class="terminal"><TEXTAREA rows="1" cols="80"> |
4565 | -$gimp data/media/icon.png |
4566 | -</TEXTAREA></DIV> |
4567 | -<IMG SRC="./images/package0.png" ALT="customized jotty icon" /> |
4568 | -</P> |
4569 | -<P> |
4570 | -If you don't personalize the icon, it's ok, your app will just have the default icon, such as in the image below. |
4571 | -</P> |
4572 | -<H2>Edit the Desktop File</H2> |
4573 | -<P> |
4574 | -By default, Quickly Ubuntu applications are classified as "utilities", so they show up under the Accessories menu in Ubuntu. If we wanted to make Jotty show up in another category, we can do this by editing the desktop file. A desktop file is a file that describes your application to a Linux desktop. The file "jottydesktop.in" was automatically created in the jotty project directory. To change Jotty from a Utility to an Office application, edit jotty.desktop.in and change this: |
4575 | -</P> |
4576 | -<DIV class="code"><TEXTAREA rows="8" cols="80"> |
4577 | -[Desktop Entry] |
4578 | -Name=Jotty |
4579 | -Comment=Jotty application |
4580 | -Categories=GNOME;Utility; |
4581 | -Exec=jotty |
4582 | -Icon=jotty |
4583 | -Terminal=false |
4584 | -Type=Application |
4585 | -</TEXTAREA></DIV> |
4586 | - |
4587 | -<P> |
4588 | -to this: |
4589 | -</P> |
4590 | -<DIV class="code"><TEXTAREA rows="8" cols="80"> |
4591 | -[Desktop Entry] |
4592 | -Name=Jotty |
4593 | -Comment=Jotty application |
4594 | -Categories=GNOME;Office; |
4595 | -Exec=jotty |
4596 | -Icon=jotty |
4597 | -Terminal=false |
4598 | -Type=Application |
4599 | -</TEXTAREA></DIV> |
4600 | -<P> |
4601 | -There are lots more categories that you can use, all defined by the FreeDesktop spec. You can see the complete list in the <A HREF="http://standards.freedesktop.org/menu-spec/latest/apa.html">menu spec</A>. |
4602 | -</P> |
4603 | -<H2>Edit Setup.py</H2> |
4604 | -<P> |
4605 | -Finally, you should include some information in the setup.py file to tell your users a little about yourself. The setup.py file was created for you, just like the desktop file. Most of of the setup.py file shouldn't be modified, as it is just boiler plate that makes your application work properly after it has been installed. However, there is a section at the bottom of the setup.py file that you should edit to describe yourself and the application. |
4606 | -</P> |
4607 | -<P> |
4608 | -So I would change this section: |
4609 | -</P> |
4610 | -<DIV class="code"><TEXTAREA rows="8" cols="80"> |
4611 | -DistUtilsExtra.auto.setup( |
4612 | - name='jotty', |
4613 | - version='0.1', |
4614 | - license='GPL v3', |
4615 | - #author='Your Name', |
4616 | - #author_email='email@ubuntu.com', |
4617 | - #description='UI for managing …', |
4618 | - #long_description='Here a longer description', |
4619 | - #url='https://launchpad.net/jotty', |
4620 | - cmdclass={'install': InstallAndUpdateDataDirectory} |
4621 | - ) |
4622 | -</TEXTAREA></DIV> |
4623 | -<P> |
4624 | -To look like this: |
4625 | -</P> |
4626 | -<DIV class="code"><TEXTAREA rows="8" cols="80"> |
4627 | -DistUtilsExtra.auto.setup( |
4628 | - name='jotty', |
4629 | - version='0.1', |
4630 | - license='GPL v3', |
4631 | - author='Rick Spencer', |
4632 | - author_email='rick.spencer@canonical.com', |
4633 | - description='Note taking application', |
4634 | - long_description='Note taking application that uses CouchDB as the backend to support easy replication across users and computers.', |
4635 | - #url='https://launchpad.net/jotty', |
4636 | - cmdclass={'install': InstallAndUpdateDataDirectory} |
4637 | - ) |
4638 | -</TEXTAREA></DIV> |
4639 | -<P>Note that the license has already been set up for you. author and author_email are updated each time you connect to Launchpad (with quickly release or quickly share) with your Launchpad real name and preferred email adress.</P> |
4640 | -<P> |
4641 | -Notice that Jotty doesn't have a web page yet, so I just left that line commented out. Also, you don't have to increment version number as quickly share and quickly release commands will make it for you.. |
4642 | -</P> |
4643 | - |
4644 | -</TEXTAREA></DIV> |
4645 | -<H1>Create and Test the Debian Archive</H1> |
4646 | -<P> |
4647 | -After personalizing the project, we are now ready to create the package. This is easily done by issuing the package command: |
4648 | -</P> |
4649 | -<DIV class="terminal"><TEXTAREA rows="1" cols="80"> |
4650 | -$quickly package |
4651 | -</TEXTAREA></DIV> |
4652 | -<P>This command will take a little while to discover dependencies and create all the required archives, etc... It will also report some errors as we haven't created a PGP key, for instance. None the less, when it is done, the package will be created. Using the file browser, you can see the created package next to the project directory:</P> |
4653 | -<IMG SRC="./images/package1.png" ALT="package command creates .deb archive" /> |
4654 | -<P>Right now, the specific file we are interested in is "jotty_0.1_all.deb". To test it out, double click on it, to open it in Ubuntu's graphical installer program:</P> |
4655 | -<IMG SRC="./images/package2.png" ALT="deb opened in gdebi" /> |
4656 | -<P>Click "Install Package" to see how it installs onto your desktop. After chugging for a bit, you'll see that it is installed in the Applications->Office menu. If you customized your icon, you'll see that the menu uses your custom icon as well.</p> |
4657 | -<IMG SRC="./images/package3.png" ALT="jotty installed" /> |
4658 | -<H1>Now that you have a package</H1> |
4659 | -<P>Now that you've packaged your application, you can share the .deb file. However, if your users install their application this way, and you update the application, your users will have to find this out and resinstall. This hassle can be avoided in Ubuntu by using Personal Package Archives (or PPAs). Distrubuting your applications in this manner is covered in section 4 (not yet available).</P> |
4660 | -</BODY> |
4661 | |
4662 | === removed file 'data/templates/ubuntu-application/help/quickly-reference.html' |
4663 | --- data/templates/ubuntu-application/help/quickly-reference.html 2010-02-26 20:43:39 +0000 |
4664 | +++ data/templates/ubuntu-application/help/quickly-reference.html 1970-01-01 00:00:00 +0000 |
4665 | @@ -1,278 +0,0 @@ |
4666 | -<HTML> |
4667 | -<HEAD> |
4668 | -<TITLE>Quickly ubuntu-application template Command Reference</TITLE> |
4669 | -<STYLE> |
4670 | -img |
4671 | -{ |
4672 | - display: block; |
4673 | - width:668px; |
4674 | - padding-top:10px; |
4675 | -} |
4676 | -p |
4677 | -{ |
4678 | - width: 800px; |
4679 | -} |
4680 | - |
4681 | -</STYLE> |
4682 | -</HEAD> |
4683 | -<BODY> |
4684 | -<P>The ubuntu-application template template contains the following commands.</P> |
4685 | -<OL> |
4686 | -<LI><A HREF="#create">create</A></LI> |
4687 | -<LI><A HREF="#dialog">dialog</A></LI> |
4688 | -<LI><A HREF="#edit">edit</A></LI> |
4689 | -<LI><A HREF="#design">design</A></LI> |
4690 | -<LI><A HREF="#help">help</A></LI> |
4691 | -<LI><A HREF="#license">license</A></LI> |
4692 | -<LI><A HREF="#package">package</A></LI> |
4693 | -<LI><A HREF="#release">release</A></LI> |
4694 | -<LI><A HREF="#run">run</A></LI> |
4695 | -<LI><A HREF="#save">save</A></LI> |
4696 | -<LI><A HREF="#share">share</A></LI> |
4697 | -</OL> |
4698 | -<A name="create"> |
4699 | -<H1>create</H1> |
4700 | -</A> |
4701 | -<P> |
4702 | -Usage: |
4703 | -$quickly create ubuntu-application path/to/project_name |
4704 | -</P><P> |
4705 | -where "project_name" is one or more words separated by an underscore and |
4706 | -path/to can be any existing path. |
4707 | -</P><P> |
4708 | -This will create and run a new project, including Python code, |
4709 | -Glade files, and packaging files to make the project work. After |
4710 | -creating the project, get started by: |
4711 | -</P> |
4712 | -<OL |
4713 | -<LI> |
4714 | -Changing your working directory to the new project: |
4715 | -$cd path/to/project_name |
4716 | -</LI><LI> |
4717 | -Edit the UI with Glade: |
4718 | -$quickly design |
4719 | -</LI><LI> |
4720 | -Edit the Python code: |
4721 | -$quickly edit |
4722 | -</LI> |
4723 | -</OL> |
4724 | - |
4725 | -<A name="dialog"> |
4726 | -<H1>dialog</H1> |
4727 | -</A> |
4728 | -<P> |
4729 | -Usage: |
4730 | -$quickly dialog dialog_name |
4731 | -where dialog_name is one or more words seperated with underscore |
4732 | -</P><P> |
4733 | -This will create: |
4734 | -</P> |
4735 | -<OL> |
4736 | -<LI> |
4737 | -A subclass of gtk.Dialog called DialogNameDialog in the module DialogNameDialog.py |
4738 | -</LI><LI> |
4739 | -A glade file called DialogNameDialog.ui in the ui directory |
4740 | -</LI><LI> |
4741 | -A catalog file called dialog_name_dialog.xml also in the ui directory |
4742 | -</LI> |
4743 | -</OL> |
4744 | -<P> |
4745 | -To edit the UI for the dialog, run: |
4746 | -$quickly design |
4747 | -</P> |
4748 | -<P> |
4749 | -To edit the behavior, run: |
4750 | -$quickly edit |
4751 | -</P> |
4752 | -<P> |
4753 | -To use the dialog you have to invoke it from another python file: |
4754 | -</P> |
4755 | -<OL> |
4756 | -<LI> |
4757 | -Import the dialog |
4758 | -import DialogNameDialog |
4759 | -</LI><LI> |
4760 | -Create an instance of the dialog |
4761 | -dialog = DialogNameDialog.NewDialogNameDialog() |
4762 | -</LI><LI> |
4763 | -Run the dialog and hide the dialog |
4764 | -result = dialog.run() |
4765 | -dialog.hide() |
4766 | -</LI> |
4767 | -</OL> |
4768 | - |
4769 | -<A name="design"> |
4770 | -<H1>design</H1> |
4771 | -</A> |
4772 | -<P> |
4773 | -Usage: |
4774 | -$quickly design |
4775 | -</P><P> |
4776 | -Opens Glade UI editor so that you can edit the UI for dialogs |
4777 | -and windows in your project. Note that you *must* open Glade |
4778 | -in this manner for quickly to work. If you try to open Glade |
4779 | -directly, and the open the UI files, Glade will throw errors |
4780 | -and won't open the files. |
4781 | -</P> |
4782 | - |
4783 | -<A name="edit"> |
4784 | -<H1>edit</H1> |
4785 | -</A> |
4786 | -<P> |
4787 | -Usage: |
4788 | -$quickly edit |
4789 | -</P><P> |
4790 | -A convenience command to open all of your python files in your project |
4791 | -directory in your default editor, ready for editing. |
4792 | -</P> |
4793 | - |
4794 | - |
4795 | -<A name="help"> |
4796 | -<H1>help</H1> |
4797 | -</A> |
4798 | -<P> |
4799 | -Usage: |
4800 | -$quickly help |
4801 | -</P><P> |
4802 | -Opens a web browser with the help index. |
4803 | -</P> |
4804 | - |
4805 | -<A name="license"> |
4806 | -<H1>license</H1> |
4807 | -</A> |
4808 | -<P> |
4809 | -Usage: |
4810 | -$quickly license <Your_Licence> |
4811 | -</P><P> |
4812 | -Adds license to project files. Before using this command, you should: |
4813 | -</P> |
4814 | -<OL> |
4815 | -<LI> |
4816 | -run $ quickly save in case something goes wrong |
4817 | -</LI><LI> |
4818 | -Edit the file Copyright to include your authorship. |
4819 | -</LI><LI> |
4820 | -If you want to put your own quickly unsupported Licence, remove and replace the tags |
4821 | - ### BEGIN AUTOMATIC LICENCE GENERATION and ### END AUTOMATIC LICENCE GENERATION |
4822 | - in it by your own licence. |
4823 | -</LI><LI> |
4824 | -Executes either $ quickly license or $ quickly licence <License> |
4825 | - where <License> can be either: |
4826 | - - GPL-3 (default) |
4827 | - - GPL-2 |
4828 | -</LI> |
4829 | -</OL> |
4830 | -<P> |
4831 | -This will modify the Copyright file with the chosen licence (with GPL-3 by default). |
4832 | -Updating previous chosen Licence if needed. |
4833 | -If you previously removed the tags to add your own licence, it will leave it pristine. |
4834 | -If no name is attributed to the Copyright, it will try to retrieve it from Launchpad |
4835 | -(in quickly release or quickly share command only) |
4836 | -</P><P> |
4837 | -Finally, this will copy the Copyright at the head of every files. |
4838 | -</P><P> |
4839 | -Note that if you don't run quickly licence before calling quickly release or quickly |
4840 | -share, this one will execute it for you and guess the copyright holder from your |
4841 | -launchpad account if you didn't update it. |
4842 | -</P> |
4843 | - |
4844 | -<A name="package"> |
4845 | -<H1>package</H1> |
4846 | -</A> |
4847 | -<P> |
4848 | -Usage: |
4849 | -$quickly package |
4850 | -</P><P> |
4851 | -Creates a debian file (deb) from your project. Before running |
4852 | -the package command you can edit the Icon and Category entry of *.desktop.in |
4853 | -file, where * is the name of your project. |
4854 | -</P><P> |
4855 | -Note that if you didn't run quickly release, quickly share |
4856 | -or quickly change-lp-project you may miss the name, email in |
4857 | -setup.py. You can edit them if you don't want to use any of these |
4858 | -commands afterwards. Those changes are not a mandatory at all for |
4859 | -testing purpose. |
4860 | -</P> |
4861 | - |
4862 | - |
4863 | -<A name="release"> |
4864 | -<H1>release</H1> |
4865 | -</A> |
4866 | -<P> |
4867 | -Usage: |
4868 | -$quickly release |
4869 | -</P><P> |
4870 | -Posts a release of your project to a PPA on launchpad so that |
4871 | -users can install the application on their system. |
4872 | -</P><P> |
4873 | -You can also execute: |
4874 | -$quickly release <release_number> of you don't want to use current |
4875 | -release_number. The release_number must be a number. |
4876 | -</P><P> |
4877 | -$quickly release <release_number> notes about changes |
4878 | -where "notes about changes" is optional text describing what changes |
4879 | -were made since the last save |
4880 | -</P><P> |
4881 | -Before running quickly release, you should: create your account |
4882 | -and a project page on http://launchpad.net. |
4883 | -You also have to add a PPA to your launchpad account. |
4884 | -</P><P> |
4885 | -Name, email and version setup.py will be automatically changed. |
4886 | -(version will be <current_release> and bzr will commit and tagged. |
4887 | -Once the release is done, <current_release> will be incremented |
4888 | -by 0.1 to be ready for next release. |
4889 | -</P><P> |
4890 | -If you previously used quickly shared <current_release>~publicX |
4891 | -will be dropped to release <current_release> version |
4892 | -(<current_release>~publicX < <current_release>) |
4893 | -You can modify the description and long description if you wish. |
4894 | -</P><P> |
4895 | -You can run $quickly package and test your package to make sure it |
4896 | -installs as expected. (This is not mandatory) |
4897 | -</P> |
4898 | - |
4899 | -<A name="run"> |
4900 | -<H1>run</H1> |
4901 | -</A> |
4902 | -<P> |
4903 | -Usage: |
4904 | -$quickly run |
4905 | -</P><P> |
4906 | -Runs your application. This is the best way to try test it out |
4907 | -while you are developing it. It starts up the main project window. |
4908 | -</P> |
4909 | -<A name="save"> |
4910 | -<H1>save</H1> |
4911 | -</A> |
4912 | -<P> |
4913 | -Usage: |
4914 | -$quickly save notes about changes |
4915 | -<BR> |
4916 | -where "notes about changes" is optional text describing what changes |
4917 | -were made since the last save. |
4918 | -</P><P> |
4919 | -This command commits all changes since the last save to bzr. Note that |
4920 | -it does not push changes to any back up location. If you need revert |
4921 | -or otherwise use the revision control, use bzr directly: |
4922 | -$bzr help |
4923 | -</P> |
4924 | - |
4925 | -<A name="share"> |
4926 | -<H1>share</H1> |
4927 | -</A> |
4928 | -<P> |
4929 | -Usage: |
4930 | -$quickly share |
4931 | -</P><P> |
4932 | -Updates your PPA with the the latest saved project changes. |
4933 | -</P><P> |
4934 | -Before running quickly release, you should: create your account |
4935 | -on http://launchpad.net. |
4936 | -You also have to add a PPA to your launchpad account. |
4937 | -</P><P> |
4938 | -Name, email and version setup.py will be automatically changed. |
4939 | -(version will be <current_release~publicX> where X will be incremented |
4940 | -at each quickly share execution) |
4941 | -You can modify the description and long description if you wish. |
4942 | -</P> |
4943 | -</BODY> |
4944 | |
4945 | === removed file 'data/templates/ubuntu-application/help/quickly-release.html' |
4946 | --- data/templates/ubuntu-application/help/quickly-release.html 2009-06-27 21:00:23 +0000 |
4947 | +++ data/templates/ubuntu-application/help/quickly-release.html 1970-01-01 00:00:00 +0000 |
4948 | @@ -1,27 +0,0 @@ |
4949 | -<HTML> |
4950 | -<HEAD> |
4951 | -<TITLE>Quickly Tutorial Part 4</TITLE> |
4952 | -<STYLE> |
4953 | -img |
4954 | -{ |
4955 | - display: block; |
4956 | - width:668px; |
4957 | - padding-top:10px; |
4958 | -} |
4959 | -p |
4960 | -{ |
4961 | - width: 800px; |
4962 | -} |
4963 | - |
4964 | -</STYLE> |
4965 | -</HEAD> |
4966 | -<BODY> |
4967 | -<H1>Introduction to Part 3</H1> |
4968 | -<P>This section will show you how to set up a launchpad account, and create a project. Then, how to use that project to deliver your application to users, and to easily keep it up to date.</P> |
4969 | - |
4970 | -<H1>Create a Launchpad Account</H1> |
4971 | -<H1>Set up a Project and a PPA</H1> |
4972 | -<H1>Publish the Project to the PPA</H1> |
4973 | -<H1>Install from the PPA</H1> |
4974 | -<H1>Update the Project</H1> |
4975 | -</BODY> |
4976 | |
4977 | === added file 'data/templates/ubuntu-application/help/quickly-ubuntu-application-tutorial.xml' |
4978 | --- data/templates/ubuntu-application/help/quickly-ubuntu-application-tutorial.xml 1970-01-01 00:00:00 +0000 |
4979 | +++ data/templates/ubuntu-application/help/quickly-ubuntu-application-tutorial.xml 2010-03-12 17:35:32 +0000 |
4980 | @@ -0,0 +1,1150 @@ |
4981 | +<?xml version="1.0" encoding="UTF-8"?> |
4982 | +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" |
4983 | +"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ |
4984 | + |
4985 | + <!ENTITY appname "<application>Quickly</application>" > |
4986 | + <!ENTITY appversion "0.4" > |
4987 | +] > |
4988 | + |
4989 | +<book lang="en" id="index"> |
4990 | + <bookinfo id="Front"> |
4991 | + <authorgroup> |
4992 | + <author role="maintainer"> |
4993 | + <firstname>Shane</firstname> |
4994 | + <surname>Fagan</surname> |
4995 | + </author> |
4996 | + <author role="maintainer"> |
4997 | + <firstname>Rick</firstname> |
4998 | + <surname>Spencer</surname> |
4999 | + </author> |
5000 | + <corpauthor> |
Done ready for merging. I just got the main branch and remerged my changes and it fixed itself and now builds.