* src/PluginUtils/_PluginWindows.py: Removed unnecessary code
* src/PluginUtils/_MenuOptions.py: Added "Change" button for filter option 2007-12-06 Douglas S.Blank <dblank@cs.brynmawr.edu> svn: r9454
This commit is contained in:
parent
4742947510
commit
dca7b6cc27
@ -1,3 +1,7 @@
|
|||||||
|
2007-12-06 Douglas S.Blank <dblank@cs.brynmawr.edu>
|
||||||
|
* src/PluginUtils/_PluginWindows.py: Removed unnecessary code
|
||||||
|
* src/PluginUtils/_MenuOptions.py: Added "Change" button for filter option
|
||||||
|
|
||||||
2007-12-06 Douglas S.Blank <dblank@cs.brynmawr.edu>
|
2007-12-06 Douglas S.Blank <dblank@cs.brynmawr.edu>
|
||||||
* src/PluginUtils/_PluginMgr.py: return values on load_plugins was
|
* src/PluginUtils/_PluginMgr.py: return values on load_plugins was
|
||||||
reversed: return True if errors.
|
reversed: return True if errors.
|
||||||
|
@ -433,27 +433,68 @@ class FilterListOption(Option):
|
|||||||
"""
|
"""
|
||||||
return self.__filters
|
return self.__filters
|
||||||
|
|
||||||
|
def clear_filters(self):
|
||||||
|
"""
|
||||||
|
Clear all of the filter objects.
|
||||||
|
|
||||||
|
"""
|
||||||
|
self.__filters = []
|
||||||
|
|
||||||
def make_gui_obj(self, gtk, dialog):
|
def make_gui_obj(self, gtk, dialog):
|
||||||
"""
|
"""
|
||||||
Add an FilterListOption to the dialog.
|
Add an FilterListOption to the dialog.
|
||||||
"""
|
"""
|
||||||
from ReportBase import ReportUtils
|
from ReportBase import ReportUtils
|
||||||
self.gobj = gtk.combo_box_new_text()
|
self.dialog = dialog
|
||||||
|
self.combo = gtk.combo_box_new_text()
|
||||||
|
self.gobj = gtk.HBox()
|
||||||
for filter in self.get_items():
|
for filter in self.get_items():
|
||||||
if filter in ["person"]:
|
if filter in ["person"]:
|
||||||
# FIXME: get filter list from filter sidebar?
|
# FIXME: get filter list from filter sidebar?
|
||||||
filter_list = ReportUtils.get_person_filters(dialog.person,False)
|
filter_list = ReportUtils.get_person_filters(dialog.person,
|
||||||
|
include_single=True)
|
||||||
for filter in filter_list:
|
for filter in filter_list:
|
||||||
self.gobj.append_text(filter.get_name())
|
self.combo.append_text(filter.get_name())
|
||||||
self.add_filter(filter)
|
self.add_filter(filter)
|
||||||
# FIXME: set proper default
|
# FIXME: set proper default
|
||||||
self.gobj.set_active(0)
|
self.combo.set_active(0)
|
||||||
|
self.change_button = gtk.Button("%s..." % _('C_hange') )
|
||||||
|
self.change_button.connect('clicked',self.on_change_clicked)
|
||||||
|
self.gobj.pack_start(self.combo, False)
|
||||||
|
self.gobj.pack_start(self.change_button, False)
|
||||||
|
|
||||||
|
def on_change_clicked(self, *obj):
|
||||||
|
from Selectors import selector_factory
|
||||||
|
SelectPerson = selector_factory('Person')
|
||||||
|
sel_person = SelectPerson(self.dialog.dbstate,
|
||||||
|
self.dialog.uistate,
|
||||||
|
self.dialog.track)
|
||||||
|
new_person = sel_person.run()
|
||||||
|
if new_person:
|
||||||
|
self.dialog.person = new_person
|
||||||
|
self.update_gui_obj()
|
||||||
|
|
||||||
|
def update_gui_obj(self):
|
||||||
|
# update the gui object with new filter info
|
||||||
|
from ReportBase import ReportUtils
|
||||||
|
for i in range(len(self.get_filters())):
|
||||||
|
self.combo.remove_text(0)
|
||||||
|
self.clear_filters()
|
||||||
|
for filter in self.get_items():
|
||||||
|
if filter in ["person"]:
|
||||||
|
filter_list = ReportUtils.get_person_filters(self.dialog.person,
|
||||||
|
include_single=True)
|
||||||
|
for filter in filter_list:
|
||||||
|
self.combo.append_text(filter.get_name())
|
||||||
|
self.add_filter(filter)
|
||||||
|
# FIXME: set proper default
|
||||||
|
self.combo.set_active(0)
|
||||||
|
|
||||||
def parse(self):
|
def parse(self):
|
||||||
"""
|
"""
|
||||||
Parse the object and return.
|
Parse the object and return.
|
||||||
"""
|
"""
|
||||||
index = self.gobj.get_active()
|
index = self.combo.get_active()
|
||||||
items = self.get_filters()
|
items = self.get_filters()
|
||||||
filter = items[index]
|
filter = items[index]
|
||||||
return filter
|
return filter
|
||||||
|
@ -324,18 +324,6 @@ class ToolManagedWindowBase(ManagedWindow.ManagedWindow):
|
|||||||
def post_run(self):
|
def post_run(self):
|
||||||
self.progress.close()
|
self.progress.close()
|
||||||
|
|
||||||
def on_center_person_change_clicked(self,*obj):
|
|
||||||
from Selectors import selector_factory
|
|
||||||
SelectPerson = selector_factory('Person')
|
|
||||||
sel_person = SelectPerson(self.dbstate,self.uistate,self.track)
|
|
||||||
new_person = sel_person.run()
|
|
||||||
if new_person:
|
|
||||||
self.new_person = new_person
|
|
||||||
new_name = name_displayer.display(new_person)
|
|
||||||
if new_name:
|
|
||||||
self.person_label.set_text( "<i>%s</i>" % new_name )
|
|
||||||
self.person_label.set_use_markup(True)
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Functions related to setting up the dialog window.
|
# Functions related to setting up the dialog window.
|
||||||
@ -378,23 +366,6 @@ class ToolManagedWindowBase(ManagedWindow.ManagedWindow):
|
|||||||
Should be overwritten by standalone report dialogs. """
|
Should be overwritten by standalone report dialogs. """
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# center_label = gtk.Label("<b>%s</b>" % _("Center Person"))
|
|
||||||
# center_label.set_use_markup(True)
|
|
||||||
# center_label.set_alignment(0.0,0.5)
|
|
||||||
# self.tbl.set_border_width(12)
|
|
||||||
# self.tbl.attach(center_label,0,4,self.col,self.col+1)
|
|
||||||
# self.col += 1
|
|
||||||
|
|
||||||
# name = name_displayer.display(self.person)
|
|
||||||
# self.person_label = gtk.Label( "%s" % name )
|
|
||||||
# self.person_label.set_alignment(0.0,0.5)
|
|
||||||
# self.tbl.attach(self.person_label,2,3,self.col,self.col+1)
|
|
||||||
|
|
||||||
# change_button = gtk.Button("%s..." % _('C_hange') )
|
|
||||||
# change_button.connect('clicked',self.on_center_person_change_clicked)
|
|
||||||
# self.tbl.attach(change_button,3,4,self.col,self.col+1,gtk.SHRINK)
|
|
||||||
# self.col += 1
|
|
||||||
|
|
||||||
def add_frame_option(self,frame_name,label_text,widget,tooltip=None):
|
def add_frame_option(self,frame_name,label_text,widget,tooltip=None):
|
||||||
"""Similar to add_option this method takes a frame_name, a
|
"""Similar to add_option this method takes a frame_name, a
|
||||||
text string and a Gtk Widget. When the interface is built,
|
text string and a Gtk Widget. When the interface is built,
|
||||||
|
Loading…
Reference in New Issue
Block a user