Kaydet (Commit) d8d107b5 authored tarafından Hakan Dündar's avatar Hakan Dündar

Several improvements (new features, performance, GUI, etc.)

üst bec4368c
# System Monitoring Center
### v1.16.0
* New: Updated GUI design (CPU, RAM, Disk, Network, GPU tabs)
* New: Highlighting selected device graph between other devices
* New: Option for showing disk/network speed as powers of 1000
* Simplified several customization menus
* Fix: Graph scaling (Disk and Network tabs)
* Minor improvements (GUI, performance, etc.)
### v1.15.0
* New: Unified tab and device selector (Performance tab)
* Replaced disk read/write time with read/write data (Disk tab)
......
......@@ -5,16 +5,16 @@ Name[tr]=Sistem Gözlem Merkezi
GenericName=System Monitor
GenericName[pt_BR]=Monitor do Sistema
GenericName[tr]=Sistem Gözlemcisi
Comment=Gets information about system performance and usage.
Comment=Multi-featured system monitor.
Comment[pt_BR]=Obtenha informações sobre o desempenho e utilização do sistema.
Comment[tr]=Sistem performansı ve kullanımı hakkında bilgi verir.
Comment[tr]=Çok özellikli sistem gözlemcisi.
Exec=system-monitoring-center
Icon=system-monitoring-center
Terminal=false
Type=Application
Categories=System;
StartupNotify=true
Keywords=system monitor;task manager;center;performance;speed;frequency;usage;cpu;ram;swap;memory;storage;network;download;fps;ratio;processes;users;startup;services;os;
Keywords[pt_BR]=monitor do sistema;gerenciador de tarefas;desempenho;velocidade;frequência;uso de CPU;uso de ram;memória swap;uso de memória;armazenamento;uso de rede;velocidade de download;fps;processos;usuários;programas de inicialização;serviços;os;
Keywords[tr]=sistem gözlemcisi;görev yöneticisi;performans;hız;frekans;kullanım;cpu;mib;ram;takas;bellek;depolama;indirme;fps;işlemler;kullanıcılar;başlangıç;servisler;os;is;
Keywords=system monitor;task manager;performance;cpu;ram;swap;memory;disk;network;processes;users;startup;services;
Keywords[pt_BR]=monitor do sistema;gerenciador de tarefas;desempenho;uso de CPU;uso de ram;memória swap;uso de memória;armazenamento;uso de rede;processos;usuários;programas de inicialização;serviços;
Keywords[tr]=sistem gözlemcisi;görev yöneticisi;performans;cpu;mib;ram;takas;bellek;disk;işlemler;kullanıcılar;başlangıç;servisler;
......@@ -77,7 +77,7 @@ class Config:
self.config_default_general_general_func()
self.config_default_performance_cpu_func()
self.config_default_performance_ram_func()
self.config_default_performance_memory_func()
self.config_default_performance_disk_func()
self.config_default_performance_network_func()
self.config_default_performance_gpu_func()
......@@ -116,10 +116,10 @@ class Config:
self.selected_cpu_core = ""
# ----------------------- Called for default RAM Tab settings -----------------------
def config_default_performance_ram_func(self):
# ----------------------- Called for default Memory Tab settings -----------------------
def config_default_performance_memory_func(self):
self.chart_line_color_ram_swap_percent = [0.27, 0.49, 1.0, 1.0]
self.chart_line_color_memory_percent = [0.27, 0.49, 1.0, 1.0]
self.show_memory_usage_per_memory = 0
self.performance_memory_data_precision = 1
self.performance_memory_data_unit = 0
......@@ -278,7 +278,7 @@ class Config:
self.performance_cpu_usage_percent_precision = int(config_values[config_variables.index("performance_cpu_usage_percent_precision")])
self.selected_cpu_core = config_values[config_variables.index("selected_cpu_core")]
self.chart_line_color_ram_swap_percent = [float(value) for value in config_values[config_variables.index("chart_line_color_ram_swap_percent")].strip("[]").split(", ")]
self.chart_line_color_memory_percent = [float(value) for value in config_values[config_variables.index("chart_line_color_memory_percent")].strip("[]").split(", ")]
self.show_memory_usage_per_memory = int(config_values[config_variables.index("show_memory_usage_per_memory")])
self.performance_memory_data_precision = int(config_values[config_variables.index("performance_memory_data_precision")])
self.performance_memory_data_unit = int(config_values[config_variables.index("performance_memory_data_unit")])
......@@ -363,8 +363,8 @@ class Config:
config_write_text = config_write_text + "selected_cpu_core = " + str(self.selected_cpu_core) + "\n"
config_write_text = config_write_text + "\n"
config_write_text = config_write_text + "[Performance Tab - RAM]" + "\n"
config_write_text = config_write_text + "chart_line_color_ram_swap_percent = " + str(self.chart_line_color_ram_swap_percent) + "\n"
config_write_text = config_write_text + "[Performance Tab - Memory]" + "\n"
config_write_text = config_write_text + "chart_line_color_memory_percent = " + str(self.chart_line_color_memory_percent) + "\n"
config_write_text = config_write_text + "show_memory_usage_per_memory = " + str(self.show_memory_usage_per_memory) + "\n"
config_write_text = config_write_text + "performance_memory_data_precision = " + str(self.performance_memory_data_precision) + "\n"
config_write_text = config_write_text + "performance_memory_data_unit = " + str(self.performance_memory_data_unit) + "\n"
......
......@@ -42,12 +42,6 @@ class Cpu:
self.label1112 = builder.get_object('label1112')
self.label1113 = builder.get_object('label1113')
import time
time1 = time.time()
# Add viewports for showing borders around some the performance data and round the corners of the viewports.
css = b"viewport {border-radius: 8px 8px 8px 8px;}"
style_provider = Gtk.CssProvider()
......@@ -70,11 +64,6 @@ class Cpu:
self.separator1104 = builder.get_object('separator1104')
self.separator1104.get_style_context().add_provider(style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
print(time.time() - time1)
# Get chart functions from another module and define as local objects for lower CPU usage.
self.performance_line_charts_draw_func = Performance.performance_line_charts_draw_func
self.performance_line_charts_enter_notify_event_func = Performance.performance_line_charts_enter_notify_event_func
......
......@@ -496,50 +496,6 @@ class Disk:
return disk_path
# ----------------------- Get disk revision -----------------------
def disk_revision_func(self, selected_disk, disk_type):
disk_revision = "-"
if disk_type == _tr("Disk"):
try:
with open("/sys/class/block/" + selected_disk + "/device/rev") as reader:
disk_revision = reader.read().strip()
except Exception:
pass
return disk_revision
# ----------------------- Get disk serial number -----------------------
def disk_serial_number_func(self, selected_disk, disk_type):
disk_serial_number = "-"
if disk_type == _tr("Disk"):
disk_id_list = os.listdir("/dev/disk/by-id/")
for id in disk_id_list:
if os.path.realpath("/dev/disk/by-id/" + id).split("/")[-1] == selected_disk and ("/dev/disk/by-id/" + id).startswith("wwn-") == False:
disk_serial_number = id.split("-")[-1]
if "part" in disk_serial_number:
disk_serial_number = id.split("-")[-2]
return disk_serial_number
# ----------------------- Get disk UUID -----------------------
def disk_uuid_func(self, selected_disk):
disk_uuid = "-"
try:
disk_uuid_list = os.listdir("/dev/disk/by-uuid/")
for uuid in disk_uuid_list:
if os.path.realpath("/dev/disk/by-uuid/" + uuid).split("/")[-1] == selected_disk:
disk_uuid = uuid
except FileNotFoundError:
pass
return disk_uuid
# ----------------------- Update disk usage percentages on disk list between Performance tab sub-tabs -----------------------
def disk_update_disk_usage_percentages_on_disk_list_func(self):
......
......@@ -41,9 +41,6 @@ class DiskDetails:
self.label1313w = builder1301w.get_object('label1313w')
self.label1314w = builder1301w.get_object('label1314w')
self.label1315w = builder1301w.get_object('label1315w')
self.label1316w = builder1301w.get_object('label1316w')
self.label1317w = builder1301w.get_object('label1317w')
self.label1322w = builder1301w.get_object('label1322w')
# Connect GUI signals
self.window1301w.connect("delete-event", self.on_window1301w_delete_event)
......@@ -84,9 +81,6 @@ class DiskDetails:
self.label1313w.set_text("--")
self.label1314w.set_text("--")
self.label1315w.set_text("--")
self.label1316w.set_text("--")
self.label1317w.set_text("--")
self.label1322w.set_text("--")
# ----------------------------------- Disk - Disk Details Foreground Function -----------------------------------
......@@ -118,9 +112,6 @@ class DiskDetails:
disk_label = Disk.disk_label_func(selected_disk)
disk_partition_label = Disk.disk_partition_label_func(selected_disk)
disk_path = Disk.disk_path_func(selected_disk)
disk_revision = Disk.disk_revision_func(selected_disk, disk_type)
disk_serial_number = Disk.disk_serial_number_func(selected_disk, disk_type)
disk_uuid = Disk.disk_uuid_func(selected_disk)
# Set label text by using storage/disk data
......@@ -138,9 +129,6 @@ class DiskDetails:
self.label1313w.set_text(disk_partition_label)
self.label1314w.set_text(disk_mount_point)
self.label1315w.set_text(disk_path)
self.label1316w.set_text(disk_revision)
self.label1317w.set_text(disk_serial_number)
self.label1322w.set_text(disk_uuid)
# ----------------------------------- Disk Details - Run Function -----------------------------------
......
This diff is collapsed.
......@@ -240,7 +240,7 @@ class MainGUI:
MainMenusDialogs.popover1001p.popup()
# ----------------------- "Performance, Processes, Users, Startup, Services, System, CPU, RAM, Disk, Network, GPU, Sensors" Radiobuttons -----------------------
# ----------------------- "Performance, Processes, Users, Startup, Services, System, CPU, Memory, Disk, Network, GPU, Sensors" Radiobuttons -----------------------
def on_main_gui_tab_radiobuttons_toggled(self, widget):
if widget.get_active() == True:
......@@ -289,7 +289,7 @@ class MainGUI:
if self.radiobutton1.get_active() == True:
self.stack1.set_visible_child(self.grid1)
if remember_last_opened_tabs_on_application_start == 1:
# No need to save Config values after this value is defined. Because save operation is performed for Performance tab sub-tabs (CPU, RAM, Disk, Network, GPU, Sensors tabs).
# No need to save Config values after this value is defined. Because save operation is performed for Performance tab sub-tabs (CPU, Memory, Disk, Network, GPU, Sensors tabs).
Config.default_main_tab = 0
# This value is used in order to detect the current tab without checking GUI obejects for lower CPU usage. This value is not saved.
Config.current_main_tab = 0
......@@ -316,7 +316,7 @@ class MainGUI:
self.main_gui_device_selection_list_func()
return
# Switch to "RAM" tab
# Switch to "Memory" tab
elif self.radiobutton1002.get_active() == True:
self.stack1001.set_visible_child(self.grid1002)
if remember_last_opened_tabs_on_application_start == 1:
......@@ -324,12 +324,12 @@ class MainGUI:
Config.config_save_func()
Config.performance_tab_current_sub_tab = 1
if self.grid1002.get_child_at(0,0) == None:
global Ram
from Ram import Ram
self.grid1002.attach(Ram.grid1201, 0, 0, 1, 1)
if Ram.initial_already_run == 0:
GLib.idle_add(Ram.ram_initial_func)
GLib.idle_add(Ram.ram_loop_func)
global Memory
from Memory import Memory
self.grid1002.attach(Memory.grid1201, 0, 0, 1, 1)
if Memory.initial_already_run == 0:
GLib.idle_add(Memory.memory_initial_func)
GLib.idle_add(Memory.memory_loop_func)
self.main_gui_device_selection_list_func()
return
......@@ -665,7 +665,7 @@ class MainGUI:
if performance_tab_current_sub_tab == 0:
GLib.idle_add(Cpu.cpu_loop_func)
if performance_tab_current_sub_tab == 1:
GLib.idle_add(Ram.ram_loop_func)
GLib.idle_add(Memory.memory_loop_func)
if performance_tab_current_sub_tab == 2:
GLib.idle_add(Disk.disk_loop_func)
if performance_tab_current_sub_tab == 3:
......
......@@ -14,14 +14,14 @@ from Performance import Performance
# Define class
class Ram:
class Memory:
# ----------------------- Always called when object is generated -----------------------
def __init__(self):
# Get GUI objects from file
builder = Gtk.Builder()
builder.add_from_file(os.path.dirname(os.path.realpath(__file__)) + "/../ui/RamTab.ui")
builder.add_from_file(os.path.dirname(os.path.realpath(__file__)) + "/../ui/MemoryTab.ui")
# Get GUI objects
self.grid1201 = builder.get_object('grid1201')
......@@ -90,34 +90,34 @@ class Ram:
# ----------------------- "customizations menu" Button -----------------------
def on_button1201_clicked(self, widget):
from RamMenu import RamMenu
RamMenu.popover1201p.set_relative_to(widget)
RamMenu.popover1201p.set_position(1)
RamMenu.popover1201p.popup()
from MemoryMenu import MemoryMenu
MemoryMenu.popover1201p.set_relative_to(widget)
MemoryMenu.popover1201p.set_position(1)
MemoryMenu.popover1201p.popup()
# ----------------------- Called for opening RAM Hardware Window -----------------------
# ----------------------- Called for opening RAM Hardware Information Window -----------------------
def on_eventbox1201_button_click_event(self, widget, event):
if event.button == 1:
from RamHardwareInformation import RamHardwareInformation
from MemoryRamHardware import MemoryRamHardware
# Run function to get RAM hardware information text (polkit dialog will be shown for getting this information).
RamHardwareInformation.ram_hardware_information_get_func()
MemoryRamHardware.memory_ram_hardware_information_get_func()
# This statement is used in order to avoid errors if user closes polkit window without entering password.
if RamHardwareInformation.memory_hardware_information_text != "":
RamHardwareInformation.window1201w.show()
if MemoryRamHardware.memory_ram_hardware_information_text != "":
MemoryRamHardware.window1201w.show()
# ----------------------- Called for opening RAM Hardware Window -----------------------
# ----------------------- Called for opening Swap Details Window -----------------------
def on_eventbox1202_button_click_event(self, widget, event):
if event.button == 1:
from RamSwapDetails import RamSwapDetails
RamSwapDetails.window1201w2.show()
from MemorySwapDetails import MemorySwapDetails
MemorySwapDetails.window1201w2.show()
# ----------------------------------- RAM - Initial Function -----------------------------------
def ram_initial_func(self):
# ----------------------------------- Memory - Initial Function -----------------------------------
def memory_initial_func(self):
# Define data unit conversion function objects in for lower CPU usage.
self.performance_define_data_unit_converter_variables_func = Performance.performance_define_data_unit_converter_variables_func
......@@ -165,7 +165,7 @@ class Ram:
ram_total = int(line.split()[1]) * 1024
# Set RAM tab label texts by using information get
# Set Memory tab label texts by using information get
if total_physical_ram != f'[{_tr("Unknown")}]':
self.label1201.set_text(_tr("Physical RAM") + ": " + str(self.performance_data_unit_converter_func("data", "none", total_physical_ram, 0, 1)))
else:
......@@ -174,8 +174,8 @@ class Ram:
self.initial_already_run = 1
# ----------------------------------- RAM - Get RAM Data Function -----------------------------------
def ram_loop_func(self):
# ----------------------------------- Memory - Get Memory Data Function -----------------------------------
def memory_loop_func(self):
ram_used = Performance.ram_used
ram_usage_percent = Performance.ram_usage_percent
......@@ -195,7 +195,7 @@ class Ram:
self.drawingarea1202.queue_draw()
# Set and update RAM tab label texts by using information get
# Set and update Memory tab label texts by using information get
self.label1202.set_text(_tr("Swap Memory") + ": " + str(self.performance_data_unit_converter_func("data", "none", swap_total, 0, 1)))
self.label1203.set_text(f'{self.performance_data_unit_converter_func("data", "none", ram_used, performance_memory_data_unit, performance_memory_data_precision)} ({ram_usage_percent[-1]:.0f}%)')
self.label1204.set_text(self.performance_data_unit_converter_func("data", "none", ram_available, performance_memory_data_unit, performance_memory_data_precision))
......@@ -208,5 +208,5 @@ class Ram:
# Generate object
Ram = Ram()
Memory = Memory()
......@@ -10,18 +10,18 @@ import subprocess
from Config import Config
from Performance import Performance
from Ram import Ram
from Memory import Memory
# Define class
class RamMenu:
class MemoryMenu:
# ----------------------- Always called when object is generated -----------------------
def __init__(self):
# Get GUI objects from file
builder = Gtk.Builder()
builder.add_from_file(os.path.dirname(os.path.realpath(__file__)) + "/../ui/RamMenus.ui")
builder.add_from_file(os.path.dirname(os.path.realpath(__file__)) + "/../ui/MemoryMenus.ui")
# Get GUI objects
self.popover1201p = builder.get_object('popover1201p')
......@@ -41,7 +41,7 @@ class RamMenu:
# ----------------------- Called for connecting some of the signals in order to disconnect them for setting GUI -----------------------
def ram_tab_customization_popover_connect_signals_func(self):
def memory_tab_customization_popover_connect_signals_func(self):
self.radiobutton1201p.connect("toggled", self.on_radiobutton1201p_toggled)
self.radiobutton1202p.connect("toggled", self.on_radiobutton1202p_toggled)
......@@ -51,7 +51,7 @@ class RamMenu:
# ----------------------- Called for disconnecting some of the signals in order to connect them for setting GUI -----------------------
def ram_tab_customization_popover_disconnect_signals_func(self):
def memory_tab_customization_popover_disconnect_signals_func(self):
self.radiobutton1201p.disconnect_by_func(self.on_radiobutton1201p_toggled)
self.radiobutton1202p.disconnect_by_func(self.on_radiobutton1202p_toggled)
......@@ -64,11 +64,11 @@ class RamMenu:
def on_popover1201p_show(self, widget):
try:
self.ram_tab_customization_popover_disconnect_signals_func()
self.memory_tab_customization_popover_disconnect_signals_func()
except TypeError:
pass
self.ram_tab_popover_set_gui()
self.ram_tab_customization_popover_connect_signals_func()
self.memory_tab_popover_set_gui()
self.memory_tab_customization_popover_connect_signals_func()
# ----------------------- "RAM" Radiobutton -----------------------
......@@ -78,8 +78,8 @@ class RamMenu:
Config.show_memory_usage_per_memory = 0
# Apply changes immediately (without waiting update interval).
Ram.ram_initial_func()
Ram.ram_loop_func()
Memory.memory_initial_func()
Memory.memory_loop_func()
Config.config_save_func()
......@@ -90,8 +90,8 @@ class RamMenu:
Config.show_memory_usage_per_memory = 1
# Apply changes immediately (without waiting update interval).
Ram.ram_initial_func()
Ram.ram_loop_func()
Memory.memory_initial_func()
Memory.memory_loop_func()
Config.config_save_func()
......@@ -101,8 +101,8 @@ class RamMenu:
Config.performance_memory_data_precision = Config.number_precision_list[widget.get_active()][2]
# Apply changes immediately (without waiting update interval).
Ram.ram_initial_func()
Ram.ram_loop_func()
Memory.memory_initial_func()
Memory.memory_loop_func()
Config.config_save_func()
......@@ -115,17 +115,17 @@ class RamMenu:
Config.performance_memory_data_unit = 1
# Apply changes immediately (without waiting update interval).
Ram.ram_initial_func()
Ram.ram_loop_func()
Memory.memory_initial_func()
Memory.memory_loop_func()
Config.config_save_func()
# ----------------------- "foreground and background color" Buttons -----------------------
# ----------------------- "Graph Color" Button -----------------------
def on_chart_color_buttons_clicked(self, widget):
# Get current foreground/background color of the chart and set it as selected color of the dialog when dialog is shown.
# Get current foreground color of the chart and set it as selected color of the dialog when dialog is shown.
if widget == self.button1201p:
red, blue, green, alpha = Config.chart_line_color_ram_swap_percent
red, blue, green, alpha = Config.chart_line_color_memory_percent
self.colorchooserdialog1201.set_rgba(Gdk.RGBA(red, blue, green, alpha))
dialog_response = self.colorchooserdialog1201.run()
......@@ -133,13 +133,13 @@ class RamMenu:
if dialog_response == Gtk.ResponseType.OK:
selected_color = self.colorchooserdialog1201.get_rgba()
if widget == self.button1201p:
Config.chart_line_color_ram_swap_percent = [selected_color.red, selected_color.green, selected_color.blue, selected_color.alpha]
Config.chart_line_color_memory_percent = [selected_color.red, selected_color.green, selected_color.blue, selected_color.alpha]
self.colorchooserdialog1201.hide()
# Apply changes immediately (without waiting update interval).
Ram.ram_initial_func()
Ram.ram_loop_func()
Memory.memory_initial_func()
Memory.memory_loop_func()
Config.config_save_func()
......@@ -147,19 +147,19 @@ class RamMenu:
def on_button1203p_clicked(self, widget):
# Load default settings
Config.config_default_performance_ram_func()
Config.config_default_performance_memory_func()
Config.config_save_func()
# Apply changes immediately (without waiting update interval).
Ram.ram_initial_func()
Ram.ram_loop_func()
self.ram_tab_customization_popover_disconnect_signals_func()
self.ram_tab_popover_set_gui()
self.ram_tab_customization_popover_connect_signals_func()
Memory.memory_initial_func()
Memory.memory_loop_func()
self.memory_tab_customization_popover_disconnect_signals_func()
self.memory_tab_popover_set_gui()
self.memory_tab_customization_popover_connect_signals_func()
# ----------------------- Called for setting menu GUI items -----------------------
def ram_tab_popover_set_gui(self):
def memory_tab_popover_set_gui(self):
# Select radiobutton appropriate for seleted/all devices chart setting
if Config.show_memory_usage_per_memory == 0:
......@@ -173,7 +173,7 @@ class RamMenu:
if Config.performance_memory_data_unit == 1:
self.radiobutton1204p.set_active(True)
# Add RAM usage data precision data into combobox
# Add Memory usage data precision data into combobox
liststore1201p = Gtk.ListStore()
liststore1201p.set_column_types([str, int])
self.combobox1201p.set_model(liststore1201p)
......@@ -188,5 +188,5 @@ class RamMenu:
# Generate object
RamMenu = RamMenu()
MemoryMenu = MemoryMenu()
......@@ -11,14 +11,14 @@ from locale import gettext as _tr
# Define class
class RamHardwareInformation:
class MemoryRamHardware:
# ----------------------- Always called when object is generated -----------------------
def __init__(self):
# Get GUI objects from file
builder = Gtk.Builder()
builder.add_from_file(os.path.dirname(os.path.realpath(__file__)) + "/../ui/RamHardwareWindow.ui")
builder.add_from_file(os.path.dirname(os.path.realpath(__file__)) + "/../ui/MemoryRamHardwareWindow.ui")
# Get GUI objects
self.window1201w = builder.get_object('window1201w')
......@@ -43,21 +43,21 @@ class RamHardwareInformation:
self.label1201w.set_text("-")
# Set label text for showing RAM hardware information.
try:
self.label1201w.set_text(self.memory_hardware_information_text)
self.label1201w.set_text(self.memory_ram_hardware_information_text)
# "try-except" is used in order to avoid errors if user closed polkit dialog without entering password.
except AttributeError:
pass
# ----------------------- Called for getting RAM hardware information -----------------------
def ram_hardware_information_get_func(self):
def memory_ram_hardware_information_get_func(self):
# This list is defined in order to make some command output strings to be translated into other languages.
ram_hardware_information_text_list = [_tr("Unknown"), _tr("None")]
memory_ram_hardware_information_text_list = [_tr("Unknown"), _tr("None")]
# Set initial value of "memory_hardware_information_text". Hardware information will be appended to this string.
# Set initial value of "memory_ram_hardware_information_text". Hardware information will be appended to this string.
# This value will also be used for preventing showing RAM hardware Information window if user closes polkit window without entering password.
self.memory_hardware_information_text = ""
self.memory_ram_hardware_information_text = ""
# "sudo" has to be used for using "pkexec" to run "dmidecode" with root privileges.
try:
......@@ -82,8 +82,8 @@ class RamHardwareInformation:
if line.startswith("Number Of Devices:"):
number_of_devices = line.split(":")[1].strip()
continue
self.memory_hardware_information_text = self.memory_hardware_information_text + _tr("Maximum Capacity") + " : " + maximum_capacity
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + _tr("Number Of Devices") + " : " + number_of_devices + "\n"
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + _tr("Maximum Capacity") + " : " + maximum_capacity
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + _tr("Number Of Devices") + " : " + number_of_devices + "\n"
# Perform the following operations if "Memory Device" is found in "dmidecode_output" output. This information may not be available on some systems.
if "Memory Device" in dmidecode_output:
......@@ -122,15 +122,15 @@ class RamHardwareInformation:
if line.startswith("Manufacturer:"):
memory_manufacturer = line.split(":")[1].strip()
continue
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" + "\n"
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + _tr("Capacity") + " : " + memory_size
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + _tr("Type") + " : " + memory_type
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + _tr("Speed/Frequency") + " : " + memory_speed
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + _tr("Manufacturer") + " : " + memory_manufacturer
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + _tr("Form Factor") + " : " + memory_form_factor
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + _tr("Locator") + " : " + memory_locator
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + _tr("Bank Locator") + " : " + memory_bank_locator
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n"
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" + "\n"
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + _tr("Capacity") + " : " + memory_size
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + _tr("Type") + " : " + memory_type
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + _tr("Speed/Frequency") + " : " + memory_speed
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + _tr("Manufacturer") + " : " + memory_manufacturer
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + _tr("Form Factor") + " : " + memory_form_factor
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + _tr("Locator") + " : " + memory_locator
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + _tr("Bank Locator") + " : " + memory_bank_locator
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n"
# Perform the following operations if "Memory Device" is not found in "dmidecode_output" output. This information may not be available on some systems.
if "Memory Device" not in dmidecode_output:
......@@ -142,16 +142,16 @@ class RamHardwareInformation:
memory_speed = "-"
memory_manufacturer = "-"
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" + "\n"
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + _tr("Capacity") + " : " + memory_size
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + _tr("Type") + " : " + memory_type
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + _tr("Speed/Frequency") + " : " + memory_speed
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + _tr("Manufacturer") + " : " + memory_manufacturer
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + _tr("Form Factor") + " : " + memory_form_factor
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + _tr("Locator") + " : " + memory_locator
self.memory_hardware_information_text = self.memory_hardware_information_text + "\n" + _tr("Bank Locator") + " : " + memory_bank_locator
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" + "\n"
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + _tr("Capacity") + " : " + memory_size
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + _tr("Type") + " : " + memory_type
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + _tr("Speed/Frequency") + " : " + memory_speed
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + _tr("Manufacturer") + " : " + memory_manufacturer
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + _tr("Form Factor") + " : " + memory_form_factor
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + _tr("Locator") + " : " + memory_locator
self.memory_ram_hardware_information_text = self.memory_ram_hardware_information_text + "\n" + _tr("Bank Locator") + " : " + memory_bank_locator
# Generate object
RamHardwareInformation = RamHardwareInformation()
MemoryRamHardware = MemoryRamHardware()
......@@ -14,14 +14,14 @@ from Performance import Performance
# Define class
class RamSwapDetails:
class MemorySwapDetails:
# ----------------------- Always called when object is generated -----------------------
def __init__(self):
# Get GUI objects from file
builder = Gtk.Builder()
builder.add_from_file(os.path.dirname(os.path.realpath(__file__)) + "/../ui/RamSwapDetailsWindow.ui")
builder.add_from_file(os.path.dirname(os.path.realpath(__file__)) + "/../ui/MemorySwapDetailsWindow.ui")
# Get GUI objects
self.window1201w2 = builder.get_object('window1201w2')
......@@ -46,11 +46,11 @@ class RamSwapDetails:
self.label1201w2.set_text("-")
# Get and show swap memory information.
self.ram_swap_details_run_func()
self.memory_swap_details_run_func()
# ----------------------------------- RAM - Swap Details Loop Function -----------------------------------
def ram_swap_details_loop_func(self):
# ----------------------------------- Memory - Swap Details Loop Function -----------------------------------
def memory_swap_details_loop_func(self):
# Define data unit conversion function objects in for lower CPU usage.
self.performance_define_data_unit_converter_variables_func = Performance.performance_define_data_unit_converter_variables_func
......@@ -63,7 +63,7 @@ class RamSwapDetails:
performance_memory_data_unit = Config.performance_memory_data_unit
# This list is defined in order to make some command output strings to be translated into other languages.
ram_hardware_information_text_list = [_tr("Partition"), _tr("File")]
memory_swap_details_text_list = [_tr("Partition"), _tr("File")]
# Set initial value of "memory_hardware_information_text". Hardware information will be appended to this string.
swap_details_text = ""
......@@ -111,14 +111,14 @@ class RamSwapDetails:
self.label1201w2.set_text(swap_details_text)
# ----------------------------------- RAM - Swap Details - Run Function -----------------------------------
def ram_swap_details_run_func(self):
# ----------------------------------- Memory - Swap Details - Run Function -----------------------------------
def memory_swap_details_run_func(self):
if self.window1201w2.get_visible() == True:
GLib.idle_add(self.ram_swap_details_loop_func)
GLib.timeout_add(Config.update_interval * 1000, self.ram_swap_details_run_func)
GLib.idle_add(self.memory_swap_details_loop_func)
GLib.timeout_add(Config.update_interval * 1000, self.memory_swap_details_run_func)
# Generate object
RamSwapDetails = RamSwapDetails()
MemorySwapDetails = MemorySwapDetails()
......@@ -248,6 +248,8 @@ class Network:
if selected_network_card == line_splitted[0].split(":")[0]:
# "split(".")" is used in order to remove "." at the end of the signal value.
network_signal_strength = line_splitted[2].split(".")[0]
if network_signal_strength != "-":
network_signal_strength = f'{network_signal_strength} (link)'
break
......
......@@ -145,7 +145,7 @@ class Performance:
Config.selected_gpu = ""
# ----------------------------------- Performance - Background Function (gets basic CPU, RAM, disk and network usage data in the background in order to assure uninterrupted data for charts) -----------------------------------
# ----------------------------------- Performance - Background Function (gets basic CPU, memory, disk and network usage data in the background in order to assure uninterrupted data for charts) -----------------------------------
def performance_background_loop_func(self):
# Definition for lower CPU usage because this variable is used multiple times in this function.
......@@ -521,11 +521,11 @@ class Performance:
for device_name in device_name_list:
chart_y_limit_list.append(100)
# Check if drawing will be for RAM tab.
# Check if drawing will be for Memory tab.
elif performance_tab_current_sub_tab == 1:
# Get chart colors.
chart_line_color = Config.chart_line_color_ram_swap_percent
chart_line_color = Config.chart_line_color_memory_percent
# Get if drawing will be for the current device (CPU core, disk, network card, etc.) or all devices, get performance data to be drawn and device list.
if Config.show_memory_usage_per_memory == 0:
......@@ -995,7 +995,7 @@ class Performance:
if performance_tab_current_sub_tab == 0:
performance_data2_at_point_text = f'- -{performance_data2[chart_number_to_highlight][chart_point_highlight]:.{Config.performance_cpu_usage_percent_precision}f} %'
elif performance_tab_current_sub_tab == 1:
performance_data2_at_point_text = f'- -{performance_data2[chart_number_to_highlight][chart_point_highlight]:.{Config.performance_ram_swap_data_precision}f} %'
performance_data2_at_point_text = f'- -{performance_data2[chart_number_to_highlight][chart_point_highlight]:.{Config.performance_memory_swap_data_precision}f} %'
elif performance_tab_current_sub_tab == 2:
performance_data2_at_point_text = f'- -{Disk.performance_data_unit_converter_func("speed", performance_disk_speed_bit, performance_data2[chart_number_to_highlight][chart_point_highlight], performance_disk_data_unit, performance_disk_data_precision)}/s'
elif performance_tab_current_sub_tab == 3:
......@@ -1069,20 +1069,20 @@ class Performance:
# ----------------------- Called for drawing performance data as bar chart -----------------------
def performance_bar_charts_draw_func(self, widget, ctx):
# Check if drawing will be for RAM tab.
# Check if drawing will be for Memory tab.
performance_tab_current_sub_tab = Config.performance_tab_current_sub_tab
if performance_tab_current_sub_tab == 1:
# Get performance data to be drawn.
from Ram import Ram
from Memory import Memory
try:
performance_data1 = Ram.swap_usage_percent[-1]
performance_data1 = Memory.swap_usage_percent[-1]
# "swap_percent" value is get in this module and drawingarea may try to use this value before relevant function (which provides this value) is finished.
except AttributeError:
return
# Get chart colors.
chart_line_color = Config.chart_line_color_ram_swap_percent
chart_line_color = Config.chart_line_color_memory_percent
# Get chart y limit value in order to show maximum value of the chart as 100.
chart_y_limit = 100
......@@ -1125,7 +1125,7 @@ class Performance:
performance_data1 = self.ram_usage_percent[-1]
# Get chart colors.
chart_line_color = Config.chart_line_color_ram_swap_percent
chart_line_color = Config.chart_line_color_memory_percent
# Get chart y limit value in order to show maximum value of the chart as 100.
chart_y_limit = 100
......
......@@ -48,7 +48,7 @@ class SettingsGUI:
self.update_interval_list = [0.5, 0.75, 1.0, 1.25, 1.5, 2.0, 3.0, 5.0, 10.0]
self.chart_data_history_list = [30, 60, 90, 120, 150, 180, 300, 600, 1200]
self.default_main_tab_list = [_tr("Performance"), _tr("Processes"), _tr("Users"), _tr("Startup"), _tr("Services"), _tr("System")]
self.performance_tab_default_sub_tab_list = [_tr("CPU"), _tr("RAM"), _tr("Disk"), _tr("Network"), _tr("GPU"), _tr("Sensors")]
self.performance_tab_default_sub_tab_list = [_tr("CPU"), _tr("Memory"), _tr("Disk"), _tr("Network"), _tr("GPU"), _tr("Sensors")]
# ----------------------- Called for connecting some of the signals in order to disconnect them for setting GUI -----------------------
......@@ -439,8 +439,8 @@ class SettingsGUI:
pass
try:
from MainGUI import Ram
Ram.initial_already_run = 0
from MainGUI import Memory
Memory.initial_already_run = 0
except ImportError:
pass
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment