void FileList::SavePanelModes() { for (int I=0; I<10; I++) { string strColumnTitles, strColumnWidths; string strStatusColumnTitles, strStatusColumnWidths, strRegKey; strRegKey.Format(L"Panel\\ViewModes\\Mode%d",I); PanelViewSettings NewSettings=ViewSettingsArray[VIEW_0+I]; ViewSettingsToText(NewSettings.ColumnType,NewSettings.ColumnWidth,NewSettings.ColumnWidthType, NewSettings.ColumnCount,FALSE,strColumnTitles,strColumnWidths); ViewSettingsToText(NewSettings.StatusColumnType,NewSettings.StatusColumnWidth,NewSettings.StatusColumnWidthType, NewSettings.StatusColumnCount,TRUE,strStatusColumnTitles,strStatusColumnWidths); SetRegKey(strRegKey,L"Columns",strColumnTitles); SetRegKey(strRegKey,L"ColumnWidths",strColumnWidths); SetRegKey(strRegKey,L"StatusColumns",strStatusColumnTitles); SetRegKey(strRegKey,L"StatusColumnWidths",strStatusColumnWidths); SetRegKey(strRegKey,L"FullScreen",NewSettings.FullScreen); SetRegKey(strRegKey,L"AlignExtensions",NewSettings.AlignExtensions); SetRegKey(strRegKey,L"FolderAlignExtensions",NewSettings.FolderAlignExtensions); SetRegKey(strRegKey,L"FolderUpperCase",NewSettings.FolderUpperCase); SetRegKey(strRegKey,L"FileLowerCase",NewSettings.FileLowerCase); SetRegKey(strRegKey,L"FileUpperToLowerCase",NewSettings.FileUpperToLowerCase); SetRegKey(strRegKey,L"PreloadC0Data",NewSettings.PreloadC0Data); } }
void FileList::SavePanelModes() { if (!ViewSettingsChanged) return; ViewSettingsChanged = false; HierarchicalConfig *PanelModeCfg = Db->CreatePanelModeConfig(); for (int I=0; I<10; I++) { string strColumnTitles, strColumnWidths; string strStatusColumnTitles, strStatusColumnWidths; PanelViewSettings NewSettings=ViewSettingsArray[VIEW_0+I]; ViewSettingsToText(NewSettings.ColumnType,NewSettings.ColumnWidth,NewSettings.ColumnWidthType, NewSettings.ColumnCount,strColumnTitles,strColumnWidths); ViewSettingsToText(NewSettings.StatusColumnType,NewSettings.StatusColumnWidth,NewSettings.StatusColumnWidthType, NewSettings.StatusColumnCount,strStatusColumnTitles,strStatusColumnWidths); unsigned __int64 id = PanelModeCfg->CreateKey(0, FormatString() << I); if (!id) continue; PanelModeCfg->SetValue(id, L"ColumnTitles", strColumnTitles); PanelModeCfg->SetValue(id, L"ColumnWidths", strColumnWidths); PanelModeCfg->SetValue(id, L"StatusColumnTitles", strStatusColumnTitles); PanelModeCfg->SetValue(id, L"StatusColumnWidths", strStatusColumnWidths); PanelModeCfg->SetValue(id, L"Flags", NewSettings.Flags); } delete PanelModeCfg; }
void FileList::SetFilePanelModes() { int CurMode=0; if (CtrlObject->Cp()->ActivePanel->GetType()==FILE_PANEL) { CurMode=CtrlObject->Cp()->ActivePanel->GetViewMode(); CurMode=CurMode?CurMode-1:9; } for(;;) { MenuDataEx ModeListMenu[]= { MSG(MEditPanelModesBrief),0,0, MSG(MEditPanelModesMedium),0,0, MSG(MEditPanelModesFull),0,0, MSG(MEditPanelModesWide),0,0, MSG(MEditPanelModesDetailed),0,0, MSG(MEditPanelModesDiz),0,0, MSG(MEditPanelModesLongDiz),0,0, MSG(MEditPanelModesOwners),0,0, MSG(MEditPanelModesLinks),0,0, MSG(MEditPanelModesAlternative),0,0, }; int ModeNumber; ModeListMenu[CurMode].SetSelect(1); { VMenu ModeList(MSG(MEditPanelModes),ModeListMenu,ARRAYSIZE(ModeListMenu),ScrY-4); ModeList.SetPosition(-1,-1,0,0); ModeList.SetHelp(L"PanelViewModes"); ModeList.SetFlags(VMENU_WRAPMODE); ModeList.Process(); ModeNumber=ModeList.Modal::GetExitCode(); } if (ModeNumber<0) return; CurMode=ModeNumber; enum ModeItems { MD_DOUBLEBOX, MD_TEXTTYPES, MD_EDITTYPES, MD_TEXTWIDTHS, MD_EDITWIDTHS, MD_TEXTSTATUSTYPES, MD_EDITSTATUSTYPES, MD_TEXTSTATUSWIDTHS, MD_EDITSTATUSWIDTHS, MD_SEPARATOR1, MD_CHECKBOX_FULLSCREEN, MD_CHECKBOX_ALIGNFILEEXT, MD_CHECKBOX_ALIGNFOLDEREXT, MD_CHECKBOX_FOLDERUPPERCASE, MD_CHECKBOX_FILESLOWERCASE, MD_CHECKBOX_UPPERTOLOWERCASE, MD_CHECKBOX_PRELOADC0DATA, MD_SEPARATOR2, MD_BUTTON_OK, MD_BUTTON_CANCEL, } ; DialogDataEx ModeDlgData[]= { DI_DOUBLEBOX, 3, 1,72,16,0,0,ModeListMenu[ModeNumber].Name, DI_TEXT, 5, 2, 0, 2,0,0,MSG(MEditPanelModeTypes), DI_EDIT, 5, 3,35, 3,0,DIF_FOCUS,L"", DI_TEXT, 5, 4, 0, 4,0,0,MSG(MEditPanelModeWidths), DI_EDIT, 5, 5,35, 5,0,0,L"", DI_TEXT, 38, 2, 0, 2,0,0,MSG(MEditPanelModeStatusTypes), DI_EDIT, 38, 3,70, 3,0,0,L"", DI_TEXT, 38, 4, 0, 4,0,0,MSG(MEditPanelModeStatusWidths), DI_EDIT, 38, 5,70, 5,0,0,L"", DI_TEXT, 3, 6, 0, 6,0,DIF_SEPARATOR,MSG(MEditPanelReadHelp), DI_CHECKBOX, 5, 7, 0, 7,0,0,MSG(MEditPanelModeFullscreen), DI_CHECKBOX, 5, 8, 0, 8,0,0,MSG(MEditPanelModeAlignExtensions), DI_CHECKBOX, 5, 9, 0, 9,0,0,MSG(MEditPanelModeAlignFolderExtensions), DI_CHECKBOX, 5,10, 0,10,0,0,MSG(MEditPanelModeFoldersUpperCase), DI_CHECKBOX, 5,11, 0,11,0,0,MSG(MEditPanelModeFilesLowerCase), DI_CHECKBOX, 5,12, 0,12,0,0,MSG(MEditPanelModeUpperToLowerCase), DI_CHECKBOX, 5,13, 0,12,0,0,MSG(MEditPanelModePreloadC0Data), DI_TEXT, 3,14, 0,13,0,DIF_SEPARATOR,L"", DI_BUTTON, 0,15, 0,14,0,DIF_DEFAULT|DIF_CENTERGROUP,MSG(MOk), DI_BUTTON, 0,15, 0,14,0,DIF_CENTERGROUP,MSG(MCancel), }; MakeDialogItemsEx(ModeDlgData,ModeDlg); int ExitCode; RemoveHighlights(ModeDlg[MD_DOUBLEBOX].strData); if (ModeNumber==9) ModeNumber=0; else ModeNumber++; PanelViewSettings NewSettings=ViewSettingsArray[ModeNumber]; ModeDlg[MD_CHECKBOX_FULLSCREEN].Selected=NewSettings.FullScreen; ModeDlg[MD_CHECKBOX_ALIGNFILEEXT].Selected=NewSettings.AlignExtensions; ModeDlg[MD_CHECKBOX_ALIGNFOLDEREXT].Selected=NewSettings.FolderAlignExtensions; ModeDlg[MD_CHECKBOX_FOLDERUPPERCASE].Selected=NewSettings.FolderUpperCase; ModeDlg[MD_CHECKBOX_FILESLOWERCASE].Selected=NewSettings.FileLowerCase; ModeDlg[MD_CHECKBOX_UPPERTOLOWERCASE].Selected=NewSettings.FileUpperToLowerCase; ModeDlg[MD_CHECKBOX_PRELOADC0DATA].Selected=NewSettings.PreloadC0Data; ViewSettingsToText(NewSettings.ColumnType,NewSettings.ColumnWidth,NewSettings.ColumnWidthType, NewSettings.ColumnCount,FALSE,ModeDlg[2].strData,ModeDlg[4].strData); ViewSettingsToText(NewSettings.StatusColumnType,NewSettings.StatusColumnWidth,NewSettings.StatusColumnWidthType, NewSettings.StatusColumnCount,TRUE,ModeDlg[6].strData,ModeDlg[8].strData); { Dialog Dlg(ModeDlg,ARRAYSIZE(ModeDlg)); Dlg.SetPosition(-1,-1,76,18); Dlg.SetHelp(L"PanelViewModes"); Dlg.Process(); ExitCode=Dlg.GetExitCode(); } if (ExitCode!=MD_BUTTON_OK) continue; memset(&NewSettings,0,sizeof(NewSettings)); NewSettings.FullScreen=ModeDlg[MD_CHECKBOX_FULLSCREEN].Selected; NewSettings.AlignExtensions=ModeDlg[MD_CHECKBOX_ALIGNFILEEXT].Selected; NewSettings.FolderAlignExtensions=ModeDlg[MD_CHECKBOX_ALIGNFOLDEREXT].Selected; NewSettings.FolderUpperCase=ModeDlg[MD_CHECKBOX_FOLDERUPPERCASE].Selected; NewSettings.FileLowerCase=ModeDlg[MD_CHECKBOX_FILESLOWERCASE].Selected; NewSettings.FileUpperToLowerCase=ModeDlg[MD_CHECKBOX_UPPERTOLOWERCASE].Selected; NewSettings.PreloadC0Data=ModeDlg[MD_CHECKBOX_PRELOADC0DATA].Selected; TextToViewSettings(ModeDlg[MD_EDITTYPES].strData,ModeDlg[MD_EDITWIDTHS].strData,FALSE, NewSettings.ColumnType,NewSettings.ColumnWidth,NewSettings.ColumnWidthType,NewSettings.ColumnCount); TextToViewSettings(ModeDlg[MD_EDITSTATUSTYPES].strData,ModeDlg[MD_EDITSTATUSWIDTHS].strData,TRUE, NewSettings.StatusColumnType,NewSettings.StatusColumnWidth,NewSettings.StatusColumnWidthType,NewSettings.StatusColumnCount); ViewSettingsArray[ModeNumber]=NewSettings; CtrlObject->Cp()->LeftPanel->SortFileList(TRUE); CtrlObject->Cp()->RightPanel->SortFileList(TRUE); CtrlObject->Cp()->SetScreenPosition(); int LeftMode=CtrlObject->Cp()->LeftPanel->GetViewMode(); int RightMode=CtrlObject->Cp()->RightPanel->GetViewMode(); // CtrlObject->Cp()->LeftPanel->SetViewMode(ModeNumber); // CtrlObject->Cp()->RightPanel->SetViewMode(ModeNumber); CtrlObject->Cp()->LeftPanel->SetViewMode(LeftMode); CtrlObject->Cp()->RightPanel->SetViewMode(RightMode); CtrlObject->Cp()->LeftPanel->Redraw(); CtrlObject->Cp()->RightPanel->Redraw(); } }
void FileList::PluginGetColumnTypesAndWidths(string& strColumnTypes,string& strColumnWidths) { ViewSettingsToText(ViewSettings.ColumnType,ViewSettings.ColumnWidth,ViewSettings.ColumnWidthType, ViewSettings.ColumnCount,false,strColumnTypes,strColumnWidths); }