File indexing completed on 2024-04-14 05:34:13

0001 /*
0002     SPDX-FileCopyrightText: 2011 Vishesh Yadav <vishesh3y@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef HGBUNDLEDIALOG_H
0008 #define HGBUNDLEDIALOG_H
0009 
0010 #include "dialogbase.h"
0011 
0012 class QGroupBox;
0013 class QCheckBox;
0014 class QLineEdit;
0015 class HgCommitInfoWidget;
0016 class HgPathSelector;
0017 
0018 /**
0019  * Dialog which implements bundle feature of Mercurial. Bundle enables
0020  * user to creates a file containing all the selected/desired changesets
0021  * in mercurial's internal format rather than patches. 
0022  * 
0023  * Changesets can either be selected by user or after being compared by
0024  * remote repository selected.
0025  *
0026  */
0027 class HgBundleDialog : public DialogBase
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     explicit HgBundleDialog(QWidget *parent=nullptr);
0033 
0034 public Q_SLOTS:
0035     void done(int r) override;
0036 
0037 private Q_SLOTS:
0038     void saveGeometry();
0039 
0040     /**
0041      * Opens a dialog listing all changeset from which user will select a 
0042      * changeset for base revision. 
0043      */
0044     void slotSelectChangeset();
0045     void slotAllChangesCheckToggled(int state);
0046 
0047 private:
0048     void setupUI();
0049 
0050     /**
0051      * Creates bundle file.
0052      *
0053      * @param fileName Path to file where bundle will be created.
0054      */
0055     void createBundle(const QString &fileName);
0056 
0057     /**
0058      * Find all changesets in repository and show them in Commit Selector in 
0059      * Base Changeset selector.
0060      */
0061     void loadCommits();
0062 
0063 private:
0064     QGroupBox *m_mainGroup;
0065     HgPathSelector *m_pathSelect;
0066     HgCommitInfoWidget *m_commitInfo;
0067     QPushButton *m_selectCommitButton;
0068     QLineEdit *m_baseRevision;
0069     QCheckBox *m_allChangesets;
0070 
0071     //options
0072     QGroupBox *m_optionGroup;
0073     QCheckBox *m_optForce;
0074     QCheckBox *m_optInsecure;
0075 };
0076 
0077 #endif /* HGBUNDLEDIALOG_H */
0078