BOOL CTDLTaskIconDlg::OnInitDialog() { CDialog::OnInitDialog(); ListView_SetImageList(m_lcIcons, m_ilIcons, LVSIL_SMALL); CPreferences prefs; for (int nImage = 0; nImage < m_ilIcons.GetImageCount(); nImage++) { CString sImage, sKey; sKey.Format(_T("Icon%d"), nImage + 1); sImage = prefs.GetProfileString(_T("TaskIcons"), sKey); if (sImage.IsEmpty()) { sImage.Format(_T("%d"), nImage + 1); } m_lcIcons.InsertItem(nImage, sImage, nImage); } if (m_nIconIndex >= 0) { m_lcIcons.SetItemState(m_nIconIndex, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED); } // disable OK button if nothing selected GetDlgItem(IDOK)->EnableWindow(m_nIconIndex >= 0); m_lcIcons.SetFocus(); return FALSE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void CPreferencesExportPage::LoadPreferences(const CPreferences& prefs) { m_sHtmlFont = prefs.GetProfileString(_T("Preferences"), _T("HtmlFont"), _T("Verdana")); m_bPreviewExport = prefs.GetProfileInt(_T("Preferences"), _T("PreviewSaveAs"), TRUE); m_nHtmlFontSize = prefs.GetProfileInt(_T("Preferences"), _T("HtmlFontSize"), 2); m_nTextIndent = prefs.GetProfileInt(_T("Preferences"), _T("TextIndent"), 2); m_nLineSpaces = prefs.GetProfileInt(_T("Preferences"), _T("LineSpaces"), 8); m_bExportVisibleOnly = prefs.GetProfileInt(_T("Preferences"), _T("ExportVisibleOnly"), FALSE); m_bExportParentTitleCommentsOnly = prefs.GetProfileInt(_T("Preferences"), _T("ExportParentTitleCommentsOnly"), FALSE); m_bExportSpaceForNotes = prefs.GetProfileInt(_T("Preferences"), _T("ExportSpaceForNotes"), FALSE); m_bUseSpaceIndents = prefs.GetProfileInt(_T("Preferences"), _T("UseSpaceIndents"), TRUE); CString sDefCharset = "Windows-" + Misc::GetDefCharset(); m_sHtmlCharSet = prefs.GetProfileString(_T("Preferences"), _T("HtmlCharSet"), sDefCharset); // m_b = prefs.GetProfileInt(_T("Preferences"), _T(""), FALSE); }
void CPreferencesToolPage::LoadPreferences(const CPreferences& prefs) { // load tools int nToolCount = prefs.GetProfileInt(_T("Tools"), _T("ToolCount"), 0); for (int nTool = 1; nTool <= nToolCount; nTool++) { CString sKey = Misc::MakeKey(_T("Tools\\Tool%d"), nTool); USERTOOL ut; ut.sToolName = prefs.GetProfileString(sKey, _T("Name"), _T("")); ut.sToolPath = prefs.GetProfileString(sKey, _T("Path"), _T("")); ut.sCmdline = prefs.GetProfileString(sKey, _T("CmdLine"), _T("")); ut.bRunMinimized = prefs.GetProfileInt(sKey, _T("RunMinimized"), FALSE); ut.sIconPath = prefs.GetProfileString(sKey, _T("IconPath"), _T("")); // replace safe quotes with real quotes ut.sCmdline.Replace(SAFEQUOTE, REALQUOTE); m_aTools.Add(ut); } }
CTDLImportDialog::CTDLImportDialog(const CImportExportMgr& mgr, CWnd* pParent /*=NULL*/) : CDialog(CTDLImportDialog::IDD, pParent), m_mgrImportExport(mgr), m_sizeMin(0, 0) { //{{AFX_DATA_INIT(CTDLImportDialog) //}}AFX_DATA_INIT CPreferences prefs; m_bFromClipboard = prefs.GetProfileInt(_T("Importing"), _T("ImportOption"), FALSE); m_sFromFilePath = prefs.GetProfileString(_T("Importing"), _T("ImportFilePath")); m_nImportTo = prefs.GetProfileInt(_T("Importing"), _T("ImportToWhere"), TDIT_SELECTEDTASK); m_nFormatOption = prefs.GetProfileInt(_T("Importing"), _T("ImportFormat"), 0); m_nFormatOption = min(m_nFormatOption, mgr.GetNumImporters()); }
CTDLTransformDialog::CTDLTransformDialog(LPCTSTR szTitle, FTC_VIEW nView, CWnd* pParent /*=NULL*/) : CDialog(IDD_TRANSFORM_DIALOG, pParent), m_taskSel(_T("Transform"), nView), m_sTitle(szTitle), m_eStylesheet(FES_COMBOSTYLEBTN | FES_RELATIVEPATHS, CEnString(IDS_XSLFILEFILTER)) { //{{AFX_DATA_INIT(CTDLTransformDialog) //}}AFX_DATA_INIT // see what we had last time CPreferences prefs; // init the stylesheet folder to point to the resource folder CString sFolder = FileMisc::GetAppResourceFolder() + _T("\\Stylesheets"); m_eStylesheet.SetCurrentFolder(sFolder); m_eStylesheet.SetBrowseTitle(CEnString(IDS_SELECTSTYLESHEET_TITLE)); m_sStylesheet = prefs.GetProfileString(_T("Transform"), _T("Stylesheet")); m_sStylesheet = FileMisc::GetRelativePath(m_sStylesheet, sFolder, FALSE); m_bDate = prefs.GetProfileInt(_T("Transform"), _T("WantDate"), TRUE); // share same title history as print dialog m_cbTitle.Load(&prefs, _T("Print")); }
void CPreferencesUIPage::LoadPreferences(const CPreferences& prefs) { // load settings m_bShowEditMenuAsColumns = prefs.GetProfileInt(_T("Preferences"), _T("ShowEditMenuAsColumns"), FALSE); m_bShowCommentsAlways = prefs.GetProfileInt(_T("Preferences"), _T("ShowCommentsAlways"), FALSE); m_bAutoReposCtrls = prefs.GetProfileInt(_T("Preferences"), _T("AutoReposCtrls"), TRUE); m_bSpecifyToolbarImage = prefs.GetProfileInt(_T("Preferences"), _T("SpecifyToolbarImage"), FALSE); m_bSharedCommentsHeight = prefs.GetProfileInt(_T("Preferences"), _T("SharedCommentsHeight"), TRUE); m_bAutoHideTabbar = prefs.GetProfileInt(_T("Preferences"), _T("AutoHideTabbar"), TRUE); m_bStackTabbarItems = prefs.GetProfileInt(_T("Preferences"), _T("StackTabbarItems"), FALSE); m_bFocusTreeOnEnter = prefs.GetProfileInt(_T("Preferences"), _T("FocusTreeOnEnter"), FALSE); m_nNewTaskPos = (PUIP_NEWTASKPOS)prefs.GetProfileInt(_T("Preferences"), _T("NewTaskPos"), PUIP_BELOW); m_nNewSubtaskPos = (PUIP_NEWTASKPOS)prefs.GetProfileInt(_T("Preferences"), _T("NewSubtaskPos"), PUIP_BOTTOM); m_bKeepTabsOrdered = prefs.GetProfileInt(_T("Preferences"), _T("KeepTabsOrdered"), FALSE); m_bShowTasklistCloseButton = prefs.GetProfileInt(_T("Preferences"), _T("ShowTasklistCloseButton"), TRUE); m_bSortDoneTasksAtBottom = prefs.GetProfileInt(_T("Preferences"), _T("SortDoneTasksAtBottom"), TRUE); m_bRTLComments = prefs.GetProfileInt(_T("Preferences"), _T("RTLComments"), FALSE); m_nCommentsPos = (PUIP_LOCATION)prefs.GetProfileInt(_T("Preferences"), _T("VertComments"), PUIP_LOCATERIGHT); m_nCtrlsPos = (PUIP_LOCATION)prefs.GetProfileInt(_T("Preferences"), _T("VertControls"), PUIP_LOCATEBOTTOM); m_bMultiSelFilters = prefs.GetProfileInt(_T("Preferences"), _T("MultiSelFilters"), TRUE); m_bRestoreTasklistFilters = prefs.GetProfileInt(_T("Preferences"), _T("RestoreTasklistFilters"), TRUE); m_bAutoRefilter = prefs.GetProfileInt(_T("Preferences"), _T("AutoRefilter"), TRUE); m_bAutoResort = prefs.GetProfileInt(_T("Preferences"), _T("AutoResort"), TRUE); m_bUseUITheme = CThemed::IsAppThemed() && prefs.GetProfileInt(_T("Preferences"), _T("UseUITheme"), TRUE); m_sUIThemeFile = prefs.GetProfileString(_T("Preferences"), _T("UIThemeFile"), _T(".\\ThemeBlue.xml")); m_nTitleFilterOption = (PUIP_MATCHTITLE)prefs.GetProfileInt(_T("Preferences"), _T("TitleFilterOption"), PUIP_MATCHONTITLECOMMENTS); m_bShowDefaultTaskIcons = prefs.GetProfileInt(_T("Preferences"), _T("ShowDefaultTaskIcons"), TRUE); m_bShowDefaultFilters = prefs.GetProfileInt(_T("Preferences"), _T("ShowDefaultFilters"), TRUE); m_bEnableColumnHeaderSorting = prefs.GetProfileInt(_T("Preferences"), _T("EnableColumnHeaderSorting"), TRUE); m_bStackEditFieldsAndComments = prefs.GetProfileInt(_T("Preferences"), _T("StackEditFieldsAndComments"), TRUE); // m_b = prefs.GetProfileInt(_T("Preferences"), _T(""), FALSE); // light-boxing not available on linux and disabled by default m_bEnableLightboxMgr = ((COSVersion() == OSV_LINUX) ? FALSE : prefs.GetProfileInt(_T("Preferences"), _T("EnableLightboxMgr"), FALSE)); // set default theme to blue if (CThemed::IsAppThemed()) { CString sResFolder = FileMisc::GetAppResourceFolder() + "\\Themes"; m_eUITheme.SetCurrentFolder(sResFolder); m_sUIThemeFile = FileMisc::GetRelativePath(m_sUIThemeFile, sResFolder, FALSE); } else m_sUIThemeFile.Empty(); // comments format if (m_cbCommentsFmt.IsInitialized()) { m_cfDefault = prefs.GetProfileString(_T("Preferences"), _T("DefaultCommentsFormatID")); m_nDefaultCommentsFormat = m_cbCommentsFmt.SetSelectedFormat(m_cfDefault); // fallback if (m_nDefaultCommentsFormat == CB_ERR) m_nDefaultCommentsFormat = prefs.GetProfileInt(_T("Preferences"), _T("DefaultCommentsFormat"), -1); if (m_nDefaultCommentsFormat == CB_ERR || m_nDefaultCommentsFormat >= m_cbCommentsFmt.GetCount()) { ASSERT (m_cbCommentsFmt.GetCount()); m_nDefaultCommentsFormat = 0; } m_cbCommentsFmt.SetCurSel(m_nDefaultCommentsFormat); m_cbCommentsFmt.GetSelectedFormat(m_cfDefault); } // task view visibility CStringArray aViews; int nView = prefs.GetProfileInt(_T("Preferences\\ViewVisibility"), _T("Count"), -1); if (nView > 0) { while (nView--) { CString sKey = Misc::MakeKey(_T("View%d"), nView); CString sView = prefs.GetProfileString(_T("Preferences\\ViewVisibility"), sKey); ASSERT(!sView.IsEmpty()); aViews.Add(sView); } m_lbTaskViews.SetVisibleViews(aViews); } }
CExportDlg::CExportDlg(const CImportExportMgr& mgr, BOOL bSingleTaskList, BOOL bShowSubtaskCheckbox, BOOL bVisibleColumnsOnly, LPCTSTR szFilePath, LPCTSTR szFolderPath, CWnd* pParent /*=NULL*/): CDialog(IDD_EXPORT_DIALOG, pParent), m_mgrImportExport(mgr), m_bSingleTaskList(bSingleTaskList), m_sFilePath(szFilePath), m_sOrgFilePath(szFilePath), m_sFolderPath(szFolderPath), m_sOrgFolderPath(szFolderPath), m_taskSel(_T("Exporting"), bShowSubtaskCheckbox, bVisibleColumnsOnly), m_eExportPath(FES_COMBOSTYLEBTN | FES_SAVEAS) { CPreferences prefs; //{{AFX_DATA_INIT(CExportDlg) m_sPathLabel = _T(""); //}}AFX_DATA_INIT m_bExportOneFile = FALSE; if (m_bSingleTaskList) { m_nExportOption = ACTIVETASKLIST; } else { m_nExportOption = prefs.GetProfileInt(_T("Exporting"), _T("ExportOption"), ACTIVETASKLIST); } if (m_sFolderPath.IsEmpty()) { m_sFolderPath = prefs.GetProfileString(_T("Exporting"), _T("LastFolder")); } if (m_bSingleTaskList || m_nExportOption == ACTIVETASKLIST || m_bExportOneFile) { m_sExportPath = m_sFilePath; // default if ((m_sFilePath.IsEmpty() || PathIsRelative(m_sFilePath)) && !m_sFolderPath.IsEmpty()) { CString sFName; FileMisc::SplitPath(m_sFilePath, NULL, NULL, &sFName); // handle empty filename if (sFName.IsEmpty()) { sFName.LoadString(IDS_TDC_UNTITLEDFILE); } FileMisc::MakePath(m_sExportPath, NULL, m_sFolderPath, sFName); } ReplaceExtension(m_sExportPath, s_nFormatOption); m_sPathLabel.LoadString(IDS_ED_FILEPATH); } else // multiple files { if (!m_sFolderPath.IsEmpty()) { m_sExportPath = m_sFolderPath; } else if (!m_sFilePath.IsEmpty()) { CString sDrive, sPath; FileMisc::SplitPath(m_sFilePath, &sDrive, &sPath); FileMisc::MakePath(m_sExportPath, sDrive, sPath); } m_sPathLabel.LoadString(IDS_ED_FOLDER); } }