15 #include <QApplication> 39 QStringList standardToolbars;
40 standardToolbars <<
"Workflow" <<
"Navigation" <<
"Tools" <<
"Screenshot" <<
"Desktop";
44 desktop =
Desktop(
"LAYOUT_3D_ACS", QByteArray::fromBase64(
""));
46 toolbars << standardToolbars <<
"Data" <<
"Help";
47 this->addToolbarsToDesktop(desktop, toolbars);
48 desktop.
addPreset(
"active_mesh_widget", Qt::LeftDockWidgetArea,
true);
49 desktop.
addPreset(
"volume_properties_widget", Qt::LeftDockWidgetArea,
true);
50 desktop.
addPreset(
"slice_properties_widget", Qt::LeftDockWidgetArea,
true);
51 desktop.
addPreset(
"dicom_widget", Qt::LeftDockWidgetArea,
true);
52 desktop.
addPreset(
"export_data_widget", Qt::LeftDockWidgetArea,
true);
53 desktop.
addPreset(
"import_widget", Qt::LeftDockWidgetArea,
true);
54 desktop.
addPreset(
"console_widget", Qt::LeftDockWidgetArea,
false);
55 desktop.
addPreset(
"help_widget", Qt::RightDockWidgetArea,
false);
56 mWorkflowDefaultDesktops[
"PatientDataUid"] = desktop;
60 desktop =
Desktop(
"LAYOUT_3D_ACS", QByteArray::fromBase64(
""));
62 toolbars << standardToolbars <<
"RegistrationHistory" <<
"Help";
63 this->addToolbarsToDesktop(desktop, toolbars);
64 desktop.
addPreset(
"console_widget", Qt::LeftDockWidgetArea,
true);
65 desktop.
addPreset(
"org_custusx_registration_gui_widget", Qt::LeftDockWidgetArea,
true);
66 desktop.
addPreset(
"registration_history_widget", Qt::LeftDockWidgetArea,
false);
67 mWorkflowDefaultDesktops[
"RegistrationUid"] = desktop;
71 desktop =
Desktop(
"LAYOUT_3D_ACS", QByteArray::fromBase64(
""));
73 toolbars << standardToolbars <<
"Camera3DViews" <<
"Sampler" <<
"Help";
74 this->addToolbarsToDesktop(desktop, toolbars);
75 desktop.
addPreset(
"active_mesh_widget", Qt::LeftDockWidgetArea,
true);
76 desktop.
addPreset(
"volume_properties_widget", Qt::LeftDockWidgetArea,
true);
77 desktop.
addPreset(
"slice_properties_widget", Qt::LeftDockWidgetArea,
true);
78 desktop.
addPreset(
"console_widget", Qt::LeftDockWidgetArea,
false);
79 mWorkflowDefaultDesktops[
"PreOpPlanningUid"] = desktop;
83 desktop =
Desktop(
"LAYOUT_3D_ACS", QByteArray::fromBase64(
""));
85 toolbars << standardToolbars <<
"InteractorStyle" <<
"ToolOffset" <<
"Help";
86 this->addToolbarsToDesktop(desktop, toolbars);
87 mWorkflowDefaultDesktops[
"NavigationUid"] = desktop;
91 desktop =
Desktop(
"LAYOUT_US_Acquisition", QByteArray::fromBase64(
""));
93 toolbars << standardToolbars <<
"Help";
94 this->addToolbarsToDesktop(desktop, toolbars);
95 desktop.
addPreset(
"igt_link_widget", Qt::LeftDockWidgetArea,
true);
96 desktop.
addPreset(
"us_reconstruction", Qt::LeftDockWidgetArea,
true);
97 desktop.
addPreset(
"org_custusx_acquisition_widgets_acquisition", Qt::LeftDockWidgetArea,
true);
98 mWorkflowDefaultDesktops[
"IntraOpImagingUid"] = desktop;
102 desktop =
Desktop(
"LAYOUT_3D_ACS", QByteArray::fromBase64(
""));
104 toolbars << standardToolbars <<
"Sampler" <<
"Help";
105 this->addToolbarsToDesktop(desktop, toolbars);
106 desktop.
addPreset(
"active_mesh_widget", Qt::LeftDockWidgetArea,
true);
107 desktop.
addPreset(
"volume_properties_widget", Qt::LeftDockWidgetArea,
true);
108 desktop.
addPreset(
"slice_properties_widget", Qt::LeftDockWidgetArea,
true);
109 desktop.
addPreset(
"metric_widget", Qt::LeftDockWidgetArea,
true);
110 desktop.
addPreset(
"console_widget", Qt::LeftDockWidgetArea,
false);
111 desktop.
addPreset(
"playback_widget", Qt::BottomDockWidgetArea,
false);
112 mWorkflowDefaultDesktops[
"PostOpControllUid"] = desktop;
116 void ApplicationsParser::addToolbarsToDesktop(
Desktop& desktop, QStringList toolbars)
118 for (
int i=0; i<toolbars.size(); ++i)
120 desktop.
addPreset(toolbars[i]+
"ToolBar", Qt::TopToolBarArea);
124 void ApplicationsParser::addDefaultDesktops(QString workflowStateUid, QString layoutUid, QString mainwindowstate)
126 mWorkflowDefaultDesktops[workflowStateUid] =
Desktop(layoutUid,
127 QByteArray::fromBase64(mainwindowstate.toLatin1()));
133 if (!mWorkflowDefaultDesktops.count(workflowName))
134 return mWorkflowDefaultDesktops[
"DEFAULT"];
135 return mWorkflowDefaultDesktops[workflowName];
143 QDomElement desktopElement;
144 if (workflowElement.namedItem(
"custom").isNull())
150 desktopElement = workflowElement.namedItem(
"custom").toElement();
152 retval.
mMainWindowState = QByteArray::fromBase64(desktopElement.attribute(
"mainwindowstate").toLatin1());
153 retval.
mLayoutUid = desktopElement.attribute(
"layoutuid");
165 desktopElement.setAttribute(
"mainwindowstate", QString(desktop.
mMainWindowState.toBase64()));
166 desktopElement.setAttribute(
"layoutuid", desktop.
mLayoutUid);
174 retval = retval.
descend(
"workflows");
183 workflowElement.removeChild(workflowElement.namedItem(
"custom"));
ProfilePtr activeProfile()
void setDesktop(QString workflowName, Desktop desktop)
static ProfileManager * getInstance(QString defaultProfile=QString("Laboratory"))
returns the only instance of this class
QDomElement getElement()
return the current element
void resetDesktop(QString workflowName)
QByteArray mMainWindowState
Data class for CustusX desktop.
void save()
save entire document.
QString mSecondaryLayoutUid
Desktop getDefaultDesktop(QString workflowName)
void addPreset(QString name, int pos, bool tabbed=true)
Helper class for xml files used to store ssc/cx data.
Desktop getDesktop(QString workflowName)
XmlOptionFile descend(QString element) const
step one level down in the xml tree
Namespace for all CustusX production code.