示例#1
0
    def __init__(self, parent=None):
        super().__init__(parent, Qt.Dialog | Qt.FramelessWindowHint)
        self._main_container = parent
        self.setModal(True)
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setFixedWidth(650)
        # Create the QML UI
        view = QQuickWidget()
        view.rootContext().setContextProperty("theme", resources.QML_COLORS)
        view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        view.setSource(ui_tools.get_qml_resource("AddFileFolder.qml"))
        self._root = view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(view)

        self._base_path = ""
        self._create_file_operation = True

        short_esc = QShortcut(QKeySequence(Qt.Key_Escape), self)
        short_esc.activated.connect(self.close)

        # Connection
        self._root.create.connect(self._create)
示例#2
0
    def __init__(self, parent=None):
        super().__init__(parent, Qt.Dialog | Qt.FramelessWindowHint)
        self._main_container = parent
        self.setModal(True)
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setFixedWidth(650)
        # Create the QML UI
        view = QQuickWidget()
        view.rootContext().setContextProperty("theme", NTheme.get_colors())
        view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        view.setSource(ui_tools.get_qml_resource("AddFileFolder.qml"))
        self._root = view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(view)

        self._base_path = ""
        self._create_file_operation = True

        short_esc = QShortcut(QKeySequence(Qt.Key_Escape), self)
        short_esc.activated.connect(self.close)

        # Connection
        self._root.create.connect(self._create)
示例#3
0
    def __init__(self, parent=None):
        super(FilesHandler, self).__init__(
            None, Qt.FramelessWindowHint | Qt.Popup)
        self.setAttribute(Qt.WA_TranslucentBackground)
        self._main_container = parent
        # Create the QML user interface.
        self.setFixedHeight(300)
        self.setFixedWidth(400)
        self.view = QQuickWidget()
        self.view.rootContext().setContextProperty(
            "theme", resources.QML_COLORS)
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("FilesHandler.qml"))
        self._root = self.view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(self.view)

        self._model = {}
        self._temp_files = {}
        self._max_index = 0

        self._root.open.connect(self._open)
        self._root.close.connect(self._close)
        self._root.fuzzySearch.connect(self._fuzzy_search)
        self._root.hide.connect(self.hide)
示例#4
0
    def __init__(self, parent=None):
        super(FilesHandler, self).__init__(
            None, Qt.FramelessWindowHint | Qt.Popup)
        self._main_container = parent
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setStyleSheet("background:transparent;")
        # Create the QML user interface.
        self.view = QDeclarativeView()
        self.view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("FilesHandler.qml"))
        self._root = self.view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(self.view)

        self._model = {}
        self._temp_files = {}
        self._max_index = 0

        self.connect(self._root, SIGNAL("open(QString, QString, QString)"),
                     self._open)
        self.connect(self._root, SIGNAL("close(QString, QString)"), self._close)
        self.connect(self._root, SIGNAL("hide()"), self.hide)
        self.connect(self._root, SIGNAL("fuzzySearch(QString)"),
                     self._fuzzy_search)
示例#5
0
    def __init__(self, parent=None):
        super(LocatorWidget, self).__init__(
            parent, Qt.Dialog | Qt.FramelessWindowHint)
        self._parent = parent
        self.setModal(True)
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setStyleSheet("background:transparent;")
        self.setFixedHeight(400)
        self.setFixedWidth(500)
        view = QQuickWidget()
        view.rootContext().setContextProperty("theme", resources.QML_COLORS)
        view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        view.setSource(ui_tools.get_qml_resource("Locator.qml"))
        self._root = view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(view)

        self.locate_symbols = locator.LocateSymbolsThread()
        self.locate_symbols.finished.connect(self._cleanup)
        # FIXME: invalid signal
        # self.locate_symbols.terminated.connect(self._cleanup)
        # Hide locator with Escape key
        shortEscMisc = QShortcut(QKeySequence(Qt.Key_Escape), self)
        shortEscMisc.activated.connect(self.hide)

        # Locator things
        self.filterPrefix = re.compile(r'(@|<|>|-|!|\.|/|:)')
        self.page_items_step = 10
        self._colors = {
            "@": "#5dade2",
            "<": "#4becc9",
            ">": "#ff555a",
            "-": "#66ff99",
            ".": "#a591c6",
            "/": "#f9d170",
            ":": "#18ffd6",
            "!": "#ff884d"}
        self._filters_list = [
            ("@", "Filename"),
            ("<", "Class"),
            (">", "Function"),
            ("-", "Attribute"),
            (".", "Current"),
            ("/", "Opened"),
            (":", "Line"),
            ("!", "NoPython")
        ]
        self._replace_symbol_type = {"<": "&lt;", ">": "&gt;"}
        self.reset_values()

        self._filter_actions = {
            '.': self._filter_this_file,
            '/': self._filter_tabs,
            ':': self._filter_lines
        }
        self._root.textChanged['QString'].connect(self.set_prefix)
        self._root.open['QString', int].connect(self._open_item)
        self._root.fetchMore.connect(self._fetch_more)
示例#6
0
    def __init__(self, parent=None):
        super(LocatorWidget, self).__init__(
            parent, Qt.Dialog | Qt.FramelessWindowHint)
        self._parent = parent
        self.setModal(True)
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setStyleSheet("background:transparent;")
        self.setFixedHeight(400)
        self.setFixedWidth(500)
        view = QQuickWidget()
        view.rootContext().setContextProperty("theme", NTheme.get_colors())
        view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        view.setSource(ui_tools.get_qml_resource("Locator.qml"))
        self._root = view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(view)

        self.locate_symbols = locator.LocateSymbolsThread()
        self.locate_symbols.finished.connect(self._cleanup)
        # FIXME: invalid signal
        # self.locate_symbols.terminated.connect(self._cleanup)
        # Hide locator with Escape key
        shortEscMisc = QShortcut(QKeySequence(Qt.Key_Escape), self)
        shortEscMisc.activated.connect(self.hide)

        # Locator things
        self.filterPrefix = re.compile(r'(@|<|>|-|!|\.|/|:)')
        self.page_items_step = 10
        self._colors = {
            "@": "#5dade2",
            "<": "#4becc9",
            ">": "#ff555a",
            "-": "#66ff99",
            ".": "#a591c6",
            "/": "#f9d170",
            ":": "#18ffd6",
            "!": "#ff884d"}
        self._filters_list = [
            ("@", "Filename"),
            ("<", "Class"),
            (">", "Function"),
            ("-", "Attribute"),
            (".", "Current"),
            ("/", "Opened"),
            (":", "Line"),
            ("!", "NoPython")
        ]
        self._replace_symbol_type = {"<": "&lt;", ">": "&gt;"}
        self.reset_values()

        self._filter_actions = {
            '.': self._filter_this_file,
            '/': self._filter_tabs,
            ':': self._filter_lines
        }
        self._root.textChanged['QString'].connect(self.set_prefix)
        self._root.open['QString', int].connect(self._open_item)
        self._root.fetchMore.connect(self._fetch_more)
