From a3127d64f6fc6c4f14f298e6e9bc6c62b67cff91 Mon Sep 17 00:00:00 2001 From: David Andrew St John Date: Mon, 11 Aug 2025 16:49:31 -0700 Subject: [PATCH] Remove MySQL configuration --- CastItDlg.cpp | 35 +++++------------------- Castit.ini | 7 +---- ConfigurationDialog.cpp | 60 +++++++---------------------------------- ConfigurationDialog.h | 13 +-------- 4 files changed, 17 insertions(+), 98 deletions(-) diff --git a/CastItDlg.cpp b/CastItDlg.cpp index 8b39896..09dc930 100644 --- a/CastItDlg.cpp +++ b/CastItDlg.cpp @@ -545,22 +545,13 @@ void CCastItDlg::config_read() m_colBW2Width = GetPrivateProfileInt(gAppName, "colBW2Width", 125, gConfigFile); m_colBW3Width = GetPrivateProfileInt(gAppName, "colBW3Width", 125, gConfigFile); - GetPrivateProfileString(gAppName, "dbUsername", "", buf, sizeof(buf), gConfigFile); - configDialog.m_Username = buf; - GetPrivateProfileString(gAppName, "dbPassword", "", buf, sizeof(buf), gConfigFile); - configDialog.m_Password = buf; - GetPrivateProfileString(gAppName, "dbDatabase", "", buf, sizeof(buf), gConfigFile); - configDialog.m_Database = buf; - GetPrivateProfileString(gAppName, "dbHostname", "", buf, sizeof(buf), gConfigFile); - configDialog.m_Hostname = buf; - GetPrivateProfileString(gAppName, "dbTableprefix", "", buf, sizeof(buf), gConfigFile); - configDialog.m_TablePrefix = buf; - configDialog.m_DBEnabled = GetPrivateProfileInt(gAppName, "dbEnabledFlag", 1, gConfigFile); - configDialog.m_PollInterval = GetPrivateProfileInt(gAppName, "pollInterval", 120, gConfigFile); - + configDialog.m_Aggregate = GetPrivateProfileInt(gAppName, "Aggregate", 0, gConfigFile); configDialog.m_DeleteSongHistoryInterval = GetPrivateProfileInt(gAppName, "DeleteSongHistoryInterval", 0, gConfigFile); + + GetPrivateProfileString(gAppName, "storageFile", "", buf, sizeof(buf), gConfigFile); + configDialog.m_StorageFile = buf; //iterate through server list and read ini data int serverCount = GetPrivateProfileInt(gAppName, "serverCount", 0, gConfigFile); @@ -705,13 +696,7 @@ void CCastItDlg::config_write() // WritePrivateProfileString(gAppName, "CC_Password", configDialog.m_CC_Password, gConfigFile); - WritePrivateProfileString(gAppName, "dbUsername", configDialog.m_Username, gConfigFile); - WritePrivateProfileString(gAppName, "dbPassword", configDialog.m_Password, gConfigFile); - WritePrivateProfileString(gAppName, "dbDatabase", configDialog.m_Database, gConfigFile); - WritePrivateProfileString(gAppName, "dbHostname", configDialog.m_Hostname, gConfigFile); - WritePrivateProfileString(gAppName, "dbTableprefix", configDialog.m_TablePrefix, gConfigFile); - SAFE_SPRINTF(buf, "%d", configDialog.m_DBEnabled); - WritePrivateProfileString(gAppName, "dbEnabledFlag", buf, gConfigFile); + WritePrivateProfileString(gAppName, "storageFile", configDialog.m_StorageFile, gConfigFile); SAFE_SPRINTF(buf, "%d", configDialog.m_PollInterval); WritePrivateProfileString(gAppName, "pollInterval", buf, gConfigFile); @@ -1417,8 +1402,6 @@ void CCastItDlg::getServerData() if (configDialog.m_GenerateTemplate) { SubstituteTagsInTemplate(&sData, i); } - if (configDialog.m_DBEnabled) { - } } /* if (configDialog.m_UpdateCC) { CString serverType = ""; @@ -1917,13 +1900,7 @@ void CCastItDlg::OnCciniBackup() WritePrivateProfileString(gAppName, "col7Width", buf, gBackupConfig); - WritePrivateProfileString(gAppName, "dbUsername", configDialog.m_Username, gBackupConfig); - WritePrivateProfileString(gAppName, "dbPassword", configDialog.m_Password, gBackupConfig); - WritePrivateProfileString(gAppName, "dbDatabase", configDialog.m_Database, gBackupConfig); - WritePrivateProfileString(gAppName, "dbHostname", configDialog.m_Hostname, gBackupConfig); - WritePrivateProfileString(gAppName, "dbTableprefix", configDialog.m_TablePrefix, gBackupConfig); - SAFE_SPRINTF(buf, "%d", configDialog.m_DBEnabled); - WritePrivateProfileString(gAppName, "dbEnabledFlag", buf, gBackupConfig); + WritePrivateProfileString(gAppName, "storageFile", configDialog.m_StorageFile, gBackupConfig); SAFE_SPRINTF(buf, "%d", configDialog.m_PollInterval); WritePrivateProfileString(gAppName, "pollInterval", buf, gBackupConfig); diff --git a/Castit.ini b/Castit.ini index 35db5b7..d8b0987 100644 --- a/Castit.ini +++ b/Castit.ini @@ -7,16 +7,11 @@ col4Width=322 col5Width=322 col6Width=322 col7Width=322 -dbUsername=YOUR_DB_USERNAME -dbPassword=YOUR_DB_PASSWORD -dbDatabase= -dbHostname=YOUR_DB_HOST -dbTableprefix= -dbEnabledFlag=0 pollInterval=10 Aggregate=0 DeleteSongHistoryInterval=0 serverCount=10 +storageFile= templateIn=example_templateIn.html templateOut=D:\PROJECTS\CastIt_9.0\Release\example_templateOut.html generateTemplate=1 diff --git a/ConfigurationDialog.cpp b/ConfigurationDialog.cpp index 0de8a8a..5b5fe41 100644 --- a/ConfigurationDialog.cpp +++ b/ConfigurationDialog.cpp @@ -24,15 +24,10 @@ CConfigurationDialog::CConfigurationDialog(CWnd* pParent /*=NULL*/) : CDialog(CConfigurationDialog::IDD, pParent) { //{{AFX_DATA_INIT(CConfigurationDialog) - m_Database = _T(""); - m_Hostname = _T(""); - m_Password = _T(""); - m_TablePrefix = _T(""); - m_Username = _T(""); - m_DBEnabled = FALSE; - m_Aggregate = 0; - m_DeleteSongHistoryInterval = 0; - m_PollInterval = 0; + m_StorageFile = _T(""); + m_Aggregate = 0; + m_DeleteSongHistoryInterval = 0; + m_PollInterval = 0; m_URL = _T(""); m_CallURL = FALSE; m_TemplateIn = _T(""); @@ -50,20 +45,9 @@ void CConfigurationDialog::DoDataExchange(CDataExchange* pDX) //{{AFX_DATA_MAP(CConfigurationDialog) DDX_Control(pDX, IDC_DELETE_SONGHISTORY_INTERVAL, m_DeleteSongCtl); DDX_Control(pDX, IDC_AGGREGATE, m_AggregateCtl); - DDX_Control(pDX, IDC_MY_USERNAME, m_UsernameCtl); - DDX_Control(pDX, IDC_MY_TABLEPREFIX, m_TablePrefixCtl); - DDX_Control(pDX, IDC_MY_PASSWORD, m_PasswordCtl); - DDX_Control(pDX, IDC_MY_HOSTNAME, m_HostnameCtl); - DDX_Control(pDX, IDC_MY_DATABASE, m_DatabaseCtl); - DDX_Text(pDX, IDC_MY_DATABASE, m_Database); - DDX_Text(pDX, IDC_MY_HOSTNAME, m_Hostname); - DDX_Text(pDX, IDC_MY_PASSWORD, m_Password); - DDX_Text(pDX, IDC_MY_TABLEPREFIX, m_TablePrefix); - DDX_Text(pDX, IDC_MY_USERNAME, m_Username); - DDX_Check(pDX, IDC_database_FLAG, m_DBEnabled); - DDX_Text(pDX, IDC_AGGREGATE, m_Aggregate); - DDX_Text(pDX, IDC_DELETE_SONGHISTORY_INTERVAL, m_DeleteSongHistoryInterval); - DDX_Text(pDX, IDC_POLLINTERVAL, m_PollInterval); + DDX_Text(pDX, IDC_AGGREGATE, m_Aggregate); + DDX_Text(pDX, IDC_DELETE_SONGHISTORY_INTERVAL, m_DeleteSongHistoryInterval); + DDX_Text(pDX, IDC_POLLINTERVAL, m_PollInterval); DDX_Text(pDX, IDC_URL, m_URL); DDX_Check(pDX, IDC_CALLURL, m_CallURL); DDX_Text(pDX, IDC_TEMPLATEIN, m_TemplateIn); @@ -81,7 +65,6 @@ void CConfigurationDialog::DoDataExchange(CDataExchange* pDX) BEGIN_MESSAGE_MAP(CConfigurationDialog, CDialog) //{{AFX_MSG_MAP(CConfigurationDialog) - ON_BN_CLICKED(IDC_database_FLAG, OnDatabaseFlag) ON_WM_CLOSE() ON_BN_CLICKED(IDC_BROWSE1, OnBrowse1) ON_BN_CLICKED(IDC_BROWSE2, OnBrowse2) @@ -102,30 +85,6 @@ END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CConfigurationDialog message handlers -void CConfigurationDialog::OnDatabaseFlag() -{ - // TODO: Add your control notification handler code here - UpdateData(TRUE); - if (m_DBEnabled) { - m_UsernameCtl.EnableWindow(TRUE); - m_PasswordCtl.EnableWindow(TRUE); - m_HostnameCtl.EnableWindow(TRUE); - m_DatabaseCtl.EnableWindow(TRUE); - m_DeleteSongCtl.EnableWindow(TRUE); - m_AggregateCtl.EnableWindow(TRUE); - m_TablePrefixCtl.EnableWindow(TRUE); - } - else { - m_UsernameCtl.EnableWindow(FALSE); - m_PasswordCtl.EnableWindow(FALSE); - m_HostnameCtl.EnableWindow(FALSE); - m_DatabaseCtl.EnableWindow(FALSE); - m_DeleteSongCtl.EnableWindow(FALSE); - m_AggregateCtl.EnableWindow(FALSE); - m_TablePrefixCtl.EnableWindow(FALSE); - } -} - BOOL CConfigurationDialog::OnInitDialog() @@ -160,9 +119,8 @@ BOOL CConfigurationDialog::OnInitDialog() // TODO: Add extra initialization here - OnDatabaseFlag(); - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE } diff --git a/ConfigurationDialog.h b/ConfigurationDialog.h index d89a231..d3ea212 100644 --- a/ConfigurationDialog.h +++ b/ConfigurationDialog.h @@ -34,17 +34,7 @@ class CConfigurationDialog : public CDialog enum { IDD = IDD_CONFIG_DIALOG }; CEdit m_DeleteSongCtl; CEdit m_AggregateCtl; - CEdit m_UsernameCtl; - CEdit m_TablePrefixCtl; - CEdit m_PasswordCtl; - CEdit m_HostnameCtl; - CEdit m_DatabaseCtl; - CString m_Database; - CString m_Hostname; - CString m_Password; - CString m_TablePrefix; - CString m_Username; - BOOL m_DBEnabled; + CString m_StorageFile; int m_Aggregate; int m_DeleteSongHistoryInterval; int m_PollInterval; @@ -71,7 +61,6 @@ class CConfigurationDialog : public CDialog // Generated message map functions //{{AFX_MSG(CConfigurationDialog) - afx_msg void OnDatabaseFlag(); afx_msg void OnClose(); virtual BOOL OnInitDialog(); afx_msg void OnBrowse1();