comparison uncommitteditem.cpp @ 311:4811eb34e819 new-branches-with-status-outside-tabs

Add Start New Branch and Cancel New Branch to uncommitted item menu; add branch name to Commit dialog
author Chris Cannam
date Tue, 01 Mar 2011 14:22:29 +0000
parents be483734bde5
children
comparison
equal deleted inserted replaced
308:7f50c040e13d 311:4811eb34e819
27 #include <QAction> 27 #include <QAction>
28 #include <QLabel> 28 #include <QLabel>
29 #include <QWidgetAction> 29 #include <QWidgetAction>
30 30
31 UncommittedItem::UncommittedItem() : 31 UncommittedItem::UncommittedItem() :
32 m_showBranch(false), m_column(0), m_row(0), m_wide(false) 32 m_showBranch(false), m_isNewBranch(false),
33 m_column(0), m_row(0), m_wide(false)
33 { 34 {
34 m_font = QFont(); 35 m_font = QFont();
35 m_font.setPixelSize(11); 36 m_font.setPixelSize(11);
36 m_font.setBold(false); 37 m_font.setBold(false);
37 m_font.setItalic(false); 38 m_font.setItalic(false);
84 85
85 QAction *commit = menu->addAction(tr("Commit...")); 86 QAction *commit = menu->addAction(tr("Commit..."));
86 connect(commit, SIGNAL(triggered()), this, SIGNAL(commit())); 87 connect(commit, SIGNAL(triggered()), this, SIGNAL(commit()));
87 QAction *revert = menu->addAction(tr("Revert...")); 88 QAction *revert = menu->addAction(tr("Revert..."));
88 connect(revert, SIGNAL(triggered()), this, SIGNAL(revert())); 89 connect(revert, SIGNAL(triggered()), this, SIGNAL(revert()));
90
91 menu->addSeparator();
92
93 QAction *branch = menu->addAction(tr("Start new branch..."));
94 connect(branch, SIGNAL(triggered()), this, SIGNAL(newBranch()));
95 QAction *nobranch = menu->addAction(tr("Cancel new branch"));
96 nobranch->setEnabled(m_isNewBranch);
97 connect(nobranch, SIGNAL(triggered()), this, SIGNAL(noBranch()));
89 98
90 menu->exec(QCursor::pos()); 99 menu->exec(QCursor::pos());
91 100
92 ungrabMouse(); 101 ungrabMouse();
93 } 102 }