示例#7
0
    def __init__(self, parent=None):
        super(FilesHandler, self).__init__(None,
                                           Qt.FramelessWindowHint | Qt.Popup)
        self._main_container = parent
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setStyleSheet("background:transparent;")
        # Create the QML user interface.
        self.view = QDeclarativeView()
        self.view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("FilesHandler.qml"))
        self._root = self.view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(self.view)

        self._model = {}
        self._temp_files = {}
        self._max_index = 0

        self.connect(self._root, SIGNAL("open(QString, QString, QString)"),
                     self._open)
        self.connect(self._root, SIGNAL("close(QString, QString)"),
                     self._close)
        self.connect(self._root, SIGNAL("hide()"), self.hide)
        self.connect(self._root, SIGNAL("fuzzySearch(QString)"),
                     self._fuzzy_search)
示例#8
0
    def __init__(self, parent=None):
        super(FilesHandler, self).__init__(
            None, Qt.FramelessWindowHint | Qt.Popup)
        self.setAttribute(Qt.WA_TranslucentBackground)
        self._main_container = parent
        # Create the QML user interface.
        self.setFixedHeight(300)
        self.setFixedWidth(400)
        self.view = QQuickWidget()
        self.view.rootContext().setContextProperty(
            "theme", resources.QML_COLORS)
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("FilesHandler.qml"))
        # self.view.setClearColor(Qt.transparent)
        self._root = self.view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(self.view)

        self._model = {}
        self._temp_files = {}
        self._max_index = 0

        self._root.open.connect(self._open)
        self._root.close.connect(self._close)
        self._root.fuzzySearch.connect(self._fuzzy_search)
        self._root.hide.connect(self.hide)
示例#9
0
    def __init__(self, parent=None):
        super(StartPage, self).__init__(parent)
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        self.view = QDeclarativeView()
        self.view.setMinimumWidth(400)
        self.view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("StartPage.qml"))
        self.root = self.view.rootObject()
        vbox.addWidget(self.view)

        self.load_items()

        self.connect(self.root, SIGNAL("openProject(QString)"),
            self._open_project)
        self.connect(self.root, SIGNAL("removeProject(QString)"),
            self._on_click_on_delete)
        self.connect(self.root, SIGNAL("markAsFavorite(QString, bool)"),
            self._on_click_on_favorite)
        self.connect(self.root, SIGNAL("openPreferences()"),
            lambda: self.emit(SIGNAL("openPreferences()")))
        self.connect(self.root, SIGNAL("newFile()"),
            lambda: self.emit(SIGNAL("newFile()")))

        self.root.set_year(str(datetime.datetime.now().year))
