File indexing completed on 2024-05-05 04:39:54

0001 /*
0002     SPDX-FileCopyrightText: 2012-2013 Miquel Sabaté <mikisabate@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef GH_PROVIDERWIDGET_H
0008 #define GH_PROVIDERWIDGET_H
0009 
0010 
0011 #include <interfaces/iprojectprovider.h>
0012 
0013 
0014 class QLabel;
0015 class QComboBox;
0016 class QListView;
0017 class QModelIndex;
0018 
0019 
0020 namespace gh
0021 {
0022 
0023 class Resource;
0024 class Account;
0025 class LineEdit;
0026 
0027 /**
0028  * @class ProviderWidget
0029  *
0030  * This class will be the widget displayed in the "Fetch Project" dialog
0031  * when the user selects this plugin to fetch a project.
0032  */
0033 class ProviderWidget : public KDevelop::IProjectProviderWidget
0034 {
0035     Q_OBJECT
0036 
0037 public:
0038     /// Constructor.
0039     explicit ProviderWidget(QWidget *parent = nullptr);
0040 
0041     /// Re-implemented from KDevelop::IProjectProviderWidget.
0042     KDevelop::VcsJob * createWorkingCopy(const QUrl &dest) override;
0043 
0044     /// Re-implemented from KDevelop::IProjectProviderWidget.
0045     bool isCorrect() const override;
0046 
0047 private Q_SLOTS:
0048     /// Fill the m_combo member.
0049     void fillCombo();
0050 
0051     /// The user has selected a project, change the working directory.
0052     void projectIndexChanged(const QModelIndex &currentIndex);
0053 
0054     /// Show the settings dialog.
0055     void showSettings();
0056 
0057     /// Search the repo specified by the user.
0058     void searchRepo();
0059 
0060 private:
0061     QListView *m_projects;
0062     Resource *m_resource;
0063     LineEdit *m_edit;
0064     Account *m_account;
0065     QComboBox *m_combo;
0066     QLabel *m_waiting;
0067 };
0068 
0069 } // End of namespace gh
0070 
0071 
0072 #endif // GH_PROVIDERWIDGET_H