mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2026-05-06 09:28:18 +00:00
Compare commits
4 Commits
9d0a99de6e
...
developmen
| Author | SHA1 | Date | |
|---|---|---|---|
| 0eb188f72e | |||
| c8bb271d82 | |||
| f1d6bbe390 | |||
| 56bb6a59e2 |
1
Gemfile
1
Gemfile
@@ -4,6 +4,7 @@ source "https://gem.coop"
|
|||||||
gem "base64"
|
gem "base64"
|
||||||
gem "rexml"
|
gem "rexml"
|
||||||
gem "logger"
|
gem "logger"
|
||||||
|
gem "json"
|
||||||
|
|
||||||
# "game" library gem
|
# "game" library gem
|
||||||
gem "cyberarm_engine"
|
gem "cyberarm_engine"
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ DEPENDENCIES
|
|||||||
cyberarm_engine
|
cyberarm_engine
|
||||||
digest-crc
|
digest-crc
|
||||||
ircparser
|
ircparser
|
||||||
|
json
|
||||||
logger
|
logger
|
||||||
rexml
|
rexml
|
||||||
rubyzip
|
rubyzip
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
module W3DHubLauncher
|
module W3DHubLauncher
|
||||||
|
DIRECTORY_NAME = "w3d-hub-linux-launcher".freeze
|
||||||
|
|
||||||
ROOT_PATH = Dir.pwd
|
ROOT_PATH = Dir.pwd
|
||||||
|
CONFIG_PATH = "#{Dir.home}/.config/#{DIRECTORY_NAME}".freeze
|
||||||
|
CACHE_PATH = "#{Dir.home}/.cache/#{DIRECTORY_NAME}".freeze
|
||||||
|
DEFAULT_PACKAGE_CACHE_PATH = "#{CACHE_PATH}/packages".freeze
|
||||||
|
DEFAULT_APPLICATIONS_PATH = "#{Dir.home}/.local/share/#{DIRECTORY_NAME}/applications".freeze
|
||||||
|
|
||||||
USER_AGENT = "#{NAME} v#{VERSION}".freeze
|
USER_AGENT = "#{NAME} v#{VERSION}".freeze
|
||||||
end
|
end
|
||||||
|
|||||||
38
lib/dialogs/downloads.rb
Normal file
38
lib/dialogs/downloads.rb
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
module W3DHubLauncher
|
||||||
|
class Dialog
|
||||||
|
class Downloads < W3DHubLauncher::Dialog
|
||||||
|
def setup
|
||||||
|
super
|
||||||
|
|
||||||
|
stack(width: 1.0, max_width: 600, height: 1.0, max_height: 600, h_align: :center, v_align: :center, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: ALPHA_BLACK) do
|
||||||
|
flow(width: 1.0, background_nine_slice: NINE_SLICE_ROUNDED_TOP, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: ALPHA_GRAY) do
|
||||||
|
banner "Downloads", width: 1.0, text_align: :center
|
||||||
|
end
|
||||||
|
|
||||||
|
stack(width: 1.0, fill: true, scroll: true, padding_left: PADDING, padding_right: PADDING) do
|
||||||
|
50.times do
|
||||||
|
stack(width: 1.0, margin_top: HALF_PADDING, margin_bottom: HALF_PADDING) do
|
||||||
|
flow(width: 1.0) do
|
||||||
|
para "PACKAGE_NAME.mix"
|
||||||
|
flow(fill: true)
|
||||||
|
para ["Downloading...", "Pending...", "Done.", "Patching...", "Unpacking..."].sample
|
||||||
|
end
|
||||||
|
progress(width: 1.0, fraction: rand)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
flow(width: 1.0, padding: PADDING, background_nine_slice: NINE_SLICE_ROUNDED_BOTTOM, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: ALPHA_GRAY) do
|
||||||
|
flow(fill: true)
|
||||||
|
|
||||||
|
button "Close" do
|
||||||
|
pop_state
|
||||||
|
end
|
||||||
|
|
||||||
|
flow(fill: true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -15,23 +15,16 @@ module W3DHubLauncher
|
|||||||
title "Initial Setup"
|
title "Initial Setup"
|
||||||
caption "Please confirm launcher's default settings and make any desired tweaks.", font: FONT_REGULAR
|
caption "Please confirm launcher's default settings and make any desired tweaks.", font: FONT_REGULAR
|
||||||
|
|
||||||
flow(width: 1.0, height: 40, margin_top: PADDING) do
|
|
||||||
tagline "Launcher data directory", height: 1.0, text_v_align: :center
|
|
||||||
edit_line format("%s/.local/share/W3D Hub", Dir.home), fill: true
|
|
||||||
button "Browse..."
|
|
||||||
end
|
|
||||||
inscription "Location where the launcher stores it's configuration files and cache interface data."
|
|
||||||
|
|
||||||
flow(width: 1.0, height: 40, margin_top: HALF_PADDING) do
|
flow(width: 1.0, height: 40, margin_top: HALF_PADDING) do
|
||||||
tagline "Launcher package cache directory", height: 1.0, text_v_align: :center
|
tagline "Launcher package cache directory", height: 1.0, text_v_align: :center
|
||||||
edit_line format("%s/.local/share/W3D Hub/package-cache", Dir.home), fill: true
|
edit_line DEFAULT_PACKAGE_CACHE_PATH, fill: true
|
||||||
button "Browse..."
|
button "Browse..."
|
||||||
end
|
end
|
||||||
inscription "Location where the launcher will download application packages."
|
inscription "Location where the launcher will download application packages."
|
||||||
|
|
||||||
flow(width: 1.0, height: 40, margin_top: HALF_PADDING) do
|
flow(width: 1.0, height: 40, margin_top: HALF_PADDING) do
|
||||||
tagline "Application installation directory", height: 1.0, text_v_align: :center
|
tagline "Application installation directory", height: 1.0, text_v_align: :center
|
||||||
edit_line format("%s/.local/share/W3D Hub/applications", Dir.home), fill: true
|
edit_line DEFAULT_APPLICATIONS_PATH, fill: true
|
||||||
button "Browse..."
|
button "Browse..."
|
||||||
end
|
end
|
||||||
inscription "Location where the launcher will install new applications."
|
inscription "Location where the launcher will install new applications."
|
||||||
@@ -53,8 +46,18 @@ module W3DHubLauncher
|
|||||||
|
|
||||||
flow(width: 1.0, padding_top: PADDING) do
|
flow(width: 1.0, padding_top: PADDING) do
|
||||||
flow(fill: true)
|
flow(fill: true)
|
||||||
button "Accept" do
|
button "Accept" do |btn|
|
||||||
page(Page::Boot::StartUp)
|
btn.enabled = false
|
||||||
|
|
||||||
|
Worker::Api.update_settings({}) do |result|
|
||||||
|
if result.okay?
|
||||||
|
page(Page::Boot::StartUp)
|
||||||
|
else
|
||||||
|
btn.enabled = true
|
||||||
|
end
|
||||||
|
|
||||||
|
puts "NOW!"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ module W3DHubLauncher
|
|||||||
# root container - background image
|
# root container - background image
|
||||||
stack(width: 1.0, height: 1.0, background_image: safe_get_image("/run/media/cyberarm/Storage/W3DHub/Launcher/package-cache/games/apb/background.png.package"), background_image_mode: :fill) do
|
stack(width: 1.0, height: 1.0, background_image: safe_get_image("/run/media/cyberarm/Storage/W3DHub/Launcher/package-cache/games/apb/background.png.package"), background_image_mode: :fill) do
|
||||||
# root container - background image tint
|
# root container - background image tint
|
||||||
flow(width: 1.0, height: 1.0, background: ALPHA_BLACK) do
|
stack(width: 1.0, height: 1.0, background: ALPHA_BLACK) do
|
||||||
# content container
|
# content container
|
||||||
stack(fill: true, height: 1.0, margin: PADDING, margin_right: LARGE_PADDING) do
|
stack(width: 1.0, fill: true, margin: PADDING) do
|
||||||
# header bar container
|
# header bar container
|
||||||
flow(width: 1.0, height: 80, margin_bottom: PADDING) do |c|
|
flow(width: 1.0, height: 80, margin_bottom: PADDING) do |c|
|
||||||
# logo + menu button
|
# logo + menu button
|
||||||
@@ -25,84 +25,100 @@ module W3DHubLauncher
|
|||||||
end.show
|
end.show
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# navigation bar container
|
||||||
stack(fill: true, height: 1.0) do
|
stack(fill: true, height: 1.0) do
|
||||||
stack(fill: true)
|
# stack(fill: true)
|
||||||
|
|
||||||
|
# navigation container
|
||||||
flow(width: 1.0) do
|
flow(width: 1.0) do
|
||||||
link("GAMES", text_v_align: :center, font: FONT_BLACK, margin_left: PADDING) { page(Page::Games) }
|
link("GAMES", text_v_align: :center, font: FONT_BLACK, margin_left: PADDING) { page(Page::Games) }
|
||||||
link("SERVERS", text_v_align: :center, font: FONT_BLACK, margin_left: PADDING) { page(Page::ServerBrowser) }
|
link("SERVERS", text_v_align: :center, font: FONT_BLACK, margin_left: PADDING) { page(Page::ServerBrowser) }
|
||||||
stack(fill: true)
|
stack(fill: true)
|
||||||
image safe_get_image("#{ROOT_PATH}/media/icons/import.png"), height: 40, color: 0xff_bbbbbb, tip: "Downloads"
|
image safe_get_image("#{ROOT_PATH}/media/icons/import.png"), height: 40, color: 0xff_bbbbbb, tip: "Downloads" do |img|
|
||||||
|
dialog(Dialog::Downloads)
|
||||||
|
end
|
||||||
image safe_get_image("#{ROOT_PATH}/media/icons/information.png"), height: 40, color: 0xff_bbbbbb, tip: "Notifications"
|
image safe_get_image("#{ROOT_PATH}/media/icons/information.png"), height: 40, color: 0xff_bbbbbb, tip: "Notifications"
|
||||||
end
|
end
|
||||||
stack(fill: true)
|
# application task status bar container
|
||||||
end
|
stack(width: 1.0, fill: true, margin_left: PADDING) do
|
||||||
end
|
flow(width: 1.0) do
|
||||||
|
para "Updating Red Alert: A Path Beyond (Release)"
|
||||||
# page content container
|
stack(fill: true)
|
||||||
@page_host = stack(width: 1.0, fill: true) do
|
para "Fetching manifests..."
|
||||||
end
|
end
|
||||||
end
|
progress(width: 1.0, fraction: 0.75)
|
||||||
|
end
|
||||||
# battleview/friends container
|
end
|
||||||
stack(width: 300, height: 1.0, margin: PADDING, margin_left: 0) do
|
|
||||||
# self account container
|
# self account container
|
||||||
flow(width: 1.0, height: 80) do
|
flow(width: 300, height: 80, margin_left: LARGE_PADDING) do
|
||||||
# self avatar container
|
# self avatar container
|
||||||
stack(width: 80, height: 1.0, background_image: rounded_avatar(safe_get_image("#{ROOT_PATH}/media/default.png"))) do
|
stack(width: 80, height: 1.0, background_image: rounded_avatar(safe_get_image("#{ROOT_PATH}/media/default.png"))) do
|
||||||
# self online state container
|
# self online state container
|
||||||
stack(width: 20, height: 20, v_align: :bottom, h_align: :right, background_image: safe_get_image("#{ROOT_PATH}/media/ui/circle_small.png"), background_image_color: 0xff_26a269)
|
stack(width: 20, height: 20, v_align: :bottom, h_align: :right, background_image: safe_get_image("#{ROOT_PATH}/media/ui/circle_small.png"), background_image_color: 0xff_26a269)
|
||||||
end
|
end
|
||||||
|
|
||||||
stack(fill: true, height: 1.0, margin_left: HALF_PADDING) do
|
stack(fill: true, height: 1.0, margin_left: HALF_PADDING) do
|
||||||
flow(fill: true)
|
flow(fill: true)
|
||||||
# self name
|
# self name
|
||||||
caption "cyberarm", font: FONT_BLACK, text_wrap: :none
|
caption "cyberarm", font: FONT_BLACK, text_wrap: :none
|
||||||
# self set online state
|
# self set online state
|
||||||
link "Online ▼", text_size: 18 do |l|
|
link "Online ▼", text_size: 18 do |l|
|
||||||
menu(parent: l) do
|
menu(parent: l) do
|
||||||
menu_item("Online")
|
menu_item("Online")
|
||||||
menu_item("Do Not Disturb")
|
menu_item("Do Not Disturb")
|
||||||
menu_item("Away")
|
menu_item("Away")
|
||||||
menu_item("Invisible")
|
menu_item("Invisible")
|
||||||
menu_item("Sign Out")
|
menu_item("Sign Out")
|
||||||
end.show
|
end.show
|
||||||
|
end
|
||||||
|
flow(fill: true)
|
||||||
end
|
end
|
||||||
flow(fill: true)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# friend management container
|
# layout container
|
||||||
flow(width: 1.0, height: 60, margin_top: PADDING) do
|
flow(width: 1.0, fill: true) do
|
||||||
flow(width: 1.0, v_align: :center) do
|
# page host container
|
||||||
button safe_get_image("#{ROOT_PATH}/media/icons/singleplayer.png"), image_height: 1.0
|
@page_host = stack(fill: true, height: 1.0) do
|
||||||
button safe_get_image("#{ROOT_PATH}/media/icons/gear.png"), image_height: 1.0, margin_left: HALF_PADDING
|
|
||||||
edit_line "", margin_left: HALF_PADDING, fill: true, height: 1.0
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# friends/clanmates list container
|
# battleview/friends container
|
||||||
stack(width: 1.0, fill: true, margin_top: LARGE_PADDING, scroll: true) do
|
@battleview_container = stack(width: 300, height: 1.0, margin_left: LARGE_PADDING, visible: true) do
|
||||||
50.times do |i|
|
# friend management container
|
||||||
# friend container
|
flow(width: 1.0, height: 60) do
|
||||||
widget(width: 1.0, height: 48, padding_top: HALF_PADDING, padding_bottom: HALF_PADDING, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: 0, hover: { background_nine_slice_color: ALPHA_GRAY }, active: { background_nine_slice_color: ALPHA_BLACK }) do |w|
|
flow(width: 1.0, v_align: :center) do
|
||||||
w.subscribe(:clicked_left_mouse_button) do
|
button safe_get_image("#{ROOT_PATH}/media/icons/singleplayer.png"), image_height: 1.0
|
||||||
puts "HELLO THERE"
|
button safe_get_image("#{ROOT_PATH}/media/icons/gear.png"), image_height: 1.0, margin_left: HALF_PADDING
|
||||||
|
edit_line "", margin_left: HALF_PADDING, fill: true, height: 1.0
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# friends/clanmates list container
|
||||||
|
stack(width: 1.0, fill: true, margin_top: LARGE_PADDING, scroll: true) do
|
||||||
|
50.times do |i|
|
||||||
|
# friend container
|
||||||
|
widget(width: 1.0, height: 48, padding_top: HALF_PADDING, padding_bottom: HALF_PADDING, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: 0, hover: { background_nine_slice_color: ALPHA_GRAY }, active: { background_nine_slice_color: ALPHA_BLACK }) do |w|
|
||||||
|
w.subscribe(:clicked_left_mouse_button) do
|
||||||
|
puts "HELLO THERE"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
# friend avatar container
|
# friend avatar container
|
||||||
stack(width: 48, height: 1.0, margin_left: HALF_PADDING, background_image: rounded_avatar(safe_get_image("#{ROOT_PATH}/media/default.png"))) do
|
stack(width: 48, height: 1.0, margin_left: HALF_PADDING, background_image: rounded_avatar(safe_get_image("#{ROOT_PATH}/media/default.png"))) do
|
||||||
stack(width: 12, height: 12, v_align: :bottom, h_align: :right, background_image: safe_get_image("#{ROOT_PATH}/media/ui/circle_small.png"), background_image_color: 0xff_26a269)
|
stack(width: 12, height: 12, v_align: :bottom, h_align: :right, background_image: safe_get_image("#{ROOT_PATH}/media/ui/circle_small.png"), background_image_color: 0xff_26a269)
|
||||||
end
|
end
|
||||||
# friend name and status container
|
# friend name and status container
|
||||||
stack(fill: true, height: 1.0, margin_left: HALF_PADDING, margin_right: HALF_PADDING) do
|
stack(fill: true, height: 1.0, margin_left: HALF_PADDING, margin_right: HALF_PADDING) do
|
||||||
stack(v_align: :center) do
|
stack(v_align: :center) do
|
||||||
caption ["Silverlight", "PXD2000", "Alstar", "SteelGhost", "FRAYDO"].sample, text_wrap: :none
|
caption ["Silverlight", "PXD2000", "Alstar", "SteelGhost", "FRAYDO"].sample, text_wrap: :none
|
||||||
inscription "RA_Under • 13:52", text_wrap: :none, margin_top: -HALF_PADDING
|
inscription "RA_Under • 13:52", text_wrap: :none, margin_top: -HALF_PADDING
|
||||||
|
end
|
||||||
|
end
|
||||||
|
# friend active application container
|
||||||
|
stack(width: 48, height: 1.0, margin_right: HALF_PADDING, background_image: safe_get_image("#{ROOT_PATH}/media/logo.png"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# friend active application container
|
|
||||||
stack(width: 48, height: 1.0, margin_right: HALF_PADDING, background_image: safe_get_image("#{ROOT_PATH}/media/logo.png"))
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -112,6 +128,12 @@ module W3DHubLauncher
|
|||||||
|
|
||||||
page(Page::Games)
|
page(Page::Games)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def button_up(id)
|
||||||
|
super
|
||||||
|
|
||||||
|
@battleview_container.toggle if id == Gosu::KB_F8
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ module W3DHubLauncher
|
|||||||
self.show_cursor = true
|
self.show_cursor = true
|
||||||
self.caption = format("%s | v%s (%s)", NAME, VERSION, VERSION_NAME) # "Cyberarm's W3D Hub Linux Launcher | v2.0.0 alpha"
|
self.caption = format("%s | v%s (%s)", NAME, VERSION, VERSION_NAME) # "Cyberarm's W3D Hub Linux Launcher | v2.0.0 alpha"
|
||||||
|
|
||||||
# push_state(States::Boot)
|
push_state(States::Boot)
|
||||||
push_state(States::Interface)
|
# push_state(States::Interface)
|
||||||
end
|
end
|
||||||
|
|
||||||
def needs_redraw?
|
def needs_redraw?
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ module W3DHubLauncher
|
|||||||
@threads = []
|
@threads = []
|
||||||
@requests = []
|
@requests = []
|
||||||
|
|
||||||
|
@settings = # Settings.new
|
||||||
|
|
||||||
# next available request_id to assign incoming requests
|
# next available request_id to assign incoming requests
|
||||||
@request_id = 0
|
@request_id = 0
|
||||||
|
|
||||||
@@ -35,6 +37,13 @@ module W3DHubLauncher
|
|||||||
response = Response.new(result.okay? ? Request::STATUS_COMPLETE : Request::STATUS_ERROR, query.request_id, result)
|
response = Response.new(result.okay? ? Request::STATUS_COMPLETE : Request::STATUS_ERROR, query.request_id, result)
|
||||||
Ractor.main.send(response)
|
Ractor.main.send(response)
|
||||||
end
|
end
|
||||||
|
when Request::LAUNCHER_UPDATE_SETTINGS
|
||||||
|
result = CyberarmEngine::Result.new
|
||||||
|
FileUtils.mkdir_p(W3DHubLauncher::CONFIG_PATH) # FAILABLE!
|
||||||
|
File.write("#{W3DHubLauncher::CONFIG_PATH}/settings.json", query.data) # FAILABLE!
|
||||||
|
result.data = query.data
|
||||||
|
response = Response.new(result.okay? ? Request::STATUS_COMPLETE : Request::STATUS_ERROR, query.request_id, result)
|
||||||
|
Ractor.main.send(response)
|
||||||
else
|
else
|
||||||
raise "UNKNOWN REQUEST"
|
raise "UNKNOWN REQUEST"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,76 +3,71 @@
|
|||||||
module W3DHubLauncher
|
module W3DHubLauncher
|
||||||
class Worker
|
class Worker
|
||||||
class Api
|
class Api
|
||||||
Request = Data.define(:coming_soon)
|
|
||||||
|
|
||||||
def initialize
|
|
||||||
@requests = []
|
|
||||||
end
|
|
||||||
|
|
||||||
# downloads requested resource, returns raw string
|
# downloads requested resource, returns raw string
|
||||||
def fetch_url
|
def self.fetch_url
|
||||||
end
|
end
|
||||||
|
|
||||||
# downloads requested resource, periodically reporting progress until completion, returning path for file on disk
|
# downloads requested resource, periodically reporting progress until completion, returning path for file on disk
|
||||||
def download_url
|
def self.download_url
|
||||||
end
|
end
|
||||||
|
|
||||||
# returns user account data
|
# returns user account data
|
||||||
#
|
#
|
||||||
# automatically handles signing in / refreshing token (DOES NOT remove account data if failed to refresh token due to network timeout)
|
# automatically handles signing in / refreshing token (DOES NOT remove account data if failed to refresh token due to network timeout)
|
||||||
def account
|
def self.account
|
||||||
end
|
end
|
||||||
|
|
||||||
# returns launcher settings
|
# returns launcher settings
|
||||||
def settings
|
def self.settings
|
||||||
end
|
end
|
||||||
|
|
||||||
# write updated launcher settings
|
# write updated launcher settings
|
||||||
def update_settings
|
def self.update_settings(settings, &block)
|
||||||
|
Worker::Request.new(Request::LAUNCHER_UPDATE_SETTINGS, settings.to_json, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
# returns list of available applications
|
# returns list of available applications
|
||||||
#
|
#
|
||||||
# if updated list is requested, return cached version immediately and then the updated list later.
|
# if updated list is requested, return cached version immediately and then the updated list later.
|
||||||
def applications
|
def self.applications
|
||||||
end
|
end
|
||||||
|
|
||||||
# returns current list of servers as reported from GSH / cache
|
# returns current list of servers as reported from GSH / cache
|
||||||
def servers
|
def self.servers
|
||||||
end
|
end
|
||||||
|
|
||||||
# returns news for application
|
# returns news for application
|
||||||
def news
|
def self.news
|
||||||
end
|
end
|
||||||
|
|
||||||
# request installation of application
|
# request installation of application
|
||||||
#
|
#
|
||||||
# periodically reports progress until completion
|
# periodically reports progress until completion
|
||||||
def install_application
|
def self.install_application
|
||||||
end
|
end
|
||||||
|
|
||||||
# request update of application
|
# request update of application
|
||||||
#
|
#
|
||||||
# periodically reports progress until completion
|
# periodically reports progress until completion
|
||||||
def update_application
|
def self.update_application
|
||||||
end
|
end
|
||||||
|
|
||||||
# request repair of application
|
# request repair of application
|
||||||
#
|
#
|
||||||
# periodically reports progress until completion
|
# periodically reports progress until completion
|
||||||
def repair_application
|
def self.repair_application
|
||||||
end
|
end
|
||||||
|
|
||||||
# request relocation of application
|
# request relocation of application
|
||||||
#
|
#
|
||||||
# periodically reports progress until completion
|
# periodically reports progress until completion
|
||||||
def move_application
|
def self.move_application
|
||||||
end
|
end
|
||||||
|
|
||||||
# request removal of application
|
# request removal of application
|
||||||
#
|
#
|
||||||
# periodically reports progress until completion
|
# periodically reports progress until completion
|
||||||
def uninstall_application
|
def self.uninstall_application
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ module W3DHubLauncher
|
|||||||
FETCH_URL = 0
|
FETCH_URL = 0
|
||||||
DOWNLOAD_URL = 1
|
DOWNLOAD_URL = 1
|
||||||
W3DHUB_API_CALL = 10
|
W3DHUB_API_CALL = 10
|
||||||
|
LAUNCHER_SETTINGS = 1000
|
||||||
|
LAUNCHER_UPDATE_SETTINGS = 1001
|
||||||
|
|
||||||
STATUS_ERROR = -1 # request has failed
|
STATUS_ERROR = -1 # request has failed
|
||||||
STATUS_PENDING = 0 # request has not yet started
|
STATUS_PENDING = 0 # request has not yet started
|
||||||
@@ -53,9 +55,8 @@ module W3DHubLauncher
|
|||||||
pp [event, data]
|
pp [event, data]
|
||||||
|
|
||||||
case event
|
case event
|
||||||
when STATUS_COMPLETE
|
when STATUS_ERROR, STATUS_COMPLETE
|
||||||
Request.requests.delete(self)
|
@callback&.call(data)
|
||||||
when STATUS_ERROR
|
|
||||||
Request.requests.delete(self)
|
Request.requests.delete(self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ require_relative "lib/pages/boot/terms"
|
|||||||
require_relative "lib/pages/boot/initial_setup"
|
require_relative "lib/pages/boot/initial_setup"
|
||||||
require_relative "lib/pages/boot/start_up"
|
require_relative "lib/pages/boot/start_up"
|
||||||
require_relative "lib/dialogs/about"
|
require_relative "lib/dialogs/about"
|
||||||
|
require_relative "lib/dialogs/downloads"
|
||||||
require_relative "lib/states/boot"
|
require_relative "lib/states/boot"
|
||||||
require_relative "lib/states/interface"
|
require_relative "lib/states/interface"
|
||||||
require_relative "lib/window"
|
require_relative "lib/window"
|
||||||
@@ -63,11 +64,11 @@ Thread.new do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
10.times do
|
# 10.times do
|
||||||
W3DHubLauncher::Worker::Request.new(W3DHubLauncher::Worker::Request::W3DHUB_API_CALL, { call: :fetch_applications }) do |result|
|
# W3DHubLauncher::Worker::Request.new(W3DHubLauncher::Worker::Request::W3DHUB_API_CALL, { call: :fetch_applications }) do |result|
|
||||||
pp result
|
# pp result
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
|
|
||||||
window = W3DHubLauncher::Window.new(width: 1280, height: 800, resizable: true)
|
window = W3DHubLauncher::Window.new(width: 1280, height: 800, resizable: true)
|
||||||
# window = W3DHubLauncher::Window.new(width: 1920, height: 1080, resizable: true)
|
# window = W3DHubLauncher::Window.new(width: 1920, height: 1080, resizable: true)
|
||||||
|
|||||||
Reference in New Issue
Block a user