mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-13 17:09:05 -05:00
Modified summary window header labels to show quantity
This commit is contained in:
@@ -61,6 +61,7 @@ private:
|
||||
QString summarizeText_camera();
|
||||
QString summarizeText_markNodes();
|
||||
QString summarizeText_addedScripts();
|
||||
void labelText(openspace::Profile* pData, int size, QString title, QLabel* pLabel);
|
||||
|
||||
Ui::ProfileEdit *ui;
|
||||
QWidget* _parent;
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
frame_meta->setFrameShadow(QFrame::Plain);
|
||||
label_meta = new QLabel(frame_meta);
|
||||
label_meta->setObjectName(QString::fromUtf8("label_meta"));
|
||||
label_meta->setGeometry(QRect(4, 0, 111, 17));
|
||||
label_meta->setGeometry(QRect(4, 0, 220, 17));
|
||||
QFont font;
|
||||
font.setFamily(QString::fromUtf8("Arial"));
|
||||
label_meta->setFont(font);
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
frame_modules->setFrameShadow(QFrame::Plain);
|
||||
label_modules = new QLabel(frame_modules);
|
||||
label_modules->setObjectName(QString::fromUtf8("label_modules"));
|
||||
label_modules->setGeometry(QRect(4, 0, 111, 17));
|
||||
label_modules->setGeometry(QRect(4, 0, 220, 17));
|
||||
label_modules->setFont(font);
|
||||
edit_modules = new QPushButton(frame_modules);
|
||||
edit_modules->setObjectName(QString::fromUtf8("edit_modules"));
|
||||
@@ -145,7 +145,7 @@ public:
|
||||
frame_assets->setFrameShadow(QFrame::Plain);
|
||||
label_assets = new QLabel(frame_assets);
|
||||
label_assets->setObjectName(QString::fromUtf8("label_assets"));
|
||||
label_assets->setGeometry(QRect(4, 0, 111, 17));
|
||||
label_assets->setGeometry(QRect(4, 0, 220, 17));
|
||||
label_assets->setFont(font);
|
||||
edit_assets = new QPushButton(frame_assets);
|
||||
edit_assets->setObjectName(QString::fromUtf8("edit_assets"));
|
||||
@@ -167,7 +167,7 @@ public:
|
||||
frame_properties->setFrameShadow(QFrame::Plain);
|
||||
label_properties = new QLabel(frame_properties);
|
||||
label_properties->setObjectName(QString::fromUtf8("label_properties"));
|
||||
label_properties->setGeometry(QRect(4, 0, 111, 17));
|
||||
label_properties->setGeometry(QRect(4, 0, 220, 17));
|
||||
label_properties->setFont(font);
|
||||
edit_properties = new QPushButton(frame_properties);
|
||||
edit_properties->setObjectName(QString::fromUtf8("edit_properties"));
|
||||
@@ -189,7 +189,7 @@ public:
|
||||
frame_keybindings->setFrameShadow(QFrame::Plain);
|
||||
label_keybindings = new QLabel(frame_keybindings);
|
||||
label_keybindings->setObjectName(QString::fromUtf8("label_keybindings"));
|
||||
label_keybindings->setGeometry(QRect(4, 0, 111, 17));
|
||||
label_keybindings->setGeometry(QRect(4, 0, 220, 17));
|
||||
label_keybindings->setFont(font);
|
||||
edit_keybindings = new QPushButton(frame_keybindings);
|
||||
edit_keybindings->setObjectName(QString::fromUtf8("edit_keybindings"));
|
||||
@@ -211,7 +211,7 @@ public:
|
||||
frame_time->setFrameShadow(QFrame::Plain);
|
||||
label_time = new QLabel(frame_time);
|
||||
label_time->setObjectName(QString::fromUtf8("label_time"));
|
||||
label_time->setGeometry(QRect(4, 0, 111, 17));
|
||||
label_time->setGeometry(QRect(4, 0, 220, 17));
|
||||
label_time->setFont(font);
|
||||
edit_time = new QPushButton(frame_time);
|
||||
edit_time->setObjectName(QString::fromUtf8("edit_time"));
|
||||
@@ -233,7 +233,7 @@ public:
|
||||
frame_deltatimes->setFrameShadow(QFrame::Plain);
|
||||
label_deltatimes = new QLabel(frame_deltatimes);
|
||||
label_deltatimes->setObjectName(QString::fromUtf8("label_deltatimes"));
|
||||
label_deltatimes->setGeometry(QRect(4, 0, 111, 17));
|
||||
label_deltatimes->setGeometry(QRect(4, 0, 220, 17));
|
||||
label_deltatimes->setFont(font);
|
||||
edit_deltatimes = new QPushButton(frame_deltatimes);
|
||||
edit_deltatimes->setObjectName(QString::fromUtf8("edit_deltatimes"));
|
||||
@@ -255,7 +255,7 @@ public:
|
||||
frame_camera->setFrameShadow(QFrame::Plain);
|
||||
label_camera = new QLabel(frame_camera);
|
||||
label_camera->setObjectName(QString::fromUtf8("label_camera"));
|
||||
label_camera->setGeometry(QRect(4, 0, 111, 17));
|
||||
label_camera->setGeometry(QRect(4, 0, 220, 17));
|
||||
label_camera->setFont(font);
|
||||
edit_camera = new QPushButton(frame_camera);
|
||||
edit_camera->setObjectName(QString::fromUtf8("edit_camera"));
|
||||
@@ -277,7 +277,7 @@ public:
|
||||
frame_marknodes->setFrameShadow(QFrame::Plain);
|
||||
label_marknodes = new QLabel(frame_marknodes);
|
||||
label_marknodes->setObjectName(QString::fromUtf8("label_marknodes"));
|
||||
label_marknodes->setGeometry(QRect(4, 0, 181, 17));
|
||||
label_marknodes->setGeometry(QRect(4, 0, 220, 17));
|
||||
label_marknodes->setFont(font);
|
||||
edit_marknodes = new QPushButton(frame_marknodes);
|
||||
edit_marknodes->setObjectName(QString::fromUtf8("edit_marknodes"));
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
frame_additionalscripts->setFrameShadow(QFrame::Plain);
|
||||
label_additionalscripts = new QLabel(frame_additionalscripts);
|
||||
label_additionalscripts->setObjectName(QString::fromUtf8("label_additionalscripts"));
|
||||
label_additionalscripts->setGeometry(QRect(4, 0, 171, 17));
|
||||
label_additionalscripts->setGeometry(QRect(4, 0, 220, 17));
|
||||
label_additionalscripts->setFont(font);
|
||||
edit_additionalscripts = new QPushButton(frame_additionalscripts);
|
||||
edit_additionalscripts->setObjectName(QString::fromUtf8("edit_additionalscripts"));
|
||||
|
||||
@@ -39,27 +39,33 @@ void ProfileEdit::initSummaryTextForEachCategory() {
|
||||
ui->text_meta->setText(summarizeText_meta());
|
||||
ui->text_meta->setReadOnly(true);
|
||||
|
||||
labelText(_pData, _pData->modules().size(), "Modules", ui->label_modules);
|
||||
ui->text_modules->setText(summarizeText_modules());
|
||||
ui->text_modules->setReadOnly(true);
|
||||
|
||||
labelText(_pData, _pData->assets().size(), "Assets", ui->label_assets);
|
||||
ui->text_assets->setText(summarizeText_assets());
|
||||
ui->text_assets->setReadOnly(true);
|
||||
|
||||
labelText(_pData, _pData->properties().size(), "Properties", ui->label_properties);
|
||||
ui->text_properties->setText(summarizeText_properties());
|
||||
ui->text_properties->setReadOnly(true);
|
||||
|
||||
labelText(_pData, _pData->keybindings().size(), "Keybindings", ui->label_keybindings);
|
||||
ui->text_keybindings->setText(summarizeText_keybindings());
|
||||
ui->text_keybindings->setReadOnly(true);
|
||||
|
||||
ui->text_time->setText(summarizeText_time());
|
||||
ui->text_time->setReadOnly(true);
|
||||
|
||||
labelText(_pData, _pData->deltaTimes().size(), "Delta Times", ui->label_deltatimes);
|
||||
ui->text_deltatimes->setText(summarizeText_deltaTimes());
|
||||
ui->text_deltatimes->setReadOnly(true);
|
||||
|
||||
ui->text_camera->setText(summarizeText_camera());
|
||||
ui->text_camera->setReadOnly(true);
|
||||
|
||||
labelText(_pData, _pData->markNodes().size(), "Mark Interesting Nodes", ui->label_marknodes);
|
||||
ui->text_marknodes->setText(summarizeText_markNodes());
|
||||
ui->text_marknodes->setReadOnly(true);
|
||||
|
||||
@@ -83,6 +89,7 @@ void ProfileEdit::openModules() {
|
||||
if (_pData) {
|
||||
_modules = new osmodules(_pData);
|
||||
_modules->exec();
|
||||
labelText(_pData, _pData->modules().size(), "Modules", ui->label_modules);
|
||||
ui->text_modules->setText(summarizeText_modules());
|
||||
}
|
||||
}
|
||||
@@ -91,6 +98,7 @@ void ProfileEdit::openProperties() {
|
||||
if (_pData) {
|
||||
_properties = new properties(_pData);
|
||||
_properties->exec();
|
||||
labelText(_pData, _pData->properties().size(), "Properties", ui->label_properties);
|
||||
ui->text_properties->setText(summarizeText_properties());
|
||||
}
|
||||
}
|
||||
@@ -99,6 +107,7 @@ void ProfileEdit::openKeybindings() {
|
||||
if (_pData) {
|
||||
_keybindings = new keybindings(_pData);
|
||||
_keybindings->exec();
|
||||
labelText(_pData, _pData->keybindings().size(), "Keybindings", ui->label_keybindings);
|
||||
ui->text_keybindings->setText(summarizeText_keybindings());
|
||||
}
|
||||
}
|
||||
@@ -107,6 +116,7 @@ void ProfileEdit::openAssets() {
|
||||
if (_pData) {
|
||||
_assets = new assets(_pData, _reportedAssets);
|
||||
_assets->exec();
|
||||
labelText(_pData, _pData->assets().size(), "Assets", ui->label_assets);
|
||||
ui->text_assets->setText(summarizeText_assets());
|
||||
}
|
||||
}
|
||||
@@ -123,6 +133,7 @@ void ProfileEdit::openDeltaTimes() {
|
||||
if (_pData) {
|
||||
_deltaTimes = new deltaTimes(_pData);
|
||||
_deltaTimes->exec();
|
||||
labelText(_pData, _pData->deltaTimes().size(), "Delta Times", ui->label_deltatimes);
|
||||
ui->text_deltatimes->setText(summarizeText_deltaTimes());
|
||||
}
|
||||
}
|
||||
@@ -147,6 +158,7 @@ void ProfileEdit::openMarkNodes() {
|
||||
if (_pData) {
|
||||
_markNodes = new markNodes(_pData);
|
||||
_markNodes->exec();
|
||||
labelText(_pData, _pData->markNodes().size(), "Mark Interesting Nodes", ui->label_marknodes);
|
||||
ui->text_marknodes->setText(summarizeText_markNodes());
|
||||
}
|
||||
}
|
||||
@@ -168,21 +180,40 @@ QString ProfileEdit::summarizeText_meta() {
|
||||
return s;
|
||||
}
|
||||
|
||||
void ProfileEdit::labelText(openspace::Profile* pData, int size, QString title,
|
||||
QLabel* pLabel)
|
||||
{
|
||||
if (pData == nullptr) {
|
||||
return;
|
||||
}
|
||||
QString label;
|
||||
if (size > 0) {
|
||||
label = "<html><head/><body><p><span style=\" font-weight:600;\">" + title + " ("
|
||||
+ QString::number(size) + ")</span></p></body></html>";
|
||||
}
|
||||
else {
|
||||
label = "<html><head/><body><p><span style=\" font-weight:600;\">" + title
|
||||
+ "</span></p></body></html>";
|
||||
}
|
||||
QByteArray qba = label.toLocal8Bit();
|
||||
pLabel->setText(QCoreApplication::translate("ProfileEdit", qba.data(), nullptr));
|
||||
}
|
||||
|
||||
QString ProfileEdit::summarizeText_modules() {
|
||||
if (_pData == nullptr) {
|
||||
return "";
|
||||
}
|
||||
QString results = QString("<Configured with %1 modules>\n").arg(_pData->modules().size());
|
||||
QString results;
|
||||
for (openspace::Profile::Module m : _pData->modules()) {
|
||||
results += " " + QString(m.name.c_str());
|
||||
results += QString(m.name.c_str());
|
||||
if (m.loadedInstruction.size() > 0 && m.notLoadedInstruction.size() > 0) {
|
||||
results += " (has commands for both loaded & non-loaded conditions)";
|
||||
results += "(has commands for both loaded & non-loaded conditions)";
|
||||
}
|
||||
else if (m.loadedInstruction.size() > 0) {
|
||||
results += " (has command for loaded condition)";
|
||||
results += "(has command for loaded condition)";
|
||||
}
|
||||
else if (m.notLoadedInstruction.size() > 0) {
|
||||
results += " (has command for non-loaded condition)";
|
||||
results += "(has command for non-loaded condition)";
|
||||
}
|
||||
results += "\n";
|
||||
}
|
||||
@@ -193,9 +224,9 @@ QString ProfileEdit::summarizeText_properties() {
|
||||
if (_pData == nullptr) {
|
||||
return "";
|
||||
}
|
||||
QString results = QString("<Configured with %1 properties>\n").arg(_pData->properties().size());
|
||||
QString results;
|
||||
for (openspace::Profile::Property p : _pData->properties()) {
|
||||
results += " " + QString(p.name.c_str()) + " = ";
|
||||
results += QString(p.name.c_str()) + " = ";
|
||||
results += QString(p.value.c_str()) + "\n";
|
||||
}
|
||||
return results;
|
||||
@@ -205,10 +236,9 @@ QString ProfileEdit::summarizeText_keybindings() {
|
||||
if (_pData == nullptr) {
|
||||
return "";
|
||||
}
|
||||
QString results =
|
||||
QString("<Configured with %1 keybindings>\n").arg(_pData->keybindings().size());
|
||||
QString results;
|
||||
for (openspace::Profile::Keybinding k : _pData->keybindings()) {
|
||||
results += " " + QString(k.name.c_str()) + " (";
|
||||
results += QString(k.name.c_str()) + " (";
|
||||
int keymod = static_cast<int>(k.key.modifier);
|
||||
if (keymod != static_cast<int>(openspace::KeyModifier::NoModifier)) {
|
||||
results += QString(openspace::KeyModifierNames.at(keymod).c_str()) + "+";
|
||||
@@ -223,9 +253,9 @@ QString ProfileEdit::summarizeText_assets() {
|
||||
if (_pData == nullptr) {
|
||||
return "";
|
||||
}
|
||||
QString results = QString("<Configured with %1 assets>\n").arg(_pData->assets().size());
|
||||
QString results;
|
||||
for (openspace::Profile::Asset a : _pData->assets()) {
|
||||
results += " " + QString(a.path.c_str()) + " ";
|
||||
results += QString(a.path.c_str()) + " ";
|
||||
results += QString(a.name.c_str()) + "\n";
|
||||
}
|
||||
return results;
|
||||
@@ -252,8 +282,7 @@ QString ProfileEdit::summarizeText_deltaTimes() {
|
||||
if (_pData == nullptr) {
|
||||
return "";
|
||||
}
|
||||
QString results =
|
||||
QString("<Configured with %1 delta times>\n").arg(_pData->deltaTimes().size());
|
||||
QString results;
|
||||
for (size_t i = 0; i < _pData->deltaTimes().size(); ++i) {
|
||||
results += _deltaTimes->createSummaryForDeltaTime(i,
|
||||
_pData->deltaTimes().at(i), false);
|
||||
|
||||
Reference in New Issue
Block a user