Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nomovok #7

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
79 changes: 79 additions & 0 deletions rpm/qmlcontacts-qt5.spec
@@ -0,0 +1,79 @@
#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't fork the packaging for apps - just port it to qt5 (see the other ports for examples)

there's not enough people working on this code to justify having both qt4 and qt5 versions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. when I read the history, I think, I did mess up with merging. Sorry, I fix those and try again.

# Do NOT Edit the Auto-generated Part!
# Generated by: spectacle version 0.26
#

Name: qmlcontacts

# >> macros
# << macros

Summary: Contacts application for nemo
Version: 0.4.2
Release: 1
Group: Applications/System
License: GPLv2
URL: https://github.com/nemomobile/qmlcontacts
Source0: %{name}-%{version}.tar.gz
#Source100: qmlcontacts-qt5.yaml
Requires: qt-components-qt5 >= 1.4.8
Requires: mapplauncherd-booster-qtcomponents-qt5
Requires: nemo-qml-plugin-thumbnailer-qt5
Requires: nemo-qml-plugin-contacts-qt5
Requires: nemo-qml-plugin-folderlistmodel
Requires: qmlgallery
Requires: qmlfilemuncher
Requires: contactsd
Requires: nemo-qml-plugin-dbus-qt5
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Contacts)
BuildRequires: pkgconfig(qdeclarative5-boostable)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: desktop-file-utils
Provides: meego-handset-people > 0.2.32
Provides: meego-handset-people-branding-upstream > 0.2.32
Obsoletes: meego-handset-people <= 0.2.32
Obsoletes: meego-handset-people-branding-upstream <= 0.2.32

%description
Contacts application using Qt Quick for Nemo Mobile.

%prep
%setup -q -n %{name}-%{version}

# >> setup
# << setup

%build
# >> build pre
# << build pre

qmake -qt=5 -recursive

make %{?jobs:-j%jobs}

# >> build post
# << build post

%install
rm -rf %{buildroot}
# >> install pre
# << install pre
%qmake_install

# >> install post
# << install post

desktop-file-install --delete-original \
--dir %{buildroot}%{_datadir}/applications \
%{buildroot}%{_datadir}/applications/*.desktop

%files
%defattr(-,root,root,-)
%{_bindir}/qmlcontacts
%{_datadir}/applications/qmlcontacts.desktop
%{_libdir}/qt5/qml/org/nemomobile/qmlcontacts/*
# >> files
# << files
20 changes: 11 additions & 9 deletions src/main.cpp
Expand Up @@ -31,9 +31,9 @@

#include <QDesktopServices>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QStandardPaths

#include <QApplication>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QGuiApplication, you want to drop QtWidgets too during the port (as it's a lot of dead weight)

#include <QDeclarativeView>
#include <QDeclarativeEngine>
#include <QDeclarativeContext>
#include <QQuickView>
#include <QQmlEngine>
#include <QQmlContext>
#include <QDebug>
#include <QDir>
#ifdef HAS_BOOSTER
Expand All @@ -45,15 +45,16 @@ Q_DECL_EXPORT
#endif
int main(int argc, char **argv)
{
QApplication *application;
QDeclarativeView *view;
QQuickView *view;
#ifdef HAS_BOOSTER
QGuiApplication *application;
application = MDeclarativeCache::qApplication(argc, argv);
view = MDeclarativeCache::qDeclarativeView();
#else
QApplication *application;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QGuiApplication

qWarning() << Q_FUNC_INFO << "Warning! Running without booster. This may be a bit slower.";
QApplication stackApp(argc, argv);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

QDeclarativeView stackView;
QQuickView stackView;
application = &stackApp;
view = &stackView;
#endif
Expand All @@ -77,15 +78,16 @@ int main(int argc, char **argv)
view->setSource(QUrl::fromLocalFile("main.qml"));
else
view->setSource(QUrl("qrc:/qml/main.qml"));

/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just delete this block, not needed anymore

view->setAttribute(Qt::WA_OpaquePaintEvent);
view->setAttribute(Qt::WA_NoSystemBackground);
view->viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
view->viewport()->setAttribute(Qt::WA_NoSystemBackground);
*/

// TODO: we could do with a plugin to access QDesktopServices paths
view->rootContext()->setContextProperty("systemAvatarDirectory", QDesktopServices::storageLocation(QDesktopServices::PicturesLocation));
view->rootContext()->setContextProperty("DocumentsLocation", QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation));
view->rootContext()->setContextProperty("systemAvatarDirectory", QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
view->rootContext()->setContextProperty("DocumentsLocation", QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));

if (isFullscreen)
view->showFullScreen();
Expand Down
4 changes: 2 additions & 2 deletions src/qml/AvatarPickerSheet.qml
Expand Up @@ -30,8 +30,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/

