diff --git a/src/lay/laySaltGrain.cc b/src/lay/laySaltGrain.cc index 83ed47e4f..d39664ad5 100644 --- a/src/lay/laySaltGrain.cc +++ b/src/lay/laySaltGrain.cc @@ -337,7 +337,9 @@ SaltGrain::xml_struct () bool SaltGrain::is_readonly () const { - return !QFileInfo (tl::to_qstring (path ())).isWritable (); + // A grain is readonly if the directory is not writable or there is a download URL + // (this means the grain has been installed from an URL). + return !QFileInfo (tl::to_qstring (path ())).isWritable () || !m_url.empty (); } void diff --git a/src/lay/laySaltManagerDialog.cc b/src/lay/laySaltManagerDialog.cc index 6fb4dc59c..d71be4edb 100644 --- a/src/lay/laySaltManagerDialog.cc +++ b/src/lay/laySaltManagerDialog.cc @@ -512,7 +512,10 @@ SaltManagerDialog::edit_properties () { SaltGrain *g = current_grain (); if (g) { - if (mp_properties_dialog->exec_dialog (g, mp_salt)) { + if (g->is_readonly ()) { + QMessageBox::critical (this, tr ("Package is not Editable"), + tr ("This package cannot be edited.\n\nEither you don't have write permissions on the directory or the package was installed from a repository.")); + } else if (mp_properties_dialog->exec_dialog (g, mp_salt)) { current_changed (); } }