Пример #1
0
    def __init__(self, tagname):
        print("Creating Keyboard Window...")
        Window.__init__(self, 'keyboard', KeyboardHandler)

        # Create a global variable...not sure handlers can't inherit builder.
        global buffer_label
        buffer_label = self.builder.get_object('l_buffer')

        # Create the local buffer but, leave it blank.
        DataBase.set_local_value('keyboard_buffer', '')

        # Set the label to show the current tag value.
        buffer_label.set_label(DataBase.get_value(tagname.get_name()))

        DataBase.set_local_value('keyboard_shift_pointer', 1)
        DataBase.set_local_value('keyboard_variable', tagname.get_name())
Пример #2
0
from utils.file_monitor import FileMonitor
from utils.dbus_services import (DeepinMovieServie, check_multiple_instances,
                                 DeepinMovieInterface, session_bus, DBUS_PATH)

if __name__ == "__main__":
    result = check_multiple_instances()
    if result:
        dbus_service = DeepinMovieServie(app)
        session_bus.registerObject(DBUS_PATH, dbus_service)
    else:
        if not config.playerMultipleProgramsAllowed:
            dbus_interface = DeepinMovieInterface()
            dbus_interface.play(json.dumps(sys.argv[1:]))
            os._exit(0)

    windowView = Window(result or len(sys.argv) > 1)
    menu_controller = MenuController()
    file_monitor = FileMonitor()
    findVideoThreadManager = FindVideoThreadManager()
    subtitleParser = Parser()
    settings = DMSettings()
    app._extra_window = weakref.ref(windowView)

    qml_context = windowView.rootContext()

    qml_context.setContextProperty("config", config)
    qml_context.setContextProperty("_settings", settings)
    qml_context.setContextProperty("_utils", utils)
    qml_context.setContextProperty("_findVideoThreadManager",
                                   findVideoThreadManager)
    qml_context.setContextProperty("_file_monitor", file_monitor)
Пример #3
0
from views.window import Window

if __name__ == '__main__':
    root = Window()
    root.mainloop()
Пример #4
0
from utils.file_monitor import FileMonitor
from utils.dbus_services import (DeepinMovieServie, check_multiple_instances,
    DeepinMovieInterface, session_bus, DBUS_PATH)

if __name__ == "__main__":
    result = check_multiple_instances()
    if result:
        dbus_service = DeepinMovieServie(app)
        session_bus.registerObject(DBUS_PATH, dbus_service)
    else:
        if not config.playerMultipleProgramsAllowed:
            dbus_interface = DeepinMovieInterface()
            dbus_interface.play(json.dumps(sys.argv[1:]))
            os._exit(0)

    windowView = Window(result or len(sys.argv) > 1)
    menu_controller = MenuController()
    file_monitor = FileMonitor()
    findVideoThreadManager = FindVideoThreadManager()
    subtitleParser = Parser()
    settings = DMSettings()
    app._extra_window = weakref.ref(windowView)

    qml_context = windowView.rootContext()

    qml_context.setContextProperty("config", config)
    qml_context.setContextProperty("_settings", settings)
    qml_context.setContextProperty("_utils", utils)
    qml_context.setContextProperty("_findVideoThreadManager",
        findVideoThreadManager)
    qml_context.setContextProperty("_file_monitor", file_monitor)
Пример #5
0
from models.paintingOptions import PaintingOptions
from models.image import Image
from views.window import Window
from views.toolbar import Toolbar
from controllers.canvasController import CanvasController
from controllers.toolController import ToolController

if __name__ == '__main__':
    painting_options = PaintingOptions()

    tool_controller = ToolController(None, None, painting_options)
    canvas_controller = CanvasController(None, painting_options,
                                         tool_controller)

    root = Window(None, None, canvas_controller)
    root.title('Paint')
    root.minsize(800, 670)

    toolbar = Toolbar(painting_options)
    image = Image(painting_options)

    image.bind("<B1-Motion>", canvas_controller.on_mouse_drag)
    image.bind("<1>", canvas_controller.on_mouse_down)
    image.bind("<Motion>", canvas_controller.on_mouse_move)
    image.bind("<B1-ButtonRelease>", canvas_controller.on_mouse_up)

    toolbar.eraser_button.configure(command=tool_controller.on_toggle_eraser)
    toolbar.color_picker_button.configure(
        command=tool_controller.on_change_color_click)
    toolbar.brush_width_button.configure(
        command=tool_controller.on_change_brush_width_click)
Пример #6
0
 def __init__(self):
     print("Creating Settings Window...")
     Window.__init__(self, 'settings', SettingsHandler)
Пример #7
0
 def __init__(self):
     print("Creating Overview Window...")
     Window.__init__(self, 'overview', OverviewHandler)
Пример #8
0
from views.window import Window

import gtk

# If the program is run directly or passed as an argument to the python
# interpreter then create a HelloWorld instance and show it
if __name__ == "__main__":
    window = Window()
    gtk.main()