M app/hgchangesetpanel.cpp +8 -1
@@ 111,7 111,9 @@ HgChangesetPanel::HgChangesetPanel(const
addAction(repoActionRunner_->diffChangesetAction());
addAction(repoActionRunner_->updateAction());
- // TODO: register userCommandActions() on current repository changed and config loaded
+ registerUserCommandActions();
+ connect(repoActionRunner_, &HgRepoActionRunner::userCommandActionsReset, this,
+ &HgChangesetPanel::registerUserCommandActions);
ui_->reloadButton->setDefaultAction(&actions_->reload);
ui_->findPreviousButton->setDefaultAction(&actions_->findPreviousRevision);
@@ 672,6 674,11 @@ void HgChangesetPanel::popupContextMenuF
menu->popup(ui_->changesetView->viewport()->mapToGlobal(pos));
}
+void HgChangesetPanel::registerUserCommandActions()
+{
+ addActions(repoActionRunner_->userCommandActions());
+}
+
void HgChangesetPanel::updateActionRunner()
{
repoActionRunner_->setCurrentRevision(currentRevision());
M app/hgchangesetpanel.h +1 -0
@@ 70,6 70,7 @@ private slots:
void onRevisionClicked(const QModelIndex &index);
void displayCurrentRevision();
void popupContextMenuForChangesetView(const QPoint &pos);
+ void registerUserCommandActions();
void updateActionRunner();
private:
M app/hgrepoactionrunner.cpp +2 -0
@@ 111,6 111,8 @@ void HgRepoActionRunner::onConfigLoaded(
action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
}
}
+
+ emit userCommandActionsReset();
}
QWidget *HgRepoActionRunner::parentWidget() const
M app/hgrepoactionrunner.h +3 -0
@@ 33,6 33,9 @@ public:
QAction *updateAction() const;
QList<QAction *> userCommandActions() const;
+signals:
+ void userCommandActionsReset();
+
private slots:
void onRepositoryServiceStopped();
void onConfigLoaded();