(instance));
- uimb.groupBox->setTitle(uimb.groupBox->title()+QString::fromLatin1(" ")+ui->comboNavigationStyle->currentText());
- QString descr;
- descr = qApp->translate((const char*)data.toByteArray(),ns->mouseButtons(NavigationStyle::SELECTION));
- descr.replace(QLatin1String("\n"), QLatin1String(""));
- uimb.selectionLabel->setText(QString::fromLatin1("%1").arg(descr));
- descr = qApp->translate((const char*)data.toByteArray(),ns->mouseButtons(NavigationStyle::PANNING));
- descr.replace(QLatin1String("\n"), QLatin1String("
"));
- uimb.panningLabel->setText(QString::fromLatin1("%1").arg(descr));
- descr = qApp->translate((const char*)data.toByteArray(),ns->mouseButtons(NavigationStyle::DRAGGING));
- descr.replace(QLatin1String("\n"), QLatin1String("
"));
- uimb.rotationLabel->setText(QString::fromLatin1("%1").arg(descr));
- descr = qApp->translate((const char*)data.toByteArray(),ns->mouseButtons(NavigationStyle::ZOOMING));
- descr.replace(QLatin1String("\n"), QLatin1String("
"));
- uimb.zoomingLabel->setText(QString::fromLatin1("%1").arg(descr));
- dlg.exec();
}
/**
@@ -241,37 +143,16 @@ void DlgSettings3DViewImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
ui->comboAliasing->blockSignals(true);
- int navigation = ui->comboNavigationStyle->currentIndex();
- int orbit = ui->comboOrbitStyle->currentIndex();
int aliasing = ui->comboAliasing->currentIndex();
- int corner = ui->naviCubeCorner->currentIndex();
ui->retranslateUi(this);
- retranslate();
- ui->comboNavigationStyle->setCurrentIndex(navigation);
- ui->comboOrbitStyle->setCurrentIndex(orbit);
ui->comboAliasing->setCurrentIndex(aliasing);
ui->comboAliasing->blockSignals(false);
- ui->naviCubeCorner->setCurrentIndex(corner);
}
else {
QWidget::changeEvent(e);
}
}
-void DlgSettings3DViewImp::retranslate()
-{
- ui->comboNavigationStyle->clear();
-
- // add submenu at the end to select navigation style
- std::map styles = UserNavigationStyle::getUserFriendlyNames();
- for (std::map::iterator it = styles.begin(); it != styles.end(); ++it) {
- QByteArray data(it->first.getName());
- QString name = QApplication::translate(it->first.getName(), it->second.c_str());
-
- ui->comboNavigationStyle->addItem(name, data);
- }
-}
-
void DlgSettings3DViewImp::onAliasingChanged(int index)
{
if (index < 0 || !isVisible())
@@ -285,126 +166,5 @@ void DlgSettings3DViewImp::onAliasingChanged(int index)
}
}
-void DlgSettings3DViewImp::onNewDocViewChanged(int index)
-{
- QVariant camera = ui->comboNewDocView->itemData(index, Qt::UserRole);
- if (camera == QByteArray("Custom")) {
- CameraDialog dlg(this);
- dlg.setValues(q0, q1, q2, q3);
- if (dlg.exec()) {
- dlg.getValues(q0, q1, q2, q3);
- }
- }
-}
-
-// ----------------------------------------------------------------------------
-
-CameraDialog::CameraDialog(QWidget* parent)
- : QDialog(parent)
-{
- this->setWindowTitle(tr("Camera settings"));
-
- QGridLayout *gridLayout;
- gridLayout = new QGridLayout(this);
-
- QGroupBox *groupBox;
- groupBox = new QGroupBox(this);
- groupBox->setTitle(tr("Orientation"));
- gridLayout->addWidget(groupBox, 0, 0, 1, 1);
-
- QDialogButtonBox *buttonBox;
- buttonBox = new QDialogButtonBox(this);
- buttonBox->setOrientation(Qt::Horizontal);
- buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
- gridLayout->addWidget(buttonBox, 3, 0, 1, 1);
-
- QGridLayout *layout;
- layout = new QGridLayout(groupBox);
-
- // Q0
- QLabel* label0 = new QLabel(groupBox);
- label0->setText(tr("Q0"));
- layout->addWidget(label0, 0, 0, 1, 1);
-
- sb0 = new QDoubleSpinBox(groupBox);
- sb0->setRange(-1, 1);
- sb0->setSingleStep(0.1);
- layout->addWidget(sb0, 0, 1, 1, 1);
-
- // Q1
- QLabel* label1 = new QLabel(groupBox);
- label1->setText(tr("Q1"));
- layout->addWidget(label1, 1, 0, 1, 1);
-
- sb1 = new QDoubleSpinBox(groupBox);
- sb1->setRange(-1, 1);
- sb1->setSingleStep(0.1);
- layout->addWidget(sb1, 1, 1, 1, 1);
-
- // Q2
- QLabel* label2 = new QLabel(groupBox);
- label2->setText(tr("Q2"));
- layout->addWidget(label2, 2, 0, 1, 1);
-
- sb2 = new QDoubleSpinBox(groupBox);
- sb2->setRange(-1, 1);
- sb2->setSingleStep(0.1);
- layout->addWidget(sb2, 2, 1, 1, 1);
-
- // Q3
- QLabel* label3 = new QLabel(groupBox);
- label3->setText(tr("Q3"));
- layout->addWidget(label3, 3, 0, 1, 1);
-
- sb3 = new QDoubleSpinBox(groupBox);
- sb3->setRange(-1, 1);
- sb3->setSingleStep(0.1);
- layout->addWidget(sb3, 3, 1, 1, 1);
-
- QPushButton *currentViewButton;
- currentViewButton = new QPushButton(this);
- currentViewButton->setText(tr("Current view"));
- currentViewButton->setObjectName(QString::fromLatin1("currentView"));
- layout->addWidget(currentViewButton, 4, 1, 2, 1);
-
- QObject::connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
- QObject::connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
- QMetaObject::connectSlotsByName(this);
-}
-
-CameraDialog::~CameraDialog()
-{
-}
-
-void CameraDialog::setValues(double q0, double q1, double q2, double q3)
-{
- sb0->setValue(q0);
- sb1->setValue(q1);
- sb2->setValue(q2);
- sb3->setValue(q3);
-}
-
-void CameraDialog::getValues(double& q0, double& q1, double& q2, double& q3) const
-{
- q0 = sb0->value();
- q1 = sb1->value();
- q2 = sb2->value();
- q3 = sb3->value();
-}
-
-void CameraDialog::on_currentView_clicked()
-{
- View3DInventor* mdi = qobject_cast(getMainWindow()->activeWindow());
- if (mdi) {
- SbRotation rot = mdi->getViewer()->getCameraOrientation();
- const float* q = rot.getValue();
- sb0->setValue(q[0]);
- sb1->setValue(q[1]);
- sb2->setValue(q[2]);
- sb3->setValue(q[3]);
- }
-}
-
-
#include "moc_DlgSettings3DViewImp.cpp"
diff --git a/src/Gui/DlgSettings3DViewImp.h b/src/Gui/DlgSettings3DViewImp.h
index 247878abbf..1dee60d09e 100644
--- a/src/Gui/DlgSettings3DViewImp.h
+++ b/src/Gui/DlgSettings3DViewImp.h
@@ -50,39 +50,14 @@ public:
void loadSettings();
private Q_SLOTS:
- void on_mouseButton_clicked();
void onAliasingChanged(int);
- void onNewDocViewChanged(int);
protected:
void changeEvent(QEvent *e);
- void retranslate();
private:
std::unique_ptr ui;
static bool showMsg;
- double q0, q1, q2, q3;
-};
-
-class CameraDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- CameraDialog(QWidget* parent=0);
- ~CameraDialog();
- void setValues(double q0, double q1, double q2, double q3);
- void getValues(double& q0, double& q1, double& q2, double& q3) const;
-
-
-private Q_SLOTS:
- void on_currentView_clicked();
-
-private:
- QDoubleSpinBox* sb0;
- QDoubleSpinBox* sb1;
- QDoubleSpinBox* sb2;
- QDoubleSpinBox* sb3;
};
} // namespace Dialog
diff --git a/src/Gui/DlgSettingsNavigation.cpp b/src/Gui/DlgSettingsNavigation.cpp
index 937cc9d2db..575de5dc2f 100644
--- a/src/Gui/DlgSettingsNavigation.cpp
+++ b/src/Gui/DlgSettingsNavigation.cpp
@@ -219,7 +219,6 @@ void DlgSettingsNavigation::retranslate()
}
}
-#include "DlgSettings3DViewImp.h"
void DlgSettingsNavigation::onNewDocViewChanged(int index)
{
QVariant camera = ui->comboNewDocView->itemData(index, Qt::UserRole);
@@ -233,7 +232,7 @@ void DlgSettingsNavigation::onNewDocViewChanged(int index)
}
// ----------------------------------------------------------------------------
-#if 0
+
CameraDialog::CameraDialog(QWidget* parent)
: QDialog(parent)
{
@@ -339,7 +338,6 @@ void CameraDialog::on_currentView_clicked()
sb3->setValue(q[3]);
}
}
-#endif
#include "moc_DlgSettingsNavigation.cpp"
diff --git a/src/Gui/DlgSettingsNavigation.h b/src/Gui/DlgSettingsNavigation.h
index 025bfb0d2b..eaed6e77b5 100644
--- a/src/Gui/DlgSettingsNavigation.h
+++ b/src/Gui/DlgSettingsNavigation.h
@@ -61,7 +61,7 @@ private:
std::unique_ptr ui;
double q0, q1, q2, q3;
};
-#if 0
+
class CameraDialog : public QDialog
{
Q_OBJECT
@@ -82,7 +82,7 @@ private:
QDoubleSpinBox* sb2;
QDoubleSpinBox* sb3;
};
-#endif
+
} // namespace Dialog
} // namespace Gui