Remember last folder used to open a project.
This commit is contained in:
@@ -455,7 +455,6 @@ void lcApplication::ShowPreferencesDialog()
|
||||
Options.Preferences = mPreferences;
|
||||
|
||||
Options.DefaultAuthor = lcGetProfileString(LC_PROFILE_DEFAULT_AUTHOR_NAME);
|
||||
Options.ProjectsPath = lcGetProfileString(LC_PROFILE_PROJECTS_PATH);
|
||||
Options.LibraryPath = lcGetProfileString(LC_PROFILE_PARTS_LIBRARY);
|
||||
Options.POVRayPath = lcGetProfileString(LC_PROFILE_POVRAY_PATH);
|
||||
Options.LGEOPath = lcGetProfileString(LC_PROFILE_POVRAY_LGEO_PATH);
|
||||
@@ -485,7 +484,6 @@ void lcApplication::ShowPreferencesDialog()
|
||||
mPreferences.SaveDefaults();
|
||||
|
||||
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);
|
||||
|
||||
@@ -49,7 +49,6 @@ struct lcPreferencesDialogOptions
|
||||
lcPreferences Preferences;
|
||||
|
||||
QString DefaultAuthor;
|
||||
QString ProjectsPath;
|
||||
QString LibraryPath;
|
||||
QString POVRayPath;
|
||||
QString LGEOPath;
|
||||
|
||||
@@ -1847,6 +1847,8 @@ bool lcMainWindow::OpenProject(const QString& FileName)
|
||||
|
||||
if (LoadFileName.isEmpty())
|
||||
return false;
|
||||
|
||||
lcSetProfileString(LC_PROFILE_PROJECTS_PATH, QFileInfo(LoadFileName).absolutePath());
|
||||
}
|
||||
|
||||
Project* NewProject = new Project();
|
||||
@@ -1878,6 +1880,8 @@ void lcMainWindow::MergeProject()
|
||||
if (LoadFileName.isEmpty())
|
||||
return;
|
||||
|
||||
lcSetProfileString(LC_PROFILE_PROJECTS_PATH, QFileInfo(LoadFileName).absolutePath());
|
||||
|
||||
Project* NewProject = new Project();
|
||||
|
||||
if (NewProject->Load(LoadFileName))
|
||||
@@ -1920,6 +1924,8 @@ bool lcMainWindow::SaveProject(const QString& FileName)
|
||||
|
||||
if (SaveFileName.isEmpty())
|
||||
return false;
|
||||
|
||||
lcSetProfileString(LC_PROFILE_PROJECTS_PATH, QFileInfo(SaveFileName).absolutePath());
|
||||
}
|
||||
|
||||
if (QFileInfo(SaveFileName).suffix().toLower() == QLatin1String("lcd"))
|
||||
|
||||
@@ -26,7 +26,6 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget *parent, void *data) :
|
||||
options = (lcPreferencesDialogOptions*)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);
|
||||
@@ -89,7 +88,6 @@ void lcQPreferencesDialog::accept()
|
||||
}
|
||||
|
||||
options->DefaultAuthor = ui->authorName->text();
|
||||
options->ProjectsPath = ui->projectsFolder->text();
|
||||
options->LibraryPath = ui->partsLibrary->text();
|
||||
options->POVRayPath = ui->povrayExecutable->text();
|
||||
options->LGEOPath = ui->lgeoPath->text();
|
||||
@@ -119,14 +117,6 @@ void lcQPreferencesDialog::accept()
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void lcQPreferencesDialog::on_projectsFolderBrowse_clicked()
|
||||
{
|
||||
QString result = QFileDialog::getExistingDirectory(this, tr("Open Projects Folder"), ui->projectsFolder->text());
|
||||
|
||||
if (!result.isEmpty())
|
||||
ui->projectsFolder->setText(QDir::toNativeSeparators(result));
|
||||
}
|
||||
|
||||
void lcQPreferencesDialog::on_partsLibraryBrowse_clicked()
|
||||
{
|
||||
QString result = QFileDialog::getExistingDirectory(this, tr("Open Parts Library Folder"), ui->partsLibrary->text());
|
||||
|
||||
@@ -27,7 +27,6 @@ public:
|
||||
|
||||
public slots:
|
||||
void accept();
|
||||
void on_projectsFolderBrowse_clicked();
|
||||
void on_partsLibraryBrowse_clicked();
|
||||
void on_povrayExecutableBrowse_clicked();
|
||||
void on_lgeoPathBrowse_clicked();
|
||||
|
||||
@@ -40,31 +40,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="authorName"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Default projects folder:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>projectsFolder</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="projectsFolder"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="projectsFolderBrowse">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Custom parts library:</string>
|
||||
@@ -74,7 +50,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="3" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="partsLibrary"/>
|
||||
@@ -88,7 +64,7 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>POV-Ray Executable:</string>
|
||||
@@ -98,7 +74,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="4" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="povrayExecutable"/>
|
||||
@@ -112,7 +88,7 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>LGEO Path:</string>
|
||||
@@ -122,7 +98,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<item row="5" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lgeoPath"/>
|
||||
@@ -136,7 +112,7 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Check for updates:</string>
|
||||
@@ -146,7 +122,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<item row="6" column="1">
|
||||
<widget class="QComboBox" name="checkForUpdates">
|
||||
<item>
|
||||
<property name="text">
|
||||
@@ -165,7 +141,7 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="2">
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="fixedDirectionKeys">
|
||||
<property name="text">
|
||||
<string>Fixed direction keys</string>
|
||||
@@ -855,8 +831,6 @@
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
<tabstop>authorName</tabstop>
|
||||
<tabstop>projectsFolder</tabstop>
|
||||
<tabstop>projectsFolderBrowse</tabstop>
|
||||
<tabstop>partsLibrary</tabstop>
|
||||
<tabstop>partsLibraryBrowse</tabstop>
|
||||
<tabstop>povrayExecutable</tabstop>
|
||||
|
||||
Reference in New Issue
Block a user