VBoxVMSettingsHD.h revision dcea3eadf1ecc8f4ac868185a05a63be42a199e4
/** @file
*
* VBox frontends: Qt4 GUI ("VirtualBox"):
* VBoxVMSettingsHD class declaration
*/
/*
* Copyright (C) 2006-2008 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#ifndef __VBoxVMSettingsHD_h__
#define __VBoxVMSettingsHD_h__
#include "VBoxSettingsPage.h"
#include "VBoxVMSettingsHD.gen.h"
#include "COMDefs.h"
#include "VBoxMediaComboBox.h"
/* Qt includes */
#include <QComboBox>
/** Register type to store slot data */
{
{
return *this;
}
{
}
{
}
};
/** Register type to store disk data */
{
{
return *this;
}
{
}
{
}
};
/** Declare type to store both slot&disk data */
{
/* Define sorting rules */
{
(slot.bus == aOther.slot.bus && slot.channel == aOther.slot.channel && slot.device < aOther.slot.device);
}
};
/**
* QAbstractTableModel class reimplementation.
*/
{
void removeSata();
void updateDisks();
int mSlotId;
int mDiskId;
};
/**
* QComboBox class reimplementation.
* Used as editor for HD Attachment SLOT field.
*/
{
void onActivate();
#if 0 /* F2 key binding left for future releases... */
#endif
};
/**
* VBoxMediaComboBox class reimplementation.
* Used as editor for HD Attachment DISK field.
*/
{
static DiskEditor* activeEditor();
~DiskEditor();
void onActivate();
#if 0 /* F2 key binding left for future releases... */
#endif
static DiskEditor *mInstance;
};
/**
* Singleton QObject class reimplementation.
* Used to make selected HD Attachments slots unique &
* stores some specific data used for HD Settings.
*/
{
AttachmentsModel *aWatched = 0);
bool aFilter = false) const;
int sataCount() const { return mSataCount; }
void setSataCount (int aSataCount)
{
if (mSataCount != aSataCount)
{
makeSATAList();
}
}
bool showDiffs() const { return mShowDiffs; }
void setShowDiffs (bool aShowDiffs)
{
update();
}
virtual ~HDSettings();
void update()
{
mModel->updateDisks();
}
void makeIDEList();
void makeSATAList();
void makeMediumList();
static HDSettings *mInstance;
int mSataCount;
bool mShowDiffs;
};
/**
* QWidget class reimplementation.
* Used as HD Settings widget.
*/
{
void hdChanged();
void putBackTo();
void retranslateUi();
void addAttachment();
void delAttachment();
void showMediaManager();
void onSATACheckToggled (int);
void onShowDiffsCheckToggled (int);
/* events */
/* private functions */
int maxNameLength() const;
/* variables */
bool mWasTableSelected;
bool mPolished;
};
#endif // __VBoxVMSettingsHD_h__