4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "awindowgui.h"
24 #include "awindowmenu.h"
26 #include "edlsession.h"
34 AssetListMenu::AssetListMenu(MWindow *mwindow, AWindowGUI *gui)
41 this->mwindow = mwindow;
45 AssetListMenu::~AssetListMenu()
49 void AssetListMenu::create_objects()
51 add_item(format = new AssetListFormat(mwindow));
52 add_item(new AssetListSort(mwindow));
56 void AssetListMenu::update_titles()
68 AssetListFormat::AssetListFormat(MWindow *mwindow)
71 this->mwindow = mwindow;
74 void AssetListFormat::update()
76 set_text(mwindow->edl->session->assetlist_format == ASSETS_TEXT ?
77 (char*)_("Display icons") : (char*)_("Display text"));
80 int AssetListFormat::handle_event()
82 AWindowGUI *agui = mwindow->awindow->gui;
83 agui->stop_vicon_drawing();
85 EDLSession *session = mwindow->edl->session;
86 switch(session->assetlist_format) {
88 session->assetlist_format = ASSETS_ICONS;
91 session->assetlist_format = ASSETS_TEXT;
95 agui->asset_list->update_format(session->assetlist_format, 1);
96 if (!mwindow->awindow->gui->allow_iconlisting) {
97 mwindow->edl->session->assetlist_format = ASSETS_TEXT;
100 agui->start_vicon_drawing();
107 AssetListSort::AssetListSort(MWindow *mwindow)
108 : BC_MenuItem(_("Sort items"))
110 this->mwindow = mwindow;
113 int AssetListSort::handle_event()
115 mwindow->awindow->gui->sort_assets();
122 FolderListMenu::FolderListMenu(MWindow *mwindow, AWindowGUI *gui)
129 this->mwindow = mwindow;
133 FolderListMenu::~FolderListMenu()
137 void FolderListMenu::create_objects()
139 add_item(format = new FolderListFormat(mwindow, this));
145 void FolderListMenu::update_titles()
147 format->set_text(mwindow->edl->session->folderlist_format == FOLDERS_TEXT ?
148 (char*)_("Display icons") : (char*)_("Display text"));
157 FolderListFormat::FolderListFormat(MWindow *mwindow, FolderListMenu *menu)
160 this->mwindow = mwindow;
163 int FolderListFormat::handle_event()
165 switch(mwindow->edl->session->folderlist_format)
168 mwindow->edl->session->folderlist_format = FOLDERS_ICONS;
171 mwindow->edl->session->folderlist_format = FOLDERS_TEXT;
175 mwindow->awindow->gui->folder_list->update_format(
176 mwindow->edl->session->folderlist_format, 1);
177 menu->update_titles();