Added povray options to the preferences dialog.

This commit is contained in:
leo 2013-08-17 01:17:23 +00:00
parent 06ceadd800
commit 3a626ab23c
5 changed files with 87 additions and 6 deletions

View file

@ -142,6 +142,8 @@ struct lcPreferencesDialogOptions
char DefaultAuthor[101];
char ProjectsPath[LC_MAXPATH];
char LibraryPath[LC_MAXPATH];
char POVRayPath[LC_MAXPATH];
char LGEOPath[LC_MAXPATH];
int MouseSensitivity;
int CheckForUpdates;

View file

@ -6225,6 +6225,8 @@ void Project::HandleCommand(LC_COMMANDS id)
strcpy(Options.DefaultAuthor, lcGetProfileString(LC_PROFILE_DEFAULT_AUTHOR_NAME));
strcpy(Options.ProjectsPath, lcGetProfileString(LC_PROFILE_PROJECTS_PATH));
strcpy(Options.LibraryPath, lcGetProfileString(LC_PROFILE_PARTS_LIBRARY));
strcpy(Options.POVRayPath, lcGetProfileString(LC_PROFILE_POVRAY_PATH));
strcpy(Options.LGEOPath, lcGetProfileString(LC_PROFILE_POVRAY_LGEO_PATH));
Options.MouseSensitivity = m_nMouse;
Options.CheckForUpdates = lcGetProfileInt(LC_PROFILE_CHECK_UPDATES);
@ -6257,6 +6259,8 @@ void Project::HandleCommand(LC_COMMANDS id)
lcSetProfileString(LC_PROFILE_DEFAULT_AUTHOR_NAME, Options.DefaultAuthor);
lcSetProfileString(LC_PROFILE_PROJECTS_PATH, Options.ProjectsPath);
lcSetProfileString(LC_PROFILE_PARTS_LIBRARY, Options.LibraryPath);
lcSetProfileString(LC_PROFILE_POVRAY_PATH, Options.POVRayPath);
lcSetProfileString(LC_PROFILE_POVRAY_LGEO_PATH, Options.LGEOPath);
lcSetProfileInt(LC_PROFILE_MOUSE_SENSITIVITY, m_nMouse);
lcSetProfileInt(LC_PROFILE_CHECK_UPDATES, Options.CheckForUpdates);
lcSetProfileInt(LC_PROFILE_SNAP, Options.Snap);

View file

