1 | /**
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
4 | * "Snapshot details" dialog UI include (Qt Designer)
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | /****************************************************************************
|
---|
24 | ** ui.h extension file, included from the uic-generated form implementation.
|
---|
25 | **
|
---|
26 | ** If you wish to add, delete or rename functions or slots use
|
---|
27 | ** Qt Designer which will update this file, preserving your code. Create an
|
---|
28 | ** init() function in place of a constructor, and a destroy() function in
|
---|
29 | ** place of a destructor.
|
---|
30 | *****************************************************************************/
|
---|
31 |
|
---|
32 |
|
---|
33 | void VBoxSnapshotDetailsDlg::init()
|
---|
34 | {
|
---|
35 | setIcon (QPixmap::fromMimeSource ("settings_16px.png"));
|
---|
36 |
|
---|
37 | txeSummary->setPaper (this->backgroundBrush());
|
---|
38 | txeSummary->setLinkUnderline (false);
|
---|
39 |
|
---|
40 | // filter out Enter keys in order to direct them to the default dlg button
|
---|
41 | QIKeyFilter *ef = new QIKeyFilter (this, Key_Enter);
|
---|
42 | ef->watchOn (txeSummary);
|
---|
43 |
|
---|
44 | txeSummary->setFocus();
|
---|
45 | }
|
---|
46 |
|
---|
47 | void VBoxSnapshotDetailsDlg::getFromSnapshot (const CSnapshot &s)
|
---|
48 | {
|
---|
49 | csnapshot = s;
|
---|
50 | CMachine machine = s.GetMachine();
|
---|
51 |
|
---|
52 | // get properties
|
---|
53 | leName->setText (s.GetName());
|
---|
54 | txeDescription->setText (s.GetDescription());
|
---|
55 |
|
---|
56 | // compose summary
|
---|
57 | txeSummary->setText (
|
---|
58 | vboxGlobal().detailsReport (machine, false /* isNewVM */,
|
---|
59 | false /* withLinks */));
|
---|
60 | setCaption (tr ("Details of %1 (%2)")
|
---|
61 | .arg (csnapshot.GetName()).arg (machine.GetName()));
|
---|
62 | }
|
---|
63 |
|
---|
64 | void VBoxSnapshotDetailsDlg::putBackToSnapshot()
|
---|
65 | {
|
---|
66 | AssertReturn (!csnapshot.isNull(), (void) 0);
|
---|
67 |
|
---|
68 | csnapshot.SetName (leName->text());
|
---|
69 | csnapshot.SetDescription (txeDescription->text());
|
---|
70 | }
|
---|
71 |
|
---|
72 | void VBoxSnapshotDetailsDlg::leName_textChanged (const QString &aText)
|
---|
73 | {
|
---|
74 | buttonOk->setEnabled (!aText.stripWhiteSpace().isEmpty());
|
---|
75 | }
|
---|
76 |
|
---|