1 | /* $Id: UIVMNamePathSelector.h 72225 2018-05-16 11:03:25Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIVMNamePathSelector class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2008-2018 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef ___UIVMNamePathSelector_h___
|
---|
19 | #define ___UIVMNamePathSelector_h___
|
---|
20 |
|
---|
21 | /* Qt includes: */
|
---|
22 | #include <QLineEdit>
|
---|
23 |
|
---|
24 | /* GUI includes: */
|
---|
25 | #include "QIWithRetranslateUI.h"
|
---|
26 |
|
---|
27 | /* Forward declarations: */
|
---|
28 | class QHBoxLayout;
|
---|
29 | class QILabel;
|
---|
30 | class QILineEdit;
|
---|
31 | class QIToolButton;
|
---|
32 |
|
---|
33 | class SHARED_LIBRARY_STUFF UIVMNamePathSelector : public QIWithRetranslateUI<QWidget>
|
---|
34 | {
|
---|
35 | Q_OBJECT;
|
---|
36 |
|
---|
37 | signals:
|
---|
38 |
|
---|
39 | void sigNameChanged(const QString &strName);
|
---|
40 | void sigPathChanged(const QString &strName);
|
---|
41 |
|
---|
42 | public:
|
---|
43 |
|
---|
44 | UIVMNamePathSelector(QWidget *pParent = 0);
|
---|
45 |
|
---|
46 | public slots:
|
---|
47 |
|
---|
48 | QString path() const;
|
---|
49 | void setPath(const QString &path);
|
---|
50 |
|
---|
51 | QString name() const;
|
---|
52 | void setName(const QString &name);
|
---|
53 | void setNameFieldValidator(const QString &strValidatorString);
|
---|
54 |
|
---|
55 | void setToolTipText(const QString &strToolTipText);
|
---|
56 | const QString& toolTipText() const;
|
---|
57 |
|
---|
58 | protected:
|
---|
59 |
|
---|
60 | void retranslateUi() /* override */;
|
---|
61 | virtual void showEvent(QShowEvent *pEvent) /* override */;
|
---|
62 |
|
---|
63 | private slots:
|
---|
64 |
|
---|
65 | void sltOpenPathSelector();
|
---|
66 |
|
---|
67 | private:
|
---|
68 |
|
---|
69 | void prepareWidgets();
|
---|
70 | QString defaultMachineFolder() const;
|
---|
71 |
|
---|
72 | QHBoxLayout *m_pMainLayout;
|
---|
73 | QILineEdit *m_pPath;
|
---|
74 | QILineEdit *m_pName;
|
---|
75 | QILabel *m_pSeparator;
|
---|
76 | QIToolButton *m_pFileDialogButton;
|
---|
77 | /** Tooltip set is set by clients of this widget. */
|
---|
78 | QString m_strToolTipText;
|
---|
79 | /** Path string whose separators are not converted to native ones. */
|
---|
80 | QString m_strNonNativePath;
|
---|
81 | };
|
---|
82 |
|
---|
83 | #endif /* !___UIVMNamePathSelector_h___ */
|
---|