| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -42,9 +42,9 @@ from PyQt5.QtWidgets import ( | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    QDialog, | 
					 | 
					 | 
					 | 
					    QDialog, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    QVBoxLayout, | 
					 | 
					 | 
					 | 
					    QVBoxLayout, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    QLabel, | 
					 | 
					 | 
					 | 
					    QLabel, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    QPushButton, | 
					 | 
					 | 
					 | 
					    QPushButton | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    QAction | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					) | 
					 | 
					 | 
					 | 
					) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					from PyQt5.QtGui import QWindow | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					from config import web_greeter_config | 
					 | 
					 | 
					 | 
					from config import web_greeter_config | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import globales | 
					 | 
					 | 
					 | 
					import globales | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -144,19 +144,15 @@ class Dialog(QDialog): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        # pylint: disable=missing-function-docstring | 
					 | 
					 | 
					 | 
					        # pylint: disable=missing-function-docstring | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        self.done(button.role) | 
					 | 
					 | 
					 | 
					        self.done(button.role) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					def error_prompt(err): | 
					 | 
					 | 
					 | 
					def general_error_prompt(window: QWindow, message: str, detail: str, title: str): | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    """Prompts a popup dialog on error""" | 
					 | 
					 | 
					 | 
					    """General error prompt""" | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if not web_greeter_config["config"]["greeter"]["detect_theme_errors"]: | 
					 | 
					 | 
					 | 
					    dialog = Dialog(parent = window, | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return | 
					 | 
					 | 
					 | 
					                    title = title, | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					                    message = message, | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    dia = Dialog(parent=globales.greeter.window, title="Error", | 
					 | 
					 | 
					 | 
					                    detail = detail, | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                 message="An error ocurred. Do you want to change to default theme?", | 
					 | 
					 | 
					 | 
					                    buttons = ["Reload theme", "Use default theme", "Cancel"]) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                 detail=err, | 
					 | 
					 | 
					 | 
					    dialog.exec() | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                 buttons=["Reload theme", "Set default theme", "Cancel"], | 
					 | 
					 | 
					 | 
					    result = dialog.result() | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                 ) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    dia.exec() | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    result = dia.result() | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if result == 2:  # Cancel | 
					 | 
					 | 
					 | 
					    if result == 2:  # Cancel | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        pass | 
					 | 
					 | 
					 | 
					        pass | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -165,3 +161,14 @@ def error_prompt(err): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        globales.greeter.load_theme() | 
					 | 
					 | 
					 | 
					        globales.greeter.load_theme() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    elif result == 0:  # Reload | 
					 | 
					 | 
					 | 
					    elif result == 0:  # Reload | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        globales.greeter.load_theme() | 
					 | 
					 | 
					 | 
					        globales.greeter.load_theme() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					def error_prompt(err: str): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    """Prompts a popup dialog on error""" | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    if not web_greeter_config["config"]["greeter"]["detect_theme_errors"]: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        return | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    general_error_prompt(globales.greeter.window, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                         "An error ocurred. Do you want to change to default theme?", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                         f"{err}", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                         "An error ocurred") | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
					 | 
					 | 
					
  |