Skip to content

Commit

Permalink
preference settings for alerts
Browse files Browse the repository at this point in the history
git-svn-id: https://foxtrick.googlecode.com/svn/trunk@167 1e3807c3-0949-0410-b78e-337b627472c1
  • Loading branch information
taised committed Dec 16, 2008
1 parent 0eed554 commit d39dfdd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
14 changes: 14 additions & 0 deletions content/preferences-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ var FoxtrickPreferencesDialog = {
}

this.initLangPref();
this.initAlertPref();
},

initAlertPref: function() {
document.getElementById('alertsliderpref').setAttribute( "checked", FoxtrickPrefs.getBool( "alertSlider" ) );
document.getElementById('alertslidermacpref').setAttribute( "checked", FoxtrickPrefs.getBool( "alertSliderGrowl" ) );
document.getElementById('alertsoundpref').setAttribute( "checked", FoxtrickPrefs.getBool( "alertSound" ) );
document.getElementById('alertsoundurlpref').setAttribute( "value", FoxtrickPrefs.getString( "alertSoundUrl" ) );
},

initLangPref: function() {
Expand Down Expand Up @@ -64,6 +72,12 @@ var FoxtrickPreferencesDialog = {
//Lang
FoxtrickPrefs.setString("htLanguage", document.getElementById("htLanguage").value);

//Alert
FoxtrickPrefs.setBool("alertSlider", document.getElementById("alertsliderpref").checked);
FoxtrickPrefs.setBool("alertSliderGrowl", document.getElementById("alertslidermacpref").checked);
FoxtrickPrefs.setBool("alertSound", document.getElementById("alertsoundpref").checked);
FoxtrickPrefs.setString("alertSoundUrl", document.getElementById("alertsoundurlpref").value);

// reinitialize
FoxtrickMain.init();

Expand Down
9 changes: 9 additions & 0 deletions content/preferences-dialog.xul
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@

</menupopup>
</menulist>
<groupbox>
<caption label="&foxtrick.prefs.alertsettings;"/>
<vbox>
<checkbox id="alertsliderpref" label="&foxtrick.prefs.alertslider;"/>
<checkbox id="alertslidermacpref" label="&foxtrick.prefs.alertslidermac;"/>
<checkbox id="alertsoundpref" label="&foxtrick.prefs.alertsound;"/>
<textbox id="alertsoundurlpref"/>
</vbox>
</groupbox>
</vbox>
</tabpanel>

Expand Down
2 changes: 1 addition & 1 deletion content/shortcuts_and_tweaks/foxtrickalert.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ var FoxtrickAlert = {
try {
FoxtrickAlert.foxtrick_playSound(PrefsBranch.getCharPref("alertSoundUrl"));
} catch (e) {
alert(e);
Foxtrick.LOG('playsound: '+e);
}
}
//}
Expand Down
2 changes: 2 additions & 0 deletions locale/en-US/foxtrick.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@
<!ENTITY foxtrick.menu.installmedalset "Install Hattrick.org medal set">
<!ENTITY foxtrick.prefs.htcurrency "Hattrick currency">
<!ENTITY foxtrick.prefs.main "Main">
<!ENTITY foxtrick.prefs.alertsettings "Alert settings">
<!ENTITY foxtrick.prefs.alertslider "Show alert slider.">
<!ENTITY foxtrick.prefs.foxtrickinstatusbar "Display FoxTrick panel in Firefox status bar.">
<!ENTITY foxtrick.prefs.alertsound "Play alert sound.">
<!ENTITY foxtrick.prefs.alertslidermac "Show growl notification (Mac only)">
<!ENTITY foxtrick.menu.createplayerad "Player ad into clipboard.">
<!ENTITY foxtrick.prefs.htdateformat "Date format">
<!ENTITY foxtrick.menu.makelink "Conference link into clipboard">
Expand Down

0 comments on commit d39dfdd

Please sign in to comment.