847
848
self.pop.popup(None, None, None, v1, v2)
849
850
def ShowAboutDialog(self,obj):
850
self.AboutDialog = gtk.glade.XML('main.glade', 'about_dialog').get_widget('about_dialog')
851
self.AboutDialog = gtk.AboutDialog()
852
self.AboutDialog.set_name (_("Alarm Clock"))
853
self.AboutDialog.set_version('0.9.4')
854
self.AboutDialog.set_copyright(_("(c) 2008 Tomasz Sałaciński\n"
855
"<tsalacinski@gmail.com>\n"
858
self.AboutDialog.set_icon_from_file('gfx/alarm-clock.svg')
851
859
self.AboutDialog.set_transient_for(MainWindow)
852
self.AboutDialog.set_name(_("Alarm Clock"))
853
self.AboutDialog.set_version('0.9.3')
854
self.AboutDialog.set_icon_from_file('gfx/alarm-clock.svg')
860
self.AboutDialog.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
861
self.AboutDialog.set_website("http://www.alarm-clock.54.pl")
862
self.Authors = [_("Programming"), "\tTomasz Sałaciński"]
863
self.AboutDialog.set_authors(self.Authors)
864
self.LogoPixbuf = gtk.gdk.pixbuf_new_from_file("gfx/alarm-clock.svg")
865
self.AboutDialog.set_logo(self.LogoPixbuf)
868
Alarm Clock is free software; you can redistribute it and/or modify
869
it under the terms of the GNU General Public License as published by
870
the Free Software Foundation; either version 2 of the License, or
871
(at your option) any later version.
873
Alarm Clock is distributed in the hope that it will be useful,
874
but WITHOUT ANY WARRANTY; without even the implied warranty of
875
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
876
GNU General Public License for more details.
878
You should have received a copy of the GNU General Public License
879
along with Alarm Clock; if not, write to the Free Software Foundation,
880
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA"""
882
self.AboutDialog.set_license(self.License)
884
self.Artists = ["""Alarm Clock icon come from the
885
Dropline Neu! icon theme"""]
887
self.AboutDialog.set_artists(self.Artists)
855
890
self.AboutDialog.run()
856
891
self.AboutDialog.destroy()
963
998
self.AddAlarmTemplate = self.AddDialog.get_widget('create_from_template_radio')
964
999
self.AddCounter = self.AddDialog.get_widget('create_counter')
965
1000
self.hbox = self.AddDialog.get_widget('mtable')
1001
self.AddAlarmNew.set_active(True)
967
1004
self.AddAlarmTemplateCombo = gtk.combo_box_new_text()
968
1005
self.hbox.attach(self.AddAlarmTemplateCombo, 1, 2, 2, 3)
1183
1220
dialog.destroy()
1223
def ToggleSoundButtons(self, Object):
1224
if self.Radio4.get_active():
1225
self.FChooser.set_sensitive(True)
1227
self.FChooser.set_sensitive(False)
1188
1229
def AddSimpleCounterDialog(self,obj = None):
1189
1230
self.AddCounterDialog = gtk.glade.XML('main.glade', 'add_coffee')
1190
1231
self.AddCounterDialogWidget = self.AddCounterDialog.get_widget('add_coffee')
1191
1232
self.AddCounterDialogWidget.set_icon_from_file('gfx/alarm-clock.svg')
1234
self.Radio3 = self.AddCounterDialog.get_widget("radiobutton3")
1235
self.Radio4 = self.AddCounterDialog.get_widget("radiobutton4")
1236
self.FChooser = self.AddCounterDialog.get_widget("sound_file_choose")
1238
self.file_filter = gtk.FileFilter()
1239
self.file_filter.set_name(_("Audio files"))
1240
self.file_filter.add_mime_type("audio/*")
1241
self.file_filter.add_pattern("*.ogg")
1242
self.file_filter.add_pattern("*.mp3")
1243
self.file_filter.add_pattern("*.wav")
1244
self.file_filter.add_pattern("*.mp4")
1245
self.file_filter.add_pattern("*.flac")
1246
self.FChooser.add_filter(self.file_filter)
1248
self.file_filter_all = gtk.FileFilter()
1249
self.file_filter_all.set_name(_("All files"))
1250
self.file_filter_all.add_pattern("*")
1252
self.FChooser.add_filter(self.file_filter_all)
1254
self.FChooser.set_sensitive(False)
1256
self.FChooser.set_current_folder(os.getenv("HOME"))
1258
self.signals = { "sound_toggle" : self.ToggleSoundButtons }
1260
self.AddCounterDialog.signal_autoconnect(self.signals)
1193
1262
self.tb = gtk.TextBuffer()
1194
1263
self.tb.set_text(_("A simple counter."))
1210
1279
self.Newdate.strftime("%d"))
1211
1280
self.NewTime = ("%s:%i") % (self.Newdate.strftime("%H"), int(self.Newdate.strftime("%M")))
1284
# 7 - Boolean - whatever to play sound
1285
# 8 - Boolean - Use custom sound file
1286
# 9 - String - path to sound file
1287
# 10 - Boolean - Constant (True) or Fade (False)
1288
# 11 - Integer - Constant volume value
1289
# 12 - Integer - Fade (Initial volume)
1290
# 13 - Integer - Fade (Final volume)
1291
# 14 - Integer - Fade (Duration in seconds)
1214
1295
self.AlarmBuffer[0] = _("Counter")
1215
1296
self.AlarmBuffer[1] = self.NewTime
1222
1303
self.AlarmBuffer[37] = _("Counter message")
1223
1304
self.AlarmBuffer[19] = False
1308
if self.Radio3.get_active():
1309
self.AlarmBuffer[7] = True
1310
self.AlarmBuffer[10] = True
1312
if self.Radio4.get_active():
1313
self.AlarmBuffer[7] = True
1314
self.AlarmBuffer[8] = True
1315
self.AlarmBuffer[9] = self.FChooser.get_filename()
1316
self.AlarmBuffer[10] = True
1225
1319
self.f = file(os.getenv("HOME") + "/.config/Alarm-Clock/alarms", "a")
1226
1320
print >> self.f, self.AlarmBuffer
1236
1330
def NewAlarmRadioCheck(self,obj):
1237
if not self.AddAlarmTemplate.get_active():
1238
self.AddAlarmTemplateCombo.set_sensitive(False)
1240
self.AddAlarmTemplateCombo.set_sensitive(True)
1332
if not self.AddAlarmTemplate.get_active():
1333
self.AddAlarmTemplateCombo.set_sensitive(False)
1335
self.AddAlarmTemplateCombo.set_sensitive(True)
1242
1339
def SoundPrefsActive(self,obj):
1243
1340
self.sp_Glade = gtk.glade.XML('main.glade', 'sound_properties')