VBoxSnapshotsWgt.ui.h revision b9042bb7a5efd07d617a8a7d812b669d75682779
/**
*
* VBox frontends: Qt GUI ("VirtualBox"):
* Snapshot details dialog (Qt Designer)
*/
/*
* Copyright (C) 2006 InnoTek Systemberatung GmbH
*
* 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 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.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you want to add, delete, or rename functions or slots, use
** Qt Designer to update this file, preserving your code.
**
** You should not define a constructor or destructor in this file.
** Instead, write your code in functions called init() and destroy().
** These will automatically be called by the form's constructor and
** destructor.
*****************************************************************************/
/** QListViewItem subclass for snapshots */
{
/** Normal snapshot item */
: QListViewItem (lv)
{
recache();
}
/** Normal snapshot item */
: QListViewItem (lvi)
{
recache();
}
/** Current state item */
: QListViewItem (lv)
{
recache();
}
/** Current state item */
: QListViewItem (lvi)
{
recache();
}
{
repaint();
}
{
repaint();
}
{
}
{
}
void recache()
{
{
mCurStateModified = false;
}
else
{
setText (0, mCurStateModified ?
"Current State (Modified)") :
"Current State (Unmodified)"));
"stored in the current snapshot") :
parent() != 0 ? /* we're not the only item in the view */
"stored in the current snapshot") :
}
}
{
}
QString toolTipText() const
{
{
/* the current snapshot is always bold */
if (mBld)
else
details = " (";
if (dateTimeToday)
else
}
else
{
}
return toolTip;
}
{
}
bool mBld : 1;
bool mItal : 1;
bool mOnline;
bool mCurStateModified;
};
////////////////////////////////////////////////////////////////////////////////
/** Tooltips for snapshots */
{
{}
{
remove (parentWidget());
}
};
{
if (!lvi)
return;
{
/*
* Ensure the main window doesn't show the text from the previous
* tooltip in the status bar.
*/
toolTipGroup();
if (toolTipGroup)
{
}
}
}
////////////////////////////////////////////////////////////////////////////////
void VBoxSnapshotsWgt::init()
{
mCurSnapshotItem = 0;
listView->setRootIsDecorated (true);
/* we have our own tooltips */
listView->setShowToolTips (false);
/* disable sorting */
/* disable unselecting items by clicking in the unused area of the list */
/* toolbar */
toolBar->addSeparator();
toolBar->addSeparator();
toolBar->setUsesTextLabel (false);
toolBar->setUsesBigPixmaps (true);
/* context menu */
mContextMenuDirty = true;
/* icons */
"discard_snapshot_22px.png", "discard_snapshot_16px.png",
"discard_snapshot_dis_22px.png", "discard_snapshot_dis_16px.png"));
"take_snapshot_22px.png", "take_snapshot_16px.png",
"take_snapshot_dis_22px.png", "take_snapshot_dis_16px.png"));
"discard_cur_state_22px.png", "discard_cur_state_16px.png",
"discard_cur_state_dis_22px.png", "discard_cur_state_dis_16px.png"));
"discard_cur_state_snapshot_22px.png", "discard_cur_state_snapshot_16px.png",
"discard_cur_state_snapshot_dis_22px.png", "discard_cur_state_snapshot_dis_16px.png"));
"show_snapshot_details_22px.png", "show_snapshot_details_16px.png",
"show_snapshot_details_dis_22px.png", "show_snapshot_details_dis_16px.png"));
/* tooltip */
}
void VBoxSnapshotsWgt::destroy()
{
}
{
refreshAll();
}
{
{
return lvi;
++ it;
}
return 0;
}
{
if (aKeepSelected)
{
if (cur)
{
if (cur->firstChild())
}
}
{
return;
}
/* get the first snapshot */
if (mMachine.GetSnapshotCount() > 0)
{
populateSnapshots (snapshot, 0);
/* add the "current state" item */
ListViewItem *cur = 0;
if (aKeepSelected)
{
if (cur == 0)
}
if (cur == 0)
cur = curStateItem();
}
else
{
/* add the "current state" item */
/*
* stupid Qt doesn't issue this signal when only one item is added
* to the empty list -- do it manually
*/
}
listView->adjustColumn (0);
}
{
: listView->firstChild();
}
{
ListViewItem *si = 0;
if (item)
else
{
}
{
}
si->setRenameEnabled (0, true);
}
{
if (item)
/* the Take Snapshot action is always enabled for the current state */
(item && !mCurSnapshotItem));
mContextMenuDirty = true;
}
void VBoxSnapshotsWgt::
int /* col */)
{
if (!item)
return;
if (mContextMenuDirty)
{
mContextMenu->clear();
if (!mCurSnapshotItem)
{
/* we have only one item -- current state */
}
else
{
{
/* current state is selected */
}
else
{
/* snapshot is selected */
}
}
mContextMenuDirty = false;
}
}
void VBoxSnapshotsWgt::discardSnapshot()
{
AssertReturn (item, (void) 0);
/* open a direct session (this call will handle all errors) */
return;
{
/* show the progress dialog */
vboxProblem().mainWindowShown());
if (progress.GetResultCode() != 0)
}
else
}
void VBoxSnapshotsWgt::takeSnapshot()
{
AssertReturn (item, (void) 0);
{
/* open a direct session (this call will handle all errors) */
return;
{
/* show the progress dialog */
vboxProblem().mainWindowShown());
if (progress.GetResultCode() != 0)
}
else
}
}
void VBoxSnapshotsWgt::discardCurState()
{
AssertReturn (item, (void) 0);
/* open a direct session (this call will handle all errors) */
return;
{
/* show the progress dialog */
vboxProblem().mainWindowShown());
if (progress.GetResultCode() != 0)
}
else
}
{
AssertReturn (item, (void) 0);
/* open a direct session (this call will handle all errors) */
return;
{
/* show the progress dialog */
vboxProblem().mainWindowShown());
if (progress.GetResultCode() != 0)
}
else
}
void VBoxSnapshotsWgt::showSnapshotDetails()
{
AssertReturn (item, (void) 0);
{
}
}
{
return; /* not interested in other machines */
curStateItem()->recache();
}
{
return; /* not interested in other machines */
curStateItem()->recache();
}
{
return; /* not interested in other machines */
{
case VBoxSnapshotEvent::Taken:
case VBoxSnapshotEvent::Discarded:
{
refreshAll (true);
break;
}
case VBoxSnapshotEvent::Changed:
{
if (!lvi)
refreshAll();
else
{
}
break;
}
}
}