Skip to content

Commit

Permalink
Merge pull request #22387 from ccordoba12/add-in-app-appeal
Browse files Browse the repository at this point in the history
PR: Add in-app appeal message for donations (Application)
  • Loading branch information
ccordoba12 authored Aug 29, 2024
2 parents 380ce47 + 4eedb04 commit da26487
Show file tree
Hide file tree
Showing 22 changed files with 683 additions and 8 deletions.
4 changes: 2 additions & 2 deletions spyder/api/widgets/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,13 @@ def closeEvent(self, event):
super().closeEvent(event)

def setVisible(self, value):
"""Override Qt method to stops timers if widget is not visible."""
"""Stop timer if widget is not visible."""
if self.timer is not None:
if value:
self.timer.start(self._interval)
else:
self.timer.stop()
super(BaseTimerStatus, self).setVisible(value)
super().setVisible(value)

# ---- Public API
# -------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion spyder/plugins/application/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from spyder.api.widgets.main_container import PluginMainContainer
from spyder.utils.installers import InstallerMissingDependencies
from spyder.config.base import get_conf_path, get_debug_level
from spyder.plugins.application.widgets import AboutDialog
from spyder.plugins.application.widgets import AboutDialog, InAppAppealStatus
from spyder.plugins.console.api import ConsoleActions
from spyder.utils.environ import UserEnvDialog
from spyder.utils.qthelpers import start_file, DialogManager
Expand Down Expand Up @@ -96,6 +96,7 @@ def setup(self):

# Attributes
self.dialog_manager = DialogManager()
self.inapp_appeal_status = InAppAppealStatus(self)

# Actions
# Documentation actions
Expand Down
13 changes: 12 additions & 1 deletion spyder/plugins/application/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,13 @@ def on_editor_available(self):
editor = self.get_plugin(Plugins.Editor)
self.get_container().sig_load_log_file.connect(editor.load)

# -------------------------- PLUGIN TEARDOWN ------------------------------
@on_plugin_available(plugin=Plugins.StatusBar)
def on_statusbar_available(self):
statusbar = self.get_plugin(Plugins.StatusBar)
inapp_appeal_status = self.get_container().inapp_appeal_status
statusbar.add_status_widget(inapp_appeal_status)

# -------------------------- PLUGIN TEARDOWN ------------------------------
@on_plugin_teardown(plugin=Plugins.Preferences)
def on_preferences_teardown(self):
preferences = self.get_plugin(Plugins.Preferences)
Expand All @@ -122,6 +127,12 @@ def on_main_menu_teardown(self):
self._depopulate_help_menu()
self.report_action.setVisible(False)

@on_plugin_teardown(plugin=Plugins.StatusBar)
def on_statusbar_teardown(self):
statusbar = self.get_plugin(Plugins.StatusBar)
inapp_appeal_status = self.get_container().inapp_appeal_status
statusbar.remove_status_widget(inapp_appeal_status.ID)

def on_close(self, _unused=True):
self.get_container().on_close()

Expand Down
1 change: 1 addition & 0 deletions spyder/plugins/application/widgets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
"""Widgets for the Application plugin."""

from .about import AboutDialog # noqa
from .status import InAppAppealStatus # noqa
2 changes: 2 additions & 0 deletions spyder/plugins/application/widgets/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def __init__(self, parent):
self.setWindowFlags(
self.windowFlags() & ~Qt.WindowContextHelpButtonHint
)
self.setWindowTitle(_("About Spyder"))
self.setWindowIcon(ima.icon("MessageBoxInformation"))
versions = get_versions()

# -- Show Git revision for development version
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit da26487

Please sign in to comment.