Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gui] smartplaylisteditor: convert spinners etc to regular buttons #10594

Merged
merged 15 commits into from Oct 6, 2016

Conversation

phil65
Copy link
Contributor

@phil65 phil65 commented Sep 29, 2016

Next one...this time the order-by button in Smartplaylisteditor.
this PR adds the same header file to GUIDialogSmartPlaylistEditor.cpp as #10593, so remind me to update the PR which gets pulled last. :)
Could have put all commits into one big PR, so sorry for the additional pinging.

EDIT: all PRs merged into this one.

EDIT: FInished!
screenshot031

@mention-bot
Copy link

@phil65, thank you for improving Kodi! According to the last 5 commits, we found the potential reviewers: @Montellese, @mkortstiege and @notspiff. Final approval needs to be given by the component maintainer.

@phil65 phil65 changed the title Playlistorder spinner [gui] change order-by selection from spinner to selectdialog Sep 29, 2016
@phil65
Copy link
Contributor Author

phil65 commented Sep 30, 2016

Added another commit which converts two more buttons.
If it helps testing or whatever I could also merge the other PR´s into this one.

@MilhouseVH
Copy link
Contributor

MilhouseVH commented Sep 30, 2016

Merge them (10593 and 10594) and I'll include them both in test builds - keeping them separate makes that a bit trickier (as they're both patching the same code).

@phil65
Copy link
Contributor Author

phil65 commented Sep 30, 2016

@MilhouseVH done.
This also includes now #10592, #10593 and #10589

@phil65 phil65 changed the title [gui] change order-by selection from spinner to selectdialog [gui] smartplaylisteditor: convert spinners etc to regular buttons Sep 30, 2016
@MilhouseVH
Copy link
Contributor

Thanks, will include in the next build.

@phil65
Copy link
Contributor Author

phil65 commented Sep 30, 2016

...aaand another commit.

@phil65 phil65 force-pushed the playlistorder_spinner branch 4 times, most recently from 7393ad2 to d7a93f4 Compare September 30, 2016 04:27
@phil65 phil65 force-pushed the playlistorder_spinner branch 2 times, most recently from ca4dde2 to 89e07d7 Compare September 30, 2016 07:27
Copy link
Member

@Montellese Montellese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good apart from the minors. This will require all skins to adjust the dialog right?

{
if (item == static_cast<int>(m_playlist.m_ruleCombination.m_rules.size()))
OnRuleAdd();
else if (item < 0 || item > static_cast<int>(m_playlist.m_ruleCombination.m_rules.size()))

This comment was marked as spam.

else
{
CSmartPlaylistRule rule = *std::static_pointer_cast<CSmartPlaylistRule>(m_playlist.m_ruleCombination.m_rules[item]);
if (CGUIDialogSmartPlaylistRule::EditRule(rule,m_playlist.GetType()))

This comment was marked as spam.

CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_LIMIT);
OnMessage(msg);
m_playlist.m_limit = msg.GetParam1();
const int limits[] = {0, 10, 25, 50, 100, 250, 500, 1000, -1 };

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

void CGUIDialogSmartPlaylistEditor::OnName()
{
std::string name = m_playlist.m_playlistName;
if (CGUIKeyboardFactory::ShowAndGetInput(name, CVariant{g_localizeStrings.Get(16012)}, false))

This comment was marked as spam.

@@ -546,6 +548,37 @@ void CGUIDialogSmartPlaylistEditor::HighlightItem(int item)
OnMessage(msg);
}

std::vector<CGUIDialogSmartPlaylistEditor::PLAYLIST_TYPE> CGUIDialogSmartPlaylistEditor::GetAllowedTypes(std::string mode)

This comment was marked as spam.

dialog->Reset();
dialog->SetHeading(CVariant{20427});
int selected = -1;
for (unsigned int i = 0; i < fields.size(); i++)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

if (!isValid)
m_rule.m_operator = (CDatabaseQueryRule::SEARCH_OPERATOR)std::get<1>(validOperators[0]);
m_rule.SetParameter("");
UpdateButtons();

This comment was marked as spam.


void CGUIDialogSmartPlaylistRule::OnOperator()
{

This comment was marked as spam.

{

std::vector< std::pair<std::string, int> > labels = GetValidOperators(m_rule);
CGUIDialogSelect* dialog = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT);

This comment was marked as spam.

void CGUIDialogSmartPlaylistRule::OnOperator()
{

std::vector< std::pair<std::string, int> > labels = GetValidOperators(m_rule);

This comment was marked as spam.

@phil65
Copy link
Contributor Author

phil65 commented Oct 1, 2016

@Montellese
addressed all of your comments in a separate commit, except for the loops, see question above.
Also added two more casts to get rid of some compiler warnings.
Yes, this needs some trivial changes for all skins.

@@ -546,6 +549,37 @@ void CGUIDialogSmartPlaylistEditor::HighlightItem(int item)
OnMessage(msg);
}

std::vector<CGUIDialogSmartPlaylistEditor::PLAYLIST_TYPE> CGUIDialogSmartPlaylistEditor::GetAllowedTypes(const std::string& mode)
{

This comment was marked as spam.

@phil65 phil65 force-pushed the playlistorder_spinner branch 2 times, most recently from 3b1196e to 03c1348 Compare October 2, 2016 21:14
@phil65
Copy link
Contributor Author

phil65 commented Oct 2, 2016

@Montellese switched to using iterators. Anything else?
Thx for reviewing.

@phil65
Copy link
Contributor Author

phil65 commented Oct 4, 2016

jenkins build this please

@phil65
Copy link
Contributor Author

phil65 commented Oct 5, 2016

@Montellese general skinner´s sentiment was to merge this, even though we´re already in a later beta, since needed skin changes are very trivial and our skinners are quite good in keeping up with these changes. Are you fine with this?

@Montellese
Copy link
Member

Fine with me but don't forget to squash the cleanup commit(s).

@Montellese Montellese added Type: Improvement non-breaking change which improves existing functionality API change: GUI labels Oct 6, 2016
@phil65
Copy link
Contributor Author

phil65 commented Oct 6, 2016

All follow-up stuff squashed into one commit.
jenkins build this please.

@phil65 phil65 merged commit 0aacf5c into xbmc:master Oct 6, 2016
@phil65 phil65 deleted the playlistorder_spinner branch October 6, 2016 23:01
@jingai
Copy link
Contributor

jingai commented Jan 10, 2017

Why was the Order button (id=19 in SmartPlaylistEditor.xml) changed from togglebutton to button? It only toggles between two values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change: GUI Type: Improvement non-breaking change which improves existing functionality v17 Krypton
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants