1 #include "FormDocumentDialog.h"
3 #include "FormDocument.h"
7 #include <qtoolbutton.h>
8 #include <qbuttongroup.h>
13 * Constructs a FormDocumentDialog which is a child of 'parent', with the
14 * name 'name' and widget flags set to 'f'
16 * The dialog will by default be modeless, unless you set 'modal' to
17 * TRUE to construct a modal dialog.
19 FormDocumentDialog::FormDocumentDialog( FormDocument* _form, QWidget* parent, const char* name, bool modal, WFlags fl )
20 : FormDocumentDialogBase( parent, name, modal, fl ),
23 // Copy the pointers to the bullet buttons into an array so that
24 // they can all be manipulated together.
25 bulletbuttons[0] = bullet00PB;
26 bulletbuttons[1] = bullet01PB;
27 bulletbuttons[2] = bullet02PB;
28 bulletbuttons[3] = bullet03PB;
29 bulletbuttons[4] = bullet04PB;
30 bulletbuttons[5] = bullet05PB;
31 bulletbuttons[6] = bullet10PB;
32 bulletbuttons[7] = bullet11PB;
33 bulletbuttons[8] = bullet12PB;
34 bulletbuttons[9] = bullet13PB;
35 bulletbuttons[10] = bullet14PB;
36 bulletbuttons[11] = bullet15PB;
37 bulletbuttons[12] = bullet20PB;
38 bulletbuttons[13] = bullet21PB;
39 bulletbuttons[14] = bullet22PB;
40 bulletbuttons[15] = bullet23PB;
41 bulletbuttons[16] = bullet24PB;
42 bulletbuttons[17] = bullet25PB;
43 bulletbuttons[18] = bullet30PB;
44 bulletbuttons[19] = bullet31PB;
45 bulletbuttons[20] = bullet32PB;
46 bulletbuttons[21] = bullet33PB;
47 bulletbuttons[22] = bullet34PB;
48 bulletbuttons[23] = bullet35PB;
49 bulletbuttons[24] = bullet40PB;
50 bulletbuttons[25] = bullet41PB;
51 bulletbuttons[26] = bullet42PB;
52 bulletbuttons[27] = bullet43PB;
53 bulletbuttons[28] = bullet44PB;
54 bulletbuttons[29] = bullet45PB;
55 bulletbuttons[30] = bullet50PB;
56 bulletbuttons[31] = bullet51PB;
57 bulletbuttons[32] = bullet52PB;
58 bulletbuttons[33] = bullet53PB;
59 bulletbuttons[34] = bullet54PB;
60 bulletbuttons[35] = bullet55PB;
64 * Destroys the object and frees any allocated resources
66 FormDocumentDialog::~FormDocumentDialog()
68 // no need to delete child widgets, Qt does it all for us
74 void FormDocumentDialog::slotApply()
77 // PENDING(kalle) Check whether we need this
78 // form->bc_->apply();
83 void FormDocumentDialog::slotAMSMath(bool)
85 form->checkDocumentInput( amsMathCB );
90 void FormDocumentDialog::slotBulletDepth1()
92 form->bulletDepth( 0 );
97 void FormDocumentDialog::slotBulletDepth2()
99 form->bulletDepth( 1 );
104 void FormDocumentDialog::slotBulletDepth3()
106 form->bulletDepth( 2 );
111 void FormDocumentDialog::slotBulletDepth4()
113 form->bulletDepth( 3 );
118 void FormDocumentDialog::slotBulletDing1()
120 qDebug( "FormDocumentDialog::slotBulletDing1()" );
121 form->checkDocumentInput( bulletDing1PB );
122 form->setBulletPics();
123 bulletStandardPB->setOn( false );
124 bulletMathsPB->setOn( false );
125 bulletDing2PB->setOn( false );
126 bulletDing3PB->setOn( false );
127 bulletDing4PB->setOn( false );
132 void FormDocumentDialog::slotBulletDing2()
134 form->checkDocumentInput( bulletDing2PB );
135 form->setBulletPics();
136 bulletStandardPB->setOn( false );
137 bulletMathsPB->setOn( false );
138 bulletDing1PB->setOn( false );
139 bulletDing3PB->setOn( false );
140 bulletDing4PB->setOn( false );
145 void FormDocumentDialog::slotBulletDing3()
147 form->checkDocumentInput( bulletDing3PB );
148 form->setBulletPics();
149 bulletStandardPB->setOn( false );
150 bulletMathsPB->setOn( false );
151 bulletDing2PB->setOn( false );
152 bulletDing1PB->setOn( false );
153 bulletDing4PB->setOn( false );
158 void FormDocumentDialog::slotBulletDing4()
160 form->checkDocumentInput( bulletDing4PB );
161 form->setBulletPics();
162 bulletStandardPB->setOn( false );
163 bulletMathsPB->setOn( false );
164 bulletDing2PB->setOn( false );
165 bulletDing3PB->setOn( false );
166 bulletDing1PB->setOn( false );
171 void FormDocumentDialog::slotBulletMaths()
173 form->checkDocumentInput( bulletMathsPB );
174 form->setBulletPics();
175 bulletStandardPB->setOn( false );
176 bulletDing1PB->setOn( false );
177 bulletDing2PB->setOn( false );
178 bulletDing3PB->setOn( false );
179 bulletDing4PB->setOn( false );
184 void FormDocumentDialog::slotBulletSize(int)
186 form->choiceBulletSize();
187 form->checkDocumentInput( bulletSizeCO );
192 void FormDocumentDialog::slotBulletStandard()
194 form->checkDocumentInput( bulletStandardPB );
195 form->setBulletPics();
196 bulletDing1PB->setOn( false );
197 bulletMathsPB->setOn( false );
198 bulletDing2PB->setOn( false );
199 bulletDing3PB->setOn( false );
200 bulletDing4PB->setOn( false );
205 void FormDocumentDialog::slotBulletSymbol(int n)
207 qDebug( "FormDocumentDialog::slotBulletSymbol( %d )", n );
208 for( int i = 0; i < 36; i++ )
209 bulletbuttons[i]->setOn( false );
210 bulletbuttons[n]->setOn( true );
211 form->bulletBMTable( n );
212 form->checkDocumentInput( bulletTypeBG );
217 void FormDocumentDialog::slotClass(int)
219 form->checkChoiceClass( 0 );
220 form->checkDocumentInput( classesCO );
225 void FormDocumentDialog::slotClose()
229 // PENDING(kalle) do something with this
230 // form->bc_->cancel();
235 void FormDocumentDialog::slotColumns(int)
237 form->checkDocumentInput( columnsBG );
242 void FormDocumentDialog::slotDefaultSkip(const QString&)
244 form->checkDocumentInput( defaultSkipED );
249 void FormDocumentDialog::slotDefaultSkip(int)
251 form->checkChoiceClass( defaultSkipCO );
252 form->checkDocumentInput( defaultSkipCO );
257 void FormDocumentDialog::slotEncoding(int)
259 form->checkChoiceClass( encodingCO );
260 form->checkDocumentInput( encodingCO );
265 void FormDocumentDialog::slotExtraOptions(const QString&)
267 form->checkDocumentInput( extraOptionsED );
272 void FormDocumentDialog::slotFloatPlacement(const QString&)
274 form->checkDocumentInput( floatPlacementED );
279 void FormDocumentDialog::slotFont(int)
281 form->checkChoiceClass( fontsCO );
282 form->checkDocumentInput( fontsCO );
287 void FormDocumentDialog::slotFontSize(int)
289 form->checkChoiceClass( fontSizeCO );
290 form->checkDocumentInput( fontSizeCO );
295 void FormDocumentDialog::slotFootskip(const QString&)
297 form->checkDocumentInput( footskipED );
302 void FormDocumentDialog::slotHeadheight(const QString&)
304 form->checkDocumentInput( headheightED );
309 void FormDocumentDialog::slotHeadsep(const QString&)
311 form->checkDocumentInput( headsepED );
316 void FormDocumentDialog::slotHeight(const QString&)
318 form->checkDocumentInput( customHeightED );
323 void FormDocumentDialog::slotLanguage(int)
325 form->checkChoiceClass( languageCO );
326 form->checkDocumentInput( languageCO );
331 void FormDocumentDialog::slotBulletLaTeX(const QString&)
333 form->inputBulletLaTeX();
334 form->checkDocumentInput( latexED );
339 void FormDocumentDialog::slotMarginBottom(const QString&)
341 form->checkDocumentInput( marginBottomED );
346 void FormDocumentDialog::slotMarginLeft(const QString&)
348 form->checkDocumentInput( marginLeftED );
353 void FormDocumentDialog::slotMarginRight(const QString&)
355 form->checkDocumentInput( marginRightED );
360 void FormDocumentDialog::slotMarginTop(const QString&)
362 form->checkDocumentInput( marginTopED );
367 void FormDocumentDialog::slotOK()
371 // PENDING(kalle) Do something about this.
377 void FormDocumentDialog::slotOrientation(int)
379 form->checkDocumentInput( orientationBG );
384 void FormDocumentDialog::slotPSDriver(int)
386 form->checkChoiceClass( psDriverCO );
387 form->checkDocumentInput( psDriverCO );
392 void FormDocumentDialog::slotPageStyle(int)
394 form->checkChoiceClass( pagestyleCO );
395 form->checkDocumentInput( pagestyleCO );
400 void FormDocumentDialog::slotPapersize(int)
402 form->checkChoiceClass( pagestyleCO );
403 form->checkDocumentInput( papersizeCO );
408 void FormDocumentDialog::slotQuoteStyle(int)
410 form->checkChoiceClass( quoteStyleTypeCO );
411 form->checkDocumentInput( quoteStyleTypeCO );
416 void FormDocumentDialog::slotQuoteType(int)
418 // Intentionally left blank
423 void FormDocumentDialog::slotRestore()
426 // PENDING(kalle) Do something about this.
427 // form->bc_->updateAll();
432 void FormDocumentDialog::slotSectionNumberDepth(int)
434 form->checkDocumentInput( sectionNumberDepthSB );
439 void FormDocumentDialog::slotSeparation(int)
441 form->checkDocumentInput( separationBG );
446 void FormDocumentDialog::slotSides(int)
448 form->checkDocumentInput( sidesBG );
453 void FormDocumentDialog::slotSpacing(const QString&)
455 form->checkDocumentInput( spacingED );
460 void FormDocumentDialog::slotSpacing(int)
462 form->checkDocumentInput( spacingCO );
463 form->checkDocumentInput( spacingCO );
468 void FormDocumentDialog::slotSpecialPaperPackage(int)
470 form->checkChoiceClass( specialCO );
471 form->checkDocumentInput( specialCO );
476 void FormDocumentDialog::slotTOCDepth(int)
478 form->checkDocumentInput( tocDepthSB );
483 void FormDocumentDialog::slotUseGeometryPackage(bool)
485 form->checkDocumentInput( CheckBox1 );
490 void FormDocumentDialog::slotWidth(const QString&)
492 form->checkDocumentInput( customWidthED );
496 void FormDocumentDialog::closeEvent( QCloseEvent* e )
499 //PENDING(kalle) Do something about this.
500 // form->bc_->hide();