<?xml version="1.0"?>
<!--
 * this file is a part of Check4Change
 *
 * Copyright 2010 Ronen Zilberman
 * See license.txt for details.
 *-->

<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="style.css" type="text/css"?>


<dialog id="c4c_about" title="About Check4Change"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        buttons="cancel"
        onload="c4c_setupAbout();"

        style="background-color:#FFFFFF"
        width="450"
        height="450"
    >

<script type="application/x-javascript"  src="chrome://c4c/content/c4cUti.js" />
<script type="application/x-javascript"  src="chrome://c4c/content/c4cMenu.js" />

<groupbox>

<vbox>
<hbox>  <spacer flex="1"/> <image align="center" src="chrome://c4c/content/c4c_smalllogo.gif"/> <spacer flex="1"/> </hbox>

<vbox>
<label value="Usage Statistics" style="font-weight: bold; text-decoration: underline"/>

<grid align="center">
<rows>
 <row/> <row/> <row/> <row/> <row/>
</rows>

<columns>
  <column style="font-weight: bold;">
   <label value="Running Version:"/>
   <label value="Installed:"/>
   <label value="Number of refreshes:"/>
   <label value="Number of changes:"/>
   <label value="Total monitoring time:"/>
  </column>
  <column>
   <label id="c4cAB_ver" value="D1.1"/>
   <label id="c4cAB_date" value="D123"/>
   <label id="c4cAB_refreshcount" value="123 namic"/>
   <label id="c4cAB_changecount" value="123 namic"/>
   <label id="c4cAB_total" value="123 dynamic"/>
  </column>
</columns>
</grid>
</vbox>

<separator/>

<description>If you find yourself using Check4Change quite often and you feel it increases your productivity / well being, why not consider making a donation? </description>
<separator class="thin"/>
<hbox> <spacer flex="1"/> <image class="link" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" onclick="c4c_openTab('check4change.mozdev.org/doDonate.html');"/> <spacer flex="1"/> </hbox>
<separator class="thin"/>

<separator />


</vbox>

<hbox>
<label value="Copyright © 2011 By: Ronen Zilberman" style="font-weight: bold;"/>
<spacer flex="1" />
<vbox align="right">  <button dlgtype="cancel" label="Close Window"/> </vbox>
</hbox>

</groupbox>




<script>
<![CDATA[

function c4c_setupAbout() {
    document.getElementById("c4cAB_ver").value = c4cUti_getPrefString("version"); // Note: this is a hack because its an internal pref of IsFirstRun.

    var date = parseInt(c4cUti_getPrefString(c4cStats_PREFIX+"installDate"));
    var days = Math.round((new Date().getTime() - date) / (1000*60*60*24));

    document.getElementById("c4cAB_date").value = days + " days ago";

    document.getElementById("c4cAB_refreshcount").value = c4cUti_getPrefInt(c4cStats_PREFIX+"refreshCount");
    document.getElementById("c4cAB_changecount").value = c4cUti_getPrefInt(c4cStats_PREFIX+"changeCount");

    document.getElementById("c4cAB_total").value = c4cUti_timeInRelavantUnits(c4cStats_totalMonitoringTime());


}


]]>

// Taken from Downthemall! about box code.
function c4c_openTab(sito) {
    var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
    var recentWindow = wm.getMostRecentWindow("navigator:browser");
    if (recentWindow) {
        // Use an existing browser window
        recentWindow.delayedOpenTab(sito);
    }   else {
        // No browser windows are open, so open a new one.
        window.open(sito);
    }
}


</script>


</dialog>