Changeset abe53d3 for win32/admin/PropAccess.cpp
- Timestamp:
- 2005-11-07T16:42:49Z (18 years ago)
- Branches:
- master
- Children:
- f56c491
- Parents:
- 99318ad
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
win32/admin/PropAccess.cpp
r99318ad rabe53d3 2 2 // 3 3 4 #define BITLBEE_CORE5 #include "bitlbeewin.h"6 4 #include "PropAccess.h" 7 5 … … 53 51 { 54 52 CString iface; m_interface.GetWindowText(iface); 53 WriteProfileString("interface", iface); 54 55 55 CString port; m_port.GetWindowText(port); 56 WriteProfileInt("port", port); 56 57 57 58 CString password; m_password.GetWindowText(password); 58 g_free((void *)global.conf->password); 59 global.conf->password = g_strdup(password); 60 61 if(m_auth_closed.GetCheck() == 1) global.conf->authmode = AUTHMODE_CLOSED; 62 if(m_auth_open.GetCheck() == 1) global.conf->authmode = AUTHMODE_OPEN; 63 if(m_auth_registered.GetCheck() == 1) global.conf->authmode = AUTHMODE_REGISTERED; 64 65 if(strcmp(iface, global.conf->iface) || atol(port) != global.conf->port) { 66 global.conf->port = atoi(port); 67 g_free((void *)global.conf->iface); 68 global.conf->iface = g_strdup(iface); 69 closesocket(global.listen_socket); 70 bitlbee_daemon_init(); 71 } 72 59 WriteProfileString("password", password); 60 61 if(m_auth_closed.GetCheck() == 1) WriteProfileInt("auth_mode", 1); 62 if(m_auth_open.GetCheck() == 1) WriteProfileInt("auth_mode", 0); 63 if(m_auth_registered.GetCheck() == 1) WriteProfileInt("auth_mode", 2); 73 64 74 65 CPropertyPage::OnOK(); … … 105 96 CPropertyPage::OnInitDialog(); 106 97 107 m_interface.SetWindowText(global.conf->iface); 108 m_password.SetWindowText(global.conf->password); 98 HKEY key; 99 RegOpenKey(HKEY_LOCAL_MACHINE, BITLBEE_KEY, &key); 100 101 m_interface.SetWindowText(GetProfileString("interface", "0.0.0.0")); 102 m_password.SetWindowText(GetProfileString("password", "")); 109 103 char tmp[20]; 110 g_snprintf(tmp, sizeof(tmp), "%d", global.conf->port);104 sprintf(tmp, "%d", GetProfileInt("port", 6667)); 111 105 m_port.SetWindowText(tmp); 112 m_auth_open.SetCheck(0);113 m_auth_closed.SetCheck(0);114 m_auth_registered.SetCheck(0);115 106 116 switch( global.conf->authmode) {117 case AUTHMODE_OPEN: m_auth_open.SetCheck(1); m_password.EnableWindow(FALSE);break;118 case AUTHMODE_CLOSED: m_auth_closed.SetCheck(1); m_password.EnableWindow(TRUE);break;119 case AUTHMODE_REGISTERED: m_auth_registered.SetCheck(1);m_password.EnableWindow(FALSE);break;107 switch(GetProfileInt("auth_mode", 1)) { 108 case 0: OnAuthOpen();break; 109 case 1: OnAuthClosed();break; 110 case 2: OnAuthRegistered();break; 120 111 } 121 112
Note: See TracChangeset
for help on using the changeset viewer.