VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIEmptyFilePathSelector.h

Last change on this file was 104358, checked in by vboxsync, 4 weeks ago

FE/Qt. bugref:10622. More refactoring around the retranslation functionality.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1/* $Id: UIEmptyFilePathSelector.h 104358 2024-04-18 05:33:40Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIEmptyFilePathSelector class declaration.
4 */
5
6/*
7 * Copyright (C) 2008-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef FEQT_INCLUDED_SRC_widgets_UIEmptyFilePathSelector_h
29#define FEQT_INCLUDED_SRC_widgets_UIEmptyFilePathSelector_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes */
35#include <QComboBox>
36
37/* VBox forward declarations */
38class QILabel;
39class QILineEdit;
40
41/* Qt forward declarations */
42class QHBoxLayout;
43class QAction;
44class QToolButton;
45
46
47class UIEmptyFilePathSelector: public QWidget
48{
49 Q_OBJECT;
50
51public:
52
53 enum Mode
54 {
55 Mode_Folder = 0,
56 Mode_File_Open,
57 Mode_File_Save
58 };
59
60 enum ButtonPosition
61 {
62 LeftPosition,
63 RightPosition
64 };
65
66 UIEmptyFilePathSelector (QWidget *aParent = NULL);
67
68 void setMode (UIEmptyFilePathSelector::Mode aMode);
69 UIEmptyFilePathSelector::Mode mode() const;
70
71 void setButtonPosition (ButtonPosition aPos);
72 ButtonPosition buttonPosition() const;
73
74 void setEditable (bool aOn);
75 bool isEditable() const;
76
77 void setChooserVisible (bool aOn);
78 bool isChooserVisible() const;
79
80 QString path() const;
81
82 void setDefaultSaveExt (const QString &aExt);
83 QString defaultSaveExt() const;
84
85 bool isModified () const { return mIsModified; }
86 void resetModified () { mIsModified = false; }
87
88 void setChooseButtonToolTip(const QString &strToolTip);
89 QString chooseButtonToolTip() const;
90
91 void setFileDialogTitle (const QString& aTitle);
92 QString fileDialogTitle() const;
93
94 void setFileFilters (const QString& aFilters);
95 QString fileFilters() const;
96
97 void setHomeDir (const QString& aDir);
98 QString homeDir() const;
99
100signals:
101 void pathChanged (QString);
102
103public slots:
104 void setPath (const QString& aPath);
105
106private slots:
107
108 void sltRetranslateUI();
109 void choose();
110 void textChanged (const QString& aPath);
111
112private:
113 /* Private member vars */
114 QHBoxLayout *mMainLayout;
115 QWidget *mPathWgt;
116 QILabel *mLabel;
117 UIEmptyFilePathSelector::Mode mMode;
118 QILineEdit *mLineEdit;
119 QToolButton *mSelectButton;
120 bool m_fButtonToolTipSet;
121 QString mFileDialogTitle;
122 QString mFileFilters;
123 QString mDefaultSaveExt;
124 QString mHomeDir;
125 bool mIsModified;
126 QString mPath;
127};
128
129#endif /* !FEQT_INCLUDED_SRC_widgets_UIEmptyFilePathSelector_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use