Mercurial > hg > easyhg
comparison filestatuswidget.cpp @ 325:5fa5c908ca00 filelist_right_button_menu
Add right-button menus (not yet functional, but hopefully with the right things in them)
| author | Chris Cannam |
|---|---|
| date | Thu, 10 Mar 2011 21:04:58 +0000 |
| parents | 306ffd913071 |
| children | 6e1fdda1dff2 |
comparison
equal
deleted
inserted
replaced
| 324:306ffd913071 | 325:5fa5c908ca00 |
|---|---|
| 54 m_simpleLabels[FileStates::Removed] = tr("Removed:"); | 54 m_simpleLabels[FileStates::Removed] = tr("Removed:"); |
| 55 m_simpleLabels[FileStates::Missing] = tr("Missing:"); | 55 m_simpleLabels[FileStates::Missing] = tr("Missing:"); |
| 56 m_simpleLabels[FileStates::InConflict] = tr("In Conflict:"); | 56 m_simpleLabels[FileStates::InConflict] = tr("In Conflict:"); |
| 57 m_simpleLabels[FileStates::Unknown] = tr("Untracked:"); | 57 m_simpleLabels[FileStates::Unknown] = tr("Untracked:"); |
| 58 m_simpleLabels[FileStates::Ignored] = tr("Ignored:"); | 58 m_simpleLabels[FileStates::Ignored] = tr("Ignored:"); |
| 59 | |
| 60 m_actionLabels[FileStates::Annotate] = tr("Annotate"); | |
| 61 m_actionLabels[FileStates::Diff] = tr("Diff"); | |
| 62 m_actionLabels[FileStates::Commit] = tr("Commit..."); | |
| 63 m_actionLabels[FileStates::Revert] = tr("Revert"); | |
| 64 m_actionLabels[FileStates::Add] = tr("Add"); | |
| 65 m_actionLabels[FileStates::Remove] = tr("Remove"); | |
| 66 m_actionLabels[FileStates::RedoMerge] = tr("Redo Merge"); | |
| 67 m_actionLabels[FileStates::MarkResolved] = tr("Mark Resolved"); | |
| 68 m_actionLabels[FileStates::Ignore] = tr("Ignore"); | |
| 69 m_actionLabels[FileStates::UnIgnore] = tr("Stop Ignoring"); | |
| 59 | 70 |
| 60 m_descriptions[FileStates::Clean] = tr("You have not changed these files."); | 71 m_descriptions[FileStates::Clean] = tr("You have not changed these files."); |
| 61 m_descriptions[FileStates::Modified] = tr("You have changed these files since you last committed them."); | 72 m_descriptions[FileStates::Modified] = tr("You have changed these files since you last committed them."); |
| 62 m_descriptions[FileStates::Added] = tr("These files will be added to version control next time you commit them."); | 73 m_descriptions[FileStates::Added] = tr("These files will be added to version control next time you commit them."); |
| 63 m_descriptions[FileStates::Removed] = tr("These files will be removed from version control next time you commit them.<br>" | 74 m_descriptions[FileStates::Removed] = tr("These files will be removed from version control next time you commit them.<br>" |
| 105 boxlayout->addWidget(w, 2, 0); | 116 boxlayout->addWidget(w, 2, 0); |
| 106 | 117 |
| 107 connect(w, SIGNAL(itemSelectionChanged()), | 118 connect(w, SIGNAL(itemSelectionChanged()), |
| 108 this, SLOT(itemSelectionChanged())); | 119 this, SLOT(itemSelectionChanged())); |
| 109 | 120 |
| 110 w->insertAction(0, new QAction(tr("Commit"), w)); | 121 FileStates::Activities activities = m_fileStates.activitiesSupportedBy(s); |
| 122 int prevGroup = -1; | |
| 123 foreach (FileStates::Activity a, activities) { | |
| 124 int group = FileStates::activityGroup(a); | |
| 125 if (group != prevGroup && prevGroup != -1) { | |
| 126 QAction *sep = new QAction("", w); | |
| 127 sep->setSeparator(true); | |
| 128 w->insertAction(0, sep); | |
| 129 } | |
| 130 prevGroup = group; | |
| 131 QAction *act = new QAction(m_actionLabels[a], w); | |
| 132 w->insertAction(0, act); | |
| 133 } | |
| 111 w->setContextMenuPolicy(Qt::ActionsContextMenu); | 134 w->setContextMenuPolicy(Qt::ActionsContextMenu); |
| 112 | 135 |
| 113 boxlayout->addItem(new QSpacerItem(2, 2), 3, 0); | 136 boxlayout->addItem(new QSpacerItem(2, 2), 3, 0); |
| 114 | 137 |
| 115 boxesLayout->addWidget(box, ++boxRow, 0); | 138 boxesLayout->addWidget(box, ++boxRow, 0); |
