Commit 7c22c5d7 authored by Smit Mehta's avatar Smit Mehta
Browse files

Polish.

Removed obselete actions from context menu in album tree view for Root and Parent collections.
Added KMessageBox showing error if someone tries to open Root in terminal or file manager.
BUGS:312627
parent 841736fc
......@@ -273,7 +273,7 @@ AlbumPropsEdit::AlbumPropsEdit(PAlbum* const album, bool create)
d->titleEdit->setText(i18n("New Album"));
d->datePicker->setDate(QDate::currentDate());
d->parentCombo->addItem(i18n("Selected Album (Default)"));
d->parentCombo->addItem(i18nc("top level folder of album","Root"));
d->parentCombo->addItem(i18nc("top level folder of album","Root of current collection"));
}
else
{
......
......@@ -119,12 +119,20 @@ public:
virtual void addActions(AbstractAlbumTreeView*, ContextMenuHelper& cmh, Album* a)
{
if (!a || a->isRoot())
{
return;
}
PAlbum* album = dynamic_cast<PAlbum*>(a);
if (!album)
if (album->isAlbumRoot())
{
cmh.addActionNewAlbum(d->albumModificationHelper, album);
cmh.addAction("album_openinfilemanager");
cmh.addAction("album_openinterminal");
return;
}
}
// --------------------------------------------------------
cmh.addActionNewAlbum(d->albumModificationHelper, album);
......
......@@ -1060,6 +1060,13 @@ void DigikamView::slotAlbumOpenInFileManager()
{
Album* album = d->albumManager->currentAlbum();
if (album->isRoot())
{
KMessageBox::error(this,
i18n("Cannot open the root. It is not a physical location."));
return;
}
if (!album || album->type() != Album::PHYSICAL)
{
return;
......@@ -1074,6 +1081,13 @@ void DigikamView::slotAlbumOpenInTerminal()
{
Album* album = d->albumManager->currentAlbum();
if (album->isRoot())
{
KMessageBox::error(this,
i18n("Cannot open the root. It is not a physical location."));
return;
}
if (!album || album->type() != Album::PHYSICAL)
{
return;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment