Back to index

gcompris  8.2.2
Public Member Functions | Public Attributes
admin.module_users.Users Class Reference
Inheritance diagram for admin.module_users.Users:
Inheritance graph
[legend]
Collaboration diagram for admin.module_users.Users:
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 Users

Definition at line 35 of file module_users.py.


Constructor & Destructor Documentation

def admin.module_users.Users.__init__ (   self,
  canvas 
)

Definition at line 39 of file module_users.py.

00039 
00040   def __init__(self, canvas):
00041       print("Gcompris_administration __init__ users panel.")
00042       module.Module.__init__(self, canvas, "users", _("Classes") + " / " + _("Users") )


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 45 of file module_users.py.

00045 
00046   def position(self):
00047     return 0
00048 

def admin.module_users.Users.start (   self,
  area 
)

Definition at line 49 of file module_users.py.

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

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 84 of file module_users.py.

00084 
00085   def stop(self):
00086     print "stopping users panel"
00087     module.Module.stop(self)
00088 
00089     # Remove the root item removes all the others inside it
00090     self.rootitem.destroy()
00091 
00092     # Close the database
00093     self.cur.close()
00094     self.con.close()
00095 
00096 

Here is the caller graph for this function:


Member Data Documentation

Definition at line 36 of file module.py.

Definition at line 53 of file module_users.py.

Definition at line 54 of file module_users.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 58 of file module_users.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: