48 handler = getProxy<ConditionHandlerInterfacePrx>(
"ConditionHandler");
51 std::unique_lock lock(dataMutex);
52 QMetaObject::invokeMethod(__widget,
"onConnect");
54 refreshAction->setChecked(
true);
56 qRegisterMetaType<Qt::Orientation>(
"Qt::Orientation");
65 refreshAction->setChecked(
false);
66 __widget->onDisconnect();
84 return qobject_cast<ConditionViewerWidget*>(__widget);
89 std::unique_lock lock(dataMutex);
90 return currentConditions;
95 std::unique_lock lock(dataMutex);
96 return pastConditions;
101 if (enableRefreshing)
118 auto removeResult =
handler->begin_removeAllConditions();
119 std::unique_lock lock(dataMutex);
120 handler->end_removeAllConditions(removeResult);
123 catch (Ice::NotRegisteredException&)
129 void ConditionViewerWidgetController::updateConditions()
135 auto pastResult =
handler->begin_getPastConditions();
136 auto activeResult =
handler->begin_getActiveConditions();
137 std::unique_lock lock(dataMutex);
138 pastConditions =
handler->end_getPastConditions(pastResult);
139 currentConditions =
handler->end_getActiveConditions(activeResult);
142 catch (Ice::NotRegisteredException&)
155 if (parent != customToolbar->parent())
157 customToolbar->setParent(parent);
160 return qobject_cast<QToolBar*>(customToolbar);
163 customToolbar =
new QToolBar(parent);
164 customToolbar->setIconSize(QSize(16, 16));
165 refreshAction = customToolbar->addAction(QIcon(
":/icons/view-refresh-7.png"),
"Refresh conditions");
166 refreshAction->setCheckable(
true);
167 connect(refreshAction, SIGNAL(toggled(
bool)),
this, SLOT(
refresh(
bool)));
169 QAction* removeAction = customToolbar->addAction(QIcon(
":/icons/dialog-close.ico"),
"Remove conditions");
172 return qobject_cast<QToolBar*>(customToolbar);