2 * Copyright (C) 2014 Canonical, Ltd.
5 * Michael Zanetti <michael.zanetti@canonical.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 3.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20#include <QtQuick/QQuickView>
21#include <QtGui/QGuiApplication>
22#include <QtQml/QQmlEngine>
23#include <QtQml/QQmlContext>
25#include <QCommandLineParser>
30#include "../MouseTouchAdaptor.h"
32int main(int argc, const char *argv[])
34 QGuiApplication *application = new QGuiApplication(argc, (char**)argv);
36 QCommandLineParser parser;
37 parser.setApplicationDescription("Description: Unity 8 Shell Dash");
38 parser.addHelpOption();
40 QCommandLineOption mousetouchOption("mousetouch",
41 "Allow the mouse to provide touch input");
42 parser.addOption(mousetouchOption);
44 // FIXME Remove once we drop the need of the hint
45 QCommandLineOption desktopFileHintOption("desktop_file_hint",
46 "The desktop_file_hint option for QtMir", "hint_file");
47 parser.addOption(desktopFileHintOption);
49 // Treat args with single dashes the same as arguments with two dashes
50 // Ex: -fullscreen == --fullscreen
51 parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
52 parser.process(*application);
54 if (getenv("QT_LOAD_TESTABILITY")) {
55 QLibrary testLib(QLatin1String("qttestability"));
57 typedef void (*TasInitialize)(void);
58 TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init");
62 qCritical("Library qttestability resolve failed!");
65 qCritical("Library qttestability load failed!");
69 bindtextdomain("unity8", translationDirectory().toUtf8().data());
71 QQuickView* view = new QQuickView();
72 view->setResizeMode(QQuickView::SizeRootObjectToView);
73 view->setTitle("Unity Dash");
75 // You will need this if you want to interact with touch-only components using a mouse
76 // Needed only when manually testing on a desktop.
77 MouseTouchAdaptor *mouseTouchAdaptor = 0;
78 if (parser.isSet(mousetouchOption)) {
79 mouseTouchAdaptor = new MouseTouchAdaptor;
80 application->installNativeEventFilter(mouseTouchAdaptor);
83 QUrl source(::qmlDirectory()+"Dash/DashApplication.qml");
84 prependImportPaths(view->engine(), ::overrideImportPaths());
85 appendImportPaths(view->engine(), ::fallbackImportPaths());
87 view->setSource(source);
90 int result = application->exec();
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list