2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-06-29 20:23:40 +00:00
|
|
|
import bpy
|
2011-08-12 06:57:00 +00:00
|
|
|
from bpy.types import Header
|
2009-06-29 20:23:40 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class FILEBROWSER_HT_header(Header):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'FILE_BROWSER'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
st = context.space_data
|
|
|
|
|
|
|
|
layout.template_header(menus=False)
|
|
|
|
|
|
|
|
row = layout.row()
|
2009-11-23 00:27:30 +00:00
|
|
|
row.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
2009-12-10 10:23:53 +00:00
|
|
|
row.operator("file.previous", text="", icon='BACK')
|
|
|
|
row.operator("file.next", text="", icon='FORWARD')
|
|
|
|
row.operator("file.parent", text="", icon='FILE_PARENT')
|
|
|
|
row.operator("file.refresh", text="", icon='FILE_REFRESH')
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
2009-11-23 00:27:30 +00:00
|
|
|
row.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
2014-01-13 09:43:15 +00:00
|
|
|
layout.operator_context = "EXEC_DEFAULT"
|
2011-03-16 21:05:24 +00:00
|
|
|
row.operator("file.directory_new", icon='NEWFOLDER')
|
2010-09-07 15:17:42 +00:00
|
|
|
|
2014-01-13 09:43:15 +00:00
|
|
|
layout.operator_context = "INVOKE_DEFAULT"
|
2010-09-01 02:25:49 +00:00
|
|
|
params = st.params
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-09-01 02:25:49 +00:00
|
|
|
# can be None when save/reload with a file selector open
|
2010-09-07 15:17:42 +00:00
|
|
|
if params:
|
2010-09-01 02:25:49 +00:00
|
|
|
layout.prop(params, "display_type", expand=True, text="")
|
|
|
|
layout.prop(params, "sort_method", expand=True, text="")
|
|
|
|
|
|
|
|
layout.prop(params, "show_hidden")
|
|
|
|
layout.prop(params, "use_filter", text="", icon='FILTER')
|
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.active = params.use_filter
|
2011-01-01 07:20:34 +00:00
|
|
|
|
2010-09-01 02:25:49 +00:00
|
|
|
row.prop(params, "use_filter_folder", text="")
|
2011-01-01 07:20:34 +00:00
|
|
|
|
2010-09-24 07:05:43 +00:00
|
|
|
if params.filter_glob:
|
2011-11-07 16:26:53 +00:00
|
|
|
#if st.active_operator and hasattr(st.active_operator, "filter_glob"):
|
2010-09-24 07:05:43 +00:00
|
|
|
# row.prop(params, "filter_glob", text="")
|
|
|
|
row.label(params.filter_glob)
|
|
|
|
else:
|
|
|
|
row.prop(params, "use_filter_blender", text="")
|
2012-10-27 18:31:52 +00:00
|
|
|
row.prop(params, "use_filter_backup", text="")
|
2010-09-24 07:05:43 +00:00
|
|
|
row.prop(params, "use_filter_image", text="")
|
|
|
|
row.prop(params, "use_filter_movie", text="")
|
|
|
|
row.prop(params, "use_filter_script", text="")
|
|
|
|
row.prop(params, "use_filter_font", text="")
|
|
|
|
row.prop(params, "use_filter_sound", text="")
|
|
|
|
row.prop(params, "use_filter_text", text="")
|
2011-04-04 10:13:04 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
bpy.utils.register_module(__name__)
|