2 * Copyright (C) 2005-2013 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
21 #include "GUIViewStatePrograms.h"
23 #include "view/ViewState.h"
24 #include "settings/GUISettings.h"
25 #include "settings/Settings.h"
26 #include "filesystem/Directory.h"
27 #include "guilib/LocalizeStrings.h"
28 #include "guilib/Key.h"
30 using namespace XFILE;
31 using namespace ADDON;
33 CGUIViewStateWindowPrograms::CGUIViewStateWindowPrograms(const CFileItemList& items) : CGUIViewState(items)
35 if (g_guiSettings.GetBool("filelists.ignorethewhensorting"))
36 AddSortMethod(SORT_METHOD_LABEL_IGNORE_THE, 551, LABEL_MASKS("%K", "%I", "%L", "")); // Titel, Size | Foldername, empty
38 AddSortMethod(SORT_METHOD_LABEL, 551, LABEL_MASKS("%K", "%I", "%L", "")); // Titel, Size | Foldername, empty
40 SetSortMethod(g_settings.m_viewStatePrograms.m_sortMethod);
41 SetViewAsControl(g_settings.m_viewStatePrograms.m_viewMode);
42 SetSortOrder(g_settings.m_viewStatePrograms.m_sortOrder);
44 LoadViewState(items.GetPath(), WINDOW_PROGRAMS);
47 void CGUIViewStateWindowPrograms::SaveViewState()
49 SaveViewToDb(m_items.GetPath(), WINDOW_PROGRAMS, &g_settings.m_viewStatePrograms);
52 CStdString CGUIViewStateWindowPrograms::GetLockType()
57 CStdString CGUIViewStateWindowPrograms::GetExtensions()
62 VECSOURCES& CGUIViewStateWindowPrograms::GetSources()
64 AddAddonsSource("executable", g_localizeStrings.Get(1043), "DefaultAddonProgram.png");
65 #if defined(TARGET_ANDROID)
66 AddAndroidSource("apps", g_localizeStrings.Get(20244), "DefaultProgram.png");
68 AddOrReplace(g_settings.m_programSources,CGUIViewState::GetSources());
69 return g_settings.m_programSources;