2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2010-01-04 11:36:55 +01:00
|
|
|
|
2016-02-03 12:15:21 +01:00
|
|
|
#pragma once
|
2009-03-23 12:03:20 +01:00
|
|
|
|
2013-01-02 22:12:06 +02:00
|
|
|
#include "vcsbase_global.h"
|
2009-03-23 12:03:20 +01:00
|
|
|
|
2022-07-29 15:56:28 +02:00
|
|
|
#include <QWidget>
|
2009-03-23 12:03:20 +01:00
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QCompleter;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2013-01-02 22:12:06 +02:00
|
|
|
namespace VcsBase {
|
2009-03-23 12:03:20 +01:00
|
|
|
|
|
|
|
|
struct SubmitFieldWidgetPrivate;
|
|
|
|
|
|
2013-01-02 22:12:06 +02:00
|
|
|
class VCSBASE_EXPORT SubmitFieldWidget : public QWidget
|
2009-03-23 12:03:20 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2018-09-20 01:32:36 +03:00
|
|
|
explicit SubmitFieldWidget(QWidget *parent = nullptr);
|
2016-02-03 12:15:21 +01:00
|
|
|
~SubmitFieldWidget() override;
|
2009-03-23 12:03:20 +01:00
|
|
|
|
|
|
|
|
QStringList fields() const;
|
|
|
|
|
void setFields(const QStringList&);
|
|
|
|
|
|
|
|
|
|
bool hasBrowseButton() const;
|
|
|
|
|
void setHasBrowseButton(bool d);
|
|
|
|
|
|
|
|
|
|
// Allow several entries for fields ("reviewed-by: a", "reviewed-by: b")
|
|
|
|
|
bool allowDuplicateFields() const;
|
|
|
|
|
void setAllowDuplicateFields(bool);
|
|
|
|
|
|
|
|
|
|
QCompleter *completer() const;
|
|
|
|
|
void setCompleter(QCompleter *c);
|
|
|
|
|
|
|
|
|
|
QString fieldValue(int pos) const;
|
|
|
|
|
void setFieldValue(int pos, const QString &value);
|
|
|
|
|
|
|
|
|
|
QString fieldValues() const;
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void browseButtonClicked(int pos, const QString &field);
|
|
|
|
|
|
2016-02-03 12:15:21 +01:00
|
|
|
private:
|
2022-07-21 13:03:09 +02:00
|
|
|
void slotRemove(int pos);
|
|
|
|
|
void slotComboIndexChanged(int pos, int comboIndex);
|
2009-03-23 12:03:20 +01:00
|
|
|
|
|
|
|
|
void removeField(int index);
|
|
|
|
|
bool comboIndexChange(int fieldNumber, int index);
|
|
|
|
|
void createField(const QString &f);
|
|
|
|
|
|
2011-09-07 14:26:11 +02:00
|
|
|
SubmitFieldWidgetPrivate *d;
|
2009-03-23 12:03:20 +01:00
|
|
|
};
|
|
|
|
|
|
2013-01-02 22:12:06 +02:00
|
|
|
} // namespace VcsBase
|