File indexing completed on 2024-04-28 04:37:24

0001 /*
0002     SPDX-FileCopyrightText: 2008 Andreas Pakulat <apaku@gmx.de>
0003     SPDX-FileCopyrightText: 2010 David Nolden <david.nolden.kdevelop@art-master.de>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef SESSIONCHOOSERDIALOG_H
0009 #define SESSIONCHOOSERDIALOG_H
0010 
0011 #include <QDialog>
0012 #include <QTimer>
0013 
0014 class QDialogButtonBox;
0015 class QModelIndex;
0016 class QListView;
0017 class QLineEdit;
0018 class QAbstractItemModel;
0019 
0020 namespace KDevelop {
0021 
0022 class SessionChooserDialog : public QDialog
0023 {
0024     Q_OBJECT
0025 public:
0026     SessionChooserDialog(QListView* view, QAbstractItemModel* model, QLineEdit* filter);
0027 
0028     bool eventFilter(QObject* object, QEvent* event) override;
0029 
0030     QWidget* mainWidget() const;
0031 
0032 public Q_SLOTS:
0033     void updateState();
0034     void doubleClicked(const QModelIndex& index);
0035     void filterTextChanged();
0036 
0037 private Q_SLOTS:
0038     void deleteButtonPressed();
0039     void showDeleteButton();
0040     void itemEntered(const QModelIndex& index);
0041 
0042 private:
0043     QListView* const m_view;
0044     QAbstractItemModel* const m_model;
0045     QLineEdit* const m_filter;
0046     QTimer m_updateStateTimer;
0047 
0048     QDialogButtonBox* m_buttonBox;
0049     QWidget* m_mainWidget;
0050     QPushButton* m_deleteButton;
0051     QTimer m_deleteButtonTimer;
0052     int m_deleteCandidateRow;
0053 };
0054 
0055 }
0056 
0057 #endif // SESSIONCHOOSERDIALOG_H