Mercurial > hg > easyhg
comparison filestatuswidget.cpp @ 331:acfe9390d5c6
Basic implementation of annotate
author | Chris Cannam |
---|---|
date | Sun, 13 Mar 2011 10:31:32 +0000 |
parents | ea62eb083ed4 |
children | bb189827f6d1 |
comparison
equal
deleted
inserted
replaced
330:bf4bbb53e217 | 331:acfe9390d5c6 |
---|---|
115 w->setSelectionMode(QListWidget::ExtendedSelection); | 115 w->setSelectionMode(QListWidget::ExtendedSelection); |
116 boxlayout->addWidget(w, 2, 0); | 116 boxlayout->addWidget(w, 2, 0); |
117 | 117 |
118 connect(w, SIGNAL(itemSelectionChanged()), | 118 connect(w, SIGNAL(itemSelectionChanged()), |
119 this, SLOT(itemSelectionChanged())); | 119 this, SLOT(itemSelectionChanged())); |
120 connect(w, SIGNAL(itemDoubleClicked(QListWidgetItem *)), | |
121 this, SLOT(itemDoubleClicked(QListWidgetItem *))); | |
120 | 122 |
121 FileStates::Activities activities = m_fileStates.activitiesSupportedBy(s); | 123 FileStates::Activities activities = m_fileStates.activitiesSupportedBy(s); |
122 int prevGroup = -1; | 124 int prevGroup = -1; |
123 foreach (FileStates::Activity a, activities) { | 125 foreach (FileStates::Activity a, activities) { |
124 // Skip activities which are not yet implemented | 126 // Skip activities which are not yet implemented |
125 if (a == FileStates::Annotate || | 127 if (a == FileStates::Ignore || |
126 a == FileStates::Ignore || | |
127 a == FileStates::UnIgnore) { | 128 a == FileStates::UnIgnore) { |
128 continue; | 129 continue; |
129 } | 130 } |
130 int group = FileStates::activityGroup(a); | 131 int group = FileStates::activityGroup(a); |
131 if (group != prevGroup && prevGroup != -1) { | 132 if (group != prevGroup && prevGroup != -1) { |
244 case FileStates::Ignore: emit ignoreFiles(files); break; | 245 case FileStates::Ignore: emit ignoreFiles(files); break; |
245 case FileStates::UnIgnore: emit unIgnoreFiles(files); break; | 246 case FileStates::UnIgnore: emit unIgnoreFiles(files); break; |
246 } | 247 } |
247 } | 248 } |
248 | 249 |
250 void FileStatusWidget::itemDoubleClicked(QListWidgetItem *item) | |
251 { | |
252 QStringList files; | |
253 files << item->text(); | |
254 emit annotateFiles(files); | |
255 } | |
249 | 256 |
250 void FileStatusWidget::itemSelectionChanged() | 257 void FileStatusWidget::itemSelectionChanged() |
251 { | 258 { |
252 DEBUG << "FileStatusWidget::itemSelectionChanged" << endl; | 259 DEBUG << "FileStatusWidget::itemSelectionChanged" << endl; |
253 | 260 |