View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003884 | FreeCAD | Patch | public | 2019-03-05 17:54 | 2019-03-31 09:25 |
Reporter | openBrain | Assigned To | |||
Priority | none | Severity | text | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 0.18 | ||||
Summary | 0003884: Add information about desktop environment in FC info | ||||
Description | The goal of the patch is to add some useful information about the user desktop environment (mainly Linux environments are concerned) when FC info are copied to clipboard with the dedicated button of the about dialog. Can be helpful to forum helpers. | ||||
Steps To Reproduce |
| ||||
Additional Information | Sorry to submit a diff, but not everything is ready for PR.
| ||||
Tags | No tags attached. | ||||
FreeCAD Information | |||||
|
FC_deskenv.diff (1,762 bytes)
diff --git a/src/Gui/Splashscreen.cpp b/src/Gui/Splashscreen.cpp index e097a1c11..3478fa73e 100644 --- a/src/Gui/Splashscreen.cpp +++ b/src/Gui/Splashscreen.cpp @@ -32,6 +32,7 @@ # include <QMutex> # include <QTextBrowser> # include <QProcess> +# include <QProcessEnvironment> # include <QSysInfo> # include <QTextStream> # include <QWaitCondition> @@ -724,7 +725,23 @@ void AboutDialog::on_copyButton_clicked() QString major = QString::fromLatin1(config["BuildVersionMajor"].c_str()); QString minor = QString::fromLatin1(config["BuildVersionMinor"].c_str()); QString build = QString::fromLatin1(config["BuildRevision"].c_str()); - str << "OS: " << SystemInfo::getOperatingSystem() << endl; + + QString deskEnv = QProcessEnvironment::systemEnvironment().value(QString::fromAscii("XDG_CURRENT_DESKTOP"),QString::fromAscii("")); + QString deskSess = QProcessEnvironment::systemEnvironment().value(QString::fromAscii("DESKTOP_SESSION"),QString::fromAscii("")); + QString deskInfo = QString::fromAscii(""); + if (!(deskEnv == QString::fromAscii("") && deskSess == QString::fromAscii(""))) + { + if (deskEnv == QString::fromAscii("") || deskSess == QString::fromAscii("")) + { + deskInfo = QString::fromAscii(" (") + deskEnv + deskSess + QString::fromAscii("("); + } + else + { + deskInfo = QString::fromAscii(" (") + deskEnv + QString::fromAscii("/") + deskSess + QString::fromAscii(")"); + } + } + + str << "OS: " << SystemInfo::getOperatingSystem() << deskInfo << endl; int wordSize = SystemInfo::getWordSizeOfOS(); if (wordSize > 0) { str << "Word size of OS: " << wordSize << "-bit" << endl; |
|
@Kunda1 (or other with some rights), I finally proposed this patch in pull request ( FreeCAD Pull Request 2038 ) with some improvements. Could you thus close this ticket to prevent duplication ? Thanks (sorry for inconvenience). |
|
I've notified the devs on the ticket to close this ticket once that FreeCAD Pull Request 2038 has been merged. |
|
https://github.com/FreeCAD/FreeCAD/commit/2b856e08402b275cf7c6d9d6d126b15a676cf40d |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-03-05 17:54 | openBrain | New Issue | |
2019-03-05 17:54 | openBrain | File Added: FC_deskenv.diff | |
2019-03-06 00:43 | Kunda1 | Steps to Reproduce Updated | |
2019-03-06 00:44 | Kunda1 | Assigned To | => wmayer |
2019-03-06 00:44 | Kunda1 | Status | new => assigned |
2019-03-20 20:58 | openBrain | Note Added: 0012936 | |
2019-03-21 02:01 | Kunda1 | Note Edited: 0012936 | |
2019-03-21 02:01 | Kunda1 | Note Edited: 0012936 | |
2019-03-21 02:02 | Kunda1 | Target Version | => 0.19 |
2019-03-21 02:02 | Kunda1 | Note Added: 0012937 | |
2019-03-21 02:02 | Kunda1 | Note Edited: 0012937 | |
2019-03-31 09:25 | wmayer | Assigned To | wmayer => |
2019-03-31 09:25 | wmayer | Status | assigned => closed |
2019-03-31 09:25 | wmayer | Resolution | open => fixed |
2019-03-31 09:25 | wmayer | Fixed in Version | => 0.19 |
2019-03-31 09:25 | wmayer | Note Added: 0012978 |