| 151 | } |
| 152 | |
| 153 | AddFormatDialog::AddFormatDialog(Project *project, |
| 154 | Gui* gui) |
| 155 | : QDialog(gui) |
| 156 | , _gui(gui) |
| 157 | { |
| 158 | _mainLayout = new QVBoxLayout(this); |
| 159 | _mainLayout->setSpacing(0); |
| 160 | _mainLayout->setContentsMargins(5, 5, 0, 0); |
| 161 | setLayout(_mainLayout); |
| 162 | setWindowTitle( tr("New Format") ); |
| 163 | |
| 164 | _fromViewerLine = new QWidget(this); |
| 165 | _fromViewerLineLayout = new QHBoxLayout(_fromViewerLine); |
| 166 | _fromViewerLine->setLayout(_fromViewerLineLayout); |
| 167 | |
| 168 | _copyFromViewerCombo = new ComboBox(_fromViewerLine); |
| 169 | |
| 170 | project->getViewers(&_viewers); |
| 171 | |
| 172 | |
| 173 | for (std::list<ViewerInstance*>::iterator it = _viewers.begin(); it != _viewers.end(); ++it) { |
| 174 | _copyFromViewerCombo->addItem( QString::fromUtf8( (*it)->getNode()->getLabel().c_str() ) ); |
| 175 | } |
| 176 | _fromViewerLineLayout->addWidget(_copyFromViewerCombo); |
| 177 | |
| 178 | _copyFromViewerButton = new Button(tr("Copy from"), _fromViewerLine); |
| 179 | _copyFromViewerButton->setToolTip( NATRON_NAMESPACE::convertFromPlainText( |
| 180 | tr("Fill the new format with the currently" |
| 181 | " displayed region of definition of the viewer" |
| 182 | " indicated on the left."), NATRON_NAMESPACE::WhiteSpaceNormal) ); |
| 183 | QObject::connect( _copyFromViewerButton, SIGNAL(clicked()), this, SLOT(onCopyFromViewer()) ); |
| 184 | _mainLayout->addWidget(_fromViewerLine); |
| 185 | |
| 186 | _fromViewerLineLayout->addWidget(_copyFromViewerButton); |
| 187 | _parametersLine = new QWidget(this); |
| 188 | _parametersLineLayout = new QHBoxLayout(_parametersLine); |
| 189 | _mainLayout->addWidget(_parametersLine); |
| 190 | |
| 191 | _widthLabel = new Label(QString::fromUtf8("w:"), _parametersLine); |
| 192 | _parametersLineLayout->addWidget(_widthLabel); |
| 193 | _widthSpinBox = new SpinBox(this, SpinBox::eSpinBoxTypeInt); |
| 194 | _widthSpinBox->setMaximum(99999); |
| 195 | _widthSpinBox->setMinimum(1); |
| 196 | _widthSpinBox->setValue(1); |
| 197 | _parametersLineLayout->addWidget(_widthSpinBox); |
| 198 | |
| 199 | |
| 200 | _heightLabel = new Label(QString::fromUtf8("h:"), _parametersLine); |
| 201 | _parametersLineLayout->addWidget(_heightLabel); |
| 202 | _heightSpinBox = new SpinBox(this, SpinBox::eSpinBoxTypeInt); |
| 203 | _heightSpinBox->setMaximum(99999); |
| 204 | _heightSpinBox->setMinimum(1); |
| 205 | _heightSpinBox->setValue(1); |
| 206 | _parametersLineLayout->addWidget(_heightSpinBox); |
| 207 | |
| 208 | |
| 209 | _pixelAspectLabel = new Label(tr("pixel aspect:"), _parametersLine); |
| 210 | _parametersLineLayout->addWidget(_pixelAspectLabel); |
nothing calls this directly
no test coverage detected