コード例 #1
0
ファイル: Menu.py プロジェクト: vporel/Web-editor
 def __init__(self, text, parent, icon=None, name=None, shortcut=None):
     QAction.__init__(self, text, parent)
     if icon is not None:
         self.setIcon(QIcon(icon))
     if name is not None:
         self.setObjectName(name)
     if shortcut is not None:
         self.setShortcut(shortcut)
コード例 #2
0
 def __init__(self, name, iface, dlg):
     QAction.__init__(self, self.name(), iface.mainWindow())
     self.iface = iface
     self.dlg = dlg
     self.canvas = iface.mapCanvas()
     self.setWhatsThis(self.desc())
     self.setToolTip(self.desc())
     self.triggered.connect(self.doit)
     return None
コード例 #3
0
ファイル: Command.py プロジェクト: lihaochen910/Candy
 def __init__(self, actionName, actionText, parent, command):
     QAction.__init__(self, actionName, parent)
     # UiInfo.__init__ ( self,  )
     self.setShortcutContext(Qt.WidgetWithChildrenShortcut)
     self.setShortcutVisibleInContextMenu(True)
     self.setText(actionText)
     if command:
         self.setProperty("QCommandAction", str(command))
     self.triggered.connect(self.onTriggered)
コード例 #4
0
	def __init__(self,enable_text=_("Enabled"),disable_text=_("Disabled")):
		QAction.__init__(self)
		self.enabled=True
		self.enable_text=enable_text
		self.disable_text=disable_text

		self.setState(self.enabled)

		self.triggered.connect(self.do_emit)
コード例 #5
0
	def __init__(self,parent):
		self.dump=False
		self.tokens=["#newton_dump","#dump_dynamic","#dump_optics","#dump_optics_verbose", "#dump_1d_slices","#dump_energy_slice_switch","#dump_energy_slice_pos","#dump_pl","#dump_write_out_band_structure","#dump_equilibrium","#dump_optical_probe","#dump_optical_probe_spectrum","#dump_ray_trace_map","#dump_write_converge","#dump_first_guess","#dump_info_text"]
		self.tokens.append("#dump_workbook")
		self.const_tokens=[]
		self.const_tokens.append(["#dump_print_converge",True])
		self.const_tokens.append(["#dump_print_newtonerror",False])

		self.help_text=" Writing data to disk can be slow and gpvdm can produce a lot of data files during a simulation run.  To speed up the simulation use this icon to minimize simulation output.  Click it again to turn back on full output.  You can fine tune these parameters theough the Configure->Dump tab."
		QAction.__init__(self,icon_get("hdd_low"), _("Data dump\ncontrol"),parent)
		self.triggered.connect(self.callback_dump_io)
コード例 #6
0
ファイル: main.py プロジェクト: schspa/virtualbox-usb-switch
 def __init__(self, name, uuid, state):
     QAction.__init__(self, name)
     self.setCheckable(True)
     self.setVisible(True)
     self.triggered.connect(self.usbswitch)
     self.name = name
     self.uuid = uuid
     self.state = state
     if (self.state == "Captured"):
         self.setChecked(True)
     pass
コード例 #7
0
    def __init__(self, parent=None):

        QAction.__init__(self, parent, text="Open...")

        self.parent = parent

        # Placeholder for the filename
        self.fname = None

        # Action for opening a file
        self.triggered.connect(self.open_file)

        self._presenter = FileLoaderPresenter(self)
コード例 #8
0
    def __init__(self, icon_name, text, s, id):
        sub_icon = None
        self.locked = False
        self.text = text

        if get_lock().is_function_locked(id) == True:
            self.locked = True

        if get_lock().is_function_not_locked(id) == True:
            self.locked = False

        if self.locked == True:
            sub_icon = "lock"
        QAction.__init__(self, icon_get(icon_name, sub_icon=sub_icon), text, s)
        self.triggered.connect(self.callback_secure_click)
コード例 #9
0
ファイル: textedit.py プロジェクト: hovo1990/GROM
    def __init__(self, *args):
        QAction.__init__(self, *args)

        self.triggered.connect(lambda x: self.correct.emit(
            str(self.text())))
コード例 #10
0
        def __init__(self, *args):
            QAction.__init__(self, *args)

            self.triggered.connect(lambda x: self.correct.emit(
                    str(self.text())))
コード例 #11
0
 def __init__(self, name, parent=None):
     QAction.__init__(self, name, parent)
     self.triggered.connect(self._send_coll)
コード例 #12
0
ファイル: launcher.py プロジェクト: uroszezula/pylauncher
 def __init__(self, itemModel, parent=None):
     QAction.__init__(self, parent)
     self.setSeparator(True)
コード例 #13
0
ファイル: launcher.py プロジェクト: uroszezula/pylauncher
 def __init__(self, itemModel, parent=None):
     # For QAction &X means that X is shortcut, && gives &
     QAction.__init__(self, itemModel.text.replace('&', '&&'), parent)
     self.itemModel = itemModel
     self.triggered.connect(self.changeView)
コード例 #14
0
 def __init__(self, parent):
     self.thermal = False
     QAction.__init__(self, icon_get("thermal-off"), _("Isothermal"),
                      parent)
     self.triggered.connect(self.callback_state_changed)
     self.update_ui(False)