|
|
|
|
@ -646,8 +646,8 @@ void TagEditor::MouseButtonPressed(MEVENT me) |
|
|
|
|
bool result = true; |
|
|
|
|
if (w != Dirs) |
|
|
|
|
{ |
|
|
|
|
if (isPrevColumnAvailable()) |
|
|
|
|
PrevColumn(); |
|
|
|
|
if (previousColumnAvailable()) |
|
|
|
|
previousColumn(); |
|
|
|
|
else |
|
|
|
|
result = false; |
|
|
|
|
} |
|
|
|
|
@ -657,8 +657,8 @@ void TagEditor::MouseButtonPressed(MEVENT me) |
|
|
|
|
bool result = true; |
|
|
|
|
if (w != Tags) |
|
|
|
|
{ |
|
|
|
|
if (isNextColumnAvailable()) |
|
|
|
|
NextColumn(); |
|
|
|
|
if (nextColumnAvailable()) |
|
|
|
|
nextColumn(); |
|
|
|
|
else |
|
|
|
|
result = false; |
|
|
|
|
} |
|
|
|
|
@ -684,8 +684,8 @@ void TagEditor::MouseButtonPressed(MEVENT me) |
|
|
|
|
{ |
|
|
|
|
if (w != FParser) |
|
|
|
|
{ |
|
|
|
|
if (isPrevColumnAvailable()) |
|
|
|
|
PrevColumn(); |
|
|
|
|
if (previousColumnAvailable()) |
|
|
|
|
previousColumn(); |
|
|
|
|
else |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
@ -702,8 +702,8 @@ void TagEditor::MouseButtonPressed(MEVENT me) |
|
|
|
|
{ |
|
|
|
|
if (w != FParserHelper) |
|
|
|
|
{ |
|
|
|
|
if (isNextColumnAvailable()) |
|
|
|
|
NextColumn(); |
|
|
|
|
if (nextColumnAvailable()) |
|
|
|
|
nextColumn(); |
|
|
|
|
else |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
@ -880,108 +880,102 @@ MPD::SongList TagEditor::getSelectedSongs() |
|
|
|
|
|
|
|
|
|
/***********************************************************************/ |
|
|
|
|
|
|
|
|
|
bool TagEditor::ifAnyModifiedAskForDiscarding() |
|
|
|
|
{ |
|
|
|
|
bool result = true; |
|
|
|
|
if (isAnyModified(*Tags)) |
|
|
|
|
result = Action::AskYesNoQuestion("There are pending changes, are you sure?", Status::trace); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool TagEditor::isNextColumnAvailable() |
|
|
|
|
bool TagEditor::previousColumnAvailable() |
|
|
|
|
{ |
|
|
|
|
bool result = false; |
|
|
|
|
if (w == Dirs) |
|
|
|
|
if (w == Tags) |
|
|
|
|
{ |
|
|
|
|
if (!TagTypes->reallyEmpty() && !Tags->reallyEmpty()) |
|
|
|
|
if (!TagTypes->reallyEmpty() && !Dirs->reallyEmpty()) |
|
|
|
|
result = true; |
|
|
|
|
} |
|
|
|
|
else if (w == TagTypes) |
|
|
|
|
{ |
|
|
|
|
if (!Tags->reallyEmpty()) |
|
|
|
|
result = true; |
|
|
|
|
if (!Dirs->reallyEmpty()) |
|
|
|
|
result = ifAnyModifiedAskForDiscarding(); |
|
|
|
|
} |
|
|
|
|
else if (w == FParser) |
|
|
|
|
else if (w == FParserHelper) |
|
|
|
|
result = true; |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool TagEditor::NextColumn() |
|
|
|
|
void TagEditor::previousColumn() |
|
|
|
|
{ |
|
|
|
|
if (w == Dirs) |
|
|
|
|
if (w == Tags) |
|
|
|
|
{ |
|
|
|
|
Dirs->setHighlightColor(Config.main_highlight_color); |
|
|
|
|
Tags->setHighlightColor(Config.main_highlight_color); |
|
|
|
|
w->refresh(); |
|
|
|
|
w = TagTypes; |
|
|
|
|
TagTypes->setHighlightColor(Config.active_column_color); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
else if (w == TagTypes && TagTypes->choice() < 13 && !Tags->reallyEmpty()) |
|
|
|
|
else if (w == TagTypes) |
|
|
|
|
{ |
|
|
|
|
TagTypes->setHighlightColor(Config.main_highlight_color); |
|
|
|
|
w->refresh(); |
|
|
|
|
w = Tags; |
|
|
|
|
Tags->setHighlightColor(Config.active_column_color); |
|
|
|
|
return true; |
|
|
|
|
w = Dirs; |
|
|
|
|
Dirs->setHighlightColor(Config.active_column_color); |
|
|
|
|
} |
|
|
|
|
else if (w == FParser) |
|
|
|
|
else if (w == FParserHelper) |
|
|
|
|
{ |
|
|
|
|
FParser->setBorder(Config.window_border); |
|
|
|
|
FParser->display(); |
|
|
|
|
w = FParserHelper; |
|
|
|
|
FParserHelper->setBorder(Config.active_window_border); |
|
|
|
|
FParserHelper->setBorder(Config.window_border); |
|
|
|
|
FParserHelper->display(); |
|
|
|
|
return true; |
|
|
|
|
w = FParser; |
|
|
|
|
FParser->setBorder(Config.active_window_border); |
|
|
|
|
FParser->display(); |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool TagEditor::isPrevColumnAvailable() |
|
|
|
|
bool TagEditor::nextColumnAvailable() |
|
|
|
|
{ |
|
|
|
|
bool result = false; |
|
|
|
|
if (w == Tags) |
|
|
|
|
if (w == Dirs) |
|
|
|
|
{ |
|
|
|
|
if (!TagTypes->reallyEmpty() && !Dirs->reallyEmpty()) |
|
|
|
|
if (!TagTypes->reallyEmpty() && !Tags->reallyEmpty()) |
|
|
|
|
result = true; |
|
|
|
|
} |
|
|
|
|
else if (w == TagTypes) |
|
|
|
|
{ |
|
|
|
|
if (!Dirs->reallyEmpty()) |
|
|
|
|
result = ifAnyModifiedAskForDiscarding(); |
|
|
|
|
if (!Tags->reallyEmpty()) |
|
|
|
|
result = true; |
|
|
|
|
} |
|
|
|
|
else if (w == FParserHelper) |
|
|
|
|
else if (w == FParser) |
|
|
|
|
result = true; |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool TagEditor::PrevColumn() |
|
|
|
|
void TagEditor::nextColumn() |
|
|
|
|
{ |
|
|
|
|
if (w == Tags) |
|
|
|
|
if (w == Dirs) |
|
|
|
|
{ |
|
|
|
|
Tags->setHighlightColor(Config.main_highlight_color); |
|
|
|
|
Dirs->setHighlightColor(Config.main_highlight_color); |
|
|
|
|
w->refresh(); |
|
|
|
|
w = TagTypes; |
|
|
|
|
TagTypes->setHighlightColor(Config.active_column_color); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
else if (w == TagTypes) |
|
|
|
|
else if (w == TagTypes && TagTypes->choice() < 13 && !Tags->reallyEmpty()) |
|
|
|
|
{ |
|
|
|
|
TagTypes->setHighlightColor(Config.main_highlight_color); |
|
|
|
|
w->refresh(); |
|
|
|
|
w = Dirs; |
|
|
|
|
Dirs->setHighlightColor(Config.active_column_color); |
|
|
|
|
return true; |
|
|
|
|
w = Tags; |
|
|
|
|
Tags->setHighlightColor(Config.active_column_color); |
|
|
|
|
} |
|
|
|
|
else if (w == FParserHelper) |
|
|
|
|
else if (w == FParser) |
|
|
|
|
{ |
|
|
|
|
FParserHelper->setBorder(Config.window_border); |
|
|
|
|
FParserHelper->display(); |
|
|
|
|
w = FParser; |
|
|
|
|
FParser->setBorder(Config.active_window_border); |
|
|
|
|
FParser->setBorder(Config.window_border); |
|
|
|
|
FParser->display(); |
|
|
|
|
return true; |
|
|
|
|
w = FParserHelper; |
|
|
|
|
FParserHelper->setBorder(Config.active_window_border); |
|
|
|
|
FParserHelper->display(); |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/***********************************************************************/ |
|
|
|
|
|
|
|
|
|
bool TagEditor::ifAnyModifiedAskForDiscarding() |
|
|
|
|
{ |
|
|
|
|
bool result = true; |
|
|
|
|
if (isAnyModified(*Tags)) |
|
|
|
|
result = Action::AskYesNoQuestion("There are pending changes, are you sure?", Status::trace); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void TagEditor::LocateSong(const MPD::Song &s) |
|
|
|
|
|