Skip to content

Commit

Permalink
Add "Undo delete page" menu item on JobListView
Browse files Browse the repository at this point in the history
  • Loading branch information
SokoloffA committed Aug 9, 2016
1 parent 721ffa5 commit 3353867
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,30 @@ void MainWindow::showJobViewContextMenu(Job job)
connect(act, SIGNAL(triggered()),
this, SLOT(cloneJob()));

menu.addSeparator();

// Undo delete ...................................
QMenu *undelMenu = menu.addMenu(tr("Undo delete page"));
undelMenu->setEnabled(false);

for(int p=0; p<job.pageCount(); ++p)
{
ProjectPage *page = job.page(p);
if (!page->visible())
{
PageAction *act;
act = new PageAction(tr("Page %1", "'Undo deletion' menu item").arg(p+1), 0, page, &menu);
connect(act, SIGNAL(triggered()),
this, SLOT(undoDeletePage()));

undelMenu->addAction(act);
}
}
undelMenu->setEnabled(undelMenu->isEnabled() || !undelMenu->isEmpty());

// ...............................................


menu.addSeparator();

act = new JobAction(tr("Delete job"), job, &menu);
Expand Down

0 comments on commit 3353867

Please sign in to comment.