config fixes

by roundabout, Thursday, 19 December 2024, 19:26:00 (1734636360), pushed by roundabout, Thursday, 19 December 2024, 19:26:03 (1734636363)

Author identity: vlad <vlad.muntoiu@gmail.com>

cf14f0281c45eff6f8ffd97f3f014ae46073766a

com.roundabout_host.Izvor.yaml

@@ -33,7 +33,7 @@ modules:

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  - pip install --prefix=/app --no-deps -r /app/share/izvor/requirements-flatpak.txt
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  - chmod +x /app/share/izvor/__init__.py
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  - ln -s /app/share/izvor/__init__.py /app/bin/izvor
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              - fc-cache -fv
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              #- fc-cache -fv
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                sources:
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  - type: dir
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    path: src
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                            
                                

src/__init__.py

@@ -399,7 +399,14 @@ class Izvor(Gtk.Application):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        switch.connect("notify::active", self.update_permanently_enabled_providers, provider.stem)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        config_button = Gtk.Button.new_with_label(_("Configure"))
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    config_button.connect("clicked", lambda _, stem=provider.stem: subprocess.Popen(["xdg-open", str(self.USER_PROVIDER_CONFIGS / f"{stem}.json")]))
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    def open_config(widget, stem=provider.stem):
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                        # User-accessible provider config, not Flatpak sandboxed
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                        config_path = str(Path.home() / ".config" / "izvor" / "providers" / f"{stem}.json")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                        if os.getenv("FLATPAK_SANDBOX_DIR"):
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                            subprocess.Popen(["flatpak-spawn", "--host", "xdg-open", config_path])
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                        else:
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                            subprocess.Popen(["xdg-open", config_path])
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    config_button.connect("clicked", open_config)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        config_button.set_relief(Gtk.ReliefStyle.NONE)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        providers_table.attach(icon, 0, rows, 1, 1)
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -414,7 +421,8 @@ class Izvor(Gtk.Application):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        rows += 1
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    def open_provider_directory(widget):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    provider_directory = str(self.USER_PROVIDERS)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    # User-accessible provider directory, not Flatpak sandboxed
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    provider_directory = str(Path.home() / ".local" / "share" / "izvor" / "providers")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        if os.getenv("FLATPAK_SANDBOX_DIR"):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                            subprocess.Popen(["flatpak-spawn", "--host", "xdg-open", provider_directory])
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        else: