2 #include "awindowgui.h"
3 #include "awindowmenu.h"
5 #include "edlsession.h"
9 #define _(String) gettext(String)
10 #define gettext_noop(String) String
11 #define N_(String) gettext_noop (String)
16 AssetListMenu::AssetListMenu(MWindow *mwindow, AWindowGUI *gui)
23 this->mwindow = mwindow;
27 AssetListMenu::~AssetListMenu()
31 void AssetListMenu::create_objects()
33 add_item(format = new AssetListFormat(mwindow));
34 add_item(new AssetListSort(mwindow));
38 void AssetListMenu::update_titles()
50 AssetListFormat::AssetListFormat(MWindow *mwindow)
53 this->mwindow = mwindow;
56 void AssetListFormat::update()
58 set_text(mwindow->edl->session->assetlist_format == ASSETS_TEXT ?
59 (char*)_("Display icons") : (char*)_("Display text"));
62 int AssetListFormat::handle_event()
64 switch(mwindow->edl->session->assetlist_format)
67 mwindow->edl->session->assetlist_format = ASSETS_ICONS;
70 mwindow->edl->session->assetlist_format = ASSETS_TEXT;
74 mwindow->awindow->gui->asset_list->update_format(
75 mwindow->edl->session->assetlist_format,
84 AssetListSort::AssetListSort(MWindow *mwindow)
85 : BC_MenuItem(_("Sort items"))
87 this->mwindow = mwindow;
90 int AssetListSort::handle_event()
92 mwindow->awindow->gui->sort_assets();
99 FolderListMenu::FolderListMenu(MWindow *mwindow, AWindowGUI *gui)
106 this->mwindow = mwindow;
110 FolderListMenu::~FolderListMenu()
114 void FolderListMenu::create_objects()
116 add_item(format = new FolderListFormat(mwindow, this));
122 void FolderListMenu::update_titles()
124 format->set_text(mwindow->edl->session->folderlist_format == FOLDERS_TEXT ?
125 (char*)_("Display icons") : (char*)_("Display text"));
134 FolderListFormat::FolderListFormat(MWindow *mwindow, FolderListMenu *menu)
137 this->mwindow = mwindow;
140 int FolderListFormat::handle_event()
142 switch(mwindow->edl->session->folderlist_format)
145 mwindow->edl->session->folderlist_format = ASSETS_ICONS;
148 mwindow->edl->session->folderlist_format = ASSETS_TEXT;
152 mwindow->awindow->gui->folder_list->update_format(mwindow->edl->session->folderlist_format, 1);
153 menu->update_titles();