Skip to content

Commit

Permalink
ui, proc details: better descriptors formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-iniguez-goya committed Nov 20, 2020
1 parent c1e8bc3 commit 0b806e0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
6 changes: 4 additions & 2 deletions ui/opensnitch/dialogs/processdetails.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def __init__(self, parent=None):
self.TABS[self.TAB_STACK]['text'] = self.textStack
self.TABS[self.TAB_ENVS]['text'] = self.textEnv

self.TABS[self.TAB_DESCRIPTORS]['text'].setFont(QtGui.QFont("monospace"))

self.iconStart = QtGui.QIcon.fromTheme("media-playback-start")
self.iconPause = QtGui.QIcon.fromTheme("media-playback-pause")

Expand Down Expand Up @@ -299,9 +301,9 @@ def _load_mem_data(self, mem):
self.labelStatm.setText(memText)

def _load_descriptors(self, descriptors):
text = "%-8s\t%-35s\t%4s -> %s\n\n" % ("Size", "Time", "Name", "Symlink")
text = "%-12s%-40s%-8s -> %s\n\n" % ("Size", "Time", "Name", "Symlink")
for d in descriptors:
text += "%-8s\t%-35s\t%4s -> %s\n" % (str(d['Size']), d['ModTime'], d['Name'], d['SymLink'])
text += "{:<12}{:<40}{:<8} -> {}\n".format(str(d['Size']), d['ModTime'], d['Name'], d['SymLink'])

self._set_tab_text(self.TAB_DESCRIPTORS, text)

Expand Down
14 changes: 12 additions & 2 deletions ui/opensnitch/res/process_details.ui
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
<property name="text">
<string>CWD: loading...</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
Expand Down Expand Up @@ -118,7 +121,7 @@
<string>Status</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<item row="0" column="1">
<widget class="QPlainTextEdit" name="textStatus">
<property name="undoRedoEnabled">
<bool>false</bool>
Expand Down Expand Up @@ -209,7 +212,14 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="comboPids"/>
<widget class="QComboBox" name="comboPids">
<property name="maxVisibleItems">
<number>100</number>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
Expand Down

0 comments on commit 0b806e0

Please sign in to comment.