2013-10-22 21:52:35 -05:00
|
|
|
#ifndef PROFILESCOMBOBOX_HPP
|
|
|
|
#define PROFILESCOMBOBOX_HPP
|
|
|
|
|
|
|
|
#include "components/contentselector/view/combobox.hpp"
|
|
|
|
#include "lineedit.hpp"
|
|
|
|
|
2022-06-16 21:29:55 +02:00
|
|
|
#include <QWidget>
|
2013-11-03 14:02:41 -06:00
|
|
|
|
2013-10-22 21:52:35 -05:00
|
|
|
class QString;
|
|
|
|
|
|
|
|
class ProfilesComboBox : public ContentSelectorView::ComboBox
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
class ComboBoxLineEdit : public LineEdit
|
|
|
|
{
|
|
|
|
public:
|
2020-11-13 11:39:47 +04:00
|
|
|
explicit ComboBoxLineEdit(QWidget* parent = nullptr);
|
2013-10-22 21:52:35 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
2020-11-13 11:39:47 +04:00
|
|
|
explicit ProfilesComboBox(QWidget* parent = nullptr);
|
2013-10-22 21:52:35 -05:00
|
|
|
void setEditEnabled(bool editable);
|
2013-11-03 14:02:41 -06:00
|
|
|
void setCurrentProfile(int index)
|
|
|
|
{
|
|
|
|
ComboBox::setCurrentIndex(index);
|
|
|
|
mOldProfile = currentText();
|
|
|
|
}
|
2013-10-22 21:52:35 -05:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void signalProfileTextChanged(const QString& item);
|
|
|
|
void signalProfileChanged(const QString& previous, const QString& current);
|
|
|
|
void signalProfileChanged(int index);
|
|
|
|
void profileRenamed(const QString& oldName, const QString& newName);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
void slotEditingFinished();
|
|
|
|
void slotIndexChangedByUser(int index);
|
|
|
|
void slotTextChanged(const QString& text);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString mOldProfile;
|
|
|
|
};
|
|
|
|
#endif // PROFILESCOMBOBOX_HPP
|