3 @author Bruno M. Carvalho and Deniz Sarioz
4 licensed under (open-source) QPL v1.0
5 which accompanies this distribution in the file QPL
8 /****************************************************************************
9 ** Form implementation generated from reading ui file 'punch.ui'
11 ** Created: Wed May 15 18:20:01 2002
12 ** by: The User Interface Compiler (uic)
14 ** WARNING! All changes made in this file will be lost!
15 ****************************************************************************/
18 #include "variables.h"
20 #include <qcheckbox.h>
23 #include <qlineedit.h>
24 #include <qpushbutton.h>
25 #include <qradiobutton.h>
29 #include <qwhatsthis.h>
30 #include <qmessagebox.h>
33 * Constructs a punchwindow which is a child of 'parent', with the
34 * name 'name' and widget flags set to 'f'
36 * The dialog will by default be modeless, unless you set 'modal' to
37 * TRUE to construct a modal dialog.
39 @author Bruno M. Carvalho
41 punchwindow::punchwindow( QWidget* parent, const char* name, bool modal, WFlags fl )
42 : QDialog( parent, name, modal, fl )
45 setName( "punchwindow" );
47 setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, sizePolicy().hasHeightForWidth() ) );
48 setMinimumSize( QSize( 400, 240 ) );
49 setMaximumSize( QSize( 400, 240 ) );
50 setCaption( tr( "Punch Window" ) );
52 punchlabel = new QLabel( this, "punchlabel" );
53 punchlabel->setGeometry( QRect( 10, 10, 100, 30 ) );
54 punchlabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, punchlabel->sizePolicy().hasHeightForWidth() ) );
55 punchlabel->setMinimumSize( QSize( 100, 30 ) );
56 punchlabel->setMaximumSize( QSize( 100, 30 ) );
57 punchlabel->setText( tr( "PUNCH" ) );
59 phantombox = new QCheckBox( this, "phantombox" );
60 phantombox->setGeometry( QRect( 30, 60, 110, 30 ) );
61 phantombox->setText( tr( "PHANTOM" ) );
63 iterationflaglabel = new QLabel( this, "iterationflaglabel" );
64 iterationflaglabel->setGeometry( QRect( 130, 100, 130, 20 ) );
65 iterationflaglabel->setText( tr( "iteration_flag_line" ) );
67 iterationflagline = new QLineEdit( this, "iterationflagline" );
68 iterationflagline->setGeometry( QRect( 50, 120, 290, 30 ) );
69 iterationflagline->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, iterationflagline->sizePolicy().hasHeightForWidth() ) );
71 Line11 = new QFrame( this, "Line11" );
72 Line11->setGeometry( QRect( 0, 165, 400, 16 ) );
73 Line11->setFrameStyle( QFrame::HLine | QFrame::Sunken );
75 okbutton = new QPushButton( this, "okbutton" );
76 okbutton->setGeometry( QRect( 50, 180, 100, 40 ) );
77 okbutton->setText( tr( "OK" ) );
78 QObject::connect(okbutton,SIGNAL(clicked()),this,SLOT(checkValues()));
80 cancelbutton = new QPushButton( this, "cancelbutton" );
81 cancelbutton->setGeometry( QRect( 250, 180, 100, 40 ) );
82 cancelbutton->setText( tr( "Cancel" ) );
83 QObject::connect(cancelbutton,SIGNAL(clicked()),this,SLOT(reject()));
87 * Destroys the object and frees any allocated resources
89 punchwindow::~punchwindow()
91 // no need to delete child widgets, Qt does it all for us
95 /** Returns a string for PUNCH input sequence
98 @author Bruno M. Carvalho
100 QString punchwindow::getOutput()
104 output.sprintf("PUNCH ");
105 if(phantombox->isChecked()) {
106 output.append("PHANTOM ");
109 output+=iterationflagline->text();
114 void punchwindow::checkValues()
118 if(!isintspace(iterationflagline->text()))
123 case 1: QMessageBox::information(this,"SnarkInput","Error!\n"
124 "iteration_flag_line must contain\n"
125 "only 0-9 and spaces and must\n"