navilocal 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54d0e9d04a184b8e488a7bbf3dd2407231e66f017bfa776714b624c9e7380e6f
4
- data.tar.gz: cd4005cf40fc7aa61a10d17def609dafd295e7dc2a4d5d2cceb77d217db4cdb6
3
+ metadata.gz: '097f29ac473a6a3544c969d25c341cad78568863aae48ce6de5b3aba3ad2229c'
4
+ data.tar.gz: dc9457620cef61b5c47c5bef804695cda42345a4068249f07a985ed19f39e554
5
5
  SHA512:
6
- metadata.gz: a3c49fdc9a11501a42ddf8008572c0ae0f19d2f1fa7e60da26820083b6c87ac557e22a7394407d233b6b6932842ca2b7272d6c454df553725cf12378f3429bce
7
- data.tar.gz: '078bf6592a2c2f56b75451c452f275e8ae85318d8c53dec8dd9fcab9ec1f154b0b6c1c514763bcee35bcc9da277c7fb6dcdf8f2813a0e5955aaa72360167cd92'
6
+ metadata.gz: aa3ff78e8d4a24d975f2eb8a2871995ba2109371d1e6c56af9a433e56e970ed173d001a50ea3052db0d3aec657a5ee0ef596d233dfee7dc5142d1a67dc513f00
7
+ data.tar.gz: 4c71d5aec3a6de51f7e62d13ea0a84764e5da3b48966370ee8fe06853f29f1f7cb5ab3ae6a7c2d729689df044f808a71bc7dd1b6f29d1432dc06053921753879
@@ -31,6 +31,11 @@ module NaviClientInstaller
31
31
  image = builder.get_object("app_logo")
32
32
  image.set_from_resource('/com/navi/navi-client/images/navi-logo-small.png')
33
33
 
34
+ @image_loading = builder.get_object("loader_gif")
35
+ @estimated_rem = builder.get_object("estimated")
36
+ @email_header = builder.get_object("sync_header")
37
+ @image_loading.set_from_resource('/com/navi/navi-client/images/robot-working.gif')
38
+
34
39
  stack = builder.get_object("app_stack")
35
40
 
36
41
  @preferences = NaviClientInstaller::Prefs.new application
@@ -55,6 +60,9 @@ module NaviClientInstaller
55
60
  button.set_sensitive false
56
61
  @spinner_indicator.active = false
57
62
  @notifier.label = "Terminated.."
63
+ @estimated_rem.label = "Please click 'refresh' button to restart process."
64
+ @email_header.label = "Email Syncing Terminated!!!"
65
+ @image_loading.set_from_resource('/com/navi/navi-client/images/robot-idle.gif')
58
66
  end
59
67
 
60
68
 
@@ -126,6 +134,9 @@ module NaviClientInstaller
126
134
  @logger.debug "Restarting the process"
127
135
  @notifier.label = "Restarting.."
128
136
  @stop_btn.set_sensitive true
137
+ @estimated_rem.label = "Estimated Time: calculating..."
138
+ @email_header.label = "Emails Syncing"
139
+ @image_loading.set_from_resource('/com/navi/navi-client/images/robot-working.gif')
129
140
  start
130
141
 
131
142
  end
@@ -187,8 +198,12 @@ module NaviClientInstaller
187
198
  @notifier.label = "Fetching emails..."
188
199
  @logger.debug "Fetching emails"
189
200
  stamp = (Time.now.to_f * 1000).to_s
201
+ @total_time_estimated = nil
202
+ @total_time_estimated_parse = 4/(24 * 60)
190
203
  @client.fetch_emails do |email_content, index, isLast, id|
204
+ calculate_estimated_remaining @total_time_estimated, @client.total_emails - downloaded_mails, @total_time_estimated_parse
191
205
 
206
+ estimated_start = DateTime.now
192
207
  @logger.debug "processing email##{index + 1} with id #{id}"
193
208
  filenames << @client.process_email(email_content, id, stamp)
194
209
  downloaded_mails+=1
@@ -198,6 +213,7 @@ module NaviClientInstaller
198
213
  @logger.debug "processing Complete. OK..."
199
214
 
200
215
  if filenames.size == 50 || isLast
216
+ estimated_start_parse = DateTime.now
201
217
  sendEmailCompletedEvent = !sendEmailCompletedEvent
202
218
 
203
219
  @logger.debug "Sending Bulk Request for #{isLast ? filenames.size : 50} emails to parser."
@@ -225,8 +241,13 @@ module NaviClientInstaller
225
241
 
226
242
  stamp = (Time.now.to_f * 1000).to_s
227
243
 
244
+ estimated_end_parse = DateTime.now
245
+ @total_time_estimated_parse = estimated_end_parse - estimated_start_parse
246
+
228
247
  end
248
+ estimated_end = DateTime.now
229
249
 
250
+ @total_time_estimated = estimated_end - estimated_start
230
251
  end
231
252
 
232
253
  @logger.debug "All emails sync and parse completed."
@@ -240,6 +261,8 @@ module NaviClientInstaller
240
261
  downloaded_mails+=1
241
262
  @logger.debug "processing Complete. OK..."
242
263
  else
264
+ @email_header.label = "Emails Syncing"
265
+ @image_loading.set_from_resource('/com/navi/navi-client/images/robot-working.gif')
243
266
  @notifier.label = "Fetching emails..."
244
267
  @logger.debug "processing email##{index + 1} with id #{id}"
245
268
  @client.total_emails+=1
@@ -255,18 +278,26 @@ module NaviClientInstaller
255
278
  start_naviai
256
279
  else
257
280
  # stop_naviai
281
+ @email_header.label = "All Emails Downloaded"
282
+ @image_loading.set_from_resource('/com/navi/navi-client/images/robot-idle.gif')
258
283
  @logger.debug "Waiting new mails (IDLE loop)..."
259
284
  @notifier.label = "Waiting for the new emails.."
260
285
  end
261
286
  end
262
287
 
263
288
  @notifier.label = "Waiting for the new emails.."
289
+ @estimated_rem.label = "Waiting for new ones"
290
+
264
291
  @client.idle_loop(['UNSEEN'], folder, @settings.provider, @settings.username, @settings.password, callback, naviai_control)
265
292
  else
266
293
  @notifier.label = "Done.."
267
294
  @spinner_indicator.active = false
295
+ @estimated_rem.label = "Sync complete"
268
296
  end
269
297
 
298
+ @email_header.label = "All Emails Downloaded"
299
+ @image_loading.set_from_resource('/com/navi/navi-client/images/robot-idle.gif')
300
+
270
301
  else
271
302
  @logger.debug "Failed to connect with your email. Please recheck the configuration."
272
303
  end
@@ -278,6 +309,16 @@ module NaviClientInstaller
278
309
 
279
310
  end
280
311
 
312
+ def calculate_estimated_remaining time, factor, parse_time
313
+
314
+ if(@estimated_rem && time && factor)
315
+ e_time = ((time * factor * 24 * 60) + (parse_time * (factor/50) * 24 * 60)).to_f
316
+ @estimated_rem.label = "Estimated Time: #{e_time.to_f.round(2)} minutes"
317
+ else
318
+ @estimated_rem.label = "Estimated Time: calculating..."
319
+ end
320
+ end
321
+
281
322
 
282
323
  def prepare_ui btn_next, btn_back
283
324
 
data/bin/navilocal CHANGED
@@ -17,14 +17,14 @@ resource_bin = File.join(application_root_path, 'gresource.bin')
17
17
 
18
18
  # the commented block below is required to generate resources folder or update if any changes
19
19
 
20
- # resource_xml = File.join(application_root_path, 'resources', 'gresources.xml')
21
- # # # Build the binary
22
- # system("glib-compile-resources",
23
- # "--target", resource_bin,
24
- # "--sourcedir", File.dirname(resource_xml),
25
- # resource_xml)
26
- #
27
- #
20
+ resource_xml = File.join(application_root_path, 'resources', 'gresources.xml')
21
+ # # Build the binary
22
+ system("glib-compile-resources",
23
+ "--target", resource_bin,
24
+ "--sourcedir", File.dirname(resource_xml),
25
+ resource_xml)
26
+
27
+
28
28
  #
29
29
  resource = Gio::Resource.load(resource_bin)
30
30
  Gio::Resources.register(resource)
data/gresource.bin CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: navilocal
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Msanjib
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 0.0.4
47
+ version: 0.0.6
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.0.4
54
+ version: 0.0.6
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: httparty
57
57
  requirement: !ruby/object:Gem::Requirement