import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0
import org.nemomobile.thumbnailer 1.0
import org.nemomobile.qmlgallery 1.0
import org.nemomobile.contacts 1.0
Expand Down
41 changes: 41 additions & 0 deletions src/qml/CheckBox.qml
@@ -0,0 +1,41 @@
import QtQuick 2.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please split the CheckBox stuff/UI changes off, and let's just focus on the port for now?


FocusScope {
id: checkbox

Accessible.role: Accessible.RadioButton

property string text: "CheckBox"
property bool checked: false

width: 100
height: 30

Row {
spacing: 2

Rectangle {
width: 12
height: 12
border.width: checkbox.focus ? 2 : 1
border.color: "black"

Text {
id: checkboxText
text: checkbox.checked ? "x" : ""
anchors.centerIn: parent
}
}

Text {
text: checkbox.text
}
}

MouseArea {
anchors.fill: parent
//onClicked: checkbox.checked = !checkbox.checked
}

// Keys.onSpacePressed: checkbox.checked = !checkbox.checked
}
10 changes: 7 additions & 3 deletions src/qml/ContactCardContentWidget.qml
Expand Up @@ -29,11 +29,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/

import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0
import org.nemomobile.contacts 1.0
import org.nemomobile.qmlcontacts 1.0
import stage.rubyx.voicecall 1.0

Flickable {
id: detailViewPortrait
Expand All @@ -44,6 +43,11 @@ Flickable {

property Person contact
property VoiceCallManager callManager

function newContact()
{
addressRepeater.setModelData(contact.addressTypes, contact.addresses)
}

Item {
id: header
Expand Down
5 changes: 2 additions & 3 deletions src/qml/ContactCardPage.qml
Expand Up @@ -29,11 +29,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/

import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0
import org.nemomobile.qmlcontacts 1.0
import org.nemomobile.contacts 1.0
import stage.rubyx.voicecall 1.0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just removing this import will break the call button, won't it? you want import org.nemomobile.voicecall 1.0

Page {
id: detailViewPage
Expand Down
19 changes: 17 additions & 2 deletions src/qml/ContactEditorSheet.qml
Expand Up @@ -30,8 +30,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/

import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0
import org.nemomobile.qmlcontacts 1.0
import org.nemomobile.contacts 1.0

Expand Down Expand Up @@ -66,6 +66,19 @@ Sheet {

phoneRepeater.setModelData(contact.phoneNumbers)
emailRepeater.setModelData(contact.emailAddresses)
addressRepeater.setModelData(contact.addressTypes, contact.addresses)
}

SelectionDialog {
id: selectionDialog
titleText: qsTr("Select work, home or other address")

onSelectedIndexChanged: {
if (selectedIndex != -1)
{
addressRepeater.addNewData(selectionDialog.model.get(selectedIndex).name);
}
}
}

content: Flickable {
Expand Down Expand Up @@ -157,6 +170,8 @@ Sheet {
contact.avatarPath = data_avatar.source
contact.phoneNumbers = phoneRepeater.modelData()
contact.emailAddresses = emailRepeater.modelData()
contact.addresses = addressRepeater.modelData()
contact.addressTypes = addressRepeater.modelDataTypes()

// TODO: this isn't asynchronous
app.contactListModel.savePerson(contact)
Expand Down
4 changes: 2 additions & 2 deletions src/qml/ContactImportSheet.qml
Expand Up @@ -30,8 +30,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/

import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0
import org.nemomobile.contacts 1.0
import org.nemomobile.folderlistmodel 1.0
import org.nemomobile.qmlfilemuncher 1.0
Expand Down
16 changes: 13 additions & 3 deletions src/qml/ContactListPage.qml
Expand Up @@ -29,8 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/

import QtQuick 1.1
import com.nokia.meego 1.2
import QtQuick 2.0
import com.nokia.meego 2.0
import org.nemomobile.qmlcontacts 1.0
import org.nemomobile.contacts 1.0

Expand All @@ -52,6 +52,10 @@ Page {
app.contactListModel.search(searchbox.searchText);
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop the empty function

function contactChange()
{
}

Component {
id: contactComponent
Expand All @@ -76,7 +80,6 @@ Page {
id: card
onClicked: pageStack.push(Qt.resolvedUrl("ContactCardPage.qml"), { contact: model.person })
}

}

tools: ToolBarLayout {
Expand Down Expand Up @@ -110,6 +113,13 @@ Page {
exportCompleteDialog.open()
}
}

MenuItem {
text: "Settings"
onClicked: {
pageStack.push(Qt.resolvedUrl("SettingsPage.qml"));
}
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/qml/DeleteContactDialog.qml
Expand Up @@ -29,8 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/

import QtQuick 1.1
import com.nokia.meego 1.1
import QtQuick 2.0
import com.nokia.meego 2.0
import org.nemomobile.contacts 1.0

QueryDialog {
Expand Down