Gui lists all tracks

This commit is contained in:
bjschuma 2010-01-18 19:25:12 -05:00
parent 2efc3034a7
commit 3bdc08476b
5 changed files with 127 additions and 0 deletions

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
</project-private>

View File

@ -0,0 +1,5 @@
__author__="bjschuma"
__date__ ="$Jan 16, 2010 12:46:48 PM$"
__all__ = ["listPage"]

View File

@ -0,0 +1,46 @@
#! /usr/bin/python
# To change this template, choose Tools | Templates
# and open the template in the editor.
__author__="bjschuma"
__date__ ="$Jan 16, 2010 12:47:28 PM$"
import gtk
from guiGTK import *
from bt.message import *
from tools import database
def library():
select = "track.name, artist.name, album.name"
frm = "track,artist,album"
where = "track.artist=artist.id AND track.album=album.id"
return database.select(select,frm,where).fetchall()
class ListPage(box.VBox):
def __init__(self,name):
box.VBox.__init__(self)
self.labelText = name
self.label = label.Label(self.labelText)
self.label.rotate(90)
self.list = list.List(gtk.ListStore(str,str,str), ["Title", "Artist", "Album"])
self.list.rules(True)
self.pack(self.list,True,True)
if name == "Library":
self.fromLibrary()
self.setLabel()
def fromLibrary(self):
for track in library():
self.list.insert(track)
def setLabel(self):
text = self.labelText + " ("
text += str( self.list.count() )
text += ")"
self.label.change(text)

59
src/extra/ogtk.py Normal file
View File

@ -0,0 +1,59 @@
# This is a simple test plugin, to make sure everything is working
__author__="bjschuma"
__date__ ="$Jan 16, 2010 12:18:10 PM$"
global name, app, type, path, opt
name = "test"
app = "scion"
type = "extra"
path = ""
opt = []
from bt.message import write
from manager import manager
import settings
from guiGTK import *
from guiOGTK import *
global window
global vbox
global bar
global tabs
# Called when the plugin needs to perform some action
def run(args):
if args == None:
manager.run("sgtk")
else:
global window, vbox, bar, tabs
window = args[0]
vbox = args[1]
bar = args[2]
window.resize(settings.get("winsize"))
tabs = tabs.Tabs()
vbox.pack(tabs,True,True)
library = listPage.ListPage("Library")
tabs.append(library,library.label)
tabs.tabpos("left")
# Called every time the plugin is enabled
def open():
# Enable scion GTK when we are enabled
manager.run("enable", ["sgtk"])
settings.set("gtkfuncs",run)
settings.set("winsize",(800,600))
# Called every time the plugin is stopped
def close():
pass
def help():
return "Ocarina GTK functions"

13
src/release Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
DIR=ocarina.`date +%F`
SCION=/opt/scion/
sh ./clean
mkdir $DIR
cp -r core $DIR
cp -r extra $DIR
cp -r $SCION/base $DIR
cp -r $SCION/core $DIR
cp -r $SCION/extra $DIR