Skip to content

Commit

Permalink
Merge branch 'master' into fbo_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kd-11 committed Apr 29, 2019
2 parents a787685 + 468e1e9 commit ae5b6d1
Show file tree
Hide file tree
Showing 6 changed files with 267 additions and 136 deletions.
11 changes: 11 additions & 0 deletions Utilities/Log.cpp
Expand Up @@ -602,6 +602,17 @@ logs::file_listener::file_listener(const std::string& name)
file_writer::log(logs::level::always, ver.text.data(), ver.text.size());
file_writer::log(logs::level::always, "\n", 1);
messages.emplace_back(std::move(ver));

// Write OS version
stored_message os;
os.m.ch = nullptr;
os.m.sev = level::notice;
os.stamp = 0;
os.text = utils::get_OS_version();

file_writer::log(logs::level::notice, os.text.data(), os.text.size());
file_writer::log(logs::level::notice, "\n", 1);
messages.emplace_back(std::move(os));
}

void logs::file_listener::log(u64 stamp, const logs::message& msg, const std::string& prefix, const std::string& _text)
Expand Down
48 changes: 48 additions & 0 deletions Utilities/sysinfo.cpp
Expand Up @@ -5,8 +5,13 @@

#ifdef _WIN32
#include "windows.h"
#include "sysinfoapi.h"
#include "subauth.h"
#include "stringapiset.h"
#else
#include <unistd.h>
#include <sys/utsname.h>
#include <errno.h>
#endif

bool utils::has_ssse3()
Expand Down Expand Up @@ -153,3 +158,46 @@ std::string utils::get_firmware_version()
}
return "";
}

std::string utils::get_OS_version()
{
std::string output = "";
#ifdef _WIN32
// GetVersionEx is deprecated, RtlGetVersion is kernel-mode only and AnalyticsInfo is UWP only.
// So we're forced to read PEB instead to get Windows version info. It's ugly but works.

const DWORD peb_offset = 0x60;
const INT_PTR peb = __readgsqword(peb_offset);

const DWORD version_major = *reinterpret_cast<const DWORD*>(peb + 0x118);
const DWORD version_minor = *reinterpret_cast<const DWORD*>(peb + 0x11c);
const WORD build = *reinterpret_cast<const WORD*>(peb + 0x120);
const UNICODE_STRING service_pack = *reinterpret_cast<const UNICODE_STRING*>(peb + 0x02E8);
const u64 compatibility_mode = *reinterpret_cast<const u64*>(peb + 0x02C8); // Two DWORDs, major & minor version

const bool has_sp = service_pack.Length > 0;
std::vector<char> holder(service_pack.Length + 1, '\0');
if (has_sp)
{
WideCharToMultiByte(CP_UTF8, NULL, service_pack.Buffer, service_pack.Length,
(LPSTR) holder.data(), static_cast<int>(holder.size()), NULL, NULL);
}

fmt::append(output,
"Operating system: Windows, Major: %lu, Minor: %lu, Build: %u, Service Pack: %s, Compatibility mode: %llu",
version_major, version_minor, build, has_sp ? holder.data() : "none", compatibility_mode);
#else
struct utsname details = {};

if (!uname(&details))
{
fmt::append(output, "Operating system: POSIX, Name: %s, Release: %s, Version: %s",
details.sysname, details.release, details.version);
}
else
{
fmt::append(output, "Operating system: POSIX, Unknown version! (Error: %d)", errno);
}
#endif
return output;
}
2 changes: 2 additions & 0 deletions Utilities/sysinfo.h
Expand Up @@ -46,4 +46,6 @@ namespace utils
std::string get_system_info();

std::string get_firmware_version();

std::string get_OS_version();
}
118 changes: 57 additions & 61 deletions bin/GuiConfigs/Envy.qss
Expand Up @@ -39,19 +39,25 @@ QToolTip {
}

/* Table Headers */
QHeaderView {
border: none;
border-bottom: 1px solid #8cf944;
}

QHeaderView::section {
background-color: #23262d;
color: #f8f8f8;
padding-left: 0.25em;
padding-top: 0.25em;
padding-bottom: 0.25em;
border: 1px solid #8cf944;
border-top: none;
border-left: none;
border-right: none;
padding-top: 3px;
padding-left: 3px;
height: 20px;
border: none;
}

QHeaderView::section:first {
padding-left: 5px;
}

/* Settings Dialog: Tabs */
/* Tabs */
QTabBar::tab {
color: #8cf944;
padding-left: 1.25em;
Expand All @@ -63,6 +69,14 @@ QTabBar::tab {
border-bottom: 1px solid #8cf944;
}

QTabWidget::pane {
border: none;
}

QTabWidget::tab-bar {
alignment: center;
}

QTabBar::tab:!selected {
color: #f8f8f8;
border-bottom: 1px solid transparent;
Expand Down Expand Up @@ -96,6 +110,11 @@ QTabBar#tab_bar_settings::tab:hover {
border-bottom: 1px solid #8cf944;
}

/* Log Tabs */
QTabWidget#tab_widget_log::tab-bar {
alignment: left;
}

