| 71 | } |
| 72 | |
| 73 | void GitMenuManager::setupProjectMenu() |
| 74 | { |
| 75 | auto mCurProject = ActionManager::instance()->actionContainer(M_GIT_PROJECT); |
| 76 | auto activeProjInfo = dpfGetService(dpfservice::ProjectService)->getActiveProjectInfo(); |
| 77 | if (!activeProjInfo.isVaild() || !GitClient::instance()->checkRepositoryExist(activeProjInfo.workspaceFolder())) { |
| 78 | mCurProject->containerAction()->setEnabled(false); |
| 79 | return; |
| 80 | } |
| 81 | |
| 82 | mCurProject->containerAction()->setEnabled(true); |
| 83 | QFileInfo info(activeProjInfo.workspaceFolder()); |
| 84 | |
| 85 | auto projectLogAct = ActionManager::instance()->command(A_GIT_LOG_PROJECT); |
| 86 | projectLogAct->setProperty(GitFilePath, activeProjInfo.workspaceFolder()); |
| 87 | projectLogAct->action()->setText(tr("Log of \"%1\"").arg(info.fileName())); |
| 88 | |
| 89 | auto projectDiffAct = ActionManager::instance()->command(A_GIT_DIFF_PROJECT); |
| 90 | projectDiffAct->setProperty(GitFilePath, activeProjInfo.workspaceFolder()); |
| 91 | projectDiffAct->action()->setText(tr("Diff of \"%1\"").arg(info.fileName())); |
| 92 | } |
| 93 | |
| 94 | void GitMenuManager::setupFileMenu(const QString &filePath) |
| 95 | { |
no test coverage detected