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

Improved tab switch performance

üst 62214220
......@@ -12,8 +12,8 @@ def environment_variables_input_gui_import_func():
import subprocess
global EnvironmentVariables, EnvironmentVariablesGUI, MainGUI
import EnvironmentVariables, EnvironmentVariablesGUI, MainGUI
global EnvironmentVariablesGUI, MainGUI
import EnvironmentVariablesGUI, MainGUI
# Import locale and gettext modules for defining translation texts which will be recognized by gettext application (will be run by programmer externally) and exported into a ".pot" file.
......
......@@ -12,8 +12,8 @@ def environment_variables_menus_import_func():
import subprocess
global Config, EnvironmentVariables, EnvironmentVariablesGUI, EnvironmentVariablesInputGUI, MainGUI
import Config, EnvironmentVariables, EnvironmentVariablesGUI, EnvironmentVariablesInputGUI, MainGUI
global Config, EnvironmentVariables, EnvironmentVariablesGUI, MainGUI
import Config, EnvironmentVariables, EnvironmentVariablesGUI, MainGUI
# Import locale and gettext modules for defining translation texts which will be recognized by gettext application (will be run by programmer externally) and exported into a ".pot" file.
......@@ -58,6 +58,11 @@ def environment_variables_menus_gui_func():
# ********************** Define object functions for Environment Variables tab right click menu **********************
def on_menuitem7101m_activate(widget): # "Add Environment Variable" item on the right click menu
if 'EnvironmentVariablesInputGUI' not in globals(): # Check if "EnvironmentVariablesInputGUI" module is imported. Therefore it is not reimported for every click on "Add Environment Variable" menu item if "EnvironmentVariablesInputGUI" name is in globals().
global EnvironmentVariablesInputGUI
import EnvironmentVariablesInputGUI
EnvironmentVariablesInputGUI.environment_variables_input_gui_import_func()
EnvironmentVariablesInputGUI.environment_variables_input_gui_func()
EnvironmentVariablesInputGUI.window7101w.set_title(_tr("Add New Persistent Environment Variable"))
EnvironmentVariablesInputGUI.window7101w.show()
......@@ -65,6 +70,11 @@ def environment_variables_menus_gui_func():
selected_variable = EnvironmentVariablesGUI.selected_variable_value.split("=")[0]
selected_variable_value = '='.join(EnvironmentVariablesGUI.selected_variable_value.split("=")[1:]) # There may be more than "=" in the VARIABLE=VALUE string. String later than first "=" is get as value.
selected_variable_type = EnvironmentVariablesGUI.selected_variable_type
if 'EnvironmentVariablesInputGUI' not in globals(): # Check if "EnvironmentVariablesInputGUI" module is imported. Therefore it is not reimported for every click on "Edit Environment Variable" menu item if "EnvironmentVariablesInputGUI" name is in globals().
global EnvironmentVariablesInputGUI
import EnvironmentVariablesInputGUI
EnvironmentVariablesInputGUI.environment_variables_input_gui_import_func()
EnvironmentVariablesInputGUI.environment_variables_input_gui_func()
EnvironmentVariablesInputGUI.window7101w.show()
EnvironmentVariablesInputGUI.entry7101w.set_text(selected_variable) # Set label text as varible to be edited
EnvironmentVariablesInputGUI.entry7102w.set_text(selected_variable_value) # Set label text as varible value to be edited
......
This diff is collapsed.
......@@ -542,7 +542,7 @@ def processes_loop_thread_func(dummy_variable):
# ----------------------------------- Processes Thread Run Function (starts execution of the threads) -----------------------------------
def processes_thread_run_func():
if "number_of_logical_cores" not in globals(): # To be able to run initial thread for only one time
if "processes_data_rows" not in globals(): # To be able to run initial thread for only one time
processes_initial_thread = Thread(target=processes_initial_thread_func, daemon=True)
processes_initial_thread.start()
processes_initial_thread.join()
......
......@@ -195,7 +195,7 @@ def processes_open_process_details_window_func(event):
print("not in list error")
return
# Open Process Details window
if 'ProcessesDetailsGUI' not in globals(): # 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(). It is not recognized after tab switch if it is not imported as global.
if 'ProcessesDetailsGUI' not in globals(): # 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().
global ProcessesDetailsGUI, ProcessesDetails
import ProcessesDetailsGUI, ProcessesDetails
ProcessesDetailsGUI.processes_details_gui_import_function()
......
......@@ -120,7 +120,7 @@ def processes_menus_gui_func():
os.system('xdg-open "%s"' % path_only)
def on_menuitem2108m_activate(widget): # "Details" item on the right click menu
if 'ProcessesDetailsGUI' not in globals(): # Check if "ProcessesDetailsGUI" module is imported. Therefore it is not reimported for every click on "Details" menu item on the right click menu if "ProcessesDetailsGUI" name is in globals(). It is not recognized after tab switch if it is not imported as global.
if 'ProcessesDetailsGUI' not in globals(): # Check if "ProcessesDetailsGUI" module is imported. Therefore it is not reimported for every click on "Details" menu item on the right click menu if "ProcessesDetailsGUI" name is in globals().
global ProcessesDetailsGUI, ProcessesDetails
import ProcessesDetailsGUI, ProcessesDetails
ProcessesDetailsGUI.processes_details_gui_import_function()
......@@ -180,8 +180,6 @@ def processes_menus_gui_func():
ProcessesCustomPriorityGUI.processes_custom_priority_gui_func()
ProcessesCustomPriorityGUI.window2101w2.show()
# ********************** Connect signals to GUI objects for Processes tab right click menu **********************
menuitem2101m.connect("activate", on_menuitem2101m_activate)
menuitem2102m.connect("activate", on_menuitem2102m_activate)
......
......@@ -9,10 +9,6 @@ def services_details_gui_import_function():
import os
global ServicesDetails
import ServicesDetails
# ----------------------------------- Services - Services Details Window GUI Function (the code of this module in order to avoid running them during module import and defines "Services Details" window GUI objects and functions/signals) -----------------------------------
def services_details_gui_function():
......
......@@ -11,8 +11,8 @@ def services_gui_import_func():
import os
global MainGUI, Services, ServicesMenusGUI, ServicesDetails, ServicesDetailsGUI
import MainGUI, Services, ServicesMenusGUI, ServicesDetails, ServicesDetailsGUI
global MainGUI, Services, ServicesMenusGUI
import MainGUI, Services, ServicesMenusGUI
# Import locale and gettext modules for defining translation texts which will be recognized by gettext application (will be run by programmer externally) and exported into a ".pot" file.
......@@ -155,7 +155,12 @@ def services_open_service_details_window_func(event):
global selected_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.
# Open Service Details window
ServicesDetailsGUI.services_details_gui_function()
if 'ServicesDetailsGUI' not in globals(): # Check if "ServicesDetailsGUI" module is imported. Therefore it is not reimported for every double click on any user on the treeview if "ServicesDetailsGUI" name is in globals().
global ServicesDetailsGUI, ServicesDetails
import ServicesDetailsGUI, ServicesDetails
ServicesDetailsGUI.services_details_gui_import_function()
ServicesDetailsGUI.services_details_gui_function()
ServicesDetails.services_details_import_func()
ServicesDetailsGUI.window6101w.show()
ServicesDetails.services_details_foreground_thread_run_func()
......
......@@ -12,8 +12,8 @@ def services_menus_import_func():
import subprocess
global Config, Services, ServicesGUI, ServicesDetails, ServicesDetailsGUI
import Config, Services, ServicesGUI, ServicesDetails, ServicesDetailsGUI
global Config, Services, ServicesGUI
import Config, Services, ServicesGUI
# ----------------------------------- Services - Services Menus GUI Function (the code of this module in order to avoid running them during module import and defines "Services" tab menu/popover GUI objects and functions/signals) -----------------------------------
......@@ -106,7 +106,12 @@ def services_menus_gui_func():
clipboard.store() # Stores copied text in the clipboard. Therefore text stays in the clipboard after application has quit.
def on_menuitem6109m_activate(widget): # "Details" item on the right click menu
ServicesDetailsGUI.services_details_gui_function()
if 'ServicesDetailsGUI' not in globals(): # Check if "ServicesDetailsGUI" module is imported. Therefore it is not reimported for every click on "Details" menu item on the right click menu if "ServicesDetailsGUI" name is in globals().
global ServicesDetailsGUI, ServicesDetails
import ServicesDetailsGUI, ServicesDetails
ServicesDetailsGUI.services_details_gui_import_function()
ServicesDetailsGUI.services_details_gui_function()
ServicesDetails.services_details_import_func()
ServicesDetailsGUI.window6101w.show()
ServicesDetails.services_details_foreground_thread_run_func()
......
......@@ -13,8 +13,8 @@ def startup_menus_import_func():
from threading import Thread
global Config, MainGUI, Startup, StartupGUI, StartupNewItemGUI
import Config, MainGUI, Startup, StartupGUI, StartupNewItemGUI
global Config, MainGUI, Startup, StartupGUI
import Config, MainGUI, Startup, StartupGUI
# Import locale and gettext modules for defining translation texts which will be recognized by gettext application (will be run by programmer externally) and exported into a ".pot" file.
......@@ -223,6 +223,11 @@ def startup_menus_gui_func():
treestore5101.set_value(Startup.piter_list[Startup.all_autostart_applications_list.index(selected_startup_application_file_name)], 1, False)
def on_menuitem5102m_activate(widget): # "Add" item on the right click menu
if 'StartupNewItemGUI' not in globals(): # Check if "StartupNewItemGUI" module is imported. Therefore it is not reimported for every click on "Add" menu item if "StartupNewItemGUI" name is in globals().
global StartupNewItemGUI
import StartupNewItemGUI
StartupNewItemGUI.startup_new_item_import_func()
StartupNewItemGUI.startup_new_item_gui_func()
StartupNewItemGUI.window5101w.show()
def on_menuitem5103m_activate(widget): # "Remove" item on the right click menu
......
......@@ -12,8 +12,8 @@ def startup_new_item_import_func():
import subprocess
global Startup, StartupGUI, MainGUI
import Startup, StartupGUI, MainGUI
global MainGUI
import MainGUI
# Import locale and gettext modules for defining translation texts which will be recognized by gettext application (will be run by programmer externally) and exported into a ".pot" file.
......
......@@ -9,10 +9,6 @@ def storage_details_gui_import_function():
import os
global StorageDetails
import StorageDetails
# ----------------------------------- Storage - Storage Details Window GUI Function (the code of this module in order to avoid running them during module import and defines "Storage Details" window GUI objects and functions/signals) -----------------------------------
def storage_details_gui_function():
......
......@@ -11,8 +11,8 @@ def storage_gui_import_func():
import os
global MainGUI, Storage, StorageMenusGUI, StorageDetails, StorageDetailsGUI
import MainGUI, Storage, StorageMenusGUI, StorageDetails, StorageDetailsGUI
global MainGUI, Storage, StorageMenusGUI
import MainGUI, Storage, StorageMenusGUI
# Import locale and gettext modules for defining translation texts which will be recognized by gettext application (will be run by programmer externally) and exported into a ".pot" file.
......@@ -172,7 +172,12 @@ def storage_open_storage_details_window_func(event):
global selected_storage_kernel_name
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.
# Open Storage Details window
StorageDetailsGUI.storage_details_gui_function()
if 'StorageDetailsGUI' not in globals(): # Check if "StorageDetailsGUI" module is imported. Therefore it is not reimported for every double click on any user on the treeview if "StorageDetailsGUI" name is in globals().
global StorageDetailsGUI, StorageDetails
import StorageDetailsGUI, StorageDetails
StorageDetailsGUI.storage_details_gui_import_function()
StorageDetailsGUI.storage_details_gui_function()
StorageDetails.storage_details_import_func()
StorageDetailsGUI.window4101w.show()
StorageDetails.storage_details_foreground_thread_run_func()
......
......@@ -12,8 +12,8 @@ def storage_menus_import_func():
import subprocess
global Config, MainGUI, Storage, StorageGUI, StorageDetails, StorageDetailsGUI, StorageRenameGUI
import Config, MainGUI, Storage, StorageGUI, StorageDetails, StorageDetailsGUI, StorageRenameGUI
global Config, MainGUI, Storage, StorageGUI
import Config, MainGUI, Storage, StorageGUI
# Import locale and gettext modules for defining translation texts which will be recognized by gettext application (will be run by programmer externally) and exported into a ".pot" file.
......@@ -174,10 +174,20 @@ def storage_menus_gui_func():
def on_menuitem4107m_activate(widget): # "Rename Label" item on the right click menu
disk_name = StorageGUI.selected_storage_kernel_name
if 'StorageRenameGUI' not in globals(): # Check if "StorageRenameGUI" module is imported. Therefore it is not reimported for every click on "Rename Label" menu item if "StorageRenameGUI" name is in globals().
global StorageRenameGUI
import StorageRenameGUI
StorageRenameGUI.storage_rename_import_func()
StorageRenameGUI.storage_rename_gui_func()
StorageRenameGUI.window4101w2.show()
def on_menuitem4108m_activate(widget): # "Details" item on the right click menu
StorageDetailsGUI.storage_details_gui_function()
if 'StorageDetailsGUI' not in globals(): # Check if "StorageDetailsGUI" module is imported. Therefore it is not reimported for double click on "Details" menu item on the right click menu if "StorageDetailsGUI" name is in globals().
global StorageDetailsGUI, StorageDetails
import StorageDetailsGUI, StorageDetails
StorageDetailsGUI.storage_details_gui_import_function()
StorageDetailsGUI.storage_details_gui_function()
StorageDetails.storage_details_import_func()
StorageDetailsGUI.window4101w.show()
StorageDetails.storage_details_foreground_thread_run_func()
......
......@@ -12,8 +12,8 @@ def storage_rename_import_func():
import subprocess
global Storage, StorageGUI, StorageRenameGUI, MainGUI
import Storage, StorageGUI, StorageRenameGUI, MainGUI
global Storage, StorageGUI, MainGUI
import Storage, StorageGUI, MainGUI
# Import locale and gettext modules for defining translation texts which will be recognized by gettext application (will be run by programmer externally) and exported into a ".pot" file.
......
......@@ -9,10 +9,6 @@ def users_details_gui_import_function():
import os
global UsersDetails
import UsersDetails
# Import locale and gettext modules for defining translation texts which will be recognized by gettext application (will be run by programmer externally) and exported into a ".pot" file.
global _tr # This arbitrary variable will be recognized by gettext application for extracting texts to be translated
import locale
......
......@@ -11,8 +11,8 @@ def users_gui_import_func():
import os
global MainGUI, Users, UsersMenusGUI, UsersDetails, UsersDetailsGUI
import MainGUI, Users, UsersMenusGUI, UsersDetails, UsersDetailsGUI
global MainGUI, Users, UsersMenusGUI
import MainGUI, Users, UsersMenusGUI
# Import locale and gettext modules for defining translation texts which will be recognized by gettext application (will be run by programmer externally) and exported into a ".pot" file.
......@@ -143,10 +143,16 @@ def users_open_user_details_window_func(event):
global selected_user_uid
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.
# Open Users Details window
UsersDetailsGUI.users_details_gui_function()
if 'UsersDetailsGUI' not in globals(): # Check if "UsersDetailsGUI" module is imported. Therefore it is not reimported for every double click on any user on the treeview if "UsersDetailsGUI" name is in globals().
global UsersDetails, UsersDetailsGUI
import UsersDetails, UsersDetailsGUI
UsersDetailsGUI.users_details_gui_import_function()
UsersDetailsGUI.users_details_gui_function()
UsersDetails.users_details_import_func()
UsersDetailsGUI.window3101w.show()
UsersDetails.users_details_foreground_thread_run_func()
# ----------------------------------- Users - No User Selected Dialog Function (shows a dialog when Open Users Right Click Menu is clicked without selecting an user) -----------------------------------
def users_no_user_selected_dialog():
......
......@@ -11,8 +11,8 @@ def users_menus_import_func():
import os
global Config, Users, UsersGUI, UsersDetails, UsersDetailsGUI
import Config, Users, UsersGUI, UsersDetails, UsersDetailsGUI
global Config, Users, UsersGUI
import Config, Users, UsersGUI
# ----------------------------------- Users - Users Menus GUI Function (the code of this module in order to avoid running them during module import and defines "Sensors" tab menu/popover GUI objects and functions/signals) -----------------------------------
......@@ -34,7 +34,12 @@ def users_menus_gui_func():
# ********************** Define object functions for Users tab right click menu **********************
def on_menuitem3101m_activate(widget): # "Details" item on the right click menu
UsersDetailsGUI.users_details_gui_function()
if 'UsersDetailsGUI' not in globals(): # Check if "UsersDetailsGUI" module is imported. Therefore it is not reimported for every click on "Details" menu item on right click menu if "UsersDetailsGUI" name is in globals().
global UsersDetails, UsersDetailsGUI
import UsersDetails, UsersDetailsGUI
UsersDetailsGUI.users_details_gui_import_function()
UsersDetailsGUI.users_details_gui_function()
UsersDetails.users_details_import_func()
UsersDetailsGUI.window3101w.show()
UsersDetails.users_details_foreground_thread_run_func()
......
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