Refactor footer status update: simplify status message by removing undo/redo information in edit mode.
This commit is contained in:
		
							parent
							
								
									bcaf412c47
								
							
						
					
					
						commit
						0ac1d588d2
					
				
					 1 changed files with 2 additions and 14 deletions
				
			
		| 
						 | 
					@ -294,19 +294,7 @@ class HostsManagerApp(App):
 | 
				
			||||||
            entry_count = len(self.hosts_file.entries)
 | 
					            entry_count = len(self.hosts_file.entries)
 | 
				
			||||||
            active_count = len(self.hosts_file.get_active_entries())
 | 
					            active_count = len(self.hosts_file.get_active_entries())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            # Add undo/redo status in edit mode
 | 
					            status = f"{entry_count} entries ({active_count} active) | {mode}"
 | 
				
			||||||
            undo_redo_status = ""
 | 
					 | 
				
			||||||
            if self.edit_mode:
 | 
					 | 
				
			||||||
                can_undo = self.manager.can_undo()
 | 
					 | 
				
			||||||
                can_redo = self.manager.can_redo()
 | 
					 | 
				
			||||||
                if can_undo or can_redo:
 | 
					 | 
				
			||||||
                    undo_status = "Undo available" if can_undo else ""
 | 
					 | 
				
			||||||
                    redo_status = "Redo available" if can_redo else ""
 | 
					 | 
				
			||||||
                    statuses = [s for s in [undo_status, redo_status] if s]
 | 
					 | 
				
			||||||
                    if statuses:
 | 
					 | 
				
			||||||
                        undo_redo_status = f" | {', '.join(statuses)}"
 | 
					 | 
				
			||||||
            
 | 
					 | 
				
			||||||
            status = f"{entry_count} entries ({active_count} active) | {mode}{undo_redo_status}"
 | 
					 | 
				
			||||||
            footer.set_status(status)
 | 
					            footer.set_status(status)
 | 
				
			||||||
        except Exception:
 | 
					        except Exception:
 | 
				
			||||||
            pass  # Footer not ready yet
 | 
					            pass  # Footer not ready yet
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue