VM Preflet: Center properly on screen

* On first run, dialog was at 0,0
* Rename window location/settings file
  from VM_data to virtualmemory_preferences
This commit is contained in:
Alexander von Gluck IV 2012-09-07 00:34:00 +00:00
parent 534268052d
commit 5dff42570e
2 changed files with 4 additions and 6 deletions

View File

@ -25,7 +25,7 @@
#include <driver_settings.h>
static const char* const kWindowSettingsFile = "VM_data";
static const char* const kWindowSettingsFile = "virtualmemory_preferences";
static const char* const kVirtualMemorySettings = "virtual_memory";
static const off_t kMegaByte = 1024 * 1024;

View File

@ -126,10 +126,10 @@ SettingsWindow::SettingsWindow()
gBootDev = dev_for_path("/boot");
BAlignment align(B_ALIGN_LEFT, B_ALIGN_MIDDLE);
if (fSettings.ReadWindowSettings() == B_OK)
MoveTo(fSettings.WindowPosition());
else
if (fSettings.ReadWindowSettings() != B_OK)
CenterOnScreen();
else
MoveTo(fSettings.WindowPosition());
status_t result = fSettings.ReadSwapSettings();
if (result == kErrorSettingsNotFound)
@ -243,8 +243,6 @@ SettingsWindow::SettingsWindow()
BRect screenFrame = screen.Frame();
if (!screenFrame.Contains(fSettings.WindowPosition()))
CenterOnScreen();
else
MoveTo(fSettings.WindowPosition());
#ifdef SWAP_VOLUME_IMPLEMENTED
// Validate the volume specified in settings file