Skip to content

Commit

Permalink
Make directory for observing lists configurable (Fix Stellarium#3165)
Browse files Browse the repository at this point in the history
  • Loading branch information
gzotti committed Sep 14, 2023
1 parent 56eef14 commit 9866024
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions guide/app_config_ini.tex
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ \subsection{\big[main\big]}
screenshot\_custom\_width & int & custom width of screenshots. Max.\ available size is hardware dependent!\\
screenshot\_custom\_height & int & custom height of screenshots. Max.\ available size is hardware dependent!\\
screenshot\_dpi & int & DPI setting for screenshots. \\\midrule
observinglists\_dir & string & Default path for saving and loading observing lists. Defaults to the user's home dir.\\
version & string & Version of Stellarium. This parameter may be used to detect necessary changes in config.ini file, do not edit.\\%\midrule
use\_separate\_output\_file & bool & Set to \emph{true} if you want to create a new file for script output for each start of Stellarium\\%\midrule
restore\_defaults & bool & If \emph{true}, Stellarium will restore default settings at startup.
Expand Down
6 changes: 4 additions & 2 deletions src/gui/ObsListDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -904,9 +904,10 @@ void ObsListDialog::editListButtonPressed()
void ObsListDialog::exportListButtonPressed()
{
static const QString filter = "Stellarium Single Observing List (*.sol);;Stellarium Observing List (*.ol)";
const QString destinationDir=StelApp::getInstance().getSettings()->value("main/observinglists_dir", QDir::homePath()).toString();
QString selectedFilter = "Stellarium Single Observing List (*.sol)";
QString exportListJsonPath = QFileDialog::getSaveFileName(nullptr, q_("Export observing list as..."),
QDir::homePath() + "/" + JSON_FILE_BASENAME + "_" + currentListName + ".sol", filter, &selectedFilter);
destinationDir + "/" + JSON_FILE_BASENAME + "_" + currentListName + ".sol", filter, &selectedFilter);

QFile jsonFile(exportListJsonPath);
if (!jsonFile.open(QIODevice::ReadWrite | QIODevice::Text))
Expand Down Expand Up @@ -950,8 +951,9 @@ void ObsListDialog::exportListButtonPressed()
void ObsListDialog::importListButtonPressed()
{
static const QString filter = "Stellarium Single Observing List (*.sol);;Stellarium Observing List (*.ol);;Stellarium Legacy JSON Observing List or Bookmarks (*.json)";
const QString destinationDir=StelApp::getInstance().getSettings()->value("main/observinglists_dir", QDir::homePath()).toString();
QString fileToImportJsonPath = QFileDialog::getOpenFileName(nullptr, q_("Import observing list"),
QDir::homePath(),
destinationDir,
filter);
QVariantMap map;
QFile jsonFile(fileToImportJsonPath);
Expand Down

0 comments on commit 9866024

Please sign in to comment.