]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QDocumentDialog.C
some more random changes, added Timeout (make clean if LyX crashes !!)
[lyx.git] / src / frontends / qt2 / QDocumentDialog.C
1 /**
2  * \file QDocumentDialog.C
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author Kalle Dalheimer <kalle@klaralvdalens-datakonsult.se>
7  */
8
9 #include <config.h>
10  
11 #include "QDocumentDialog.h"
12 #include "Dialogs.h"
13 #include "QDocument.h"
14
15 #include <qlineedit.h>
16 #include <qcheckbox.h>
17 #include <qtoolbutton.h>
18 #include <qbuttongroup.h>
19 #include <qcombobox.h>
20 #include <qspinbox.h>
21
22 QDocumentDialog::QDocumentDialog(QDocument * form, QWidget * parent, const char * name, bool modal, WFlags fl)
23         : QDocumentDialogBase(parent, name, modal, fl),
24                 form_(form)
25 {
26 #if 0 
27         // Copy the pointers to the bullet buttons into an array so that
28         // they can all be manipulated together.
29         bulletbuttons[0] = bullet00PB;
30         bulletbuttons[1] = bullet01PB;
31         bulletbuttons[2] = bullet02PB;
32         bulletbuttons[3] = bullet03PB;
33         bulletbuttons[4] = bullet04PB;
34         bulletbuttons[5] = bullet05PB;
35         bulletbuttons[6] = bullet10PB;
36         bulletbuttons[7] = bullet11PB;
37         bulletbuttons[8] = bullet12PB;
38         bulletbuttons[9] = bullet13PB;
39         bulletbuttons[10] = bullet14PB;
40         bulletbuttons[11] = bullet15PB;
41         bulletbuttons[12] = bullet20PB;
42         bulletbuttons[13] = bullet21PB;
43         bulletbuttons[14] = bullet22PB;
44         bulletbuttons[15] = bullet23PB;
45         bulletbuttons[16] = bullet24PB;
46         bulletbuttons[17] = bullet25PB;
47         bulletbuttons[18] = bullet30PB;
48         bulletbuttons[19] = bullet31PB;
49         bulletbuttons[20] = bullet32PB;
50         bulletbuttons[21] = bullet33PB;
51         bulletbuttons[22] = bullet34PB;
52         bulletbuttons[23] = bullet35PB;
53         bulletbuttons[24] = bullet40PB;
54         bulletbuttons[25] = bullet41PB;
55         bulletbuttons[26] = bullet42PB;
56         bulletbuttons[27] = bullet43PB;
57         bulletbuttons[28] = bullet44PB;
58         bulletbuttons[29] = bullet45PB;
59         bulletbuttons[30] = bullet50PB;
60         bulletbuttons[31] = bullet51PB;
61         bulletbuttons[32] = bullet52PB;
62         bulletbuttons[33] = bullet53PB;
63         bulletbuttons[34] = bullet54PB;
64         bulletbuttons[35] = bullet55PB;
65 #endif 
66 }
67
68  
69 QDocumentDialog::~QDocumentDialog()
70 {
71 }
72
73
74 #if 0 
75 void QDocumentDialog::slotApply()
76 {
77         form->apply();
78         // PENDING(kalle) Check whether we need this
79         //      form->bc_->apply();
80 }
81
82
83 void QDocumentDialog::slotAMSMath(bool)
84 {
85         form->checkDocumentInput( amsMathCB );
86 }
87
88  
89 void QDocumentDialog::slotBulletDepth1()
90 {
91         form->bulletDepth( 0 );
92 }
93
94
95 void QDocumentDialog::slotBulletDepth2()
96 {
97         form->bulletDepth( 1 );
98 }
99
100  
101 void QDocumentDialog::slotBulletDepth3()
102 {
103         form->bulletDepth( 2 );
104 }
105
106
107 void QDocumentDialog::slotBulletDepth4()
108 {
109         form->bulletDepth( 3 );
110 }
111
112
113 void QDocumentDialog::slotBulletDing1()
114 {
115         qDebug( "QDocumentDialog::slotBulletDing1()" );
116         form->checkDocumentInput( bulletDing1PB );
117         form->setBulletPics();
118         bulletStandardPB->setOn( false );
119         bulletMathsPB->setOn( false );
120         bulletDing2PB->setOn( false );
121         bulletDing3PB->setOn( false );
122         bulletDing4PB->setOn( false );
123 }
124
125
126 void QDocumentDialog::slotBulletDing2()
127 {
128         form->checkDocumentInput( bulletDing2PB );
129         form->setBulletPics();
130         bulletStandardPB->setOn( false );
131         bulletMathsPB->setOn( false );
132         bulletDing1PB->setOn( false );
133         bulletDing3PB->setOn( false );
134         bulletDing4PB->setOn( false );
135 }
136
137
138 void QDocumentDialog::slotBulletDing3()
139 {
140         form->checkDocumentInput( bulletDing3PB );
141         form->setBulletPics();
142         bulletStandardPB->setOn( false );
143         bulletMathsPB->setOn( false );
144         bulletDing2PB->setOn( false );
145         bulletDing1PB->setOn( false );
146         bulletDing4PB->setOn( false );
147 }
148
149
150 void QDocumentDialog::slotBulletDing4()
151 {
152         form->checkDocumentInput( bulletDing4PB );
153         form->setBulletPics();
154         bulletStandardPB->setOn( false );
155         bulletMathsPB->setOn( false );
156         bulletDing2PB->setOn( false );
157         bulletDing3PB->setOn( false );
158         bulletDing1PB->setOn( false );
159 }
160
161
162 void QDocumentDialog::slotBulletMaths()
163 {
164         form->checkDocumentInput( bulletMathsPB );
165         form->setBulletPics();
166         bulletStandardPB->setOn( false );
167         bulletDing1PB->setOn( false );
168         bulletDing2PB->setOn( false );
169         bulletDing3PB->setOn( false );
170         bulletDing4PB->setOn( false );
171 }
172
173
174 void QDocumentDialog::slotBulletSize(int)
175 {
176         form->choiceBulletSize();
177         form->checkDocumentInput( bulletSizeCO );
178 }
179
180
181 void QDocumentDialog::slotBulletStandard()
182 {
183         form->checkDocumentInput( bulletStandardPB );
184         form->setBulletPics();
185         bulletDing1PB->setOn( false );
186         bulletMathsPB->setOn( false );
187         bulletDing2PB->setOn( false );
188         bulletDing3PB->setOn( false );
189         bulletDing4PB->setOn( false );
190 }
191
192
193 void QDocumentDialog::slotBulletSymbol(int n)
194 {
195         qDebug( "QDocumentDialog::slotBulletSymbol( %d )", n );
196         for( int i = 0; i < 36; i++ )
197                 bulletbuttons[i]->setOn( false );
198         bulletbuttons[n]->setOn( true );
199         form->bulletBMTable( n );
200         form->checkDocumentInput( bulletTypeBG );
201 }
202
203
204 void QDocumentDialog::slotClass(int)
205 {
206         form->checkChoiceClass( 0 );
207         form->checkDocumentInput( classesCO );
208 }
209
210
211 void QDocumentDialog::slotClose()
212 {
213         form->cancel();
214         form->hide();
215         // PENDING(kalle) do something with this
216         //      form->bc_->cancel();
217 }
218
219
220 void QDocumentDialog::slotColumns(int)
221 {
222         form->checkDocumentInput( columnsBG );
223 }
224
225
226 void QDocumentDialog::slotDefaultSkip(const QString&)
227 {
228         form->checkDocumentInput( defaultSkipED );
229 }
230
231
232 void QDocumentDialog::slotDefaultSkip(int)
233 {
234         form->checkChoiceClass( defaultSkipCO );
235         form->checkDocumentInput( defaultSkipCO );
236 }
237
238
239 void QDocumentDialog::slotEncoding(int)
240 {
241         form->checkChoiceClass( encodingCO );
242         form->checkDocumentInput( encodingCO );
243 }
244
245
246 void QDocumentDialog::slotExtraOptions(const QString&)
247 {
248         form->checkDocumentInput( extraOptionsED );
249 }
250
251
252 void QDocumentDialog::slotFloatPlacement(const QString&)
253 {
254         form->checkDocumentInput( floatPlacementED );
255 }
256
257
258 void QDocumentDialog::slotFont(int)
259 {
260         form->checkChoiceClass( fontsCO );
261         form->checkDocumentInput( fontsCO );
262 }
263
264
265 void QDocumentDialog::slotFontSize(int)
266 {
267         form->checkChoiceClass( fontSizeCO );
268         form->checkDocumentInput( fontSizeCO );
269 }
270
271
272 void QDocumentDialog::slotFootskip(const QString&)
273 {
274         form->checkDocumentInput( footskipED );
275 }
276
277
278 void QDocumentDialog::slotHeadheight(const QString&)
279 {
280         form->checkDocumentInput( headheightED );
281 }
282
283
284 void QDocumentDialog::slotHeadsep(const QString&)
285 {
286         form->checkDocumentInput( headsepED );
287 }
288
289
290 void QDocumentDialog::slotHeight(const QString&)
291 {
292         form->checkDocumentInput( customHeightED );
293 }
294
295
296 void QDocumentDialog::slotLanguage(int)
297 {
298         form->checkChoiceClass( languageCO );
299         form->checkDocumentInput( languageCO );
300 }
301
302
303 void QDocumentDialog::slotBulletLaTeX(const QString&)
304 {
305         form->inputBulletLaTeX();
306         form->checkDocumentInput( latexED );
307 }
308
309
310 void QDocumentDialog::slotMarginBottom(const QString&)
311 {
312         form->checkDocumentInput( marginBottomED );
313 }
314
315
316 void QDocumentDialog::slotMarginLeft(const QString&)
317 {
318         form->checkDocumentInput( marginLeftED );
319 }
320
321
322 void QDocumentDialog::slotMarginRight(const QString&)
323 {
324         form->checkDocumentInput( marginRightED );
325 }
326
327
328 void QDocumentDialog::slotMarginTop(const QString&)
329 {
330         form->checkDocumentInput( marginTopED );
331 }
332
333
334 void QDocumentDialog::slotOK()
335 {
336         form->apply();
337         form->hide();
338         // PENDING(kalle) Do something about this.
339         //      form->bc_->ok();
340 }
341
342
343 void QDocumentDialog::slotOrientation(int)
344 {
345         form->checkDocumentInput( orientationBG );
346 }
347
348
349 void QDocumentDialog::slotPSDriver(int)
350 {
351         form->checkChoiceClass( psDriverCO );
352         form->checkDocumentInput( psDriverCO );
353 }
354
355
356 void QDocumentDialog::slotPageStyle(int)
357 {
358         form->checkChoiceClass( pagestyleCO );
359         form->checkDocumentInput( pagestyleCO );
360 }
361
362
363 void QDocumentDialog::slotPapersize(int)
364 {
365         form->checkChoiceClass( pagestyleCO );
366         form->checkDocumentInput( papersizeCO );
367 }
368
369
370 void QDocumentDialog::slotQuoteStyle(int)
371 {
372         form->checkChoiceClass( quoteStyleTypeCO );
373         form->checkDocumentInput( quoteStyleTypeCO );
374 }
375
376  
377 void QDocumentDialog::slotQuoteType(int)
378 {
379         // Intentionally left blank
380 }
381
382
383 void QDocumentDialog::slotRestore()
384 {
385         form->update();
386         // PENDING(kalle) Do something about this.
387         //      form->bc_->updateAll();
388 }
389
390
391 void QDocumentDialog::slotSectionNumberDepth(int)
392 {
393         form->checkDocumentInput( sectionNumberDepthSB );
394 }
395
396
397 void QDocumentDialog::slotSeparation(int)
398 {
399         form->checkDocumentInput( separationBG );
400 }
401
402
403 void QDocumentDialog::slotSides(int)
404 {
405         form->checkDocumentInput( sidesBG );
406 }
407
408
409 void QDocumentDialog::slotSpacing(const QString&)
410 {
411         form->checkDocumentInput( spacingED );
412 }
413
414
415 void QDocumentDialog::slotSpacing(int)
416 {
417         form->checkDocumentInput( spacingCO );
418         form->checkDocumentInput( spacingCO );
419 }
420
421
422 void QDocumentDialog::slotSpecialPaperPackage(int)
423 {
424         form->checkChoiceClass( specialCO );
425         form->checkDocumentInput( specialCO );
426 }
427
428
429 void QDocumentDialog::slotTOCDepth(int)
430 {
431         form->checkDocumentInput( tocDepthSB );
432 }
433
434
435 void QDocumentDialog::slotUseGeometryPackage(bool)
436 {
437         form->checkDocumentInput( CheckBox1 );
438 }
439
440  
441 void QDocumentDialog::slotWidth(const QString&)
442 {
443         form->checkDocumentInput( customWidthED );
444 }
445 #endif 
446
447
448 void QDocumentDialog::closeEvent( QCloseEvent* e )
449 {
450         //form_->hide();
451         //PENDING(kalle) Do something about this.
452         //      form->bc_->hide();
453         e->accept();
454 }