forked from qt-creator/qt-creator
Welcome Screen: Don't try to load FDO icons when not on linux
Change-Id: I5bfaf78dddb27c42ad515f9506857dace571efd4 Reviewed-on: http://codereview.qt.nokia.com/1009 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Daniel Molkentin <daniel.molkentin@nokia.com>
This commit is contained in:
@@ -10,11 +10,15 @@ BorderImage {
|
||||
|
||||
Rectangle { color: "black"; width: parent.width; height: 1; anchors.top: parent.top; anchors.left: parent.left }
|
||||
|
||||
Components.Button {
|
||||
Components.QStyleItem { id: styleItem; visible: false }
|
||||
|
||||
// whitelist
|
||||
property bool _hasDesktopTheme: welcomeMode.platform() === "linux"
|
||||
|
||||
Components.Button {
|
||||
id: openProjectButton
|
||||
text: qsTr("Open Project...")
|
||||
iconSource: "image://desktoptheme/document-open"
|
||||
iconSource: _hasDesktopTheme ? "image://desktoptheme/document-open" : ""
|
||||
onClicked: welcomeMode.openProject();
|
||||
height: 32
|
||||
anchors.left: parent.left
|
||||
@@ -25,7 +29,7 @@ BorderImage {
|
||||
Components.Button {
|
||||
id: createProjectButton
|
||||
text: qsTr("Create Project...")
|
||||
iconSource: "image://desktoptheme/document-new"
|
||||
iconSource: _hasDesktopTheme ? "image://desktoptheme/document-new" : ""
|
||||
onClicked: welcomeMode.newProject();
|
||||
height: 32
|
||||
anchors.left: openProjectButton.right
|
||||
|
@@ -97,6 +97,8 @@ public:
|
||||
void initPlugins();
|
||||
int activePlugin() const { return m_activePlugin; }
|
||||
|
||||
Q_SCRIPTABLE QString platform() const;
|
||||
|
||||
public slots:
|
||||
void sendFeedback();
|
||||
void newProject();
|
||||
@@ -195,6 +197,21 @@ void WelcomeMode::initPlugins()
|
||||
QUrl::fromLocalFile(Core::ICore::instance()->resourcePath() + "/welcomescreen/welcomescreen.qml"));
|
||||
}
|
||||
|
||||
QString WelcomeMode::platform() const
|
||||
{
|
||||
#if defined(Q_OS_WIN)
|
||||
return QLatin1String("windows");
|
||||
#elif defined(Q_OS_MAC)
|
||||
return QLatin1String("mac");
|
||||
#elif defined(Q_OS_LINUX)
|
||||
return QLatin1String("linux");
|
||||
#elif defined(Q_OS_UNIX)
|
||||
return QLatin1String("unix");
|
||||
#else
|
||||
return QLatin1String("other")
|
||||
#endif
|
||||
}
|
||||
|
||||
void WelcomeMode::welcomePluginAdded(QObject *obj)
|
||||
{
|
||||
if (Utils::IWelcomePage *plugin = qobject_cast<Utils::IWelcomePage*>(obj)) {
|
||||
|
Reference in New Issue
Block a user