@@ -198,10 +198,13 @@ def _check_advanced_toggled(self, state):
198
198
def _button_clicked (self ):
199
199
self ._stop_countdown ()
200
200
201
- def _set_elide_text (self , widget , text , max_size = 132 ):
201
+ def truncate_text (self , text , max_size = 64 ):
202
202
if len (text ) > max_size :
203
203
text = text [:max_size ] + "..."
204
+ return text
204
205
206
+ def _set_elide_text (self , widget , text , max_size = 64 ):
207
+ text = self .truncate_text (text , max_size )
205
208
widget .setText (text )
206
209
207
210
def promptUser (self , connection , is_local , peer ):
@@ -296,6 +299,12 @@ def _set_app_description(self, description):
296
299
self .appDescriptionLabel .setFixedHeight (0 )
297
300
self .appDescriptionLabel .setText ("" )
298
301
302
+ self .appDescriptionLabel .setText (
303
+ "" .join (
304
+ filter (str .isprintable , self .appDescriptionLabel .text ())
305
+ )
306
+ )
307
+
299
308
def _set_app_path (self , app_name , app_args , con ):
300
309
# show the binary path if it's not part of the cmdline args:
301
310
# cmdline: telnet 1.1.1.1 (path: /usr/bin/telnet.netkit)
@@ -314,17 +323,29 @@ def _set_app_path(self, app_name, app_args, con):
314
323
self .appPathLabel .setVisible (False )
315
324
self .appPathLabel .setText ("" )
316
325
326
+ self .appPathLabel .setText (
327
+ "" .join (
328
+ filter (str .isprintable , self .appPathLabel .text ())
329
+ )
330
+ )
331
+
317
332
def _set_app_args (self , app_name , app_args ):
318
333
# if the app name and the args are the same, there's no need to display
319
334
# the args label (amule for example)
320
335
if app_name .lower () != app_args :
321
336
self .argsLabel .setVisible (True )
322
- self ._set_elide_text (self .argsLabel , app_args )
337
+ self ._set_elide_text (self .argsLabel , app_args , 256 )
323
338
self .argsLabel .setToolTip (app_args )
324
339
else :
325
340
self .argsLabel .setVisible (False )
326
341
self .argsLabel .setText ("" )
327
342
343
+ self .argsLabel .setText (
344
+ "" .join (
345
+ filter (str .isprintable , self .argsLabel .text ())
346
+ )
347
+ )
348
+
328
349
def _set_default_target (self , combo , con , app_name , app_args ):
329
350
# set appimage as default target if the process path starts with
330
351
# /tmp/._mount
@@ -514,6 +535,7 @@ def _get_popup_message(self, app_name, con):
514
535
the pop-up dialog. Example:
515
536
curl is connecting to www.opensnitch.io on TCP port 443
516
537
"""
538
+ app_name = self .truncate_text (app_name )
517
539
message = "<b>%s</b>" % app_name
518
540
if not self ._local :
519
541
message = QC .translate ("popups" , "<b>Remote</b> process %s running on <b>%s</b>" ) % ( \
0 commit comments