* Added info about the graphics device as suggested in #5112. However, it's
currently only shown in the monitor tool tip, that is now feels a bit crowded, so a better solution would be nice. I'm hesitant to give it a more prominent position, though, unless one has proof-read what the accelerants actually return here. * Added missing space between the serial number of the monitor and the date it has been produced. * Renamed fTempScreenMode to fUndoScreenMode, as it's only used to deliver that functionality. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34659 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -533,6 +533,14 @@ ScreenMode::GetMonitorInfo(monitor_info& info, float* _diagonalInches)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
ScreenMode::GetDeviceInfo(accelerant_device_info& info)
|
||||||
|
{
|
||||||
|
BScreen screen(fWindow);
|
||||||
|
return screen.GetDeviceInfo(&info);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
screen_mode
|
screen_mode
|
||||||
ScreenMode::ModeAt(int32 index)
|
ScreenMode::ModeAt(int32 index)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ public:
|
|||||||
status_t GetMonitorInfo(monitor_info& info,
|
status_t GetMonitorInfo(monitor_info& info,
|
||||||
float* _diagonalInches = NULL);
|
float* _diagonalInches = NULL);
|
||||||
|
|
||||||
|
status_t GetDeviceInfo(accelerant_device_info& info);
|
||||||
|
|
||||||
screen_mode ModeAt(int32 index);
|
screen_mode ModeAt(int32 index);
|
||||||
int32 CountModes();
|
int32 CountModes();
|
||||||
|
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
|
|||||||
B_ALL_WORKSPACES),
|
B_ALL_WORKSPACES),
|
||||||
fBootWorkspaceApplied(false),
|
fBootWorkspaceApplied(false),
|
||||||
fScreenMode(this),
|
fScreenMode(this),
|
||||||
fTempScreenMode(this),
|
fUndoScreenMode(this),
|
||||||
fModified(false)
|
fModified(false)
|
||||||
{
|
{
|
||||||
BScreen screen(this);
|
BScreen screen(this);
|
||||||
@@ -1034,7 +1034,7 @@ ScreenWindow::MessageReceived(BMessage* message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case BUTTON_UNDO_MSG:
|
case BUTTON_UNDO_MSG:
|
||||||
fTempScreenMode.Revert();
|
fUndoScreenMode.Revert();
|
||||||
_UpdateActiveMode();
|
_UpdateActiveMode();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1216,9 +1216,26 @@ ScreenWindow::_UpdateMonitor()
|
|||||||
if (info.produced.week != 0 && info.produced.year != 0
|
if (info.produced.week != 0 && info.produced.year != 0
|
||||||
&& length < sizeof(text)) {
|
&& length < sizeof(text)) {
|
||||||
length += snprintf(text + length, sizeof(text) - length,
|
length += snprintf(text + length, sizeof(text) - length,
|
||||||
"(%u/%u)", info.produced.week, info.produced.year);
|
" (%u/%u)", info.produced.week, info.produced.year);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add info about the graphics device
|
||||||
|
|
||||||
|
accelerant_device_info deviceInfo;
|
||||||
|
if (fScreenMode.GetDeviceInfo(deviceInfo) == B_OK
|
||||||
|
&& length < sizeof(text)) {
|
||||||
|
if (deviceInfo.name[0] && deviceInfo.chipset[0]) {
|
||||||
|
length += snprintf(text + length, sizeof(text) - length,
|
||||||
|
"%s%s (%s)", length != 0 ? "\n\n" : "", deviceInfo.name,
|
||||||
|
deviceInfo.chipset);
|
||||||
|
} else if (deviceInfo.name[0] || deviceInfo.chipset[0]) {
|
||||||
|
length += snprintf(text + length, sizeof(text) - length,
|
||||||
|
"%s%s", length != 0 ? "\n\n" : "", deviceInfo.name[0]
|
||||||
|
? deviceInfo.name : deviceInfo.chipset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (text[0])
|
if (text[0])
|
||||||
fMonitorView->SetToolTip(text);
|
fMonitorView->SetToolTip(text);
|
||||||
}
|
}
|
||||||
@@ -1237,7 +1254,8 @@ void
|
|||||||
ScreenWindow::_Apply()
|
ScreenWindow::_Apply()
|
||||||
{
|
{
|
||||||
// make checkpoint, so we can undo these changes
|
// make checkpoint, so we can undo these changes
|
||||||
fTempScreenMode.UpdateOriginalModes();
|
fUndoScreenMode.UpdateOriginalModes();
|
||||||
|
|
||||||
status_t status = fScreenMode.Set(fSelected);
|
status_t status = fScreenMode.Set(fSelected);
|
||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
// use the mode that has eventually been set and
|
// use the mode that has eventually been set and
|
||||||
|
|||||||
@@ -102,12 +102,15 @@ private:
|
|||||||
|
|
||||||
BButton* fBackgroundsButton;
|
BButton* fBackgroundsButton;
|
||||||
|
|
||||||
ScreenMode fScreenMode, fTempScreenMode;
|
ScreenMode fScreenMode;
|
||||||
|
ScreenMode fUndoScreenMode;
|
||||||
// screen modes for all workspaces
|
// screen modes for all workspaces
|
||||||
uint32 fOriginalWorkspacesColumns;
|
|
||||||
uint32 fOriginalWorkspacesRows;
|
|
||||||
screen_mode fActive, fSelected, fOriginal;
|
screen_mode fActive, fSelected, fOriginal;
|
||||||
// screen modes for the current workspace
|
// screen modes for the current workspace
|
||||||
|
|
||||||
|
uint32 fOriginalWorkspacesColumns;
|
||||||
|
uint32 fOriginalWorkspacesRows;
|
||||||
bool fModified;
|
bool fModified;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user