File: classGitViewApplication.html

package info (click to toggle)
witty 3.1.2-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 45,512 kB
  • ctags: 35,832
  • sloc: cpp: 69,469; ansic: 66,945; xml: 4,383; sh: 594; perl: 108; makefile: 106
file content (376 lines) | stat: -rw-r--r-- 39,550 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Wt examples: GitViewApplication Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>GitViewApplication Class Reference<br>
<small>
[<a class="el" href="group__gitmodelexample.html">Git model example</a>]</small>
</h1><!-- doxytag: class="GitViewApplication" --><!-- doxytag: inherits="Wt::WApplication" -->A simple application to navigate a git repository.  
<a href="#_details">More...</a>
<p>
<div class="dynheader">
Inheritance diagram for GitViewApplication:</div>
<div class="dynsection">
<p><center><img src="classGitViewApplication__inherit__graph.png" border="0" usemap="#GitViewApplication__inherit__map" alt="Inheritance graph"></center>
<map name="GitViewApplication__inherit__map">
<area shape="rect" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html" title="Wt::WApplication" alt="" coords="11,80,131,107"><area shape="rect" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WObject.html" title="Wt::WObject" alt="" coords="23,5,119,32"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="classGitViewApplication-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitViewApplication.html#478ab50b8bedd025337fdb7331b52b38">GitViewApplication</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WEnvironment.html">WEnvironment</a> &amp;env)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor.  <a href="#478ab50b8bedd025337fdb7331b52b38"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitViewApplication.html#043dd2cfa14da73cea78d7d48a6df699">loadGitModel</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Change repository and/or revision.  <a href="#043dd2cfa14da73cea78d7d48a6df699"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitViewApplication.html#d97472e53f7127b6b7ee06991af7006d">showFile</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Displayed the currently selected file.  <a href="#d97472e53f7127b6b7ee06991af7006d"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WLineEdit.html">WLineEdit</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitViewApplication.html#0c1fdfc4d7cf1c73b9f3e5cddd001f5a">repositoryEdit_</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WLineEdit.html">WLineEdit</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitViewApplication.html#957e6ae0f86c15b027b8731891dfca0a">revisionEdit_</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitViewApplication.html#09199862d1a205031e8f4a3b2285413e">repositoryError_</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitViewApplication.html#267032da74b04ddeac38be8f1974ebab">revisionError_</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classGitModel.html">GitModel</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitViewApplication.html#70fc849d4ac46da4b770db5899ca1aab">gitModel_</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WTreeView.html">WTreeView</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitViewApplication.html#afde306a61ff7f76e13ca525ee234efb">gitView_</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classSourceView.html">SourceView</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitViewApplication.html#3470565a36d585eeeb70b1012d561331">sourceView_</a></td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A simple application to navigate a git repository. 
<p>
This examples demonstrates how to use the custom model use <a class="el" href="classGitModel.html" title="A model that retrieves revision trees from a git repository.">GitModel</a> with a WTreeView. 
<p>Definition at line <a class="el" href="GitView_8C-source.html#l00039">39</a> of file <a class="el" href="GitView_8C-source.html">GitView.C</a>.</p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="478ab50b8bedd025337fdb7331b52b38"></a><!-- doxytag: member="GitViewApplication::GitViewApplication" ref="478ab50b8bedd025337fdb7331b52b38" args="(const WEnvironment &amp;env)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">GitViewApplication::GitViewApplication           </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WEnvironment.html">WEnvironment</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>env</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Constructor. 
<p>

