From: David Llewellyn-Jones Date: Sun, 30 Mar 2014 00:38:10 +0000 (+0000) Subject: Added About page. X-Git-Url: https://www.flypig.org.uk/git/?p=openvpnui.git;a=commitdiff_plain;h=93e2321f381ed34de36c088a4f50a7550e148652 Added About page. --- diff --git a/OpenVPNUI.desktop b/OpenVPNUI.desktop deleted file mode 100644 index 245e577..0000000 --- a/OpenVPNUI.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Application -X-Nemo-Application-Type=silica-qt5 -Name=OpenVPNUI -Icon=OpenVPNUI -Exec=OpenVPNUI - diff --git a/OpenVPNUI.png b/OpenVPNUI.png deleted file mode 100644 index 4c883a0..0000000 Binary files a/OpenVPNUI.png and /dev/null differ diff --git a/OpenVPNUI.pro b/OpenVPNUI.pro index b0eed47..e1e09ae 100644 --- a/OpenVPNUI.pro +++ b/OpenVPNUI.pro @@ -6,11 +6,11 @@ # - desktop icon filename must be changed # - desktop filename must be changed # - icon definition filename in desktop file must be changed -TARGET = OpenVPNUI +TARGET = harbour-openvpn-rig CONFIG += sailfishapp -SOURCES += src/OpenVPNUI.cpp \ +SOURCES += \ src/vpncontrol.cpp \ src/filebrowse/searchworker.cpp \ src/filebrowse/searchengine.cpp \ @@ -18,13 +18,12 @@ SOURCES += src/OpenVPNUI.cpp \ src/filebrowse/fileworker.cpp \ src/filebrowse/filemodel.cpp \ src/filebrowse/fileinfo.cpp \ - src/filebrowse/engine.cpp + src/filebrowse/engine.cpp \ + src/openvpn-rig.cpp -OTHER_FILES += qml/OpenVPNUI.qml \ +OTHER_FILES += qml/harbour-openvpn-rig.qml \ qml/cover/CoverPage.qml \ - rpm/OpenVPNUI.spec \ - rpm/OpenVPNUI.yaml \ - OpenVPNUI.desktop \ + rpm/harbour-openvpn-rig.spec \ qml/pages/ConnectPage.qml \ qml/pages/ConfigurePage.qml \ OpenVPN-help.txt \ @@ -60,7 +59,6 @@ OTHER_FILES += qml/OpenVPNUI.qml \ qml/filebrowse/pages/DirectoryPage.qml \ qml/filebrowse/pages/CreateFolderDialog.qml \ qml/filebrowse/pages/ConsolePage.qml \ - qml/filebrowse/pages/AboutPage.qml \ qml/filebrowse/components/Spacer.qml \ qml/filebrowse/components/ProgressPanel.qml \ qml/filebrowse/components/NotificationPanel.qml \ @@ -70,7 +68,14 @@ OTHER_FILES += qml/OpenVPNUI.qml \ qml/filebrowse/components/DirPopup.qml \ qml/filebrowse/components/CenteredField.qml \ qml/components/ValueButtonAlignRight.qml \ - bin/ovpnpermit + bin/ovpnpermit \ + qml/harbour-openvpn-rig.qml \ + harbour-openvpn-rig.desktop \ + rpm/harbour-openvpn-rig.spec \ + rpm/harbour-openvpn-rig.yaml \ + qml/images/openvpn-rig.png \ + qml/images/ovpn-title.png \ + qml/pages/AboutPage.qml HEADERS += \ src/vpncontrol.h \ diff --git a/OpenVPNUI.pro.user b/OpenVPNUI.pro.user index c471047..e62ae15 100644 --- a/OpenVPNUI.pro.user +++ b/OpenVPNUI.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget @@ -54,7 +54,7 @@ MerSDK-SailfishOS-armv7hl MerSDK-SailfishOS-armv7hl {d2cef3cf-98e6-437c-a097-b7f269d12d9c} - 0 + 1 2 0 diff --git a/bin/ovpnpermit b/bin/ovpnpermit index 5f57070..bd19a0e 100755 Binary files a/bin/ovpnpermit and b/bin/ovpnpermit differ diff --git a/harbour-openvpn-rig.desktop b/harbour-openvpn-rig.desktop new file mode 100644 index 0000000..22dccc4 --- /dev/null +++ b/harbour-openvpn-rig.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +X-Nemo-Application-Type=silica-qt5 +Name=OpenVPN Rig +Icon=harbour-openvpn-rig +Exec=harbour-openvpn-rig + diff --git a/qml/OpenVPNUI.qml b/qml/OpenVPNUI.qml deleted file mode 100644 index 0e2e5f5..0000000 --- a/qml/OpenVPNUI.qml +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2014 David Llewellyn-Jones - Contact: David Llewellyn-Jones - All rights reserved. - - You may use this file under the terms of BSD license as follows: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Jolla Ltd nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - Built using the standard template from Jolla - Copyright (C) 2013 Jolla Ltd. - Contact: Thomas Perl -*/ - -import QtQuick 2.0 -import Sailfish.Silica 1.0 -import "pages" - -ApplicationWindow -{ - initialPage: Qt.resolvedUrl("pages/ConnectPage.qml") - cover: Qt.resolvedUrl("cover/CoverPage.qml") -} - - diff --git a/qml/filebrowse/pages/AboutPage.qml b/qml/filebrowse/pages/AboutPage.qml deleted file mode 100644 index c3f3701..0000000 --- a/qml/filebrowse/pages/AboutPage.qml +++ /dev/null @@ -1,58 +0,0 @@ -import QtQuick 2.0 -import Sailfish.Silica 1.0 - -Page { - id: page - allowedOrientations: Orientation.All - - SilicaFlickable { - id: flickable - anchors.fill: parent - contentHeight: column.height - VerticalScrollDecorator { flickable: flickable } - - Column { - id: column - anchors.left: parent.left - anchors.right: parent.right - anchors.leftMargin: Theme.paddingLarge - anchors.rightMargin: Theme.paddingLarge - - PageHeader { title: qsTr("Public Domain") } - - Label { - width: parent.width - wrapMode: Text.Wrap - font.pixelSize: Theme.fontSizeSmall - color: Theme.highlightColor - text: "This is free and unencumbered software released into the public domain."+ - "\n\n"+ - "Anyone is free to copy, modify, publish, use, compile, sell, or "+ - "distribute this software, either in source code form or as a compiled "+ - "binary, for any purpose, commercial or non-commercial, and by any "+ - "means."+ - "\n\n"+ - "In jurisdictions that recognize copyright laws, the author or authors "+ - "of this software dedicate any and all copyright interest in the "+ - "software to the public domain. We make this dedication for the benefit "+ - "of the public at large and to the detriment of our heirs and "+ - "successors. We intend this dedication to be an overt act of "+ - "relinquishment in perpetuity of all present and future rights to this "+ - "software under copyright law."+ - "\n\n"+ - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, "+ - "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF "+ - "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. "+ - "IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR "+ - "OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, "+ - "ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR "+ - "OTHER DEALINGS IN THE SOFTWARE."+ - "\n\n"+ - "For more information, please refer to " - } - } - } - -} - - diff --git a/qml/harbour-openvpn-rig.qml b/qml/harbour-openvpn-rig.qml new file mode 100644 index 0000000..0e2e5f5 --- /dev/null +++ b/qml/harbour-openvpn-rig.qml @@ -0,0 +1,45 @@ +/* + Copyright (C) 2014 David Llewellyn-Jones + Contact: David Llewellyn-Jones + All rights reserved. + + You may use this file under the terms of BSD license as follows: + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Jolla Ltd nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Built using the standard template from Jolla + Copyright (C) 2013 Jolla Ltd. + Contact: Thomas Perl +*/ + +import QtQuick 2.0 +import Sailfish.Silica 1.0 +import "pages" + +ApplicationWindow +{ + initialPage: Qt.resolvedUrl("pages/ConnectPage.qml") + cover: Qt.resolvedUrl("cover/CoverPage.qml") +} + + diff --git a/qml/images/openvpn-rig.png b/qml/images/openvpn-rig.png new file mode 100644 index 0000000..ea08e45 Binary files /dev/null and b/qml/images/openvpn-rig.png differ diff --git a/qml/images/ovpn-title.png b/qml/images/ovpn-title.png new file mode 100644 index 0000000..af86e1f Binary files /dev/null and b/qml/images/ovpn-title.png differ diff --git a/qml/pages/AboutPage.qml b/qml/pages/AboutPage.qml new file mode 100644 index 0000000..da6fabb --- /dev/null +++ b/qml/pages/AboutPage.qml @@ -0,0 +1,182 @@ +/* + Copyright (C) 2014 David Llewellyn-Jones + Contact: David Llewellyn-Jones + All rights reserved. + + You may use this file under the terms of BSD license as follows: + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Jolla Ltd nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Built using the standard template from Jolla + Copyright (C) 2013 Jolla Ltd. + Contact: Thomas Perl +*/ + +import QtQuick 2.0 +import Sailfish.Silica 1.0 + +Page { + id: aboutPage + + SilicaFlickable { + width: parent.width + height: parent.height + interactive: true + + anchors.fill: parent + contentHeight: aboutColumn.height + Theme.paddingLarge + + VerticalScrollDecorator {} + + Column { + id: aboutColumn + width: parent.width + spacing: Theme.paddingLarge + + PageHeader { + title: "About OpenVPN Rig" + } + + Image { + width: 452 + height: 86 + anchors.topMargin: Theme.paddingLarge + anchors.horizontalCenter: parent.horizontalCenter + source : "../images/ovpn-title.png" + } + + Label { + text: "OpenVPN client configuration" + wrapMode: Text.WordWrap + font.pixelSize: Theme.fontSizeSmall + anchors { + leftMargin: Theme.paddingLarge + rightMargin: Theme.paddingLarge + left: parent.left + right: parent.right + } + } + Label { + text: "Version:\t0.5.0" + wrapMode: Text.WordWrap + font.pixelSize: Theme.fontSizeSmall + horizontalAlignment: Text.AlignLeft + anchors { + leftMargin: Theme.paddingLarge + rightMargin: Theme.paddingLarge + left: parent.left + right: parent.right + } + } + Label { + text: "Author:\tDavid Llewellyn-Jones" + wrapMode: Text.WordWrap + font.pixelSize: Theme.fontSizeSmall + horizontalAlignment: Text.AlignLeft + anchors { + leftMargin: Theme.paddingLarge + rightMargin: Theme.paddingLarge + left: parent.left + right: parent.right + } + } + Label { + text: "Licence:\tBSD" + wrapMode: Text.WordWrap + font.pixelSize: Theme.fontSizeSmall + horizontalAlignment: Text.AlignLeft + anchors { + leftMargin: Theme.paddingLarge + rightMargin: Theme.paddingLarge + left: parent.left + right: parent.right + } + } + Label { + text: "Credits" + color: Theme.highlightColor + font.family: Theme.fontFamilyHeading + horizontalAlignment: Text.AlignRight + anchors { + margins: Theme.paddingLarge + left: parent.left + right: parent.right + } + } + + Label { + text: "File Browser code by Kari with public domain licence" + wrapMode: Text.WordWrap + font.pixelSize: Theme.fontSizeSmall + anchors { + leftMargin: Theme.paddingLarge + rightMargin: Theme.paddingLarge + left: parent.left + right: parent.right + } + } + + Label { + text: "OpenVPN and the OpenVPN logo are trademarks of OpenVPN Technologies, Inc." + wrapMode: Text.WordWrap + font.pixelSize: Theme.fontSizeSmall + anchors { + leftMargin: Theme.paddingLarge + rightMargin: Theme.paddingLarge + left: parent.left + right: parent.right + } + } + + Label { + text: "Links" + color: Theme.highlightColor + font.family: Theme.fontFamilyHeading + horizontalAlignment: Text.AlignRight + anchors { + margins: Theme.paddingLarge + left: parent.left + right: parent.right + } + } + + Row { + spacing: Theme.paddingLarge + anchors.horizontalCenter: parent.horizontalCenter + Button { + id: connect + text: "Website" + enabled: true + onClicked: Qt.openUrlExternally("http://www.flypig.co.uk/?to=openvpnrig") + } + Button { + id : disconnect + text: "Email" + enabled: true + onClicked: Qt.openUrlExternally("mailto:david@flypig.co.uk") + } + } + } + } + +} diff --git a/qml/pages/ConnectPage.qml b/qml/pages/ConnectPage.qml index 08cbdb6..c0175f4 100644 --- a/qml/pages/ConnectPage.qml +++ b/qml/pages/ConnectPage.qml @@ -92,6 +92,10 @@ Page { // PullDownMenu and PushUpMenu must be declared in SilicaFlickable, SilicaListView or SilicaGridView PullDownMenu { + MenuItem { + text: "About" + onClicked: pageStack.push(Qt.resolvedUrl("AboutPage.qml")) + } MenuItem { text: "Configure" onClicked: pageStack.push(Qt.resolvedUrl("ConfigurePage.qml")) @@ -113,7 +117,7 @@ Page { spacing: Theme.paddingLarge PageHeader { - title: "OpenVPN Control" + title: "OpenVPN Rig" } Row { spacing: Theme.paddingLarge diff --git a/rpm/OpenVPNUI.spec b/rpm/OpenVPNUI.spec deleted file mode 100644 index 25569f4..0000000 --- a/rpm/OpenVPNUI.spec +++ /dev/null @@ -1,77 +0,0 @@ -# -# Do NOT Edit the Auto-generated Part! -# Generated by: spectacle version 0.27 -# - -Name: OpenVPNUI - -# >> macros -# << macros - -%{!?qtc_qmake:%define qtc_qmake %qmake} -%{!?qtc_qmake5:%define qtc_qmake5 %qmake5} -%{!?qtc_make:%define qtc_make make} -%{?qtc_builddir:%define _builddir %qtc_builddir} -Summary: OpenVPN User Interface -Version: 0.1 -Release: 1 -Group: Qt/Qt -License: BSD Licence -URL: http://example.org/ -Source0: %{name}-%{version}.tar.bz2 -Source100: OpenVPNUI.yaml -Requires: sailfishsilica-qt5 >= 0.10.9 -BuildRequires: pkgconfig(sailfishapp) >= 0.0.10 -BuildRequires: pkgconfig(Qt5Core) -BuildRequires: pkgconfig(Qt5Qml) -BuildRequires: pkgconfig(Qt5Quick) -BuildRequires: desktop-file-utils - -%description -Short description of my SailfishOS Application - - -%prep -%setup -q -n %{name}-%{version} - -# >> setup -# << setup - -%build -# >> build pre -# << build pre - -%qtc_qmake5 - -%qtc_make %{?_smp_mflags} - -# >> build post -# << build post - -%install -rm -rf %{buildroot} -# >> install pre -# << install pre -%qmake5_install - -# >> install post -# << install post - -desktop-file-install --delete-original \ - --dir %{buildroot}%{_datadir}/applications \ - %{buildroot}%{_datadir}/applications/*.desktop - -%files -%defattr(-,root,root,-) -/usr/share/icons/hicolor/86x86/apps -/usr/share/applications -/usr/share/OpenVPNUI -/usr/bin -%attr(4755,root,root) %{_datadir}/%{name}/bin/ovpnpermit -%{_datadir}/%{name}/bin -%{_datadir}/icons/hicolor/86x86/apps/%{name}.png -%{_datadir}/applications/%{name}.desktop -%{_datadir}/%{name}/qml -%{_bindir} -# >> files -# << files diff --git a/rpm/OpenVPNUI.yaml b/rpm/OpenVPNUI.yaml deleted file mode 100644 index e899975..0000000 --- a/rpm/OpenVPNUI.yaml +++ /dev/null @@ -1,32 +0,0 @@ -Name: OpenVPNUI -Summary: OpenVPN User Interface -Version: 0.1 -Release: 1 -Group: Qt/Qt -URL: http://example.org/ -License: "BSD Licence" -Sources: -- '%{name}-%{version}.tar.bz2' -Description: | - Short description of my SailfishOS Application -Configure: none -Builder: qtc5 -PkgConfigBR: -- sailfishapp >= 0.0.10 -- Qt5Core -- Qt5Qml -- Qt5Quick -Requires: -- sailfishsilica-qt5 >= 0.10.9 -Files: -- /usr/share/icons/hicolor/86x86/apps -- /usr/share/applications -- /usr/share/OpenVPNUI -- /usr/bin -- '%attr(4755,root,root) %{_datadir}/%{name}/bin/ovpnpermit' -- '%{_datadir}/%{name}/bin' -- '%{_datadir}/icons/hicolor/86x86/apps/%{name}.png' -- '%{_datadir}/applications/%{name}.desktop' -- '%{_datadir}/%{name}/qml' -- '%{_bindir}' -PkgBR: [] diff --git a/rpm/harbour-openvpn-rig.spec b/rpm/harbour-openvpn-rig.spec new file mode 100644 index 0000000..2e30e4f --- /dev/null +++ b/rpm/harbour-openvpn-rig.spec @@ -0,0 +1,78 @@ +# +# Do NOT Edit the Auto-generated Part! +# Generated by: spectacle version 0.27 +# + +Name: harbour-openvpn-rig + +# >> macros +# << macros + +%{!?qtc_qmake:%define qtc_qmake %qmake} +%{!?qtc_qmake5:%define qtc_qmake5 %qmake5} +%{!?qtc_make:%define qtc_make make} +%{?qtc_builddir:%define _builddir %qtc_builddir} +Summary: OpenVPN User Interface +Version: 0.1 +Release: 1 +Group: Qt/Qt +License: BSD Licence +URL: http://example.org/ +Source0: %{name}-%{version}.tar.bz2 +Source100: harbour-openvpn-rig.yaml +Requires: sailfishsilica-qt5 >= 0.10.9 +Requires: openvpn >= 2.2.2 +BuildRequires: pkgconfig(Qt5Quick) +BuildRequires: pkgconfig(Qt5Qml) +BuildRequires: pkgconfig(Qt5Core) +BuildRequires: pkgconfig(sailfishapp) >= 0.0.10 +BuildRequires: desktop-file-utils + +%description +Short description of my SailfishOS Application + + +%prep +%setup -q -n %{name}-%{version} + +# >> setup +# << setup + +%build +# >> build pre +# << build pre + +%qtc_qmake5 + +%qtc_make %{?_smp_mflags} + +# >> build post +# << build post + +%install +rm -rf %{buildroot} +# >> install pre +# << install pre +%qmake5_install + +# >> install post +# << install post + +desktop-file-install --delete-original \ + --dir %{buildroot}%{_datadir}/applications \ + %{buildroot}%{_datadir}/applications/*.desktop + +%files +%defattr(-,root,root,-) +%{_bindir} +%{_datadir}/%{name}/qml +%{_datadir}/applications/%{name}.desktop +%{_datadir}/icons/hicolor/86x86/apps/%{name}.png +%{_datadir}/%{name}/bin +%attr(4755,root,root) %{_datadir}/%{name}/bin/ovpnpermit +/usr/bin +/usr/share/harbour-openvpn-rig +/usr/share/applications +/usr/share/icons/hicolor/86x86/apps +# >> files +# << files diff --git a/rpm/harbour-openvpn-rig.yaml b/rpm/harbour-openvpn-rig.yaml new file mode 100644 index 0000000..33b4ca5 --- /dev/null +++ b/rpm/harbour-openvpn-rig.yaml @@ -0,0 +1,33 @@ +Name: harbour-openvpn-rig +Summary: OpenVPN User Interface +Version: 0.1 +Release: 1 +Group: Qt/Qt +URL: http://example.org/ +License: "BSD Licence" +Sources: +- '%{name}-%{version}.tar.bz2' +Description: | + Short description of my SailfishOS Application +Configure: none +Builder: qtc5 +PkgConfigBR: +- Qt5Quick +- Qt5Qml +- Qt5Core +- sailfishapp >= 0.0.10 +Requires: +- sailfishsilica-qt5 >= 0.10.9 +- openvpn >= 2.2.2 +Files: +- '%{_bindir}' +- '%{_datadir}/%{name}/qml' +- '%{_datadir}/applications/%{name}.desktop' +- '%{_datadir}/icons/hicolor/86x86/apps/%{name}.png' +- '%{_datadir}/%{name}/bin' +- '%attr(4755,root,root) %{_datadir}/%{name}/bin/ovpnpermit' +- /usr/bin +- /usr/share/harbour-openvpn-rig +- /usr/share/applications +- /usr/share/icons/hicolor/86x86/apps +PkgBR: [] diff --git a/src/OpenVPNUI.cpp b/src/OpenVPNUI.cpp deleted file mode 100644 index 2df2800..0000000 --- a/src/OpenVPNUI.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - Copyright (C) 2014 David Llewellyn-Jones - Contact: David Llewellyn-Jones - All rights reserved. - - You may use this file under the terms of BSD license as follows: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Jolla Ltd nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - Built using the standard template from Jolla - Copyright (C) 2013 Jolla Ltd. - Contact: Thomas Perl -*/ - -#ifdef QT_QML_DEBUG -#include -#endif - -#include -#include "vpncontrol.h" -#include "filemodel.h" -#include "fileinfo.h" -#include "searchengine.h" -#include "engine.h" - -int main(int argc, char *argv[]) -{ - qmlRegisterType("harbour.file.browser.FileModel", 1, 0, "FileModel"); - qmlRegisterType("harbour.file.browser.FileInfo", 1, 0, "FileInfo"); - qmlRegisterType("harbour.file.browser.SearchEngine", 1, 0, "SearchEngine"); - - int result; - - setuid(0); - seteuid(0); - - // SailfishApp::main() will display "qml/template.qml", if you need more - // control over initialization, you can use: - // - // - SailfishApp::application(int, char *[]) to get the QGuiApplication * - // - SailfishApp::createView() to get a new QQuickView * instance - // - SailfishApp::pathTo(QString) to get a QUrl to a resource file - // - // To display the view, call "show()" (will show fullscreen on device). - - QScopedPointer app(SailfishApp::application(argc, argv)); - - // These values are used by QSettings to access the config file in - // /home/nemo/.local/share/flypig/OpenVPNUI.conf - QCoreApplication::setOrganizationName("flypig"); - QCoreApplication::setOrganizationDomain("www.flypig.co.uk"); - QCoreApplication::setApplicationName("OpenVPNUI"); - - QScopedPointer view(SailfishApp::createView()); - - view->setSource(SailfishApp::pathTo("qml/OpenVPNUI.qml")); - - VPNControl * vpnControl = new VPNControl (); - - view->rootContext()->setContextProperty("VpnControl", vpnControl); - - vpnControl->initialise(); - - // QML global engine object - QScopedPointer engine(new Engine); - view->rootContext()->setContextProperty("engine", engine.data()); - // Store pointer to engine to access it in any class - QVariant engineVariant = qVariantFromValue(engine.data()); - qApp->setProperty("engine", engineVariant); - - // Run the application loop - view->show(); - result = app->exec(); - - delete vpnControl; - - return result; -} - diff --git a/src/openvpn-rig.cpp b/src/openvpn-rig.cpp new file mode 100644 index 0000000..adfb69b --- /dev/null +++ b/src/openvpn-rig.cpp @@ -0,0 +1,101 @@ +/* + Copyright (C) 2014 David Llewellyn-Jones + Contact: David Llewellyn-Jones + All rights reserved. + + You may use this file under the terms of BSD license as follows: + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Jolla Ltd nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Built using the standard template from Jolla + Copyright (C) 2013 Jolla Ltd. + Contact: Thomas Perl +*/ + +#ifdef QT_QML_DEBUG +#include +#else +#include +#endif + +#include +#include "vpncontrol.h" +#include "filemodel.h" +#include "fileinfo.h" +#include "searchengine.h" +#include "engine.h" + +int main(int argc, char *argv[]) +{ + qmlRegisterType("harbour.file.browser.FileModel", 1, 0, "FileModel"); + qmlRegisterType("harbour.file.browser.FileInfo", 1, 0, "FileInfo"); + qmlRegisterType("harbour.file.browser.SearchEngine", 1, 0, "SearchEngine"); + + int result; + + setuid(0); + seteuid(0); + + // SailfishApp::main() will display "qml/template.qml", if you need more + // control over initialization, you can use: + // + // - SailfishApp::application(int, char *[]) to get the QGuiApplication * + // - SailfishApp::createView() to get a new QQuickView * instance + // - SailfishApp::pathTo(QString) to get a QUrl to a resource file + // + // To display the view, call "show()" (will show fullscreen on device). + + QScopedPointer app(SailfishApp::application(argc, argv)); + + // These values are used by QSettings to access the config file in + // /home/nemo/.local/share/flypig/OpenVPNUI.conf + QCoreApplication::setOrganizationName("flypig"); + QCoreApplication::setOrganizationDomain("www.flypig.co.uk"); + QCoreApplication::setApplicationName("OpenVPN Rig"); + + QScopedPointer view(SailfishApp::createView()); + + view->setSource(SailfishApp::pathTo("qml/harbour-openvpn-rig.qml")); + + VPNControl * vpnControl = new VPNControl (); + + view->rootContext()->setContextProperty("VpnControl", vpnControl); + + vpnControl->initialise(); + + // QML global engine object + QScopedPointer engine(new Engine); + view->rootContext()->setContextProperty("engine", engine.data()); + // Store pointer to engine to access it in any class + QVariant engineVariant = qVariantFromValue(engine.data()); + qApp->setProperty("engine", engineVariant); + + // Run the application loop + view->show(); + result = app->exec(); + + delete vpnControl; + + return result; +} + diff --git a/src/vpncontrol.cpp b/src/vpncontrol.cpp index 3f80913..d3ec771 100644 --- a/src/vpncontrol.cpp +++ b/src/vpncontrol.cpp @@ -211,7 +211,7 @@ void VPNControl::vpnConnect() { } else { vpnProcess = new QProcess(); - QString program = "/usr/share/OpenVPNUI/bin/ovpnpermit"; + QString program = "/usr/share/harbour-openvpn-rig/bin/ovpnpermit"; collectArguments (); vpnProcess->setReadChannel(QProcess::StandardOutput); connect(vpnProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(readError(QProcess::ProcessError)));