| 26 | using namespace KDevelop; |
| 27 | |
| 28 | StashManagerDialog::StashManagerDialog(const QDir& stashed, GitPlugin* plugin, QWidget* parent) |
| 29 | : QDialog(parent), m_plugin(plugin), m_dir(stashed) |
| 30 | { |
| 31 | setWindowTitle(i18nc("@title:window", "Stash Manager")); |
| 32 | |
| 33 | m_ui = new Ui::StashManager; |
| 34 | m_ui->setupUi(this); |
| 35 | |
| 36 | KDevelop::restoreAndAutoSaveGeometry(*this, QStringLiteral("VCS"), QStringLiteral("StashManagerDialog")); |
| 37 | |
| 38 | auto* m = new StashModel(stashed, plugin, this); |
| 39 | m_ui->stashView->setModel(m); |
| 40 | |
| 41 | connect(m_ui->show, &QPushButton::clicked, this, &StashManagerDialog::showStash); |
| 42 | connect(m_ui->apply, &QPushButton::clicked, this, &StashManagerDialog::applyClicked); |
| 43 | connect(m_ui->branch, &QPushButton::clicked, this, &StashManagerDialog::branchClicked); |
| 44 | connect(m_ui->pop, &QPushButton::clicked, this, &StashManagerDialog::popClicked); |
| 45 | connect(m_ui->drop, &QPushButton::clicked, this, &StashManagerDialog::dropClicked); |
| 46 | connect(m, &StashModel::rowsInserted, this, &StashManagerDialog::stashesFound); |
| 47 | |
| 48 | connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &StashManagerDialog::reject); |
| 49 | |
| 50 | setEnabled(false); //we won't enable it until we have the model with data and selection |
| 51 | } |
| 52 | |
| 53 | StashManagerDialog::~StashManagerDialog() |
| 54 | { |
nothing calls this directly
no test coverage detected