selected_variable_value=EnvironmentVariables.variable_list[EnvironmentVariables.environment_variables_data_rows.index(model[treeiter][:])]# "[:]" is used in order to copy entire list to be able to use it for getting index in the "environment_variables_data_rows" list to use it getting name of the variable.
EnvironmentVarMenuRightClickGUI.menuitem7103m.set_sensitive(False)# Set "Delete Environment Variable" item as insensitive
EnvironmentVarMenuRightClickGUI.menuitem7103m.set_tooltip_text(_tr("Shell variables cannot be deleted."))# Set "Delete Environment Variable" item tooltip text
# ----------------------------------- Startup - No Startup Item Selected Dialog Function (shows a dialog when Open Startup Item Right Click Menu is clicked without selecting a startup item) -----------------------------------
selected_process_pid=Processes.pid_list[Processes.processes_data_rows.index(model[treeiter][:])]# "[:]" is used in order to copy entire list to be able to use it for getting index in the "processes_data_rows" list to use it getting pid of the process.
exceptValueError:# It gives error such as "ValueError: [True, 'system-monitoring-center-process-symbolic', 'python3', 2411, 'asush', 'Running', 1.6633495783351964, 98824192, 548507648, 45764608, 0, 16384, 0, 5461, 0, 4, 1727, 1000, 1000, '/usr/bin/python3.9'] is not in list" rarely. It is handled in this situation.
print("not in list error")
return
if'ProcessesMenuRightClickGUI'notinglobals():# Check if "ProcessesMenuRightClickGUI" module is imported. Therefore it is not reimported on every right click operation.
selected_process_pid=Processes.pid_list[Processes.processes_data_rows.index(model[treeiter][:])]# "[:]" is used in order to copy entire list to be able to use it for getting index in the "processes_data_rows" list to use it getting pid of the process.
exceptValueError:# It gives error such as "ValueError: [True, 'system-monitoring-center-process-symbolic', 'python3', 2411, 'asush', 'Running', 1.6633495783351964, 98824192, 548507648, 45764608, 0, 16384, 0, 5461, 0, 4, 1727, 1000, 1000, '/usr/bin/python3.9'] is not in list" rarely. It is handled in this situation.
print("not in list error")
return
# Open Process Details window
if'ProcessesDetailsGUI'notinglobals():# Check if "ProcessesDetailsGUI" module is imported. Therefore it is not reimported for every double click on any process on the treeview if "ProcessesDetailsGUI" name is in globals().
# ----------------------------------- Processes - No Process Selected Dialog Function (shows a dialog when Open Process Right Click Menu is clicked without selecting a process) -----------------------------------
selected_service_name=Services.service_list[Services.services_data_rows.index(model[treeiter][:])]# "[:]" is used in order to copy entire list to be able to use it for getting index in the "services_data_rows" list to use it getting name of the service.
return# Stop running rest of the code if the error is encountered.
model=treeview6101.get_model()
treeiter=model.get_iter(path)
iftreeiterisNone:
services_no_service_selected_dialog()
iftreeiterisnotNone:
globalselected_service_name
selected_service_name=Services.service_list[Services.services_data_rows.index(model[treeiter][:])]# "[:]" is used in order to copy entire list to be able to use it for getting index in the "services_data_rows" list to use it getting name of the service.
# ----------------------------------- Services - No Service Selected Dialog Function (shows a dialog when Open Services Right Click Menu is clicked without selecting a service) -----------------------------------
selected_startup_application_file_name=Startup.all_autostart_applications_list[Startup.startup_data_rows.index(model[treeiter][:])]# "[:]" is used in order to copy entire list to be able to use it for getting index in the "startup_data_rows" list to use it getting name of the startup application file name.
# ----------------------------------- Startup - No Startup Item Selected Dialog Function (shows a dialog when Open Startup Item Right Click Menu is clicked without selecting a startup item) -----------------------------------
selected_storage_kernel_name=Storage.disk_list[Storage.storage_data_rows.index(model[treeiter][:])]# "[:]" is used in order to copy entire list to be able to use it for getting index in the "storage_data_rows" list to use it getting name of the disk.
selected_storage_kernel_name=Storage.disk_list[Storage.storage_data_rows.index(model[treeiter][:])]# "[:]" is used in order to copy entire list to be able to use it for getting index in the "storage_data_rows" list to use it getting name of the disk.
# ----------------------------------- Storage - No Disk Selected Dialog Function (shows a dialog when Open Storage Right Click Menu is clicked without selecting a storage/disk) -----------------------------------
selected_user_uid=Users.uid_username_list[Users.users_data_rows.index(model[treeiter][:])][0]# "[:]" is used in order to copy entire list to be able to use it for getting index in the "user_data_rows" list to use it getting UID of the user.
selected_user_uid=Users.uid_username_list[Users.users_data_rows.index(model[treeiter][:])][0]# "[:]" is used in order to copy entire list to be able to use it for getting index in the "users_data_rows" list to use it getting UID of the user.
# ----------------------------------- Users - No User Selected Dialog Function (shows a dialog when Open Users Right Click Menu is clicked without selecting an user) -----------------------------------