VBoxVMSettingsHD.h revision 9f038400f4857fe63db67c7db3b0a9197bd9e06f
/** @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 removeAddController();
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;
{
{
}
}
bool showDiffs() const { return mShowDiffs; }
void setShowDiffs (bool aShowDiffs)
{
update();
}
virtual ~HDSettings();
void update()
{
mModel->updateDisks();
}
void makeIDEList();
void makeAddControllerList();
void makeMediumList();
static HDSettings *mInstance;
int mAddCount;
bool mShowDiffs;
};
/**
* QWidget class reimplementation.
* Used as HD Settings widget.
*/
{
void hdChanged();
void putBackTo();
void retranslateUi();
void addAttachment();
void delAttachment();
void showMediaManager();
void onAddControllerCheckToggled (int);
void onAddControllerTypeChanged (int aIndex);
bool checkAddControllers (int aWhat);
void onShowDiffsCheckToggled (int);
/* events */
/* private functions */
int maxNameLength() const;
void removeFocus();
{
return static_cast<KStorageControllerType> (mCbControllerType->itemData (mCbControllerType->currentIndex()).toInt());
}
KStorageBus currentBusType() const
{
}
int currentMaxPortCount() const
{
int c = 0;
switch (currentBusType())
{
case KStorageBus_IDE: c = 2; break;
case KStorageBus_SATA: c = 30; break;
case KStorageBus_SCSI: c = 16; break;
default: break;
}
return c;
}
/* variables */
bool mWasTableSelected;
bool mPolished;
};
#endif // __VBoxVMSettingsHD_h__