Example #1
0
void Perfboard::changeBoardSize() 
{

	QString newSize = QString("%1.%2").arg(m_xEdit->text()).arg(m_yEdit->text());
    m_propsMap.insert("size", newSize);

    InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this);
    if (infoGraphicsView != NULL) {
        infoGraphicsView->swap(modelPart()->properties().value("family"), "size", m_propsMap, this);
    }
}
Example #2
0
void Perfboard::changeBoardSize() 
{
	if (!m_gotWarning) {
		int x = m_xEdit->text().toInt();
		int y = m_yEdit->text().toInt();
		if (x * y >= WarningSize) {
			m_gotWarning = true;
			QMessageBox messageBox(NULL);
			messageBox.setWindowTitle(tr("Performance Warning"));
			messageBox.setText(tr("Performance of perfboards and stripboards with more than approximately 2000 holes can be slow. Are you sure ?\n"
				"\nNote: this warning will not be repeated during this session."
				));
			messageBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
			messageBox.setDefaultButton(QMessageBox::Cancel);
			messageBox.setIcon(QMessageBox::Warning);
			messageBox.setWindowModality(Qt::WindowModal);
			messageBox.setButtonText(QMessageBox::Ok, tr("Set new size"));
			messageBox.setButtonText(QMessageBox::Cancel, tr("Cancel"));
			QMessageBox::StandardButton answer = (QMessageBox::StandardButton) messageBox.exec();

			if (answer != QMessageBox::Ok) {
				getXY(x, y, m_size);
				m_xEdit->setText(QString::number(x));
				m_yEdit->setText(QString::number(y));
				return;
			}
		}
	}


	QString newSize = QString("%1.%2").arg(m_xEdit->text()).arg(m_yEdit->text());
    m_propsMap.insert("size", newSize);

    InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this);
    if (infoGraphicsView != NULL) {
        infoGraphicsView->swap(family(), "size", m_propsMap, this);
    }
}