First draft of SendSystemInfoDialog

This commit is contained in:
Lukas Matena 2021-08-11 12:03:44 +02:00
parent 37219fe4f3
commit faa808b385
8 changed files with 401 additions and 19 deletions

View file

@ -105,4 +105,42 @@ PlatformFlavor platform_flavor()
return s_platform_flavor;
}
std::string platform_to_string(Platform platform)
{
switch (platform) {
case Platform::Uninitialized: return "Unitialized";
case Platform::Unknown : return "Unknown";
case Platform::Windows : return "Windows";
case Platform::OSX : return "OSX";
case Platform::Linux : return "Linux";
case Platform::BSDUnix : return "BSDUnix";
}
assert(false);
return "";
}
std::string platform_flavor_to_string(PlatformFlavor pf)
{
switch (pf) {
case PlatformFlavor::Uninitialized : return "Unitialized";
case PlatformFlavor::Unknown : return "Unknown";
case PlatformFlavor::Generic : return "Generic";
case PlatformFlavor::GenericLinux : return "GenericLinux";
case PlatformFlavor::LinuxOnChromium : return "LinuxOnChromium";
case PlatformFlavor::WSL : return "WSL";
case PlatformFlavor::WSL2 : return "WSL2";
case PlatformFlavor::OpenBSD : return "OpenBSD";
case PlatformFlavor::GenericOSX : return "GenericOSX";
case PlatformFlavor::OSXOnX86 : return "OSXOnX86";
case PlatformFlavor::OSXOnArm : return "OSXOnArm";
}
assert(false);
return "";
}
} // namespace Slic3r

View file

@ -1,6 +1,8 @@
#ifndef SLIC3R_Platform_HPP
#define SLIC3R_Platform_HPP
#include <string>
namespace Slic3r {
enum class Platform
@ -16,24 +18,16 @@ enum class Platform
enum class PlatformFlavor
{
Uninitialized,
Unknown,
// For Windows and OSX, until we need to be more specific.
Generic,
// For Platform::Linux
GenericLinux,
LinuxOnChromium,
// Microsoft's Windows on Linux (Linux kernel simulated on NTFS kernel)
WSL,
// Microsoft's Windows on Linux, version 2 (virtual machine)
WSL2,
// For Platform::BSDUnix
OpenBSD,
// For Platform::OSX
GenericOSX,
// For Apple's on Intel X86 CPU
OSXOnX86,
// For Apple's on Arm CPU
OSXOnArm,
Unknown,
Generic, // For Windows and OSX, until we need to be more specific.
GenericLinux, // For Platform::Linux
LinuxOnChromium, // For Platform::Linux
WSL, // Microsoft's Windows on Linux (Linux kernel simulated on NTFS kernel)
WSL2, // Microsoft's Windows on Linux, version 2 (virtual machine)
OpenBSD, // For Platform::BSDUnix
GenericOSX, // For Platform::OSX
OSXOnX86, // For Apple's on Intel X86 CPU
OSXOnArm, // For Apple's on Arm CPU
};
// To be called on program start-up.
@ -42,6 +36,9 @@ void detect_platform();
Platform platform();
PlatformFlavor platform_flavor();
std::string platform_to_string(Platform platform);
std::string platform_flavor_to_string(PlatformFlavor pf);
} // namespace Slic3r
#endif // SLIC3R_Platform_HPP