Git: Rework branch dialog

* Make adding new branches more discoverable
 * Make adding tracking branches more discoverable
 * Update UI

Task-number: QTCREATORBUG-4943
Task-number: QTCREATORBUG-4944
Change-Id: Idcbf5f8321a3bd04c925e33d094bb479788a7d9b
Reviewed-on: http://codereview.qt.nokia.com/588
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Tobias Hunger
2011-05-30 12:14:49 +00:00
parent 9197596000
commit 5f6a91e009
9 changed files with 908 additions and 585 deletions

View File

@@ -48,9 +48,8 @@ namespace Ui {
class BranchDialog;
}
class GitClient;
class LocalBranchModel;
class RemoteBranchModel;
class BranchAddDialog;
class BranchModel;
/**
* Branch dialog. Displays a list of local branches at the top and remote
@@ -59,44 +58,33 @@ class RemoteBranchModel;
*/
class BranchDialog : public QDialog {
Q_OBJECT
Q_DISABLE_COPY(BranchDialog)
public:
explicit BranchDialog(QWidget *parent = 0);
virtual ~BranchDialog();
~BranchDialog();
public slots:
void refresh(const QString &repository, bool force);
private slots:
void slotEnableButtons(const QItemSelection &selected = QItemSelection());
void slotCheckoutSelectedBranch();
void slotDeleteSelectedBranch();
void slotDiffSelected();
void slotLog();
void slotRefresh();
void slotLocalBranchActivated();
void slotRemoteBranchActivated(const QModelIndex &);
void slotCreateLocalBranch(const QString &branchName);
void enableButtons();
void refresh();
void add();
void checkout();
void remove();
void diff();
void log();
protected:
virtual void changeEvent(QEvent *e);
void changeEvent(QEvent *e);
private:
bool ask(const QString &title, const QString &what, bool defaultButton);
void selectLocalBranch(const QString &b);
int selectedLocalBranchIndex() const;
int selectedRemoteBranchIndex() const;
QModelIndex selectedIndex();
Ui::BranchDialog *m_ui;
QPushButton *m_checkoutButton;
QPushButton *m_diffButton;
QPushButton *m_logButton;
QPushButton *m_refreshButton;
QPushButton *m_deleteButton;
LocalBranchModel *m_localModel;
RemoteBranchModel *m_remoteModel;
BranchModel *m_model;
QString m_repository;
};