diff --git a/src/musredit/PMusrEditAbout.cpp b/src/musredit/PMusrEditAbout.cpp index d7b8fbdf..4f6de382 100644 --- a/src/musredit/PMusrEditAbout.cpp +++ b/src/musredit/PMusrEditAbout.cpp @@ -33,7 +33,7 @@ //--------------------------------------------------------------------------- /** - *
+ *
Handles the musredit about popup. */ PMusrEditAbout::PMusrEditAbout(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) { diff --git a/src/musredit/PPrefsDialog.cpp b/src/musredit/PPrefsDialog.cpp index b2f37475..c5127305 100644 --- a/src/musredit/PPrefsDialog.cpp +++ b/src/musredit/PPrefsDialog.cpp @@ -33,7 +33,15 @@ //---------------------------------------------------------------------------------------------------- /** - *
+ *
Constructor.
+ *
+ * \param keep_mn2_output if true, keep the minuit2 output for each fitted msr-file, i.e.
+ * MINUIT2.OUTPUT ->
+ * returns the dump flag (see the '--dump' option of musrfit). 0 == no dump, 1 == ascii dump, 2 == root dump
*/
int PPrefsDialog::getDump()
{
@@ -80,7 +88,8 @@ int PPrefsDialog::getDump()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * SLOT: called when the QCheckBox 'dump ascii' is selected. Will uncheck 'dump root' since these
+ * two options are mutually exclusive.
*/
void PPrefsDialog::dumpAscii()
{
@@ -90,7 +99,8 @@ void PPrefsDialog::dumpAscii()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * SLOT: called when the QCheckBox 'dump root' is selected. Will uncheck 'dump ascii' since these
+ * two options are mutually exclusive.
*/
void PPrefsDialog::dumpRoot()
{
diff --git a/src/musredit/PPrefsDialog.h b/src/musredit/PPrefsDialog.h
index 36ecd79f..07832de9 100644
--- a/src/musredit/PPrefsDialog.h
+++ b/src/musredit/PPrefsDialog.h
@@ -36,6 +36,9 @@
#include "ui_PPrefsDialog.h"
+/**
+ * Class handling the content of the MusrFit/Preferences.
+ */
class PPrefsDialog : public QDialog, private Ui::PPrefsDialog
{
Q_OBJECT
diff --git a/src/musredit/PReplaceConfirmationDialog.cpp b/src/musredit/PReplaceConfirmationDialog.cpp
index 39353303..b9b3985c 100644
--- a/src/musredit/PReplaceConfirmationDialog.cpp
+++ b/src/musredit/PReplaceConfirmationDialog.cpp
@@ -33,7 +33,10 @@
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Constructor.
+ *
+ * \param parent pointer to the parent object
+ * \param f qt windows flags
*/
PReplaceConfirmationDialog::PReplaceConfirmationDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f)
{
diff --git a/src/musredit/PReplaceDialog.cpp b/src/musredit/PReplaceDialog.cpp
index 70756cc6..8c9a9a33 100644
--- a/src/musredit/PReplaceDialog.cpp
+++ b/src/musredit/PReplaceDialog.cpp
@@ -37,7 +37,12 @@
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Constructor.
+ *
+ * \param data find/replace data structure
+ * \param selection if true, find/replace only of the selection
+ * \param parent pointer to the parent object
+ * \param f qt windows flag
*/
PReplaceDialog::PReplaceDialog(PFindReplaceData *data, const bool selection, QWidget *parent, Qt::WindowFlags f) :
QDialog(parent, f), fData(data)
@@ -72,7 +77,7 @@ PReplaceDialog::PReplaceDialog(PFindReplaceData *data, const bool selection, QWi
//----------------------------------------------------------------------------------------------------
/**
- *
+ * returns the pointer to the find/replace data structure which is updated from the GUI content.
*/
PFindReplaceData* PReplaceDialog::getData()
{
@@ -91,7 +96,7 @@ PFindReplaceData* PReplaceDialog::getData()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * SLOT: called on find text available.
*/
void PReplaceDialog::onFindTextAvailable(const QString&)
{
diff --git a/src/musredit/PReplaceDialog.h b/src/musredit/PReplaceDialog.h
index feb94bf8..15781ade 100644
--- a/src/musredit/PReplaceDialog.h
+++ b/src/musredit/PReplaceDialog.h
@@ -49,7 +49,7 @@ class PReplaceDialog : public QDialog, private Ui::PReplaceDialog
virtual void onFindTextAvailable(const QString&);
private:
- PFindReplaceData *fData;
+ PFindReplaceData *fData; ///< pointer to the find/replace data
};
#endif // _PREPLACEDIALOG_H_
diff --git a/src/musredit/PSubTextEdit.cpp b/src/musredit/PSubTextEdit.cpp
index a6892258..1e257e7e 100644
--- a/src/musredit/PSubTextEdit.cpp
+++ b/src/musredit/PSubTextEdit.cpp
@@ -53,100 +53,20 @@
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Constructor.
+ *
+ * \param admin pointer to the musredit internal administration object.
+ * \param parent pointer to the parent object.
*/
PSubTextEdit::PSubTextEdit(PAdmin *admin, QWidget *parent) :
QPlainTextEdit(parent),
fAdmin(admin)
{
-// fLastModified = QDateTime::fromString("1900-01-01 00:00:00");
}
//----------------------------------------------------------------------------------------------------
/**
- *
- */
-QMenu* PSubTextEdit::createPopupMenu(const QPoint &pos)
-{
- QMenu *menu = new QMenu( this );
- QMenu *theoryFunctions = new QMenu( menu );
-
- QAction *a;
- a = new QAction( tr("insert Title"), this);
- a->setStatusTip( tr("insert a title") );
- connect(a, SIGNAL( activated() ), this, SLOT( insertTitle() ));
- menu->addAction(a);
-
- a = new QAction(tr("insert Parameter Block"), this);
- a->setStatusTip( tr("insert a parameter block") );
- connect(a, SIGNAL( activated() ), this, SLOT( insertParameterBlock() ));
- menu->addAction(a);
-
- // feed the theoryFunctions popup menu
- for (unsigned int i=0; i
+ * Starts the msr-title input dialog window.
*/
void PSubTextEdit::insertTitle()
{
@@ -166,7 +86,7 @@ void PSubTextEdit::insertTitle()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Starts the msr-fit-parameter input dialog window.
*/
void PSubTextEdit::insertParameterBlock()
{
@@ -185,20 +105,26 @@ void PSubTextEdit::insertParameterBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Inserts the selected theory item.
+ *
+ * \param name of the theory item to be added.
*/
-void PSubTextEdit::insertTheoryFunction(int idx)
+void PSubTextEdit::insertTheoryFunction(QString name)
{
- if (idx < 300)
- return;
-
- int index = idx - 300;
-
- if (index >= (int)fAdmin->getTheoryCounts())
- return;
-
QString str = "????";
- PTheory *theoItem = fAdmin->getTheoryItem(index);
+
+ int idx = -1;
+ for (unsigned int i=0; i
+ * Starts the msr-theory input dialog window.
*/
void PSubTextEdit::insertTheoryBlock()
{
@@ -244,7 +170,7 @@ void PSubTextEdit::insertTheoryBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Starts the msr-functions input dialog window.
*/
void PSubTextEdit::insertFunctionBlock()
{
@@ -264,7 +190,7 @@ void PSubTextEdit::insertFunctionBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Starts the msr-asymmetry-run input dialog window.
*/
void PSubTextEdit::insertAsymRunBlock()
{
@@ -371,7 +297,7 @@ void PSubTextEdit::insertAsymRunBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Starts the msr-single-historgram-run input dialog window.
*/
void PSubTextEdit::insertSingleHistRunBlock()
{
@@ -478,7 +404,7 @@ void PSubTextEdit::insertSingleHistRunBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Starts the msr-nonMusr-run input dialog window.
*/
void PSubTextEdit::insertNonMusrRunBlock()
{
@@ -541,7 +467,7 @@ void PSubTextEdit::insertNonMusrRunBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Insert the command block.
*/
void PSubTextEdit::insertCommandBlock()
{
@@ -557,7 +483,7 @@ void PSubTextEdit::insertCommandBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Starts the msr-Fourier input dialog window.
*/
void PSubTextEdit::insertFourierBlock()
{
@@ -576,7 +502,7 @@ void PSubTextEdit::insertFourierBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Starts the msr-plot input dialog window.
*/
void PSubTextEdit::insertPlotBlock()
{
@@ -595,7 +521,7 @@ void PSubTextEdit::insertPlotBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Insert a default msr-statistics block.
*/
void PSubTextEdit::insertStatisticBlock()
{
diff --git a/src/musredit/PSubTextEdit.h b/src/musredit/PSubTextEdit.h
index 8d9cee9e..0df7dd0e 100644
--- a/src/musredit/PSubTextEdit.h
+++ b/src/musredit/PSubTextEdit.h
@@ -37,6 +37,10 @@
#include "PAdmin.h"
+//------------------------------------------------------------------------------------------
+/**
+ * Class handling a single text edit tab within musredit.
+ */
class PSubTextEdit : public QPlainTextEdit
{
Q_OBJECT
@@ -45,13 +49,10 @@ class PSubTextEdit : public QPlainTextEdit
PSubTextEdit(PAdmin *admin = 0, QWidget *parent = 0);
virtual ~PSubTextEdit() {}
-// void setLastModified(const QDateTime &lastModified) { fLastModified = lastModified; }
-// QDateTime getLastModified() const { return fLastModified; }
-
public slots:
void insertTitle();
void insertParameterBlock();
- void insertTheoryFunction(int idx);
+ void insertTheoryFunction(QString name);
void insertTheoryBlock();
void insertFunctionBlock();
void insertAsymRunBlock();
@@ -62,12 +63,8 @@ class PSubTextEdit : public QPlainTextEdit
void insertPlotBlock();
void insertStatisticBlock();
- protected:
- virtual QMenu *createPopupMenu( const QPoint &pos);
-
private:
- PAdmin *fAdmin;
-// QDateTime fLastModified;
+ PAdmin *fAdmin; ///< pointer to the administration object which holds working-, executable-paths etc.
};
#endif // _PSUBTEXTEDIT_H_
diff --git a/src/musredit/PTextEdit.cpp b/src/musredit/PTextEdit.cpp
index d36f59b2..2a35c3b2 100644
--- a/src/musredit/PTextEdit.cpp
+++ b/src/musredit/PTextEdit.cpp
@@ -75,13 +75,18 @@ using namespace std;
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Constructor
+ *
+ * \param parent pointer to the parent object
+ * \param f qt windows flags
*/
PTextEdit::PTextEdit( QWidget *parent, Qt::WindowFlags f )
: QMainWindow( parent, f )
{
+ // reads and manages the conents of the xml-startup (musredit_startup.xml) file
fAdmin = new PAdmin();
+ // enable file system watcher. Needed to get notification if the msr-file is changed outside of musrfit at runtime
fFileSystemWatcherActive = true;
fFileSystemWatcher = new QFileSystemWatcher();
if (fFileSystemWatcher == 0) {
@@ -90,6 +95,7 @@ PTextEdit::PTextEdit( QWidget *parent, Qt::WindowFlags f )
connect( fFileSystemWatcher, SIGNAL(fileChanged(const QString&)), this, SLOT(fileChanged(const QString&)));
}
+ // initialize stuff
fMusrT0Action = 0;
fMsr2DataParam = 0;
@@ -100,6 +106,7 @@ PTextEdit::PTextEdit( QWidget *parent, Qt::WindowFlags f )
fEnableMusrT0 = fAdmin->getEnableMusrT0Flag();
fDump = 0; // 0 = no dump, 1 = ascii dump, 2 = root dump
+ // setup menus
setupFileActions();
setupEditActions();
setupTextActions();
@@ -116,6 +123,7 @@ PTextEdit::PTextEdit( QWidget *parent, Qt::WindowFlags f )
QPixmap image0(":/images/musrfit.xpm");
setWindowIcon( image0 );
+ // if arguments are give, try to load those files, otherwise create an empty new file
if ( qApp->argc() != 1 ) {
for ( int i = 1; i < qApp->argc(); ++i )
load( qApp->argv()[ i ] );
@@ -128,7 +136,7 @@ PTextEdit::PTextEdit( QWidget *parent, Qt::WindowFlags f )
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Destructor
*/
PTextEdit::~PTextEdit()
{
@@ -158,7 +166,7 @@ PTextEdit::~PTextEdit()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Setup the file menu and the necessary actions.
*/
void PTextEdit::setupFileActions()
{
@@ -244,7 +252,7 @@ void PTextEdit::setupFileActions()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Setup the edit menu and the necessary actions.
*/
void PTextEdit::setupEditActions()
{
@@ -355,6 +363,15 @@ void PTextEdit::setupEditActions()
connect( a, SIGNAL( triggered() ), this, SLOT( insertFunctionBlock() ));
addSubMenu->addAction(a);
+ // feed the theoryFunctions popup menu
+ QMenu *theoryFunctions = new QMenu( tr("Add Theory Function"), this );
+ for (unsigned int i=0; i
+ * Setup the font/font size menu.
*/
void PTextEdit::setupTextActions()
{
@@ -449,7 +467,7 @@ void PTextEdit::setupTextActions()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Setup the musrfit menu and the necessary actions.
*/
void PTextEdit::setupMusrActions()
{
@@ -534,7 +552,7 @@ void PTextEdit::setupMusrActions()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Setup the help menu and the necessary actions.
*/
void PTextEdit::setupHelpActions()
{
@@ -560,18 +578,22 @@ void PTextEdit::setupHelpActions()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * load an msr-file.
+ *
+ * \param f filename
+ * \param index if == -1, add the file as a new tab, otherwise, replace the contents of the tab at index.
*/
void PTextEdit::load( const QString &f, const int index )
{
+ // check if the file exists
if ( !QFile::exists( f ) )
return;
-// QFileInfo info(f);
-
+ // create a new text edit object
PSubTextEdit *edit = new PSubTextEdit( fAdmin );
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
+ // place the text edit object at the appropriate tab position
if (index == -1)
fTabWidget->addTab( edit, QFileInfo( f ).fileName() );
else
@@ -580,22 +602,27 @@ void PTextEdit::load( const QString &f, const int index )
if ( !file.open( QIODevice::ReadOnly ) )
return;
+ // add the msr-file to the file system watchersssss
fFileSystemWatcher->addPath(f);
+ // read the file
QTextStream ts( &file );
QString txt = ts.readAll();
edit->setPlainText( txt );
- doConnections( edit );
+ doConnections( edit ); // add all necessary signal/slot connections
+ // set the tab widget to the current tab
fTabWidget->setCurrentIndex(fTabWidget->indexOf(edit));
edit->viewport()->setFocus();
+
+ // update the filename mapper
fFilenames.remove( edit );
fFilenames.insert( edit, f );
}
//----------------------------------------------------------------------------------------------------
/**
- *
+ * returns the currently tab selected textedit object.
*/
PSubTextEdit *PTextEdit::currentEditor() const
{
@@ -610,7 +637,9 @@ PSubTextEdit *PTextEdit::currentEditor() const
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Setup the necessray signal/slot connections for the textedit object.
+ *
+ * \param e textedit object
*/
void PTextEdit::doConnections( PSubTextEdit *e )
{
@@ -624,7 +653,9 @@ void PTextEdit::doConnections( PSubTextEdit *e )
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Validates a given runlist.
+ *
+ * \param runList run list string which should be a space separated list of run numbers.
*/
bool PTextEdit::validRunList(const QString runList)
{
@@ -658,7 +689,7 @@ bool PTextEdit::validRunList(const QString runList)
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Start the dialog to enter a msr-file title. See also https://intranet.psi.ch/MUSR/MusrFit#4_1_The_Title
*/
void PTextEdit::insertTitle()
{
@@ -667,7 +698,7 @@ void PTextEdit::insertTitle()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Start the dialog to enter a msr-file fit-parameter block. See also https://intranet.psi.ch/MUSR/MusrFit#4_2_The_FITPARAMETER_Block
*/
void PTextEdit::insertParameterBlock()
{
@@ -676,7 +707,7 @@ void PTextEdit::insertParameterBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Start the dialog to enter a msr-file theory block. See also https://intranet.psi.ch/MUSR/MusrFit#4_3_The_THEORY_Block
*/
void PTextEdit::insertTheoryBlock()
{
@@ -685,7 +716,18 @@ void PTextEdit::insertTheoryBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Insert a selected theory function. See also https://intranet.psi.ch/MUSR/MusrFit#4_3_The_THEORY_Block
+ *
+ * \param a action of the selected theory function
+ */
+void PTextEdit::insertTheoryFunction(QAction *a)
+{
+ currentEditor()->insertTheoryFunction(a->text());
+}
+
+//----------------------------------------------------------------------------------------------------
+/**
+ * Start the dialog to enter a msr-file function block. See also https://intranet.psi.ch/MUSR/MusrFit#4_4_The_FUNCTIONS_Block
*/
void PTextEdit::insertFunctionBlock()
{
@@ -694,7 +736,7 @@ void PTextEdit::insertFunctionBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Start the dialog to enter a msr-file asymmetry run block. See also https://intranet.psi.ch/MUSR/MusrFit#4_5_The_RUN_Block
*/
void PTextEdit::insertAsymRunBlock()
{
@@ -703,7 +745,7 @@ void PTextEdit::insertAsymRunBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Start the dialog to enter a msr-file single histogram run block. See also https://intranet.psi.ch/MUSR/MusrFit#4_5_The_RUN_Block
*/
void PTextEdit::insertSingleHistRunBlock()
{
@@ -712,7 +754,7 @@ void PTextEdit::insertSingleHistRunBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Start the dialog to enter a msr-file nonMusr run block. See also https://intranet.psi.ch/MUSR/MusrFit#4_5_The_RUN_Block
*/
void PTextEdit::insertNonMusrRunBlock()
{
@@ -721,7 +763,7 @@ void PTextEdit::insertNonMusrRunBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Inserts a default command block. See also https://intranet.psi.ch/MUSR/MusrFit#4_6_The_COMMANDS_Block
*/
void PTextEdit::insertCommandBlock()
{
@@ -730,7 +772,7 @@ void PTextEdit::insertCommandBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Start the dialog to enter a msr-file Fourier block. See also https://intranet.psi.ch/MUSR/MusrFit#4_7_The_FOURIER_Block
*/
void PTextEdit::insertFourierBlock()
{
@@ -739,7 +781,7 @@ void PTextEdit::insertFourierBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Start the dialog to enter a msr-file plot block. See also https://intranet.psi.ch/MUSR/MusrFit#4_7_The_PLOT_Block
*/
void PTextEdit::insertPlotBlock()
{
@@ -748,7 +790,7 @@ void PTextEdit::insertPlotBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Inserts a default statistics block. See also https://intranet.psi.ch/MUSR/MusrFit#4_9_The_STATISTIC_Block
*/
void PTextEdit::insertStatisticBlock()
{
@@ -757,7 +799,7 @@ void PTextEdit::insertStatisticBlock()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * SLOT: called when File/New is selected. Will generate an empty tab-textedit field in musredit.
*/
void PTextEdit::fileNew()
{
@@ -772,7 +814,9 @@ void PTextEdit::fileNew()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * SLOT: called when File/Open is selected. Will open an msr-/mlog-file. It checks if the file is
+ * already open, and if so will just select the current tab. If you want to reload the file use the
+ * fileReload() slot.
*/
void PTextEdit::fileOpen()
{
@@ -810,7 +854,7 @@ void PTextEdit::fileOpen()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Will reload the currently selected msr-file.
*/
void PTextEdit::fileReload()
{
@@ -826,7 +870,7 @@ void PTextEdit::fileReload()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Will save the currently selected file.
*/
void PTextEdit::fileSave()
{
@@ -854,7 +898,8 @@ void PTextEdit::fileSave()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Will open a file selector dialog to obtain a file name, and then save the file under the newly
+ * selected file name.
*/
void PTextEdit::fileSaveAs()
{
@@ -878,7 +923,7 @@ void PTextEdit::fileSaveAs()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Will call a print dialog and print the msr-file.
*/
void PTextEdit::filePrint()
{
@@ -927,7 +972,10 @@ void PTextEdit::filePrint()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Will remove a textedit tab from musredit. Depending on check it will done with or without checking
+ * if the file has been saved before.
+ *
+ * \param check if set to true, a warning dialog will popup if the file is not saved yet.
*/
void PTextEdit::fileClose(const bool check)
{
@@ -952,7 +1000,8 @@ void PTextEdit::fileClose(const bool check)
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Removes all textedit tabs from musredit. It checks if the files haven't been saved, and if so it will
+ * popup a warning dialog.
*/
void PTextEdit::fileCloseAll()
{
@@ -988,7 +1037,8 @@ void PTextEdit::fileCloseAll()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Will close all textedit tabs but the selected one. It checks if the files haven't been saved, and if so it will
+ * popup a warning dialog.
*/
void PTextEdit::fileCloseAllOthers()
{
@@ -1035,7 +1085,7 @@ void PTextEdit::fileCloseAllOthers()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Will quit musredit.
*/
void PTextEdit::fileExit()
{
@@ -1056,7 +1106,7 @@ void PTextEdit::fileExit()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Text undo of the current textedit tab.
*/
void PTextEdit::editUndo()
{
@@ -1067,7 +1117,7 @@ void PTextEdit::editUndo()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Text redo of the current textedit tab
*/
void PTextEdit::editRedo()
{
@@ -1078,7 +1128,7 @@ void PTextEdit::editRedo()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Select all text of the current textedit tab.
*/
void PTextEdit::editSelectAll()
{
@@ -1089,7 +1139,7 @@ void PTextEdit::editSelectAll()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Cut the selection of the current textedit tab.
*/
void PTextEdit::editCut()
{
@@ -1100,7 +1150,7 @@ void PTextEdit::editCut()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Copy the selection of the current textedit tab.
*/
void PTextEdit::editCopy()
{
@@ -1111,7 +1161,7 @@ void PTextEdit::editCopy()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Paste at the cursor position of the current textedit tab.
*/
void PTextEdit::editPaste()
{
@@ -1122,7 +1172,7 @@ void PTextEdit::editPaste()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Starts a find dialog, and searches for a find string.
*/
void PTextEdit::editFind()
{
@@ -1182,7 +1232,7 @@ void PTextEdit::editFind()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Searches for a find string in the forward direction.
*/
void PTextEdit::editFindNext()
{
@@ -1197,7 +1247,7 @@ void PTextEdit::editFindNext()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Searches for a find string in the backward direction.
*/
void PTextEdit::editFindPrevious()
{
@@ -1214,7 +1264,7 @@ void PTextEdit::editFindPrevious()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Starts a find/replace dialog, and searches for a find string and replaces it depending of the replace options.
*/
void PTextEdit::editFindAndReplace()
{
@@ -1273,7 +1323,8 @@ void PTextEdit::editFindAndReplace()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Comment a selection, i.e. add a '#' character in front of each line of the selection.
+ * (Multiple selections not yet supported).
*/
void PTextEdit::editComment()
{
@@ -1307,7 +1358,8 @@ void PTextEdit::editComment()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Uncomment a selection, i.e. remove a '#' character in front of each line of the selection.
+ * (Multiple selections not yet supported).
*/
void PTextEdit::editUncomment()
{
@@ -1361,7 +1413,9 @@ void PTextEdit::editUncomment()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Chances the font.
+ *
+ * \param f font name
*/
void PTextEdit::textFamily( const QString &f )
{
@@ -1376,7 +1430,9 @@ void PTextEdit::textFamily( const QString &f )
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Chances the font size.
+ *
+ * \param p font size in points.
*/
void PTextEdit::textSize( const QString &p )
{
@@ -1391,7 +1447,7 @@ void PTextEdit::textSize( const QString &p )
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Loads a default asymmetry msr-file.
*/
void PTextEdit::musrGetAsymmetryDefault()
{
@@ -1452,7 +1508,7 @@ void PTextEdit::musrGetAsymmetryDefault()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Loads a default single histogram msr-file.
*/
void PTextEdit::musrGetSingleHistoDefault()
{
@@ -1513,7 +1569,7 @@ void PTextEdit::musrGetSingleHistoDefault()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * calls musrfit --chisq-only
+ * calls musrfit
+ * Starts a msr2data input dialog which collects all the necessary data before calling msr2data.
*/
void PTextEdit::musrMsr2Data()
{
@@ -1930,7 +1986,7 @@ cout << endl;
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Calls musrview
+ * Callse musrt0
+ * Calls the preferences dialog which is used to set some global options.
*/
void PTextEdit::musrPrefs()
{
@@ -2018,7 +2074,7 @@ void PTextEdit::musrPrefs()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Swaps the currently open msr-file with its mlog-file (if present) and updates musredit accordingly.
*/
void PTextEdit::musrSwapMsrMlog()
{
@@ -2094,7 +2150,7 @@ void PTextEdit::musrSwapMsrMlog()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Starts the help content browser.
*/
void PTextEdit::helpContents()
{
@@ -2105,7 +2161,7 @@ void PTextEdit::helpContents()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Starts the help about info box.
*/
void PTextEdit::helpAbout()
{
@@ -2115,7 +2171,7 @@ void PTextEdit::helpAbout()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * Starts the help about Qt info box.
*/
void PTextEdit::helpAboutQt()
{
@@ -2124,7 +2180,9 @@ void PTextEdit::helpAboutQt()
//----------------------------------------------------------------------------------------------------
/**
- *
+ * SLOT: called when the font shall be changed.
+ *
+ * \param f font object
*/
void PTextEdit::fontChanged( const QFont &f )
{
@@ -2144,6 +2202,8 @@ void PTextEdit::fontChanged( const QFont &f )
//----------------------------------------------------------------------------------------------------
/**
*
+ *
+ * \param forced
*/
void PTextEdit::textChanged(const bool forced)
{
@@ -2284,14 +2344,14 @@ void PTextEdit::fileChanged(const QString &fileName)
//----------------------------------------------------------------------------------------------------
/**
* .Delayed reactivation of file system watcher, needed when saving files. At the moment the delay
- * is set to 1000 ms.
+ * is set to 2000 ms.
*/
void PTextEdit::fileSystemWatcherActivation()
{
if (fFileSystemWatcherTimeout.isActive())
return;
- fFileSystemWatcherTimeout.singleShot(1000, this, SLOT(setFileSystemWatcherActive()));
+ fFileSystemWatcherTimeout.singleShot(2000, this, SLOT(setFileSystemWatcherActive()));
}
//----------------------------------------------------------------------------------------------------
diff --git a/src/musredit/PTextEdit.h b/src/musredit/PTextEdit.h
index 9d33025d..a4e4d868 100644
--- a/src/musredit/PTextEdit.h
+++ b/src/musredit/PTextEdit.h
@@ -47,6 +47,10 @@ class QTabWidget;
class QTextEdit;
class QMenu;
+//----------------------------------------------------------------------------------------------
+/**
+ * Main class for musredit.
+ */
class PTextEdit : public QMainWindow
{
Q_OBJECT
@@ -74,6 +78,7 @@ private slots:
void insertTitle();
void insertParameterBlock();
void insertTheoryBlock();
+ void insertTheoryFunction(QAction *a);
void insertFunctionBlock();
void insertAsymRunBlock();
void insertSingleHistRunBlock();
@@ -137,27 +142,27 @@ private slots:
void setFileSystemWatcherActive();
private:
- PAdmin *fAdmin;
- QFileSystemWatcher *fFileSystemWatcher;
- bool fFileSystemWatcherActive;
- QTimer fFileSystemWatcherTimeout;
+ PAdmin *fAdmin; ///< pointer to the xml-startup file informations. Needed for different purposes like default working- and executable directories etc.
+ QFileSystemWatcher *fFileSystemWatcher; ///< checks if msr-files are changing on the disk while being open in musredit.
+ bool fFileSystemWatcherActive; ///< flag to enable/disable the file system watcher
+ QTimer fFileSystemWatcherTimeout; ///< timer used to re-enable file system watcher. Needed to delay the re-enabling
QAction *fMusrT0Action;
- bool fKeepMinuit2Output;
- bool fTitleFromDataFile;
- bool fEnableMusrT0;
- int fDump;
+ bool fKeepMinuit2Output; ///< 'global' flag, if set to true, musrfit calls will keep the minuit2 output files.
+ bool fTitleFromDataFile; ///< 'global' flag, if set to true, musrfit will take the title from the data file instead of the msr-file.
+ bool fEnableMusrT0; ///< 'global' flag, if set to true, musrt0 will be enabled
+ int fDump; ///< 'global' tag for musrfit calls: 0 == no dump, 1 == ascii dump, 2 == root dump
- PMsr2DataParam *fMsr2DataParam;
- PFindReplaceData *fFindReplaceData;
+ PMsr2DataParam *fMsr2DataParam; ///< structure holding the necessary input information for msr2data
+ PFindReplaceData *fFindReplaceData; ///< structure holding the ncessary input for find/replace
- QComboBox *fComboFont;
- QComboBox *fComboSize;
+ QComboBox *fComboFont; ///< combo box for the font selector
+ QComboBox *fComboSize; ///< combo box for the font size
bool fFontChanging; ///< flag needed to prevent some textChanged feature to occure when only the font changed
- QTabWidget *fTabWidget;
- QMap