[gcompris] music activity, removed dead code.



commit 4b72447eacbaecd50f7f0ec65512d4b5275182b8
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Tue Sep 11 00:06:22 2012 +0200

    music activity, removed dead code.
    
    Will find a way later to create a dialog box to ask
    for a confirmation.

 src/piano_composition-activity/gcomprismusic.py    |   27 +-------------------
 .../piano_composition.py                           |   12 ++------
 2 files changed, 4 insertions(+), 35 deletions(-)
---
diff --git a/src/piano_composition-activity/gcomprismusic.py b/src/piano_composition-activity/gcomprismusic.py
index f987280..4bcc63f 100644
--- a/src/piano_composition-activity/gcomprismusic.py
+++ b/src/piano_composition-activity/gcomprismusic.py
@@ -1142,7 +1142,7 @@ class PianoKeyboard():
         self.height = height
         self.key_callback = key_callback
         #piano keyboard image
-        self.image = goocanvas.Image(
+        image = goocanvas.Image(
           parent=self.rootitem,
           pixbuf=gcompris.utils.load_pixmap("piano_composition/keyboard.png"),
           x=self.x,
@@ -1385,30 +1385,6 @@ def pianokeyBindings(keyval, self):
     elif keyval == gtk.keysyms.F5:
         self.keyboard_click(None, None, None, -5)
 
-def askUser(x, y, self):
-    self.text = goocanvas.Text(
-            parent=self.rootitem, x=x, y=y, width=1000,
-            text='<span size="30000" > Erase All? </span>',
-            fill_color='black', anchor=gtk.ANCHOR_CENTER,
-            alignment=pango.ALIGN_CENTER,
-            use_markup=True)
-    TG = 10
-    bounds = self.text.get_bounds()
-
-    self.rect = goocanvas.Rect(parent=self.rootitem,
-                          x=bounds.x1 - TG,
-                          y=bounds.y1 - TG,
-                          width=bounds.x2 - bounds.x1 + TG * 2,
-                          height=bounds.y2 - bounds.y1 + TG * 2,
-                          line_width=3.0,
-                          fill_color='gray')
-    self.rect.raise_(None)
-    self.text.raise_(None)
-    self.yesButton, self.txt1 = textButton(x - 50, y + 80, _('Yes'), self, color='green', includeText=True)
-    self.noButton, self.txt2 = textButton(x + 50, y + 80, _('No'), self, color='red', includeText=True)
-
-    return self.yesButton, self.noButton
-
 def eraseUserPrompt(x,y,z,self):
     self.text.remove()
     self.yesButton.remove()
@@ -1416,7 +1392,6 @@ def eraseUserPrompt(x,y,z,self):
     self.text.remove()
     self.rect.remove()
     self.txt1.remove()
-    self.yesButton.remove()
     self.txt2.remove()
 
 def drawBasicPlayHomePagePart1(self):
diff --git a/src/piano_composition-activity/piano_composition.py b/src/piano_composition-activity/piano_composition.py
index 6361cc2..5f7a013 100644
--- a/src/piano_composition-activity/piano_composition.py
+++ b/src/piano_composition-activity/piano_composition.py
@@ -554,15 +554,9 @@ dialogue to\nenable the sound."), stop_board)
         self.wholeNoteSelected.connect("button_press_event", self.staff.updateToWhole)
         gcompris.utils.item_focus_init(self.wholeNoteSelected, None)
 
-    def askAndEraseStaff(self,x=None,y=None,z=None):
-        ask_user=False
-        if ask_user:
-            if self.staff.noteList:
-                (self.y, self.n) = askUser(450,300,self)
-            self.y.connect("button_press_event", self.erase)
-            self.n.connect("button_press_event", eraseUserPrompt,self)
-        else:
-            self.staff.eraseAllNotes()
+    def askAndEraseStaff(self, unused1, unused2, unused3):
+        # @FIXME, should have a dialog asking for confirmation
+        self.staff.eraseAllNotes()
 
     def erase(self,x,y,z):
         #self.staff.eraseAllNotes()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]