Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build_support/localization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ const MENU_STATUS_HELP_KEYS: &[(&str, &str)] = &[
"IDM_SERVICE_GOTOPROCESS",
"crate::ui::resource_ids::IDM_SERVICE_GOTOPROCESS",
),
(
"IDM_PROC_FILTER",
"crate::ui::resource_ids::IDM_PROC_FILTER",
),
];

pub(crate) fn generate() {
Expand Down
3 changes: 3 additions & 0 deletions localization/de.toml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ ServiceStartFailed = "Der Dienst konnte nicht gestartet werden."
ServiceStopFailed = "Der Dienst konnte nicht beendet werden."
ServiceStateUnchanged = "Der Dienst hat den angeforderten Zustand nicht erreicht."
ServiceProcessPid = "PID"
ProcessNameFilterLabel = "Filter:"
ProcessNameFilterMenu = "Nach &Name filtern\tStrg+F"

[menu_status_help]
IDM_RUN = "Runs a new program"
Expand Down Expand Up @@ -352,3 +354,4 @@ IDM_TASK_BRINGTOFRONT = "Brings the window front, but does not switch to it"
IDM_SERVICE_START = "Startet den ausgewählten Dienst"
IDM_SERVICE_STOP = "Beendet den ausgewählten Dienst"
IDM_SERVICE_GOTOPROCESS = "Wählt den Prozess des Diensts auf der Seite Prozesse aus"
IDM_PROC_FILTER = "Zeigt nur Prozesse, deren Abbildname den eingegebenen Text enthält"
3 changes: 3 additions & 0 deletions localization/en_us.toml
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ ServiceStartFailed = "Unable to start the service."
ServiceStopFailed = "Unable to stop the service."
ServiceStateUnchanged = "The service did not enter the requested state."
ServiceProcessPid = "PID"
ProcessNameFilterLabel = "Filter:"
ProcessNameFilterMenu = "Filter by &Name\tCtrl+F"

[menu_status_help]
IDM_RUN = "Runs a new program"
Expand Down Expand Up @@ -359,3 +361,4 @@ IDM_TASK_BRINGTOFRONT = "Brings the window front, but does not switch to it"
IDM_SERVICE_START = "Starts the selected service"
IDM_SERVICE_STOP = "Stops the selected service"
IDM_SERVICE_GOTOPROCESS = "Selects the service process on the Processes page"
IDM_PROC_FILTER = "Shows only processes whose image name contains the typed text"
3 changes: 3 additions & 0 deletions localization/es.toml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ ServiceStartFailed = "No se pudo iniciar el servicio."
ServiceStopFailed = "No se pudo detener el servicio."
ServiceStateUnchanged = "El servicio no entró en el estado solicitado."
ServiceProcessPid = "PID"
ProcessNameFilterLabel = "Filtro:"
ProcessNameFilterMenu = "Filtrar por &nombre\tCtrl+F"

[menu_status_help]
IDM_RUN = "Runs a new program"
Expand Down Expand Up @@ -352,3 +354,4 @@ IDM_TASK_BRINGTOFRONT = "Brings the window front, but does not switch to it"
IDM_SERVICE_START = "Inicia el servicio seleccionado"
IDM_SERVICE_STOP = "Detiene el servicio seleccionado"
IDM_SERVICE_GOTOPROCESS = "Selecciona el proceso del servicio en la página Procesos"
IDM_PROC_FILTER = "Muestra solo los procesos cuyo nombre de imagen contiene el texto escrito"
3 changes: 3 additions & 0 deletions localization/fr.toml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ ServiceStartFailed = "Impossible de démarrer le service."
ServiceStopFailed = "Impossible d'arrêter le service."
ServiceStateUnchanged = "Le service n'a pas atteint l'état demandé."
ServiceProcessPid = "PID"
ProcessNameFilterLabel = "Filtre :"
ProcessNameFilterMenu = "Filtrer par &nom\tCtrl+F"

[menu_status_help]
IDM_RUN = "Runs a new program"
Expand Down Expand Up @@ -352,3 +354,4 @@ IDM_TASK_BRINGTOFRONT = "Brings the window front, but does not switch to it"
IDM_SERVICE_START = "Démarre le service sélectionné"
IDM_SERVICE_STOP = "Arrête le service sélectionné"
IDM_SERVICE_GOTOPROCESS = "Sélectionne le processus du service dans la page Processus"
IDM_PROC_FILTER = "Affiche uniquement les processus dont le nom d'image contient le texte saisi"
3 changes: 3 additions & 0 deletions localization/pt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ ServiceStartFailed = "Não foi possível iniciar o serviço."
ServiceStopFailed = "Não foi possível parar o serviço."
ServiceStateUnchanged = "O serviço não entrou no estado solicitado."
ServiceProcessPid = "PID"
ProcessNameFilterLabel = "Filtro:"
ProcessNameFilterMenu = "Filtrar por &nome\tCtrl+F"

[menu_status_help]
IDM_RUN = "Runs a new program"
Expand Down Expand Up @@ -352,3 +354,4 @@ IDM_TASK_BRINGTOFRONT = "Brings the window front, but does not switch to it"
IDM_SERVICE_START = "Inicia o serviço selecionado"
IDM_SERVICE_STOP = "Para o serviço selecionado"
IDM_SERVICE_GOTOPROCESS = "Seleciona o processo do serviço na página Processos"
IDM_PROC_FILTER = "Mostra apenas os processos cujo nome de imagem contém o texto digitado"
3 changes: 3 additions & 0 deletions localization/ru.toml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ ServiceStartFailed = "Не удалось запустить службу."
ServiceStopFailed = "Не удалось остановить службу."
ServiceStateUnchanged = "Служба не перешла в запрошенное состояние."
ServiceProcessPid = "PID"
ProcessNameFilterLabel = "Фильтр:"
ProcessNameFilterMenu = "Фильтр по &имени\tCtrl+F"

[menu_status_help]
IDM_RUN = "Runs a new program"
Expand Down Expand Up @@ -352,3 +354,4 @@ IDM_TASK_BRINGTOFRONT = "Brings the window front, but does not switch to it"
IDM_SERVICE_START = "Запускает выбранную службу"
IDM_SERVICE_STOP = "Останавливает выбранную службу"
IDM_SERVICE_GOTOPROCESS = "Выбирает процесс службы на странице процессов"
IDM_PROC_FILTER = "Показывает только процессы, имя образа которых содержит введенный текст"
3 changes: 3 additions & 0 deletions localization/zh_cn.toml
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ ServiceStartFailed = "无法启动该服务。"
ServiceStopFailed = "无法停止该服务。"
ServiceStateUnchanged = "该服务没有进入请求的状态。"
ServiceProcessPid = "PID"
ProcessNameFilterLabel = "筛选:"
ProcessNameFilterMenu = "按名称筛选(&N)\tCtrl+F"

[menu_status_help]
IDM_RUN = "Runs a new program"
Expand Down Expand Up @@ -349,3 +351,4 @@ IDM_TASK_BRINGTOFRONT = "Brings the window front, but does not switch to it"
IDM_SERVICE_START = "启动所选服务"
IDM_SERVICE_STOP = "停止所选服务"
IDM_SERVICE_GOTOPROCESS = "在进程页选中该服务的进程"
IDM_PROC_FILTER = "只显示映像名称包含所输入文本的进程"
3 changes: 3 additions & 0 deletions localization/zh_tw.toml
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ ServiceStartFailed = "無法啟動服務。"
ServiceStopFailed = "無法停止服務。"
ServiceStateUnchanged = "服務沒有進入要求的狀態。"
ServiceProcessPid = "PID"
ProcessNameFilterLabel = "篩選:"
ProcessNameFilterMenu = "依名稱篩選(&N)\tCtrl+F"

[menu_status_help]
IDM_RUN = "Runs a new program"
Expand Down Expand Up @@ -349,3 +351,4 @@ IDM_TASK_BRINGTOFRONT = "Brings the window front, but does not switch to it"
IDM_SERVICE_START = "啟動選取的服務"
IDM_SERVICE_STOP = "停止選取的服務"
IDM_SERVICE_GOTOPROCESS = "在處理程序頁選取該服務的處理程序"
IDM_PROC_FILTER = "只顯示映像名稱包含所輸入文字的處理程序"
10 changes: 10 additions & 0 deletions src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,9 @@ impl App {
.unwrap_or(false),
);
}
if self.options.current_page == PageId::Processes.persisted() {
self.enable_menu_item(menu, IDM_PROC_FILTER, true);
}
if self.options.current_page == PageId::Services.persisted() {
let commands = self.pages[PageId::Services.index()]
.service_command_state()
Expand Down Expand Up @@ -2249,6 +2252,13 @@ impl App {
SendMessageW(task_hwnd, WM_COMMAND, command_id as usize, 0);
}
}
IDM_PROC_FILTER => {
if self.options.current_page == PageId::Processes.persisted() {
self.pages[PageId::Processes.index()].focus_process_name_filter();
} else {
MessageBeep(0);
}
}
IDM_PROCCOLS
| IDM_AFFINITY
| IDM_PROC_DEBUG
Expand Down
9 changes: 8 additions & 1 deletion src/app/page_host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,8 @@ impl PageState {
match msg {
WM_COMMAND => match self {
Self::Gpu(state) => Some(state.handle_command(wparam)),
Self::Task(_) | Self::Process(_) | Self::Users(_) | Self::Services(_) => {
Self::Process(state) => Some(state.handle_window_command(wparam)),
Self::Task(_) | Self::Users(_) | Self::Services(_) => {
Some(self.handle_page_command((wparam & 0xFFFF) as u16))
}
_ => None,
Expand Down Expand Up @@ -900,6 +901,12 @@ impl DialogPage {
self.state.handle_process_command(command_id, options)
}

pub fn focus_process_name_filter(&mut self) {
if let PageState::Process(state) = &mut self.state {
state.focus_name_filter();
}
}

pub fn handle_user_command(&mut self, command_id: u16) -> bool {
self.state.handle_user_command(command_id)
}
Expand Down
Loading