539 |
539 |
540 +#if defined(XP_UNIX) && !defined(XP_MACOSX) |
540 +#if defined(XP_UNIX) && !defined(XP_MACOSX) |
541 +#include "nsKDEUtils.h" |
541 +#include "nsKDEUtils.h" |
542 +#endif |
542 +#endif |
543 + |
543 + |
|
544 #ifdef XP_MACOSX |
|
545 #include <CoreFoundation/CoreFoundation.h> |
|
546 #endif |
|
547 |
544 #define DOWNLOAD_MANAGER_BUNDLE "chrome://mozapps/locale/downloads/downloads.properties" |
548 #define DOWNLOAD_MANAGER_BUNDLE "chrome://mozapps/locale/downloads/downloads.properties" |
545 #define DOWNLOAD_MANAGER_ALERT_ICON "chrome://mozapps/skin/downloads/downloadIcon.png" |
549 #define DOWNLOAD_MANAGER_ALERT_ICON "chrome://mozapps/skin/downloads/downloadIcon.png" |
546 #define PREF_BDM_SHOWALERTONCOMPLETE "browser.download.manager.showAlertOnComplete" |
550 #define PREF_BDM_SHOWALERTONCOMPLETE "browser.download.manager.showAlertOnComplete" |
547 #define PREF_BDM_SHOWALERTINTERVAL "browser.download.manager.showAlertInterval" |
551 #define PREF_BDM_SHOWALERTINTERVAL "browser.download.manager.showAlertInterval" |
548 #define PREF_BDM_RETENTION "browser.download.manager.retention" |
552 @@ -2162,16 +2166,25 @@ nsDownload::SetState(DownloadState aStat |
549 #define PREF_BDM_QUITBEHAVIOR "browser.download.manager.quitBehavior" |
|
550 #define PREF_BDM_ADDTORECENTDOCS "browser.download.manager.addToRecentDocs" |
|
551 #define PREF_BDM_SCANWHENDONE "browser.download.manager.scanWhenDone" |
|
552 @@ -2158,16 +2162,25 @@ nsDownload::SetState(DownloadState aStat |
|
553 nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID)); |
553 nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID)); |
554 |
554 |
555 // Master pref to control this function. |
555 // Master pref to control this function. |
556 PRBool showTaskbarAlert = PR_TRUE; |
556 PRBool showTaskbarAlert = PR_TRUE; |
557 if (pref) |
557 if (pref) |
573 |
573 |
574 PRInt64 alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC; |
574 PRInt64 alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC; |
575 PRInt64 goat = PR_Now() - mStartTime; |
575 PRInt64 goat = PR_Now() - mStartTime; |
576 showTaskbarAlert = goat > alertIntervalUSec; |
576 showTaskbarAlert = goat > alertIntervalUSec; |
577 |
577 |
578 @@ -2193,16 +2206,17 @@ nsDownload::SetState(DownloadState aStat |
578 @@ -2197,16 +2210,17 @@ nsDownload::SetState(DownloadState aStat |
579 // because if it is, they'll click open the download manager and |
579 // because if it is, they'll click open the download manager and |
580 // the items they downloaded will have been removed. |
580 // the items they downloaded will have been removed. |
581 alerts->ShowAlertNotification( |
581 alerts->ShowAlertNotification( |
582 NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title, |
582 NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title, |
583 message, !removeWhenDone, EmptyString(), mDownloadManager, |
583 message, !removeWhenDone, EmptyString(), mDownloadManager, |
584 EmptyString()); |
584 EmptyString()); |
585 } |
585 } |
586 } |
586 } |
587 + } // end non-KDE block |
587 + } // end non-KDE block |
588 } |
588 } |
589 #if defined(XP_WIN) && !defined(WINCE) |
589 #if (defined(XP_WIN) && !defined(WINCE)) || defined(XP_MACOSX) |
590 nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mTarget); |
590 nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mTarget); |
591 nsCOMPtr<nsIFile> file; |
591 nsCOMPtr<nsIFile> file; |
592 nsAutoString path; |
592 nsAutoString path; |
593 |
593 |
594 if (fileURL && |
594 if (fileURL && |