commit e43de89750e78c111106de7b2c1887e8c9135312 Author: MTRNord <mtrnord1@gmail.com> Date: Tue, 1 May 2018 16:44:54 +0200 Initial Commit Diffstat:
| A | .circleci/Morpheusv2.sh | | | 9 | +++++++++ |
| A | .circleci/checkout.sh | | | 43 | +++++++++++++++++++++++++++++++++++++++++++ |
| A | .circleci/config.yml | | | 109 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | .codeclimate.yml | | | 30 | ++++++++++++++++++++++++++++++ |
| A | .github/ISSUE_TEMPLATE.md | | | 33 | +++++++++++++++++++++++++++++++++ |
| A | .gitignore | | | 25 | +++++++++++++++++++++++++ |
| A | CONTRIBUTING.md | | | 91 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | Gopkg.lock | | | 39 | +++++++++++++++++++++++++++++++++++++++ |
| A | Gopkg.toml | | | 30 | ++++++++++++++++++++++++++++++ |
| A | LICENSE | | | 202 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | README.md | | | 39 | +++++++++++++++++++++++++++++++++++++++ |
| A | cmd/root.go | | | 52 | ++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | deb.json | | | 61 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | icon.rc | | | 2 | ++ |
| A | icon_windows.syso | | | 0 | |
| A | main.go | | | 39 | +++++++++++++++++++++++++++++++++++++++ |
| A | morpheus.ico | | | 0 | |
| A | pkg/app/main.go | | | 64 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | pkg/mainThreadHelper.go | | | 38 | ++++++++++++++++++++++++++++++++++++++ |
| A | pkg/qml/icons/README.md | | | 10 | ++++++++++ |
| A | pkg/qml/icons/ic_add_black_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/ic_add_white_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/ic_arrow_drop_down_black_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/ic_arrow_drop_down_circle_black_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/ic_menu_black_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/ic_menu_white_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/ic_person_black_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/ic_person_white_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/ic_phone_black_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/ic_phone_white_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/ic_power_settings_new_black_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/ic_power_settings_new_white_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/ic_send_black_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/ic_settings_black_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/ic_settings_white_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/ic_video_call_black_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/ic_video_call_white_48px.svg | | | 5 | +++++ |
| A | pkg/qml/icons/sign-in.svg | | | 3 | +++ |
| A | pkg/qml/icons/sign-out.svg | | | 3 | +++ |
| A | pkg/qml/langs/morpheus_en.ts | | | 67 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | pkg/qml/resources/logos/MorpheusBig.png | | | 0 | |
| A | pkg/qml/ui/chat.ui | | | 1010 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | pkg/qml/ui/login.ui | | | 759 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | pkg/qml/ui/message.ui | | | 200 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | pkg/qml/ui/ownmessage.ui | | | 203 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | pkg/qml/ui/register.ui | | | 814 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | pkg/qml/ui/room.ui | | | 218 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | scripts/lint.sh | | | 32 | ++++++++++++++++++++++++++++++++ |
| A | scripts/templates/LicenseAgreementDlg_HK.wxs | | | 36 | ++++++++++++++++++++++++++++++++++++ |
| A | scripts/templates/WixUI_HK.wxs | | | 65 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | scripts/templates/choco/LICENSE.txt | | | 9 | +++++++++ |
| A | scripts/templates/choco/VERIFICATION.txt | | | 10 | ++++++++++ |
| A | scripts/templates/choco/chocolateyInstall.ps1 | | | 7 | +++++++ |
| A | scripts/templates/choco/chocolateyUninstall.ps1 | | | 6 | ++++++ |
| A | scripts/templates/choco/pkg.nuspec | | | 38 | ++++++++++++++++++++++++++++++++++++++ |
| A | scripts/templates/product.wxs | | | 159 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | wix.json | | | 45 | +++++++++++++++++++++++++++++++++++++++++++++ |
57 files changed, 4685 insertions(+), 0 deletions(-)
diff --git a/.circleci/Morpheusv2.sh b/.circleci/Morpheusv2.sh @@ -0,0 +1,8 @@ +#!/bin/bash +appname=`basename $0 | sed s,\.sh$,,` + +export LD_LIBRARY_PATH=/usr/local/lib +export QT_PLUGIN_PATH=/usr/local/Morpheusv2/plugins +export QML_IMPORT_PATH=/usr/local/Morpheusv2/qml +export QML2_IMPORT_PATH=/usr/local/Morpheusv2/qml +/usr/bin/$appname "$@" +\ No newline at end of file diff --git a/.circleci/checkout.sh b/.circleci/checkout.sh @@ -0,0 +1,43 @@ +#!/bin/sh +set -e + +# Workaround old docker images with incorrect $HOME +# check https://github.com/docker/docker/issues/2968 for details +if [ "${HOME}" = "/" ] +then + export HOME=$(getent passwd $(id -un) | cut -d: -f6) +fi + +replace='https://github.com/' +to_replace='git@github.com:' +NEW_CIRCLE_REPOSITORY_URL="${CIRCLE_REPOSITORY_URL/$to_replace/$replace}" + +if [ -e /home/user/work/src/github.com/Nordgedanken/Morpheusv2/.git ] +then + cd /home/user/work/src/github.com/Nordgedanken/Morpheusv2/ + git remote set-url origin "$NEW_CIRCLE_REPOSITORY_URL" || true +else + mkdir -p /home/user/work/src/github.com/Nordgedanken/Morpheusv2/ + cd /home/user/work/src/github.com/Nordgedanken/Morpheusv2/ + git clone "$NEW_CIRCLE_REPOSITORY_URL" . +fi + +if [ -n "$CIRCLE_TAG" ] +then + git fetch --force origin "refs/tags/${CIRCLE_TAG}" +else + git fetch --force origin "${CIRCLE_BRANCH}:remotes/origin/${CIRCLE_BRANCH}" +fi + + +if [ -n "$CIRCLE_TAG" ] +then + git reset --hard "$CIRCLE_SHA1" + git checkout -q "$CIRCLE_TAG" +elif [ -n "$CIRCLE_BRANCH" ] +then + git reset --hard "$CIRCLE_SHA1" + git checkout -q -B "$CIRCLE_BRANCH" +fi + +git reset --hard "$CIRCLE_SHA1" diff --git a/.circleci/config.yml b/.circleci/config.yml @@ -0,0 +1,109 @@ +version: 2 +jobs: + prepare: + docker: + - image: therecipe/qt:linux + steps: + - run: + name: Get checkout script + command: apt-get update -qq && apt-get install -y -qq wget curl && mkdir -p .circleci && wget https://raw.githubusercontent.com/Nordgedanken/Morpheusv2/develop/.circleci/checkout.sh -O .circleci/checkout.sh && chmod +x .circleci/checkout.sh + - run: + name: Checkout Morpheusv2 + command: bash .circleci/checkout.sh + - run: + name: Set PATH to correct value + command: echo 'export PATH=/usr/local/go/bin:/usr/local/go_workspace/bin:~/.go_workspace/bin:/home/user/work/bin:$GOBIN:$PATH' >> $BASH_ENV + - run: + name: Get Dep + working_directory: /home/user/work/src/github.com/Nordgedanken/Morpheusv2/ + command: curl -L -s https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 -o $GOPATH/bin/dep && chmod +x $GOPATH/bin/dep + - run: + name: Get Go Dependencies + working_directory: /home/user/work/src/github.com/Nordgedanken/Morpheusv2/ + command: dep ensure + - persist_to_workspace: + # Must be an absolute path, or relative path from working_directory + root: /home/user/work/ + # Must be relative path from root + paths: + - src/ + build_linux: + docker: + - image: therecipe/qt:linux + steps: + - attach_workspace: + # Must be absolute path or relative path from working_directory + at: /home/user/work/ + - run: + name: Update Build Deps + working_directory: /home/user/work/src/github.com/Nordgedanken/Morpheusv2/ + command: apt-get update -y -qq && apt-get install apt -y -qq && add-apt-repository ppa:ubuntu-toolchain-r/test -y && apt-get update -y -qq && apt-get -y -qq install gcc-5 g++-5 && rm -f /usr/bin/gcc && ln -s /usr/bin/gcc-5 /usr/bin/gcc && rm -f /usr/bin/g++ && ln -s /usr/bin/g++-5 /usr/bin/g++ + - run: + name: Run Build + working_directory: /home/user/work/src/github.com/Nordgedanken/Morpheusv2/ + command: $GOPATH/bin/qtdeploy build linux + - run: + name: Prepare Deb Generating + working_directory: /home/user/work/src/github.com/Nordgedanken/Morpheusv2/ + command: apt-get update -qq && apt-get install -y -qq wget && wget -q -O - --no-check-certificate https://raw.githubusercontent.com/mh-cbon/latest/master/install.sh | GH=mh-cbon/go-bin-deb sh -xe && apt-get update -qq && apt-get install build-essential lintian -y -qq + - run: + name: Deb Generating + working_directory: /home/user/work/src/github.com/Nordgedanken/Morpheusv2/ + command: mkdir debian && go-bin-deb generate -o debian + - run: + name: Generate tar.gz + working_directory: /home/user/work/src/github.com/Nordgedanken/Morpheusv2/ + command: tar -czf Morpheusv2.tar.gz deploy/linux/ + - store_artifacts: + path: /home/user/work/src/github.com/Nordgedanken/Morpheusv2/debian/ + destination: debian + - store_artifacts: + path: /home/user/work/src/github.com/Nordgedanken/Morpheus/Morpheusv2.tar.gz + destination: Morpheusv2.tar.gz + lint: + docker: + - image: therecipe/qt:linux + steps: + - attach_workspace: + # Must be absolute path or relative path from working_directory + at: /home/user/work/ + - run: + name: Generate additional binding files + working_directory: /home/user/work/src/github.com/Nordgedanken/Morpheusv2/ + command: $GOPATH/bin/qtrcc desktop && $GOPATH/bin/qtmoc desktop + - run: + name: Run Lint + working_directory: /home/user/work/src/github.com/Nordgedanken/Morpheusv2/ + command: chmod +x scripts/lint.sh && scripts/lint.sh + no_output_timeout: 1200 + build_win_static: + docker: + - image: therecipe/qt:windows_64_static + steps: + - attach_workspace: + # Must be absolute path or relative path from working_directory + at: /home/user/work/ + - run: + name: Run Build + working_directory: /home/user/work/src/github.com/Nordgedanken/Morpheusv2/ + command: $GOPATH/bin/qtdeploy build windows + - store_artifacts: + path: /home/user/work/src/github.com/Nordgedanken/Morpheusv2/deploy/windows/Morpheusv2.exe + destination: Morpheusv2.exe +workflows: + version: 2 + build-test: + jobs: + - prepare + - build_linux: + requires: + - prepare + - build_win_static: + requires: + - prepare + - lint: + requires: + - prepare +notify: + webhooks: + - url: https://riot.nordgedanken.de:4051/services/hooks/Y2lyY2xlY2lfc2VydmljZQ diff --git a/.codeclimate.yml b/.codeclimate.yml @@ -0,0 +1,30 @@ +version: "2" # required to adjust maintainability checks +checks: + method-complexity: + config: + threshold: 20 + method-lines: + config: + threshold: 40 + return-statements: + config: + threshold: 400 + +plugins: + govet: + enabled: true + golint: + enabled: true + gofmt: + enabled: true + fixme: + enabled: true + config: + strings: + - FIXME + - BUG + - TODO + +ratings: + paths: + - "**.go" diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,32 @@ +Issue tracker is **ONLY** used for reporting bugs. NO NEW FEATURE ACCEPTED! Use the [Matrix Room](https://matrix.to/#/#Morpheus:matrix.ffslfl.net) for supporting issues. + +<!--- Provide a general summary of the issue in the Title above --> + +## Expected Behavior +<!--- Tell us what should happen --> + +## Current Behavior +<!--- Tell us what happens instead of the expected behavior --> + +## Possible Solution +<!--- Not obligatory, but suggest a fix/reason for the bug, --> + +## Steps to Reproduce +<!--- Provide a link to a live example, or an unambiguous set of steps to --> +<!--- reproduce this bug. Include code to reproduce, if relevant --> +1. +2. +3. +4. + +## Context (Environment) +<!--- How has this issue affected you? What are you trying to accomplish? --> +<!--- Providing context helps us come up with a solution that is most useful in the real world --> + +<!--- Provide a general summary of the issue in the Title above --> + +## Detailed Description +<!--- Provide a detailed description of the change or addition you are proposing --> + +## Possible Implementation +<!--- Not obligatory, but suggest an idea for implementing addition or change --> +\ No newline at end of file diff --git a/.gitignore b/.gitignore @@ -0,0 +1,24 @@ +# Binaries for programs and plugins +*.exe +*.dll +*.so +*.dylib + +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 +.glide/ +deploy/ +rcc* +debug* +log/ +data/ +moc* +.idea/ +Morpheus.exe +Morpheus.msi +vendor/ +\ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md @@ -0,0 +1,90 @@ +# Contributing + +When contributing to this repository, please first discuss the change you wish to make via issue, +[matrix](https://matrix.to/#/#Morpheus:matrix.ffslfl.net), or any other method with the owners of this repository before making a change. + +Please note we have a code of conduct, please follow it in all your interactions with the project. + +## Pull Request Process + +1. Ensure any install or build dependencies are removed before the end of the layer when doing a + build. +2. Update the README.md with details of changes to the interface, this includes new environment + variables, useful file locations. +<!--3. You may merge the Pull Request in once you have the sign-off of two other developers, or if you + do not have permission to do that, you may request the second reviewer to merge it for you. --> + +## Code of Conduct + +### Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +### Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +### Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +### Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project [matrix +room](https://matrix.to/#/#Morpheus:matrix.ffslfl.net), posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +### Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at "info [at] nordgedanken [dot] de". All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +### Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ +\ No newline at end of file diff --git a/Gopkg.lock b/Gopkg.lock @@ -0,0 +1,39 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + name = "github.com/inconshreveable/mousetrap" + packages = ["."] + revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" + version = "v1.0" + +[[projects]] + branch = "master" + name = "github.com/shibukawa/configdir" + packages = ["."] + revision = "e180dbdc8da04c4fa04272e875ce64949f38bd3e" + +[[projects]] + name = "github.com/spf13/cobra" + packages = ["."] + revision = "a1f051bc3eba734da4772d60e2d677f47cf93ef4" + version = "v0.0.2" + +[[projects]] + name = "github.com/spf13/pflag" + packages = ["."] + revision = "583c0c0531f06d5278b7d917446061adc344b5cd" + version = "v1.0.1" + +[[projects]] + branch = "master" + name = "github.com/therecipe/qt" + packages = [".","core","gui","widgets"] + revision = "7038382d6c7bb5fd3957df56bbedf8ec4ca6b67c" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "a82e2ac4eccca051143202632fee6ebf07b015e82f3d04c4bc426be93aab708b" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml @@ -0,0 +1,30 @@ + +# Gopkg.toml example +# +# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" + + +[[constraint]] + branch = "master" + name = "github.com/shibukawa/configdir" + +[[constraint]] + branch = "master" + name = "github.com/therecipe/qt" diff --git a/LICENSE b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md @@ -0,0 +1,39 @@ +# Morpheus v2 +[](https://circleci.com/gh/Nordgedanken/Morpheusv2) + +[]() + +[](https://goreportcard.com/report/github.com/Nordgedanken/Morpheusv2) +--- + +A Matrix client written in Go-QT and a Reboot of my previous Project [Morpheus](https://github.com/Nordgedanken/Morpheus) + +## Contributing - Matrix Room +Join the Matrix Room at [#Morpheus:matrix.ffslfl.net](https://matrix.to/#/#Morpheus:matrix.ffslfl.net) +Read the [Contribution Guideline](CONTRIBUTING.md) + +## How to build +### Prerequisites +1. https://github.com/therecipe/qt + * Follow https://github.com/therecipe/qt/wiki/Installation +2. Clone this repo by doing `go get -u github.com/Nordgedanken/Morpheusv2` + +### Build +1. Run `qtdeploy build desktop` inside `$GOPATH/src/github.com/Nordgedanken/Morpheusv2` +2. Run the Application from within `deploy/**` + +## How to Build the Windows Installer +1. Get a Windows PC +2. Follow setup on https://github.com/mh-cbon/go-msi +3. Download the Morpheus.exe from the latest CI Build for your tag into the Source Folder or the build result (it needs to be static linked) +4. Run `go-msi make --msi Morpheusv2.msi --version 0.1.0 --src scripts/templates` + +## Versioning +We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/Nordgedanken/Morpheus/tags). + + +## License +This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details + +## Acknowledgments +* Inspired by [nheko](http://github.com/mujx/nheko) diff --git a/cmd/root.go b/cmd/root.go @@ -0,0 +1,52 @@ +// Copyright © 2018 MTRNord <info@nordgedanken.de> +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package cmd + +import ( + "fmt" + "os" + + "github.com/Nordgedanken/Morpheusv2/pkg/app" + "github.com/spf13/cobra" +) + +var cfgFile string + +// rootCmd represents the base command when called without any subcommands +var rootCmd = &cobra.Command{ + Use: "Morpheusv2", + Short: "A brief description of your application", + Long: `A longer description that spans multiple lines and likely contains +examples and usage of using your application. For example: + +Cobra is a CLI library for Go that empowers applications. +This application is a tool to generate the needed files +to quickly create a Cobra application.`, + // Uncomment the following line if your bare application + // has an action associated with it: + RunE: func(cmd *cobra.Command, args []string) error { + return app.Start(args) + }, +} + +// Execute adds all child commands to the root command and sets flags appropriately. +// This is called by main.main(). It only needs to happen once to the rootCmd. +func Execute() { + if err := rootCmd.Execute(); err != nil { + fmt.Println(err) + os.Exit(1) + } + os.Exit(0) +} diff --git a/deb.json b/deb.json @@ -0,0 +1,60 @@ +{ + "name": "Morpheusv2", + "maintainer": "MTRNord <info@nordgedanken.de>", + "version": "0.0.1", + "arch": "amd64", + "files": [ + { + "from": ".circleci/Morpheusv2.sh", + "to": "/usr/bin", + "base": ".circleci/", + "fperm": "0755" + }, + { + "from": "deploy/linux/Morpheusv2", + "to": "/usr/bin", + "base": "deploy/linux/", + "fperm": "0755" + }, + { + "from": "deploy/linux/lib/**/**", + "to": "/usr/local/lib/", + "base": "deploy/linux/lib/", + "fperm": "0755" + }, + { + "from": "deploy/linux/plugins/**/**", + "to": "/usr/local/Morpheusv2/plugins/", + "base": "deploy/linux/plugins", + "fperm": "0755" + }, + { + "from": "deploy/linux/qml/**/**", + "to": "/usr/local/Morpheusv2/qml/", + "base": "deploy/linux/sml/", + "fperm": "0755" + } + ], + "copyrights": [ + { + "files": "*", + "copyright": "2017 MTRNord <info@nordgedanken.de>", + "license": "Apache2.0", + "file": "LICENSE" + } + ], + "description": "A Matrix client written in Go-QT ", + "menus": [ + { + "name":"Morpheusv2", + "description":"A Matrix client written in Go-QT ", + "generic-name":"Matrix Client", + "exec":"/usr/bin/Morpheusv2.sh", + "icon":"qml/resources/logos/MorpheusBig.png", + "type":"Application", + "keywords":"matrix;Morpheusv2", + "startup-notify": false, + "categories":"Network/InstantMessaging" + } + ] +} +\ No newline at end of file diff --git a/icon.rc b/icon.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "morpheus.ico" +\ No newline at end of file diff --git a/icon_windows.syso b/icon_windows.syso Binary files differ. diff --git a/main.go b/main.go @@ -0,0 +1,39 @@ +// Copyright © 2018 MTRNord <info@nordgedanken.de> +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "github.com/Nordgedanken/Morpheusv2/cmd" + "github.com/Nordgedanken/Morpheusv2/pkg" + "runtime" +) + +// Arrange that main.main runs on main thread. +func init() { + runtime.LockOSThread() +} + +func main() { + go pkg.Do(cmd.Execute) + go func() { + for { + pkg.Do(noop) + } + }() + + pkg.Main() +} + +func noop() {} diff --git a/morpheus.ico b/morpheus.ico Binary files differ. diff --git a/pkg/app/main.go b/pkg/app/main.go @@ -0,0 +1,64 @@ +// Copyright © 2018 MTRNord <info@nordgedanken.de> +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package app + +import ( + "github.com/shibukawa/configdir" + "github.com/therecipe/qt/core" + "github.com/therecipe/qt/gui" + "github.com/therecipe/qt/widgets" + "log" + "os" + "path/filepath" +) + +func Start(args []string) error { + log.Println("Starting Morpheus v2") + + // Init Logs and folders + configDirs := configdir.New("Nordgedanken", "Morpheus") + if _, StatErr := os.Stat(filepath.ToSlash(configDirs.QueryFolders(configdir.Global)[0].Path) + "/log/"); os.IsNotExist(StatErr) { + MkdirErr := os.MkdirAll(filepath.ToSlash(configDirs.QueryFolders(configdir.Global)[0].Path)+"/log/", 0700) + if MkdirErr != nil { + return MkdirErr + } + } + + app := widgets.NewQApplication(len(args), args) + + app.SetAttribute(core.Qt__AA_UseHighDpiPixmaps, true) + app.SetApplicationName("Morpheus") + app.SetApplicationVersion("0.1.0") + appIcon := gui.NewQIcon5(":/qml/resources/logos/MorpheusBig.png") + app.SetWindowIcon(appIcon) + + window := widgets.NewQMainWindow(nil, 0) + + windowHeight := 600 + windowWidth := 950 + + desktopApp := widgets.QApplication_Desktop() + primaryScreen := desktopApp.PrimaryScreen() + screen := desktopApp.Screen(primaryScreen) + windowX := (screen.Width() - windowHeight) / 2 + windowY := (screen.Height() - windowWidth) / 2 + + window.Resize2(windowWidth, windowHeight) + window.Show() + + window.Move2(windowX, windowY) + + return nil +} diff --git a/pkg/mainThreadHelper.go b/pkg/mainThreadHelper.go @@ -0,0 +1,38 @@ +// Copyright © 2018 MTRNord <info@nordgedanken.de> +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pkg + +// Main runs the main SDL service loop. +// The binary's main.main must call sdl.Main() to run this loop. +// Main does not return. If the binary needs to do other work, it +// must do it in separate goroutines. +func Main() { + for f := range mainfunc { + f() + } +} + +// queue of work to run in main thread. +var mainfunc = make(chan func()) + +// do runs f on the main thread. +func Do(f func()) { + done := make(chan bool, 1) + mainfunc <- func() { + f() + done <- true + } + <-done +} diff --git a/pkg/qml/icons/README.md b/pkg/qml/icons/README.md @@ -0,0 +1,9 @@ +# Icons come from [Material Design](material.io) and [https://github.com/encharm/Font-Awesome-SVG-PNG](https://github.com/encharm/Font-Awesome-SVG-PNG) + +## License +See: https://github.com/google/material-design-icons/#license +And: https://github.com/encharm/Font-Awesome-SVG-PNG/blob/master/LICENSE + +## Used Version +Material Icons: 7fbdfc47a52bcfe7bd414a1b2eeabb85a4ab6c49 +Font Awesome: 30dda99ee4d4e3437d35fae5f397a7484ba4c840 +\ No newline at end of file diff --git a/pkg/qml/icons/ic_add_black_48px.svg b/pkg/qml/icons/ic_add_black_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/> + <path d="M0 0h24v24H0z" fill="none"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/ic_add_white_48px.svg b/pkg/qml/icons/ic_add_white_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#fafafa" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/> + <path d="M0 0h24v24H0z" fill="none"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/ic_arrow_drop_down_black_48px.svg b/pkg/qml/icons/ic_arrow_drop_down_black_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M7 10l5 5 5-5z"/> + <path d="M0 0h24v24H0z" fill="none"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/ic_arrow_drop_down_circle_black_48px.svg b/pkg/qml/icons/ic_arrow_drop_down_circle_black_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0z" fill="none"/> + <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 12l-4-4h8l-4 4z"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/ic_menu_black_48px.svg b/pkg/qml/icons/ic_menu_black_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0z" fill="none"/> + <path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/ic_menu_white_48px.svg b/pkg/qml/icons/ic_menu_white_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#fafafa" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0z" fill="none"/> + <path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/ic_person_black_48px.svg b/pkg/qml/icons/ic_person_black_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/> + <path d="M0 0h24v24H0z" fill="none"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/ic_person_white_48px.svg b/pkg/qml/icons/ic_person_white_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#fafafa" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/> + <path d="M0 0h24v24H0z" fill="none"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/ic_phone_black_48px.svg b/pkg/qml/icons/ic_phone_black_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0z" fill="none"/> + <path d="M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/ic_phone_white_48px.svg b/pkg/qml/icons/ic_phone_white_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#fafafa" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0z" fill="none"/> + <path d="M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/ic_power_settings_new_black_48px.svg b/pkg/qml/icons/ic_power_settings_new_black_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0z" fill="none"/> + <path d="M13 3h-2v10h2V3zm4.83 2.17l-1.42 1.42C17.99 7.86 19 9.81 19 12c0 3.87-3.13 7-7 7s-7-3.13-7-7c0-2.19 1.01-4.14 2.58-5.42L6.17 5.17C4.23 6.82 3 9.26 3 12c0 4.97 4.03 9 9 9s9-4.03 9-9c0-2.74-1.23-5.18-3.17-6.83z"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/ic_power_settings_new_white_48px.svg b/pkg/qml/icons/ic_power_settings_new_white_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#fafafa" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0z" fill="none"/> + <path d="M13 3h-2v10h2V3zm4.83 2.17l-1.42 1.42C17.99 7.86 19 9.81 19 12c0 3.87-3.13 7-7 7s-7-3.13-7-7c0-2.19 1.01-4.14 2.58-5.42L6.17 5.17C4.23 6.82 3 9.26 3 12c0 4.97 4.03 9 9 9s9-4.03 9-9c0-2.74-1.23-5.18-3.17-6.83z"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/ic_send_black_48px.svg b/pkg/qml/icons/ic_send_black_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/> + <path d="M0 0h24v24H0z" fill="none"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/ic_settings_black_48px.svg b/pkg/qml/icons/ic_settings_black_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0z" fill="none"/> + <path d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/ic_settings_white_48px.svg b/pkg/qml/icons/ic_settings_white_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#fafafa" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0z" fill="none"/> + <path d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/ic_video_call_black_48px.svg b/pkg/qml/icons/ic_video_call_black_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#000000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0V0z" fill="none"/> + <path d="M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4zM14 13h-3v3H9v-3H6v-2h3V8h2v3h3v2z"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/ic_video_call_white_48px.svg b/pkg/qml/icons/ic_video_call_white_48px.svg @@ -0,0 +1,4 @@ +<svg fill="#fafafa" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"> + <path d="M0 0h24v24H0V0z" fill="none"/> + <path d="M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4zM14 13h-3v3H9v-3H6v-2h3V8h2v3h3v2z"/> +</svg> +\ No newline at end of file diff --git a/pkg/qml/icons/sign-in.svg b/pkg/qml/icons/sign-in.svg @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8"?> +<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1312 896q0 26-19 45l-544 544q-19 19-45 19t-45-19-19-45v-288h-448q-26 0-45-19t-19-45v-384q0-26 19-45t45-19h448v-288q0-26 19-45t45-19 45 19l544 544q19 19 19 45zm352-352v704q0 119-84.5 203.5t-203.5 84.5h-320q-13 0-22.5-9.5t-9.5-22.5q0-4-1-20t-.5-26.5 3-23.5 10-19.5 20.5-6.5h320q66 0 113-47t47-113v-704q0-66-47-113t-113-47h-312l-11.5-1-11.5-3-8-5.5-7-9-2-13.5q0-4-1-20t-.5-26.5 3-23.5 10-19.5 20.5-6.5h320q119 0 203.5 84.5t84.5 203.5z" fill="#fff"/></svg> +\ No newline at end of file diff --git a/pkg/qml/icons/sign-out.svg b/pkg/qml/icons/sign-out.svg @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8"?> +<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M704 1440q0 4 1 20t.5 26.5-3 23.5-10 19.5-20.5 6.5h-320q-119 0-203.5-84.5t-84.5-203.5v-704q0-119 84.5-203.5t203.5-84.5h320q13 0 22.5 9.5t9.5 22.5q0 4 1 20t.5 26.5-3 23.5-10 19.5-20.5 6.5h-320q-66 0-113 47t-47 113v704q0 66 47 113t113 47h312l11.5 1 11.5 3 8 5.5 7 9 2 13.5zm928-544q0 26-19 45l-544 544q-19 19-45 19t-45-19-19-45v-288h-448q-26 0-45-19t-19-45v-384q0-26 19-45t45-19h448v-288q0-26 19-45t45-19 45 19l544 544q19 19 19 45z" fill="#fff"/></svg> +\ No newline at end of file diff --git a/pkg/qml/langs/morpheus_en.ts b/pkg/qml/langs/morpheus_en.ts @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1" language="en_US"> +<context> + <name>ChatWidget</name> + <message> + <location filename="../ui/chat.ui" line="20"/> + <source>Neo</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../ui/chat.ui" line="179"/> + <source>New 1-1 Chat</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../ui/chat.ui" line="241"/> + <source>New Room</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../ui/chat.ui" line="303"/> + <source>Directory</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../ui/chat.ui" line="368"/> + <source>Settings</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../ui/chat.ui" line="427"/> + <source>Logout</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../ui/chat.ui" line="546"/> + <source>Search...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../ui/chat.ui" line="684"/> + <source>Matrix HQ</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../ui/chat.ui" line="704"/> + <source>The Official Matrix HQ - please come chat here! | To support Matrix.org development: https://patreon.com/matrixdotorg | Try http://riot.im/app for a glossy web client | Looking for homeserver hosting? Check out https://upcloud.com/matrix!</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../ui/chat.ui" line="737"/> + <source>Start Voice Chat</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../ui/chat.ui" line="778"/> + <source>Start Video Chat</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../ui/chat.ui" line="901"/> + <source>Send a Message (unecrypted)...</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/pkg/qml/resources/logos/MorpheusBig.png b/pkg/qml/resources/logos/MorpheusBig.png Binary files differ. diff --git a/pkg/qml/ui/chat.ui b/pkg/qml/ui/chat.ui @@ -0,0 +1,1010 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>ChatWidget</class> + <widget class="QWidget" name="ChatWidget"> + <property name="windowModality"> + <enum>Qt::ApplicationModal</enum> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>950</width> + <height>600</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>950</width> + <height>600</height> + </size> + </property> + <property name="windowTitle"> + <string>Morpheus</string> + </property> + <property name="windowIcon"> + <iconset resource="../../rcc.qrc"> + <normaloff>:/qml/resources/logos/MorpheusBig.png</normaloff>:/qml/resources/logos/MorpheusBig.png</iconset> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="styleSheet"> + <string notr="true">background-color: rgb(244, 246, 250);</string> + </property> + <layout class="QGridLayout" name="gridLayout"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <item row="0" column="0"> + <widget class="QWidget" name="sidebarWidget" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">background-color: rgb(91, 103, 125); +/* rgb(70, 79, 96);*/</string> + </property> + <layout class="QGridLayout" name="gridLayout_6"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <item row="0" column="0"> + <widget class="QWidget" name="userAvatarLayout" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <widget class="QLabel" name="UserAvatar"> + <property name="geometry"> + <rect> + <x>7</x> + <y>10</y> + <width>61</width> + <height>61</height> + </rect> + </property> + <property name="mouseTracking"> + <bool>true</bool> + </property> + <property name="text"> + <string/> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </widget> + </item> + <item row="1" column="0"> + <widget class="QWidget" name="buttonAreaLayout" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QVBoxLayout" name="verticalLayout_8"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QWidget" name="buttonsExceptSettings" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>7</number> + </property> + <property name="topMargin"> + <number>45</number> + </property> + <property name="rightMargin"> + <number>9</number> + </property> + <item> + <widget class="QWidget" name="to1ChatButtonLayout" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="spacing"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>9</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QPushButton" name="to1ChatButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>New 1-1 Chat</string> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../../rcc.qrc"> + <normaloff>:/qml/icons/ic_person_white_48px.svg</normaloff>:/qml/icons/ic_person_white_48px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>25</width> + <height>25</height> + </size> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="newRoomButtonLayout" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>9</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>9</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QPushButton" name="newRoomButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>New Room</string> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../../rcc.qrc"> + <normaloff>:/qml/icons/ic_add_white_48px.svg</normaloff>:/qml/icons/ic_add_white_48px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="directoryButtonLayout" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>9</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>9</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QPushButton" name="directoryButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>Directory</string> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../../rcc.qrc"> + <normaloff>:/qml/icons/ic_menu_white_48px.svg</normaloff>:/qml/icons/ic_menu_white_48px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>25</width> + <height>25</height> + </size> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="settingsButtonLayout" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>9</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>9</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QPushButton" name="settingsMenuButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="mouseTracking"> + <bool>false</bool> + </property> + <property name="toolTip"> + <string>Settings</string> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../../rcc.qrc"> + <normaloff>:/qml/icons/ic_settings_white_48px.svg</normaloff>:/qml/icons/ic_settings_white_48px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>25</width> + <height>25</height> + </size> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="LogoutButtonLayout" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <property name="spacing"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>9</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QPushButton" name="LogoutButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>Logout</string> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset> + <normaloff>:/qml/icons/sign-out.svg</normaloff>:/qml/icons/sign-out.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>25</width> + <height>25</height> + </size> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + <zorder>settingsButtonLayout</zorder> + <zorder>directoryButtonLayout</zorder> + <zorder>to1ChatButtonLayout</zorder> + <zorder>newRoomButtonLayout</zorder> + <zorder>LogoutButtonLayout</zorder> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + <zorder>buttonAreaLayout</zorder> + <zorder>userAvatarLayout</zorder> + </widget> + </item> + <item row="0" column="1"> + <widget class="QWidget" name="RoomBarWidget" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QVBoxLayout" name="verticalLayout_6"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QWidget" name="SearchWidget" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>9</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>9</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <item row="0" column="0"> + <widget class="QLineEdit" name="SearchInput"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>271</width> + <height>31</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">background-color: rgb(235, 239, 245); +border: 0; +border-radius: 5px;</string> + </property> + <property name="text"> + <string/> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="placeholderText"> + <string>Search...</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QScrollArea" name="roomScroll"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">border:0;</string> + </property> + <property name="verticalScrollBarPolicy"> + <enum>Qt::ScrollBarAsNeeded</enum> + </property> + <property name="horizontalScrollBarPolicy"> + <enum>Qt::ScrollBarAlwaysOff</enum> + </property> + <property name="widgetResizable"> + <bool>true</bool> + </property> + <property name="alignment"> + <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> + </property> + <widget class="QWidget" name="roomScrollAreaContent"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>271</width> + <height>551</height> + </rect> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </widget> + </widget> + </item> + </layout> + </widget> + </item> + <item row="0" column="2"> + <widget class="QWidget" name="RoomWidget" native="true"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">background-color: rgb(250, 250, 250);</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_9"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QWidget" name="titleBar" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">background-color:rgb(246, 246, 246); +border-radius: 2px;</string> + </property> + <layout class="QGridLayout" name="gridLayout_7"> + <property name="leftMargin"> + <number>9</number> + </property> + <property name="topMargin"> + <number>9</number> + </property> + <property name="rightMargin"> + <number>9</number> + </property> + <property name="bottomMargin"> + <number>9</number> + </property> + <property name="horizontalSpacing"> + <number>6</number> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="roomAvatar"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="0" column="1"> + <layout class="QVBoxLayout" name="TitleLayout"> + <property name="sizeConstraint"> + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <item> + <widget class="QLabel" name="RoomTitle"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <family>Arial</family> + <pointsize>25</pointsize> + <underline>true</underline> + <stylestrategy>PreferAntialias</stylestrategy> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="openExternalLinks"> + <bool>false</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="Topic"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <family>Arial</family> + <pointsize>9</pointsize> + <stylestrategy>PreferAntialias</stylestrategy> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="textFormat"> + <enum>Qt::AutoText</enum> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + </layout> + </item> + <item row="0" column="2"> + <widget class="QPushButton" name="callButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>Start Voice Chat</string> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../../rcc.qrc"> + <normaloff>:/qml/icons/ic_phone_black_48px.svg</normaloff>:/qml/icons/ic_phone_black_48px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>25</width> + <height>25</height> + </size> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="0" column="3"> + <widget class="QPushButton" name="videoCallButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>Start Video Chat</string> + </property> + <property name="styleSheet"> + <string notr="true">;</string> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../../rcc.qrc"> + <normaloff>:/qml/icons/ic_video_call_black_48px.svg</normaloff>:/qml/icons/ic_video_call_black_48px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>25</width> + <height>25</height> + </size> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <layout class="QVBoxLayout" name="messageAreaLayout"> + <property name="spacing"> + <number>9</number> + </property> + <item> + <widget class="QScrollArea" name="messageScroll"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">border:0;</string> + </property> + <property name="horizontalScrollBarPolicy"> + <enum>Qt::ScrollBarAlwaysOff</enum> + </property> + <property name="widgetResizable"> + <bool>true</bool> + </property> + <property name="alignment"> + <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> + </property> + <widget class="QWidget" name="messagesScrollAreaContent"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>601</width> + <height>469</height> + </rect> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </widget> + </widget> + </item> + <item> + <widget class="QWidget" name="messageInputWrapper" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <layout class="QGridLayout" name="gridLayout_3" rowstretch="0"> + <property name="leftMargin"> + <number>9</number> + </property> + <property name="topMargin"> + <number>9</number> + </property> + <property name="rightMargin"> + <number>9</number> + </property> + <property name="bottomMargin"> + <number>9</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <item row="0" column="0"> + <widget class="QLineEdit" name="MessageInput"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">background-color: rgb(229, 229, 229); +border: 0; +border-radius: 5px; +padding: 3px</string> + </property> + <property name="inputMask"> + <string/> + </property> + <property name="text"> + <string/> + </property> + <property name="maxLength"> + <number>999999999</number> + </property> + <property name="frame"> + <bool>true</bool> + </property> + <property name="readOnly"> + <bool>false</bool> + </property> + <property name="placeholderText"> + <string>Send a Message (unencrypted)...</string> + </property> + <property name="clearButtonEnabled"> + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + </layout> + <zorder>RoomBarWidget</zorder> + <zorder>sidebarWidget</zorder> + <zorder>RoomWidget</zorder> + </widget> + <resources> + <include location="../../rcc.qrc"/> + </resources> + <connections/> +</ui> diff --git a/pkg/qml/ui/login.ui b/pkg/qml/ui/login.ui @@ -0,0 +1,759 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>ChatWidget</class> + <widget class="QWidget" name="ChatWidget"> + <property name="windowModality"> + <enum>Qt::ApplicationModal</enum> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>950</width> + <height>600</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>950</width> + <height>600</height> + </size> + </property> + <property name="windowTitle"> + <string>Morpheus</string> + </property> + <property name="windowIcon"> + <iconset resource="../../rcc.qrc"> + <normaloff>:/qml/resources/logos/MorpheusBig.png</normaloff>:/qml/resources/logos/MorpheusBig.png</iconset> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="styleSheet"> + <string notr="true">background-color: rgb(244, 246, 250);</string> + </property> + <layout class="QGridLayout" name="gridLayout"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <item row="0" column="0"> + <widget class="QWidget" name="sidebarWidget" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">background-color: rgb(121, 194, 113) +/* rgb(91, 103, 125); +/* rgb(70, 79, 96);*/</string> + </property> + <layout class="QGridLayout" name="gridLayout_6"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <item row="0" column="0"> + <widget class="QWidget" name="buttonAreaLayout" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QVBoxLayout" name="verticalLayout_8"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QWidget" name="buttonsExceptSettings" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>6</number> + </property> + <property name="leftMargin"> + <number>7</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>9</number> + </property> + <property name="bottomMargin"> + <number>9</number> + </property> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>30</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QWidget" name="registerButtonLayout" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <item> + <widget class="QPushButton" name="RegisterButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>Register</string> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../../rcc.qrc"> + <normaloff>:/qml/icons/ic_add_white_48px.svg</normaloff>:/qml/icons/ic_add_white_48px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>35</width> + <height>35</height> + </size> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="settingsButtonLayout" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QPushButton" name="settingsMenuButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="mouseTracking"> + <bool>false</bool> + </property> + <property name="toolTip"> + <string>Settings</string> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../../rcc.qrc"> + <normaloff>:/qml/icons/ic_settings_white_48px.svg</normaloff>:/qml/icons/ic_settings_white_48px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + <zorder>settingsButtonLayout</zorder> + <zorder>registerButtonLayout</zorder> + <zorder>verticalSpacer</zorder> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item row="0" column="1"> + <widget class="QWidget" name="RoomWidget" native="true"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">background-color: rgb(250, 250, 250);</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item alignment="Qt::AlignTop"> + <widget class="QWidget" name="titleBar" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">background-color:rgb(246, 246, 246); +border-radius: 2px;</string> + </property> + <layout class="QGridLayout" name="gridLayout_7"> + <property name="leftMargin"> + <number>9</number> + </property> + <property name="topMargin"> + <number>9</number> + </property> + <property name="rightMargin"> + <number>9</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <property name="horizontalSpacing"> + <number>6</number> + </property> + <property name="verticalSpacing"> + <number>0</number> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="roomAvatar"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>85</width> + <height>85</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="../../rcc.qrc">:/qml/resources/logos/MorpheusBig.png</pixmap> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="0" column="1"> + <layout class="QVBoxLayout" name="TitleLayout"> + <property name="sizeConstraint"> + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <item> + <widget class="QLabel" name="RoomTitle"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <family>Arial</family> + <pointsize>25</pointsize> + <underline>true</underline> + <stylestrategy>PreferAntialias</stylestrategy> + </font> + </property> + <property name="text"> + <string>Login</string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="openExternalLinks"> + <bool>false</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="Topic"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <family>Arial</family> + <pointsize>9</pointsize> + <stylestrategy>PreferAntialias</stylestrategy> + </font> + </property> + <property name="text"> + <string>Login to a Matrix Home Server</string> + </property> + <property name="textFormat"> + <enum>Qt::AutoText</enum> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="Main" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <item row="0" column="0" alignment="Qt::AlignHCenter|Qt::AlignVCenter"> + <widget class="QWidget" name="Wrapper" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>450</width> + <height>170</height> + </size> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QWidget" name="ServerChooserDropdown_w" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="ServerChooser"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Server Address</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>68</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QComboBox" name="ServerChooserDropdown"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">QComboBox { + border-radius: 3px; + padding: 1px 18px 1px 3px; +} + +QComboBox::down-arrow { + image: url(:/qml/icons/ic_arrow_drop_down_black_48px.svg); +} + +QComboBox::down-arrow:on { /* shift the arrow when popup is open */ + top: 1px; + left: 1px; +}</string> + </property> + <property name="editable"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="Localpart_w" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="Localpart"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Localpart</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLineEdit" name="LocalpartInput"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="placeholderText"> + <string>Insert Localpart (@Username)</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="Password_w" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="Password"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Password</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLineEdit" name="PasswordInput"> + <property name="echoMode"> + <enum>QLineEdit::Password</enum> + </property> + <property name="placeholderText"> + <string>Insert password</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QPushButton" name="LoginButton"> + <property name="styleSheet"> + <string notr="true">QPushButton { + border-radius: 5px; + background-color: rgb(121, 194, 113); + min-height: 25px; +} + +QPushButton:default { + border-color: navy; /* make the default button prominent */ +}</string> + </property> + <property name="text"> + <string>Login</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <resources> + <include location="../../rcc.qrc"/> + </resources> + <connections/> +</ui> diff --git a/pkg/qml/ui/message.ui b/pkg/qml/ui/message.ui @@ -0,0 +1,200 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>message</class> + <widget class="QWidget" name="message"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>365</width> + <height>106</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <property name="styleSheet"> + <string notr="true">background-color:transparent;</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QWidget" name="widget_2" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QWidget" name="widget_3" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>61</width> + <height>61</height> + </size> + </property> + <widget class="QLabel" name="avatar"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>61</width> + <height>61</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap>../../../../../../../Downloads/avatar512.png</pixmap> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::NoTextInteraction</set> + </property> + </widget> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="widget" native="true"> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="messageContent"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <family>Arial</family> + <pointsize>12</pointsize> + <stylestrategy>PreferAntialias</stylestrategy> + </font> + </property> + <property name="styleSheet"> + <string notr="true">/*OLD COLOR +background-color: rgb(242, 244, 248); */ +background-color: rgb(225, 227, 230); +border: 0; +border-radius:7px;</string> + </property> + <property name="text"> + <string/> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="margin"> + <number>4</number> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QWidget" name="subMessageWidget" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="sender"> + <property name="font"> + <font> + <pointsize>8</pointsize> + </font> + </property> + <property name="styleSheet"> + <string notr="true">color:grey;</string> + </property> + <property name="text"> + <string/> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="timestamp"> + <property name="font"> + <font> + <pointsize>8</pointsize> + </font> + </property> + <property name="styleSheet"> + <string notr="true">color:grey;</string> + </property> + <property name="text"> + <string/> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse</set> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/pkg/qml/ui/ownmessage.ui b/pkg/qml/ui/ownmessage.ui @@ -0,0 +1,203 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>message</class> + <widget class="QWidget" name="message"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>365</width> + <height>106</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <property name="styleSheet"> + <string notr="true">background-color:transparent;</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QWidget" name="widget_2" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="1"> + <widget class="QWidget" name="widget_3" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>61</width> + <height>61</height> + </size> + </property> + <widget class="QLabel" name="avatar"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>61</width> + <height>61</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap>../../../../../../../Downloads/avatar512.png</pixmap> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::NoTextInteraction</set> + </property> + </widget> + </widget> + </item> + <item row="0" column="0"> + <widget class="QWidget" name="widget" native="true"> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="messageContent"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <family>Arial</family> + <pointsize>12</pointsize> + <stylestrategy>PreferAntialias</stylestrategy> + </font> + </property> + <property name="styleSheet"> + <string notr="true">/*OLD COLOR +background-color: rgb(242, 244, 248); */ +background-color: rgb(123, 199, 248); +border: 0; +border-radius:7px;</string> + </property> + <property name="text"> + <string/> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="margin"> + <number>4</number> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QWidget" name="subMessageWidget" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="timestamp"> + <property name="font"> + <font> + <pointsize>8</pointsize> + </font> + </property> + <property name="styleSheet"> + <string notr="true">color:grey;</string> + </property> + <property name="text"> + <string/> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="sender"> + <property name="font"> + <font> + <pointsize>8</pointsize> + </font> + </property> + <property name="styleSheet"> + <string notr="true">color:grey;</string> + </property> + <property name="text"> + <string/> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/pkg/qml/ui/register.ui b/pkg/qml/ui/register.ui @@ -0,0 +1,814 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>ChatWidget</class> + <widget class="QWidget" name="ChatWidget"> + <property name="windowModality"> + <enum>Qt::ApplicationModal</enum> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>950</width> + <height>600</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>950</width> + <height>600</height> + </size> + </property> + <property name="windowTitle"> + <string>Morpheus</string> + </property> + <property name="windowIcon"> + <iconset resource="../../rcc.qrc"> + <normaloff>:/qml/resources/logos/MorpheusBig.png</normaloff>:/qml/resources/logos/MorpheusBig.png</iconset> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="styleSheet"> + <string notr="true">background-color: rgb(244, 246, 250);</string> + </property> + <layout class="QGridLayout" name="gridLayout"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <item row="0" column="0"> + <widget class="QWidget" name="sidebarWidget" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="styleSheet"> + <string notr="true">background-color: rgb(113, 189, 194); +/* rgb(121, 194, 113);*/ +/* rgb(91, 103, 125);*/ +/* rgb(70, 79, 96);*/</string> + </property> + <layout class="QGridLayout" name="gridLayout_6"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <item row="0" column="0"> + <widget class="QWidget" name="buttonAreaLayout" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QVBoxLayout" name="verticalLayout_8"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QWidget" name="buttonsExceptSettings" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>6</number> + </property> + <property name="leftMargin"> + <number>7</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>9</number> + </property> + <property name="bottomMargin"> + <number>9</number> + </property> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>30</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QWidget" name="loginButtonLayout" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <item> + <widget class="QPushButton" name="loginButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>New Room</string> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset> + <normaloff>:/qml/icons/sign-in.svg</normaloff>:/qml/icons/sign-in.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>35</width> + <height>35</height> + </size> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="settingsButtonLayout" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QPushButton" name="settingsMenuButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="mouseTracking"> + <bool>false</bool> + </property> + <property name="toolTip"> + <string>Settings</string> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../../rcc.qrc"> + <normaloff>:/qml/icons/ic_settings_white_48px.svg</normaloff>:/qml/icons/ic_settings_white_48px.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>30</width> + <height>30</height> + </size> + </property> + <property name="flat"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + <zorder>settingsButtonLayout</zorder> + <zorder>loginButtonLayout</zorder> + <zorder>verticalSpacer</zorder> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item row="0" column="1"> + <widget class="QWidget" name="RoomWidget" native="true"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">background-color: rgb(250, 250, 250);</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item alignment="Qt::AlignTop"> + <widget class="QWidget" name="titleBar" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">background-color:rgb(246, 246, 246); +border-radius: 2px;</string> + </property> + <layout class="QGridLayout" name="gridLayout_7"> + <property name="leftMargin"> + <number>9</number> + </property> + <property name="topMargin"> + <number>9</number> + </property> + <property name="rightMargin"> + <number>9</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <property name="horizontalSpacing"> + <number>6</number> + </property> + <property name="verticalSpacing"> + <number>0</number> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="roomAvatar"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>85</width> + <height>85</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="../../rcc.qrc">:/qml/resources/logos/MorpheusBig.png</pixmap> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="0" column="1"> + <layout class="QVBoxLayout" name="TitleLayout"> + <property name="sizeConstraint"> + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <item> + <widget class="QLabel" name="RoomTitle"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <family>Arial</family> + <pointsize>25</pointsize> + <underline>true</underline> + <stylestrategy>PreferAntialias</stylestrategy> + </font> + </property> + <property name="text"> + <string>Register</string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="openExternalLinks"> + <bool>false</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="Topic"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <family>Arial</family> + <pointsize>9</pointsize> + <stylestrategy>PreferAntialias</stylestrategy> + </font> + </property> + <property name="text"> + <string>Register to a Matrix Home Server</string> + </property> + <property name="textFormat"> + <enum>Qt::AutoText</enum> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="Main" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <item row="0" column="0" alignment="Qt::AlignHCenter|Qt::AlignVCenter"> + <widget class="QWidget" name="Wrapper" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>450</width> + <height>170</height> + </size> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QWidget" name="Server_w" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="Server"> + <property name="text"> + <string>Server</string> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Preferred</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>204</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QComboBox" name="ServerChooserDropdown"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">QComboBox { + border-radius: 3px; + padding: 1px 18px 1px 3px; +} + +QComboBox::down-arrow { + image: url(:/qml/icons/ic_arrow_drop_down_black_48px.svg); +} + +QComboBox::down-arrow:on { /* shift the arrow when popup is open */ + top: 1px; + left: 1px; +}</string> + </property> + <property name="editable"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="Username_w" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="Username"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Username</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Preferred</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>191</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLineEdit" name="UsernameInput"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="placeholderText"> + <string>Insert Localpart (@Username)</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="Password_w" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="Password"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Password</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Preferred</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>193</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLineEdit" name="PasswordInput"> + <property name="echoMode"> + <enum>QLineEdit::Password</enum> + </property> + <property name="placeholderText"> + <string>Insert password</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="PasswordConfirm_w" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="PasswordConfirm"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Confirm Password</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Preferred</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>153</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLineEdit" name="PasswordConfirmInput"> + <property name="echoMode"> + <enum>QLineEdit::Password</enum> + </property> + <property name="placeholderText"> + <string>Insert password</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QPushButton" name="RegisterButton"> + <property name="styleSheet"> + <string notr="true">QPushButton { + border-radius: 5px; + background-color: rgb(113, 189, 194); + min-height: 25px; +} + +QPushButton:default { + border-color: navy; /* make the default button prominent */ +}</string> + </property> + <property name="text"> + <string>Register</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <resources> + <include location="../../rcc.qrc"/> + </resources> + <connections/> +</ui> diff --git a/pkg/qml/ui/room.ui b/pkg/qml/ui/room.ui @@ -0,0 +1,218 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>room</class> + <widget class="QWidget" name="room"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>365</width> + <height>106</height> + </rect> + </property> + <property name="mouseTracking"> + <bool>true</bool> + </property> + <property name="tabletTracking"> + <bool>true</bool> + </property> + <property name="focusPolicy"> + <enum>Qt::ClickFocus</enum> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <property name="styleSheet"> + <string notr="true">background-color:transparent;</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QWidget" name="widget_2" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QGridLayout" name="gridLayout"> + <property name="leftMargin"> + <number>9</number> + </property> + <property name="topMargin"> + <number>9</number> + </property> + <item row="0" column="0"> + <widget class="QWidget" name="widget_3" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>61</width> + <height>61</height> + </size> + </property> + <widget class="QLabel" name="roomAvatar"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>61</width> + <height>61</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap>../../../../../../../Downloads/avatar512.png</pixmap> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::NoTextInteraction</set> + </property> + </widget> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="widget" native="true"> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="roomName"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <family>Arial</family> + <pointsize>12</pointsize> + <weight>75</weight> + <italic>false</italic> + <bold>true</bold> + <stylestrategy>PreferAntialias</stylestrategy> + <kerning>true</kerning> + </font> + </property> + <property name="mouseTracking"> + <bool>true</bool> + </property> + <property name="styleSheet"> + <string notr="true">border: 0;</string> + </property> + <property name="text"> + <string/> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="margin"> + <number>4</number> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QWidget" name="subMessageWidget" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="lastMessage"> + <property name="font"> + <font> + <pointsize>8</pointsize> + </font> + </property> + <property name="styleSheet"> + <string notr="true">color:grey;</string> + </property> + <property name="text"> + <string>This is a placeholder :)</string> + </property> + <property name="openExternalLinks"> + <bool>false</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="timestamp"> + <property name="font"> + <font> + <pointsize>8</pointsize> + </font> + </property> + <property name="styleSheet"> + <string notr="true">color:grey;</string> + </property> + <property name="text"> + <string>This is a placeholder :)</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="openExternalLinks"> + <bool>false</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse</set> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/scripts/lint.sh b/scripts/lint.sh @@ -0,0 +1,32 @@ + +#! /bin/bash + +# Runs the linters against dendrite + +# The linters can take a lot of resources and are slow, so they can be +# configured using two environment variables: +# +# - `MORPHEUS_LINT_CONCURRENCY` - number of concurrent linters to run, +# gometalinter defaults this to 8 +# - `MORPHEUS_LINT_DISABLE_GC` - if set then the the go gc will be disabled +# when running the linters, speeding them up but using much more memory. + + +set -eu + +args="--config=linter.json" + +if [ -n "${MORPHEUS_LINT_CONCURRENCY:-}" ] +then args="$args --concurrency=$MORPHEUS_LINT_CONCURRENCY" +fi + +if [ -z "${MORPHEUS_LINT_DISABLE_GC:-}" ] +then args="$args --enable-gc" +fi + +echo "Installing lint search engine..." +go get -u -v github.com/alecthomas/gometalinter/ +$GOPATH/bin/gometalinter --config=linter.json ./... --install + +echo "Looking for lint..." +$GOPATH/bin/gometalinter ./... ${args} --skip=vendor --exclude "vendor" --exclude "moc" --exclude "qt" diff --git a/scripts/templates/LicenseAgreementDlg_HK.wxs b/scripts/templates/LicenseAgreementDlg_HK.wxs @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> + <Fragment> + <UI> + <Dialog Id="LicenseAgreementDlg_HK" Width="370" Height="270" Title="!(loc.LicenseAgreementDlg_Title)"> + <Control Id="LicenseAcceptedCheckBox" Type="CheckBox" X="20" Y="207" Width="330" Height="18" CheckBoxValue="1" Property="LicenseAccepted" + Text="!(loc.LicenseAgreementDlgLicenseAcceptedCheckBox)" /> + <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" /> + <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)"> + <Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">CostingComplete = 1</Publish> + <Condition Action="disable"><![CDATA[LicenseAccepted <> "1"]]></Condition> + <Condition Action="enable">LicenseAccepted = "1"</Condition> + </Control> + <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)"> + <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish> + </Control> + <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.LicenseAgreementDlgBannerBitmap)" /> + <Control Id="LicenseText" Type="ScrollableText" X="20" Y="60" Width="330" Height="140" Sunken="yes" TabSkip="no"> + + {{if gt (.License | len) 0}} + <Text SourceFile="{{.License}}" /> + {{end}} + + </Control> + <Control Id="Print" Type="PushButton" X="112" Y="243" Width="56" Height="17" Text="!(loc.WixUIPrint)"> + <Publish Event="DoAction" Value="WixUIPrintEula">1</Publish> + </Control> + <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" /> + <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" /> + <Control Id="Description" Type="Text" X="25" Y="23" Width="340" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.LicenseAgreementDlgDescription)" /> + <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.LicenseAgreementDlgTitle)" /> + </Dialog> + </UI> + </Fragment> +</Wix> diff --git a/scripts/templates/WixUI_HK.wxs b/scripts/templates/WixUI_HK.wxs @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> + <Fragment> + + <UI Id="WixUI_HK"> + <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> + <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> + <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> + + <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" /> + <Property Id="WixUI_Mode" Value="InstallDir" /> + + <DialogRef Id="BrowseDlg" /> + <DialogRef Id="DiskCostDlg" /> + <DialogRef Id="ErrorDlg" /> + <DialogRef Id="FatalError" /> + <DialogRef Id="FilesInUse" /> + <DialogRef Id="MsiRMFilesInUse" /> + <DialogRef Id="PrepareDlg" /> + <DialogRef Id="ProgressDlg" /> + <DialogRef Id="ResumeDlg" /> + <DialogRef Id="UserExit" /> + + <!-- Make sure to include custom dialogs in the installer database via a DialogRef command, + especially if they are not included explicitly in the publish chain below --> + <DialogRef Id="LicenseAgreementDlg_HK"/> + + <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish> + <Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish> + + <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish> + + <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" + {{if gt (.License | len) 0}} + Value="LicenseAgreementDlg_HK" + {{else}} + Value="InstallDirDlg" + {{end}} + >NOT Installed</Publish> + <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish> + + <Publish Dialog="LicenseAgreementDlg_HK" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish> + <Publish Dialog="LicenseAgreementDlg_HK" Control="Next" Event="NewDialog" Value="InstallDirDlg">LicenseAccepted = "1"</Publish> + + <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg_HK">1</Publish> + <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish> + <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish> + <Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish> + <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish> + + <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish> + <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish> + + <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed</Publish> + + <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish> + + <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> + <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> + <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish> + </UI> + + <UIRef Id="WixUI_Common" /> + </Fragment> +</Wix> diff --git a/scripts/templates/choco/LICENSE.txt b/scripts/templates/choco/LICENSE.txt @@ -0,0 +1,9 @@ +From: {{.Choco.LicenseURL}} + +LICENSE + +{{if gt (.License | len) 0}} +{{.License | cat}} +{{else if gt (.Choco.LicenseURL | len) 0}} +{{.Choco.LicenseURL | download}} +{{end}} diff --git a/scripts/templates/choco/VERIFICATION.txt b/scripts/templates/choco/VERIFICATION.txt @@ -0,0 +1,10 @@ +VERIFICATION + +To check the checksum of this package, extract the msi file contained into it, +then run + + checksum.exe {{.Choco.MsiFile}} -t=sha256 + +The result must match + + {{.Choco.MsiSum | upper}} diff --git a/scripts/templates/choco/chocolateyInstall.ps1 b/scripts/templates/choco/chocolateyInstall.ps1 @@ -0,0 +1,7 @@ +$packageName = '{{.Choco.ID}}' +$fileType = 'msi' +$silentArgs = '/quiet'; +$scriptPath = $(Split-Path $MyInvocation.MyCommand.Path); +$fileFullPath = Join-Path $scriptPath '{{.Choco.MsiFile}}'; + +Install-ChocolateyInstallPackage $packageName $fileType $silentArgs $fileFullPath -checksum '{{.Choco.MsiSum}}' -checksumType = 'sha256' diff --git a/scripts/templates/choco/chocolateyUninstall.ps1 b/scripts/templates/choco/chocolateyUninstall.ps1 @@ -0,0 +1,6 @@ +$packageName = "{{.Choco.ID}}"; +$fileType = 'msi'; +$scriptPath = $(Split-Path $MyInvocation.MyCommand.Path); +$fileFullPath = Join-Path $scriptPath '{{.Choco.MsiFile}}'; + +Uninstall-ChocolateyPackage $packageName $fileType "$fileFullPath /q" diff --git a/scripts/templates/choco/pkg.nuspec b/scripts/templates/choco/pkg.nuspec @@ -0,0 +1,38 @@ +<?xml version="1.0"?> +<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <metadata> + <id>{{.Choco.ID}}</id> + <title>{{.Choco.Title}}</title> + <version>{{.VersionOk}}</version> + <authors>{{.Choco.Authors}}</authors> + <owners>{{.Choco.Owners}}</owners> + <description>{{.Choco.Description}}</description> + {{if gt (.Choco.ProjectURL | len) 0}} + <projectUrl>{{.Choco.ProjectURL}}</projectUrl> + {{end}} + {{if gt (.Choco.Tags | len) 0}} + <tags>{{.Choco.Tags}}</tags> + {{end}} + {{if gt (.Choco.LicenseURL | len) 0}} + <licenseUrl>{{.Choco.LicenseURL}}</licenseUrl> + {{end}} + {{if gt (.Choco.IconURL | len) 0}} + <iconUrl>{{.Choco.IconURL}}</iconUrl> + {{end}} + {{if gt (.Choco.ChangeLog | len) 0}} + <releaseNotes>{{.Choco.ChangeLog}}</releaseNotes> + {{end}} + {{if .Choco.RequireLicense}} + <requireLicenseAcceptance>true</requireLicenseAcceptance> + {{else}} + <requireLicenseAcceptance>false</requireLicenseAcceptance> + {{end}} + </metadata> + <files> + <file src="{{.Choco.BuildDir}}\chocolateyInstall.ps1" target="tools" /> + <file src="{{.Choco.BuildDir}}\chocolateyUninstall.ps1" target="tools" /> + <file src="{{.Choco.BuildDir}}\{{.Choco.MsiFile}}" target="tools" /> + <file src="{{.Choco.BuildDir}}\LICENSE.txt" target="tools" /> + <file src="{{.Choco.BuildDir}}\VERIFICATION.txt" target="tools" /> + </files> +</package> diff --git a/scripts/templates/product.wxs b/scripts/templates/product.wxs @@ -0,0 +1,159 @@ +<?xml version="1.0"?> + +<?if $(sys.BUILDARCH)="x86"?> + <?define Program_Files="ProgramFilesFolder"?> +<?elseif $(sys.BUILDARCH)="x64"?> + <?define Program_Files="ProgramFiles64Folder"?> +<?else?> + <?error Unsupported value of sys.BUILDARCH=$(sys.BUILDARCH)?> +<?endif?> + +<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> + + <Product Id="*" UpgradeCode="{{.UpgradeCode}}" + Name="{{.Product}}" + Version="{{.VersionOk}}" + Manufacturer="{{.Company}}" + Language="1033"> + + <Package InstallerVersion="200" Compressed="yes" Comments="Windows Installer Package" InstallScope="perMachine"/> + + <Media Id="1" Cabinet="product.cab" EmbedCab="yes"/> + + <Upgrade Id="{{.UpgradeCode}}"> + <UpgradeVersion Minimum="{{.VersionOk}}" OnlyDetect="yes" Property="NEWERVERSIONDETECTED"/> + <UpgradeVersion Minimum="0.0.0" Maximum="{{.VersionOk}}" IncludeMinimum="yes" IncludeMaximum="no" + Property="OLDERVERSIONBEINGUPGRADED"/> + </Upgrade> + <Condition Message="A newer version of this software is already installed.">NOT NEWERVERSIONDETECTED</Condition> + + <Directory Id="TARGETDIR" Name="SourceDir"> + + <Directory Id="$(var.Program_Files)"> + <Directory Id="INSTALLDIR" Name="{{.Product}}"> + {{if gt (.Files.Items | len) 0}} + <Component Id="ApplicationFiles" Guid="{{.Files.GUID}}"> + {{range $i, $e := .Files.Items}} + <File Id="ApplicationFile{{$i}}" Source="{{$e}}"/> + {{end}} + </Component> + {{end}} + {{if gt (.Directories | len) 0}} + {{range $i, $e := .Directories}} + <Directory Id="APPDIR{{$i}}" Name="{{$e}}" /> + {{end}} + {{end}} + </Directory> + </Directory> + + {{if gt (.Env.Vars | len) 0}} + <Component Id="ENVS" Guid="{{.Env.GUID}}"> + {{range $i, $e := .Env.Vars}} + <Environment Id="ENV{{$i}}" + Name="{{$e.Name}}" + Value="{{$e.Value}}" + Permanent="{{$e.Permanent}}" + Part="{{$e.Part}}" + Action="{{$e.Action}}" + System="{{$e.System}}" /> + {{end}} + </Component> + {{end}} + + {{if gt (.Shortcuts.Items | len) 0}} + <Directory Id="ProgramMenuFolder"> + <Directory Id="ApplicationProgramsFolder" Name="{{.Product}}"> + <Component Id="ApplicationShortcut" Guid="6743f868-7229-4caa-9064-d05ee7fca371"> + {{range $i, $e := .Shortcuts.Items}} + <Shortcut Id="ApplicationStartMenuShortcut" + Name="{{$e.Name}}" + Description="{{$e.Description}}" + Target="{{$e.Target}}" + WorkingDirectory="{{$e.WDir}}" + > + <Icon Id="Icon{{$i}}_Menu" SourceFile="{{$e.Icon}}" /> + </Shortcut> + <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/> + <RegistryValue Root="HKCU" + Key="Software\{{$.Company}}\{{$.Product}}" + Name="installed{{$i}}" + Type="integer" Value="1" KeyPath="yes"/> + {{end}} + </Component> + </Directory> + <Directory Id="ProgramMenuSubfolder" Name="{{.Product}}"> + <Component Id="ApplicationShortcuts" Guid="{{.Shortcuts.GUID}}"> + {{range $i, $e := .Shortcuts.Items}} + <Shortcut Id="ApplicationShortcut{{$i}}" + Name="{{$e.Name}}" + Description="{{$e.Description}}" + Target="{{$e.Target}}" + WorkingDirectory="{{$e.WDir}}" + {{if gt ($e.Arguments | len) 0}} + Arguments="{{$e.Arguments}}" + {{end}} + > + {{if gt ($e.Icon | len) 0}} + <Icon Id="Icon{{$i}}" SourceFile="{{$e.Icon}}" /> + {{end}} + </Shortcut> + <RegistryValue Root="HKCU" + Key="Software\{{$.Company}}\{{$.Product}}" + Name="installed{{$i}}" + Type="integer" Value="1" KeyPath="yes"/> + {{end}} + <RemoveFolder Id="ProgramMenuSubfolder" On="uninstall"/> + </Component> + </Directory> + </Directory> + {{end}} + + </Directory> + + {{range $i, $e := .InstallHooks}} + <SetProperty Id="CustomInstallExec{{$i}}" Value="{{$e.CookedCommand}}" Before="CustomInstallExec{{$i}}" Sequence="execute"/> + <CustomAction Id="CustomInstallExec{{$i}}" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="check" Impersonate="no"/> + {{end}} + {{range $i, $e := .UninstallHooks}} + <SetProperty Id="CustomUninstallExec{{$i}}" Value="{{$e.CookedCommand}}" Before="CustomUninstallExec{{$i}}" Sequence="execute"/> + <CustomAction Id="CustomUninstallExec{{$i}}" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="check" Impersonate="no"/> + {{end}} + <InstallExecuteSequence> + <RemoveExistingProducts After="InstallValidate"/> + {{range $i, $e := .InstallHooks}} + <Custom Action="CustomInstallExec{{$i}}" After="{{if eq $i 0}}InstallFiles{{else}}CustomInstallExec{{dec $i}}{{end}}">NOT Installed AND NOT REMOVE</Custom> + {{end}} + {{range $i, $e := .UninstallHooks}} + <Custom Action="CustomUninstallExec{{$i}}" After="{{if eq $i 0}}InstallInitialize{{else}}CustomUninstallExec{{dec $i}}{{end}}">REMOVE ~= "ALL"</Custom> + {{end}} + </InstallExecuteSequence> + + <Feature Id="DefaultFeature" Level="1"> + {{if gt (.Env.Vars | len) 0}} + <ComponentRef Id="ENVS"/> + {{end}} + {{if gt (.Files.Items | len) 0}} + <ComponentRef Id="ApplicationFiles"/> + {{end}} + {{if gt (.Shortcuts.Items | len) 0}} + <ComponentRef Id="ApplicationShortcuts"/> + {{end}} + {{range $i, $e := .Directories}} + <ComponentGroupRef Id="AppFiles{{$i}}" /> + {{end}} + <ComponentRef Id="ApplicationShortcut" /> + </Feature> + + <UI> + <!-- Define the installer UI --> + <UIRef Id="WixUI_HK" /> + </UI> + + <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" /> + + <!-- this should help to propagate env var changes --> + <CustomActionRef Id="WixBroadcastEnvironmentChange" /> + + </Product> + +</Wix> diff --git a/wix.json b/wix.json @@ -0,0 +1,44 @@ +{ + "product": "Morpheusv2", + "company": "Nordgedanken", + "license": "LICENSE", + "upgrade-code": "07ea6b62-c4cd-4154-9120-a159f90d4e96", + "files": { + "guid": "f872c0e3-2cf5-4bee-a961-7a8bf145cf89", + "items": [ + "Morpheusv2.exe" + ] + }, + "env": { + "guid": "417a48b3-e40b-4909-8e70-34de45576a29", + "vars": [ + { + "name": "PATH", + "value": "[INSTALLDIR]", + "permanent": "no", + "system": "no", + "action": "set", + "part": "last" + } + ] + }, + "shortcuts": { + "guid": "6743f868-7229-4caa-9064-d05ee7fca370", + "items": [ + { + "name": "Morpheusv2", + "description": "A Matrix client written in Go-QT", + "target": "[INSTALLDIR]\\Morpheusv2.exe", + "wdir": "INSTALLDIR", + "arguments": "", + "icon": "morpheus.ico" + } + ] + }, + "choco": { + "description": "A Matrix client written in Go-QT", + "project-url": "https://github.com/Nordgedanken/Morpheusv2", + "tags": "matrix chat go client", + "license-url": "https://github.com/Nordgedanken/Morpheusv2/blob/master/LICENSE" + } +} +\ No newline at end of file