navilocal 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/application/models/settings.rb +26 -0
- data/application/ui/navi/main_runner.rb +21 -0
- data/application/ui/navi/navi_install.rb +5 -15
- data/application/ui/navi/prefs.rb +2 -1
- data/gresource.bin +0 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 861dbe709ba809a68edc0946987309c0a205ff16ae38b14192087915cd3e8551
|
4
|
+
data.tar.gz: 7da2bff65c99dc4ddde05a193df385d6743cd00b2e37f3c7ebcd952b0d3c802f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c9012fa20266028a1e174139d02030fac27c45aa961902f3668d7cbab5485089f665db0157d0f03df0f7f79d93ea5c628eaf4e57cf606f251ddaebe9abd2383
|
7
|
+
data.tar.gz: f218689d97637462e139ab3164ee21bc0d82a6da9261d811b28068f0f9d8e551ed670dffdbd5852bb5c8736a8088de876b01cde262e1e05e1acba79d665147a3
|
@@ -55,6 +55,32 @@ module NaviClientInstaller
|
|
55
55
|
# raise ArgumentError, "Failed to load existing item: #{e.message}"
|
56
56
|
end
|
57
57
|
|
58
|
+
def self.remove_downloaded_ai
|
59
|
+
%x(rm -rf #{NaviClientInstaller::Settings::DEFAULT_STORAGE}/bin/naviai*)
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.download_ai log_storage = NaviClientInstaller::Settings::DEFAULT_STORAGE + '/screen.log'
|
63
|
+
downloaded = false
|
64
|
+
unless File.file?(File.expand_path File.join(NaviClientInstaller::Settings::DEFAULT_STORAGE,'bin', 'naviai'))
|
65
|
+
%x(rm -rf #{NaviClientInstaller::Settings::DEFAULT_STORAGE}/bin/naviai*)
|
66
|
+
|
67
|
+
|
68
|
+
url= %x(uname).gsub(/\s+/, "") == 'Darwin' ? "https://s3.amazonaws.com/locallockbox/naviaiDarwin.zip" : "https://s3.amazonaws.com/locallockbox/naviai.zip"
|
69
|
+
FileUtils.mkdir_p(NaviClientInstaller::Settings::DEFAULT_STORAGE + '/bin')
|
70
|
+
# @replace_string = true
|
71
|
+
%x(curl -o #{NaviClientInstaller::Settings::DEFAULT_STORAGE}/bin/naviai.zip #{url} 2>&1 | tee #{log_storage})
|
72
|
+
# @replace_string = false
|
73
|
+
|
74
|
+
%x(unzip -a #{NaviClientInstaller::Settings::DEFAULT_STORAGE}/bin/naviai.zip -d #{NaviClientInstaller::Settings::DEFAULT_STORAGE}/bin/ 2>&1 | tee #{log_storage})
|
75
|
+
%x(chmod 777 #{NaviClientInstaller::Settings::DEFAULT_STORAGE}/bin/naviai)
|
76
|
+
%x(rm -rf #{NaviClientInstaller::Settings::DEFAULT_STORAGE}/bin/naviai.zip 2>&1 | tee #{log_storage})
|
77
|
+
|
78
|
+
downloaded = true
|
79
|
+
|
80
|
+
end
|
81
|
+
return downloaded
|
82
|
+
end
|
83
|
+
|
58
84
|
# Resolves if an item is new
|
59
85
|
def is_new?
|
60
86
|
!File.exists? @filename
|
@@ -74,6 +74,15 @@ module NaviClientInstaller
|
|
74
74
|
terminate_worker_thread
|
75
75
|
}
|
76
76
|
|
77
|
+
@preferences.update_btn.signal_connect 'clicked' do |button|
|
78
|
+
|
79
|
+
terminate_worker_thread
|
80
|
+
stack.set_visible_child stack.get_child_by_name('page1')
|
81
|
+
NaviClientInstaller::Settings::remove_downloaded_ai
|
82
|
+
|
83
|
+
restart_process false
|
84
|
+
end
|
85
|
+
|
77
86
|
end
|
78
87
|
|
79
88
|
def set_logout_action logout_control, application
|
@@ -106,6 +115,8 @@ module NaviClientInstaller
|
|
106
115
|
@action_logout.set_enabled false
|
107
116
|
end
|
108
117
|
|
118
|
+
|
119
|
+
|
109
120
|
@action_logout.set_enabled false
|
110
121
|
end
|
111
122
|
|
@@ -141,6 +152,14 @@ module NaviClientInstaller
|
|
141
152
|
|
142
153
|
end
|
143
154
|
|
155
|
+
def download_ai
|
156
|
+
@logger.debug "Checking and Updating Navi services."
|
157
|
+
downloaded = NaviClientInstaller::Settings::download_ai
|
158
|
+
if downloaded
|
159
|
+
@logger.debug "Navi services updated.."
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
144
163
|
def start_fetching
|
145
164
|
|
146
165
|
@logger = CustomLogger.new @log_display.buffer, @iter_log
|
@@ -149,6 +168,8 @@ module NaviClientInstaller
|
|
149
168
|
|
150
169
|
begin
|
151
170
|
|
171
|
+
download_ai
|
172
|
+
|
152
173
|
if @settings.method == "imap"
|
153
174
|
@client = NaviEmailSync::ImapApi.new @settings.method
|
154
175
|
@logger.set_custom_logger @client.logger
|
@@ -86,24 +86,14 @@ module NaviClientInstaller
|
|
86
86
|
@text_display.set_text "Configuring services..."
|
87
87
|
@log_display.buffer.insert_markup(@iter_log, "Configuring services..\n")
|
88
88
|
|
89
|
-
|
90
|
-
%x(rm -rf #{NaviClientInstaller::Settings::DEFAULT_STORAGE}/bin/naviai*)
|
89
|
+
new_ai_downloaded = NaviClientInstaller::Settings.download_ai @log_storage
|
91
90
|
|
92
|
-
|
93
|
-
|
94
|
-
FileUtils.mkdir_p(NaviClientInstaller::Settings::DEFAULT_STORAGE + '/bin')
|
95
|
-
# @replace_string = true
|
96
|
-
%x(curl -o #{NaviClientInstaller::Settings::DEFAULT_STORAGE}/bin/naviai.zip #{url} 2>&1 | tee #{@log_storage})
|
97
|
-
# @replace_string = false
|
98
|
-
|
99
|
-
%x(unzip -a #{NaviClientInstaller::Settings::DEFAULT_STORAGE}/bin/naviai.zip -d #{NaviClientInstaller::Settings::DEFAULT_STORAGE}/bin/ 2>&1 | tee #{@log_storage})
|
100
|
-
%x(chmod 777 #{NaviClientInstaller::Settings::DEFAULT_STORAGE}/bin/naviai)
|
101
|
-
%x(rm -rf #{NaviClientInstaller::Settings::DEFAULT_STORAGE}/bin/naviai.zip 2>&1 | tee #{@log_storage})
|
102
|
-
|
103
|
-
@log_display.buffer.insert_markup(@iter_log, "Done Configuring processes..\n")
|
91
|
+
if new_ai_downloaded
|
92
|
+
@log_display.buffer.insert_markup(@iter_log, "Done Configuring services..\n")
|
104
93
|
else
|
105
|
-
@log_display.buffer.insert_markup(@iter_log, "
|
94
|
+
@log_display.buffer.insert_markup(@iter_log, "Services already installed...forwarding to the next step\n")
|
106
95
|
end
|
96
|
+
|
107
97
|
@progress_indicator.fraction = @limit_progress
|
108
98
|
|
109
99
|
end
|
@@ -7,6 +7,7 @@ module NaviClientInstaller
|
|
7
7
|
include CommonFunctions
|
8
8
|
|
9
9
|
attr_accessor :logout_btn
|
10
|
+
attr_accessor :update_btn
|
10
11
|
attr_accessor :window_ui
|
11
12
|
|
12
13
|
def initialize application
|
@@ -22,7 +23,7 @@ module NaviClientInstaller
|
|
22
23
|
application&.quit
|
23
24
|
end
|
24
25
|
|
25
|
-
|
26
|
+
@update_btn = builder.get_object("updateai_btn")
|
26
27
|
|
27
28
|
end
|
28
29
|
|
data/gresource.bin
CHANGED
Binary file
|