Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Add in-app appeal message for donations (Application) #22387

Merged
merged 6 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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