Created
February 18, 2014 12:43
-
-
Save Eugeny/9070215 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ajenti.api import * | |
from ajenti.plugins.main.api import SectionPlugin | |
from ajenti.ui import on | |
from ajenti.ui.binder import Binder | |
@plugin | |
class GLSlideShowPrefs (SectionPlugin): | |
default_classconfig = { | |
'option_1_enable': True # etc | |
} | |
classconfig_root = True | |
def init(self): | |
self.title = 'Screensaver' | |
self.icon = 'picture' | |
self.category = 'Sanickiosk' | |
self.append(self.ui.inflate('glslideshow_flags:main')) | |
self.binder = Binder(self, self) | |
self.binder.populate() | |
@on('save', 'click') | |
def save(self): | |
self.binder.update() | |
self.save_classconfig() | |
cmdline = '' | |
print self.classconfig | |
for option in ['option_1', 'option_2']: | |
if self.classconfig.get(option + '_enable', False): | |
cmdline += '--%s ' % option | |
value = self.classconfig.get(option + '_value', False) | |
if value: | |
cmdline += '%s ' % value | |
print cmdline # save |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<vc> | |
<body> | |
<pad> | |
<bind:dict bind="classconfig"> | |
<vc> | |
<formline text="Option 1"> | |
<checkbox bind="option_1_enable" /> | |
</formline> | |
<formline text="Option 2"> | |
<hc> | |
<checkbox bind="option_2_enable" /> | |
<textbox bind="option_2_value" /> | |
</hc> | |
</formline> | |
</vc> | |
</bind:dict> | |
</pad> | |
</body> | |
<button id="save" text="{Save}" icon="ok" /> | |
</vc> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment