File indexing completed on 2024-04-28 04:37:23
0001 /* 0002 SPDX-FileCopyrightText: 2010 Aleix Pol Gonzalez <aleixpol@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef KDEVPLATFORM_PROJECTSOURCEPAGE_H 0008 #define KDEVPLATFORM_PROJECTSOURCEPAGE_H 0009 0010 #include <QWidget> 0011 0012 class KJob; 0013 class QUrl; 0014 namespace Ui { class ProjectSourcePage; } 0015 namespace KDevelop 0016 { 0017 class VcsJob; 0018 class IProjectProvider; 0019 class IProjectProviderWidget; 0020 class IPlugin; 0021 class IBasicVersionControl; 0022 class VcsLocationWidget; 0023 0024 class ProjectSourcePage : public QWidget 0025 { 0026 Q_OBJECT 0027 public: 0028 explicit ProjectSourcePage(const QUrl& initial, const QUrl& repoUrl, IPlugin* preSelectPlugin, 0029 QWidget* parent = nullptr); 0030 ~ProjectSourcePage() override; 0031 0032 QUrl workingDir() const; 0033 0034 private Q_SLOTS: 0035 void setSourceIndex(int index); 0036 void checkoutVcsProject(); 0037 void projectReceived(KJob* job); 0038 void reevaluateCorrection(); 0039 void progressChanged(KJob*, unsigned long); 0040 void infoMessage(KJob*, const QString& text, const QString& rich); 0041 void locationChanged(); 0042 void projectChanged(const QString& name); 0043 0044 Q_SIGNALS: 0045 void isCorrect(bool); 0046 0047 private: 0048 void setSourceWidget(int index, const QUrl& repoUrl); 0049 void setStatus(const QString& message); 0050 void clearStatus(); 0051 0052 KDevelop::IBasicVersionControl* vcsPerIndex(int index); 0053 KDevelop::IProjectProvider* providerPerIndex(int index); 0054 KDevelop::VcsJob* jobPerCurrent(); 0055 0056 Ui::ProjectSourcePage* m_ui; 0057 QList<KDevelop::IPlugin*> m_plugins; 0058 KDevelop::VcsLocationWidget* m_locationWidget; 0059 KDevelop::IProjectProviderWidget* m_providerWidget; 0060 }; 0061 0062 } 0063 #endif // KDEVPLATFORM_PROJECTSOURCEPAGE_H