Skip to content

Commit

Permalink
code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorVieiraZ committed Nov 15, 2024
1 parent 4491267 commit c88c027
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Mergin/help.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
MAIN_ROOT = "https://merginmaps.com/"


class MerginHelp:
"""Class for generating Mergin plugin help URLs."""

Expand All @@ -8,6 +9,6 @@ def howto_attachment_widget(self):

def howto_background_maps(self):
return f"{MAIN_ROOT}/docs/gis/settingup_background_map/"

def mergin_subscription_link(self):
return f"{MAIN_ROOT}/pricing/"
8 changes: 5 additions & 3 deletions Mergin/monthly_contributors_error_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@

ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), "ui", "ui_monthly_contributors_error_dialog.ui")


class MonthlyContributorsErrorDialog(QDialog):
def __init__(self, e, parent=None):
QDialog.__init__(self, parent)
self.ui = uic.loadUi(ui_file, self)

self.server_response = e.server_response
self.set_dialog_style()

self.buttonBox.accepted.connect(self.open_upgrade_link)
self.buttonBox.rejected.connect(self.reject)

def set_dialog_style(self):
upgrade_button = self.buttonBox.button(QDialogButtonBox.Ok)
upgrade_button.setText("Upgrade")

quota = self.server_response.get("contributors_quota", "#NA")
quota_text = f"{quota}/{quota}"
self.plan_quota_progress_bar.setFormat(quota_text)
Expand All @@ -36,7 +37,8 @@ def set_dialog_style(self):
QProgressBar::chunk {
background-color: rgb(0, 76, 69);
}
""")
"""
)

def open_upgrade_link(self):
QDesktopServices.openUrl(QUrl(MerginHelp().mergin_subscription_link()))
Expand Down

0 comments on commit c88c027

Please sign in to comment.