Jump to content


Photo

ComponentsFromSkin


  • Please log in to reply
43 replies to this topic

Re: ComponentsFromSkin #21 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 22 October 2014 - 00:12

 

Therefore it is better create separate window (Screen) for this message in the plugin...

 

 

I'm trying to do it, but my knownledge of python is not enough...

 

I got it using messagebox

self.session.open(MessageBox, _(hh), MessageBox.TYPE_INFO, timeout = 6)

But window was small/short.

Variable hh has all text (the same which is saved at /tmp folder) , so I assume I have to create a function which creates a new window, but I have to pass it some arguments.

 

I have added the following...

class Result(Screen):
    skin = """
        <screen position="center,center" size="460,450" title="Results" >
            <widget name="myText" position="10,10" size="450,400" font="Regular;20"/>
        </screen>"""

    def __init__(self, session, args = None):
        self.session = session
       
        Screen.__init__(self, session)
        self["myText"] = Label(_(Screen))
        self["myActionMap"] = ActionMap(["SetupActions"],
        {
            "ok": self.close
        }, -1)

Then I should call it when it finishes writing file to /tmp folder... and pass it the hh information

.
.
.
.
fi.write(hh)
fi.close()
self.session.open(Result, hh)

 I'm doing something wrong, I've spent 2 days looking for everywhere and looking at some code, but I don't find it.

 

:(


Enigma is getting old....

 

Spoiler

Re: ComponentsFromSkin #22 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 22 October 2014 - 12:05

I don't understand, what you want?

You want this text can be displayed?

Why?

Is it make sense?

 

In any case, you choose are the wrong way to do it.

 

 

You send attribute hh (string object) to your module Result, but your module do not can receive any arguments.
 



class Result(Screen, any_arguments?):

And it's wrong:
 



self["myText"] = Label(_(Screen))

What is Screen?
Name Screen is not defined by string object.
And why name is Screen?
Name Screen is defined as Screen from module Screen (from Screens.Screen import Screen).

Choose another name and define it as string.

 

Better take a system screen MessageBox (from folder Screens) and copy it to plugin folder and change it for your requirements, remove the any functions and attributes, such as:



type = TYPE_YESNO, timeout = -1, close_on_any_key = False, 

And rename it, for example as MyMessageBox. And import it to plugin:



from MyMessageBox import MyMessageBox

or



import MyMessageBox 

And send him your arguments ....


Edited by a.k.a. Uchkun, 22 October 2014 - 12:05.


Re: ComponentsFromSkin #23 Anzo

  • Senior Member
  • 313 posts

+5
Neutral

Posted 22 October 2014 - 16:33

I tried it with OE2 CVS skins. Those skins work with OpenATV 4.2, but don't show the plugins menu and information menu. This plugin didn't warn of adjust it.


Groet, André

:blink:


Re: ComponentsFromSkin #24 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 22 October 2014 - 17:08

Do not warn about what?

This plugin informs you just about missing components, e.g. converters and renderers, applied in the skin, and which not included in this image by default......


Edited by a.k.a. Uchkun, 22 October 2014 - 17:09.


Re: ComponentsFromSkin #25 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 22 October 2014 - 19:49

I don't understand, what you want?

You want this text can be displayed?

Why?

Is it make sense?

 

In any case, you choose are the wrong way to do it.

 

I just want to have on screen the same info saved on the written file on /tmp/ folder.

I already got it using MessageBox,

self.session.open(MessageBox, _(hh), MessageBox.TYPE_INFO)

but as I said before, if results list is too long, it goes out of screen.

That's why the first day I asked how to change messagebox width and height, to have it bigger and taller.

 

As you told me it had to be changed on skin parameters, I forgot it...  and now what I'm trying to do is to open a new screen, which I'm able to control width and height and position.

That's just what I want, open a new screen (as big as I want) to see the results.

 

Sense ??  Sure it has a very few one.... but as this plugin is very important to me, I try to improve it.

I think some people doesn't really understand its information, I do perfectly, and that's why I'm trying that....


Edited by jpuigs, 22 October 2014 - 19:50.

Enigma is getting old....

 

Spoiler

Re: ComponentsFromSkin #26 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 23 October 2014 - 05:51

 


.... but as this plugin is very important to me, I try to improve it.

I think some people doesn't really understand its information, I do perfectly, and that's why I'm trying that....

 

 

OK.

Try it.

 

On init your screen

class Result(Screen):
skin = """
<screen position="center,center" size="460,450" title="Results" >
<widget source="myText" render="Label" position="10,10" size="450,400" font="Regular;20"/>
</screen>"""

def __init__(self, session, mytext):
self.session = session

Screen.__init__(self, session)
self["myText"] = Label(mytext)
self["myActionMap"] = ActionMap(["SetupActions"],
{
"ok": self.close
}, -1)

To method __init__ add new argument mytext, which is your text hh.

And if you use Label, you must use source="myText", not name="myText", and you must add render="Label"....



Re: ComponentsFromSkin #27 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 23 October 2014 - 06:41

I was wrong. You can specify with name, without source and render, sorry....



Re: ComponentsFromSkin #28 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 23 October 2014 - 06:46

And without myActionMap....

And should look like so

class Result(Screen):
skin = """
<screen position="center,center" size="460,450" title="Results" >
<widget name="myText" position="10,10" size="450,400" font="Regular;20"/>
</screen>"""

def __init__(self, session, mytext):
self.session = session

Screen.__init__(self, session)
self["myText"] = Label(_(mytext))


Re: ComponentsFromSkin #29 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 23 October 2014 - 14:02

Thanks. Later I'll try and post results.


Enigma is getting old....

 

Spoiler

Re: ComponentsFromSkin #30 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 23 October 2014 - 16:34

This code working.

I've already checked







class Result(Screen):
	skin = """
<screen name="Result" position="center,center" size="465,650" title="Results">
  <widget name="myText" position="10,10" size="445,580" font="Regular;20" transparent="1"/>
  <ePixmap position="200,638" zPosition="1" size="165,2" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/ComponentsFromSkin/images/red.png" alphatest="blend" />
  <widget name="red_key" position="215,608" zPosition="2" size="165,30" font="Regular; 20" halign="center" valign="center" backgroundColor="#41000000" foregroundColor="#00dddddd" transparent="1" />
</screen>"""

	def __init__(self, session, mytext):
		self.session = session
		self.setTitle(_("Results"))
		Screen.__init__(self, session)
		self["myText"] = Label(_(mytext))
		self["red_key"] = Label(_("Close"))
		self["shortcuts"] = ActionMap(["ShortcutActions", "WizardActions"],
		{
			"cancel": self.cancel,
			"back": self.cancel,
			"red": self.cancel,
			}, -2)

	def cancel(self):
		self.close()


Edited by a.k.a. Uchkun, 23 October 2014 - 16:36.


Re: ComponentsFromSkin #31 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 23 October 2014 - 18:41

The last code produces green crash screen (GSOD).

I've deleted this line:

self.setTitle(_("Results"))

and now works fine.

 

The first two codes you wrote at 7 am work fine too.

I'll do some small "cosmetic" adjustments, and when I got them I'll write the code.

Thanks.


Enigma is getting old....

 

Spoiler

Re: ComponentsFromSkin #32 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 23 October 2014 - 19:44

Next version 1.4

Changes?

 

See in screenshotes......

 

 

 

 

a65c3bf4b00b.jpg

 

 

 

 

222b80564712.jpg

 

Attached Files


Edited by a.k.a. Uchkun, 23 October 2014 - 19:45.


Re: ComponentsFromSkin #33 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 23 October 2014 - 20:50

I forgot to thank jpuigs, his previous code is also included in the plugin.

Thanks to jpuigs.....


Edited by a.k.a. Uchkun, 23 October 2014 - 20:50.


Re: ComponentsFromSkin #34 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 23 October 2014 - 22:08

Next version 1.4

 

  :)

 

Thank's , you've saved me work....

Now I'm thinking of new functions....


Enigma is getting old....

 

Spoiler

Re: ComponentsFromSkin #35 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 24 October 2014 - 01:08

I'm thinking about 2 lists in a common (wider) screen. (converter and render)

<widget name="mylistc" position="10,10" size="380,480" scrollbarMode="showOnDemand" transparent="1"/>
<widget name="mylistr" position="410,10" size="480,480" scrollbarMode="showOnDemand" transparent="1"/>

So I define another argument....

















def __init__(self, session, mylstc, mylstr):
...
...
...
...
self["mylistc"] = MenuList(mylstc)
self["mylistr"] = MenuList(mylstr)









 

and I open it in this way...

self.session.open(Result, myc, myr)

It works fine..... but I have a problem.

If lists are long,  they appear scrollbars on both sides, but I can only move the right one, not the left one.

How could I do it to select  left or right scrollbar ?   focus_set() ?

 

Attached File  componentsfromskin.jpg   66.71KB   5 downloads

 

 


Edited by jpuigs, 24 October 2014 - 01:09.

Enigma is getting old....

 

Spoiler

Re: ComponentsFromSkin #36 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 24 October 2014 - 05:14

I'm thinking about 2 lists in a common (wider) screen. (converter and render)

.................... but I can only move the right one, not the left one.

How could I do it to select  left or right scrollbar ?   focus_set() ?

 

attachicon.gifcomponentsfromskin.jpg

 

I don't know which module in image contains method setFokus.....



Re: ComponentsFromSkin #37 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 25 October 2014 - 12:52

Neither Do I.

I've been 'googleing' and I don't find anything....

 

Then I'll do separate lists.

Just one question

 

Action code....

if config.plugins.componentsfromskin.imagemode.value == '1':
  defconv = [List of Converters1.........]
  defren = [List of Renderers1......]
   try:
    CODE 1
 
if config.plugins.componentsfromskin.imagemode.value == '2':
  defconv = [List of Converters2.........]
  defren = [List of Renderers2......]
   try:
    CODE 2
 
if config.plugins.componentsfromskin.imagemode.value == '3':
  defconv = [List of Converters3.........]
  defren = [List of Renderers3......]
   try:
    CODE 3

Is CODE 1 = CODE 2 = CODE 3 ???

 

I Think they are al the same.

 

I ask you because I want to simplify code and delete repeated things.


Edited by jpuigs, 25 October 2014 - 12:56.

Enigma is getting old....

 

Spoiler

Re: ComponentsFromSkin #38 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 26 October 2014 - 05:44

Once this code is in the plugin, probably needs it.

Is not that?

This plugin for three images, vti, openpli and blackhole.

They have different default components of course..... 



Re: ComponentsFromSkin #39 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 26 October 2014 - 05:58

If you intend to use the plugin for only one image, openpli, you can remove the two parts

if config.plugins.componentsfromskin.imagemode.value == 


Re: ComponentsFromSkin #40 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 26 October 2014 - 06:08

I do not understand why you need two lists? Do all in one list is not visible?

In Google you can find, how do it in tkinter for example.

It is very simple.

But in image openpli, Google not tell you.......


Edited by a.k.a. Uchkun, 26 October 2014 - 06:11.



9 user(s) are reading this topic

0 members, 9 guests, 0 anonymous users