-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bace3cd
commit 7e648b8
Showing
3 changed files
with
197 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import os | ||
from qgis.PyQt import uic | ||
from qgis.PyQt.QtWidgets import QDialog | ||
from qgis.PyQt.QtCore import QUrl | ||
from qgis.PyQt.QtGui import QDesktopServices | ||
|
||
ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), "ui", "ui_project_limit_hit_dialog.ui") | ||
|
||
class ProjectLimitHitDialog(QDialog): | ||
def __init__(self, e, parent=None): | ||
QDialog.__init__(self, parent) | ||
self.ui = uic.loadUi(ui_file, self) | ||
|
||
quota = e.server_response.get('projects_quota', 'N/A') | ||
plan = e.server_response.get('plan', 'N/A') | ||
self.planQuota_label.setText(str(quota)) | ||
self.planName_label.setText(str(plan)) | ||
|
||
self.cancel_btn.clicked.connect(self.reject) | ||
self.upgrade_plan_btn.clicked.connect(self.open_upgrade_link) | ||
|
||
def open_upgrade_link(self): | ||
QDesktopServices.openUrl(QUrl("https://www.merginmaps.com/pricing")) | ||
self.accept() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>Dialog</class> | ||
<widget class="QDialog" name="Dialog"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>332</width> | ||
<height>278</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Project limit hit</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QLabel" name="label"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="font"> | ||
<font> | ||
<pointsize>16</pointsize> | ||
<weight>75</weight> | ||
<bold>true</bold> | ||
</font> | ||
</property> | ||
<property name="text"> | ||
<string>You have reached the maximum limit of active monthly contributors for your subscription.</string> | ||
</property> | ||
<property name="textFormat"> | ||
<enum>Qt::AutoText</enum> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignCenter</set> | ||
</property> | ||
<property name="wordWrap"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="label_2"> | ||
<property name="text"> | ||
<string>Upgrade your subscription or wait until next month | ||
for refresh of slots.</string> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="verticalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>40</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<item> | ||
<widget class="QLabel" name="label_3"> | ||
<property name="text"> | ||
<string>Used</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="planQuota_label"> | ||
<property name="text"> | ||
<string/> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<widget class="QProgressBar" name="plan_quota_progress_bar"> | ||
<property name="value"> | ||
<number>100</number> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="horizontalLayout_2"> | ||
<item> | ||
<widget class="QLabel" name="label_6"> | ||
<property name="text"> | ||
<string>Plan</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="planName_label"> | ||
<property name="text"> | ||
<string/> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="horizontalLayout_3"> | ||
<item> | ||
<widget class="QPushButton" name="cancel_btn"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="text"> | ||
<string>Cancel</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="upgrade_plan_btn"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="minimumSize"> | ||
<size> | ||
<width>100</width> | ||
<height>0</height> | ||
</size> | ||
</property> | ||
<property name="maximumSize"> | ||
<size> | ||
<width>200</width> | ||
<height>16777215</height> | ||
</size> | ||
</property> | ||
<property name="text"> | ||
<string>Upgrade</string> | ||
</property> | ||
<property name="default"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |