Skip to content
Newer
Older
100644 86 lines (75 sloc) 3.12 KB
62fd704 initial 0.9 upload
Bart vd Ende authored Jan 26, 2012
1 /*
2 * Copyright (C) 2005-2008 Team XBMC
3 * http://www.xbmc.org
4 *
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)
8 * any later version.
9 *
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.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, write to
17 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 * http://www.gnu.org/copyleft/gpl.html
19 *
20 */
21
22 #include "GUIViewStatePrograms.h"
23 #include "GUIBaseContainer.h"
24 #include "FileItem.h"
25 #include "ViewState.h"
26 #include "GUISettings.h"
27 #include "Settings.h"
28 #include "FileSystem/Directory.h"
29 #include "FileSystem/PluginDirectory.h"
30 #include "Util.h"
31 #include "LocalizeStrings.h"
32 #include "Key.h"
33
34 using namespace DIRECTORY;
35
36 CGUIViewStateWindowPrograms::CGUIViewStateWindowPrograms(const CFileItemList& items) : CGUIViewState(items)
37 {
38 if (g_guiSettings.GetBool("filelists.ignorethewhensorting"))
39 AddSortMethod(SORT_METHOD_LABEL_IGNORE_THE, 551, LABEL_MASKS("%K", "%I", "%L", "")); // Titel, Size | Foldername, empty
40 else
41 AddSortMethod(SORT_METHOD_LABEL, 551, LABEL_MASKS("%K", "%I", "%L", "")); // Titel, Size | Foldername, empty
42 AddSortMethod(SORT_METHOD_DATE, 552, LABEL_MASKS("%K", "%J", "%L", "%J")); // Titel, Date | Foldername, Date
43 AddSortMethod(SORT_METHOD_PROGRAM_COUNT, 565, LABEL_MASKS("%K", "%C", "%L", "")); // Titel, Count | Foldername, empty
44 AddSortMethod(SORT_METHOD_SIZE, 553, LABEL_MASKS("%K", "%I", "%K", "%I")); // Filename, Size | Foldername, Size
45 AddSortMethod(SORT_METHOD_FILE, 561, LABEL_MASKS("%L", "%I", "%L", "")); // Filename, Size | FolderName, empty
46
47 SetSortMethod(g_stSettings.m_viewStatePrograms.m_sortMethod);
48 SetViewAsControl(g_stSettings.m_viewStatePrograms.m_viewMode);
49 SetSortOrder(g_stSettings.m_viewStatePrograms.m_sortOrder);
50
51 LoadViewState(items.m_strPath, WINDOW_PROGRAMS);
52 }
53
54 void CGUIViewStateWindowPrograms::SaveViewState()
55 {
8326ead initial 1.5 upload
Bart vd Ende authored Jan 26, 2012
56 SaveViewToDb(m_items.m_strPath, WINDOW_PROGRAMS, &g_stSettings.m_viewStatePrograms);
57 }
62fd704 initial 0.9 upload
Bart vd Ende authored Jan 26, 2012
58
59 CStdString CGUIViewStateWindowPrograms::GetLockType()
60 {
61 return "programs";
62 }
63
64 CStdString CGUIViewStateWindowPrograms::GetExtensions()
65 {
66 return ".xbe|.cut";
67 }
68
69 VECSOURCES& CGUIViewStateWindowPrograms::GetSources()
70 {
71 bool bIsSourceName = true;
72 // plugins share
73 if (CPluginDirectory::HasPlugins("programs"))
74 {
75 CMediaSource share;
76 share.strName = g_localizeStrings.Get(1043); // Program Plugins
77 share.strPath = "plugin://programs/";
78 share.m_strThumbnailImage = CUtil::GetDefaultFolderThumb("DefaultProgramPlugins.png");
79 share.m_ignore= true;
80 if (CUtil::GetMatchingSource(share.strName, g_settings.m_programSources, bIsSourceName) < 0)
81 g_settings.m_programSources.push_back(share);
82 }
83 return g_settings.m_programSources;
84 }
85
Something went wrong with that request. Please try again.