本文整理汇总了Python中spyderlib.utils.qthelpers.get_std_icon函数的典型用法代码示例。如果您正苦于以下问题:Python get_std_icon函数的具体用法?Python get_std_icon怎么用?Python get_std_icon使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_std_icon函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: update_warning
def update_warning(self, warning_type=NO_WARNING, conflicts=[]):
"""Update warning label to reflect conflict status of new shortcut"""
if warning_type == NO_WARNING:
warn = False
tip = 'This shortcut is correct!'
elif warning_type == SEQUENCE_CONFLICT:
template = '<i>{0}<b>{1}</b></i>'
tip_title = _('The new shorcut conflicts with:') + '<br>'
tip_body = ''
for s in conflicts:
tip_body += ' - {0}: {1}<br>'.format(s.context, s.name)
tip_body = tip_body[:-4] # Removing last <br>
tip = template.format(tip_title, tip_body)
warn = True
elif warning_type == SEQUENCE_LENGTH:
# Sequences with 5 keysequences (i.e. Ctrl+1, Ctrl+2, Ctrl+3,
# Ctrl+4, Ctrl+5) are invalid
template = '<i>{0}</i>'
tip = _('A compound sequence can have {break} a maximum of '
'4 subsequences.{break}').format(**{'break': '<br>'})
warn = True
elif warning_type == INVALID_KEY:
template = '<i>{0}</i>'
tip = _('Invalid key entered') + '<br>'
warn = True
self.helper_button.show()
if warn:
self.label_warning.show()
self.helper_button.setIcon(get_std_icon('MessageBoxWarning'))
self.button_ok.setEnabled(False)
else:
self.helper_button.setIcon(get_std_icon('DialogApplyButton'))
self.label_warning.setText(tip)
开发者ID:AminJamalzadeh,项目名称:spyder,代码行数:35,代码来源:shortcuts.py
示例2: __init__
def __init__(self, parent=None, name_filters=['*.py', '*.pyw'],
show_all=False, show_cd_only=None, show_icontext=True):
QWidget.__init__(self, parent)
self.treewidget = ExplorerTreeWidget(self, show_cd_only=show_cd_only)
self.treewidget.setup(name_filters=name_filters, show_all=show_all)
self.treewidget.chdir(getcwd())
icontext_action = create_action(self, _("Show icons and text"),
toggled=self.toggle_icontext)
self.treewidget.common_actions += [None, icontext_action]
# Setup toolbar
self.toolbar = QToolBar(self)
self.toolbar.setIconSize(QSize(16, 16))
self.previous_action = create_action(self, text=_("Previous"),
icon=get_std_icon("ArrowBack"),
triggered=self.treewidget.go_to_previous_directory)
self.toolbar.addAction(self.previous_action)
self.previous_action.setEnabled(False)
self.connect(self.treewidget, SIGNAL("set_previous_enabled(bool)"),
self.previous_action.setEnabled)
self.next_action = create_action(self, text=_("Next"),
icon=get_std_icon("ArrowForward"),
triggered=self.treewidget.go_to_next_directory)
self.toolbar.addAction(self.next_action)
self.next_action.setEnabled(False)
self.connect(self.treewidget, SIGNAL("set_next_enabled(bool)"),
self.next_action.setEnabled)
parent_action = create_action(self, text=_("Parent"),
icon=get_std_icon("ArrowUp"),
triggered=self.treewidget.go_to_parent_directory)
self.toolbar.addAction(parent_action)
self.toolbar.addSeparator()
options_action = create_action(self, text='', tip=_("Options"),
icon=get_icon('tooloptions.png'))
self.toolbar.addAction(options_action)
widget = self.toolbar.widgetForAction(options_action)
widget.setPopupMode(QToolButton.InstantPopup)
menu = QMenu(self)
add_actions(menu, self.treewidget.common_actions)
options_action.setMenu(menu)
icontext_action.setChecked(show_icontext)
self.toggle_icontext(show_icontext)
vlayout = QVBoxLayout()
vlayout.addWidget(self.toolbar)
vlayout.addWidget(self.treewidget)
self.setLayout(vlayout)
开发者ID:jayitb,项目名称:Spyderplugin_ratelaws,代码行数:54,代码来源:explorer.py
示例3: setup_context_menu
def setup_context_menu(self):
"""Reimplement PythonShellWidget method"""
PythonShellWidget.setup_context_menu(self)
self.help_action = create_action(self, _("Help..."),
icon=get_std_icon('DialogHelpButton'),
triggered=self.help)
self.menu.addAction(self.help_action)
开发者ID:alfonsodiecko,项目名称:PYTHON_DIST,代码行数:7,代码来源:internalshell.py
示例4: get_options_menu
def get_options_menu(self):
ExternalShellBase.get_options_menu(self)
self.interact_action = create_action(self, _("Interact"))
self.interact_action.setCheckable(True)
self.debug_action = create_action(self, _("Debug"))
self.debug_action.setCheckable(True)
self.args_action = create_action(self, _("Arguments..."),
triggered=self.get_arguments)
self.post_mortem_action = create_action(self, _("Post Mortem Debug"))
self.post_mortem_action.setCheckable(True)
run_settings_menu = QMenu(_("Run settings"), self)
add_actions(run_settings_menu,
(self.interact_action, self.debug_action, self.args_action,
self.post_mortem_action))
self.cwd_button = create_action(self, _("Working directory"),
icon=get_std_icon('DirOpenIcon'),
tip=_("Set current working directory"),
triggered=self.set_current_working_directory)
self.env_button = create_action(self, _("Environment variables"),
icon=get_icon('environ.png'),
triggered=self.show_env)
self.syspath_button = create_action(self,
_("Show sys.path contents"),
icon=get_icon('syspath.png'),
triggered=self.show_syspath)
actions = [run_settings_menu, self.show_time_action, None,
self.cwd_button, self.env_button, self.syspath_button]
if self.menu_actions is not None:
actions += [None]+self.menu_actions
return actions
开发者ID:Micseb,项目名称:spyder,代码行数:30,代码来源:pythonshell.py
示例5: get_toolbar_buttons
def get_toolbar_buttons(self):
ExternalShellBase.get_toolbar_buttons(self)
if self.namespacebrowser_button is None and self.stand_alone:
self.namespacebrowser_button = create_toolbutton(self,
get_icon('dictedit.png'), self.tr("Variables"),
tip=self.tr("Show/hide global variables explorer"),
toggled=self.toggle_globals_explorer)
if self.cwd_button is None:
self.cwd_button = create_toolbutton(self,
get_std_icon('DirOpenIcon'), self.tr("Working directory"),
tip=self.tr("Set current working directory"),
triggered=self.set_current_working_directory)
if self.terminate_button is None:
self.terminate_button = create_toolbutton(self,
get_icon('terminate.png'), self.tr("Terminate"),
tip=self.tr("Attempts to terminate the process.\n"
"The process may not exit as a result of "
"clicking this button\n"
"(it is given the chance to prompt "
"the user for any unsaved files, etc)."))
buttons = [self.cwd_button]
if self.namespacebrowser_button is not None:
buttons.append(self.namespacebrowser_button)
buttons += [self.run_button, self.options_button,
self.terminate_button, self.kill_button]
return buttons
开发者ID:cheesinglee,项目名称:spyder,代码行数:26,代码来源:pythonshell.py
示例6: __init__
def __init__(self, parent=None):
QWidget.__init__(self, parent)
self.runconf = RunConfiguration()
common_group = QGroupBox(_("General settings"))
common_layout = QGridLayout()
common_group.setLayout(common_layout)
self.clo_cb = QCheckBox(_("Command line options:"))
common_layout.addWidget(self.clo_cb, 0, 0)
self.clo_edit = QLineEdit()
self.connect(self.clo_cb, SIGNAL("toggled(bool)"), self.clo_edit.setEnabled)
self.clo_edit.setEnabled(False)
common_layout.addWidget(self.clo_edit, 0, 1)
self.wd_cb = QCheckBox(_("Working directory:"))
common_layout.addWidget(self.wd_cb, 1, 0)
wd_layout = QHBoxLayout()
self.wd_edit = QLineEdit()
self.connect(self.wd_cb, SIGNAL("toggled(bool)"), self.wd_edit.setEnabled)
self.wd_edit.setEnabled(False)
wd_layout.addWidget(self.wd_edit)
browse_btn = QPushButton(get_std_icon("DirOpenIcon"), "", self)
browse_btn.setToolTip(_("Select directory"))
self.connect(browse_btn, SIGNAL("clicked()"), self.select_directory)
wd_layout.addWidget(browse_btn)
common_layout.addLayout(wd_layout, 1, 1)
radio_group = QGroupBox(_("Interpreter"))
radio_layout = QVBoxLayout()
radio_group.setLayout(radio_layout)
self.current_radio = QRadioButton(_("Execute in current Python " "or IPython interpreter"))
radio_layout.addWidget(self.current_radio)
self.new_radio = QRadioButton(_("Execute in a new dedicated " "Python interpreter"))
radio_layout.addWidget(self.new_radio)
self.systerm_radio = QRadioButton(_("Execute in an external " "system terminal"))
radio_layout.addWidget(self.systerm_radio)
new_group = QGroupBox(_("Dedicated Python interpreter"))
self.connect(self.current_radio, SIGNAL("toggled(bool)"), new_group.setDisabled)
new_layout = QGridLayout()
new_group.setLayout(new_layout)
self.interact_cb = QCheckBox(_("Interact with the Python " "interpreter after execution"))
new_layout.addWidget(self.interact_cb, 1, 0, 1, -1)
self.pclo_cb = QCheckBox(_("Command line options:"))
new_layout.addWidget(self.pclo_cb, 2, 0)
self.pclo_edit = QLineEdit()
self.connect(self.pclo_cb, SIGNAL("toggled(bool)"), self.pclo_edit.setEnabled)
self.pclo_edit.setEnabled(False)
new_layout.addWidget(self.pclo_edit, 2, 1)
pclo_label = QLabel(_("The <b>-u</b> option is " "added to these commands"))
pclo_label.setWordWrap(True)
new_layout.addWidget(pclo_label, 3, 1)
# TODO: Add option for "Post-mortem debugging"
layout = QVBoxLayout()
layout.addWidget(common_group)
layout.addWidget(radio_group)
layout.addWidget(new_group)
self.setLayout(layout)
开发者ID:jromang,项目名称:retina-old,代码行数:59,代码来源:runconfig.py
示例7: update_list
def update_list(self):
"""Update path list"""
self.listwidget.clear()
for name in self.pathlist:
item = QListWidgetItem(name)
item.setIcon(get_std_icon('DirClosedIcon'))
self.listwidget.addItem(item)
self.refresh()
开发者ID:Brainsciences,项目名称:luminoso,代码行数:8,代码来源:pathmanager.py
示例8: create_dir_item
def create_dir_item(dirname, parent):
if dirname != root_path:
displayed_name = osp.basename(dirname)
else:
displayed_name = dirname
item = QTreeWidgetItem(parent, [displayed_name])
item.setIcon(0, get_std_icon('DirClosedIcon'))
return item
开发者ID:Brainsciences,项目名称:luminoso,代码行数:8,代码来源:findinfiles.py
示例9: update_warning
def update_warning(self):
""" """
widget = self._button_warning
if not self.is_valid():
tip = _('Array dimensions not valid')
widget.setIcon(get_std_icon('MessageBoxWarning'))
widget.setToolTip(tip)
QToolTip.showText(self._widget.mapToGlobal(QPoint(0, 5)), tip)
else:
self._button_warning.setToolTip('')
开发者ID:Micseb,项目名称:spyder,代码行数:10,代码来源:arraybuilder.py
示例10: update_list
def update_list(self):
"""Update path list"""
self.listwidget.clear()
for name in self.pathlist + self.ro_pathlist:
item = QListWidgetItem(name)
item.setIcon(get_std_icon("DirClosedIcon"))
if name in self.ro_pathlist:
item.setFlags(Qt.NoItemFlags)
self.listwidget.addItem(item)
self.refresh()
开发者ID:jromang,项目名称:retina-old,代码行数:10,代码来源:pathmanager.py
示例11: update_warning
def update_warning(self, reset=False):
""" """
conflicts = self.check_conflicts()
if reset:
conflicts = []
widget = self.helper_button
if conflicts:
tip_title = _('The new entered shorcut conflicts with:') + '\n'
tip_body = ''
for s in conflicts:
tip_body += ' - {0}: {1}\n'.format(s.context, s.name)
tip = '{0}{1}'.format(tip_title, tip_body)
widget.setIcon(get_std_icon('MessageBoxWarning'))
widget.setToolTip(tip)
QToolTip.showText(widget.mapToGlobal(QPoint(0, 5)), tip)
else:
widget.setToolTip('')
QToolTip.hideText()
widget.setIcon(get_std_icon('DialogApplyButton'))
开发者ID:ptocca,项目名称:spyder,代码行数:21,代码来源:shortcuts.py
示例12: __init__
def __init__(self):
QToolButton.__init__(self)
self.setIcon(get_std_icon('MessageBoxInformation'))
style = """
QToolButton {
border: 1px solid grey;
padding:0px;
border-radius: 2px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #f6f7fa, stop: 1 #dadbde);
}
"""
self.setStyleSheet(style)
开发者ID:AminJamalzadeh,项目名称:spyder,代码行数:13,代码来源:helperwidgets.py
示例13: create_browsedir
def create_browsedir(self, text, option, default=NoDefault, tip=None):
widget = self.create_lineedit(text, option, default,
alignment=Qt.Horizontal)
for edit in self.lineedits:
if widget.isAncestorOf(edit):
break
msg = _("Invalid directory path")
self.validate_data[edit] = (osp.isdir, msg)
browse_btn = QPushButton(get_std_icon('DirOpenIcon'), "", self)
browse_btn.setToolTip(_("Select directory"))
browse_btn.clicked.connect(lambda: self.select_directory(edit))
layout = QHBoxLayout()
layout.addWidget(widget)
layout.addWidget(browse_btn)
layout.setContentsMargins(0, 0, 0, 0)
browsedir = QWidget(self)
browsedir.setLayout(layout)
return browsedir
开发者ID:SaWein,项目名称:spyder,代码行数:18,代码来源:configdialog.py
示例14: add_actions_to_context_menu
def add_actions_to_context_menu(self, menu):
"""Add actions to IPython widget context menu"""
# See spyderlib/widgets/ipython.py for more details on this method
inspect_action = create_action(self, _("Inspect current object"),
QKeySequence("Ctrl+I"),
icon=get_std_icon('MessageBoxInformation'),
triggered=self.inspect_object)
clear_line_action = create_action(self, _("Clear line or block"),
QKeySequence("Shift+Escape"),
icon=get_icon('eraser.png'),
triggered=self.clear_line)
clear_console_action = create_action(self, _("Clear console"),
QKeySequence("Ctrl+L"),
icon=get_icon('clear.png'),
triggered=self.clear_console)
quit_action = create_action(self, _("&Quit"), icon='exit.png',
triggered=self.exit_callback)
add_actions(menu, (None, inspect_action, clear_line_action,
clear_console_action, None, quit_action))
return menu
开发者ID:alfonsodiecko,项目名称:PYTHON_DIST,代码行数:20,代码来源:ipython.py
示例15: create_browsefile
def create_browsefile(self, text, option, default=NoDefault, tip=None,
filters=None):
widget = self.create_lineedit(text, option, default,
alignment=Qt.Horizontal)
for edit in self.lineedits:
if widget.isAncestorOf(edit):
break
msg = _("Invalid file path")
self.validate_data[edit] = (osp.isfile, msg)
browse_btn = QPushButton(get_std_icon('FileIcon'), "", self)
browse_btn.setToolTip(_("Select file"))
self.connect(browse_btn, SIGNAL("clicked()"),
lambda: self.select_file(edit, filters))
layout = QHBoxLayout()
layout.addWidget(widget)
layout.addWidget(browse_btn)
layout.setContentsMargins(0, 0, 0, 0)
browsedir = QWidget(self)
browsedir.setLayout(layout)
return browsedir
开发者ID:jromang,项目名称:spyderlib,代码行数:20,代码来源:configdialog.py
示例16: __init__
def __init__(self, parent=None):
QWidget.__init__(self, parent)
self.current_radio = None
self.dedicated_radio = None
self.systerm_radio = None
self.runconf = RunConfiguration()
firstrun_o = CONF.get('run', ALWAYS_OPEN_FIRST_RUN_OPTION, False)
# --- General settings ----
common_group = QGroupBox(_("General settings"))
common_layout = QGridLayout()
common_group.setLayout(common_layout)
self.clo_cb = QCheckBox(_("Command line options:"))
common_layout.addWidget(self.clo_cb, 0, 0)
self.clo_edit = QLineEdit()
self.connect(self.clo_cb, SIGNAL("toggled(bool)"),
self.clo_edit.setEnabled)
self.clo_edit.setEnabled(False)
common_layout.addWidget(self.clo_edit, 0, 1)
self.wd_cb = QCheckBox(_("Working directory:"))
common_layout.addWidget(self.wd_cb, 1, 0)
wd_layout = QHBoxLayout()
self.wd_edit = QLineEdit()
self.connect(self.wd_cb, SIGNAL("toggled(bool)"),
self.wd_edit.setEnabled)
self.wd_edit.setEnabled(False)
wd_layout.addWidget(self.wd_edit)
browse_btn = QPushButton(get_std_icon('DirOpenIcon'), "", self)
browse_btn.setToolTip(_("Select directory"))
self.connect(browse_btn, SIGNAL("clicked()"), self.select_directory)
wd_layout.addWidget(browse_btn)
common_layout.addLayout(wd_layout, 1, 1)
# --- Interpreter ---
interpreter_group = QGroupBox(_("Console"))
interpreter_layout = QVBoxLayout()
interpreter_group.setLayout(interpreter_layout)
self.current_radio = QRadioButton(CURRENT_INTERPRETER)
interpreter_layout.addWidget(self.current_radio)
self.dedicated_radio = QRadioButton(DEDICATED_INTERPRETER)
interpreter_layout.addWidget(self.dedicated_radio)
self.systerm_radio = QRadioButton(SYSTERM_INTERPRETER)
interpreter_layout.addWidget(self.systerm_radio)
# --- Dedicated interpreter ---
new_group = QGroupBox(_("Dedicated Python console"))
self.connect(self.current_radio, SIGNAL("toggled(bool)"),
new_group.setDisabled)
new_layout = QGridLayout()
new_group.setLayout(new_layout)
self.interact_cb = QCheckBox(_("Interact with the Python "
"console after execution"))
new_layout.addWidget(self.interact_cb, 1, 0, 1, -1)
self.show_kill_warning_cb = QCheckBox(_("Show warning when killing"
" running process"))
new_layout.addWidget(self.show_kill_warning_cb, 2, 0, 1, -1)
self.pclo_cb = QCheckBox(_("Command line options:"))
new_layout.addWidget(self.pclo_cb, 3, 0)
self.pclo_edit = QLineEdit()
self.connect(self.pclo_cb, SIGNAL("toggled(bool)"),
self.pclo_edit.setEnabled)
self.pclo_edit.setEnabled(False)
self.pclo_edit.setToolTip(_("<b>-u</b> is added to the "
"other options you set here"))
new_layout.addWidget(self.pclo_edit, 3, 1)
#TODO: Add option for "Post-mortem debugging"
# Checkbox to preserve the old behavior, i.e. always open the dialog
# on first run
hline = QFrame()
hline.setFrameShape(QFrame.HLine)
hline.setFrameShadow(QFrame.Sunken)
self.firstrun_cb = QCheckBox(ALWAYS_OPEN_FIRST_RUN % _("this dialog"))
self.connect(self.firstrun_cb, SIGNAL("clicked(bool)"),
self.set_firstrun_o)
self.firstrun_cb.setChecked(firstrun_o)
layout = QVBoxLayout()
layout.addWidget(interpreter_group)
layout.addWidget(common_group)
layout.addWidget(new_group)
layout.addWidget(hline)
layout.addWidget(self.firstrun_cb)
self.setLayout(layout)
开发者ID:arvindchari88,项目名称:newGitTest,代码行数:89,代码来源:runconfig.py
示例17: update_menu
def update_menu(self):
"""Update option menu"""
self.menu.clear()
actions = []
newdir_action = create_action(self,
translate('Explorer',
"New folder..."),
icon="folder_new.png",
triggered=self.new_folder)
actions.append(newdir_action)
newfile_action = create_action(self,
translate('Explorer',
"New file..."),
icon="filenew.png",
triggered=self.new_file)
actions.append(newfile_action)
fname = self.get_filename()
if fname is not None:
is_dir = osp.isdir(fname)
ext = osp.splitext(fname)[1]
run_action = create_action(self,
translate('Explorer', "Run"),
icon="run_small.png",
triggered=self.run)
edit_action = create_action(self,
translate('Explorer', "Edit"),
icon="edit.png",
triggered=self.clicked)
delete_action = create_action(self,
translate('Explorer', "Delete..."),
icon="delete.png",
triggered=self.delete)
rename_action = create_action(self,
translate('Explorer', "Rename..."),
icon="rename.png",
triggered=self.rename)
browse_action = create_action(self,
translate('Explorer', "Browse"),
icon=get_std_icon("CommandLink"),
triggered=self.clicked)
open_action = create_action(self,
translate('Explorer', "Open"),
triggered=self.startfile)
if ext in ('.py', '.pyw'):
actions.append(run_action)
if ext in self.valid_types or os.name != 'nt':
actions.append(browse_action if is_dir else edit_action)
else:
actions.append(open_action)
actions += [delete_action, rename_action, None]
if is_dir and os.name == 'nt':
# Actions specific to Windows directories
actions.append( create_action(self,
translate('Explorer', "Open in Windows Explorer"),
icon="magnifier.png",
triggered=self.startfile) )
if is_dir:
if os.name == 'nt':
_title = translate('Explorer', "Open command prompt here")
else:
_title = translate('Explorer', "Open terminal here")
action = create_action(self, _title, icon="cmdprompt.png",
triggered=lambda _fn=fname:
self.parent_widget.emit(
SIGNAL("open_terminal(QString)"), _fn))
actions.append(action)
_title = translate('Explorer', "Open Python interpreter here")
action = create_action(self, _title, icon="python.png",
triggered=lambda _fn=fname:
self.parent_widget.emit(
SIGNAL("open_interpreter(QString)"), _fn))
actions.append(action)
if programs.is_module_installed("IPython"):
_title = translate('Explorer', "Open IPython here")
action = create_action(self, _title, icon="ipython.png",
triggered=lambda _fn=fname:
self.parent_widget.emit(
SIGNAL("open_ipython(QString)"), _fn))
actions.append(action)
if actions:
actions.append(None)
actions += self.common_actions
add_actions(self.menu, actions)
开发者ID:cheesinglee,项目名称:spyder,代码行数:83,代码来源:explorer.py
示例18: __init__
def __init__(self, parent, enable_replace=False):
QWidget.__init__(self, parent)
self.enable_replace = enable_replace
self.editor = None
self.is_code_editor = None
glayout = QGridLayout()
glayout.setContentsMargins(0, 0, 0, 0)
self.setLayout(glayout)
self.close_button = create_toolbutton(self, triggered=self.hide,
icon=get_std_icon("DialogCloseButton"))
glayout.addWidget(self.close_button, 0, 0)
# Find layout
self.search_text = PatternComboBox(self, tip=_("Search string"),
adjust_to_minimum=False)
self.connect(self.search_text, SIGNAL('valid(bool)'),
lambda state:
self.find(changed=False, forward=True, rehighlight=False))
self.connect(self.search_text.lineEdit(),
SIGNAL("textEdited(QString)"), self.text_has_been_edited)
self.previous_button = create_toolbutton(self,
triggered=self.find_previous,
icon=get_std_icon("ArrowBack"))
self.next_button = create_toolbutton(self,
triggered=self.find_next,
icon=get_std_icon("ArrowForward"))
self.connect(self.next_button, SIGNAL('clicked()'),
self.update_search_combo)
self.connect(self.previous_button, SIGNAL('clicked()'),
self.update_search_combo)
self.re_button = create_toolbutton(self, icon=get_icon("advanced.png"),
tip=_("Regular expression"))
self.re_button.setCheckable(True)
self.connect(self.re_button, SIGNAL("toggled(bool)"),
lambda state: self.find())
self.case_button = create_toolbutton(self,
icon=get_icon("upper_lower.png"),
tip=_("Case Sensitive"))
self.case_button.setCheckable(True)
self.connect(self.case_button, SIGNAL("toggled(bool)"),
lambda state: self.find())
self.words_button = create_toolbutton(self,
icon=get_icon("whole_words.png"),
tip=_("Whole words"))
self.words_button.setCheckable(True)
self.connect(self.words_button, SIGNAL("toggled(bool)"),
lambda state: self.find())
self.highlight_button = create_toolbutton(self,
icon=get_icon("highlight.png"),
tip=_("Highlight matches"))
self.highlight_button.setCheckable(True)
self.connect(self.highlight_button, SIGNAL("toggled(bool)"),
self.toggle_highlighting)
hlayout = QHBoxLayout()
self.widgets = [self.close_button, self.search_text,
self.previous_button, self.next_button,
self.re_button, self.case_button, self.words_button,
self.highlight_button]
for widget in self.widgets[1:]:
hlayout.addWidget(widget)
glayout.addLayout(hlayout, 0, 1)
# Replace layout
replace_with = QLabel(_("Replace with:"))
self.replace_text = PatternComboBox(self, adjust_to_minimum=False,
tip=_("Replace string"))
self.replace_button = create_toolbutton(self,
text=_("Replace/find"),
icon=get_std_icon("DialogApplyButton"),
triggered=self.replace_find,
text_beside_icon=True)
self.connect(self.replace_button, SIGNAL('clicked()'),
self.update_replace_combo)
self.connect(self.replace_button, SIGNAL('clicked()'),
self.update_search_combo)
self.all_check = QCheckBox(_("Replace all"))
self.replace_layout = QHBoxLayout()
widgets = [replace_with, self.replace_text, self.replace_button,
self.all_check]
for widget in widgets:
self.replace_layout.addWidget(widget)
glayout.addLayout(self.replace_layout, 1, 1)
self.widgets.extend(widgets)
self.replace_widgets = widgets
self.hide_replace()
self.search_text.setTabOrder(self.search_text, self.replace_text)
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
#.........这里部分代码省略.........
开发者ID:ymarfoq,项目名称:outilACVDesagregation,代码行数:101,代码来源:findreplace.py
示例19: get_plugin_icon
def get_plugin_icon(self):
"""Return widget icon"""
return get_std_icon('DirOpenIcon')
开发者ID:arvindchari88,项目名称:newGitTest,代码行数:3,代码来源:workingdirectory.py
示例20: __init__
def __init__(self, parent, workdir=None):
QToolBar.__init__(self, parent)
SpyderPluginMixin.__init__(self, parent)
# Initialize plugin
self.initialize_plugin()
self.setWindowTitle(self.get_plugin_title()) # Toolbar title
self.setObjectName(self.get_plugin_title()) # Used to save Window state
# Previous dir action
self.history = []
self.histindex = None
self.previous_action = create_action(self, "previous", None,
get_icon('previous.png'), _('Back'),
triggered=self.previous_directory)
self.addAction(self.previous_action)
# Next dir action
self.history = []
self.histindex = None
self.next_action = create_action(self, "next", None,
get_icon('next.png'), _('Next'),
triggered=self.next_directory)
self.addAction(self.next_action)
# Enable/disable previous/next actions
self.connect(self, SIGNAL("set_previous_enabled(bool)"),
self.previous_action.setEnabled)
self.connect(self, SIGNAL("set_next_enabled(bool)"),
self.next_action.setEnabled)
# Path combo box
adjust = self.get_option('working_dir_adjusttocontents')
self.pathedit = PathComboBox(self, adjust_to_contents=adjust)
self.pathedit.setToolTip(_("This is the working directory for newly\n"
"opened consoles (Python/IPython consoles and\n"
"terminals), for the file explorer, for the\n"
"find in files plugin and for new files\n"
"created in the editor"))
self.connect(self.pathedit, SIGNAL("open_dir(QString)"), self.chdir)
self.pathedit.setMaxCount(self.get_option('working_dir_history'))
wdhistory = self.load_wdhistory( workdir )
if workdir is None:
if self.get_option('startup/use_last_directory'):
if wdhistory:
workdir = wdhistory[0]
else:
workdir = "."
else:
workdir = self.get_option('startup/fixed_directory', ".")
if not osp.isdir(workdir):
workdir = "."
self.chdir(workdir)
self.pathedit.addItems( wdhistory )
self.refresh_plugin()
self.addWidget(self.pathedit)
# Browse action
browse_action = create_action(self, "browse", None,
get_std_icon('DirOpenIcon'),
_('Browse a working directory'),
triggered=self.select_directory)
self.addAction(browse_action)
# Set current console working directory action
setwd_action = create_action(self, icon=get_icon('set_workdir.png'),
text=_("Set as current console's "
"working directory"),
triggered=self.set_as_current_console_wd)
self.addAction(setwd_action)
# Parent dir action
parent_action = create_action(self, "parent", None,
get_icon('up.png'),
_('Change to parent directory'),
triggered=self.parent_directory)
self.addAction(parent_action)
开发者ID:arvindchari88,项目名称:newGitTest,代码行数:78,代码来源:workingdirectory.py
注:本文中的spyderlib.utils.qthelpers.get_std_icon函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论