示例#10
0
    def __init__(self, parent=None):
        super().__init__(parent, Qt.Dialog | Qt.FramelessWindowHint)
        # parent,
        # Qt.Dialog | Qt.FramelessWindowHint
        # )
        self._operations = {'row': False, 'col': True}
        self.setModal(True)
        # self.setAttribute(Qt.WA_TranslucentBackground)
        # self.setStyleSheet("background:transparent;")
        self.setFixedHeight(150)
        self.setFixedWidth(300)
        # Create the QML user interface.
        view = QQuickWidget()
        view.rootContext().setContextProperty("theme", NTheme.get_colors())
        view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        view.setSource(ui_tools.get_qml_resource("SplitOrientation.qml"))
        self._root = view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(view)
        view.setFocusPolicy(Qt.StrongFocus)

        short_esc = QShortcut(QKeySequence(Qt.Key_Escape), self)
        short_esc.activated.connect(self.hide)
        self._root.selected['QString'].connect(self._split_operation)
    def __init__(self, parent=None):
        super(LocatorWidget,
              self).__init__(parent,
                             Qt.SplashScreen)  # | Qt.FramelessWindowHint)
        self._parent = parent
        # self.setModal(True)
        # self.setAttribute(Qt.WA_TranslucentBackground)
        # self.setStyleSheet("background:transparent;")
        self.setWindowState(Qt.WindowActive)
        self.setFixedHeight(400)
        self.setFixedWidth(500)
        # Create the QML user interface.
        self.view = QQuickWidget()
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.engine().quit.connect(self.hide)
        self.view.setSource(ui_tools.get_qml_resource("Locator.qml"))
        self._root = self.view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(self.view)

        self.locate_symbols = locator.LocateSymbolsThread()
        self.locate_symbols.finished.connect(self._cleanup)
        self.locate_symbols.terminated.connect(self._cleanup)

        QApplication.instance().focusChanged["QWidget*", "QWidget*"].connect(\
            lambda w1, w2, this=self: this.hide() if w1 == this.view else None)

        # Locator things
        self.filterPrefix = re.compile(r'(@|<|>|-|!|\.|/|:)')
        self.page_items_step = 10
        self._colors = {
            "@": "white",
            "<": "#18ff6a",
            ">": "red",
            "-": "#18e1ff",
            ".": "#f118ff",
            "/": "#fff118",
            ":": "#18ffd6",
            "!": "#ffa018"
        }
        self._filters_list = [("@", "Filename"), ("<", "Class"),
                              (">", "Function"), ("-", "Attribute"),
                              (".", "Current"), ("/", "Opened"), (":", "Line"),
                              ("!", "NoPython")]
        self._replace_symbol_type = {"<": "&lt;", ">": "&gt;"}
        self.reset_values()

        self._filter_actions = {
            '.': self._filter_this_file,
            '/': self._filter_tabs,
            ':': self._filter_lines
        }

        self._root.textChanged.connect(self.set_prefix)
        self._root.open.connect(self._open_item)
        self._root.fetchMore.connect(self._fetch_more)
    def __init__(self, combofiles, Force_Free=False):  #SplashScreen
        super(FilesHandler, self).__init__(
            None, Qt.SplashScreen)  #, Qt.Popup | Qt.FramelessWindowHint
        # self.setAttribute(Qt.WA_TranslucentBackground)
        # self.setStyleSheet("background:transparent;")
        # self.setStyleSheet("background-color: rgb(25, 255, 60);")
        self.setWindowState(Qt.WindowActive)  # | Qt.SplashScreen
        # self.setAttribute(Qt.WA_AlwaysStackOnTop, False)
        # Create the QML user interface.
        self._main_container = combofiles.container  #IDE.get_service('main_container')
        self.comboParent = combofiles
        self.Force_Free = combofiles.undocked or Force_Free
        # self.rawObj = raww(self)

        self.view = QQuickWidget()
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.engine().quit.connect(self.hide)
        # self.view.rootContext().setContextProperty("rawObj", self.rawObj)
        self.view.setSource(ui_tools.get_qml_resource("FilesHandler.qml"))
        self._root = self.view.rootObject()
        cntx = self.view.rootContext()
        cntx.setProperty("tools", Tools())
        self._contextMenu_Incert = self._root.property("_window_")

        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(self.view)

        # {"name": model[i][0],
        # "path": model[i][1],
        # "checkers": model[i][2],
        # "modified": model[i][3],
        # "tempFile": model[i][4],
        # "project": "",
        # "itemVisible": true});

        self._ntup = ("name", "path", "checkers", "modified", "tempFile",
                      "project", "itemVisible")
        # self._Ndtup = namedtuple("_Ndtup", self._ntup)

        self._filePathPosition = {}
        self._filesModel = []
        self._temp_files = {}
        self._max_index = 0
        print("\n\nFilesHandler", self, self._contextMenu_Incert)

        # QApplication.instance().focusChanged["QWidget*", "QWidget*"].connect(\
        #     lambda w1, w2: print("\n\n:focusChanged:", w1, w1.geometry() if w1\
        #     else "_No es un widget",  w2, w2.geometry() if w2 else "_No es un widget"))

        QApplication.instance().focusChanged["QWidget*", "QWidget*"].connect(\
            lambda old, now, this=self:  print("\n\n:focusChanged:", this.hide(), old, now) if old == this.view else None)

        self._root.open.connect(self._open)
        self._root.close.connect(self._close)
        self._root.hide.connect(self.hide)
        self._root.fuzzySearch.connect(self._fuzzy_search)
示例#13
0
    def __init__(self, parent=None):
        super(LocatorWidget, self).__init__(parent,
                                            Qt.Dialog | Qt.FramelessWindowHint)
        self._parent = parent
        self.setModal(True)
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setStyleSheet("background:transparent;")
        self.setFixedHeight(400)
        self.setFixedWidth(500)
        # Create the QML user interface.
        view = QDeclarativeView()
        view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
        view.setSource(ui_tools.get_qml_resource("Locator.qml"))
        self._root = view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(view)

        self.locate_symbols = locator.LocateSymbolsThread()
        self.connect(self.locate_symbols, SIGNAL("finished()"), self._cleanup)
        self.connect(self.locate_symbols, SIGNAL("terminated()"),
                     self._cleanup)

        # Locator things
        self.filterPrefix = re.compile(r'(@|<|>|-|!|\.|/|:)')
        self.page_items_step = 10
        self._colors = {
            "@": "white",
            "<": "#18ff6a",
            ">": "red",
            "-": "#18e1ff",
            ".": "#f118ff",
            "/": "#fff118",
            ":": "#18ffd6",
            "!": "#ffa018"
        }
        self._filters_list = [("@", "Filename"), ("<", "Class"),
                              (">", "Function"), ("-", "Attribute"),
                              (".", "Current"), ("/", "Opened"), (":", "Line"),
                              ("!", "NoPython")]
        self._replace_symbol_type = {"<": "&lt;", ">": "&gt;"}
        self.reset_values()

        self._filter_actions = {
            '.': self._filter_this_file,
            '/': self._filter_tabs,
            ':': self._filter_lines
        }

        self.connect(self._root, SIGNAL("textChanged(QString)"),
                     self.set_prefix)
        self.connect(self._root, SIGNAL("open(QString, int)"), self._open_item)
        self.connect(self._root, SIGNAL("fetchMore()"), self._fetch_more)
示例#14
0
 def __init__(self, parent=None):
     super(MainSelector, self).__init__(parent)
     self.setAttribute(Qt.WA_TranslucentBackground)
     self.setAttribute(Qt.WA_ShowWithoutActivating)
     # Create the QML user interface.
     view = QQuickWidget()
     view.setClearColor(Qt.transparent)
     view.setResizeMode(QQuickWidget.SizeRootObjectToView)
     view.setSource(ui_tools.get_qml_resource("MainSelector.qml"))
     self._root = view.rootObject()
     vbox = QVBoxLayout(self)
     vbox.setContentsMargins(0, 0, 0, 0)
     vbox.setSpacing(0)
     vbox.addWidget(view)
示例#15
0
    def __init__(self, parent=None):
        super(PluginsStore, self).__init__(parent, Qt.Dialog)
       # QDialog.__init__(self, parent, Qt.Dialog | Qt.FramelessWindowHint)
        self.setWindowTitle(self.tr("Plugins Store"))
        self.setMaximumSize(QSize(0, 0))

        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        self.view = QQuickView()
        self.view.setMinimumWidth(800)
        self.view.setMinimumHeight(600)
        self.view.setResizeMode(QQuickView.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("PluginsStore.qml"))
        self.root = self.view.rootObject()
        vbox.addWidget(self.view)
        self._plugins = {}
        self._plugins_inflate = []
        self._plugins_by_tag = collections.defaultdict(list)
        self._plugins_by_author = collections.defaultdict(list)
        self._base_color = QColor("white")
        self._counter = 0
        self._counter_callback = None
        self._inflating_plugins = []
        self._categoryTags = True
        self._search = []
        self.status = None

        self.connect(self.root, SIGNAL("loadPluginsGrid()"),
                     self._load_by_name)
        self.connect(self.root, SIGNAL("close()"),
                     self.close)
        self.connect(self.root, SIGNAL("showPluginDetails(int)"),
                     self.show_plugin_details)
        self.connect(self.root, SIGNAL("loadTagsGrid()"),
                     self._load_tags_grid)
        self.connect(self.root, SIGNAL("loadAuthorGrid()"),
                     self._load_author_grid)
        self.connect(self.root, SIGNAL("search(QString)"),
                     self._load_search_results)
        self.connect(self.root, SIGNAL("loadPluginsForCategory(QString)"),
                     self._load_plugins_for_category)
        self.connect(self, SIGNAL("processCompleted(PyQt_PyObject)"),
                     self._process_complete)

        self.nenv = nenvironment.NenvEggSearcher()
        self.connect(self.nenv,
                     SIGNAL("searchCompleted(PyQt_PyObject)"),
                     self.callback)
        self.status = self.nenv.do_search()
示例#16
0
 def __init__(self, parent=None):
     super(SplitOrientation,
           self).__init__(parent, Qt.Dialog | Qt.FramelessWindowHint)
     self.setModal(True)
     self.setAttribute(Qt.WA_TranslucentBackground)
     self.setStyleSheet("background:transparent;")
     self.setFixedHeight(180)
     self.setFixedWidth(315)
     # Create the QML user interface.
     view = QDeclarativeView()
     view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
     view.setSource(ui_tools.get_qml_resource("SplitOrientation.qml"))
     self._root = view.rootObject()
     vbox = QVBoxLayout(self)
     vbox.addWidget(view)
示例#17
0
 def __init__(self, parent=None):
     super(SplitOrientation, self).__init__(parent,
         Qt.Dialog | Qt.FramelessWindowHint)
     self.setModal(True)
     self.setAttribute(Qt.WA_TranslucentBackground)
     self.setStyleSheet("background:transparent;")
     self.setFixedHeight(150)
     self.setFixedWidth(310)
     # Create the QML user interface.
     view = QDeclarativeView()
     view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
     view.setSource(ui_tools.get_qml_resource("SplitOrientation.qml"))
     self._root = view.rootObject()
     vbox = QVBoxLayout(self)
     vbox.addWidget(view)
示例#18
0
    def __init__(self, parent=None):
        super(MainSelector, self).__init__(parent)
        # Create the QML user interface.
        view = QDeclarativeView()
        view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
        view.setSource(ui_tools.get_qml_resource("MainSelector.qml"))
        self._root = view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(view)

        self.connect(self._root, SIGNAL("open(int)"),
                     lambda i: self.emit(SIGNAL("changeCurrent(int)"), i))
        self.connect(self._root, SIGNAL("ready()"),
                     lambda: self.emit(SIGNAL("ready()")))
示例#19
0
    def __init__(self, parent=None):
        super(MainSelector, self).__init__(parent)
        # Create the QML user interface.
        view = QDeclarativeView()
        view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
        view.setSource(ui_tools.get_qml_resource("MainSelector.qml"))
        self._root = view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(view)

        self.connect(self._root, SIGNAL("open(int)"),
            lambda i: self.emit(SIGNAL("changeCurrent(int)"), i))
        self.connect(self._root, SIGNAL("ready()"),
            lambda: self.emit(SIGNAL("ready()")))
示例#20
0
    def __init__(self, parent=None):
        super(PluginsStore, self).__init__(parent, Qt.Dialog)
        self.setWindowTitle(translations.TR_MANAGE_PLUGINS)
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        self.view = QDeclarativeView()
        self.view.setMinimumWidth(800)
        self.view.setMinimumHeight(600)
        self.view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("PluginsStore.qml"))
        self.root = self.view.rootObject()
        vbox.addWidget(self.view)
        self._plugins = {}
        self._plugins_inflate = []
        self._plugins_by_tag = collections.defaultdict(list)
        self._plugins_by_author = collections.defaultdict(list)
        self._base_color = QColor("white")
        self._counter = 0
        self._counter_callback = None
        self._inflating_plugins = []
        self._categoryTags = True
        self._search = []
        self.status = None

        self.connect(self.root, SIGNAL("loadPluginsGrid()"),
                     self._load_by_name)
        self.connect(self.root, SIGNAL("close()"),
                     self.close)
        self.connect(self.root, SIGNAL("showPluginDetails(int)"),
                     self.show_plugin_details)
        self.connect(self.root, SIGNAL("loadTagsGrid()"),
                     self._load_tags_grid)
        self.connect(self.root, SIGNAL("loadAuthorGrid()"),
                     self._load_author_grid)
        self.connect(self.root, SIGNAL("search(QString)"),
                     self._load_search_results)
        self.connect(self.root, SIGNAL("loadPluginsForCategory(QString)"),
                     self._load_plugins_for_category)
        self.connect(self, SIGNAL("processCompleted(PyQt_PyObject)"),
                     self._process_complete)

        self.nenv = nenvironment.NenvEggSearcher()
        self.connect(self.nenv,
                     SIGNAL("searchCompleted(PyQt_PyObject)"),
                     self.callback)
        self.status = self.nenv.do_search()
示例#21
0
    def __init__(self, btn, parent=None):
        super().__init__(parent, Qt.FramelessWindowHint | Qt.Popup)
        self.btn_selector = btn
        self.setAttribute(Qt.WA_TranslucentBackground)
        box = QVBoxLayout(self)
        self.view = QQuickWidget()
        self.view.setClearColor(Qt.transparent)
        self.setFixedWidth(400)
        self.setFixedHeight(200)
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("PythonChooser.qml"))

        self._root = self.view.rootObject()
        box.addWidget(self.view)

        self._model = []
        self._root.pythonSelected.connect(self.set_python_interpreter)
示例#22
0
    def __init__(self, btn, parent=None):
        super().__init__(parent, Qt.FramelessWindowHint | Qt.Popup)
        self.btn_selector = btn
        self.setAttribute(Qt.WA_TranslucentBackground)
        box = QVBoxLayout(self)
        self.view = QQuickWidget()
        self.view.setClearColor(Qt.transparent)
        self.setFixedWidth(400)
        self.setFixedHeight(200)
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("PythonChooser.qml"))

        self._root = self.view.rootObject()
        box.addWidget(self.view)

        self._model = []
        self._root.pythonSelected.connect(self.set_python_interpreter)
示例#23
0
    def __init__(self, parent=None):
        super(PluginsStore, self).__init__(parent, Qt.Dialog)
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        self.view = QDeclarativeView()
        self.view.setMinimumWidth(800)
        self.view.setMinimumHeight(600)
        self.view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("PluginsStore.qml"))
        self.root = self.view.rootObject()
        vbox.addWidget(self.view)

        self.nenv = nenvironment.NenvEggSearcher()
        self.connect(self.nenv, SIGNAL("searchCompleted(PyQt_PyObject)"),
            self.callback)

        self.status = self.nenv.do_search()
    def __init__(self, parent=None):
        super(MainSelector, self).__init__(parent)
        # Create the QML user interface.
        self.view = QQuickWidget()
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.engine().quit.connect(self.hide)
        self.view.setSource(ui_tools.get_qml_resource("MainSelector.qml"))
        self._root = self.view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(self.view)

        self._root.open[int].connect(self.changeCurrent.emit)
        self._root.open[int].connect(self._clean_removed)
        self._root.ready.connect(self.ready.emit)
        self._root.closePreviewer.connect(self.closePreviewer.emit)
        self._root.animationCompleted.connect(self.animationCompleted.emit)
    def __init__(self, parent=None):
        super(MainSelector, self).__init__(parent)
        # Create the QML user interface.
        self.view = QQuickWidget()
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.engine().quit.connect(self.hide)
        self.view.setSource(ui_tools.get_qml_resource("MainSelector.qml"))
        self._root = self.view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(self.view)

        self._root.open[int].connect(self.changeCurrent.emit)
        self._root.open[int].connect(self._clean_removed)
        self._root.ready.connect(self.ready.emit)
        self._root.closePreviewer.connect(self.closePreviewer.emit)
        self._root.animationCompleted.connect(self.animationCompleted.emit)
示例#26
0
    def __init__(self, parent=None):
        super(SplitOrientation, self).__init__(parent, Qt.Dialog | Qt.FramelessWindowHint)
        self._operations = {"row": False, "col": True}
        self.setModal(True)
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setStyleSheet("background:transparent;")
        self.setFixedHeight(130)
        self.setFixedWidth(290)
        # Create the QML user interface.
        view = QDeclarativeView()
        view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
        view.setSource(ui_tools.get_qml_resource("SplitOrientation.qml"))
        self._root = view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(view)

        self.connect(self._root, SIGNAL("selected(QString)"), self._split_operation)
示例#27
0
    def __init__(self, parent=None):
        super(Notification, self).__init__(None, Qt.ToolTip)
        self._parent = parent
        self._duration = 3000
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setAttribute(Qt.WA_TransparentForMouseEvents)
        self.setAttribute(Qt.WA_ShowWithoutActivating)
        self.setStyleSheet("background:transparent;")
        self.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)
        self.setFixedHeight(30)
        # Create the QML user interface.
        view = QDeclarativeView()
        view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
        view.setSource(ui_tools.get_qml_resource("Notification.qml"))
        self._root = view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.addWidget(view)

        self.connect(self._root, SIGNAL("close()"), self.close)
示例#28
0
    def __init__(self, parent=None):
        super(Notification, self).__init__(None, Qt.ToolTip)
        self._parent = parent
        self._duration = 3000
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setAttribute(Qt.WA_TransparentForMouseEvents)
        self.setAttribute(Qt.WA_ShowWithoutActivating)
        self.setStyleSheet("background:transparent;")
        self.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)
        self.setFixedHeight(60)
        # Create the QML user interface.
        view = QDeclarativeView()
        view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
        view.setSource(ui_tools.get_qml_resource("Notification.qml"))
        self._root = view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.addWidget(view)

        self.connect(self._root, SIGNAL("close()"), self.close)
    def __init__(self, parent=None):
        super(PluginsStore, self).__init__(parent, Qt.Popup)  #Qt.Tool
        self.setWindowTitle(translations.TR_MANAGE_PLUGINS)
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        #self.setWindowState(Qt.WindowActive)
        self.view = QQuickWidget()
        self.view.setMinimumWidth(800)
        self.view.setMinimumHeight(600)
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("PluginsStore.qml"))
        self.root = self.view.rootObject()
        vbox.addWidget(self.view)
        self._plugins = {}
        self._plugins_inflate = []
        self._plugins_by_tag = collections.defaultdict(list)
        self._plugins_by_author = collections.defaultdict(list)
        self._base_color = QColor("white")
        self._counter = 0
        self._counter_callback = None
        self._inflating_plugins = []
        self._categoryTags = True
        self._search = []
        self.status = None

        # QApplication.instance().focusChanged["QWidget*", "QWidget*"].connect(\
        #     lambda w1, w2, this=self: this.hide() if w1 == this.view else None)

        self.root.loadPluginsGrid.connect(self._load_by_name)
        self.root.close.connect(lambda: print("self.close", self.close()))
        self.root.showPluginDetails[int].connect(self.show_plugin_details)
        self.root.loadTagsGrid.connect(self._load_tags_grid)
        self.root.loadAuthorGrid.connect(self._load_author_grid)
        self.root.search[str].connect(self._load_search_results)
        self.root.loadPluginsForCategory[str].connect(
            self._load_plugins_for_category)
        self.processCompleted.connect(self._process_complete)

        self.nenv = nenvironment.NenvEggSearcher()
        self.nenv.searchCompleted.connect(self.callback)
        self.status = self.nenv.do_search()
示例#30
0
    def __init__(self, parent=None):
        super(SplitOrientation,
              self).__init__(parent, Qt.Dialog | Qt.FramelessWindowHint)
        self._operations = {'row': False, 'col': True}
        self.setModal(True)
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setStyleSheet("background:transparent;")
        self.setFixedHeight(150)
        self.setFixedWidth(290)
        # Create the QML user interface.
        view = QQuickWidget()
        view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        view.setSource(ui_tools.get_qml_resource("SplitOrientation.qml"))
        self._root = view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(view)

        self._root.selected.connect(self._split_operation)
    def __init__(self, parent=None):
        super(PluginsStore, self).__init__(parent, Qt.Popup)#Qt.Tool
        self.setWindowTitle(translations.TR_MANAGE_PLUGINS)
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        #self.setWindowState(Qt.WindowActive)
        self.view = QQuickWidget()
        self.view.setMinimumWidth(800)
        self.view.setMinimumHeight(600)
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("PluginsStore.qml"))
        self.root = self.view.rootObject()
        vbox.addWidget(self.view)
        self._plugins = {}
        self._plugins_inflate = []
        self._plugins_by_tag = collections.defaultdict(list)
        self._plugins_by_author = collections.defaultdict(list)
        self._base_color = QColor("white")
        self._counter = 0
        self._counter_callback = None
        self._inflating_plugins = []
        self._categoryTags = True
        self._search = []
        self.status = None

        # QApplication.instance().focusChanged["QWidget*", "QWidget*"].connect(\
        #     lambda w1, w2, this=self: this.hide() if w1 == this.view else None)

        self.root.loadPluginsGrid.connect(self._load_by_name)
        self.root.close.connect(lambda: print("self.close", self.close()))
        self.root.showPluginDetails[int].connect(self.show_plugin_details)
        self.root.loadTagsGrid.connect(self._load_tags_grid)
        self.root.loadAuthorGrid.connect(self._load_author_grid)
        self.root.search[str].connect(self._load_search_results)
        self.root.loadPluginsForCategory[str].connect(self._load_plugins_for_category)
        self.processCompleted.connect(self._process_complete)

        self.nenv = nenvironment.NenvEggSearcher()
        self.nenv.searchCompleted.connect(self.callback)
        self.status = self.nenv.do_search()
示例#32
0
    def __init__(self, parent=None):
        super(ErrorsList, self).__init__()
        self._main_container = IDE.get_service("main_container")
        # Create the QML user interface.
        self.view = QQuickWidget()
        self.view.rootContext().setContextProperty("theme",
                                                   resources.QML_COLORS)
        # Colors from theme
        warn_bug_colors = {}
        warn_bug_colors["warning"] = resources.COLOR_SCHEME.get("editor.pep8")
        warn_bug_colors["bug"] = resources.COLOR_SCHEME.get("editor.checker")
        self.view.rootContext().setContextProperty("colors", warn_bug_colors)
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("ErrorsList.qml"))
        self._root = self.view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(self.view)

        self._root.open.connect(self._open)
示例#33
0
    def __init__(self, parent=None):
        super(FilesHandler, self).__init__(None,
                                           Qt.FramelessWindowHint | Qt.Popup)
        self._main_container = parent
        self.setStyleSheet("background:transparent;")
        # Create the QML user interface.
        self.view = QQuickWidget()
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("FilesHandler.qml"))
        self._root = self.view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(self.view)

        self._model = {}
        self._temp_files = {}
        self._max_index = 0

        self._root.open['QString', 'QString', 'QString'].connect(self._open)
        self._root.hide.connect(self.hide)
示例#34
0
    def __init__(self, parent=None):
        super(Notification, self).__init__(None, Qt.ToolTip)
        self._parent = parent
        self._duration = 3000
        self.setAttribute(Qt.WA_TranslucentBackground, True)
        self.setAttribute(Qt.WA_TransparentForMouseEvents)
        self.setAttribute(Qt.WA_ShowWithoutActivating)
        self.setFixedHeight(30)
        # Create the QML user interface.
        view = QQuickWidget()
        view.setClearColor(Qt.transparent)
        view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        view.setSource(ui_tools.get_qml_resource("Notification.qml"))
        self._root = view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(view)

        self._root.close.connect(self.close)
        self._parent.goingDown.connect(self.close)
示例#35
0
    def __init__(self, parent=None):
        super(StartPage, self).__init__(parent)
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        self.view = QQuickWidget()
        self.view.rootContext().setContextProperty(
            "theme", resources.QML_COLORS)
        self.view.rootContext().setContextProperty(
            "shortcuts", self.get_shortcuts())
        self.view.setMinimumWidth(400)
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("StartPage.qml"))
        self.root = self.view.rootObject()
        vbox.addWidget(self.view)

        # Connections
        self.root.onDrop.connect(self.__open_drop_files)
        self.root.openProject.connect(self._open_project)
        self.root.newFile.connect(lambda: self.newFile.emit())
        self.load_items()
示例#36
0
    def __init__(self, parent=None):
        super(ErrorsList, self).__init__()
        self._main_container = IDE.get_service("main_container")
        # Create the QML user interface.
        self.view = QQuickWidget()
        self.view.rootContext().setContextProperty(
            "theme", resources.QML_COLORS)
        # Colors from theme
        warn_bug_colors = {}
        warn_bug_colors["warning"] = resources.COLOR_SCHEME.get("editor.pep8")
        warn_bug_colors["bug"] = resources.COLOR_SCHEME.get("editor.checker")
        self.view.rootContext().setContextProperty("colors", warn_bug_colors)
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("ErrorsList.qml"))
        self._root = self.view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(self.view)

        self._root.open.connect(self._open)
示例#37
0
    def __init__(self, parent=None):
        super(StartPage, self).__init__(parent)
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        self.view = QQuickWidget()
        self.view.rootContext().setContextProperty("theme",
                                                   resources.QML_COLORS)
        self.view.rootContext().setContextProperty("shortcuts",
                                                   self.get_shortcuts())
        self.view.setMinimumWidth(400)
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("StartPage.qml"))
        self.root = self.view.rootObject()
        vbox.addWidget(self.view)

        # Connections
        self.root.onDrop.connect(self.__open_drop_files)
        self.root.openProject.connect(self._open_project)
        self.root.newFile.connect(lambda: self.newFile.emit())
        self.load_items()
示例#38
0
    def __init__(self, parent=None):#SplashScreen
        super(FilesHandler, self).__init__(None, Qt.SplashScreen)#, Qt.Popup | Qt.FramelessWindowHint
        # self.setAttribute(Qt.WA_TranslucentBackground)
        # self.setStyleSheet("background:transparent;")
        #self.setStyleSheet("background-color: rgb(25, 255, 60);")
        self.setWindowState(Qt.WindowActive)# | Qt.SplashScreen
        self.setAttribute(Qt.WA_AlwaysStackOnTop, False)
        # Create the QML user interface.
        self._main_container = parent.container#IDE.get_service('main_container')
        self.comboParent = parent
        # self.rawObj = raww(self)

        self.view = QQuickWidget()
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.engine().quit.connect(self.hide)
        # self.view.rootContext().setContextProperty("rawObj", self.rawObj)
        self.view.setSource(ui_tools.get_qml_resource("FilesHandler.qml"))
        self._root = self.view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(self.view)

        self._model = {}
        self._temp_files = {}
        self._max_index = 0


        # QApplication.instance().focusChanged["QWidget*", "QWidget*"].connect(\
        #     lambda w1, w2: print("\n\n:focusChanged:", w1, w1.geometry() if w1\
        #     else "_No es un widget",  w2, w2.geometry() if w2 else "_No es un widget"))

        QApplication.instance().focusChanged["QWidget*", "QWidget*"].connect(\
            lambda w1, w2, this=self: this.hide() if w1 == this.view else None)

        self._root.open.connect(self._open)
        self._root.close.connect(self._close)
        self._root.hide.connect(self.hide)
        self._root.fuzzySearch.connect(self._fuzzy_search)
示例#39
0
    def __init__(self, parent=None):
        super().__init__(parent, Qt.WindowStaysOnTopHint)
        box = QVBoxLayout(self)
        box.setContentsMargins(3, 3, 3, 3)
        box.setSpacing(0)
        # Model
        self._manager = BookmarkManager()
        # QML UI
        view = QQuickWidget()
        view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        view.rootContext().setContextProperty("bookmarkModel", self._manager)
        view.rootContext().setContextProperty("theme", resources.QML_COLORS)
        view.setSource(ui_tools.get_qml_resource("BookmarkList.qml"))
        box.addWidget(view)

        self._root = view.rootObject()

        self._root.openBookmark.connect(self._open_bookmark)
        self._root.menuRequested.connect(self._show_menu)

        IDE.register_service("bookmarks", self)
        ExplorerContainer.register_tab("Bookmarks", self)
示例#40
0
    def __init__(self, parent=None):
        super().__init__(parent, Qt.WindowStaysOnTopHint)
        box = QVBoxLayout(self)
        box.setContentsMargins(0, 0, 0, 0)
        box.setSpacing(0)
        # Model
        self._manager = BookmarkManager()
        # QML UI
        view = QQuickWidget()
        view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        view.rootContext().setContextProperty("bookmarkModel", self._manager)
        view.rootContext().setContextProperty("theme", resources.QML_COLORS)
        view.setSource(ui_tools.get_qml_resource("BookmarkList.qml"))
        box.addWidget(view)

        self._root = view.rootObject()

        self._root.openBookmark.connect(self._open_bookmark)
        self._root.menuRequested.connect(self._show_menu)

        IDE.register_service("bookmarks", self)
        ExplorerContainer.register_tab("Bookmarks", self)
示例#41
0
    def __init__(self, parent=None):
        super(StartPage, self).__init__(parent)
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        self.view = QQuickWidget()
        self.view.setMinimumWidth(400)
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("StartPage.qml"))
        self.root = self.view.rootObject()
        vbox.addWidget(self.view)

        self.load_items()

        self.root.openProject.connect(self._open_project)
        self.root.removeProject.connect(self._on_click_on_delete)
        self.root.markAsFavorite.connect(self._on_click_on_favorite)
        self.root.openPreferences.connect(self.openPreferences.emit)
        self.root.newFile.connect(lambda: self.newFile.emit(translations.TR_NEW_DOCUMENT))#self.test)
        self.root.openFiles.connect(self.checkFiles)

        self.root.set_year(str(datetime.datetime.now().year))
示例#42
0
    def __init__(self, parent=None):
        super(StartPage, self).__init__(parent)
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        self.view = QQuickWidget()
        self.view.setMinimumWidth(400)
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("StartPage.qml"))
        self.root = self.view.rootObject()
        vbox.addWidget(self.view)

        self.load_items()

        self.root.openProject.connect(self._open_project)
        self.root.removeProject.connect(self._on_click_on_delete)
        self.root.markAsFavorite.connect(self._on_click_on_favorite)
        self.root.openPreferences.connect(self.openPreferences.emit)
        self.root.newFile.connect(lambda: self.newFile.emit(
            translations.TR_NEW_DOCUMENT))  #self.test)
        self.root.openFiles.connect(self.checkFiles)

        self.root.set_year(str(datetime.datetime.now().year))
示例#43
0
    def __init__(self, parent=None):
        super(Notification, self).__init__(None, Qt.ToolTip)
        self._parent = parent
        self._duration = 1800
        self._text = ""
        self._running = False
        self.setAttribute(Qt.WA_TranslucentBackground, True)
        self.setAttribute(Qt.WA_TransparentForMouseEvents)
        self.setAttribute(Qt.WA_ShowWithoutActivating)
        self.setFixedHeight(30)
        # Create the QML user interface.
        view = QQuickWidget()
        view.setClearColor(Qt.transparent)
        view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        view.setSource(ui_tools.get_qml_resource("Notification.qml"))
        self._root = view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(view)

        self._root.close.connect(self.close)
        self._parent.goingDown.connect(self.close)
示例#44
0
    def __init__(self, parent=None):
        super(AddFileFolderWidget,
              self).__init__(parent, Qt.Dialog | Qt.FramelessWindowHint)
        self._main_container = parent
        self.setModal(True)
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setStyleSheet("background:transparent;")
        self.setFixedHeight(70)
        self.setFixedWidth(650)
        # Create the QML user interface.
        self.view = QQuickWidget()
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("AddFileFolder.qml"))
        self._root = self.view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(self.view)

        self._base_path = ""

        self._create_file_operation = True

        self._root.create.connect(self._create)
示例#45
0
    def __init__(self, parent=None):
        super().__init__(parent, Qt.Dialog | Qt.FramelessWindowHint)
        self._operations = {'row': False, 'col': True}
        self.setModal(True)
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setStyleSheet("background:transparent;")
        self.setFixedHeight(150)
        self.setFixedWidth(290)
        # Create the QML user interface.
        view = QQuickWidget()
        view.setClearColor(Qt.transparent)
        view.rootContext().setContextProperty("theme", resources.QML_COLORS)
        view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        view.setSource(ui_tools.get_qml_resource("SplitOrientation.qml"))
        self._root = view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(view)
        view.setFocusPolicy(Qt.StrongFocus)

        short_esc = QShortcut(QKeySequence(Qt.Key_Escape), self)
        short_esc.activated.connect(self.hide)
        self._root.selected['QString'].connect(self._split_operation)
示例#46
0
    def __init__(self, parent=None):
        super(AddFileFolderWidget, self).__init__(
            parent, Qt.Dialog | Qt.FramelessWindowHint)
        self._main_container = parent
        self.setModal(True)
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setStyleSheet("background:transparent;")
        self.setFixedHeight(70)
        self.setFixedWidth(650)
        # Create the QML user interface.
        self.view = QDeclarativeView()
        self.view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
        self.view.setSource(ui_tools.get_qml_resource("AddFileFolder.qml"))
        self._root = self.view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(self.view)

        self._base_path = ""

        self._create_file_operation = True

        self.connect(self._root, SIGNAL("create(QString)"), self._create)
    def __init__(self, parent=None):
        super(LocatorWidget, self).__init__(
            parent, Qt.SplashScreen)# | Qt.FramelessWindowHint)
        self._parent = parent
        # self.setModal(True)
        # self.setAttribute(Qt.WA_TranslucentBackground)
        # self.setStyleSheet("background:transparent;")
        self.setWindowState(Qt.WindowActive)
        self.setFixedHeight(400)
        self.setFixedWidth(500)
        # Create the QML user interface.
        self.view = QQuickWidget()
        self.view.setResizeMode(QQuickWidget.SizeRootObjectToView)
        self.view.engine().quit.connect(self.hide)
        self.view.setSource(ui_tools.get_qml_resource("Locator.qml"))
        self._root = self.view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(self.view)

        self.locate_symbols = locator.LocateSymbolsThread()
        self.locate_symbols.finished.connect(self._cleanup)
        self.locate_symbols.terminated.connect(self._cleanup)

        QApplication.instance().focusChanged["QWidget*", "QWidget*"].connect(\
            lambda w1, w2, this=self: this.hide() if w1 == this.view else None)

        # Locator things
        self.filterPrefix = re.compile(r'(@|<|>|-|!|\.|/|:)')
        self.page_items_step = 10
        self._colors = {
            "@": "white",
            "<": "#18ff6a",
            ">": "red",
            "-": "#18e1ff",
            ".": "#f118ff",
            "/": "#fff118",
            ":": "#18ffd6",
            "!": "#ffa018"}
        self._filters_list = [
            ("@", "Filename"),
            ("<", "Class"),
            (">", "Function"),
            ("-", "Attribute"),
            (".", "Current"),
            ("/", "Opened"),
            (":", "Line"),
            ("!", "NoPython")
        ]
        self._replace_symbol_type = {"<": "&lt;", ">": "&gt;"}
        self.reset_values()

        self._filter_actions = {
            '.': self._filter_this_file,
            '/': self._filter_tabs,
            ':': self._filter_lines
        }

        self._root.textChanged.connect(self.set_prefix)
        self._root.open.connect(self._open_item)
        self._root.fetchMore.connect(self._fetch_more)
示例#48
0
    def __init__(self, parent=None):
        super(LocatorWidget, self).__init__(
            parent, Qt.Dialog | Qt.FramelessWindowHint)
        self._parent = parent
        self.setModal(True)
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.setStyleSheet("background:transparent;")
        self.setFixedHeight(400)
        self.setFixedWidth(500)
        # Create the QML user interface.
        view = QDeclarativeView()
        view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
        view.setSource(ui_tools.get_qml_resource("Locator.qml"))
        self._root = view.rootObject()
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        vbox.addWidget(view)

        self.locate_symbols = locator.LocateSymbolsThread()
        self.connect(self.locate_symbols, SIGNAL("finished()"), self._cleanup)
        self.connect(self.locate_symbols, SIGNAL("terminated()"),
                     self._cleanup)

        # Locator things
        self.filterPrefix = re.compile(r'(@|<|>|-|!|\.|/|:)')
        self.page_items_step = 10
        self._colors = {
            "@": "white",
            "<": "#18ff6a",
            ">": "red",
            "-": "#18e1ff",
            ".": "#f118ff",
            "/": "#fff118",
            ":": "#18ffd6",
            "!": "#ffa018"}
        self._filters_list = [
            ("@", "Filename"),
            ("<", "Class"),
            (">", "Function"),
            ("-", "Attribute"),
            (".", "Current"),
            ("/", "Opened"),
            (":", "Line"),
            ("!", "NoPython")
        ]
        self._replace_symbol_type = {"<": "&lt;", ">": "&gt;"}
        self.reset_values()

        self._filter_actions = {
            '.': self._filter_this_file,
            '/': self._filter_tabs,
            ':': self._filter_lines
        }

        self.connect(self._root, SIGNAL("textChanged(QString)"),
                     self.set_prefix)
        self.connect(self._root, SIGNAL("open(QString, int)"),
                     self._open_item)
        self.connect(self._root, SIGNAL("fetchMore()"),
                     self._fetch_more)