aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp6
-rw-r--r--src/qt/notificator.cpp15
-rw-r--r--src/qt/notificator.h3
3 files changed, 15 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 1b56cead3c..babdf88f77 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1457,10 +1457,9 @@ runCommand(std::string strCommand)
printf("runCommand error: system(%s) returned %d\n", strCommand.c_str(), nErr);
}
+// Called from inside SetBestChain: attaches a block to the new best chain being built
bool CBlock::SetBestChainInner(CTxDB& txdb, CBlockIndex *pindexNew)
{
- assert(pindexNew->pprev == pindexBest);
-
uint256 hash = GetHash();
// Adding to current best branch
@@ -1707,10 +1706,11 @@ bool CBlock::AcceptBlock()
return error("AcceptBlock() : AddToBlockIndex failed");
// Relay inventory, but don't relay old inventory during initial block download
+ int nBlockEstimate = Checkpoints::GetTotalBlocksEstimate();
if (hashBestChain == hash)
CRITICAL_BLOCK(cs_vNodes)
BOOST_FOREACH(CNode* pnode, vNodes)
- if (nBestHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : 140700))
+ if (nBestHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : nBlockEstimate))
pnode->PushInventory(CInv(MSG_BLOCK, hash));
return true;
diff --git a/src/qt/notificator.cpp b/src/qt/notificator.cpp
index a2314caa47..e668079536 100644
--- a/src/qt/notificator.cpp
+++ b/src/qt/notificator.cpp
@@ -52,10 +52,13 @@ Notificator::Notificator(const QString &programName, QSystemTrayIcon *trayicon,
OSStatus status = LSGetApplicationForInfo(kLSUnknownType, kLSUnknownCreator, CFSTR("growlTicket"), kLSRolesAll, 0, &cfurl);
if (status != kLSApplicationNotFoundErr) {
CFBundleRef bundle = CFBundleCreate(0, cfurl);
- CFRelease(cfurl);
if (CFStringCompare(CFBundleGetIdentifier(bundle), CFSTR("com.Growl.GrowlHelperApp"), kCFCompareCaseInsensitive | kCFCompareBackwards) == kCFCompareEqualTo) {
- mode = Growl;
+ if (CFStringHasSuffix(CFURLGetString(cfurl), CFSTR("/Growl.app/")))
+ mode = Growl13;
+ else
+ mode = Growl12;
}
+ CFRelease(cfurl);
CFRelease(bundle);
}
#endif
@@ -226,7 +229,7 @@ void Notificator::notifySystray(Class cls, const QString &title, const QString &
void Notificator::notifyGrowl(Class cls, const QString &title, const QString &text, const QIcon &icon)
{
const QString script(
- "tell application \"GrowlHelperApp\"\n"
+ "tell application \"%5\"\n"
" set the allNotificationsList to {\"Notification\"}\n" // -- Make a list of all the notification types (all)
" set the enabledNotificationsList to {\"Notification\"}\n" // -- Make a list of the notifications (enabled)
" register as application \"%1\" all notifications allNotificationsList default notifications enabledNotificationsList\n" // -- Register our script with Growl
@@ -265,7 +268,8 @@ void Notificator::notifyGrowl(Class cls, const QString &title, const QString &te
QString quotedTitle(title), quotedText(text);
quotedTitle.replace("\\", "\\\\").replace("\"", "\\");
quotedText.replace("\\", "\\\\").replace("\"", "\\");
- qt_mac_execute_apple_script(script.arg(notificationApp, quotedTitle, quotedText, notificationIcon), 0);
+ QString growlApp(this->mode == Notificator::Growl13 ? "Growl" : "GrowlHelperApp");
+ qt_mac_execute_apple_script(script.arg(notificationApp, quotedTitle, quotedText, notificationIcon, growlApp), 0);
}
#endif
@@ -282,7 +286,8 @@ void Notificator::notify(Class cls, const QString &title, const QString &text, c
notifySystray(cls, title, text, icon, millisTimeout);
break;
#ifdef Q_WS_MAC
- case Growl:
+ case Growl12:
+ case Growl13:
notifyGrowl(cls, title, text, icon);
break;
#endif
diff --git a/src/qt/notificator.h b/src/qt/notificator.h
index 2d83013a7f..0271c26f48 100644
--- a/src/qt/notificator.h
+++ b/src/qt/notificator.h
@@ -49,7 +49,8 @@ private:
None, /**< Ignore informational notifications, and show a modal pop-up dialog for Critical notifications. */
Freedesktop, /**< Use DBus org.freedesktop.Notifications */
QSystemTray, /**< Use QSystemTray::showMessage */
- Growl /**< Use the Growl notification system (Mac only) */
+ Growl12, /**< Use the Growl 1.2 notification system (Mac only) */
+ Growl13 /**< Use the Growl 1.3 notification system (Mac only) */
};
QString programName;
Mode mode;