| ... |
... |
@@ -174,10 +174,6 @@ def _populate_grid(self, contact): |
|
174
|
174
|
self._ui.sub.show()
|
|
175
|
175
|
self._ui.sub_label.show()
|
|
176
|
176
|
|
|
177
|
|
- # Idle time
|
|
178
|
|
- # TODO
|
|
179
|
|
- # self._set_idle_time(contact)
|
|
180
|
|
-
|
|
181
|
177
|
# PEP info
|
|
182
|
178
|
# TODO
|
|
183
|
179
|
# self._append_pep_info(contact)
|
| ... |
... |
@@ -219,15 +215,30 @@ def _build_resource_grid(self, resources, scale): |
|
219
|
215
|
if contact.status:
|
|
220
|
216
|
row_num += 1
|
|
221
|
217
|
status_text = GLib.markup_escape_text(contact.status)
|
|
222
|
|
- status_label = Gtk.Label()
|
|
|
218
|
+ status_label = Gtk.Label(label=status_text)
|
|
223
|
219
|
status_label.set_halign(Gtk.Align.START)
|
|
224
|
220
|
status_label.set_xalign(0)
|
|
225
|
221
|
status_label.set_ellipsize(Pango.EllipsizeMode.END)
|
|
226
|
222
|
status_label.set_max_width_chars(30)
|
|
227
|
|
- status_label.set_text(status_text)
|
|
228
|
223
|
self._ui.resource_grid.attach(
|
|
229
|
224
|
status_label, 1, row_num, 1, 1)
|
|
230
|
225
|
|
|
|
226
|
+ if contact.idle_time:
|
|
|
227
|
+ row_num += 1
|
|
|
228
|
+ idle_time = time.localtime(contact.idle_time)
|
|
|
229
|
+ idle_time = datetime(*(idle_time[:6]))
|
|
|
230
|
+ current = datetime.now()
|
|
|
231
|
+ if idle_time.date() == current.date():
|
|
|
232
|
+ formatted = idle_time.strftime('%X')
|
|
|
233
|
+ else:
|
|
|
234
|
+ formatted = idle_time.strftime('%c')
|
|
|
235
|
+ idle_text = _('Idle since: %s') % formatted
|
|
|
236
|
+ idle_label = Gtk.Label(label=idle_text)
|
|
|
237
|
+ idle_label.set_halign(Gtk.Align.START)
|
|
|
238
|
+ idle_label.set_xalign(0)
|
|
|
239
|
+ self._ui.resource_grid.attach(
|
|
|
240
|
+ idle_label, 1, row_num, 1, 1)
|
|
|
241
|
+
|
|
231
|
242
|
row_num += 1
|
|
232
|
243
|
|
|
233
|
244
|
self._ui.resource_grid.show_all()
|
| ... |
... |
@@ -257,20 +268,6 @@ def _append_pep_info(self, contact): |
|
257
|
268
|
self._ui.location.show()
|
|
258
|
269
|
self._ui.location_label.show()
|
|
259
|
270
|
|
|
260
|
|
- def _set_idle_time(self, contact):
|
|
261
|
|
- if contact.idle_time:
|
|
262
|
|
- idle_time = contact.idle_time
|
|
263
|
|
- idle_time = time.localtime(contact.idle_time)
|
|
264
|
|
- idle_time = datetime(*(idle_time[:6]))
|
|
265
|
|
- current = datetime.now()
|
|
266
|
|
- if idle_time.date() == current.date():
|
|
267
|
|
- formatted = idle_time.strftime('%X')
|
|
268
|
|
- else:
|
|
269
|
|
- formatted = idle_time.strftime('%c')
|
|
270
|
|
- self._ui.idle_since.set_text(formatted)
|
|
271
|
|
- self._ui.idle_since.show()
|
|
272
|
|
- self._ui.idle_since_label.show()
|
|
273
|
|
-
|
|
274
|
271
|
|
|
275
|
272
|
class FileTransfersTooltip:
|
|
276
|
273
|
def __init__(self):
|