diff --git a/qml/pages/FirstPage.qml b/qml/pages/FirstPage.qml deleted file mode 100644 index 9a00fc3..0000000 --- a/qml/pages/FirstPage.qml +++ /dev/null @@ -1,43 +0,0 @@ -import QtQuick 2.0 -import Sailfish.Silica 1.0 - -Page { - id: page - - // The effective value will be restricted by ApplicationWindow.allowedOrientations - allowedOrientations: Orientation.All - - // To enable PullDownMenu, place our content in a SilicaFlickable - SilicaFlickable { - anchors.fill: parent - - // PullDownMenu and PushUpMenu must be declared in SilicaFlickable, SilicaListView or SilicaGridView - PullDownMenu { - MenuItem { - text: qsTr("Show Page 2") - onClicked: pageStack.animatorPush(Qt.resolvedUrl("SecondPage.qml")) - } - } - - // Tell SilicaFlickable the height of its content. - contentHeight: column.height - - // Place our content in a Column. The PageHeader is always placed at the top - // of the page, followed by our content. - Column { - id: column - - width: page.width - spacing: Theme.paddingLarge - PageHeader { - title: qsTr("UI Template") - } - Label { - x: Theme.horizontalPageMargin - text: qsTr("Hello Sailors") - color: Theme.secondaryHighlightColor - font.pixelSize: Theme.fontSizeExtraLarge - } - } - } -} diff --git a/qml/pages/SecondPage.qml b/qml/pages/SecondPage.qml deleted file mode 100644 index 6dbadf4..0000000 --- a/qml/pages/SecondPage.qml +++ /dev/null @@ -1,30 +0,0 @@ -import QtQuick 2.0 -import Sailfish.Silica 1.0 - -Page { - id: page - - // The effective value will be restricted by ApplicationWindow.allowedOrientations - allowedOrientations: Orientation.All - - SilicaListView { - id: listView - model: 20 - anchors.fill: parent - header: PageHeader { - title: qsTr("Nested Page") - } - delegate: BackgroundItem { - id: delegate - - Label { - x: Theme.horizontalPageMargin - text: qsTr("Item") + " " + index - anchors.verticalCenter: parent.verticalCenter - color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor - } - onClicked: console.log("Clicked " + index) - } - VerticalScrollDecorator {} - } -} diff --git a/qml/qt3.qml b/qml/qt3.qml index 5709adc..d1db442 100644 --- a/qml/qt3.qml +++ b/qml/qt3.qml @@ -1,9 +1,8 @@ import QtQuick 2.0 import Sailfish.Silica 1.0 -import "pages" ApplicationWindow { - initialPage: Component { FirstPage { } } - cover: Qt.resolvedUrl("cover/CoverPage.qml") - allowedOrientations: defaultAllowedOrientations + Label { + text: networkInterface.name() + } } diff --git a/qt3.pro b/qt3.pro index 7f24b6f..351368d 100644 --- a/qt3.pro +++ b/qt3.pro @@ -19,8 +19,6 @@ SOURCES += src/qt3.cpp \ DISTFILES += qml/qt3.qml \ qml/cover/CoverPage.qml \ - qml/pages/FirstPage.qml \ - qml/pages/SecondPage.qml \ rpm/qt3.changes.in \ rpm/qt3.changes.run.in \ rpm/qt3.spec \ diff --git a/src/qt3.cpp b/src/qt3.cpp index 421fe47..3e600ef 100644 --- a/src/qt3.cpp +++ b/src/qt3.cpp @@ -7,17 +7,16 @@ int main(int argc, char *argv[]) { - // SailfishApp::main() will display "qml/qt3.qml", if you need more - // control over initialization, you can use: - // - // - SailfishApp::application(int, char *[]) to get the QGuiApplication * - // - SailfishApp::createView() to get a new QQuickView * instance - // - SailfishApp::pathTo(QString) to get a QUrl to a resource file - // - SailfishApp::pathToMainQml() to get a QUrl to the main QML file - // - // To display the view, call "show()" (will show fullscreen on device). + QGuiApplication *app = SailfishApp::application(argc, argv); + QQuickView *view = SailfishApp::createView(); + NetworkInterface ni(QNetworkInterface::interfaceFromName("lo")); qDebug() << ni.name(); - return SailfishApp::main(argc, argv); + view->rootContext()->setContextProperty("networkInterface", &ni); + + view->setSource(SailfishApp::pathToMainQml()); + view->show(); + + return app->exec(); } diff --git a/translations/qt3-de.ts b/translations/qt3-de.ts index 8f39883..4b7499a 100644 --- a/translations/qt3-de.ts +++ b/translations/qt3-de.ts @@ -8,30 +8,4 @@ Mein Cover - - FirstPage - - Show Page 2 - Zur Seite 2 - - - UI Template - UI-Vorlage - - - Hello Sailors - Hallo Matrosen - - - - SecondPage - - Nested Page - Unterseite - - - Item - Element - - diff --git a/translations/qt3.ts b/translations/qt3.ts index 7fc118e..6c0a8ab 100644 --- a/translations/qt3.ts +++ b/translations/qt3.ts @@ -8,30 +8,4 @@ - - FirstPage - - Show Page 2 - - - - UI Template - - - - Hello Sailors - - - - - SecondPage - - Nested Page - - - - Item - - -