File indexing completed on 2024-04-14 05:34:15
0001 /* 0002 SPDX-FileCopyrightText: 2011 Vishesh Yadav <vishesh3y@gmail.com> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef HGPATHSELECTOR_H 0008 #define HGPATHSELECTOR_H 0009 0010 #include <QWidget> 0011 #include <QMap> 0012 0013 class KComboBox; 0014 class QLineEdit; 0015 0016 /** 0017 * A simple widget which presents a ComboBox to select list of Path aliases 0018 * stored in .hgrc file and show their URL. URL's can be entered manually 0019 * as well. 0020 */ 0021 class HgPathSelector : public QWidget 0022 { 0023 Q_OBJECT 0024 0025 public: 0026 explicit HgPathSelector(QWidget *parent=nullptr); 0027 0028 /** 0029 * @return Return QString containing the selected/entered alias/URL 0030 */ 0031 const QString remote() const; 0032 0033 public Q_SLOTS: 0034 void reload(); 0035 0036 private: 0037 void setupUI(); 0038 0039 private Q_SLOTS: 0040 void slotChangeEditUrl(int index); 0041 0042 private: 0043 QMap<QString, QString> m_pathList; 0044 KComboBox *m_selectPathAlias; 0045 QLineEdit *m_urlEdit; 0046 }; 0047 0048 #endif /* HGPATHSELECTOR_H */ 0049