]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/printdlg.C
* Baruch's GuiBC template.
[lyx.git] / src / frontends / qt2 / printdlg.C
1 /****************************************************************************
2 ** Form implementation generated from reading ui file 'printdlg.ui'
3 **
4 ** Created: Sun Feb 4 23:02:20 2001
5 **      by:  The User Interface Compiler (uic)
6 **
7 ** WARNING! All changes made in this file will be lost!
8 ****************************************************************************/
9 #include "printdlg.h"
10
11 #include <qbuttongroup.h>
12 #include <qcheckbox.h>
13 #include <qgroupbox.h>
14 #include <qlabel.h>
15 #include <qlineedit.h>
16 #include <qpushbutton.h>
17 #include <qradiobutton.h>
18 #include <qspinbox.h>
19 #include <qlayout.h>
20 #include <qvariant.h>
21 #include <qtooltip.h>
22 #include <qwhatsthis.h>
23
24 /* 
25  *  Constructs a PrintDlg which is a child of 'parent', with the 
26  *  name 'name' and widget flags set to 'f' 
27  *
28  *  The dialog will by default be modeless, unless you set 'modal' to
29  *  TRUE to construct a modal dialog.
30  */
31 PrintDlg::PrintDlg( QWidget* parent,  const char* name, bool modal, WFlags fl )
32     : QDialog( parent, name, modal, fl )
33 {
34     if ( !name )
35         setName( "PrintDlg" );
36     resize( 363, 342 ); 
37     setCaption( tr( "Form1" ) );
38     PrintDlgLayout = new QVBoxLayout( this ); 
39     PrintDlgLayout->setSpacing( 6 );
40     PrintDlgLayout->setMargin( 11 );
41
42     ButtonGroup1 = new QButtonGroup( this, "ButtonGroup1" );
43     ButtonGroup1->setTitle( tr( "Print Destination" ) );
44     ButtonGroup1->setColumnLayout(0, Qt::Vertical );
45     ButtonGroup1->layout()->setSpacing( 0 );
46     ButtonGroup1->layout()->setMargin( 0 );
47     ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() );
48     ButtonGroup1Layout->setAlignment( Qt::AlignTop );
49     ButtonGroup1Layout->setSpacing( 3 );
50     ButtonGroup1Layout->setMargin( 11 );
51
52     toPrinter = new QRadioButton( ButtonGroup1, "toPrinter" );
53     toPrinter->setText( tr( "&Printer" ) );
54     toPrinter->setChecked( TRUE );
55
56     ButtonGroup1Layout->addWidget( toPrinter, 0, 0 );
57
58     toFile = new QRadioButton( ButtonGroup1, "toFile" );
59     toFile->setText( tr( "&File" ) );
60
61     ButtonGroup1Layout->addWidget( toFile, 1, 0 );
62
63     printerName = new QLineEdit( ButtonGroup1, "printerName" );
64
65     ButtonGroup1Layout->addWidget( printerName, 0, 1 );
66
67     fileName = new QLineEdit( ButtonGroup1, "fileName" );
68     fileName->setEnabled( FALSE );
69
70     ButtonGroup1Layout->addWidget( fileName, 1, 1 );
71
72     browsePB = new QPushButton( ButtonGroup1, "browsePB" );
73     browsePB->setText( tr( "&Browse..." ) );
74     browsePB->setEnabled( FALSE );
75
76     ButtonGroup1Layout->addWidget( browsePB, 1, 2 );
77     PrintDlgLayout->addWidget( ButtonGroup1 );
78
79     ButtonGroup3 = new QButtonGroup( this, "ButtonGroup3" );
80     ButtonGroup3->setTitle( tr( "Pages" ) );
81     ButtonGroup3->setColumnLayout(0, Qt::Vertical );
82     ButtonGroup3->layout()->setSpacing( 0 );
83     ButtonGroup3->layout()->setMargin( 0 );
84     ButtonGroup3Layout = new QGridLayout( ButtonGroup3->layout() );
85     ButtonGroup3Layout->setAlignment( Qt::AlignTop );
86     ButtonGroup3Layout->setSpacing( 3 );
87     ButtonGroup3Layout->setMargin( 11 );
88
89     allPages = new QRadioButton( ButtonGroup3, "allPages" );
90     allPages->setText( tr( "All" ) );
91     allPages->setChecked( TRUE );
92
93     ButtonGroup3Layout->addWidget( allPages, 0, 0 );
94
95     oddPages = new QRadioButton( ButtonGroup3, "oddPages" );
96     oddPages->setText( tr( "Odd" ) );
97
98     ButtonGroup3Layout->addWidget( oddPages, 1, 0 );
99
100     evenPages = new QRadioButton( ButtonGroup3, "evenPages" );
101     evenPages->setText( tr( "Even" ) );
102
103     ButtonGroup3Layout->addWidget( evenPages, 2, 0 );
104
105     fromPageL = new QLabel( ButtonGroup3, "fromPageL" );
106     fromPageL->setText( tr( "Starting range:" ) );
107     fromPageL->setEnabled( FALSE );
108
109     ButtonGroup3Layout->addWidget( fromPageL, 3, 1 );
110
111     toPageL = new QLabel( ButtonGroup3, "toPageL" );
112     toPageL->setText( tr( "Last page:" ) );
113     toPageL->setEnabled( FALSE );
114
115     ButtonGroup3Layout->addWidget( toPageL, 3, 2 );
116
117     toPage = new QLineEdit( ButtonGroup3, "toPage" );
118     toPage->setEnabled( FALSE );
119
120     ButtonGroup3Layout->addWidget( toPage, 4, 2 );
121
122     reverse = new QCheckBox( ButtonGroup3, "reverse" );
123     reverse->setText( tr( "&Reverse order" ) );
124
125     ButtonGroup3Layout->addWidget( reverse, 0, 2 );
126
127     fromPage = new QLineEdit( ButtonGroup3, "fromPage" );
128     fromPage->setEnabled( FALSE );
129
130     ButtonGroup3Layout->addWidget( fromPage, 4, 1 );
131
132     customPages = new QRadioButton( ButtonGroup3, "customPages" );
133     customPages->setText( tr( "Pages:" ) );
134
135     ButtonGroup3Layout->addWidget( customPages, 4, 0 );
136     PrintDlgLayout->addWidget( ButtonGroup3 );
137
138     GroupBox3 = new QGroupBox( this, "GroupBox3" );
139     GroupBox3->setTitle( tr( "Copies" ) );
140     GroupBox3->setColumnLayout(0, Qt::Vertical );
141     GroupBox3->layout()->setSpacing( 0 );
142     GroupBox3->layout()->setMargin( 0 );
143     GroupBox3Layout = new QHBoxLayout( GroupBox3->layout() );
144     GroupBox3Layout->setAlignment( Qt::AlignTop );
145     GroupBox3Layout->setSpacing( 6 );
146     GroupBox3Layout->setMargin( 11 );
147
148     copies = new QSpinBox( GroupBox3, "copies" );
149     copies->setMinValue( 1 );
150     copies->setValue( 1 );
151     GroupBox3Layout->addWidget( copies );
152
153     collate = new QCheckBox( GroupBox3, "collate" );
154     collate->setText( tr( "Co&llate" ) );
155     collate->setEnabled( FALSE );
156     GroupBox3Layout->addWidget( collate );
157     QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
158     GroupBox3Layout->addItem( spacer );
159     PrintDlgLayout->addWidget( GroupBox3 );
160
161     Layout1 = new QHBoxLayout; 
162     Layout1->setSpacing( 6 );
163     Layout1->setMargin( 0 );
164     QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
165     Layout1->addItem( spacer_2 );
166
167     printPB = new QPushButton( this, "printPB" );
168     printPB->setText( tr( "&Print" ) );
169     Layout1->addWidget( printPB );
170
171     cancelPB = new QPushButton( this, "cancelPB" );
172     cancelPB->setText( tr( "&Cancel" ) );
173     cancelPB->setDefault( TRUE );
174     Layout1->addWidget( cancelPB );
175     PrintDlgLayout->addLayout( Layout1 );
176
177     // signals and slots connections
178     connect( toFile, SIGNAL( toggled(bool) ), browsePB, SLOT( setEnabled(bool) ) );
179     connect( toFile, SIGNAL( toggled(bool) ), fileName, SLOT( setEnabled(bool) ) );
180     connect( toFile, SIGNAL( toggled(bool) ), printerName, SLOT( setDisabled(bool) ) );
181     connect( printPB, SIGNAL( clicked() ), this, SLOT( print() ) );
182     connect( cancelPB, SIGNAL( clicked() ), this, SLOT( cancel_adaptor() ) );
183     connect( copies, SIGNAL( valueChanged(int) ), this, SLOT( set_collate(int) ) );
184     connect( browsePB, SIGNAL( clicked() ), this, SLOT( browse_file() ) );
185     connect( customPages, SIGNAL( toggled(bool) ), fromPage, SLOT( setEnabled(bool) ) );
186     connect( customPages, SIGNAL( toggled(bool) ), fromPageL, SLOT( setEnabled(bool) ) );
187     connect( customPages, SIGNAL( toggled(bool) ), toPage, SLOT( setEnabled(bool) ) );
188     connect( customPages, SIGNAL( toggled(bool) ), toPageL, SLOT( setEnabled(bool) ) );
189 }
190
191 /*  
192  *  Destroys the object and frees any allocated resources
193  */
194 PrintDlg::~PrintDlg()
195 {
196     // no need to delete child widgets, Qt does it all for us
197 }
198
199 void PrintDlg::cancel_adaptor()
200 {
201     qWarning( "PrintDlg::cancel_adaptor(): Not implemented yet!" );
202 }
203
204 void PrintDlg::enable_pagerange(int)
205 {
206     qWarning( "PrintDlg::enable_pagerange(int): Not implemented yet!" );
207 }
208
209 void PrintDlg::browse_file()
210 {
211     qWarning( "PrintDlg::browse_file(): Not implemented yet!" );
212 }
213
214 void PrintDlg::print()
215 {
216     qWarning( "PrintDlg::print(): Not implemented yet!" );
217 }
218
219 void PrintDlg::set_collate(int)
220 {
221     qWarning( "PrintDlg::set_collate(int): Not implemented yet!" );
222 }
223