OpenMW
apps/launcher/utils/profilescombobox.hpp
Go to the documentation of this file.
00001 #ifndef PROFILESCOMBOBOX_HPP
00002 #define PROFILESCOMBOBOX_HPP
00003 
00004 #include "components/contentselector/view/combobox.hpp"
00005 #include "lineedit.hpp"
00006 
00007 #include <QDebug>
00008 
00009 class QString;
00010 
00011 class ProfilesComboBox : public ContentSelectorView::ComboBox
00012 {
00013     Q_OBJECT
00014 
00015 public:
00016     class ComboBoxLineEdit : public LineEdit
00017     {
00018     public:
00019         explicit ComboBoxLineEdit (QWidget *parent = 0);
00020     };
00021 
00022 public:
00023 
00024     explicit ProfilesComboBox(QWidget *parent = 0);
00025     void setEditEnabled(bool editable);
00026     void setCurrentProfile(int index)
00027     {
00028         ComboBox::setCurrentIndex(index);
00029         mOldProfile = currentText();
00030     }
00031 
00032 signals:
00033     void signalProfileTextChanged(const QString &item);
00034     void signalProfileChanged(const QString &previous, const QString &current);
00035     void signalProfileChanged(int index);
00036     void profileRenamed(const QString &oldName, const QString &newName);
00037 
00038 private slots:
00039 
00040     void slotEditingFinished();
00041     void slotIndexChangedByUser(int index);
00042     void slotTextChanged(const QString &text);
00043 
00044 private:
00045     QString mOldProfile;
00046 };
00047 #endif // PROFILESCOMBOBOX_HPP