- if (!sel_branch.isEmpty()) {
- docstring current_branch = qstring_to_ucs4(sel_branch);
- Branch * branch =
- branchlist_.find(current_branch);
- if (!branch)
- return;
-
- QColor const initial = rgb2qcolor(branch->getColor());
- QColor ncol(QColorDialog::getColor(initial, qApp->focusWidget()));
- if (ncol.isValid()){
- // add the color to the branchlist
- branch->setColor(fromqstr(ncol.name()));
- newBranchLE->clear();
+ if (sel_branch.isEmpty())
+ return;
+
+ docstring current_branch = qstring_to_ucs4(sel_branch);
+ Branch * branch = branchlist_.find(current_branch);
+ if (!branch)
+ return;
+
+ QColor const initial = rgb2qcolor(branch->color());
+ QColor ncol = QColorDialog::getColor(initial, qApp->focusWidget());
+ if (!ncol.isValid())
+ return;
+
+ // add the color to the branchlist
+ branch->setColor(fromqstr(ncol.name()));
+ newBranchLE->clear();
+ updateView();
+}
+
+
+void GuiBranches::toggleSuffix(QTreeWidgetItem * item)
+{
+ if (item == 0)
+ return;
+
+ QString sel_branch = item->text(0);
+ if (sel_branch.isEmpty())
+ return;
+
+ Branch * branch = branchlist_.find(qstring_to_ucs4(sel_branch));
+ if (branch) {
+ branch->setFilenameSuffix(!branch->hasFilenameSuffix());
+ newBranchLE->clear();
+ updateView();
+ }
+}
+
+
+void GuiBranches::on_unknownPB_pressed()
+{
+ undef_->branchesLW->clear();
+ for (int i = 0; i != unknown_branches_.count(); ++i) {
+ if (branchesTW->findItems(unknown_branches_[i], Qt::MatchExactly, 0).empty())
+ undef_->branchesLW->addItem(unknown_branches_[i]);
+ }
+ unknownBranchSelChanged();
+ undef_->exec();
+}
+
+
+void GuiBranches::addUnknown()
+{
+ QList<QListWidgetItem *> selItems =
+ undef_->branchesLW->selectedItems();
+
+ QList<QListWidgetItem *>::const_iterator it = selItems.begin();
+ for (; it != selItems.end() ; ++it) {
+ QListWidgetItem const * new_branch = *it;
+ if (new_branch) {
+ branchlist_.add(qstring_to_ucs4(new_branch->text()));