Skip to content
Snippets Groups Projects
Commit d6b193a8 authored by Peter Naumann's avatar Peter Naumann
Browse files

Better distinction for linked scenarios and makeLocal functionality

parent 9fb0a48f
No related branches found
No related tags found
1 merge request!90Extended support for linked scenarios
Pipeline #15702 failed
......@@ -76,6 +76,10 @@ void DetailedApplicationView::init()
void attributeChanged(QtProperty * property,
const QString & attribute, const QVariant & val);
ui->linkedApplicationLabel->setVisible(false);
ui->makeLocalButton->setVisible(false);
ui->addParameterButton->setVisible(false);
//QObject::connect(variantManager.get(), SIGNAL())
}
......@@ -183,7 +187,7 @@ void DetailedApplicationView::showApplicationInstance(ApplicationInstancePtr app
init();
}
if (appInstance->getStatus().compare("Running") == 0)
if (appInstance->getStatus() == "Running")
{
ui->stateLabel->setStyleSheet("QLabel { color : green; }");
//stateLabelPallet.setColor(QPalette::WindowText, Qt::blue);
......@@ -201,6 +205,12 @@ void DetailedApplicationView::showApplicationInstance(ApplicationInstancePtr app
ui->stateLabel->setStyleSheet("QLabel { color : black; }");
}
bool readOnly = appInstance->isReadOnly();
ui->linkedApplicationLabel->setVisible(readOnly);
ui->makeLocalButton->setVisible(readOnly);
ui->addParameterButton->setVisible(!readOnly);
ui->dataLabel->setText(QString::fromStdString(appInstance->getName()));
ui->stateLabel->setText(QString::fromStdString(appInstance->getStatus()));
statusUpdateRelevant = true;
......@@ -937,3 +947,14 @@ void DetailedApplicationView::on_reloadButton_clicked()
}
}
}
void DetailedApplicationView::on_makeLocalButton_clicked()
{
if (!lastAppInstance)
{
return;
}
lastAppInstance->makeLocal();
showApplicationInstance(lastAppInstance, nullptr);
}
......@@ -95,6 +95,7 @@ signals:
void addParameterButtonClicked();
void addIceEnvButtonClicked();
void toolButtonClicked();
void makeLocalButtonClicked();
void saveScenario(ScenarioManager::Data_Structure::ApplicationInstancePtr application);
void applicationEnabledChange(bool enabled);
......@@ -127,6 +128,8 @@ private slots:
void on_fileUpdate();
void on_makeLocalButton_clicked();
private:
void init();
void show_or_hide_property(QtProperty*, bool);
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>458</width>
<height>300</height>
<width>564</width>
<height>380</height>
</rect>
</property>
<property name="windowTitle">
......@@ -108,6 +108,12 @@
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QPushButton" name="reloadButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Refresh (Reloads the Properties)</string>
</property>
......@@ -120,8 +126,86 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="linkedApplicationLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>164</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>164</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>190</red>
<green>190</green>
<blue>190</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Linked Application - read only</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="makeLocalButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Unlink the application with the current configuration</string>
</property>
<property name="text">
<string>Make local</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="addParameterButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment