Ocarina window new preferences tree
The main window will set its size based on the new preferences tree, instead of the old preferences map.
This commit is contained in:
parent
de31941af1
commit
7f82a08a3a
|
@ -25,16 +25,20 @@ plugin = None
|
|||
audio = None
|
||||
lastfm = None
|
||||
|
||||
init_pref2 = None
|
||||
|
||||
|
||||
# Initialize helpful variables
|
||||
def init():
|
||||
global prefs
|
||||
global prefs2
|
||||
global init_pref2
|
||||
global audio
|
||||
global lastfm
|
||||
|
||||
prefs = Map("preferences")
|
||||
prefs2 = trees.get_pref_tree("preferences")
|
||||
init_pref2 = prefs2.init_pref
|
||||
import audio
|
||||
import lastfm
|
||||
|
||||
|
|
|
@ -10,11 +10,14 @@ import ocarina
|
|||
|
||||
from ocarina import collection
|
||||
|
||||
libsaria.init_pref("window_size", (800,600))
|
||||
libsaria.init_pref2("ocarina.window.width", 800)
|
||||
libsaria.init_pref2("ocarina.window.height", 600)
|
||||
|
||||
prefs = libsaria.prefs
|
||||
prefs2 = libsaria.prefs2
|
||||
win_prefs = prefs2.lookup_child(["ocarina", "window"])
|
||||
size = (win_prefs.get_pref("width"), win_prefs.get_pref("height"))
|
||||
|
||||
win = ocarina.get_window(prefs["window_size"])
|
||||
win = ocarina.get_window(size)
|
||||
ocarina.set_window_title(ocarina.__vers__)
|
||||
ocarina.set_window_icon("images/ocarina.png")
|
||||
|
||||
|
|
|
@ -37,7 +37,8 @@ def init(size):
|
|||
|
||||
|
||||
def resized(widget, geom):
|
||||
libsaria.prefs["window_size"] = (geom.width, geom.height)
|
||||
libsaria.prefs2.set_pref("ocarina.window.width", geom.width)
|
||||
libsaria.prefs2.set_pref("ocarina.window.height", geom.height)
|
||||
|
||||
|
||||
def dnd_receive(widget, context, x, y, selection, type, time):
|
||||
|
|
Loading…
Reference in New Issue
Block a user