-
-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#4064 we have to use program_context early on MS Windows
as this sets up the environment properly and allows us to import the gi bindings
- Loading branch information
Showing
4 changed files
with
60 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# This file is part of Xpra. | ||
# Copyright (C) 2018-2024 Antoine Martin <antoine@xpra.org> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
||
from importlib import import_module | ||
|
||
from xpra.gtk.configure.common import run_gui | ||
from xpra.os_util import LINUX | ||
from xpra.gtk.dialogs.base_gui_window import BaseGUIWindow | ||
from xpra.gtk.widget import label | ||
|
||
|
||
class HomeGUI(BaseGUIWindow): | ||
|
||
def __init__(self): | ||
super().__init__( | ||
"Configure Xpra", | ||
"toolbox.png", | ||
wm_class=("xpra-configure-gui", "Xpra Configure GUI"), | ||
default_size=(480, 300), | ||
header_bar=(False, False), | ||
) | ||
self.dialogs: dict[str, BaseGUIWindow] = {} | ||
|
||
def populate(self): | ||
self.vbox.add(label("Configure Xpra", font="sans 20")) | ||
self.vbox.add(label("Tune your xpra configuration:", font="sans 14")) | ||
if LINUX: | ||
self.sub("Packages", "package.png", "Install or remove xpra packages", "packages") | ||
self.sub("Features", "features.png", "Enable or disable feature groups", "features") | ||
self.sub("Picture compression", "encoding.png", "Encodings, speed and quality", "encodings") | ||
self.sub("GStreamer", "gstreamer.png", "Configure the GStreamer codecs", "gstreamer") | ||
self.sub("OpenGL acceleration", "opengl.png", "Test and validate OpenGL renderer", "opengl") | ||
|
||
def sub(self, title="", icon_name="browse.png", tooltip="", configure: str = "") -> None: | ||
|
||
def callback(_btn): | ||
dialog = self.dialogs.get(configure) | ||
if dialog is None: | ||
mod = import_module(f"xpra.gtk.configure.{configure}") | ||
dialog = mod.ConfigureGUI(self) | ||
self.dialogs[configure] = dialog | ||
dialog.show() | ||
self.ib(title, icon_name, tooltip, callback=callback) | ||
|
||
|
||
def main(_args) -> int: | ||
return run_gui(HomeGUI) | ||
|
||
|
||
if __name__ == "__main__": | ||
import sys | ||
sys.exit(main(sys.argv[1:])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters