comparison hgtabwidget.cpp @ 153:70fe12873106

* Show both parents of uncommitted merge; fixes to right-button menus
author Chris Cannam
date Thu, 02 Dec 2010 17:55:21 +0000
parents 2b997861174b
children 6bcb4a4d6521
comparison
equal deleted inserted replaced
152:2b997861174b 153:70fe12873106
50 this, SIGNAL(revert())); 50 this, SIGNAL(revert()));
51 51
52 connect(m_historyWidget, SIGNAL(diffWorkingFolder()), 52 connect(m_historyWidget, SIGNAL(diffWorkingFolder()),
53 this, SIGNAL(diffWorkingFolder())); 53 this, SIGNAL(diffWorkingFolder()));
54 54
55 connect(m_historyWidget, SIGNAL(showWork()),
56 this, SLOT(showWorkTab()));
57
55 connect(m_historyWidget, SIGNAL(updateTo(QString)), 58 connect(m_historyWidget, SIGNAL(updateTo(QString)),
56 this, SIGNAL(updateTo(QString))); 59 this, SIGNAL(updateTo(QString)));
57 60
58 connect(m_historyWidget, SIGNAL(diffToCurrent(QString)), 61 connect(m_historyWidget, SIGNAL(diffToCurrent(QString)),
59 this, SIGNAL(diffToCurrent(QString))); 62 this, SIGNAL(diffToCurrent(QString)));
71 void HgTabWidget::clearSelections() 74 void HgTabWidget::clearSelections()
72 { 75 {
73 m_fileStatusWidget->clearSelections(); 76 m_fileStatusWidget->clearSelections();
74 } 77 }
75 78
76 void HgTabWidget::setCurrent(QStringList ids) 79 void HgTabWidget::setCurrent(QStringList ids, QString branch)
77 { 80 {
78 m_historyWidget->setCurrent(ids, canCommit()); 81 m_historyWidget->setCurrent(ids, branch, canCommit());
79 } 82 }
80 83
81 bool HgTabWidget::canCommit() const 84 bool HgTabWidget::canCommit() const
82 { 85 {
83 if (!m_fileStatusWidget->getSelectedAddableFiles().empty()) return false; 86 if (!m_fileStatusWidget->getSelectedAddableFiles().empty()) return false;
158 161
159 void HgTabWidget::setNewLog(QString hgLogList) 162 void HgTabWidget::setNewLog(QString hgLogList)
160 { 163 {
161 m_historyWidget->parseNewLog(hgLogList); 164 m_historyWidget->parseNewLog(hgLogList);
162 if (m_historyWidget->haveNewItems()) { 165 if (m_historyWidget->haveNewItems()) {
163 setCurrentWidget(m_historyWidget); 166 showHistoryTab();
164 } 167 }
165 } 168 }
166 169
167 void HgTabWidget::addIncrementalLog(QString hgLogList) 170 void HgTabWidget::addIncrementalLog(QString hgLogList)
168 { 171 {
169 m_historyWidget->parseIncrementalLog(hgLogList); 172 m_historyWidget->parseIncrementalLog(hgLogList);
170 if (m_historyWidget->haveNewItems()) { 173 if (m_historyWidget->haveNewItems()) {
171 setCurrentWidget(m_historyWidget); 174 showHistoryTab();
172 } 175 }
173 } 176 }
174 177
175 void HgTabWidget::setWorkFolderAndRepoNames(QString workFolderPath, QString remoteRepoPath) 178 void HgTabWidget::setWorkFolderAndRepoNames(QString workFolderPath, QString remoteRepoPath)
176 { 179 {
180 183
181 void HgTabWidget::setState(QString state) 184 void HgTabWidget::setState(QString state)
182 { 185 {
183 m_fileStatusWidget->setState(state); 186 m_fileStatusWidget->setState(state);
184 } 187 }
188
189 void HgTabWidget::showWorkTab()
190 {
191 setCurrentWidget(m_fileStatusWidget);
192 }
193
194 void HgTabWidget::showHistoryTab()
195 {
196 setCurrentWidget(m_historyWidget);
197 }
198