Verified Commit fb3a9a40 authored by Tobias WEBER's avatar Tobias WEBER
Browse files

changed default paths

parent 8447032e
......@@ -595,9 +595,9 @@ void GotoDlg::LoadList()
if(m_pSettings && !m_pSettings->value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = ".";
QString strDirLast = "~";
if(m_pSettings)
strDirLast = m_pSettings->value("goto_pos/last_dir", ".").toString();
strDirLast = m_pSettings->value("goto_pos/last_dir", "~").toString();
QString qstrFile = QFileDialog::getOpenFileName(this,
"Load Positions", strDirLast,
"TAZ files (*.taz *.TAZ)", nullptr,
......@@ -629,9 +629,9 @@ void GotoDlg::SaveList()
if(m_pSettings && !m_pSettings->value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = ".";
QString strDirLast = "~";
if(m_pSettings)
m_pSettings->value("goto_pos/last_dir", ".").toString();
m_pSettings->value("goto_pos/last_dir", "~").toString();
QString qstrFile = QFileDialog::getSaveFileName(this,
"Save Positions", strDirLast,
"TAZ files (*.taz *.TAZ)", nullptr,
......
......@@ -673,9 +673,9 @@ void PowderDlg::SavePowder()
if(m_pSettings && !m_pSettings->value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = ".";
QString strDirLast = "~";
if(m_pSettings)
m_pSettings->value("powder/last_dir", ".").toString();
m_pSettings->value("powder/last_dir", "~").toString();
QString qstrFile = QFileDialog::getSaveFileName(this,
"Save Powder Configuration", strDirLast,
"TAZ files (*.taz *.TAZ)", nullptr,
......@@ -752,9 +752,9 @@ void PowderDlg::LoadPowder()
if(m_pSettings && !m_pSettings->value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = ".";
QString strDirLast = "~";
if(m_pSettings)
strDirLast = m_pSettings->value("powder/last_dir", ".").toString();
strDirLast = m_pSettings->value("powder/last_dir", "~").toString();
QString qstrFile = QFileDialog::getOpenFileName(this,
"Open Powder Configuration", strDirLast,
"TAZ files (*.taz *.TAZ)", nullptr,
......@@ -874,7 +874,7 @@ void PowderDlg::SaveTable()
if(m_pSettings && !m_pSettings->value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = m_pSettings ? m_pSettings->value("powder/last_dir_table", ".").toString() : ".";
QString strDirLast = m_pSettings ? m_pSettings->value("powder/last_dir_table", "~").toString() : "~";
QString _strFile = QFileDialog::getSaveFileName(this,
"Save Table", strDirLast, "Data files (*.dat *.DAT)", nullptr, fileopt);
......
......@@ -58,7 +58,7 @@ void ConvoDlg::Load()
QString strDirLast = "";
if(m_pSett)
strDirLast = m_pSett->value("monteconvo/last_dir", ".").toString();
strDirLast = m_pSett->value("monteconvo/last_dir", "~").toString();
QString _strFile = QFileDialog::getOpenFileName(this,
"Open Convolution Configuration...", strDirLast, "Takin files (*.taz *.TAZ)",
nullptr, fileopt);
......@@ -122,7 +122,7 @@ void ConvoDlg::SaveAs()
QString strDirLast = "";
if(m_pSett)
strDirLast = m_pSett->value("monteconvo/last_dir", ".").toString();
strDirLast = m_pSett->value("monteconvo/last_dir", "~").toString();
QString _strFile = QFileDialog::getSaveFileName(this,
"Save Convolution Configuration", strDirLast, "Takin files (*.taz *.TAZ)",
nullptr, fileopt);
......@@ -303,7 +303,7 @@ void ConvoDlg::SaveConvofit()
QString strDirLast = "";
if(m_pSett)
strDirLast = m_pSett->value("monteconvo/last_dir_convofit", ".").toString();
strDirLast = m_pSett->value("monteconvo/last_dir_convofit", "~").toString();
QString _strFile = QFileDialog::getSaveFileName(this,
"Export to Convofit", strDirLast, "Convofit files (*.job *.JOB)",
nullptr, fileopt);
......@@ -343,9 +343,9 @@ void ConvoDlg::SaveResult()
if(m_pSett && !m_pSett->value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = ".";
QString strDirLast = "~";
if(m_pSett)
strDirLast = m_pSett->value("monteconvo/last_dir_result", ".").toString();
strDirLast = m_pSett->value("monteconvo/last_dir_result", "~").toString();
QString strFile = QFileDialog::getSaveFileName(this,
"Save Scan", strDirLast, "Data Files (*.dat *.DAT)", nullptr, fileopt);
......@@ -470,9 +470,9 @@ void ConvoDlg::browseCrysFiles()
if(m_pSett && !m_pSett->value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = ".";
QString strDirLast = "~";
if(m_pSett)
strDirLast = m_pSett->value("monteconvo/last_dir_crys", ".").toString();
strDirLast = m_pSett->value("monteconvo/last_dir_crys", "~").toString();
QString strFile = QFileDialog::getOpenFileName(this,
"Open Crystal File...", strDirLast, "Takin files (*.taz *.TAZ)",
nullptr, fileopt);
......@@ -493,9 +493,9 @@ void ConvoDlg::browseResoFiles()
if(m_pSett && !m_pSett->value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = ".";
QString strDirLast = "~";
if(m_pSett)
strDirLast = m_pSett->value("monteconvo/last_dir_reso", ".").toString();
strDirLast = m_pSett->value("monteconvo/last_dir_reso", "~").toString();
QString strFile = QFileDialog::getOpenFileName(this,
"Open Resolution File...", strDirLast, "Takin files (*.taz *.TAZ)",
nullptr, fileopt);
......@@ -516,9 +516,9 @@ void ConvoDlg::browseSqwFiles()
if(m_pSett && !m_pSett->value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = ".";
QString strDirLast = "~";
if(m_pSett)
strDirLast = m_pSett->value("monteconvo/last_dir_sqw", ".").toString();
strDirLast = m_pSett->value("monteconvo/last_dir_sqw", "~").toString();
QString strFile = QFileDialog::getOpenFileName(this,
"Open S(q,w) File...", strDirLast, "All S(q,w) files (*.dat *.DAT *.py *.PY *.jl *.JL)",
nullptr, fileopt);
......@@ -539,9 +539,9 @@ void ConvoDlg::browseScanFiles()
if(m_pSett && !m_pSett->value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = ".";
QString strDirLast = "~";
if(m_pSett)
strDirLast = m_pSett->value("monteconvo/last_dir_scan", ".").toString();
strDirLast = m_pSett->value("monteconvo/last_dir_scan", "~").toString();
QString strFile = QFileDialog::getOpenFileName(this,
"Open S(q,w) File...", strDirLast, "All scan files (*.dat *.DAT *.scn *.SCN);;All files (*.* *)",
nullptr, fileopt);
......@@ -562,9 +562,9 @@ void ConvoDlg::browseAutosaveFile()
if(m_pSett && !m_pSett->value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = ".";
QString strDirLast = "~";
if(m_pSett)
strDirLast = m_pSett->value("monteconvo/last_dir_autosave", ".").toString();
strDirLast = m_pSett->value("monteconvo/last_dir_autosave", "~").toString();
QString strFile = QFileDialog::getSaveFileName(this,
"Open S(q,w) File...", strDirLast, "Data files (*.dat *.txt);;All files (*.*)",
nullptr, fileopt);
......
......@@ -259,7 +259,7 @@ std::shared_ptr<ReflCurve<t_real_reso>> ResoDlg::load_cache_refl(const std::stri
if(strFile == "")
return pRefl;
std::vector<std::string> vecRelDirs = { m_strCurDir, "." };
std::vector<std::string> vecRelDirs = { m_strCurDir, "~", "." };
const std::vector<std::string>& vecGlobalPaths = get_global_paths();
for(const std::string& strGlobalPath : vecGlobalPaths)
vecRelDirs.push_back(strGlobalPath);
......@@ -990,7 +990,7 @@ void ResoDlg::MCGenerate()
if(m_pSettings && !m_pSettings->value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strLastDir = m_pSettings ? m_pSettings->value("reso/mc_dir", ".").toString() : ".";
QString strLastDir = m_pSettings ? m_pSettings->value("reso/mc_dir", "~").toString() : "~";
QString _strFile = QFileDialog::getSaveFileName(this, "Save MC neutron data...",
strLastDir, "Data files (*.dat *.DAT);;All files (*.*)", nullptr, fileopt);
if(_strFile == "")
......
......@@ -328,7 +328,7 @@ void ScanViewerDlg::SelectDir()
if(!m_settings.value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strCurDir = (m_strCurDir==""?".":m_strCurDir.c_str());
QString strCurDir = (m_strCurDir==""?"~":m_strCurDir.c_str());
QString strDir = QFileDialog::getExistingDirectory(this, "Select directory",
strCurDir, QFileDialog::ShowDirsOnly | fileopt);
if(strDir != "")
......
......@@ -89,7 +89,7 @@ void TazDlg::ExportSceneSVG(QGraphicsScene& scene)
if(!m_settings.value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = m_settings.value("main/last_dir_export", ".").toString();
QString strDirLast = m_settings.value("main/last_dir_export", "~").toString();
QString strFile = QFileDialog::getSaveFileName(this,
"Export SVG", strDirLast, "SVG files (*.svg *.SVG)", nullptr, fileopt);
if(strFile == "")
......@@ -125,7 +125,7 @@ void TazDlg::ExportBZCut()
if(!m_settings.value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = m_settings.value("main/last_dir_export", ".").toString();
QString strDirLast = m_settings.value("main/last_dir_export", "~").toString();
QString strFile = QFileDialog::getSaveFileName(this,
"Export Data", strDirLast, "Data files (*.dat *.DAT)", nullptr, fileopt);
if(strFile == "")
......@@ -181,7 +181,7 @@ void TazDlg::ExportBZ3DModel()
if(!m_settings.value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = m_settings.value("main/last_dir_export", ".").toString();
QString strDirLast = m_settings.value("main/last_dir_export", "~").toString();
QString strFile = QFileDialog::getSaveFileName(this,
"Export X3D", strDirLast, "X3D files (*.x3d *.X3D)", nullptr, fileopt);
if(strFile == "")
......@@ -345,7 +345,7 @@ void TazDlg::ExportUCModel()
if(!m_settings.value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = m_settings.value("main/last_dir_export", ".").toString();
QString strDirLast = m_settings.value("main/last_dir_export", "~").toString();
QString strFile = QFileDialog::getSaveFileName(this,
"Export X3D", strDirLast, "X3D files (*.x3d *.X3D)", nullptr, fileopt);
if(strFile == "")
......
......@@ -92,7 +92,7 @@ bool TazDlg::Load()
if(!m_settings.value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = m_settings.value("main/last_dir", ".").toString();
QString strDirLast = m_settings.value("main/last_dir", "~").toString();
QString strFile = QFileDialog::getOpenFileName(this,
"Open TAS Configuration...", strDirLast, "Takin files (*.taz *.TAZ)",
nullptr, fileopt);
......@@ -599,7 +599,7 @@ bool TazDlg::SaveAs()
if(!m_settings.value("main/native_dialogs", 1).toBool())
fileopt = QFileDialog::DontUseNativeDialog;
QString strDirLast = m_settings.value("main/last_dir", ".").toString();
QString strDirLast = m_settings.value("main/last_dir", "~").toString();
QString strFile = QFileDialog::getSaveFileName(this,
"Save TAS Configuration", strDirLast, "Takin files (*.taz *.TAZ)",
nullptr, fileopt);
......@@ -639,7 +639,7 @@ bool TazDlg::Import()
fileopt = QFileDialog::DontUseNativeDialog;
const bool bShowPreview = m_settings.value("main/dlg_previews", true).toBool();
QString strDirLast = m_settings.value("main/last_import_dir", ".").toString();
QString strDirLast = m_settings.value("main/last_import_dir", "~").toString();
std::unique_ptr<QFileDialog> pdlg;
if(bShowPreview)
......@@ -802,7 +802,7 @@ bool TazDlg::ImportCIF()
fileopt = QFileDialog::DontUseNativeDialog;
const bool bShowPreview = m_settings.value("main/dlg_previews", true).toBool();
QString strDirLast = m_settings.value("main/last_import_cif_dir", ".").toString();
QString strDirLast = m_settings.value("main/last_import_cif_dir", "~").toString();
std::unique_ptr<QFileDialog> pdlg{new QFileDialog(this, "Import CIF...")};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment