Began work on gtk functions
This commit is contained in:
parent
fbe5a760f7
commit
b2a469a247
|
@ -92,7 +92,7 @@ def loop():
|
|||
disp(input)
|
||||
|
||||
while halt == False:
|
||||
#emit("loop")
|
||||
emit("cliloop")
|
||||
#list = settings.get("everyloop",True)
|
||||
#if not list == None:
|
||||
# for func in list:
|
||||
|
|
|
@ -61,13 +61,9 @@ def disp(string, y=-1):
|
|||
else:
|
||||
stdscr.leaveok(True)
|
||||
move = stdscr.getyx()
|
||||
l = len(string)
|
||||
if l == 0:
|
||||
return
|
||||
space = " " * settings.get("maxyx")[1]
|
||||
stdscr.addstr(y, 0, space)
|
||||
#stdscr.addstr(y, 0, space)
|
||||
|
||||
|
||||
|
||||
try:
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ class Plugin(plugin.Plugin):
|
|||
|
||||
if len(list) == 0:
|
||||
write("Nothing to list")
|
||||
return
|
||||
return []
|
||||
|
||||
write(type + " plugins")
|
||||
write("----------------")
|
||||
|
@ -58,6 +58,8 @@ class Plugin(plugin.Plugin):
|
|||
if args[0] == "enable":
|
||||
func = manager.enablePlugin
|
||||
elif args[0] == "disable":
|
||||
if ("plugins" in args)==True:
|
||||
return
|
||||
func = manager.disablePlugin
|
||||
elif args[0] == "reload":
|
||||
func = manager.reloadPlugin
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
__author__="bjschuma"
|
||||
__date__ ="$Jan 14, 2010 10:39:29 PM$"
|
||||
|
||||
import window
|
||||
import gtk
|
||||
|
||||
class Bar(gtk.MenuBar):
|
||||
|
@ -27,5 +28,14 @@ class Item(gtk.MenuItem):
|
|||
menu.append(sub)
|
||||
self.set_submenu(menu)
|
||||
|
||||
|
||||
self.show()
|
||||
|
||||
|
||||
def makeBar():
|
||||
def pluginWindow(item):
|
||||
w = window.PluginWindow()
|
||||
bar = Bar()
|
||||
plugins = Item("Plugins",pluginWindow)
|
||||
tools = Item("Tools",None,[plugins])
|
||||
bar.append(tools)
|
||||
return bar
|
|
@ -12,7 +12,7 @@ import list
|
|||
import button
|
||||
import label
|
||||
from bt.message import write
|
||||
from manager import manager
|
||||
import manager
|
||||
import settings
|
||||
|
||||
|
||||
|
@ -21,7 +21,7 @@ def empty(text=None,verbose=None):
|
|||
|
||||
|
||||
def quit(a,b):
|
||||
manager.run("enable",["exit"])
|
||||
manager.run("plugins",["enable", "exit"])
|
||||
manager.run("exit")
|
||||
|
||||
|
||||
|
@ -55,7 +55,6 @@ class PluginWindow(Window):
|
|||
def __init__(self):
|
||||
Window.__init__(self,"Plugin Manager")
|
||||
self.quit(self.hide)
|
||||
manager.run("enable", ["lsmod"])
|
||||
self.vbox = box.VBox()
|
||||
self.hbox = box.HBox()
|
||||
self.vbox.pack(self.hbox,True,True)
|
||||
|
@ -65,13 +64,13 @@ class PluginWindow(Window):
|
|||
|
||||
self.enabled = list.List(gtk.ListStore(str), ["Enabled"])
|
||||
self.enabled.connect("cursor-changed", self.changeLabel, "enabled")
|
||||
enabledMods = manager.run("lsmod","enabled")
|
||||
enabledMods = manager.call("plugins",["list", "enabled"])
|
||||
for mod in enabledMods:
|
||||
self.enabled.insert([mod])
|
||||
|
||||
self.disabled = list.List(gtk.ListStore(str), ["Disabled"])
|
||||
self.disabled.connect("cursor-changed", self.changeLabel, "disabled")
|
||||
disabledMods = manager.run("lsmod","disabled")
|
||||
disabledMods = manager.call("plugins",["list","disabled"])
|
||||
for mod in disabledMods:
|
||||
self.disabled.insert([mod])
|
||||
|
||||
|
@ -103,16 +102,16 @@ class PluginWindow(Window):
|
|||
|
||||
def enable(self,button,name):
|
||||
list, path, plugin = self.getPlugin(self.disabled)
|
||||
manager.run("enable",[plugin] )
|
||||
if (plugin in manager.run("lsmod", "enabled")) == True:
|
||||
manager.run("plugins", ["enable",plugin] )
|
||||
if (plugin in manager.call("plugins", ["list","enabled"])) == True:
|
||||
self.disabled.remove(path)
|
||||
self.enabled.insert([plugin])
|
||||
|
||||
|
||||
def disable(self,button,name):
|
||||
list, path, plugin = self.getPlugin(self.enabled)
|
||||
manager.run("disable",[plugin])
|
||||
if (plugin in manager.run("lsmod", "disabled")) == True:
|
||||
manager.run("plugins", ["disable",plugin])
|
||||
if (plugin in manager.call("plugins",["list", "disabled"])) == True:
|
||||
self.enabled.remove(path)
|
||||
self.disabled.insert([plugin])
|
||||
|
||||
|
@ -124,6 +123,6 @@ class PluginWindow(Window):
|
|||
list, path, plugin = self.getPlugin(self.disabled)
|
||||
|
||||
#settings.set("write", empty)
|
||||
message = manager.run("help",[plugin])
|
||||
message = manager.call("help",[plugin])
|
||||
self.lbl.change(message)
|
||||
#settings.pop("write")
|
||||
|
|
|
@ -62,18 +62,14 @@ class Plugin(plugin.Plugin):
|
|||
|
||||
def loop(self):
|
||||
global vbox,bar,win
|
||||
manager.run("disable",["cli"])
|
||||
manager.run("plugins", ["disable","cli"])
|
||||
|
||||
win = window.Window(settings.get("appname").title())
|
||||
vbox = box.VBox()
|
||||
win.add(vbox)
|
||||
|
||||
bar = menu.Bar()
|
||||
bar = menu.makeBar()
|
||||
vbox.pack(bar)
|
||||
plugins = menu.Item("Plugins",self.pluginWindow)
|
||||
|
||||
tools = menu.Item("Tools",None,[plugins])
|
||||
bar.append(tools)
|
||||
|
||||
if settings.has("gtkfuncs") == True:
|
||||
for func in settings.get("gtkfuncs", True):
|
||||
|
|
Loading…
Reference in New Issue