Skip to content
This repository has been archived by the owner on May 22, 2019. It is now read-only.

Commit

Permalink
fix: enable fatal error message
Browse files Browse the repository at this point in the history
  • Loading branch information
gbronisz committed Mar 19, 2019
1 parent 4302dab commit 6896d8d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/pages/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,25 @@ def go_back(self):
self.remove_timer = True
self.proc.terminate()

def check_partitioning_completion(self):
temp = self.settings.get('temp')
path = os.path.join(temp, ".cnchi_partitioning_completed")
if os.path.exists(path):
msg = "You must reboot before retrying again."
logging.error(msg)
msg = _("You must reboot before retrying again.")
show.fatal_error(self.main_window, msg)
return False

def prepare(self, direction):
""" Load screen """
self.translate_ui()
self.show_all()

self.forward_button.set_sensitive(self.results['check_all'])

self.check_partitioning_completion()

# Set timer
self.on_timer()
self.timeout_id = GLib.timeout_add(1000, self.on_timer)
Expand All @@ -195,21 +207,13 @@ def run(self):

def check_all(self):
""" Check that all requirements are meet """
temp = self.settings.get('temp')
path = os.path.join(temp, ".cnchi_partitioning_completed")
if os.path.exists(path):
msg = "You must reboot before retrying again."
logging.error(msg)
msg = _("You must reboot before retrying again.")
show.fatal_error(self.main_window, msg)
return False

on_power = not self.on_battery()
self.results['power'] = on_power

space = self.has_enough_space()
self.results['space'] = space

temp = self.settings.get('temp')
path = os.path.join(temp, ".cnchi_partitioning_completed")
packaging_issues = os.path.exists(path)
self.results['packing'] = not packaging_issues
Expand Down
2 changes: 2 additions & 0 deletions src/show_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

from misc import extra as misc

# When testing, no _() is available
try:
_("")
Expand Down

0 comments on commit 6896d8d

Please sign in to comment.