Commit db78293e authored by Paul Olav Tvete's avatar Paul Olav Tvete

Generic Android error messages

We want to give better feedback for installation problems and
other issues. There may still be undiscovered ways to mess up the
creator configuration, and we might find them after the string
freeze.

This adds a number of strings that we can use later.
We can add new error codes after the string freeze (and even in
patch releases). This means that even if we can't give people
detailed help for their problem in the UI, at least we give them
a googleable string.

We can then add better messages for the new errors in the next minor
release.

Change-Id: Ida7921fce5142d55144b0ba022de04726872187a
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent e4b2947c
......@@ -23,6 +23,7 @@ HEADERS += \
androiddeploystep.h \
androiddeploystepwidget.h \
androiddeploystepfactory.h \
androiderrormessage.h \
androidglobal.h \
androidrunner.h \
androiddebugsupport.h \
......@@ -59,6 +60,7 @@ SOURCES += \
androiddeploystep.cpp \
androiddeploystepwidget.cpp \
androiddeploystepfactory.cpp \
androiderrormessage.cpp \
androidrunner.cpp \
androiddebugsupport.cpp \
androidqtversionfactory.cpp \
......
......@@ -55,6 +55,8 @@ QtcPlugin {
"androiddevice.h",
"androiddevicefactory.cpp",
"androiddevicefactory.h",
"androiderrormessage.h",
"androiderrormessage.cpp",
"androidgdbserverkitinformation.cpp",
"androidgdbserverkitinformation.h",
"androidglobal.h",
......
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** 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.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "androiderrormessage.h"
#include <QObject>
namespace Android {
namespace Internal {
QString AndroidErrorMessage::getMessage(ErrorCode errorCode, const QVariantList &parameters)
{
Q_UNUSED(parameters);
switch (errorCode) {
case SDKInstallationError:
return QObject::tr("Android: SDK installation error 0x%1").arg(errorCode, 0, 16);
case NDKInstallationError:
return QObject::tr("Android: NDK installation error 0x%1").arg(errorCode, 0, 16);
case JavaInstallationError:
return QObject::tr("Android: Java installation error 0x%1").arg(errorCode, 0, 16);
case AntInstallationError:
return QObject::tr("Android: ant installation error 0x%1").arg(errorCode, 0, 16);
case AdbInstallationError:
return QObject::tr("Android: adb installation error 0x%1").arg(errorCode, 0, 16);
case DeviceConnectionError:
return QObject::tr("Android: Device connection error 0x%1").arg(errorCode, 0, 16);
case DevicePermissionError:
return QObject::tr("Android: Device permission error 0x%1").arg(errorCode, 0, 16);
case DeviceAuthorizationError:
return QObject::tr("Android: Device authorization error 0x%1").arg(errorCode, 0, 16);
case DeviceAPILevelError:
return QObject::tr("Android: Device API level not supported: error 0x%1").arg(errorCode, 0, 16);
default:
return QObject::tr("Android: Unknown error 0x%1").arg(errorCode, 0, 16);
}
}
} // namespace Internal
} // namespace Android
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** 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.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef ANDROIDERRORMESSAGE_H
#define ANDROIDERRORMESSAGE_H
#include <QVariantList>
namespace Android {
namespace Internal {
class AndroidErrorMessage
{
public:
enum ErrorCode {
UnknownError = 0x3000,
SDKInstallationError,
NDKInstallationError,
JavaInstallationError,
AntInstallationError,
AdbInstallationError,
DeviceConnectionError,
DevicePermissionError,
DeviceAuthorizationError,
DeviceAPILevelError
};
static QString getMessage(ErrorCode errorCode, const QVariantList &parameters = QVariantList());
};
} // namespace Internal
} // namespace Android
#endif // ANDROIDERRORMESSAGE_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment