Example #1
0
 def __init__(self, dock_tabbar, main):
     QObject.__init__(self)
     self.dock_tabbar = dock_tabbar
     self.main = main
     self.moving = False
     self.from_index = None
     self.to_index = None
Example #2
0
def create_toolbutton(parent,
                      text=None,
                      shortcut=None,
                      icon=None,
                      tip=None,
                      toggled=None,
                      triggered=None,
                      autoraise=True,
                      text_beside_icon=False):
    """Create a QToolButton"""
    button = QToolButton(parent)
    if text is not None:
        button.setText(text)
    if icon is not None:
        if is_text_string(icon):
            icon = get_icon(icon)
        button.setIcon(icon)
    if text is not None or tip is not None:
        button.setToolTip(text if tip is None else tip)
    if text_beside_icon:
        button.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
    button.setAutoRaise(autoraise)
    if triggered is not None:
        QObject.connect(button, SIGNAL('clicked()'), triggered)
    if toggled is not None:
        QObject.connect(button, SIGNAL("toggled(bool)"), toggled)
        button.setCheckable(True)
    if shortcut is not None:
        button.setShortcut(shortcut)
    return button
Example #3
0
 def __init__(self, dock_tabbar, main):
     QObject.__init__(self)
     self.dock_tabbar = dock_tabbar
     self.main = main
     self.moving = False
     self.from_index = None
     self.to_index = None
Example #4
0
 def initialize_plugin(self):
     """Initialize plugin: connect signals, setup actions, ..."""
     self.plugin_actions = self.get_plugin_actions()
     QObject.connect(self, SIGNAL("show_message(QString,int)"), self.show_message)
     QObject.connect(self, SIGNAL("update_plugin_title()"), self.__update_plugin_title)
     if self.sig_option_changed is not None:
         self.sig_option_changed.connect(self.set_option)
     self.setWindowTitle(self.get_plugin_title())
     self.create_toggle_view_action()
Example #5
0
 def initialize_plugin(self):
     """Initialize plugin: connect signals, setup actions, ..."""
     self.plugin_actions = self.get_plugin_actions()
     QObject.connect(self, SIGNAL('show_message(QString,int)'),
                     self.show_message)
     QObject.connect(self, SIGNAL('update_plugin_title()'),
                     self.__update_plugin_title)
     if self.sig_option_changed is not None:
         self.sig_option_changed.connect(self.set_option)
     self.setWindowTitle(self.get_plugin_title())
     self.create_toggle_view_action()
Example #6
0
        def __init__(self, canvas, num):
            import matplotlib
            
            if backend_qt4.DEBUG:
                print 'FigureManagerQT.%s' % backend_qt4.fn_name()
            backend_qt4.FigureManagerBase.__init__(self, canvas, num)
            self.canvas = canvas
            
            self.window = FigureWindow()
            self.window.setWindowTitle("Figure %d" % num)
            self.window.setAttribute(Qt.WA_DeleteOnClose)

            import os.path as osp
            image = osp.join(matplotlib.rcParams['datapath'],
                             'images', 'matplotlib.png' )
            self.window.setWindowIcon(QIcon(image))
    
            # Give the keyboard focus to the figure instead of the manager
            self.canvas.setFocusPolicy(Qt.ClickFocus)
            self.canvas.setFocus()
    
            QObject.connect(self.window, SIGNAL('destroyed()'),
                            self._widgetclosed)
            self.window._destroying = False
    
            self.toolbar = self._get_toolbar(self.canvas, self.window)
            self.window.addToolBar(self.toolbar)
            QObject.connect(self.toolbar, SIGNAL("message"),
                    self.window.statusBar().showMessage)
    
            self.window.setCentralWidget(self.canvas)
    
            if matplotlib.is_interactive():
                self.window.show()
    
            # attach a show method to the figure for pylab ease of use
            self.canvas.figure.show = lambda *args: self.window.show()
    
            def notify_axes_change(fig):
                # This will be called whenever the current axes is changed
                if self.toolbar != None: self.toolbar.update()
            self.canvas.figure.add_axobserver(notify_axes_change)
Example #7
0
    def __init__(self, parent, on_finished=None, on_partial=None):
        QObject.__init__(self, parent)
        self._parent = parent
        self.output = None
        self.partial = None
        self.stdout = None
        self.error = None
        self._parse = False
        self._function_called = ''
        self._name = None
        self._process = QProcess()
        self._on_finished = on_finished

        self._process.finished.connect(self._call_conda_ready)
        self._process.readyReadStandardOutput.connect(self._call_conda_partial)

        if on_finished is not None:
            self._process.finished.connect(on_finished)
        if on_partial is not None:
            self._process.readyReadStandardOutput.connect(on_partial)

        self.set_root_prefix()
Example #8
0
def create_toolbutton(parent, text=None, shortcut=None, icon=None, tip=None,
                      toggled=None, triggered=None,
                      autoraise=True, text_beside_icon=False):
    """Create a QToolButton"""
    button = QToolButton(parent)
    if text is not None:
        button.setText(text)
    if icon is not None:
        if is_text_string(icon):
            icon = get_icon(icon)
        button.setIcon(icon)
    if text is not None or tip is not None:
        button.setToolTip(text if tip is None else tip)
    if text_beside_icon:
        button.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
    button.setAutoRaise(autoraise)
    if triggered is not None:
        QObject.connect(button, SIGNAL('clicked()'), triggered)
    if toggled is not None:
        QObject.connect(button, SIGNAL("toggled(bool)"), toggled)
        button.setCheckable(True)
    if shortcut is not None:
        button.setShortcut(shortcut)
    return button
Example #9
0
 def __init__(self):
     QObject.__init__(self)
     self.dialogs = {}
     self.namespace = None
Example #10
0
 def __init__(self, input_condition):
     QObject.__init__(self)
     self.input_data = None
     self.input_condition = input_condition
Example #11
0
 def __init__(self):
     QObject.__init__(self)
     self.queue = []
     self.lock = threading.Lock()
Example #12
0
 def __init__(self, input_condition):
     QObject.__init__(self)
     self.input_data = None
     self.input_condition = input_condition
Example #13
0
 def __init__(self):
     QObject.__init__(self)
     self.queue = []
     self.lock = threading.Lock()
Example #14
0
 def __init__(self):
     QObject.__init__(self)
     self.dialogs = {}
     self.namespace = None
Example #15
0
 def __init__(self, parent):
     QObject.__init__(self)
     self._parent = parent
     self.error = None
     self.latest_release = None
Example #16
0
 def __init__(self):
     QObject.__init__(self)
     self.dialogs = {}
Example #17
0
 def __init__(self, parent):
     QObject.__init__(self)
     self._parent = parent
     self.error = None
     self.latest_release = None
Example #18
0
 def __init__(self):
     QObject.__init__(self)
     self.dialogs = {}