diff --git a/configure.ac b/configure.ac index e211ea63..9ecabaf4 100644 --- a/configure.ac +++ b/configure.ac @@ -1263,8 +1263,6 @@ AC_CONFIG_FILES([Makefile \ src/musredit_qt5/Makefile \ src/musredit/Makefile \ src/musrgui/Makefile \ - src/musredit_qt5/musredit_startup.xml \ - src/musredit/musredit_startup.xml \ src/musrgui/musrgui_startup.xml]) AC_OUTPUT @@ -1425,3 +1423,15 @@ echo " Programs: ${INSTALLDIR}/bin" echo " XML configuration files: ${HOME}/.musrfit" echo " Documentation: ${DOCDIR}" echo "" + +dnl -------------- +dnl create header file that musredit knows at runtime where to find the documentation +dnl -------------- +if test "x$enable_editor" != "xno" && test "x${QMAKEBIN}" != "x" && test "x${QTEDITOR}" = "xmusredit_qt5"; then + echo \#define MUSRFIT_PREFIX \"${INSTALLDIR}\" > src/musredit_qt5/musrfit-info.h + echo \#define MUSRFIT_DOC_DIR \"${DOCDIR}\" >> src/musredit_qt5/musrfit-info.h +fi +if test "x$enable_editor" != "xno" && test "x${QMAKEBIN}" != "x" && test "x${QTEDITOR}" = "xmusredit"; then + echo \#define MUSRFIT_PREFIX \"${INSTALLDIR}\" > src/musredit/musrfit-info.h + echo \#define MUSRFIT_DOC_DIR \"${DOCDIR}\" >> src/musredit/musrfit-info.h +fi diff --git a/src/musredit/PAdmin.cpp b/src/musredit/PAdmin.cpp index c097fdfb..b22b2498 100644 --- a/src/musredit/PAdmin.cpp +++ b/src/musredit/PAdmin.cpp @@ -36,7 +36,10 @@ using namespace std; #include #include #include +#include +#include +#include "musrfit-info.h" #include "PAdmin.h" //-------------------------------------------------------------------------- @@ -259,7 +262,7 @@ bool PAdminXMLParser::characters(const QString& str) else flag = false; fAdmin->setMusrviewShowAvgFlag(flag); - break; + break; case eEnableMusrT0: if (str == "y") flag = true; @@ -578,13 +581,21 @@ QString PAdminXMLParser::expandPath(const QString &str) QString msg; QString newStr=""; + QProcessEnvironment procEnv = QProcessEnvironment::systemEnvironment(); + QStringList list = str.split("/"); for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { token = *it; if (token.contains("$")) { token.remove('$'); - path = std::getenv(token.toLatin1()); + if (!procEnv.contains(token)) { + msg = QString("Couldn't find '%1'. Some things might not work properly").arg(token); + QMessageBox::warning(0, "**WARNING**", msg, QMessageBox::Ok, QMessageBox::NoButton); + newStr = ""; + break; + } + path = procEnv.value(token, ""); if (path.isEmpty()) { msg = QString("Couldn't expand '%1'. Some things might not work properly").arg(token); QMessageBox::warning(0, "**WARNING**", msg, QMessageBox::Ok, QMessageBox::NoButton); @@ -658,18 +669,25 @@ PAdmin::PAdmin() : QObject() QString path = QString("./"); QString fln = QString("musredit_startup.xml"); QString pathFln = path + fln; + QProcessEnvironment procEnv = QProcessEnvironment::systemEnvironment(); if (!QFile::exists(pathFln)) { // 2nd: check $HOME/.musrfit/musredit/musredit_startup.xml - path = std::getenv("HOME"); + path = procEnv.value("HOME", ""); pathFln = path + "/.musrfit/musredit/" + fln; if (!QFile::exists(pathFln)) { // 3rd: check $MUSRFITPATH/musredit_startup.xml - path = std::getenv("MUSRFITPATH"); + path = procEnv.value("MUSRFITPATH", ""); pathFln = path + "/" + fln; if (!QFile::exists(pathFln)) { // 4th: check $ROOTSYS/bin/musredit_startup.xml - path = std::getenv("ROOTSYS"); + path = procEnv.value("ROOTSYS", ""); pathFln = path + "/bin/" + fln; + if (!QFile::exists(pathFln)) { + // 5th: not found anyware hence create it + path = procEnv.value("HOME", ""); + pathFln = path + "/.musrfit/musredit/" + fln; + createMusreditStartupFile(); + } } } } @@ -861,6 +879,12 @@ int PAdmin::savePrefs(QString pref_fln) else data[i] = " n"; } + if (data[i].contains("") && data[i].contains("")) { + data[i] = QString(" %1").arg(fFontName); + } + if (data[i].contains("") && data[i].contains("")) { + data[i] = QString(" %1").arg(fFontSize); + } } // write prefs @@ -910,6 +934,7 @@ void PAdmin::saveRecentFiles() { // check if musredit_startup.xml is present in the current directory, and if yes, use this file to // save the recent file names otherwise use the "master" musredit_startup.xml + QString str(""); QString fln = QString("./musredit_startup.xml"); if (!QFile::exists(fln)) @@ -967,6 +992,302 @@ void PAdmin::saveRecentFiles() } } +//-------------------------------------------------------------------------- +/** + * @brief PAdmin::createMusreditStartupFile + */ +void PAdmin::createMusreditStartupFile() +{ + // get $HOME + QProcessEnvironment procEnv = QProcessEnvironment::systemEnvironment(); + QString pathName = procEnv.value("HOME", ""); + pathName += "/.musrfit/musredit"; + + // check if the directory $HOME/.musrfit/musredit exists if not create it + QDir dir(pathName); + if (!dir.exists()) { + // directory $HOME/.musrfit/musredit does not exist hence create it + dir.mkpath(pathName); + } + + // create default musredit_startup.xml file in $HOME/.musrfit/musredit + pathName += "/musredit_startup.xml"; + QFile file(pathName); + + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) + return; + + QTextStream fout(&file); + + fout << "" << endl; + fout << "" << endl; + fout << " " << endl; + fout << " This is handling default setting parameters for the musredit." << endl; + fout << " " << endl; + fout << " " << endl; + fout << " " << MUSRFIT_PREFIX << "/bin" << endl; + fout << " ./" << endl; + fout << " " << MUSRFIT_DOC_DIR << "/templates" << endl; + fout << " 3600" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " y" << endl; + fout << " n" << endl; + fout << " y" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " y" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " " << MUSRFIT_DOC_DIR << "/examples/test-histo-PSI-BIN.msr" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheTitle" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheFitparameterBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheTheoryBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheFunctionsBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheRunBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheCommandsBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheFourierBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#ThePlotBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheStatisticBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/Msr2Data.html" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#A_2.3_musrFT" << endl; + fout << " " << endl; + fout << " " << endl; +#ifdef Q_OS_MAC + fout << " Courier New" << endl; + fout << " 16" << endl; +#else + fout << " Monospace" << endl; + fout << " 12" << endl; +#endif + fout << " " << endl; + fout << " " << endl; + fout << " mue4" << endl; + fout << " psi" << endl; + fout << " root-npp" << endl; + fout << " y" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " y" << endl; + fout << " y" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " y" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " " << endl; + fout << " " << MUSRFIT_DOC_DIR << "/latex_images" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " asymmetry" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " asymmetry.png" << endl; + fout << " 1" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " simplExpo" << endl; + fout << " (rate)" << endl; + fout << " " << endl; + fout << " simpleExp.png" << endl; + fout << " 1" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " generExpo" << endl; + fout << " (rate exponent)" << endl; + fout << " " << endl; + fout << " generalExp.png" << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " simpleGss" << endl; + fout << " (rate)" << endl; + fout << " " << endl; + fout << " simpleGauss.png" << endl; + fout << " 1" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " statGssKT" << endl; + fout << " (rate)" << endl; + fout << " " << endl; + fout << " statGssKT.png" << endl; + fout << " 1" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " statGssKTLF" << endl; + fout << " (frequency damping)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " dynGssKTLF" << endl; + fout << " (frequency damping hopping-rate)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 3" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " statExpKT" << endl; + fout << " (rate)" << endl; + fout << " " << endl; + fout << " statExpKT.png" << endl; + fout << " 1" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " statExpKTLF" << endl; + fout << " (frequency damping)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " dynExpKTLF" << endl; + fout << " (frequency damping hopping-rate)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 3" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " combiLGKT" << endl; + fout << " (lorentzRate gaussRate)" << endl; + fout << " " << endl; + fout << " combiLGKT.png" << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " strKT" << endl; + fout << " (rate beta)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " spinGlass" << endl; + fout << " (rate hopping-rate order)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 3" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " rdAnisoHf" << endl; + fout << " (frequency rate)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " abragam" << endl; + fout << " (rate hopping-rate)" << endl; + fout << " " << endl; + fout << " abragam.png" << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " TFieldCos" << endl; + fout << " (phase frequency)" << endl; + fout << " " << endl; + fout << " tfCos.png" << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " internFld" << endl; + fout << " (fraction phase frequency Trate Lrate)" << endl; + fout << " " << endl; + fout << " internalField.png" << endl; + fout << " 5" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " internFldGK" << endl; + fout << " (fraction frequency Trate Lrate beta)" << endl; + fout << " " << endl; + fout << " internalFieldGK.png" << endl; + fout << " 5" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " internFldLL" << endl; + fout << " (fraction frequency Trate Lrate)" << endl; + fout << " " << endl; + fout << " internalFieldLL.png" << endl; + fout << " 4" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " bessel" << endl; + fout << " (phase frequency)" << endl; + fout << " " << endl; + fout << " bessel.png" << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " internBsl" << endl; + fout << " (fraction phase frequency Trate Lrate)" << endl; + fout << " " << endl; + fout << " internalBessel.png" << endl; + fout << " 5" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " skewedGss" << endl; + fout << " (phase frequency rate_m rate_p)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 4" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " staticNKZF" << endl; + fout << " (damping_D0 R_b)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " staticNKTF" << endl; + fout << " (phase frequency damping_D0 R_b)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 4" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " dynamicNKZF" << endl; + fout << " (damping_D0 R_b nu_c)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 3" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " dynamicNKTF" << endl; + fout << " (phase frequency damping_D0 R_b nu_c)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 5" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " polynom" << endl; + fout << " (tshift p0 p1 ... pn)" << endl; + fout << " " << endl; + fout << " polynom.png" << endl; + fout << " 4" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " userFcn" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 0" << endl; + fout << " " << endl; + fout << " " << endl; + fout << "" << endl; + + file.close(); +} + //-------------------------------------------------------------------------- // END //-------------------------------------------------------------------------- diff --git a/src/musredit/PAdmin.h b/src/musredit/PAdmin.h index 2d0dc51d..454735d4 100644 --- a/src/musredit/PAdmin.h +++ b/src/musredit/PAdmin.h @@ -209,6 +209,7 @@ class PAdmin : public QObject QVector fTheory; ///< stores all known theories. Needed when generating theory blocks from within musredit. void saveRecentFiles(); ///< save recent file list + void createMusreditStartupFile(); ///< create default musredit_startup.xml }; #endif // _PADMIN_H_ diff --git a/src/musredit/musredit.pro b/src/musredit/musredit.pro index 1c63f74a..d35f16a4 100644 --- a/src/musredit/musredit.pro +++ b/src/musredit/musredit.pro @@ -1,10 +1,6 @@ TEMPLATE = app TARGET = musredit -!exists( musredit_startup.xml ) { - error( "Configuration file musredit_startup.xml not found! Please configure musrfit first, before trying to install musredit!" ) -} - # install path for musredit count( PREFIX, 1 ) { MUSREDIT_INSTALL_PATH = $${PREFIX}/bin @@ -67,8 +63,6 @@ macx { unix:xml.path = $$(HOME)/.musrfit/musredit macx:xml.path = $$(HOME)/.musrfit/musredit win32:xml.path = c:/musrfit/bin -xml.files = musredit_startup.xml -INSTALLS += xml CONFIG += qt \ warn_on \ @@ -78,7 +72,10 @@ QT += xml QT += webkit QT += network +INCLUDEPATH += "../include" + HEADERS = musredit.h \ + musrfit-info.h \ PHelp.h \ PTextEdit.h \ PSubTextEdit.h \ @@ -101,7 +98,8 @@ HEADERS = musredit.h \ PGetFourierBlockDialog.h \ PGetPlotBlockDialog.h \ PMsr2DataDialog.h \ - PMusrEditAbout.h + PMusrEditAbout.h \ + ../include/git-revision.h SOURCES = PHelp.cpp \ PTextEdit.cpp \ diff --git a/src/musredit/musredit_startup.xml.in b/src/musredit/musredit_startup.xml.in deleted file mode 100644 index 49a0d256..00000000 --- a/src/musredit/musredit_startup.xml.in +++ /dev/null @@ -1,260 +0,0 @@ - - - - This is handling default setting parameters for the musredit. - - - @prefix@/bin - ./ - @DOCDIR@/templates - 3600 - n - n - n - y - n - y - n - n - y - - - /home/nemu/analysis/musrfit/doc/examples/test-histo-PSI-BIN.msr - - - file://@DOCDIR@/html/user/MUSR/MusrFit.html - file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheTitle - file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheFitparameterBlock - file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheTheoryBlock - file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheFunctionsBlock - file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheRunBlock - file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheCommandsBlock - file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheFourierBlock - file://@DOCDIR@/html/user/MUSR/MusrFit.html#ThePlotBlock - file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheStatisticBlock - file://@DOCDIR@/html/user/MUSR/Msr2Data.html - file://@DOCDIR@/html/user/MUSR/MusrFit.html#A_2.3_musrFT - - - Courier New - 12 - - - mue4 - psi - root-npp - y - - - y - y - n - n - n - n - y - n - n - n - n - - @DOCDIR@/latex_images - - - asymmetry - - - asymmetry.png - 1 - - - simplExpo - (rate) - - simpleExp.png - 1 - - - generExpo - (rate exponent) - - generalExp.png - 2 - - - simpleGss - (rate) - - simpleGauss.png - 1 - - - statGssKT - (rate) - - statGssKT.png - 1 - - - statGssKTLF - (frequency damping) - - - 2 - - - dynGssKTLF - (frequency damping hopping-rate) - - - 3 - - - statExpKT - (rate) - - statExpKT.png - 1 - - - statExpKTLF - (frequency damping) - - - 2 - - - dynExpKTLF - (frequency damping hopping-rate) - - - 3 - - - combiLGKT - (lorentzRate gaussRate) - - combiLGKT.png - 2 - - - strKT - (rate beta) - - - 2 - - - spinGlass - (rate hopping-rate order) - - - 3 - - - rdAnisoHf - (frequency rate) - - - 2 - - - abragam - (rate hopping-rate) - - abragam.png - 2 - - - TFieldCos - (phase frequency) - - tfCos.png - 2 - - - internFld - (fraction phase frequency Trate Lrate) - - internalField.png - 5 - - - internFldGK - (fraction frequency Trate Lrate beta) - - internalFieldGK.png - 5 - - - internFldLL - (fraction frequency Trate Lrate) - - internalFieldLL.png - 4 - - - bessel - (phase frequency) - - bessel.png - 2 - - - internBsl - (fraction phase frequency Trate Lrate) - - internalBessel.png - 5 - - - skewedGss - (phase frequency rate_m rate_p) - - - 4 - - - staticNKZF - (damping_D0 R_b) - - - 2 - - - staticNKTF - (phase frequency damping_D0 R_b) - - - 4 - - - dynamicNKZF - (damping_D0 R_b nu_c) - - - 3 - - - dynamicNKTF - (phase frequency damping_D0 R_b nu_c) - - - 5 - - - polynom - (tshift p0 p1 ... pn) - - polynom.png - 4 - - - userFcn - - - - 0 - - - diff --git a/src/musredit_qt5/PAdmin.cpp b/src/musredit_qt5/PAdmin.cpp index 340edef1..1a7755a6 100644 --- a/src/musredit_qt5/PAdmin.cpp +++ b/src/musredit_qt5/PAdmin.cpp @@ -36,9 +36,10 @@ using namespace std; #include #include #include - +#include #include +#include "musrfit-info.h" #include "PAdmin.h" //-------------------------------------------------------------------------- @@ -681,6 +682,12 @@ PAdmin::PAdmin() : QObject() // 4th: check $ROOTSYS/bin/musredit_startup.xml path = procEnv.value("ROOTSYS", ""); pathFln = path + "/bin/" + fln; + if (!QFile::exists(pathFln)) { + // 5th: not found anyware hence create it + path = procEnv.value("HOME", ""); + pathFln = path + "/.musrfit/musredit/" + fln; + createMusreditStartupFile(); + } } } } @@ -985,6 +992,302 @@ void PAdmin::saveRecentFiles() } } +//-------------------------------------------------------------------------- +/** + * @brief PAdmin::createMusreditStartupFile + */ +void PAdmin::createMusreditStartupFile() +{ + // get $HOME + QProcessEnvironment procEnv = QProcessEnvironment::systemEnvironment(); + QString pathName = procEnv.value("HOME", ""); + pathName += "/.musrfit/musredit"; + + // check if the directory $HOME/.musrfit/musredit exists if not create it + QDir dir(pathName); + if (!dir.exists()) { + // directory $HOME/.musrfit/musredit does not exist hence create it + dir.mkpath(pathName); + } + + // create default musredit_startup.xml file in $HOME/.musrfit/musredit + pathName += "/musredit_startup.xml"; + QFile file(pathName); + + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) + return; + + QTextStream fout(&file); + + fout << "" << endl; + fout << "" << endl; + fout << " " << endl; + fout << " This is handling default setting parameters for the musredit." << endl; + fout << " " << endl; + fout << " " << endl; + fout << " " << MUSRFIT_PREFIX << "/bin" << endl; + fout << " ./" << endl; + fout << " " << MUSRFIT_DOC_DIR << "/templates" << endl; + fout << " 3600" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " y" << endl; + fout << " n" << endl; + fout << " y" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " y" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " " << MUSRFIT_DOC_DIR << "/examples/test-histo-PSI-BIN.msr" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheTitle" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheFitparameterBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheTheoryBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheFunctionsBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheRunBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheCommandsBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheFourierBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#ThePlotBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheStatisticBlock" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/Msr2Data.html" << endl; + fout << " file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#A_2.3_musrFT" << endl; + fout << " " << endl; + fout << " " << endl; +#ifdef Q_OS_MAC + fout << " Courier New" << endl; + fout << " 16" << endl; +#else + fout << " Monospace" << endl; + fout << " 12" << endl; +#endif + fout << " " << endl; + fout << " " << endl; + fout << " mue4" << endl; + fout << " psi" << endl; + fout << " root-npp" << endl; + fout << " y" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " y" << endl; + fout << " y" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " y" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " n" << endl; + fout << " " << endl; + fout << " " << MUSRFIT_DOC_DIR << "/latex_images" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " asymmetry" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " asymmetry.png" << endl; + fout << " 1" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " simplExpo" << endl; + fout << " (rate)" << endl; + fout << " " << endl; + fout << " simpleExp.png" << endl; + fout << " 1" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " generExpo" << endl; + fout << " (rate exponent)" << endl; + fout << " " << endl; + fout << " generalExp.png" << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " simpleGss" << endl; + fout << " (rate)" << endl; + fout << " " << endl; + fout << " simpleGauss.png" << endl; + fout << " 1" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " statGssKT" << endl; + fout << " (rate)" << endl; + fout << " " << endl; + fout << " statGssKT.png" << endl; + fout << " 1" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " statGssKTLF" << endl; + fout << " (frequency damping)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " dynGssKTLF" << endl; + fout << " (frequency damping hopping-rate)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 3" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " statExpKT" << endl; + fout << " (rate)" << endl; + fout << " " << endl; + fout << " statExpKT.png" << endl; + fout << " 1" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " statExpKTLF" << endl; + fout << " (frequency damping)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " dynExpKTLF" << endl; + fout << " (frequency damping hopping-rate)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 3" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " combiLGKT" << endl; + fout << " (lorentzRate gaussRate)" << endl; + fout << " " << endl; + fout << " combiLGKT.png" << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " strKT" << endl; + fout << " (rate beta)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " spinGlass" << endl; + fout << " (rate hopping-rate order)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 3" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " rdAnisoHf" << endl; + fout << " (frequency rate)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " abragam" << endl; + fout << " (rate hopping-rate)" << endl; + fout << " " << endl; + fout << " abragam.png" << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " TFieldCos" << endl; + fout << " (phase frequency)" << endl; + fout << " " << endl; + fout << " tfCos.png" << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " internFld" << endl; + fout << " (fraction phase frequency Trate Lrate)" << endl; + fout << " " << endl; + fout << " internalField.png" << endl; + fout << " 5" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " internFldGK" << endl; + fout << " (fraction frequency Trate Lrate beta)" << endl; + fout << " " << endl; + fout << " internalFieldGK.png" << endl; + fout << " 5" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " internFldLL" << endl; + fout << " (fraction frequency Trate Lrate)" << endl; + fout << " " << endl; + fout << " internalFieldLL.png" << endl; + fout << " 4" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " bessel" << endl; + fout << " (phase frequency)" << endl; + fout << " " << endl; + fout << " bessel.png" << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " internBsl" << endl; + fout << " (fraction phase frequency Trate Lrate)" << endl; + fout << " " << endl; + fout << " internalBessel.png" << endl; + fout << " 5" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " skewedGss" << endl; + fout << " (phase frequency rate_m rate_p)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 4" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " staticNKZF" << endl; + fout << " (damping_D0 R_b)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 2" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " staticNKTF" << endl; + fout << " (phase frequency damping_D0 R_b)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 4" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " dynamicNKZF" << endl; + fout << " (damping_D0 R_b nu_c)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 3" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " dynamicNKTF" << endl; + fout << " (phase frequency damping_D0 R_b nu_c)" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 5" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " polynom" << endl; + fout << " (tshift p0 p1 ... pn)" << endl; + fout << " " << endl; + fout << " polynom.png" << endl; + fout << " 4" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " userFcn" << endl; + fout << " " << endl; + fout << " " << endl; + fout << " " << endl; + fout << " 0" << endl; + fout << " " << endl; + fout << " " << endl; + fout << "" << endl; + + file.close(); +} + //-------------------------------------------------------------------------- // END //-------------------------------------------------------------------------- diff --git a/src/musredit_qt5/PAdmin.h b/src/musredit_qt5/PAdmin.h index b966ef78..d9b05051 100644 --- a/src/musredit_qt5/PAdmin.h +++ b/src/musredit_qt5/PAdmin.h @@ -209,6 +209,7 @@ class PAdmin : public QObject QVector fTheory; ///< stores all known theories. Needed when generating theory blocks from within musredit. void saveRecentFiles(); ///< save recent file list + void createMusreditStartupFile(); ///< create default musredit_startup.xml }; #endif // _PADMIN_H_ diff --git a/src/musredit_qt5/musredit.pro b/src/musredit_qt5/musredit.pro index eaf8062c..9d351027 100644 --- a/src/musredit_qt5/musredit.pro +++ b/src/musredit_qt5/musredit.pro @@ -1,10 +1,6 @@ TEMPLATE = app TARGET = musredit -!exists( musredit_startup.xml ) { - error( "Configuration file musredit_startup.xml not found! Please configure musrfit first, before trying to install musredit!" ) -} - # install path for musredit count( PREFIX, 1 ) { MUSREDIT_INSTALL_PATH = $${PREFIX}/bin @@ -67,8 +63,6 @@ macx { unix:xml.path = $$(HOME)/.musrfit/musredit macx:xml.path = $$(HOME)/.musrfit/musredit win32:xml.path = c:/musrfit/bin -xml.files = musredit_startup.xml -INSTALLS += xml CONFIG += qt \ warn_on \ @@ -84,6 +78,7 @@ QT += svg INCLUDEPATH += "../include" HEADERS = musredit.h \ + musrfit-info.h \ PHelp.h \ PTextEdit.h \ PSubTextEdit.h \ diff --git a/src/musredit_qt5/musredit_startup.xml.in b/src/musredit_qt5/musredit_startup.xml.in deleted file mode 100644 index 0c0a859e..00000000 --- a/src/musredit_qt5/musredit_startup.xml.in +++ /dev/null @@ -1,260 +0,0 @@ - - - - This is handling default setting parameters for the musredit. - - - @prefix@/bin - ./ - @DOCDIR@/templates - 3600 - n - n - n - y - n - y - n - n - y - - - /home/nemu/analysis/musrfit/doc/examples/test-histo-PSI-BIN.msr - - - file://@DOCDIR@/html/user/MUSR/MusrFit.html - file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheTitle - file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheFitparameterBlock - file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheTheoryBlock - file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheFunctionsBlock - file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheRunBlock - file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheCommandsBlock - file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheFourierBlock - file://@DOCDIR@/html/user/MUSR/MusrFit.html#ThePlotBlock - file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheStatisticBlock - file://@DOCDIR@/html/user/MUSR/Msr2Data.html - file://@DOCDIR@/html/user/MUSR/MusrFit.html#A_2.3_musrFT - - - Monospace - 12 - - - mue4 - psi - root-npp - y - - - y - y - n - n - n - n - y - n - n - n - n - - @DOCDIR@/latex_images - - - asymmetry - - - asymmetry.png - 1 - - - simplExpo - (rate) - - simpleExp.png - 1 - - - generExpo - (rate exponent) - - generalExp.png - 2 - - - simpleGss - (rate) - - simpleGauss.png - 1 - - - statGssKT - (rate) - - statGssKT.png - 1 - - - statGssKTLF - (frequency damping) - - - 2 - - - dynGssKTLF - (frequency damping hopping-rate) - - - 3 - - - statExpKT - (rate) - - statExpKT.png - 1 - - - statExpKTLF - (frequency damping) - - - 2 - - - dynExpKTLF - (frequency damping hopping-rate) - - - 3 - - - combiLGKT - (lorentzRate gaussRate) - - combiLGKT.png - 2 - - - strKT - (rate beta) - - - 2 - - - spinGlass - (rate hopping-rate order) - - - 3 - - - rdAnisoHf - (frequency rate) - - - 2 - - - abragam - (rate hopping-rate) - - abragam.png - 2 - - - TFieldCos - (phase frequency) - - tfCos.png - 2 - - - internFld - (fraction phase frequency Trate Lrate) - - internalField.png - 5 - - - internFldGK - (fraction frequency Trate Lrate beta) - - internalFieldGK.png - 5 - - - internFldLL - (fraction frequency Trate Lrate) - - internalFieldLL.png - 4 - - - bessel - (phase frequency) - - bessel.png - 2 - - - internBsl - (fraction phase frequency Trate Lrate) - - internalBessel.png - 5 - - - skewedGss - (phase frequency rate_m rate_p) - - - 4 - - - staticNKZF - (damping_D0 R_b) - - - 2 - - - staticNKTF - (phase frequency damping_D0 R_b) - - - 4 - - - dynamicNKZF - (damping_D0 R_b nu_c) - - - 3 - - - dynamicNKTF - (phase frequency damping_D0 R_b nu_c) - - - 5 - - - polynom - (tshift p0 p1 ... pn) - - polynom.png - 4 - - - userFcn - - - - 0 - - -