QTabBar#tab_bar_log::tab:!selected {
color: #FFF;
border: none;
Expand Down Expand Up @@ -134,7 +153,7 @@ QCheckBox::indicator:unchecked {
background-color: #000;
}

QCheckBox::indicator::disabled {
QCheckBox::indicator:disabled {
background-color: #4d5058;
}

Expand Down Expand Up @@ -189,7 +208,7 @@ QRadioButton::indicator:unchecked {
background-color: #000;
}

QRadioButton::indicator::disabled {
QRadioButton::indicator:disabled {
background-color: #4d5058;
}

Expand All @@ -204,7 +223,7 @@ QComboBox {
min-height: 14px;
}

QComboBox::hover {
QComboBox:hover {
color: #8cf944;
background-color: #2d3038;
border: 0.0625em solid #8cf944;
Expand All @@ -230,40 +249,40 @@ QComboBox::!selected {
padding-left: 0.25em;
}

QComboBox::disabled {
QComboBox:disabled {
background-color: #4d5058;
color: #fff;
}

/* Sliders */
QSlider::groove:horizontal {
border: -5px solid #8cf944;
border: -3px solid transparent;
border-radius: 0.45em;
height: 8px;
background: #8cf944;
margin: 1px;
}

QSlider::groove:horizontal:disabled {
background: #4d5058;
}

QSlider::handle:horizontal {
background: #23262d;
border: 1px solid #5c5c5c;
border-radius: 0.1em;
width: 18px;
margin: -2px 4;
margin: -2px 2;
}

QSlider::handle:horizontal:hover {
background: #23262d;
border: 1px solid #8cf944;
width: 18px;
margin: -2px 4;
}

QSlider::handle:horizontal:pressed {
background: #30333a;
border: 1px solid #8cf944;
width: 18px;
margin: -2px 4;
}

/* Progress Bar */
Expand Down Expand Up @@ -311,7 +330,7 @@ QPushButton:hover {
color: #8cf944;
}

QPushButton::disabled {
QPushButton:disabled {
color: #999999;
}

Expand All @@ -323,7 +342,7 @@ QPushButton::pressed {
QSpinBox, QDoubleSpinBox {
border: 1px solid #999999;
padding: 2px;
color: #999999;
color: #FFFFFF;
border-radius: 2px;
background-color: transparent;
}
Expand Down Expand Up @@ -370,11 +389,6 @@ QDockWidget::close-button, QDockWidget::float-button {
width: auto;
}

/* Disable Borders */
QTabWidget::pane {
border: none;
}

/* Top Menu Bar */
QMenuBar::item:selected {
margin-bottom: 0.125em;
Expand Down Expand Up @@ -417,6 +431,15 @@ QMenu::item:disabled {
}

/* Libraries List */
QListWidget {
border: 1px solid #bdc3c7;
border-radius: 0.1em;
}

QListWidget:disabled {
border: 1px solid #4d5058;
}

QListWidget::item:selected {
background-color: #30333a;
color: #b1f184;
Expand Down Expand Up @@ -500,6 +523,10 @@ QToolBar {
}

/* Toolbar Buttons */
QLabel#toolbar_icon_color {
color: #FFFFFF;
}

QToolButton {
background: transparent;
border-radius: 0em;
Expand All @@ -512,12 +539,12 @@ QToolButton {
border-bottom: 1px solid transparent;
}

QToolButton::disabled {
QToolButton:disabled {
background-color: #30333a;
color: #f8f8f8;
}

QToolButton::hover {
QToolButton:hover {
background-color: #2d3038;
color: #8cf944;
border-bottom: 1px solid #8cf944;
Expand Down Expand Up @@ -574,7 +601,7 @@ QLabel#log_level_warning {
}

QLabel#log_level_notice {
color: #ffffff;
color: #FFFFFF;
}

QLabel#log_level_trace {
Expand All @@ -585,43 +612,12 @@ QLabel#log_stack {
color: #3498d8;
}

/* Set TTY colors */
/* TTY colors */
QTextEdit#tty_frame {
background-color: #23262d;
}

QLabel#tty_text {
color: #FFFFFF;
}

/* RSX Debugger */
QLabel#rsx_debugger_display_buffer {
background-color: #131313;
}

/* Kernel Explorer */
QDialog#kernel_explorer {
background-color: #131313;
}

/* Memory Viewer */
QDialog#memory_viewer {
background-color: #131313;
color: #FFF;
}

QLabel#memory_viewer_address_panel {
color: #8cf944;
background-color: #131313;
}

QLabel#memory_viewer_hex_panel {
color: #FFF;
background-color: #131313;
}

QLabel#memory_viewer_ascii_panel {
color: #FFF;
background-color: #131313;
color: #f8f8f8;
}

0 comments on commit ae5b6d1

Please sign in to comment.