def get_media_files_panel(media_list_view, add_cb, del_cb, col_changed_cb, hamburger_launch_pressed, filtering_cb): # Create buttons and connect signals add_media_b = Gtk.Button(_("Add")) del_media_b = Gtk.Button(_("Delete")) add_media_b.connect("clicked", add_cb, None) del_media_b.connect("clicked", del_cb, None) add_media_b.set_tooltip_text(_("Add Media File to Bin")) del_media_b.set_tooltip_text(_("Delete Media File from Bin")) hamburger_launcher = guicomponents.HamburgerPressLaunch( hamburger_launch_pressed) guiutils.set_margins(hamburger_launcher.widget, 2, 0, 4, 12) columns_img = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "columns.png") columns_launcher = guicomponents.PressLaunch(col_changed_cb, columns_img, w=22, h=22) columns_launcher.surface_y = 6 columns_launcher.widget.set_tooltip_text( _("Number of Media File columns.")) all_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_all_files.png") audio_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_audio_files.png") graphics_pixbuf = cairo.ImageSurface.create_from_png( respaths.IMAGE_PATH + "show_graphics_files.png") video_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_video_files.png") imgseq_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_imgseq_files.png") pattern_pixbuf = cairo.ImageSurface.create_from_png( respaths.IMAGE_PATH + "show_pattern_producers.png") files_filter_launcher = guicomponents.ImageMenuLaunch( filtering_cb, [ all_pixbuf, video_pixbuf, audio_pixbuf, graphics_pixbuf, imgseq_pixbuf, pattern_pixbuf ], 24, 22) files_filter_launcher.surface_x = 3 files_filter_launcher.surface_y = 4 files_filter_launcher.widget.set_tooltip_text( _("Visible Media File types.")) gui.media_view_filter_selector = files_filter_launcher buttons_box = Gtk.HBox(False, 1) buttons_box.pack_start(hamburger_launcher.widget, False, False, 0) buttons_box.pack_start(guiutils.get_pad_label(4, 4), False, False, 0) buttons_box.pack_start(columns_launcher.widget, False, False, 0) buttons_box.pack_start(files_filter_launcher.widget, False, False, 0) buttons_box.pack_start(Gtk.Label(), True, True, 0) panel = Gtk.VBox() panel.pack_start(media_list_view, True, True, 0) panel.pack_start(buttons_box, False, True, 0) return panel
def get_media_files_panel(media_list_view, add_cb, del_cb, col_changed_cb, proxy_cb, filtering_cb): # Create buttons and connect signals add_media_b = Gtk.Button(_("Add")) del_media_b = Gtk.Button(_("Delete")) add_media_b.connect("clicked", add_cb, None) del_media_b.connect("clicked", del_cb, None) add_media_b.set_tooltip_text(_("Add Media File to Bin")) del_media_b.set_tooltip_text(_("Delete Media File from Bin")) proxy_b = Gtk.Button() proxy_b.set_image( Gtk.Image.new_from_file(respaths.IMAGE_PATH + "proxy_button.png")) proxy_b.connect("clicked", proxy_cb, None) proxy_b.set_tooltip_text(_("Render Proxy Files For Selected Media")) gui.proxy_button = proxy_b columns_img = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "columns.png") columns_launcher = guicomponents.PressLaunch(col_changed_cb, columns_img, w=22, h=22) columns_launcher.surface_y = 9 all_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_all_files.png") audio_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_audio_files.png") graphics_pixbuf = cairo.ImageSurface.create_from_png( respaths.IMAGE_PATH + "show_graphics_files.png") video_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_video_files.png") imgseq_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_imgseq_files.png") pattern_pixbuf = cairo.ImageSurface.create_from_png( respaths.IMAGE_PATH + "show_pattern_producers.png") files_filter_launcher = guicomponents.ImageMenuLaunch( filtering_cb, [ all_pixbuf, video_pixbuf, audio_pixbuf, graphics_pixbuf, imgseq_pixbuf, pattern_pixbuf ], 24, 22) files_filter_launcher.surface_x = 3 files_filter_launcher.surface_y = 8 gui.media_view_filter_selector = files_filter_launcher buttons_box = Gtk.HBox(False, 1) buttons_box.pack_start(add_media_b, True, True, 0) buttons_box.pack_start(del_media_b, True, True, 0) buttons_box.pack_start(proxy_b, False, False, 0) buttons_box.pack_start(guiutils.get_pad_label(4, 4), False, False, 0) buttons_box.pack_start(columns_launcher.widget, False, False, 0) buttons_box.pack_start(files_filter_launcher.widget, False, False, 0) panel = Gtk.VBox() panel.pack_start(buttons_box, False, True, 0) panel.pack_start(media_list_view, True, True, 0) return panel
def get_media_files_panel(media_list_view, add_cb, del_cb, col_changed_cb, hamburger_launch_pressed, filtering_cb): # Aug-2019 - SvdB - BB size_adj = 1 prefs = editorpersistance.prefs if prefs.double_track_hights: size_adj = 2 hamburger_launcher = guicomponents.HamburgerPressLaunch( hamburger_launch_pressed) guiutils.set_margins(hamburger_launcher.widget, 2, 0, 4, 12) columns_img = guiutils.get_cairo_image("columns") columns_launcher = guicomponents.PressLaunch(col_changed_cb, columns_img, w=22 * size_adj, h=22 * size_adj) columns_launcher.surface_y = 6 columns_launcher.widget.set_tooltip_text( _("Number of Media File columns.")) all_pixbuf = guiutils.get_cairo_image("show_all_files") audio_pixbuf = guiutils.get_cairo_image("show_audio_files") graphics_pixbuf = guiutils.get_cairo_image("show_graphics_files") video_pixbuf = guiutils.get_cairo_image("show_video_files") imgseq_pixbuf = guiutils.get_cairo_image("show_imgseq_files") pattern_pixbuf = guiutils.get_cairo_image("show_pattern_producers") unused_pixbuf = guiutils.get_cairo_image("show_unused_files") files_filter_launcher = guicomponents.ImageMenuLaunch( filtering_cb, [ all_pixbuf, video_pixbuf, audio_pixbuf, graphics_pixbuf, imgseq_pixbuf, pattern_pixbuf, unused_pixbuf ], 24 * size_adj, 22 * size_adj) files_filter_launcher.surface_x = 3 files_filter_launcher.surface_y = 4 files_filter_launcher.widget.set_tooltip_text( _("Visible Media File types.")) gui.media_view_filter_selector = files_filter_launcher bin_info = guicomponents.BinInfoPanel() buttons_box = Gtk.HBox(False, 1) buttons_box.pack_start(hamburger_launcher.widget, False, False, 0) buttons_box.pack_start(guiutils.get_pad_label(4, 4), False, False, 0) buttons_box.pack_start(columns_launcher.widget, False, False, 0) buttons_box.pack_start(files_filter_launcher.widget, False, False, 0) buttons_box.pack_start(Gtk.Label(), True, True, 0) buttons_box.pack_start(bin_info, False, False, 0) #buttons_box.pack_start(Gtk.Label(), True, True, 0) panel = Gtk.VBox() panel.pack_start(media_list_view, True, True, 0) panel.pack_start(buttons_box, False, True, 0) return (panel, bin_info)
def get_media_files_panel(media_list_view, add_cb, del_cb, col_changed_cb, proxy_cb, filtering_cb): # Create buttons and connect signals add_media_b = gtk.Button(_("Add")) del_media_b = gtk.Button(_("Delete")) add_media_b.connect("clicked", add_cb, None) del_media_b.connect("clicked", del_cb, None) add_media_b.set_tooltip_text(_("Add Media File to Bin")) del_media_b.set_tooltip_text(_("Delete Media File from Bin")) proxy_b = gtk.Button() proxy_b.set_image( gtk.image_new_from_file(respaths.IMAGE_PATH + "proxy_button.png")) proxy_b.connect("clicked", proxy_cb, None) proxy_b.set_tooltip_text(_("Render Proxy Files For Selected Media")) gui.proxy_button = proxy_b columns_img = gtk.image_new_from_file(respaths.IMAGE_PATH + "columns.png") adj = gtk.Adjustment(value=editorpersistance.prefs.media_columns, lower=MEDIA_PANEL_MIN_ROWS, upper=MEDIA_PANEL_MAX_ROWS, step_incr=1) spin = gtk.SpinButton(adj) spin.set_numeric(True) spin.set_size_request(40, 30) spin.connect("changed", col_changed_cb) all_pixbuf = gtk.gdk.pixbuf_new_from_file(respaths.IMAGE_PATH + "show_all_files.png") audio_pixbuf = gtk.gdk.pixbuf_new_from_file(respaths.IMAGE_PATH + "show_audio_files.png") graphics_pixbuf = gtk.gdk.pixbuf_new_from_file(respaths.IMAGE_PATH + "show_graphics_files.png") video_pixbuf = gtk.gdk.pixbuf_new_from_file(respaths.IMAGE_PATH + "show_video_files.png") imgseq_pixbuf = gtk.gdk.pixbuf_new_from_file(respaths.IMAGE_PATH + "show_imgseq_files.png") pattern_pixbuf = gtk.gdk.pixbuf_new_from_file(respaths.IMAGE_PATH + "show_pattern_producers.png") files_filter_launcher = guicomponents.ImageMenuLaunch( filtering_cb, [ all_pixbuf, video_pixbuf, audio_pixbuf, graphics_pixbuf, imgseq_pixbuf, pattern_pixbuf ], 20, 22) files_filter_launcher.pixbuf_x = 3 files_filter_launcher.pixbuf_y = 9 gui.media_view_filter_selector = files_filter_launcher buttons_box = gtk.HBox(False, 1) buttons_box.pack_start(add_media_b, True, True, 0) buttons_box.pack_start(del_media_b, True, True, 0) buttons_box.pack_start(proxy_b, False, False, 0) buttons_box.pack_start(guiutils.get_pad_label(4, 4), False, False, 0) buttons_box.pack_start(columns_img, False, False, 0) buttons_box.pack_start(spin, False, False, 0) buttons_box.pack_start(files_filter_launcher.widget, False, False, 0) panel = gtk.VBox() panel.pack_start(buttons_box, False, True, 0) panel.pack_start(media_list_view, True, True, 0) out_align = gtk.Alignment(0.5, 0.5, 1.0, 1.0) out_align.set_padding(4, 4, 0, 4) out_align.add(panel) return out_align