mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-27 12:45:50 +00:00
UpdaterCommon: Move most of the programs here
This commit is contained in:
parent
2a3c075330
commit
19bf2c166d
10 changed files with 337 additions and 458 deletions
|
@ -7,6 +7,7 @@
|
|||
#include "UpdaterCommon/UI.h"
|
||||
|
||||
#include <Cocoa/Cocoa.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
|
@ -107,6 +108,32 @@ void UI::SetTotalProgress(int current, int total)
|
|||
run_on_main([&] { [GetView() SetTotalProgress:(double)current total:(double)total]; });
|
||||
}
|
||||
|
||||
void UI::Sleep(int seconds)
|
||||
{
|
||||
[NSThread sleepForTimeInterval:static_cast<float>(seconds)];
|
||||
}
|
||||
|
||||
void UI::WaitForPID(u32 pid)
|
||||
{
|
||||
for (int res = kill(pid, 0); res == 0 || (res < 0 && errno == EPERM); res = kill(pid, 0))
|
||||
{
|
||||
UI::Sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
void UI::LaunchApplication(std::string path)
|
||||
{
|
||||
[[NSWorkspace sharedWorkspace]
|
||||
launchApplication:[NSString stringWithCString:path.c_str()
|
||||
encoding:[NSString defaultCStringEncoding]]];
|
||||
}
|
||||
|
||||
// Stubs. These are only needed on Windows
|
||||
|
||||
void UI::Init()
|
||||
{
|
||||
}
|
||||
|
||||
void UI::Stop()
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue