Exemple #1
0
    def _open_and_yield(self, action_name, timeout_ms=300, retries=6):
        """
        Compatible with run_test_driver, to be used in a yield statement
            editor = Project_Properties_Editor()
            yield editor.open_and_yield()
            ...
        :param action_name: the name of the action that will open window
        """

        windows = Gtk.Window.list_toplevels()
        yield modal_dialog(lambda: GPS.execute_action(action_name), timeout_ms)

        self.dialogs = []
        attempt = 0
        while True:
            self.dialogs = [
                w for w in Gtk.Window.list_toplevels()
                if w not in windows and w.get_mapped()
            ]

            if self.dialogs:
                # Wait little bit more to allow dialog to be dispayed and
                # focus to be moved.
                yield timeout(timeout_ms)
                break
            attempt += 1
            if attempt > retries:
                break
            yield timeout(timeout_ms)
Exemple #2
0
    def _open_and_yield(self, action_name, timeout_ms=300, retries=6):
        """
        Compatible with run_test_driver, to be used in a yield statement
            editor = Project_Properties_Editor()
            yield editor.open_and_yield()
            ...
        :param action_name: the name of the action that will open window
        """

        windows = Gtk.Window.list_toplevels()
        yield modal_dialog(lambda: GPS.execute_action(action_name), timeout_ms)

        self.dialogs = []
        attempt = 0
        while True:
            self.dialogs = [
                w for w in Gtk.Window.list_toplevels()
                if w not in windows and w.get_mapped()]

            if self.dialogs:
                # Wait little bit more to allow dialog to be dispayed and
                # focus to be moved.
                yield timeout(timeout_ms)
                break
            attempt += 1
            if attempt > retries:
                break
            yield timeout(timeout_ms)