Skip to content

Commit 0d255b8

Browse files
authored
Merge pull request #234 from KumarLabJax/update-license-dialog
Update license dialog
2 parents 61c23ef + 82bd5a4 commit 0d255b8

File tree

3 files changed

+291
-23
lines changed

3 files changed

+291
-23
lines changed

src/jabs/resources/docs/LICENSE

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
PLATFORM LICENSE AGREEMENT
2+
FOR NON-COMMERCIAL USE
3+
4+
*Last Updated: May 10, 2021*
5+
6+
This Platform License Agreement (this “Agreement”) is made between you
7+
(“You,” “Your,” or “Licensee”) and The Jackson Laboratory (“Licensor”).
8+
This Agreement permits You to access and use the Licensed Platform
9+
subject to Your acceptance of all the terms and conditions contained in
10+
this Agreement. Please read this Agreement carefully. Your access to or
11+
use of the Licensed Platform shall be deemed Your acceptance of this
12+
Agreement. If You do not agree to any of the terms and conditions set
13+
forth in this Agreement, Licensor is unwilling to grant You the license
14+
contained in this Agreement and You should not access or use the
15+
Licensed Platform.
16+
17+
1. LICENSED PLATFORM
18+
19+
1.1 **Grant**. Subject to the terms and conditions of this Agreement,
20+
Licensor hereby grants to Licensee a worldwide, royalty-free,
21+
non-exclusive, non-transferable, non-sublicensable, revocable license to
22+
access and use the functionality of the Licensed Platform (and to
23+
download and use any downloadable software applications used to deliver
24+
the Licensed Platform on Your computer or mobile device) solely for
25+
Non-Commercial purposes. “Licensed Platform” means the latest version
26+
of Licensor’s behavioral extraction and classification platform made
27+
available to You, including animal pose estimation and extraction and
28+
behavioral classification tools, libraries, algorithms and other features,
29+
functionalities and services included therein or therewith, along with all
30+
websites and cloud-based and downloadable software applications used to
31+
deliver the foregoing. “Non-Commercial” means not intended or directed
32+
toward commercial advantage or monetary compensation.
33+
34+
1.2 **License Limitations**. Nothing in this Agreement shall be
35+
construed to confer any rights upon Licensee except as expressly granted
36+
herein. Licensee may not use or exploit the Licensed Platform other than
37+
as expressly permitted by this Agreement. Licensee may not, nor may
38+
Licensee permit any third party to, reproduce, distribute, publicly
39+
display, modify, translate, reverse engineer, decompile, disassemble or
40+
create derivative works based on the Licensed Platform or any portion
41+
thereof. Licensee acknowledges that Licensor reserves the right to offer
42+
to Licensee or any third party a license for commercial use and
43+
distribution of the Licensed Platform on terms and conditions different
44+
than those contained in this Agreement. If You are interested in
45+
commercial use of the Licensed Platform, please contact the Licensor.
46+
47+
1.3 **User Classifiers**. For avoidance of doubt, the license grant
48+
set forth in Section 1.1 and the license limitations set forth in
49+
Section 1.2 shall be read together to permit Your use of the Licensed
50+
Platform to develop animal behavioral classification algorithms and/or
51+
workflows (each a “User Classifier”), provided that (1) You may use such
52+
User Classifiers solely for Non-Commercial purposes, (2) You may not,
53+
without the prior written consent of Licensor, which Licensor may
54+
withhold in its sole discretion, use such User Classifiers for
55+
commercial purposes or distribute such User Classifiers, and (3) You
56+
hereby acknowledge and agree that Licensor may use such User Classifiers
57+
without obligation to You for Non-Commercial purposes and/or to improve
58+
the Licensed Platform. If You are interested in commercial use or
59+
distribution of any User Classifier, please contact Licensor.
60+
61+
1.4 **Ownership Rights**. Except for the limited license rights
62+
expressly granted to Licensee under this Agreement, Licensee
63+
acknowledges that Licensor (and its applicable licensors, if any)
64+
retains all right, title and interest, including all intellectual
65+
property and other proprietary rights, in and to the Licensed Platform,
66+
including any modifications of and derivative works based on the
67+
Licensed Platform.
68+
69+
1.5 **Feedback**. If You provide feedback or suggestions about the
70+
Licensed Platform, then Licensor may use such information without
71+
obligation to You.
72+
73+
2. USER DATA
74+
75+
2.1 **Grant**. You hereby grant to Licensor a perpetual,
76+
irrevocable, worldwide, royalty-free, non-exclusive license to access
77+
and use User Data solely to operate and improve the Licensed Platform.
78+
“User Data” means Input Data and Output Data. “Input Data” means the
79+
videos, images and other data uploaded or otherwise submitted by You to,
80+
or collected, downloaded or otherwise received from You by, the Licensed
81+
Platform. “Output Data” means data produced through processing of Input
82+
Data via the Licensed Platform.
83+
84+
2.2 **Ownership Rights**. Except for the limited license rights
85+
expressly granted to Licensor under this Agreement, Licensor
86+
acknowledges that Licensee (and its applicable licensors, if any)
87+
retains all right, title and interest, including all intellectual
88+
property and other proprietary rights, in and to User Data.
89+
90+
2.3 **Your Responsibility for Input Data**. You represent and
91+
warrant that: (i) You are the owner of the Input Data or otherwise have
92+
all necessary licenses, right, consents and permissions (including all
93+
permissions required under applicable privacy and intellectual property
94+
laws) to upload the Input Data to the Licensed Platform and to authorize
95+
Licensor to access and use the Input Data to operate the Licensed
96+
Platform; and (ii) such uploading, access and use does not and will not
97+
infringe, misappropriate or violate any third party’s intellectual
98+
property, privacy, publicity or other legal rights or violate any
99+
applicable law or regulation.
100+
101+
2.4 **Your Responsibility for Your Projects**. If You are the
102+
Project Manager with respect to a Project, then, as between You and
103+
Licensor, You are solely responsible for: (1) the acts and omissions of
104+
the Project Manager and Project Collaborators with respect to the
105+
Project, including their compliance with this Agreement, (2)
106+
establishing and enforcing any agreements and policies with Project
107+
Collaborators governing their activities with respect to the Project,
108+
including, for example, relating to maintenance of the confidentiality
109+
of User Data relating to the Project, (3) ensuring that the hosting and
110+
processing of User Data in connection with the Project is in compliance
111+
with all applicable laws, which may require obtaining consents,
112+
authorizations and other rights from third parties, and (4) responding
113+
to, defending and resolving any disputes relating to the Project.
114+
“Project” means a specific workflow and/or workspace organized within
115+
the Licensed Platform for purposes of coordinating and managing one or
116+
more permitted uses of the Licensed Platform. “Project Manager” means
117+
the user of the Licensed Platform who establishes, configures and
118+
administers a Project. “Project Collaborator” means any user of the
119+
Licensed Platform authorized to access and/or participate in a Project
120+
under the configurations managed by the Project Manager.
121+
122+
3. DISCLAIMER OF WARRANTY AND LIMITATION OF LIABILITY; INDEMNITY
123+
124+
3.1 **DISCLAIMER OF WARRANTY**. LICENSOR PROVIDES THE LICENSED PLATFORM
125+
ON A NO-FEE BASIS “AS IS” WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
126+
IMPLIED. LICENSOR EXPRESSLY DISCLAIMS ALL WARRANTIES OR CONDITIONS OF
127+
ANY KIND, INCLUDING ANY WARRANTY OF MERCHANTABILITY, TITLE, SECURITY,
128+
ACCURACY, NON-INFRINGEMENT OR FITNESS FOR A PARTICULAR PURPOSE. LICENSOR
129+
MAKES NO WARRANTY THAT THE LICENSED PLATFORM WILL MEET YOUR REQUIREMENTS
130+
OR BE AVAILABLE ON AN UNINTERRUPTED, SECURE, OR ERROR-FREE BASIS, OR
131+
THAT LICENSOR WILL CONTINUE TO OFFER OR MAKE AVAILABLE THE LICENSED
132+
PLATFORM FOR ANY PARTICULAR LENGTH OF TIME, AND LICENSOR RESERVES THE
133+
RIGHT TO CHANGE AND UPDATE THE LICENSED PLATFORM WITHOUT NOTICE TO YOU.
134+
LICENSOR MAKES NO WARRANTY REGARDING THE QUALITY OF ANY PRODUCTS,
135+
SERVICES OR CONTENT OBTAINED THROUGH THE LICENSED PLATFORM OR THE
136+
ACCURACY, TIMELINESS, TRUTHFULNESS, COMPLETENESS OR RELIABILITY OF ANY
137+
CONTENT OBTAINED THROUGH THE LICENSED PLATFORM. YOU ARE SOLELY
138+
RESPONSIBLE FOR ALL OF YOUR COMMUNICATIONS AND INTERACTIONS WITH OTHER
139+
USERS OF THE LICENSED PLATFORM AND WITH OTHER PERSONS WITH WHOM YOU
140+
COMMUNICATE OR INTERACT AS A RESULT OF YOUR USE OF THE LICENSED
141+
PLATFORM. THE FOREGOING DISCLAIMERS SHALL APPLY TO THE FULLEST EXTENT
142+
PERMITTED BY LAW, AND SHALL SURVIVE ANY TERMINATION OR EXPIRATION OF
143+
THIS AGREEMENT OR YOUR USE OF THE LICENSED PLATFORM.
144+
145+
3.2 **LIMITATION OF LIABILITY**. LICENSEE ASSUMES FULL RESPONSIBILITY
146+
AND RISK FOR ANY LOSS RESULTING FROM LICENSEE’S ACCESS TO AND USE OF THE
147+
LICENSED PLATFORM (INCLUDING YOUR DOWNLOADING AND USE OF ANY
148+
DOWNLOADABLE SOFTWARE APPLICATIONS USED TO DELIVER THE LICENSED
149+
PLATFORM). IN NO EVENT SHALL LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES
150+
OR OTHER LIABILITY, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
151+
ARISING FROM THE LICENSED PLATFORM OR LICENSEE’S USE OF THE LICENSED
152+
PLATFORM, REGARDLESS OF WHETHER LICENSOR IS ADVISED, OR HAS OTHER REASON
153+
TO KNOW, OR IN FACT KNOWS, OF THE POSSIBILITY OF THE FOREGOING. THE
154+
LIMITATIONS OF DAMAGES SET FORTH ABOVE ARE FUNDAMENTAL AND MATERIAL
155+
ELEMENTS OF THE BASIS OF THE BARGAIN BETWEEN LICENSOR AND LICENSEE, AND
156+
SHALL APPLY TO THE FULLEST EXTENT PERMITTED BY LAW, AND SHALL SURVIVE
157+
ANY TERMINATION OR EXPIRATION OF THIS AGREEMENT OR YOUR USE OF THE
158+
LICENSED PLATFORM.
159+
160+
3.3 **Acknowledgement**. Without limiting the generality of Sections
161+
3.1 and 3.2, Licensee acknowledges that the Licensed Platform is
162+
provided as an information resource only and should not be relied on for
163+
any diagnostic or treatment purposes.
164+
165+
3.4 **Indemnity**. You agree to defend, indemnify, and hold Licensor,
166+
its subsidiaries and affiliates, and their officers, directors,
167+
employees, agents, representatives and attorneys harmless from and
168+
against any claims, liabilities, damages, losses, and expenses,
169+
including, without limitation, reasonable legal and accounting fees,
170+
arising out of or in any way connected with (i) Your access to or use of
171+
the Licensed Platform; (ii) Your violation of this Agreement; and/or
172+
(iii) Your violation of any third-party right, including without
173+
limitation any intellectual property or other proprietary right. The
174+
indemnification obligations under this section shall survive the
175+
termination or expiration of this Agreement or Your use of the Licensed
176+
Platform.
177+
178+
4. TERM AND TERMINATION
179+
180+
4.1 **Term**. This Agreement commences on the date on which You first
181+
access or use the Licensed Platform and will continue until terminated
182+
in accordance with Section 4.2.
183+
184+
4.2 **Termination**. If Licensee breaches any provision hereunder, or
185+
otherwise engages in any unauthorized or objectionable use of the
186+
Licensed Platform, or if Licensor ceases to provide or support the
187+
Licensed Platform, Licensor may terminate this Agreement immediately,
188+
and You shall not be entitled to any refunds, credits or other
189+
consideration. Licensee may terminate this Agreement at any time upon
190+
written notice to Licensor. Upon termination, the license granted under
191+
Section 1 will terminate and Licensee will immediately cease using the
192+
Licensed Platform and destroy all copies of any downloadable software
193+
applications used to deliver the Licensed Platform in its possession.
194+
Licensee will certify in writing that it has complied with the foregoing
195+
obligation.
196+
197+
5. MISCELLANEOUS
198+
199+
5.1 **Future Updates and Modification**. Licensor reserves the right,
200+
at its sole discretion, to modify, discontinue or terminate the Licensed
201+
Platform or to modify this Agreement, at any time and without prior
202+
notice. If we modify this Agreement, we will post the modification via
203+
the Licensed Platform or provide You with notice of the modification. We
204+
will also update the “Last Updated” date at the top of this Agreement.
205+
By continuing to access or use the Licensed Platform after we have
206+
posted a modification via the Licensed Platform or have provided You
207+
with notice of a modification, You are indicating that Your agreement
208+
and express consent to be bound by the modified Agreement. You may also
209+
be asked to re-acknowledge and re-accept the Agreement following any
210+
material changes. If the modified Agreement is not acceptable to You,
211+
You may cease using the Licensed Platform and this is Your only recourse
212+
213+
5.2 **Entire Agreement**. This Agreement constitutes the sole and
214+
entire agreement between the parties as to the subject matter set forth
215+
herein and supersedes are previous license agreements, understandings,
216+
or arrangements between the parties relating to such subject matter.
217+
218+
5.3 **Governing Law**. This Agreement shall be construed, governed,
219+
interpreted and applied in accordance with the internal laws of the
220+
State of Maine, U.S.A., without regard to conflict of laws principles.
221+
The parties agree that any disputes between them may be heard only in
222+
the state or federal courts in the State of Maine, and the parties
223+
hereby consent to venue and jurisdiction in those courts.

