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

Improve Update notifiers #2684

Merged
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
11 changes: 5 additions & 6 deletions src/robotide/application/updatenotifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import builtins
import re
import subprocess
import sys
# Configure wx uversion to allow running test app in __main__
Expand Down Expand Up @@ -98,18 +99,16 @@ def _get_response(params, method):


def upgrade_from_dev_dialog(version_installed):
VERSION = None
dev_version = urllib2.urlopen('https://raw.githubusercontent.com/robotframework/'
'RIDE/master/src/robotide/version.py', timeout=1).read().decode('utf-8')
master_code = compile(dev_version, 'version', 'exec')
main_dict = {'VERSION': VERSION}
exec(master_code, main_dict) # defines VERSION
if cmp_versions(version_installed, main_dict['VERSION']) == -1:
matches = re.findall("VERSION\s*=\s*'([\w.]*)'", dev_version)
version_latest = matches[0] if matches else None
if cmp_versions(version_installed, version_latest) == -1:
# Here is the Menu Help->Upgrade insertion part, try to highlight menu # wx.CANCEL_DEFAULT
command = sys.executable + " -m pip install -U https://github.com/robotframework/RIDE/archive/master.zip"
_add_content_to_clipboard(command)
if not _askyesno(_("Upgrade?"), f"{SPC}{_('New development version is available.')}{SPC}\n{SPC}"
f"{_('You may install version ')}{main_dict['VERSION']}{_(' with:')}\n"
f"{_('You may install version %s with:') % version_latest}\n"
f"{SPC}{command}{SPC}\n\n{SPC}{_('Click OK to Upgrade now!')}\n{SPC}"
f"{_('After upgrade you will see another dialog informing to close this RIDE instance.')}"
f"{SPC}\n", wx.GetActiveWindow(), no_default=True):
Expand Down
7 changes: 1 addition & 6 deletions src/robotide/locale/RIDE.pot
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ msgstr ""

#:
#: /home2/helio/github/RIDE/tools/../src/robotide/application/updatenotifier.py:112
msgid " with:"
msgstr ""

#:
#: /home2/helio/github/RIDE/tools/../src/robotide/application/updatenotifier.py:112
msgid "You may install version "
msgid "You may install version %s with:"
msgstr ""

#:
Expand Down
Binary file modified src/robotide/locale/nl/LC_MESSAGES/RIDE.mo
Binary file not shown.
8 changes: 2 additions & 6 deletions src/robotide/locale/nl/LC_MESSAGES/RIDE.po
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,8 @@ msgid "Upgrade?"
msgstr "Bijwerken?"

#: /home2/helio/github/RIDE/tools/../src/robotide/application/updatenotifier.py:112
msgid " with:"
msgstr " met:"

#: /home2/helio/github/RIDE/tools/../src/robotide/application/updatenotifier.py:112
msgid "You may install version "
msgstr "Je kunt versie installeren "
msgid "You may install version %s with:"
msgstr "Je kunt versie %s installeren met:"

#: /home2/helio/github/RIDE/tools/../src/robotide/application/updatenotifier.py:113
msgid "Click OK to Upgrade now!"
Expand Down
Binary file modified src/robotide/locale/pt_BR/LC_MESSAGES/RIDE.mo
Binary file not shown.
8 changes: 2 additions & 6 deletions src/robotide/locale/pt_BR/LC_MESSAGES/RIDE.po
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,8 @@ msgid "Upgrade?"
msgstr "Atualizar?"

#: /home2/helio/github/RIDE/tools/../src/robotide/application/updatenotifier.py:112
msgid " with:"
msgstr " com:"

#: /home2/helio/github/RIDE/tools/../src/robotide/application/updatenotifier.py:112
msgid "You may install version "
msgstr "Você pode instalar a versão "
msgid "You may install version %s with:"
msgstr "Você pode instalar a versão %s com:"

#: /home2/helio/github/RIDE/tools/../src/robotide/application/updatenotifier.py:113
msgid "Click OK to Upgrade now!"
Expand Down
Binary file modified src/robotide/locale/pt_PT/LC_MESSAGES/RIDE.mo
Binary file not shown.
8 changes: 2 additions & 6 deletions src/robotide/locale/pt_PT/LC_MESSAGES/RIDE.po
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,8 @@ msgid "Upgrade?"
msgstr "Atualizar?"

#: /home2/helio/github/RIDE/tools/../src/robotide/application/updatenotifier.py:112
msgid " with:"
msgstr " com:"

#: /home2/helio/github/RIDE/tools/../src/robotide/application/updatenotifier.py:112
msgid "You may install version "
msgstr "Você pode instalar a versão "
msgid "You may install version %s with:"
msgstr "Você pode instalar a versão %s com:"

#: /home2/helio/github/RIDE/tools/../src/robotide/application/updatenotifier.py:113
msgid "Click OK to Upgrade now!"
Expand Down
8 changes: 4 additions & 4 deletions src/robotide/ui/mainframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def _init_ui(self):
self.aui_mgr.AddPane(tb3,
aui.AuiPaneInfo().Name("tb3").Caption("Toolbar 3").
ToolbarPane().Top().Row(1).Position(1))

##### End Test
"""
# self.leftpanel = wx.Panel(self, name="left_panel", size = (275, 250))
Expand Down Expand Up @@ -637,10 +637,10 @@ def ensure_on_screen(self):

def show_confirm_reload_dlg(self, event):
msg = [_('Workspace modifications detected on the file system.'),
_('Do you want to reload the workspace?'),
_('Answering <No> will ignore the changes on disk.')]
_('Do you want to reload the workspace?')]
if self.controller.is_dirty():
msg.insert(2, _('Answering <Yes> will discard unsaved changes.'))
msg += [_('Answering <Yes> will discard unsaved changes.'),
_('Answering <No> will ignore the changes on disk.')]
ret = wx.MessageBox('\n'.join(msg), _('Files Changed On Disk'),
style=wx.YES_NO | wx.ICON_WARNING)
confirmed = ret == wx.YES
Expand Down
Loading