Show measurement database.
--HG-- branch : feature
This commit is contained in:
parent
58f013cd1e
commit
78329af822
|
@ -52,9 +52,9 @@ DialogMDataBase::DialogMDataBase(QWidget *parent)
|
|||
list()
|
||||
|
||||
{
|
||||
ui->setupUi(this);
|
||||
InitDataBase();
|
||||
|
||||
connect(ui->treeWidget, &QTreeWidget::itemChanged, this, &DialogMDataBase::UpdateChecks);
|
||||
connect(ui->treeWidget, &QTreeWidget::itemClicked, this, &DialogMDataBase::ShowDescription);
|
||||
}
|
||||
|
||||
|
@ -635,9 +635,9 @@ void DialogMDataBase::AddMeasurement(QTreeWidgetItem *group, const QString &name
|
|||
{
|
||||
m->setCheckState(0, Qt::Unchecked);
|
||||
}
|
||||
}
|
||||
|
||||
UpdateChecks(m, 0);
|
||||
UpdateChecks(m, 0);
|
||||
}
|
||||
|
||||
const QString text = qApp->TrVars()->MNumber(name) + ". " + qApp->TrVars()->MToUser(name);
|
||||
m->setText(0, text);
|
||||
|
|
|
@ -36,13 +36,15 @@
|
|||
#include <QLocalSocket>
|
||||
#include <QResource>
|
||||
#include <QTranslator>
|
||||
#include <QPointer>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
MApplication::MApplication(int &argc, char **argv)
|
||||
:VAbstractApplication(argc, argv),
|
||||
mainWindows(),
|
||||
localServer(nullptr),
|
||||
trVars(nullptr)
|
||||
trVars(nullptr),
|
||||
dataBase(QPointer<DialogMDataBase>())
|
||||
{
|
||||
setApplicationDisplayName(VER_PRODUCTNAME_STR);
|
||||
setApplicationName(VER_INTERNALNAME_STR);
|
||||
|
@ -292,6 +294,22 @@ QString MApplication::diagramsPath() const
|
|||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MApplication::ShowDataBase()
|
||||
{
|
||||
if (dataBase.isNull())
|
||||
{
|
||||
dataBase = new DialogMDataBase();
|
||||
dataBase->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
dataBase->setModal(false);
|
||||
dataBase->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
dataBase->activateWindow();
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
#if defined(Q_WS_MAC)
|
||||
bool MApplication::event(QEvent* event)
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "../vmisc/def.h"
|
||||
#include "../vmisc/vtapesettings.h"
|
||||
#include "../vmisc/vabstractapplication.h"
|
||||
#include "dialogs/dialogmdatabase.h"
|
||||
|
||||
class MApplication;// use in define
|
||||
class TMainWindow;
|
||||
|
@ -70,6 +71,8 @@ public:
|
|||
QString translationsPath() const;
|
||||
QString diagramsPath() const;
|
||||
|
||||
void ShowDataBase();
|
||||
|
||||
public slots:
|
||||
TMainWindow *NewMainWindow();
|
||||
|
||||
|
@ -82,6 +85,7 @@ private:
|
|||
QList<QPointer<TMainWindow> > mainWindows;
|
||||
QLocalServer *localServer;
|
||||
VTranslateVars *trVars;
|
||||
QPointer<DialogMDataBase> dataBase;
|
||||
|
||||
void Clean();
|
||||
};
|
||||
|
|
|
@ -1135,6 +1135,7 @@ void TMainWindow::SetupMenu()
|
|||
// Measurements
|
||||
connect(ui->actionAddCustom, &QAction::triggered, this, &TMainWindow::AddCustom);
|
||||
connect(ui->actionAddKnown, &QAction::triggered, this, &TMainWindow::AddKnown);
|
||||
connect(ui->actionDatabase, &QAction::triggered, qApp, &MApplication::ShowDataBase);
|
||||
|
||||
// Window
|
||||
connect(ui->menuWindow, &QMenu::aboutToShow, this, &TMainWindow::AboutToShowWindowMenu);
|
||||
|
|
|
@ -615,6 +615,7 @@
|
|||
</property>
|
||||
<addaction name="actionAddKnown"/>
|
||||
<addaction name="actionAddCustom"/>
|
||||
<addaction name="actionDatabase"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuMeasurements"/>
|
||||
|
@ -784,6 +785,14 @@
|
|||
<string>Open template</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDatabase">
|
||||
<property name="text">
|
||||
<string>Database</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Show information about all known measurement</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
|
|
Loading…
Reference in New Issue
Block a user