21 #include <qlineedit.h>
22 #include <qvalidator.h>
23 #include <qpushbutton.h>
24 #include <qmessagebox.h>
25 #include <qbuttongroup.h>
26 #include <qcheckbox.h>
27 #include <qvgroupbox.h>
29 #include <qstringlist.h>
31 #include <qtoolbutton.h>
34 #include <qradiobutton.h>
35 #include <qfileinfo.h>
36 #include <qfiledialog.h>
44 : QDialog (Doc_, 0, true, Qt::WDestructiveClose)
47 setCaption (tr(
"Document Settings"));
51 Expr.setPattern(
"[0-9a-zA-Z /\\]+");
52 Validator =
new QRegExpValidator (Expr,
this);
54 QGridLayout * box =
new QGridLayout (
this, 1, 1, 5);
56 QVGroupBox * setGroup =
new QVGroupBox (tr(
"Code Creation Settings"),
this);
57 box->addWidget (setGroup, 0, 0);
58 QWidget * f =
new QWidget (setGroup);
59 QGridLayout * all =
new QGridLayout (f, 7, 5, 5);
61 if (Doc->
Icon.isEmpty ())
62 Doc->
Icon = Module +
".png";
72 all->addMultiCellWidget (
IconEdit, 0, 0, 1, 3);
74 BrowseButt =
new QPushButton (tr(
"Browse"), f);
75 connect (
BrowseButt, SIGNAL (clicked()), SLOT (slotBrowse()));
78 QLabel * l1 =
new QLabel (tr(
"Output file:"), f);
79 l1->setAlignment (Qt::AlignRight);
80 all->addWidget (l1, 1, 0);
83 all->addMultiCellWidget (
OutputEdit, 1, 1, 1, 3);
92 QLabel * l2 =
new QLabel (tr(
"Icon description:"), f);
93 l2->setAlignment (Qt::AlignRight);
94 all->addWidget (l2, 2, 0);
100 Doc->
LongDesc = Module +
" verilog device";
102 QLabel * l3 =
new QLabel (tr(
"Description:"), f);
103 l3->setAlignment (Qt::AlignRight);
104 all->addWidget (l3, 3, 0);
110 QRadioButton * nonRadio =
111 new QRadioButton (tr(
"unspecified device"), f);
112 QRadioButton * bjtRadio =
113 new QRadioButton (tr(
"NPN/PNP polarity"), f);
114 QRadioButton * mosRadio =
115 new QRadioButton (tr(
"NMOS/PMOS polarity"), f);
120 bjtRadio->setChecked (
true);
122 mosRadio->setChecked (
true);
124 nonRadio->setChecked (
true);
125 all->addMultiCellWidget (nonRadio, 4, 4, 0, 1);
126 all->addWidget (bjtRadio, 4, 2);
127 all->addMultiCellWidget (mosRadio, 4, 4, 3, 4);
130 QRadioButton * anaRadio =
131 new QRadioButton (tr(
"analog only"), f);
132 QRadioButton * digRadio =
133 new QRadioButton (tr(
"digital only"), f);
134 QRadioButton * allRadio =
135 new QRadioButton (tr(
"both"), f);
140 allRadio->setChecked (
true);
142 anaRadio->setChecked (
true);
144 digRadio->setChecked (
true);
145 all->addMultiCellWidget (anaRadio, 5, 5, 0, 1);
146 all->addWidget (allRadio, 5, 2);
147 all->addMultiCellWidget (digRadio, 5, 5, 3, 4);
149 QHBox * Buttons =
new QHBox (f);
150 all->addMultiCellWidget (Buttons, 6, 6, 0, 4);
151 QPushButton * ButtonOk =
new QPushButton (tr(
"Ok"), Buttons);
152 QPushButton * ButtonCancel =
new QPushButton (tr(
"Cancel"), Buttons);
153 connect (ButtonOk, SIGNAL(clicked()), SLOT(slotOk()));
154 connect (ButtonCancel, SIGNAL(clicked()), SLOT(reject()));
155 ButtonOk->setDefault(
true);
163 void VASettingsDialog::slotOk ()
165 bool changed =
false;
205 void VASettingsDialog::slotBrowse ()
207 QString
s = QFileDialog::getOpenFileName (
209 tr(
"PNG files")+
" (*.png);;"+
210 tr(
"Any file")+
" (*)",
211 this, 0, tr(
"Enter an Icon File Name"));