Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI JS: Add channel icon reset
  • Loading branch information
perexg committed Oct 22, 2014
1 parent 9da4003 commit 469f834
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/webui/static/app/chconf.js
Expand Up @@ -130,6 +130,12 @@ tvheadend.channel_tab = function(panel, index)
sel[1].set('number', tmp);
}

function reset_icons(ctx, e, store, sm) {
Ext.each(sm.getSelections(), function(channel) {
channel.set('icon', '');
});
}

var mapButton = {
name: 'map',
builder: function() {
Expand Down Expand Up @@ -195,6 +201,19 @@ tvheadend.channel_tab = function(panel, index)
callback: swap_numbers
};

var iconResetButton = {
name: 'iconreset',
builder: function() {
return new Ext.Toolbar.Button({
tooltip: 'Reset (clear) the selected icon URLs',
iconCls: 'cancel',
text: 'Reset Icon',
disabled: false
});
},
callback: reset_icons
};

tvheadend.idnode_grid(panel, {
url: 'api/channel',
comet: 'channel',
Expand All @@ -210,7 +229,7 @@ tvheadend.channel_tab = function(panel, index)
create: {}
},
del: true,
tbar: [mapButton, lowNoButton, noUpButton, noDownButton, noSwapButton],
tbar: [mapButton, lowNoButton, noUpButton, noDownButton, noSwapButton, iconResetButton],
lcol: [
{
width: 50,
Expand Down

3 comments on commit 469f834

@ProfYaffle
Copy link
Member

Choose a reason for hiding this comment

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

@PiterEL I've been there, desperately hoping for a merge so I can make some more changes - but you do realise that everyone following the tvheadend repository gets notified every time you plead for a merge, don't you?

You'd be better off creating a branch:

git checkout -b BRANCH

... making your changes here and then keeping it rebased:

git checkout BRANCH
git rebase upstream/master
git push -f

This basically grabs a copy of (your) master and replays your (branch) changes on top of it so that your PR is always up-to-date and mergable. It also means that you can build a local executable that includes both your changes and all the latest commits to master - assuming you keep your master up-to-date with something like:

git checkout master
git fetch upstream
git merge upstream/master
git push

You can create as many branches as you like (so one per project/change, perhaps?) so new commits don't end up in an existing PR. You can keep branches rebased to each other as well (git rebase upstream/BRANCH) so you have separate branches with separate PRs but yet still have a version with all changes from this and other branches. Just remember to use git checkout to switch to the right branch before you do anything; as PRs get merged, you can delete the merged branch and move back towards rebasing to master as that now includes your other changes.

Just a suggestion. I'm sure someone can correct my git-fu as I'm a noob as well, but that's the essence of it all.

https://tvheadend.org/projects/tvheadend/wiki/Git

@ProfYaffle
Copy link
Member

Choose a reason for hiding this comment

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

Being a beginner is fine, don't worry. You're very nearly there... you've obviously created the first branch and the PR and that's all perfect.

The problem is that - once a PR is open - all subsequent commits will be added to it. That's what you're seeing when PR #518 gets your "HEL: Update image..." commit - it's what you were seeing when you were changing master as well, all commits feed into your PR and you start sending messages to @perexg, pleading that he merge it all 😄

What you thus need to do is create another new branch for this next change. Do it exactly as you did before, make the change, push it and open the PR. Make sure you're on master before you create the new branch.

You now have:

master ----- branch 1 with "WEBUI: Changed icon for reset icon and clen image cache"
            |
            ----- branch 2 with "HEL: Update image for Configuration>Channels"

So both branches are based on a snapshot of master, taken at the time you created the branches.

Rebasing (as above) then brings them back up-to-date with master, but they're still independent. That's probably a good thing.

If you NEED to have all changes rolled into one, then you can either:

  1. Branch your first branch to create your second (vs branching from master)
  2. Rebase your second branch onto your first one instead of onto master

... but you'll need to play with these as either of them will get very messy IMO. Better to make individual changes that can be merged one at a time. If a major one is merged then a rebase of the second will show merge conflicts - clean these up and rebase and you'll be ready for merge again.

Now, I'm also spamming half of github with this, so I'll leave it there. There are many tutorials on the web.

@ProfYaffle
Copy link
Member

Choose a reason for hiding this comment

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

Once merged, you can simply delete branch 1 and branch 2 as you don't need them any more. Keep master updated to reflect the main repository, and you now have a 'clean' reference point once more that includes your changes because they've been merged. If they're not merged, just rebase your branches so they can be merged cleanly.

Go to 'branches' on the github website, and simply click the trash can next to the branch - it's now gone. There are command-line ways in which to do it as well, but that's the easiest.

And my Polish is worse, don't worry 😉

Please sign in to comment.