Skip to content
Snippets Groups Projects
Commit 0f12780a authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Merge branch 'show-armarx-workspace-in-gs' into 'master'

Show the active ArmarX workspace in title of ArmarX Gui

See merge request !91
parents 77d27e7d 8afe2788
No related branches found
No related tags found
1 merge request!91Show the active ArmarX workspace in title of ArmarX Gui
Pipeline #15757 passed
......@@ -252,7 +252,7 @@ namespace armarx
}
static QString
getUserNameAtHostName()
getUserNameAtHostName(const QString& delimiter, const QString& at)
{
const QString hostname = QHostInfo::localHostName();
QString user = getUserName();
......@@ -262,7 +262,7 @@ namespace armarx
}
else
{
return user + "-at-" + hostname;
return user + delimiter + at + delimiter + hostname;
}
}
......@@ -270,7 +270,7 @@ namespace armarx
ArmarXGuiApp::makeName()
{
std::vector<std::string> items{"ArmarXGui"};
items.push_back(getUserNameAtHostName().toStdString());
items.push_back(getUserNameAtHostName("-", "at").toStdString());
items.push_back(DateTime::Now().toDateTimeString());
std::string name = simox::alg::join(items, "_");
......@@ -327,7 +327,21 @@ namespace armarx
const auto guiWindowBaseName = QString{"ArmarX"} + " @ " + QHostInfo::localHostName();
setApplicationName(guiWindowBaseName);
setApplicationDisplayName(getUserNameAtHostName());
{
const char* envArmarxWorkspace = std::getenv("ARMARX_WORKSPACE_NAME");
if (envArmarxWorkspace == nullptr)
{
envArmarxWorkspace = std::getenv("ARMARX_WORKSPACE");
}
QString applicationDisplayName;
if (envArmarxWorkspace != nullptr)
{
applicationDisplayName += "[▽" + QString(envArmarxWorkspace) + "] ";
}
applicationDisplayName += getUserNameAtHostName(" ", "@");
setApplicationDisplayName(applicationDisplayName);
}
connect(this,
SIGNAL(exceptionCaught(QString)),
......
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