Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Commit

Permalink
Starting from clean slate for the UI (#23)
Browse files Browse the repository at this point in the history
1. **Explanation**: 
    - Refreshed UI using the Model-View-Delegate approach from Qt.

2. **Fixed issues**: 
    - Fixed #22 
    - Fixed #24 
    - Fixed #12 
    - Fixed #13  

3. **Testing environment**: 
    - Sailfish OS version: 2.1.0.11
    - Sailfish OS hardware: Oneplus X
  • Loading branch information
DylanVanAssche authored Jan 4, 2018
1 parent b460eee commit 4915c6f
Show file tree
Hide file tree
Showing 106 changed files with 6,755 additions and 3,029 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ Makefile*
# QtCtreator CMake
CMakeLists.txt.user*

#Enforce .pro.user ignore
harbour-berail.pro.user

113 changes: 64 additions & 49 deletions harbour-berail.pro
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# NOTICE:
#
# Application name defined in TARGET has a corresponding QML filename.
# If name defined in TARGET is changed, the following needs to be done
# to match new name:
# - corresponding QML filename must be changed
# - desktop icon filename must be changed
# - desktop filename must be changed
# - icon definition filename in desktop file must be changed
# - translation filenames have to be changed
# This file is part of BeRail.
#
# BeRail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BeRail is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BeRail. If not, see <http://www.gnu.org/licenses/>.
#

# The name of your application
TARGET = harbour-berail
Expand All @@ -18,34 +24,6 @@ QT += core \
network \
positioning

SOURCES += src/harbour-berail.cpp \
src/logger.cpp \
src/os.cpp \
src/api.cpp \
src/models/station.cpp \
src/models/alert.cpp \
src/models/disturbances.cpp \
src/models/liveboard.cpp \
src/models/vehicle.cpp \
src/models/stop.cpp \
src/models/connection.cpp \
src/models/via.cpp \
src/models/enum.cpp \
src/models/alertlistmodel.cpp \
src/models/stoplistmodel.cpp \
src/models/vehiclelistmodel.cpp \
src/models/stationlistmodel.cpp \
src/models/connectionlistmodel.cpp \
src/models/vialistmodel.cpp

OTHER_FILES += qml/harbour-berail.qml \
qml/cover/CoverPage.qml \
qml/pages/FirstPage.qml \
rpm/harbour-berail.spec \
rpm/harbour-berail.yaml \
translations/*.ts \
harbour-berail.desktop

# OS module notification support
PKGCONFIG += nemonotifications-qt5
QT += dbus
Expand All @@ -59,15 +37,13 @@ DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\"

SAILFISHAPP_ICONS = 86x86 108x108 128x128 256x256

# to disable building translations every time, comment out the
# following CONFIG line
CONFIG += sailfishapp_i18n
# Enable translations
CONFIG += sailfishapp_i18n \
sailfishapp_i18n_idbased \
sailfishapp_i18n_unfinished

# German translation is enabled as an example. If you aren't
# planning to localize your app, remember to comment out the
# following TRANSLATIONS line. And also do not forget to
# modify the localized app name in the the .desktop file.
TRANSLATIONS += translations/harbour-berail-de.ts \
TRANSLATIONS += translations/harbour-berail.ts \
translations/harbour-berail-de.ts \
translations/harbour-berail-nl.ts

DISTFILES += \
Expand All @@ -85,10 +61,8 @@ DISTFILES += \
qml/pages/StationListPage.qml \
qml/pages/js/util.js \
qml/pages/DatePickerPage.qml \
qml/pages/TripPage.qml \
qml/pages/components/TripItem.qml \
qml/pages/js/trip.js \
qml/pages/TripDetailPage.qml \
qml/pages/components/LiveBoardItem.qml \
qml/pages/components/CancelOverlay.qml \
qml/pages/js/liveboard.js \
Expand All @@ -98,7 +72,10 @@ DISTFILES += \
qml/pages/js/disturbances.js \
qml/pages/components/DisturbancesView.qml \
qml/pages/DisturbancesPage.qml \
qml/pages/SettingsPage.qml
qml/pages/SettingsPage.qml \
translations/harbour-berail-en.ts \
qml/components/GlassStationButton.qml \
qml/pages/TripDetailHeader.qml

RESOURCES += \
qml/resources/resources.qrc
Expand All @@ -121,4 +98,42 @@ HEADERS += \
src/models/vehiclelistmodel.h \
src/models/stationlistmodel.h \
src/models/connectionlistmodel.h \
src/models/vialistmodel.h
src/models/vialistmodel.h \
src/models/announcements.h \
src/models/remarks.h \
src/models/stationlistmodelfilter.h \
src/models/stopvia.h \
src/models/stopabstract.h

SOURCES += src/harbour-berail.cpp \
src/logger.cpp \
src/os.cpp \
src/api.cpp \
src/models/station.cpp \
src/models/alert.cpp \
src/models/disturbances.cpp \
src/models/liveboard.cpp \
src/models/vehicle.cpp \
src/models/stop.cpp \
src/models/connection.cpp \
src/models/via.cpp \
src/models/enum.cpp \
src/models/alertlistmodel.cpp \
src/models/stoplistmodel.cpp \
src/models/vehiclelistmodel.cpp \
src/models/stationlistmodel.cpp \
src/models/connectionlistmodel.cpp \
src/models/vialistmodel.cpp \
src/models/announcements.cpp \
src/models/remarks.cpp \
src/models/stationlistmodelfilter.cpp \
src/models/stopvia.cpp \
src/models/stopabstract.cpp

OTHER_FILES += qml/harbour-berail.qml \
qml/cover/CoverPage.qml \
qml/pages/FirstPage.qml \
rpm/harbour-berail.spec \
rpm/harbour-berail.yaml \
translations/*.ts \
harbour-berail.desktop
80 changes: 80 additions & 0 deletions qml/components/AlertListDelegate.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* This file is part of BeRail.
*
* BeRail is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BeRail is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with BeRail. If not, see <http://www.gnu.org/licenses/>.
*/

import QtQuick 2.0
import Sailfish.Silica 1.0

ListItem {
contentHeight: column.height*1.1

Column {
id: column
width: parent.width
anchors.centerIn: parent
spacing: Theme.paddingSmall

SectionHeader {
text: model.title.split(":")[1].split(".")[0] // Remove "." from the end
}

TextLabel {
text: model.text
}

Item {
width: parent.width
height: Theme.itemSizeSmall

Label {
width: parent.width - iconLocation.width
anchors { right: iconLocation.left; rightMargin: Theme.paddingSmall; verticalCenter: parent.verticalCenter }
horizontalAlignment: Text.AlignRight
font.pixelSize: Theme.fontSizeSmall
truncationMode: TruncationMode.Fade
color: Theme.secondaryColor
text: model.title.split(":")[0]
}

Image {
id: iconLocation
anchors { right: parent.right; rightMargin: Theme.horizontalPageMargin; verticalCenter: parent.verticalCenter }
source: "image://theme/icon-m-location"
}
}

Item {
width: parent.width
height: Theme.itemSizeSmall

Label {
width: parent.width - iconDate.width
anchors { right: iconDate.left; rightMargin: Theme.paddingSmall; verticalCenter: parent.verticalCenter }
horizontalAlignment: Text.AlignRight
font.pixelSize: Theme.fontSizeSmall
truncationMode: TruncationMode.Fade
color: Theme.secondaryColor
text: model.timestamp.toLocaleString(Qt.locale(), "dd MMM yyyy hh:mm");
}

Image {
id: iconDate
anchors { right: parent.right; rightMargin: Theme.horizontalPageMargin; verticalCenter: parent.verticalCenter }
source: "image://theme/icon-m-time-date"
}
}
}
}
28 changes: 28 additions & 0 deletions qml/components/CanceledOverlay.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import QtQuick 2.0
import Sailfish.Silica 1.0

Item {
width: parent.width
height: parent.height

Rectangle {
anchors { fill: parent }
opacity: 0.75
gradient: Gradient {
GradientStop { position: 0.0; color: Theme.highlightBackgroundColor }
GradientStop { position: 0.33; color: Theme.highlightDimmerColor }
GradientStop { position: 0.66; color: Theme.highlightDimmerColor }
GradientStop { position: 1.0; color: Theme.highlightBackgroundColor }
}
}

Label {
anchors { centerIn: parent }
//% "Canceled"
text: qsTrId("berail-canceled") + " :-("
color: Theme.primaryColor
font.bold: true
font.capitalization: Font.AllUppercase
font.pixelSize: Theme.fontSizeLarge
}
}
Loading

0 comments on commit 4915c6f

Please sign in to comment.