<p>Definition at line <a class="el" href="GitView_8C-source.html#l00044">44</a> of file <a class="el" href="GitView_8C-source.html">GitView.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00045"></a>00045     : <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#e29a843f4d50159b17abfa9503c389db">WApplication</a>(env)
<a name="l00046"></a>00046   {
<a name="l00047"></a>00047     <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#f377d541443b4bcea5fcc40be7c70173">useStyleSheet</a>(<span class="stringliteral">"gitview.css"</span>);
<a name="l00048"></a>00048     <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#71a3f7da5abb9a76df94fab69ba61670">setTitle</a>(<span class="stringliteral">"Git model example"</span>);
<a name="l00049"></a>00049 
<a name="l00050"></a>00050     <span class="keyword">const</span> <span class="keywordtype">char</span> *gitRepo = getenv(<span class="stringliteral">"GITVIEW_REPOSITORY_PATH"</span>);
<a name="l00051"></a>00051 
<a name="l00052"></a>00052     <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WGridLayout.html">WGridLayout</a> *grid = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WGridLayout.html">WGridLayout</a>();
<a name="l00053"></a>00053     grid-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WGridLayout.html#6e64afee237de5665fcd014f407130b2">addWidget</a>(<span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a>(<span class="stringliteral">"Git repository path:"</span>), 0, 0);
<a name="l00054"></a>00054     grid-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WGridLayout.html#6e64afee237de5665fcd014f407130b2">addWidget</a>(<a class="code" href="classGitViewApplication.html#0c1fdfc4d7cf1c73b9f3e5cddd001f5a">repositoryEdit_</a> = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WLineEdit.html">WLineEdit</a>(gitRepo ? gitRepo : <span class="stringliteral">""</span>)
<a name="l00055"></a>00055                     , 0, 1, AlignLeft);
<a name="l00056"></a>00056     grid-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WGridLayout.html#6e64afee237de5665fcd014f407130b2">addWidget</a>(<a class="code" href="classGitViewApplication.html#09199862d1a205031e8f4a3b2285413e">repositoryError_</a> = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a>(), 0, 2);
<a name="l00057"></a>00057     grid-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WGridLayout.html#6e64afee237de5665fcd014f407130b2">addWidget</a>(<span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a>(<span class="stringliteral">"Revision:"</span>), 1, 0);
<a name="l00058"></a>00058     grid-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WGridLayout.html#6e64afee237de5665fcd014f407130b2">addWidget</a>(<a class="code" href="classGitViewApplication.html#957e6ae0f86c15b027b8731891dfca0a">revisionEdit_</a> = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WLineEdit.html">WLineEdit</a>(<span class="stringliteral">"master"</span>), 1, 1, AlignLeft);
<a name="l00059"></a>00059     grid-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WGridLayout.html#6e64afee237de5665fcd014f407130b2">addWidget</a>(<a class="code" href="classGitViewApplication.html#267032da74b04ddeac38be8f1974ebab">revisionError_</a> = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a>(), 1, 2);
<a name="l00060"></a>00060 
<a name="l00061"></a>00061     <a class="code" href="classGitViewApplication.html#0c1fdfc4d7cf1c73b9f3e5cddd001f5a">repositoryEdit_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WLineEdit.html#4c6c5a52deefa5a246e0638f1572d0d8">setTextSize</a>(30);
<a name="l00062"></a>00062     <a class="code" href="classGitViewApplication.html#957e6ae0f86c15b027b8731891dfca0a">revisionEdit_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WLineEdit.html#4c6c5a52deefa5a246e0638f1572d0d8">setTextSize</a>(20);
<a name="l00063"></a>00063     <a class="code" href="classGitViewApplication.html#09199862d1a205031e8f4a3b2285413e">repositoryError_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWebWidget.html#6fd43dced1a62f7e79bc3522eeb16216">setStyleClass</a>(<span class="stringliteral">"error-msg"</span>);
<a name="l00064"></a>00064     <a class="code" href="classGitViewApplication.html#267032da74b04ddeac38be8f1974ebab">revisionError_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWebWidget.html#6fd43dced1a62f7e79bc3522eeb16216">setStyleClass</a>(<span class="stringliteral">"error-msg"</span>);
<a name="l00065"></a>00065 
<a name="l00066"></a>00066     <a class="code" href="classGitViewApplication.html#0c1fdfc4d7cf1c73b9f3e5cddd001f5a">repositoryEdit_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WInteractWidget.html#38f06d1ad95e7599b055f49931236c10">enterPressed</a>()
<a name="l00067"></a>00067       .<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1EventSignal.html#6efcb92576b5aa846a3354dd26918a9f">connect</a>(SLOT(<span class="keyword">this</span>, <a class="code" href="classGitViewApplication.html#043dd2cfa14da73cea78d7d48a6df699" title="Change repository and/or revision.">GitViewApplication::loadGitModel</a>));
<a name="l00068"></a>00068     <a class="code" href="classGitViewApplication.html#957e6ae0f86c15b027b8731891dfca0a">revisionEdit_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WInteractWidget.html#38f06d1ad95e7599b055f49931236c10">enterPressed</a>()
<a name="l00069"></a>00069       .<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1EventSignal.html#6efcb92576b5aa846a3354dd26918a9f">connect</a>(SLOT(<span class="keyword">this</span>, <a class="code" href="classGitViewApplication.html#043dd2cfa14da73cea78d7d48a6df699" title="Change repository and/or revision.">GitViewApplication::loadGitModel</a>));
<a name="l00070"></a>00070 
<a name="l00071"></a>00071     <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WPushButton.html">WPushButton</a> *b = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WPushButton.html">WPushButton</a>(<span class="stringliteral">"Load"</span>);
<a name="l00072"></a>00072     b-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WInteractWidget.html#e11e050cce0d4a8f742afa3ef92bfe8c">clicked</a>().connect(SLOT(<span class="keyword">this</span>, <a class="code" href="classGitViewApplication.html#043dd2cfa14da73cea78d7d48a6df699" title="Change repository and/or revision.">GitViewApplication::loadGitModel</a>));
<a name="l00073"></a>00073     grid-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WGridLayout.html#6e64afee237de5665fcd014f407130b2">addWidget</a>(b, 2, 0, AlignLeft);
<a name="l00074"></a>00074 
<a name="l00075"></a>00075     <a class="code" href="classGitViewApplication.html#afde306a61ff7f76e13ca525ee234efb">gitView_</a> = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WTreeView.html">WTreeView</a>();
<a name="l00076"></a>00076     <a class="code" href="classGitViewApplication.html#afde306a61ff7f76e13ca525ee234efb">gitView_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WTreeView.html#482314306c8404d7ed941fd986e32623">resize</a>(300, WLength::Auto);
<a name="l00077"></a>00077     <a class="code" href="classGitViewApplication.html#afde306a61ff7f76e13ca525ee234efb">gitView_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemView.html#e1c86a0f37f97f63aed3b00fd8ffad7c">setSortingEnabled</a>(<span class="keyword">false</span>);
<a name="l00078"></a>00078     <a class="code" href="classGitViewApplication.html#afde306a61ff7f76e13ca525ee234efb">gitView_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WTreeView.html#390300f766472476e6a0df5aefaa2ef0">setModel</a>(<a class="code" href="classGitViewApplication.html#70fc849d4ac46da4b770db5899ca1aab">gitModel_</a> = <span class="keyword">new</span> <a class="code" href="classGitModel.html" title="A model that retrieves revision trees from a git repository.">GitModel</a>(<span class="keyword">this</span>));
<a name="l00079"></a>00079     <a class="code" href="classGitViewApplication.html#afde306a61ff7f76e13ca525ee234efb">gitView_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemView.html#f6fcd9761e2f7a3b497d3563c849d320">setSelectionMode</a>(SingleSelection);
<a name="l00080"></a>00080     <a class="code" href="classGitViewApplication.html#afde306a61ff7f76e13ca525ee234efb">gitView_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemView.html#9ed7710caa82e030db59020f4add4025">selectionChanged</a>().<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1Signal.html#6fc9536d2e7f59684ec32f3734b01f38">connect</a>
<a name="l00081"></a>00081       (SLOT(<span class="keyword">this</span>, <a class="code" href="classGitViewApplication.html#d97472e53f7127b6b7ee06991af7006d" title="Displayed the currently selected file.">GitViewApplication::showFile</a>));
<a name="l00082"></a>00082 
<a name="l00083"></a>00083     <a class="code" href="classGitViewApplication.html#3470565a36d585eeeb70b1012d561331">sourceView_</a> = <span class="keyword">new</span> <a class="code" href="classSourceView.html" title="View class for source code.">SourceView</a>(<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/group__modelview.html#gg0ae864e12320f9f89172735e075ed0685ed17aded8a0e3b712698cf85a218f1f">DisplayRole</a>, 
<a name="l00084"></a>00084                                  <a class="code" href="classGitModel.html#49c30024f0241738b30cf4cec589b292" title="The role which may be used on a file to retrieve its contents.">GitModel::ContentsRole</a>, 
<a name="l00085"></a>00085                                  <a class="code" href="classGitModel.html#9419f872ce68506009748f0595400ef7">GitModel::FilePathRole</a>);
<a name="l00086"></a>00086     <a class="code" href="classGitViewApplication.html#3470565a36d585eeeb70b1012d561331">sourceView_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWebWidget.html#6fd43dced1a62f7e79bc3522eeb16216">setStyleClass</a>(<span class="stringliteral">"source-view"</span>);
<a name="l00087"></a>00087 
<a name="l00088"></a>00088     <span class="keywordflow">if</span> (<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#19f3b913f4bc2f69761d9a3738bf142b">environment</a>().javaScript()) {
<a name="l00089"></a>00089       <span class="comment">/*</span>
<a name="l00090"></a>00090 <span class="comment">       * We have JavaScript: We can use layout managers so everything will</span>
<a name="l00091"></a>00091 <span class="comment">       * always fit nicely in the window.</span>
<a name="l00092"></a>00092 <span class="comment">       */</span>
<a name="l00093"></a>00093       <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WVBoxLayout.html">WVBoxLayout</a> *topLayout = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WVBoxLayout.html">WVBoxLayout</a>();
<a name="l00094"></a>00094       topLayout-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WBoxLayout.html#062d26b432841995a0be7b7d7aac6413">addLayout</a>(grid, 0, AlignTop | AlignLeft);
<a name="l00095"></a>00095 
<a name="l00096"></a>00096       <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WHBoxLayout.html">WHBoxLayout</a> *gitLayout = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WHBoxLayout.html">WHBoxLayout</a>();
<a name="l00097"></a>00097       gitLayout-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WLayout.html#c8fa1927e7c9b15e3e673cbf6a473c34">setLayoutHint</a>(<span class="stringliteral">"table-layout"</span>, <span class="stringliteral">"fixed"</span>);
<a name="l00098"></a>00098       gitLayout-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WBoxLayout.html#7c1ec58e25d0b7add93f5f4342844db6">addWidget</a>(<a class="code" href="classGitViewApplication.html#afde306a61ff7f76e13ca525ee234efb">gitView_</a>, 0);
<a name="l00099"></a>00099       gitLayout-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WBoxLayout.html#7c1ec58e25d0b7add93f5f4342844db6">addWidget</a>(<a class="code" href="classGitViewApplication.html#3470565a36d585eeeb70b1012d561331">sourceView_</a>, 1);
<a name="l00100"></a>00100       topLayout-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WBoxLayout.html#062d26b432841995a0be7b7d7aac6413">addLayout</a>(gitLayout, 1);
<a name="l00101"></a>00101 
<a name="l00102"></a>00102       <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#17e118a04d962459484a12989a80bc05">root</a>()-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html#1c84e0ffe330d4798f0ce217f75be08c">setLayout</a>(topLayout);
<a name="l00103"></a>00103       <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#17e118a04d962459484a12989a80bc05">root</a>()-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWebWidget.html#6fd43dced1a62f7e79bc3522eeb16216">setStyleClass</a>(<span class="stringliteral">"maindiv"</span>);
<a name="l00104"></a>00104     } <span class="keywordflow">else</span> {
<a name="l00105"></a>00105       <span class="comment">/*</span>
<a name="l00106"></a>00106 <span class="comment">       * No JavaScript: let's make the best of the situation using regular</span>
<a name="l00107"></a>00107 <span class="comment">       * CSS-based layout</span>
<a name="l00108"></a>00108 <span class="comment">       */</span>
<a name="l00109"></a>00109       <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#17e118a04d962459484a12989a80bc05">root</a>()-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWebWidget.html#6fd43dced1a62f7e79bc3522eeb16216">setStyleClass</a>(<span class="stringliteral">"maindiv"</span>);
<a name="l00110"></a>00110       <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html">WContainerWidget</a> *top = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html">WContainerWidget</a>();
<a name="l00111"></a>00111       top-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html#1c84e0ffe330d4798f0ce217f75be08c">setLayout</a>(grid, AlignTop | AlignLeft);
<a name="l00112"></a>00112       <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#17e118a04d962459484a12989a80bc05">root</a>()-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html#2cfe66d9b62940f889e99538a9f478d2">addWidget</a>(top);
<a name="l00113"></a>00113       <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#17e118a04d962459484a12989a80bc05">root</a>()-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html#2cfe66d9b62940f889e99538a9f478d2">addWidget</a>(<a class="code" href="classGitViewApplication.html#afde306a61ff7f76e13ca525ee234efb">gitView_</a>);
<a name="l00114"></a>00114       <a class="code" href="classGitViewApplication.html#afde306a61ff7f76e13ca525ee234efb">gitView_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WCompositeWidget.html#afed7408935752c6b0c8195ac49f2e9c">setFloatSide</a>(Left);
<a name="l00115"></a>00115       <a class="code" href="classGitViewApplication.html#afde306a61ff7f76e13ca525ee234efb">gitView_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WCompositeWidget.html#ddf49ace29b76331067c86bc4ae6ac38">setMargin</a>(6);
<a name="l00116"></a>00116       <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#17e118a04d962459484a12989a80bc05">root</a>()-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html#2cfe66d9b62940f889e99538a9f478d2">addWidget</a>(<a class="code" href="classGitViewApplication.html#3470565a36d585eeeb70b1012d561331">sourceView_</a>);
<a name="l00117"></a>00117       <a class="code" href="classGitViewApplication.html#3470565a36d585eeeb70b1012d561331">sourceView_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWebWidget.html#07719d06da0dd17af2381c663e8fb0b7">setMargin</a>(6);
<a name="l00118"></a>00118     }
<a name="l00119"></a>00119   }
</pre></div>
<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="043dd2cfa14da73cea78d7d48a6df699"></a><!-- doxytag: member="GitViewApplication::loadGitModel" ref="043dd2cfa14da73cea78d7d48a6df699" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GitViewApplication::loadGitModel           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Change repository and/or revision. 
<p>

