Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.

Commit

Permalink
Fixed reboot button not working
Browse files Browse the repository at this point in the history
  • Loading branch information
oeed committed Jul 18, 2014
1 parent 70dbb0e commit b73e19a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion System/.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.450998259E9
1.16075615E9
2 changes: 1 addition & 1 deletion System/Programs/First Setup.program/Views/page5.view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
["Width"]="100%,-6",
["Name"]="Label",
["Type"]="Label",
["Text"]="All done! OneOS is now all setup and ready for you to use. Click 'Restart' to get going!"
["Text"]="All done! OneOS is now all setup and ready for you to use. Click 'Restart' to get going!\n\nIf the restart button does not work then hold Ctrl + R or break and replace your computer."
},
[3]={
["Y"]="100%,-1",
Expand Down
2 changes: 2 additions & 0 deletions System/Programs/First Setup.program/startup
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ program:ObjectClick('RestartButton', function(self, event, side, x, y)
h.write(textutils.serialize(settings))
h.close()

OneOS.Log.i('Trying to reboot...')
OneOS.Restart(true)
print('You might have to hold Ctrl + R if you\'re seeing this.')
end)

program:ObjectClick('ColourButton', function(self, event, side, x, y)
Expand Down
8 changes: 6 additions & 2 deletions System/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ bedrock.EventHandler = function(self)
end

function Shutdown(force, restart)
Log.i(bedrock.View.Name)
if bedrock.View.Name == 'firstsetup' then
os.reboot()
end
Log.i('Trying to shutdown/restart. Restart: '..tostring(restart))
local success = true
if not force then
Expand All @@ -104,10 +108,10 @@ function Shutdown(force, restart)
end)
end
end

local firstsetup = false
function AnimateShutdown(restart)
Log.w('System safely stopping.')
if Settings:GetValues()['UseAnimations'] then
if Settings:GetValues()['UseAnimations'] and not firstsetup then
Drawing.Clear(colours.white)
Drawing.DrawBuffer()
sleep(0)
Expand Down

0 comments on commit b73e19a

Please sign in to comment.