Check-in [4767ecba93]
Overview
Comment: | Make specbuttons smaller, lookup image names (using `locate` - should be moved to configwin saving callback, as it's slow on startup otherwise) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
4767ecba9383dabbc22d6d40a8df5d0c |
User & Date: | mario on 2016-10-18 21:57:54 |
Other Links: | manifest | tags |
Context
2016-10-18
| ||
22:11 | Move action/playback handlers to contrib/cmdline/ check-in: 05817e12db user: mario tags: trunk | |
21:57 | Make specbuttons smaller, lookup image names (using `locate` - should be moved to configwin saving callback, as it's slow on startup otherwise) check-in: 4767ecba93 user: mario tags: trunk | |
21:27 | Prepare specbuttons addin (small user-defined application control interface, adds to the main toolbar) check-in: e1d9342408 user: mario tags: trunk | |
Changes
Modified st2.py from [0bca1b8083] to [af3c3860ce].
︙ | ︙ | |||
30 31 32 33 34 35 36 | # # Primarily radio stations are displayed, some channels however are music # collections. Commercial and sign-up services are not an objective. # standard modules import sys | | | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | # # Primarily radio stations are displayed, some channels however are music # collections. Commercial and sign-up services are not an objective. # standard modules import sys import os, subprocess import re from copy import copy import inspect import traceback from threading import Thread import time from compat2and3 import * |
︙ | ︙ | |||
448 449 450 451 452 453 454 | pix = pix.scale_simple(int(321*r), int(115*r), gtk.gdk.INTERP_BILINEAR) self.img_logo.set_from_pixbuf(pix) # Extra buttons def specbuttons_load(self): x = 0 for btn,cmd in conf.specbuttons.items(): | | > | > > > > > > > > > > > | > | | < > | > > | 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 | pix = pix.scale_simple(int(321*r), int(115*r), gtk.gdk.INTERP_BILINEAR) self.img_logo.set_from_pixbuf(pix) # Extra buttons def specbuttons_load(self): x = 0 for btn,cmd in conf.specbuttons.items(): log.IN(btn, cmd) i = gtk.Image() if (btn.find("gtk-") == 0): i.set_from_stock(btn, gtk.ICON_SIZE_SMALL_TOOLBAR) else: path = None if os.path.exists(btn): path = btn else: f = subprocess.Popen(["locate", "/usr/share/[pi]*s/*%s*.*" % btn], stdout=subprocess.PIPE) path, err = f.communicate() path = path.split("\n")[0] log.DATA(path) if path: i.set_from_file(path) b = gtk.Button() b.set_image(i) b.connect("clicked", lambda x0, cmd=cmd, *x: action.run(cmd) ) self.specbuttons.attach( b, int(x / 2), int(x/2)+1, x%2, (x%2)+1, gtk.SHRINK, gtk.SHRINK, 0, 0 ) x = x + 1 self.specbuttons.show_all() # load application state (widget sizes, selections, etc.) def init_app_state(self): winlayout = conf.load("window") if (winlayout): |
︙ | ︙ |