comparison filestatuswidget.cpp @ 106:729438d70af8

* Retrieve and store current branch and heads; some refactoring
author Chris Cannam
date Thu, 25 Nov 2010 17:54:35 +0000
parents 0bd32aedc6f6
children 1721c580c10e
comparison
equal deleted inserted replaced
105:1928f9b408e6 106:729438d70af8
45 ++row; 45 ++row;
46 layout->addWidget(new QLabel(tr("Remote:")), row, 0); 46 layout->addWidget(new QLabel(tr("Remote:")), row, 0);
47 m_remoteURLLabel = new QLabel; 47 m_remoteURLLabel = new QLabel;
48 layout->addWidget(m_remoteURLLabel, row, 1); 48 layout->addWidget(m_remoteURLLabel, row, 1);
49 49
50 ++row;
51 layout->addWidget(new QLabel(tr("Branch:")), row, 0);
52 m_branchLabel = new QLabel;
53 layout->addWidget(m_branchLabel, row, 1);
54
50 layout->setColumnStretch(1, 20); 55 layout->setColumnStretch(1, 20);
56
57 layout->addWidget(new QLabel("<qt><hr></qt>"), ++row, 0, 1, 2);
51 58
52 m_simpleLabels[FileStates::Clean] = tr("Unmodified:"); 59 m_simpleLabels[FileStates::Clean] = tr("Unmodified:");
53 m_simpleLabels[FileStates::Modified] = tr("Modified:"); 60 m_simpleLabels[FileStates::Modified] = tr("Modified:");
54 m_simpleLabels[FileStates::Added] = tr("Added:"); 61 m_simpleLabels[FileStates::Added] = tr("Added:");
55 m_simpleLabels[FileStates::Removed] = tr("Removed:"); 62 m_simpleLabels[FileStates::Removed] = tr("Removed:");
77 QWidget *box = new QWidget; 84 QWidget *box = new QWidget;
78 QGridLayout *boxlayout = new QGridLayout; 85 QGridLayout *boxlayout = new QGridLayout;
79 boxlayout->setMargin(0); 86 boxlayout->setMargin(0);
80 box->setLayout(boxlayout); 87 box->setLayout(boxlayout);
81 88
82 boxlayout->addItem(new QSpacerItem(5, 8), 0, 0); 89 boxlayout->addItem(new QSpacerItem(5, 5), 0, 0);
83 90
84 boxlayout->addWidget(new QLabel(labelFor(s)), 1, 0); 91 boxlayout->addWidget(new QLabel(labelFor(s)), 1, 0);
85 92
86 QListWidget *w = new QListWidget; 93 QListWidget *w = new QListWidget;
87 m_stateListMap[s] = w; 94 m_stateListMap[s] = w;
266 m_fileStates = p; 273 m_fileStates = p;
267 updateWidgets(); 274 updateWidgets();
268 } 275 }
269 276
270 void 277 void
278 FileStatusWidget::setBranch(QString b)
279 {
280 m_branch = b;
281 m_branchLabel->setText(b);
282 }
283
284 void
271 FileStatusWidget::updateWidgets() 285 FileStatusWidget::updateWidgets()
272 { 286 {
273 QDateTime lastInteractionTime; 287 QDateTime lastInteractionTime;
274 if (m_dateReference) { 288 if (m_dateReference) {
275 lastInteractionTime = m_dateReference->lastModified(); 289 lastInteractionTime = m_dateReference->lastModified();