@ -24,6 +24,8 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget *parent, void *data) :
ui->authorName->setText(options->DefaultAuthor);
ui->projectsFolder->setText(options->ProjectsPath);
ui->partsLibrary->setText(options->LibraryPath);
ui->povrayExecutable->setText(options->POVRayPath);
ui->lgeoPath->setText(options->LGEOPath);
ui->mouseSensitivity->setValue(options->MouseSensitivity);
ui->checkForUpdates->setChecked(options->CheckForUpdates != 0);
ui->centimeterUnits->setChecked((options->Snap & LC_DRAW_CM_UNITS) != 0);
@ -71,6 +73,8 @@ void lcQPreferencesDialog::accept()
strcpy(options->DefaultAuthor, ui->authorName->text().toLocal8Bit().data());
strcpy(options->ProjectsPath, ui->projectsFolder->text().toLocal8Bit().data());
strcpy(options->LibraryPath, ui->partsLibrary->text().toLocal8Bit().data());
strcpy(options->POVRayPath, ui->povrayExecutable->text().toLocal8Bit().data());
strcpy(options->LGEOPath, ui->lgeoPath->text().toLocal8Bit().data());
options->MouseSensitivity = ui->mouseSensitivity->value();
options->CheckForUpdates = ui->checkForUpdates->isChecked() ? 1 : 0;
@ -132,6 +136,28 @@ void lcQPreferencesDialog::on_partsLibraryBrowse_clicked()
ui->partsLibrary->setText(QDir::toNativeSeparators(result));
}
void lcQPreferencesDialog::on_povrayBrowse_clicked()
{
#ifdef Q_OS_WIN
QString filter(tr("Executable Files (*.exe);;All Files (*.*)"));
#else
QString filter(tr("All Files (*.*)"));
#endif
QString result = QFileDialog::getOpenFileName(this, tr("Open POV-Ray Executable"), ui->povrayExecutable->text(), filter);
if (!result.isEmpty())
ui->povrayExecutable->setText(QDir::toNativeSeparators(result));
}
void lcQPreferencesDialog::on_lgeoBrowse_clicked()
{
QString result = QFileDialog::getExistingDirectory(this, tr("Open LGEO Folder"), ui->lgeoPathBrowse->text());
if (!result.isEmpty())
ui->lgeoPathBrowse->setText(QDir::toNativeSeparators(result));
}
void lcQPreferencesDialog::on_antiAliasing_toggled()
{
ui->antiAliasingSamples->setEnabled(ui->antiAliasing->isChecked());

View file

@ -29,6 +29,8 @@ public slots:
void accept();
void on_projectsFolderBrowse_clicked();
void on_partsLibraryBrowse_clicked();
void on_povrayBrowse_clicked();
void on_lgeoBrowse_clicked();
void on_antiAliasing_toggled();
void on_edgeLines_toggled();
void on_baseGrid_toggled();

View file

@ -44,7 +44,7 @@
</property>
</widget>
</item>
<item row="5" column="0">
<item row="7" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Mouse sensitivity:</string>
@ -54,7 +54,7 @@
</property>
</widget>
</item>
<item row="5" column="1">
<item row="7" column="1">
<widget class="QSlider" name="mouseSensitivity">
<property name="minimum">
<number>1</number>
@ -70,28 +70,28 @@
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<item row="9" column="0" colspan="2">
<widget class="QCheckBox" name="checkForUpdates">
<property name="text">
<string>Check for updates on startup</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="2">
<item row="10" column="0" colspan="2">
<widget class="QCheckBox" name="centimeterUnits">
<property name="text">
<string>Centimeter units</string>
</property>
</widget>
</item>
<item row="9" column="0" colspan="2">
<item row="11" column="0" colspan="2">
<widget class="QCheckBox" name="noRelativeSnap">
<property name="text">
<string>Don't allow relative snap</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="2">
<item row="12" column="0" colspan="2">
<widget class="QCheckBox" name="fixedDirectionKeys">
<property name="text">
<string>Fixed direction keys</string>
@ -139,6 +139,48 @@
<item row="0" column="1">
<widget class="QLineEdit" name="authorName"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>POV-Ray Executable</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>LGEO Path</string>
</property>
</widget>
</item>
<item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLineEdit" name="povrayExecutable"/>
</item>
<item>
<widget class="QToolButton" name="povRayExecutableBrowse">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="6" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLineEdit" name="lgeoPath"/>
</item>
<item>
<widget class="QToolButton" name="lgeoPathBrowse">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabRendering">
@ -603,6 +645,10 @@
<tabstop>projectsFolderBrowse</tabstop>
<tabstop>partsLibrary</tabstop>
<tabstop>partsLibraryBrowse</tabstop>
<tabstop>povrayExecutable</tabstop>
<tabstop>povRayExecutableBrowse</tabstop>
<tabstop>lgeoPath</tabstop>
<tabstop>lgeoPathBrowse</tabstop>
<tabstop>mouseSensitivity</tabstop>
<tabstop>checkForUpdates</tabstop>
<tabstop>centimeterUnits</tabstop>
@ -631,6 +677,7 @@
<tabstop>shortcutsReset</tabstop>
<tabstop>shortcutEdit</tabstop>
<tabstop>shortcutAssign</tabstop>
<tabstop>shortcutRemove</tabstop>
</tabstops>
<resources/>
<connections>