forked from qt-creator/qt-creator
Git: Auto stash for branches
Allow user to handle local changes when switching branches. Task-number: QTCREATORBUG-8417 Change-Id: I62d615aadfbd81c8ae03f3cd292b98773a36e1e7 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Tobias Hunger
parent
7df112b687
commit
81bf2ec154
45
src/plugins/git/branchcheckoutdialog.h
Normal file
45
src/plugins/git/branchcheckoutdialog.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef BRANCHCHECKOUTDIALOG_H
|
||||
#define BRANCHCHECKOUTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
namespace Ui {
|
||||
class BranchCheckoutDialog;
|
||||
}
|
||||
|
||||
class BranchCheckoutDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BranchCheckoutDialog(QWidget *parent, const QString& currentBranch,
|
||||
const QString& nextBranch);
|
||||
~BranchCheckoutDialog();
|
||||
|
||||
void foundNoLocalChanges();
|
||||
void foundStashForNextBranch();
|
||||
|
||||
bool makeStashOfCurrentBranch();
|
||||
bool moveLocalChangesToNextBranch();
|
||||
bool discardLocalChanges();
|
||||
bool popStashOfNextBranch();
|
||||
|
||||
bool hasStashForNextBranch();
|
||||
bool hasLocalChanges();
|
||||
|
||||
private slots:
|
||||
void updatePopStashCheckBox(bool moveChangesChecked);
|
||||
|
||||
private:
|
||||
Ui::BranchCheckoutDialog *m_ui;
|
||||
bool m_foundStashForNextBranch;
|
||||
bool m_hasLocalChanges;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Git
|
||||
|
||||
#endif // BRANCHCHECKOUTDIALOG_H
|
||||
Reference in New Issue
Block a user