Skip to content
Snippets Groups Projects
Commit 5672a225 authored by con's avatar con
Browse files

Mac OS X: Show build error count in Dock icon.

Mac OS X >= Leopard only.
Task-number: QTCREATORBUG-356
parent 11d298d5
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,11 @@
#include <QtGui/QHBoxLayout>
#include <QtGui/QFont>
#include <QtGui/QPixmap>
#include <QtDebug>
#ifdef Q_OS_MAC
#include "buildprogress_mac.h"
#endif
using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;
......@@ -93,4 +98,10 @@ void BuildProgress::updateState()
m_warningIcon->setEnabled(haveWarnings);
m_warningLabel->setEnabled(haveWarnings);
m_warningLabel->setText(QString("%1").arg(warnings));
#ifdef Q_OS_MAC
if (haveErrors)
qtcShowDockTileBadgeLabel(QString("%1").arg(errors));
else
qtcShowDockTileBadgeLabel("");
#endif
}
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef BUILDPROGRESS_MAC_H
#define BUILDPROGRESS_MAC_H
#include <QtCore/QString>
namespace ProjectExplorer {
namespace Internal {
void qtcShowDockTileBadgeLabel(const QString &text);
}
}
#endif
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "buildprogress_mac.h"
#include <AppKit/NSDockTile.h>
#include <AppKit/NSApplication.h>
#include <Foundation/NSString.h>
void ProjectExplorer::Internal::qtcShowDockTileBadgeLabel(const QString &text)
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
const char *utf8String = text.toUtf8().constData();
NSString *cocoaString = [[NSString alloc] initWithUTF8String:utf8String];
[[NSApp dockTile] setBadgeLabel:cocoaString];
[cocoaString release];
#else
Q_UNUSED(text)
#endif
}
......@@ -135,9 +135,14 @@ win32 {
HEADERS += winguiprocess.h
}
else:unix:SOURCES += applicationlauncher_x11.cpp
macx {
HEADERS += buildprogress_mac.h
OBJECTIVE_SOURCES += buildprogress_mac.mm
LIBS += -framework Carbon -framework AppKit
}
RESOURCES += projectexplorer.qrc
DEFINES += PROJECTEXPLORER_LIBRARY
OTHER_FILES += ProjectExplorer.pluginspec
mac:LIBS += -framework Carbon
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment