Skip to content

Commit

Permalink
Fixed version in Changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
klayoutmatthias committed May 4, 2018
1 parent 0d544f0 commit 887bcb3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
0.25.2 (2018-05-03):
0.25.3 (2018-05-03):

* Enhancement: Compile option to use libcurl instead of QtNetwork
This workaround enables builds on the native CentOS6
Expand Down
16 changes: 14 additions & 2 deletions src/lay/lay/laySaltManagerDialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -611,19 +611,31 @@ BEGIN_PROTECTED
throw tl::Exception (tl::to_string (tr ("No package selected to delete")));
}

std::vector <std::string> failed;

if (gg.size () == 1) {
SaltGrain *g = gg.front ();
if (QMessageBox::question (this, tr ("Delete Package"), tr ("Are you sure to delete package '%1'?").arg (tl::to_qstring (g->name ())), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) {
mp_salt->remove_grain (*g);
if (! mp_salt->remove_grain (*g)) {
failed.push_back (g->name ());
}
}
} else {
if (QMessageBox::question (this, tr ("Delete Packages"), tr ("Are you sure to delete the selected %1 packages?").arg (int (gg.size ())), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) {
for (std::vector<SaltGrain *>::const_iterator i = gg.begin (); i != gg.end (); ++i) {
mp_salt->remove_grain (**i);
if (! mp_salt->remove_grain (**i)) {
failed.push_back ((*i)->name ());
}
}
}
}

if (failed.size () == 1) {
throw tl::Exception (tl::to_string (tr ("Failed to remove package %1 (no write permissions on directory?)").arg (tl::to_qstring (failed.front ()))));
} else if (failed.size () > 1) {
throw tl::Exception (tl::to_string (tr ("Failed to remove the following packages:\n %1").arg (tl::to_qstring (tl::join (failed, "\n ")))));
}

END_PROTECTED
}

Expand Down

0 comments on commit 887bcb3

Please sign in to comment.