1 /****************************************************************************
2 ** Form implementation generated from reading ui file 'printdlg.ui'
4 ** Created: Sun Feb 4 23:02:20 2001
5 ** by: The User Interface Compiler (uic)
7 ** WARNING! All changes made in this file will be lost!
8 ****************************************************************************/
11 #include <qbuttongroup.h>
12 #include <qcheckbox.h>
13 #include <qgroupbox.h>
15 #include <qlineedit.h>
16 #include <qpushbutton.h>
17 #include <qradiobutton.h>
22 #include <qwhatsthis.h>
25 * Constructs a PrintDlg which is a child of 'parent', with the
26 * name 'name' and widget flags set to 'f'
28 * The dialog will by default be modeless, unless you set 'modal' to
29 * TRUE to construct a modal dialog.
31 PrintDlg::PrintDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
32 : QDialog( parent, name, modal, fl )
35 setName( "PrintDlg" );
37 setCaption( tr( "Form1" ) );
38 PrintDlgLayout = new QVBoxLayout( this );
39 PrintDlgLayout->setSpacing( 6 );
40 PrintDlgLayout->setMargin( 11 );
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 );
52 toPrinter = new QRadioButton( ButtonGroup1, "toPrinter" );
53 toPrinter->setText( tr( "&Printer" ) );
54 toPrinter->setChecked( TRUE );
56 ButtonGroup1Layout->addWidget( toPrinter, 0, 0 );
58 toFile = new QRadioButton( ButtonGroup1, "toFile" );
59 toFile->setText( tr( "&File" ) );
61 ButtonGroup1Layout->addWidget( toFile, 1, 0 );
63 printerName = new QLineEdit( ButtonGroup1, "printerName" );
65 ButtonGroup1Layout->addWidget( printerName, 0, 1 );
67 fileName = new QLineEdit( ButtonGroup1, "fileName" );
68 fileName->setEnabled( FALSE );
70 ButtonGroup1Layout->addWidget( fileName, 1, 1 );
72 browsePB = new QPushButton( ButtonGroup1, "browsePB" );
73 browsePB->setText( tr( "&Browse..." ) );
74 browsePB->setEnabled( FALSE );
76 ButtonGroup1Layout->addWidget( browsePB, 1, 2 );
77 PrintDlgLayout->addWidget( ButtonGroup1 );
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 );
89 allPages = new QRadioButton( ButtonGroup3, "allPages" );
90 allPages->setText( tr( "All" ) );
91 allPages->setChecked( TRUE );
93 ButtonGroup3Layout->addWidget( allPages, 0, 0 );
95 oddPages = new QRadioButton( ButtonGroup3, "oddPages" );
96 oddPages->setText( tr( "Odd" ) );
98 ButtonGroup3Layout->addWidget( oddPages, 1, 0 );
100 evenPages = new QRadioButton( ButtonGroup3, "evenPages" );
101 evenPages->setText( tr( "Even" ) );
103 ButtonGroup3Layout->addWidget( evenPages, 2, 0 );
105 fromPageL = new QLabel( ButtonGroup3, "fromPageL" );
106 fromPageL->setText( tr( "Starting range:" ) );
107 fromPageL->setEnabled( FALSE );
109 ButtonGroup3Layout->addWidget( fromPageL, 3, 1 );
111 toPageL = new QLabel( ButtonGroup3, "toPageL" );
112 toPageL->setText( tr( "Last page:" ) );
113 toPageL->setEnabled( FALSE );
115 ButtonGroup3Layout->addWidget( toPageL, 3, 2 );
117 toPage = new QLineEdit( ButtonGroup3, "toPage" );
118 toPage->setEnabled( FALSE );
120 ButtonGroup3Layout->addWidget( toPage, 4, 2 );
122 reverse = new QCheckBox( ButtonGroup3, "reverse" );
123 reverse->setText( tr( "&Reverse order" ) );
125 ButtonGroup3Layout->addWidget( reverse, 0, 2 );
127 fromPage = new QLineEdit( ButtonGroup3, "fromPage" );
128 fromPage->setEnabled( FALSE );
130 ButtonGroup3Layout->addWidget( fromPage, 4, 1 );
132 customPages = new QRadioButton( ButtonGroup3, "customPages" );
133 customPages->setText( tr( "Pages:" ) );
135 ButtonGroup3Layout->addWidget( customPages, 4, 0 );
136 PrintDlgLayout->addWidget( ButtonGroup3 );
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 );
148 copies = new QSpinBox( GroupBox3, "copies" );
149 copies->setMinValue( 1 );
150 copies->setValue( 1 );
151 GroupBox3Layout->addWidget( copies );
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 );
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 );
167 printPB = new QPushButton( this, "printPB" );
168 printPB->setText( tr( "&Print" ) );
169 Layout1->addWidget( printPB );
171 cancelPB = new QPushButton( this, "cancelPB" );
172 cancelPB->setText( tr( "&Cancel" ) );
173 cancelPB->setDefault( TRUE );
174 Layout1->addWidget( cancelPB );
175 PrintDlgLayout->addLayout( Layout1 );
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) ) );
192 * Destroys the object and frees any allocated resources
194 PrintDlg::~PrintDlg()
196 // no need to delete child widgets, Qt does it all for us
199 void PrintDlg::cancel_adaptor()
201 qWarning( "PrintDlg::cancel_adaptor(): Not implemented yet!" );
204 void PrintDlg::enable_pagerange(int)
206 qWarning( "PrintDlg::enable_pagerange(int): Not implemented yet!" );
209 void PrintDlg::browse_file()
211 qWarning( "PrintDlg::browse_file(): Not implemented yet!" );
214 void PrintDlg::print()
216 qWarning( "PrintDlg::print(): Not implemented yet!" );
219 void PrintDlg::set_collate(int)
221 qWarning( "PrintDlg::set_collate(int): Not implemented yet!" );