~ubuntu-branches/ubuntu/oneiric/alarm-clock/oneiric

« back to all changes in this revision

Viewing changes to alarm-clock/MainClass.py

  • Committer: Bazaar Package Importer
  • Author(s): Marco Rodrigues
  • Date: 2008-11-11 12:38:15 UTC
  • mto: (7.1.2 sid) (9.1.1 squeeze) (1.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20081111123815-uw5x62teqst2npi3
Tags: upstream-0.9.18
ImportĀ upstreamĀ versionĀ 0.9.18

Show diffs side-by-side

added added

removed removed

Lines of Context:
1146
1146
                self.RefreshTemplateList()
1147
1147
                self.TemplateSelection.select_path(self.row,)
1148
1148
 
1149
 
        def StopTheSound(self,obj = None, x = None):
1150
 
                        MainWindowGlade.get_widget('stop_sound').set_sensitive(False)
 
1149
        def StopTheSound(self, obj = None, x = None):
 
1150
                        if type(obj) == bool:
 
1151
                                if obj == True:
 
1152
                                        MainWindowGlade.get_widget('stop_sound').set_sensitive(True)
 
1153
                        else:
 
1154
                                        MainWindowGlade.get_widget('stop_sound').set_sensitive(False)
1151
1155
                        FadeStopped = True
1152
1156
                        PlayerInstance.set_state(gst.STATE_NULL)
1153
1157
                        PlayerInstance.set_property("volume", 0)
2843
2847
                SingleDateWidget = SingleDate.get_widget('single_day_dialog')
2844
2848
                SingleDateWidget.set_icon_from_file(PREFIX + '/scalable/alarm-clock.svg')
2845
2849
                date_data = re.search('(\d+)/(\d+)/(\d+)', self.AlarmBuffer[3])
2846
 
                SingleDate.get_widget('calendar').select_month(int (self.date_data.group(2)), int (self.date_data.group(1)))
2847
 
                SingleDate.get_widget('calendar').select_day(int (self.date_data.group(3)))
 
2850
                SingleDate.get_widget('calendar').select_month(int (date_data.group(2)), int (date_data.group(1)))
 
2851
                SingleDate.get_widget('calendar').select_day(int (date_data.group(3)))
2848
2852
 
2849
2853
 
2850
2854
                if SingleDateWidget.run() == gtk.RESPONSE_CANCEL:
3294
3298
                                snoozebutton = dl_Glade.get_widget('snooze_button')
3295
3299
 
3296
3300
                                def Snooze(obj):
 
3301
                                        MainWindowGlade.get_widget('stop_sound').set_sensitive(True)
3297
3302
                                        self.SnoozeClicked(Al, Count, Remover, Loader, Prefs, UpdateList)
3298
3303
                                        dl.destroy()
3299
 
                                        self.StopTheSound()
 
3304
                                        self.StopTheSound(True)
 
3305
                                        return
3300
3306
                                def Edit(obj):
3301
3307
                                        dl.destroy()
3302
3308
                                        self.StopTheSound()
3303
3309
                                        if not Count: 
3304
 
                                                UpdateList(True)
 
3310
                                                return
 
3311
                                        UpdateList(True)
3305
3312
                                        Prefs(self)
3306
3313
                                        Loader()
3307
3314
                                        Protected = None
3423
3430
 
3424
3431
 
3425
3432
        def SnoozeClicked(self, Al, Count = False, Remover = False, Loader = False, Prefs = False, UpdateList = None):
3426
 
                SnoozeThreadObject = SnoozeThread.SnoozeThread(Al, StartGUI, Count, Remover, Loader, Prefs, UpdateList)
 
3433
                SnoozeThreadObject = SnoozeThread.SnoozeThread(Al, StartGUI, Count, Remover, Loader, Prefs, UpdateList, MainWindowGlade.get_widget('stop_sound'))
3427
3434
                SnoozeThreadObject.start()
3428
3435
 
3429
3436