src/jabs/ui/license_dialog.py

Lines changed: 57 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
1-
from PySide6.QtCore import Qt
2-
from PySide6.QtWidgets import QDialog, QHBoxLayout, QLabel, QPushButton, QVBoxLayout
1+
from importlib import resources
2+
3+
from PySide6.QtCore import QSize, Qt
4+
from PySide6.QtWidgets import (
5+
QDialog,
6+
QDialogButtonBox,
7+
QLabel,
8+
QPlainTextEdit,
9+
QSizePolicy,
10+
QVBoxLayout,
11+
)
312

413
from ..constants import APP_NAME, APP_NAME_LONG
514

615

16+
def _read_license_text() -> str:
17+
try:
18+
with (
19+
resources.files("jabs.resources.docs")
20+
.joinpath("LICENSE")
21+
.open("r", encoding="utf-8") as f
22+
):
23+
return f.read()
24+
except Exception:
25+
return "LICENSE not found in package."
26+
27+
728
class LicenseAgreementDialog(QDialog):
829
"""Dialog for accepting the application license agreement.
930
@@ -16,29 +37,42 @@ class LicenseAgreementDialog(QDialog):
1637
"""
1738

1839
def __init__(self, *args, **kwargs):
19-
super().__init__(*args, **kwargs)
20-
self.setWindowTitle(f"Accept {APP_NAME_LONG} License")
21-
self.setModal(True)
22-
23-
layout = QVBoxLayout()
24-
25-
layout.addWidget(
26-
QLabel(f"I have read and I agree to the {APP_NAME} license terms."),
27-
alignment=Qt.AlignmentFlag.AlignCenter,
40+
super().__init__(*args, **{key: val for key, val in kwargs.items() if key != "view_only"})
41+
self._view_only = kwargs.get("view_only", False)
42+
self.setWindowTitle(
43+
f"Accept {APP_NAME_LONG} License"
44+
if not self._view_only
45+
else f"{APP_NAME_LONG} License"
2846
)
47+
self.setModal(True)
48+
self.setSizeGripEnabled(True)
49+
self.setMinimumSize(600, 350)
2950

30-
button_layout = QHBoxLayout()
31-
32-
yes_button = QPushButton("YES")
33-
yes_button.clicked.connect(self.accept)
34-
35-
no_button = QPushButton("NO")
36-
no_button.clicked.connect(self.reject)
51+
layout = QVBoxLayout(self)
3752

38-
button_layout.addStretch()
39-
button_layout.addWidget(yes_button, alignment=Qt.AlignmentFlag.AlignRight)
40-
button_layout.addWidget(no_button, alignment=Qt.AlignmentFlag.AlignRight)
53+
license_view = QPlainTextEdit()
54+
license_view.setReadOnly(True)
55+
license_view.setPlainText(_read_license_text())
56+
license_view.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
57+
layout.addWidget(license_view)
4158

42-
layout.addLayout(button_layout)
59+
if self._view_only:
60+
# this is the license viewer, not the acceptance dialog
61+
buttons = QDialogButtonBox(QDialogButtonBox.StandardButton.Ok)
62+
buttons.accepted.connect(self.accept)
63+
else:
64+
# this is the acceptance dialog, need to add the prompt and Yes/No buttons
65+
layout.addWidget(
66+
QLabel(f"I have read and I agree to the {APP_NAME} license terms:"),
67+
alignment=Qt.AlignmentFlag.AlignCenter,
68+
)
69+
buttons = QDialogButtonBox(
70+
QDialogButtonBox.StandardButton.Yes | QDialogButtonBox.StandardButton.No
71+
)
72+
buttons.accepted.connect(self.accept)
73+
buttons.rejected.connect(self.reject)
74+
layout.addWidget(buttons)
4375

44-
self.setLayout(layout)
76+
def sizeHint(self) -> QSize:
77+
"""Preferred starting size; layout can expand beyond this"""
78+
return QSize(700, 420)

src/jabs/ui/main_window.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ def __init__(self, app_name: str, app_name_long: str, *args, **kwargs) -> None:
9696
user_guide_action.triggered.connect(self._open_user_guide)
9797
app_menu.addAction(user_guide_action)
9898

99+
# license action
100+
license_action = QtGui.QAction("View License Agreement", self)
101+
license_action.setStatusTip("View License Agreement")
102+
license_action.triggered.connect(self._view_license)
103+
app_menu.addAction(license_action)
104+
99105
# enable/disable session tracking
100106
session_tracking_action = QtGui.QAction("Enable Session Tracking", self)
101107
session_tracking_action.setStatusTip("Enable or disable session tracking")
@@ -979,3 +985,8 @@ def _on_bbox_overlay_support_changed(self, supported: bool) -> None:
979985
self._identity_overlay_floating.setChecked(True)
980986

981987
self._identity_overlay_bbox.setEnabled(supported)
988+
989+
def _view_license(self) -> None:
990+
"""View the license agreement (JABS->View License Agreement menu action)"""
991+
dialog = LicenseAgreementDialog(self, view_only=True)
992+
dialog.exec_()

0 commit comments

Comments
 (0)