• 1
  • 54
  • 55
  • 56(current)
  • 57
  • 58
  • 140
Release script.skinshortcuts
(2015-10-16, 05:58)tomer953 Wrote: Now Im thinking how to take it to the next level, I tought to make some custom dialog to the unlock code instead of the Skin.SetNumeric window,
There is a way to pass the ::ACTION:: to my custom dialog? so once the user is typing the right code - it will perform the action immediately.
Code:
Skin.SetString(action,::ACTION::)
- will work fine in the override?

If you wanted to try making the changes to the script so that this would work, you'd (likely - I'm not in a position to test this) need to change the following in datafunctions.py - somewhere around line 280 - there is:-

Code:
if actions.text == "::ACTION::":
    newaction.text = action.text

It would need changing to:-

Code:
if "::ACTION::" in actions.text:
   newaction.text = actions.text.replace("::ACTION::",action.text)

Note that this is blind, as it were - as I say I'm not in a position to test whether this would work (though it should). You'd obviously also need to ensure you match the indenting of the surrounding code. And, if it does work, please consider PR'ing Wink
Reply
Confirmed Worked!
Thank you very much.
I will update here when finish mod it. :]
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
Great Smile

As I said, please do consider PR'ing this. I won't be able to make the changes myself for a few days so it would mean (unless someone else makes the changes themselves) it would land on the git master a lot quicker. With how quiet this thread has been over the last few days, and with the fact that there are 'wip' skins being tested that are reliant on git changes, my instinct is we're not far off a repo update and having this merged means that could (potentially) happen faster.

If you do PR it, though, please also update the changelog.txt - something like `[tomer953] Remove requirement for ::ACTION:: in action override to be the only text in element` - only better written Wink (Though please do include your name - I've always liked the idea of highlighting those who only occasionally contribute to the script in the changelog)

(Once this is merged I'll open an issue on Git to see if the general consensus is that we're ready for a repo push, hoping that Marcelveldt will lead such Smile)
Reply
Actually i'm not using git so much if at all, but ill fork and pr it tomorrow.

http://i.imgur.com/eDyGN06.jpg
work as charm. huge thanks
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
I'm wondering if there is a way to INSERT a new tile rather than adding it to the bottom? I find the majority of the time I would prefer the tile to be added just below the currently selected item rather than at the end of the list.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
Sounds sensible, and should be a pretty easy change. Up for hacking the script yourself? (Otherwise I'll sort it this weekend).

First off we need to know the index of the selected item in our list of all items (which also includes hidden items) and add one to it (where we're going to insert the new item). So, somewhere around line 875 in gui.py there is:-

Code:
listControl = self.getControl( 211 )

Right after it, add:-

Code:
num = listControl.getSelectedPosition()
orderIndex = int( listControl.getListItem( num ).getProperty( "skinshortcuts-orderindex" ) ) + 1

Then, rather than the existing `append()` and `_display_listitems()` lines, the following will insert and highlight new item:-

Code:
self.allListItems.insert( orderIndex, listitem )
self._display_listitems( num + 1 )

And finally, there's some out of date code in there (obviously written before _display_listitems() could also set the focus), so delete the last line of the function.

Of course, the indenting of the surrounding code needs to be respected, and it's always possible I've made a typo so if it doesn't work as-is accept my apologies.
Reply
Sounds great, I will also test it in my end later today.
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
(2015-10-22, 08:44)BobCratchett Wrote: Sounds sensible, and should be a pretty easy change. Up for hacking the script yourself? (Otherwise I'll sort it this weekend).

First off we need to know the index of the selected item in our list of all items (which also includes hidden items) and add one to it (where we're going to insert the new item). So, somewhere around line 875 in gui.py there is:-

Code:
listControl = self.getControl( 211 )

Right after it, add:-

Code:
num = listControl.getSelectedPosition()
orderIndex = int( listControl.getListItem( num ).getProperty( "skinshortcuts-orderindex" ) ) + 1

Then, rather than the existing `append()` and `_display_listitems()` lines, the following will insert and highlight new item:-

Code:
self.allListItems.insert( orderIndex, listitem )
self._display_listitems( num + 1 )

And finally, there's some out of date code in there (obviously written before _display_listitems() could also set the focus), so delete the last line of the function.

Of course, the indenting of the surrounding code needs to be respected, and it's always possible I've made a typo so if it doesn't work as-is accept my apologies.

Like that?
http://pastebin.com/QMssiNqk
http://i.imgur.com/A4WRDYu.png

i'm getting script.error:
http://pastebin.com/T4CnAP8s

b.t.w, Im modifying the py file that is in my actual skinshortcuts folder, its ok, right?
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
Indentation error Smile At a guess you've used tabs to indent the code rather than the spaces that Python requires.
Reply
ah..my bad.
Tested and worked fine.
Do you want me to PR it ?

b.t.w, I just saw, that the "reset" option I used, is now launching a dialogselect with two options: "Restore a default shortcut" "Restore to skin default"
can I force the second one?
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
Up to you if you want to PR it, otherwise I'll do it myself in the next couple of days.

Nope, no way to force the second option unless you want to add an override yourself for it Wink (You'd add a new variable to hold whether the override is enabled in __init__, actually load the override in _load_widgetsbackgrounds() - a function that needs renaming at some stage Wink - then add an if/else to the code for GUI 308. (And then update the docs, of course!) Follow how widgetRename is done for an example.

Again, though, its a sensible option so if you're not up for it (and no-one else is) I'll add it myself when I'm next working with this code.
Reply
PR'ed.
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
Merged Smile And many thanks for doing it.
Reply
NP.

I just consulting with you, but what you say about an optinal setting to ignore shortcuts from being saved from one skin to another?
In my eyes, It was supposed to be an Advantage, but since skinners use their own layouts and Properties - I found myself reset shortcuts again and again with every skin change.
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
I'm not against seeing it added if someone wants to take the time to code it. Technically it would be a relatively easy change, but to do it right wouldn't necessarily be (right now the script saves the shortcuts and the properties separately, for example, which wouldn't make sense with this option). Personally, though I'd like to see those properties that cause issues not be transferred, rather than the shortcuts themselves (for example, custom user icons have been known to be difficult to transfer between skins, so should probably be skin-specific).
Reply
  • 1
  • 54
  • 55
  • 56(current)
  • 57
  • 58
  • 140

Logout Mark Read Team Forum Stats Members Help
script.skinshortcuts8
This forum uses Lukasz Tkacz MyBB addons.