Back to index

gcompris  8.2.2
Public Member Functions | Public Attributes
admin.module_profiles.Profiles Class Reference
Inheritance diagram for admin.module_profiles.Profiles:
Inheritance graph
[legend]
Collaboration diagram for admin.module_profiles.Profiles:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def position
def start
def stop
def init
def get_module_name
def start

Public Attributes

 con
 cur
 rootitem
 module_name
 module_label
 canvas
 selector_color
 outline_color
 module_panel_ofset
 root_select_item
 select_item

Detailed Description

Administrating GCompris Profiles

Definition at line 34 of file module_profiles.py.


Constructor & Destructor Documentation

def admin.module_profiles.Profiles.__init__ (   self,
  canvas 
)

Definition at line 38 of file module_profiles.py.

00038 
00039   def __init__(self, canvas):
00040     print("Gcompris_administration __init__ profiles panel.")
00041     module.Module.__init__(self, canvas, "profiles", _("Profiles"))


Member Function Documentation

def admin.module.Module.get_module_name (   self) [inherited]

Definition at line 107 of file module.py.

00107 
00108     def get_module_name(self):
00109         return self.module_name

def admin.module.Module.init (   self,
  index,
  select_area,
  callback 
) [inherited]

Definition at line 48 of file module.py.

00048 
00049     def init(self, index, select_area, callback):
00050         print("Gcompris_administration init panel.")
00051 
00052         height = 80
00053         gap = 35
00054         x   = select_area[0] + (select_area[2] - select_area[0]) / 2
00055         y1  = select_area[1] + height * index + 2
00056         y2  = select_area[1] + height * (index + 1) + 1
00057 
00058         # Create our rootitem. We put each canvas item in it so at the end we
00059         # only have to kill it. The canvas deletes all the items it contains automaticaly.
00060 
00061         self.root_select_item = self.canvas.add(
00062             gnomecanvas.CanvasGroup,
00063             x=0.0,
00064             y=0.0
00065             )
00066 
00067         self.select_item = self.root_select_item.add(
00068             gnomecanvas.CanvasRect,
00069             x1=select_area[0]+2,
00070             y1=y1,
00071             x2=select_area[2]-2,
00072             y2=y2,
00073             fill_color="white",
00074             outline_color="white",
00075             width_units=1.0
00076             )
00077         self.select_item.connect("event", callback, self)
00078 
00079         y1 += 30
00080         print "config_" + self.module_name + ".png"
00081         print gcompris.skin.image_to_skin("config_" +
00082                                           self.module_name +
00083                                           ".png")
00084         item = self.root_select_item.add(
00085             gnomecanvas.CanvasPixbuf,
00086             pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin("config_" +
00087                                                                             self.module_name +
00088                                                                             ".png")),
00089             x = x,
00090             y = y1,
00091             anchor=gtk.ANCHOR_CENTER,
00092             )
00093         item.connect("event", callback, self)
00094 
00095         y1 += gap
00096 
00097         item = self.root_select_item.add (
00098             gnomecanvas.CanvasText,
00099             text=_(self.module_label),
00100             font=gcompris.skin.get_font("gcompris/tiny"),
00101             x = x,
00102             y = y1,
00103             fill_color="black"
00104             )
00105         item.connect("event", callback, self)
00106 

Reimplemented from admin.module.Module.

Definition at line 44 of file module_profiles.py.

00044 
00045   def position(self):
00046     return 2

def admin.module_profiles.Profiles.start (   self,
  area 
)

Definition at line 47 of file module_profiles.py.

00047 
00048   def start(self, area):
00049     print "starting profiles panel"
00050 
00051     # Connect to our database
00052     self.con = sqlite.connect(gcompris.get_database())
00053     self.cur = self.con.cursor()
00054 
00055     # Create our rootitem. We put each canvas item in it so at the end we
00056     # only have to kill it. The canvas deletes all the items it contains automaticaly.
00057 
00058     self.rootitem = self.canvas.add(
00059         gnomecanvas.CanvasGroup,
00060         x=0.0,
00061         y=0.0
00062         )
00063 
00064     module.Module.start(self)
00065 
00066     frame = gtk.Frame(_("Profiles"))
00067     frame.show()
00068 
00069     self.rootitem.add(
00070       gnomecanvas.CanvasWidget,
00071       widget=frame,
00072       x=area[0]+self.module_panel_ofset,
00073       y=area[1]+self.module_panel_ofset,
00074       width=area[2]-area[0]-2*self.module_panel_ofset,
00075       height=area[3]-area[1]-2*self.module_panel_ofset,
00076       anchor=gtk.ANCHOR_NW,
00077       size_pixels=False)
00078 
00079     profile_list.Profile_list(frame, self.con, self.cur)

def admin.module.Module.start (   self) [inherited]

Definition at line 110 of file module.py.

00110 
00111     def start(self):
00112         self.select_item.set(
00113             fill_color_rgba=self.selector_color,
00114             outline_color_rgba=self.outline_color
00115             )

Reimplemented from admin.module.Module.

Definition at line 80 of file module_profiles.py.

00080 
00081   def stop(self):
00082     print "stopping profiles panel"
00083     module.Module.stop(self)
00084 
00085     # Remove the root item removes all the others inside it
00086     self.rootitem.destroy()
00087 
00088     # Close the database
00089     self.cur.close()
00090     self.con.close()

Here is the caller graph for this function:


Member Data Documentation

Definition at line 36 of file module.py.

Definition at line 51 of file module_profiles.py.

Definition at line 52 of file module_profiles.py.

Definition at line 35 of file module.py.

Definition at line 34 of file module.py.

Definition at line 40 of file module.py.

Definition at line 39 of file module.py.

Definition at line 60 of file module.py.

Definition at line 57 of file module_profiles.py.

Definition at line 66 of file module.py.

Definition at line 38 of file module.py.


The documentation for this class was generated from the following file: