Example #1
0
 def addDock(self, name, dialog, position, visibility=True, connect=True):
     controls = PuddleDock._controls.values()
     dock = PuddleDock(name, dialog, self, status)
     self.addDockWidget(position, dock)
     self._winmenu.addAction(dock.toggleViewAction())
     if connect:
         connect_control(PuddleDock._controls[name], controls)
     dock.setVisible(visibility)
     self.restoreDockWidget(dock)
     return PuddleDock._controls[name]
Example #2
0
 def addDock(self, name, dialog, position, visibility=True, connect=True):
     controls = PuddleDock._controls.values()
     dock = PuddleDock(name, dialog, self, status)
     self.addDockWidget(position, dock)
     self._winmenu.addAction(dock.toggleViewAction())
     if connect:
         connect_control(PuddleDock._controls[name], controls)
     dock.setVisible(visibility)
     self.restoreDockWidget(dock)
     return PuddleDock._controls[name]
Example #3
0
def create_tool_windows(parent, extra=None):
    """Creates the dock widgets for the main window (parent) using
    the modules stored in puddlestuff/mainwin.

    Returns (the toggleViewActions of the docks, the dockWidgets the
    mselves)."""
    actions = []
    docks = []
    cparser = PuddleConfig()
    cparser.filename = ls.menu_path
    widgets = (
        mainwin.tagpanel,
        mainwin.artwork,
        mainwin.dirview,
        mainwin.patterncombo,
        mainwin.filterwin,
        puddlestuff.webdb,
        mainwin.storedtags,
        mainwin.logdialog,
        puddlestuff.masstag.dialogs,
    )

    controls = [z.control for z in widgets]
    controls.extend(mainwin.action_dialogs.controls)
    if extra:
        controls.extend(extra)
    for z in controls:
        name = z[0]
        try:
            if not z[2]:
                PuddleDock._controls[name] = z[1](status=status)
                continue
        except IndexError:
            pass

        p = PuddleDock(z[0], z[1], parent, status)

        parent.addDockWidget(z[2], p)

        try:
            if z[4]:
                p.setFloating(True)
            p.move(parent.rect().center())
        except IndexError:
            pass

        p.setVisible(z[3])
        docks.append(p)
        action = p.toggleViewAction()
        action.setText(name)
        scut = cparser.get("winshortcuts", name, "")
        if scut:
            action.setShortcut(scut)
        actions.append(action)
    return actions, docks
Example #4
0
def create_tool_windows(parent, extra=None):
    """Creates the dock widgets for the main window (parent) using
    the modules stored in puddlestuff/mainwin.

    Returns (the toggleViewActions of the docks, the dockWidgets the
    mselves)."""
    actions = []
    docks = []
    cparser = PuddleConfig()
    cparser.filename = ls.menu_path
    widgets = (mainwin.tagpanel, mainwin.artwork, mainwin.dirview,
               mainwin.patterncombo, mainwin.filterwin, puddlestuff.webdb,
               mainwin.storedtags, mainwin.logdialog,
               puddlestuff.masstag.dialogs)

    controls = [z.control for z in widgets]
    controls.extend(mainwin.action_dialogs.controls)
    if extra:
        controls.extend(extra)
    for z in controls:
        name = z[0]
        try:
            if not z[2]:
                PuddleDock._controls[name] = z[1](status=status)
                continue
        except IndexError:
            pass

        p = PuddleDock(z[0], z[1], parent, status)

        parent.addDockWidget(z[2], p)

        try:
            if z[4]: p.setFloating(True)
            p.move(parent.rect().center())
        except IndexError:
            pass

        p.setVisible(z[3])
        docks.append(p)
        action = p.toggleViewAction()
        action.setText(name)
        scut = cparser.get('winshortcuts', name, '')
        if scut:
            action.setShortcut(scut)
        actions.append(action)
    return actions, docks