本文整理汇总了Python中cola.widgets.status.StatusWidget.set_filter方法的典型用法代码示例。如果您正苦于以下问题:Python StatusWidget.set_filter方法的具体用法?Python StatusWidget.set_filter怎么用?Python StatusWidget.set_filter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cola.widgets.status.StatusWidget
的用法示例。
在下文中一共展示了StatusWidget.set_filter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainView
# 需要导入模块: from cola.widgets.status import StatusWidget [as 别名]
# 或者: from cola.widgets.status.StatusWidget import set_filter [as 别名]
#.........这里部分代码省略.........
self.build_recent_menu)
self.connect(self.commitmsgeditor, SIGNAL('cursorPosition(int,int)'),
self.show_cursor_position)
self.connect(self.diffeditor, SIGNAL('diff_options_updated()'),
self.statuswidget.refresh)
self.connect(self, SIGNAL('update'), self._update_callback)
self.connect(self, SIGNAL('install_config_actions'),
self._install_config_actions)
# Install .git-config-defined actions
self._config_task = None
self.install_config_actions()
# Restore saved settings
if not self.restore_state(settings=settings):
self.resize(987, 610)
self.set_initial_size()
self.statusdockwidget.widget().setFocus()
# Route command output here
Interaction.log_status = self.logwidget.log_status
Interaction.log = self.logwidget.log
Interaction.log(version.git_version_str() + '\n' +
N_('git cola version %s') % version.version())
def set_initial_size(self):
self.statuswidget.set_initial_size()
self.commitmsgeditor.set_initial_size()
def set_filter(self, txt):
self.statuswidget.set_filter(txt)
# Qt overrides
def closeEvent(self, event):
"""Save state in the settings manager."""
commit_msg = self.commitmsgeditor.commit_message(raw=True)
self.model.save_commitmsg(commit_msg)
MainWindow.closeEvent(self, event)
def build_recent_menu(self):
settings = Settings()
settings.load()
recent = settings.recent
cmd = cmds.OpenRepo
menu = self.open_recent_menu
menu.clear()
for r in recent:
name = os.path.basename(r)
directory = os.path.dirname(r)
text = '%s %s %s' % (name, unichr(0x2192), directory)
menu.addAction(text, cmds.run(cmd, r))
# Accessors
mode = property(lambda self: self.model.mode)
def _config_updated(self, source, config, value):
if config == prefs.FONTDIFF:
# The diff font
font = QtGui.QFont()
if not font.fromString(value):
return
self.logwidget.setFont(font)