<p>Definition at line <a class="el" href="GitView_8C-source.html#l00130">130</a> of file <a class="el" href="GitView_8C-source.html">GitView.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00130"></a>00130                       {
<a name="l00131"></a>00131     <a class="code" href="classGitViewApplication.html#3470565a36d585eeeb70b1012d561331">sourceView_</a>-&gt;<a class="code" href="classSourceView.html#10f2b88b0b8ea6b9563077e7958bc4d0" title="Sets the model index.">setIndex</a>(<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">WModelIndex</a>());
<a name="l00132"></a>00132     <a class="code" href="classGitViewApplication.html#09199862d1a205031e8f4a3b2285413e">repositoryError_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html#2f788aa524d51b3962642c9f565e66e6">setText</a>(<span class="stringliteral">""</span>);
<a name="l00133"></a>00133     <a class="code" href="classGitViewApplication.html#267032da74b04ddeac38be8f1974ebab">revisionError_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html#2f788aa524d51b3962642c9f565e66e6">setText</a>(<span class="stringliteral">""</span>);
<a name="l00134"></a>00134     <span class="keywordflow">try</span> {
<a name="l00135"></a>00135       <a class="code" href="classGitViewApplication.html#70fc849d4ac46da4b770db5899ca1aab">gitModel_</a>-&gt;<a class="code" href="classGitModel.html#ac776e532822827e59a2233645995e65" title="Set the repository and load its &amp;#39;master&amp;#39; revision.">setRepositoryPath</a>(<a class="code" href="classGitViewApplication.html#0c1fdfc4d7cf1c73b9f3e5cddd001f5a">repositoryEdit_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WLineEdit.html#c74b58779cb635898cac13e81d8b0c7a">text</a>().<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WString.html#159d088da6e8f2be1035b2341889254c">toUTF8</a>());
<a name="l00136"></a>00136       <span class="keywordflow">try</span> {
<a name="l00137"></a>00137         <a class="code" href="classGitViewApplication.html#70fc849d4ac46da4b770db5899ca1aab">gitModel_</a>-&gt;<a class="code" href="classGitModel.html#f78bddbae2d7b76ec1e49d8626dc7526" title="Load a particular revision.">loadRevision</a>(<a class="code" href="classGitViewApplication.html#957e6ae0f86c15b027b8731891dfca0a">revisionEdit_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WLineEdit.html#c74b58779cb635898cac13e81d8b0c7a">text</a>().<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WString.html#159d088da6e8f2be1035b2341889254c">toUTF8</a>());
<a name="l00138"></a>00138       } <span class="keywordflow">catch</span> (<span class="keyword">const</span> <a class="code" href="classGit_1_1Exception.html" title="Exception class.">Git::Exception</a>&amp; e) {
<a name="l00139"></a>00139         <a class="code" href="classGitViewApplication.html#267032da74b04ddeac38be8f1974ebab">revisionError_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html#2f788aa524d51b3962642c9f565e66e6">setText</a>(e.what());
<a name="l00140"></a>00140       }
<a name="l00141"></a>00141     } <span class="keywordflow">catch</span> (<span class="keyword">const</span> <a class="code" href="classGit_1_1Exception.html" title="Exception class.">Git::Exception</a>&amp; e) {
<a name="l00142"></a>00142       <a class="code" href="classGitViewApplication.html#09199862d1a205031e8f4a3b2285413e">repositoryError_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html#2f788aa524d51b3962642c9f565e66e6">setText</a>(e.what());
<a name="l00143"></a>00143     }
<a name="l00144"></a>00144   }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="d97472e53f7127b6b7ee06991af7006d"></a><!-- doxytag: member="GitViewApplication::showFile" ref="d97472e53f7127b6b7ee06991af7006d" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GitViewApplication::showFile           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Displayed the currently selected file. 
<p>

<p>Definition at line <a class="el" href="GitView_8C-source.html#l00148">148</a> of file <a class="el" href="GitView_8C-source.html">GitView.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00148"></a>00148                   {
<a name="l00149"></a>00149     <span class="keywordflow">if</span> (<a class="code" href="classGitViewApplication.html#afde306a61ff7f76e13ca525ee234efb">gitView_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemView.html#fde08bb75862592d81dc93f30ed7dcd6">selectedIndexes</a>().empty())
<a name="l00150"></a>00150       <span class="keywordflow">return</span>;
<a name="l00151"></a>00151 
<a name="l00152"></a>00152     <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">WModelIndex</a> selected = *<a class="code" href="classGitViewApplication.html#afde306a61ff7f76e13ca525ee234efb">gitView_</a>-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemView.html#fde08bb75862592d81dc93f30ed7dcd6">selectedIndexes</a>().begin();
<a name="l00153"></a>00153     <a class="code" href="classGitViewApplication.html#3470565a36d585eeeb70b1012d561331">sourceView_</a>-&gt;<a class="code" href="classSourceView.html#10f2b88b0b8ea6b9563077e7958bc4d0" title="Sets the model index.">setIndex</a>(selected);
<a name="l00154"></a>00154   }
</pre></div>
<p>

</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="0c1fdfc4d7cf1c73b9f3e5cddd001f5a"></a><!-- doxytag: member="GitViewApplication::repositoryEdit_" ref="0c1fdfc4d7cf1c73b9f3e5cddd001f5a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WLineEdit.html">WLineEdit</a>* <a class="el" href="classGitViewApplication.html#0c1fdfc4d7cf1c73b9f3e5cddd001f5a">GitViewApplication::repositoryEdit_</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="GitView_8C-source.html#l00122">122</a> of file <a class="el" href="GitView_8C-source.html">GitView.C</a>.</p>

</div>
</div><p>
<a class="anchor" name="957e6ae0f86c15b027b8731891dfca0a"></a><!-- doxytag: member="GitViewApplication::revisionEdit_" ref="957e6ae0f86c15b027b8731891dfca0a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WLineEdit.html">WLineEdit</a> * <a class="el" href="classGitViewApplication.html#957e6ae0f86c15b027b8731891dfca0a">GitViewApplication::revisionEdit_</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="GitView_8C-source.html#l00122">122</a> of file <a class="el" href="GitView_8C-source.html">GitView.C</a>.</p>

</div>
</div><p>
<a class="anchor" name="09199862d1a205031e8f4a3b2285413e"></a><!-- doxytag: member="GitViewApplication::repositoryError_" ref="09199862d1a205031e8f4a3b2285413e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a>* <a class="el" href="classGitViewApplication.html#09199862d1a205031e8f4a3b2285413e">GitViewApplication::repositoryError_</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="GitView_8C-source.html#l00123">123</a> of file <a class="el" href="GitView_8C-source.html">GitView.C</a>.</p>

</div>
</div><p>
<a class="anchor" name="267032da74b04ddeac38be8f1974ebab"></a><!-- doxytag: member="GitViewApplication::revisionError_" ref="267032da74b04ddeac38be8f1974ebab" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a> * <a class="el" href="classGitViewApplication.html#267032da74b04ddeac38be8f1974ebab">GitViewApplication::revisionError_</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="GitView_8C-source.html#l00123">123</a> of file <a class="el" href="GitView_8C-source.html">GitView.C</a>.</p>

</div>
</div><p>
<a class="anchor" name="70fc849d4ac46da4b770db5899ca1aab"></a><!-- doxytag: member="GitViewApplication::gitModel_" ref="70fc849d4ac46da4b770db5899ca1aab" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classGitModel.html">GitModel</a>* <a class="el" href="classGitViewApplication.html#70fc849d4ac46da4b770db5899ca1aab">GitViewApplication::gitModel_</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="GitView_8C-source.html#l00124">124</a> of file <a class="el" href="GitView_8C-source.html">GitView.C</a>.</p>

</div>
</div><p>
<a class="anchor" name="afde306a61ff7f76e13ca525ee234efb"></a><!-- doxytag: member="GitViewApplication::gitView_" ref="afde306a61ff7f76e13ca525ee234efb" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WTreeView.html">WTreeView</a>* <a class="el" href="classGitViewApplication.html#afde306a61ff7f76e13ca525ee234efb">GitViewApplication::gitView_</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="GitView_8C-source.html#l00125">125</a> of file <a class="el" href="GitView_8C-source.html">GitView.C</a>.</p>

</div>
</div><p>
<a class="anchor" name="3470565a36d585eeeb70b1012d561331"></a><!-- doxytag: member="GitViewApplication::sourceView_" ref="3470565a36d585eeeb70b1012d561331" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classSourceView.html">SourceView</a>* <a class="el" href="classGitViewApplication.html#3470565a36d585eeeb70b1012d561331">GitViewApplication::sourceView_</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="GitView_8C-source.html#l00126">126</a> of file <a class="el" href="GitView_8C-source.html">GitView.C</a>.</p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>/home/koen/project/wt/public-git/wt/examples/gitmodel/<a class="el" href="GitView_8C-source.html">GitView.C</a></ul>
</div>
<hr size="1"><address style="align: right;"><small>
Generated on Fri Mar 26 17:12:12 2010 for <a href="http://www.webtoolkit.eu/wt/">Wt</a> by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address>
</body>
</html>