#include "edl.h"
#include "edlsession.h"
#include "file.h"
+#include "filesystem.h"
#include "filexml.h"
#include "language.h"
+#include "loadfile.h"
#include "localsession.h"
#include "mainerror.h"
#include "mainindexes.h"
+#include "mainmenu.h"
#include "mainsession.h"
#include "mwindow.h"
#include "mwindowgui.h"
BC_SubMenu *submenu;
add_item(info = new AssetPopupInfo(mwindow, this));
add_item(format = new AWindowListFormat(mwindow, gui));
- add_item(menu_item = new BC_MenuItem(_("Sort...")));
- menu_item->add_submenu(submenu = new BC_SubMenu());
- submenu->add_submenuitem(new AssetPopupSortNames(mwindow, this));
- submenu->add_submenuitem(new AssetPopupSortTimes(mwindow, this));
+ add_item(new AssetPopupSort(mwindow, this));
add_item(index = new AssetPopupBuildIndex(mwindow, this));
add_item(view = new AssetPopupView(mwindow, this));
add_item(view_window = new AssetPopupViewWindow(mwindow, this));
mwindow->gui->lock_window("AssetPopup::paste_assets");
mwindow->cwindow->gui->lock_window("AssetPopup::paste_assets");
- gui->collect_assets();
+ int proxy = mwindow->edl->session->awindow_folder == AW_PROXY_FOLDER ? 1 : 0;
+ gui->collect_assets(proxy);
mwindow->paste_assets(mwindow->edl->local_session->get_selectionstart(1),
- mwindow->edl->tracks->first,
- 0); // do not overwrite
+ mwindow->edl->tracks->first, 0); // do not overwrite
+ mwindow->session->clear_drag_proxy();
gui->unlock_window();
mwindow->gui->unlock_window();
int AssetPopup::update()
{
format->update();
- gui->collect_assets();
+ int proxy = mwindow->edl->session->awindow_folder == AW_PROXY_FOLDER ? 1 : 0;
+ gui->collect_assets(proxy);
return 0;
}
}
-AssetPopupSortNames::AssetPopupSortNames(MWindow *mwindow, AssetPopup *popup)
- : BC_MenuItem(_("Sort names"))
-{
- this->mwindow = mwindow;
- this->popup = popup;
-}
-
-AssetPopupSortNames::~AssetPopupSortNames()
-{
-}
-
-int AssetPopupSortNames::handle_event()
-{
- mwindow->awindow->gui->sort_assets(0);
- return 1;
-}
-
-AssetPopupSortTimes::AssetPopupSortTimes(MWindow *mwindow, AssetPopup *popup)
- : BC_MenuItem(_("Sort times"))
+AssetPopupSort::AssetPopupSort(MWindow *mwindow, AssetPopup *popup)
+ : BC_MenuItem(_("Sort"))
{
this->mwindow = mwindow;
this->popup = popup;
}
-AssetPopupSortTimes::~AssetPopupSortTimes()
+AssetPopupSort::~AssetPopupSort()
{
}
-int AssetPopupSortTimes::handle_event()
+int AssetPopupSort::handle_event()
{
- mwindow->awindow->gui->sort_assets(1);
+ mwindow->awindow->gui->sort_assets();
return 1;
}
void AssetListMenu::create_objects()
{
+ add_item(load_file = new AssetPopupLoadFile(mwindow, gui));
add_item(format = new AWindowListFormat(mwindow, gui));
add_item(new AWindowListSort(mwindow, gui));
add_item(new AssetListCopy(mwindow, gui));
update_titles(shots_displayed = 1);
}
+AssetPopupLoadFile::AssetPopupLoadFile(MWindow *mwindow, AWindowGUI *gui)
+ : BC_MenuItem(_("Load files..."), "o", 'o')
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+}
+
+AssetPopupLoadFile::~AssetPopupLoadFile()
+{
+}
+
+int AssetPopupLoadFile::handle_event()
+{
+ mwindow->gui->mainmenu->load_file->thread->start();
+ return 1;
+}
+
void AssetListMenu::update_titles(int shots)
{
format->update();
void AssetCopyWindow::create_objects()
{
+ lock_window("AssetCopyWindow::create_objects");
BC_Title *title;
int x = 10, y = 10, pad = 5;
add_subwindow(title = new BC_Title(x, y, _("List of asset paths:")));
add_subwindow(new BC_OKButton(this));
show_window();
+ unlock_window();
}
int AssetCopyWindow::resize_event(int w, int h)
void AssetPasteWindow::create_objects()
{
+ lock_window("AssetPasteWindow::create_objects()");
BC_Title *title;
int x = 10, y = 10, pad = 5;
add_subwindow(title = new BC_Title(x, y, _("Enter list of asset paths:")));
add_subwindow(new BC_OKButton(this));
add_subwindow(new BC_CancelButton(this));
show_window();
+ unlock_window();
}
int AssetPasteWindow::resize_event(int w, int h)
preferences->snapshot_path, _("snap"),
1900+tm.tm_year,1+tm.tm_mon,tm.tm_mday,
tm.tm_hour,tm.tm_min,tm.tm_sec, exts[mode]);
+ char *asset_path = FileSystem::basepath(filename);
+ Asset *asset = new Asset(asset_path);
+ delete [] asset_path;
+
int fw = edl->get_w(), fh = edl->get_h();
int fcolor_model = edl->session->color_model;
- Asset *asset = new Asset(filename);
switch( mode ) {
case SNAPSHOT_PNG:
asset->format = FILE_PNG;
preferences->snapshot_path, _("grab"),
1900+tm.tm_year,1+tm.tm_mon,tm.tm_mday,
tm.tm_hour,tm.tm_min,tm.tm_sec, exts[mode]);
-
- Asset *asset = new Asset(filename);
+ char *asset_path = FileSystem::basepath(filename);
+ Asset *asset = new Asset(asset_path);
+ delete [] asset_path;
switch( mode ) {
case GRABSHOT_PNG:
asset->format = FILE_PNG;