summaryrefslogtreecommitdiffstats
path: root/ui/qt/widgets/path_selection_edit.h
blob: 1c0f9fbb0ac71ee1034455346750724d2fb24264 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* path_chooser_delegate.cpp
 * Delegate to select a file path for a treeview entry
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef PATH_SELECTOR_EDIT_H
#define PATH_SELECTOR_EDIT_H

#include <QWidget>
#include <QString>
#include <QLineEdit>
#include <QToolButton>

class PathSelectionEdit : public QWidget
{
    Q_OBJECT

public:
    PathSelectionEdit(QString title, QString path, bool selectFile, QWidget *parent = 0);
    PathSelectionEdit(QWidget *parent = 0);

    QString path() const;

public slots:
    void setPath(QString newPath = QString());

signals:
    void pathChanged(QString newPath);

protected slots:
    void browseForPath();

private:
    QString _title;
    QString _path;
    bool _selectFile;

    QLineEdit * _edit;
    QToolButton * _button;
};

#endif // PATH_SELECTOR_EDIT_H