Changeset abe53d3 for win32/admin
- Timestamp:
- 2005-11-07T16:42:49Z (19 years ago)
- Branches:
- master
- Children:
- f56c491
- Parents:
- 99318ad
- Location:
- win32/admin
- Files:
-
- 4 added
- 15 moved
Legend:
- Unmodified
- Added
- Removed
-
win32/admin/MainDlg.cpp
r99318ad rabe53d3 2 2 // 3 3 4 #define BITLBEE_CORE5 #include "bitlbeewin.h"6 #include "PropUsers.h"7 4 #include "PropPaths.h" 8 5 #include "PropAccess.h" 9 #include "PropLog.h"10 6 #include "PropConn.h" 11 7 #include "MainDlg.h" … … 26 22 AddPage(new CPropPaths()); 27 23 AddPage(new CPropAccess()); 28 AddPage(new CPropUsers());29 AddPage(new CPropLog());30 24 AddPage(new CPropertyPage(IDD_PROPPAGE_ABOUT)); 31 25 AddPage(new CPropConn()); … … 76 70 ShowWindow(SW_HIDE); 77 71 } 78 -
win32/admin/MainDlg.h
r99318ad rabe53d3 7 7 // MainDlg.h : header file 8 8 // 9 10 #include <afxdlgs.h> 9 11 10 12 ///////////////////////////////////////////////////////////////////////////// -
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 -
win32/admin/PropAccess.h
r99318ad rabe53d3 7 7 // PropAccess.h : header file 8 8 // 9 10 #include <afxdlgs.h> 11 #include "Resource.h" 9 12 10 13 ///////////////////////////////////////////////////////////////////////////// -
win32/admin/PropConn.cpp
r99318ad rabe53d3 2 2 // 3 3 4 #define BITLBEE_CORE5 #include "bitlbeewin.h"6 4 #include "PropConn.h" 7 5 … … 57 55 void CPropConn::OnProxyEnabled() 58 56 { 59 // TODO: Add your control notification handler code here60 57 m_proxyhost.EnableWindow(m_proxy_enabled.GetCheck()); 61 58 m_proxytype.EnableWindow(m_proxy_enabled.GetCheck()); … … 73 70 void CPropConn::OnOK() 74 71 { 72 CString tmp; 73 m_proxyhost.GetWindowText(tmp); 74 WriteProfileString("proxy_host", tmp); 75 76 m_proxyport.GetWindowText(tmp); 77 WriteProfileInt("proxy_port", atoi(tmp)); 78 75 79 if(!m_proxy_enabled.GetCheck()) { 76 proxytype = PROXY_NONE; 77 return; 80 WriteProfileInt("proxy_type", 0); 81 } else { 82 WriteProfileInt("proxy_type", m_proxytype.GetCurSel()+1); 78 83 } 79 84 80 CString tmp;81 m_proxyhost.GetWindowText(tmp);82 strcpy(proxyhost, tmp);83 84 m_proxyport.GetWindowText(tmp);85 proxyport = atoi(tmp);86 87 proxytype = m_proxytype.GetCurSel()+1;88 89 85 if(!m_proxy_auth_enabled.GetCheck()) { 90 strcpy(proxyuser, ""); 91 strcpy(proxypass, ""); 92 return; 86 WriteProfileString("proxy_user", ""); 87 WriteProfileString("proxy_password", ""); 88 } else { 89 m_proxyuser.GetWindowText(tmp); 90 WriteProfileString("proxy_user", tmp); 91 m_proxypass.GetWindowText(tmp); 92 WriteProfileString("proxy_password", tmp); 93 93 } 94 95 m_proxyuser.GetWindowText(tmp);96 strcpy(proxyuser, tmp);97 m_proxypass.GetWindowText(tmp);98 strcpy(proxypass, tmp);99 94 100 95 CPropertyPage::OnOK(); … … 105 100 char pp[20]; 106 101 CPropertyPage::OnInitDialog(); 102 int proxytype; 107 103 108 m_proxyhost.SetWindowText( proxyhost);109 m_proxyuser.SetWindowText( proxyuser);110 m_proxypass.SetWindowText( proxypass);111 g_snprintf(pp, 20, "%d", proxyport);104 m_proxyhost.SetWindowText(GetProfileString("proxy_host", "")); 105 m_proxyuser.SetWindowText(GetProfileString("proxy_user", "")); 106 m_proxypass.SetWindowText(GetProfileString("proxy_password", "")); 107 sprintf(pp, "%d", GetProfileInt("proxy_port", 3128)); 112 108 m_proxyport.SetWindowText(pp); 109 110 proxytype = GetProfileInt("proxy_type", 0); 113 111 114 112 m_proxytype.AddString("SOCKS 4"); … … 117 115 m_proxytype.SetCurSel(proxytype-1); 118 116 119 m_proxy_enabled.SetCheck(proxytype == PROXY_NONE?0:1);120 m_proxy_auth_enabled.SetCheck(strcmp( proxyuser, "")?1:0);117 m_proxy_enabled.SetCheck(proxytype == 0?0:1); 118 m_proxy_auth_enabled.SetCheck(strcmp(GetProfileString("proxy_user", ""), "")?1:0); 121 119 122 120 OnProxyEnabled(); -
win32/admin/PropConn.h
r99318ad rabe53d3 7 7 // PropConn.h : header file 8 8 // 9 10 #include <afxdlgs.h> 11 #include "Resource.h" 9 12 10 13 ///////////////////////////////////////////////////////////////////////////// -
win32/admin/PropLog.cpp
r99318ad rabe53d3 2 2 // 3 3 4 #define BITLBEE_CORE5 #include "bitlbeewin.h"6 4 #include "PropLog.h" 7 5 -
win32/admin/PropPaths.cpp
r99318ad rabe53d3 2 2 // 3 3 4 #define BITLBEE_CORE5 #include "bitlbeewin.h"6 4 #include "PropPaths.h" 7 5 #include "shlobj.h" … … 53 51 { 54 52 CString tmp; 55 g_free((void *)global.conf->configdir); 56 m_configdir.GetWindowText(tmp); 53 m_configdir.GetWindowText(tmp); 57 54 58 55 if (tmp.GetLength() > 0 … … 60 57 && tmp.GetAt(tmp.GetLength() - 1) != '\\') 61 58 { 62 global.conf->configdir = g_strdup_printf("%s\\", tmp); 63 } else { 64 global.conf->configdir = g_strdup(tmp); 59 tmp = tmp + "\\"; 65 60 } 66 61 67 g_free((void *)global.conf->motdfile); 62 WriteProfileString("configdir", tmp); 63 68 64 m_motdfile.GetWindowText(tmp); 69 global.conf->motdfile = g_strdup(tmp);70 65 WriteProfileString("motdfile", tmp); 66 71 67 CPropertyPage::OnOK(); 72 68 } … … 112 108 { 113 109 CPropertyPage::OnInitDialog(); 114 115 m_configdir.SetWindowText( global.conf->configdir);116 m_motdfile.SetWindowText( global.conf->motdfile);110 111 m_configdir.SetWindowText(GetProfileString("configdir", "")); 112 m_motdfile.SetWindowText(GetProfileString("motdfile", "")); 117 113 118 114 return TRUE; -
win32/admin/PropPaths.h
r99318ad rabe53d3 7 7 // PropPaths.h : header file 8 8 // 9 #include <afxdlgs.h> 10 #include "Resource.h" 9 11 10 12 ///////////////////////////////////////////////////////////////////////////// -
win32/admin/bitlbee.rc
r99318ad rabe53d3 95 95 END 96 96 97 IDD_PROPPAGE_USERS DIALOG DISCARDABLE 0, 0, 210, 15498 STYLE WS_CHILD | WS_DISABLED | WS_CAPTION99 CAPTION "Users"100 FONT 8, "MS Sans Serif"101 BEGIN102 GROUPBOX "Known users",IDC_STATIC,7,7,196,68103 GROUPBOX "Current users",IDC_STATIC,7,79,196,68104 LISTBOX IDC_KNOWN_USERS,13,17,114,52,LBS_SORT |105 LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP106 PUSHBUTTON "&Remove",IDC_DEL_KNOWN_USERS,133,17,32,14,WS_DISABLED107 LISTBOX IDC_CURRENT_USERS,13,89,115,52,LBS_SORT |108 LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP109 PUSHBUTTON "&Kick",IDC_KICK,135,89,19,14,WS_DISABLED110 PUSHBUTTON "&Refresh",IDC_REFRESH_KNOWN_USERS,133,38,30,14111 PUSHBUTTON "&Refresh",IDC_REFRESH_CURRENT_USERS,135,110,30,14112 END113 114 97 IDD_PROPPAGE_PATHS DIALOG DISCARDABLE 0, 0, 210, 154 115 98 STYLE WS_CHILD | WS_DISABLED | WS_CAPTION … … 124 107 EDITTEXT IDC_MOTDFILE,13,51,122,13,ES_AUTOHSCROLL 125 108 PUSHBUTTON "&Edit...",IDC_EDIT_MOTD,153,66,43,13 126 END127 128 IDD_PHONY DIALOG DISCARDABLE 0, 0, 9, 9129 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU130 CAPTION "Dialog"131 FONT 8, "MS Sans Serif"132 BEGIN133 109 END 134 110 … … 150 126 LTEXT "The Bitlbee homepage is located at http://www.bitlbee.org/\n\nFor Bitlbee support, go to #bitlbee on irc.oftc.net", 151 127 IDC_STATIC,17,100,248,39 152 END153 154 IDD_PROPPAGE_LOG DIALOG DISCARDABLE 0, 0, 210, 154155 STYLE WS_CHILD | WS_DISABLED | WS_CAPTION156 CAPTION "Logs"157 FONT 8, "MS Sans Serif"158 BEGIN159 LISTBOX IDC_LOG,7,7,196,140,LBS_SORT | LBS_NOINTEGRALHEIGHT |160 WS_VSCROLL | WS_TABSTOP161 128 END 162 129 … … 184 151 END 185 152 153 IDD_PROPPAGE_MAIN DIALOG DISCARDABLE 0, 0, 210, 101 154 STYLE WS_CHILD | WS_DISABLED | WS_CAPTION 155 CAPTION "Main" 156 FONT 8, "MS Sans Serif" 157 BEGIN 158 LTEXT "Current Status:",IDC_STATIC,13,16,66,9 159 LTEXT "Static",IDC_STATIC,92,16,80,12 160 PUSHBUTTON "&Start",IDC_STARTSERVICE,13,28,40,11 161 PUSHBUTTON "&Stop",IDC_STOPSERVICE,65,29,46,11 162 CONTROL "&Verbose",IDC_VERBOSE,"Button",BS_AUTOCHECKBOX | 163 WS_TABSTOP,15,43,84,12 164 EDITTEXT IDC_PING_INTERVAL,93,62,47,12,ES_AUTOHSCROLL 165 LTEXT "Ping Interval:",IDC_STATIC,13,62,60,10 166 END 167 186 168 187 169 #ifndef _MAC … … 212 194 VALUE "FileVersion", "1, 0, 0, 1\0" 213 195 VALUE "InternalName", "bitlbee\0" 214 VALUE "LegalCopyright", "Copyright (C) 2002-200 4\0"215 VALUE "OriginalFilename", "bitlbee .exe\0"196 VALUE "LegalCopyright", "Copyright (C) 2002-2005\0" 197 VALUE "OriginalFilename", "bitlbeeadm.exe\0" 216 198 VALUE "ProductName", "Bitlbee Application\0" 217 199 VALUE "ProductVersion", "1, 0, 0, 1\0" … … 243 225 END 244 226 245 IDD_PROPPAGE_ USERS, DIALOG227 IDD_PROPPAGE_PATHS, DIALOG 246 228 BEGIN 247 229 LEFTMARGIN, 7 … … 251 233 END 252 234 253 IDD_PROPPAGE_PATHS, DIALOG 235 IDD_PROPPAGE_ABOUT, DIALOG 236 BEGIN 237 LEFTMARGIN, 7 238 RIGHTMARGIN, 277 239 TOPMARGIN, 7 240 BOTTOMMARGIN, 149 241 END 242 243 IDD_PROPPAGE_CONNECTION, DIALOG 254 244 BEGIN 255 245 LEFTMARGIN, 7 … … 259 249 END 260 250 261 IDD_PHONY, DIALOG 262 BEGIN 263 LEFTMARGIN, 7 264 RIGHTMARGIN, 2 265 TOPMARGIN, 7 266 BOTTOMMARGIN, 2 267 END 268 269 IDD_PROPPAGE_ABOUT, DIALOG 270 BEGIN 271 LEFTMARGIN, 7 272 RIGHTMARGIN, 277 273 TOPMARGIN, 7 274 BOTTOMMARGIN, 149 275 END 276 277 IDD_PROPPAGE_LOG, DIALOG 251 IDD_PROPPAGE_MAIN, DIALOG 278 252 BEGIN 279 253 LEFTMARGIN, 7 280 254 RIGHTMARGIN, 203 281 TOPMARGIN, 7 282 BOTTOMMARGIN, 147 283 END 284 285 IDD_PROPPAGE_CONNECTION, DIALOG 286 BEGIN 287 LEFTMARGIN, 7 288 RIGHTMARGIN, 203 289 TOPMARGIN, 7 290 BOTTOMMARGIN, 147 255 TOPMARGIN, 6 256 BOTTOMMARGIN, 94 291 257 END 292 258 END … … 296 262 ///////////////////////////////////////////////////////////////////////////// 297 263 // 298 // Menu299 //300 301 IDR_POPUP MENU DISCARDABLE302 BEGIN303 POPUP "tray"304 BEGIN305 MENUITEM "&Show", IDM_SHOW306 MENUITEM SEPARATOR307 MENUITEM "&Exit", IDM_EXIT308 END309 END310 311 312 /////////////////////////////////////////////////////////////////////////////313 //314 264 // Bitmap 315 265 // … … 325 275 BEGIN 326 276 IDS_ABOUTBOX "&About bitlbee..." 327 IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed."328 277 END 329 278 -
win32/admin/bitlbeewin.h
r99318ad rabe53d3 14 14 #include "resource.h" // main symbols 15 15 16 class CTrayNot;17 extern "C" {18 #define BITLBEE_CORE19 #include "bitlbee.h"20 }21 22 16 ///////////////////////////////////////////////////////////////////////////// 23 17 // CBitlbeeApp: … … 28 22 { 29 23 public: 30 CBitlbeeApp() ;24 CBitlbeeApp() {} 31 25 32 26 // Overrides … … 41 35 42 36 //{{AFX_MSG(CBitlbeeApp) 43 afx_msg void OnExit();44 afx_msg void OnShow();45 37 //}}AFX_MSG 46 38 DECLARE_MESSAGE_MAP() 47 39 protected: 48 CTrayNot *not;49 40 CPropertySheet *dlg; 50 GIOChannel *listen;51 41 }; 52 42 -
win32/admin/resource.h
r99318ad rabe53d3 21 21 #define IDD_PROPPAGE_CONNECTION 137 22 22 #define IDI_ICON1 138 23 #define IDD_PROPPAGE_MAIN 138 23 24 #define IDC_AUTH_OPEN 1001 24 25 #define IDC_AUTH_CLOSED 1002 … … 46 47 #define IDC_PROXYPORT 1023 47 48 #define IDC_PROXYTYPE 1024 49 #define IDC_STARTSERVICE 1025 50 #define IDC_STOPSERVICE 1026 51 #define IDC_VERBOSE 1027 52 #define IDC_PING_INTERVAL 1028 48 53 #define IDM_SHOW 32771 49 54 #define IDM_EXIT 32773 … … 55 60 #define _APS_NEXT_RESOURCE_VALUE 139 56 61 #define _APS_NEXT_COMMAND_VALUE 32774 57 #define _APS_NEXT_CONTROL_VALUE 102 562 #define _APS_NEXT_CONTROL_VALUE 1029 58 63 #define _APS_NEXT_SYMED_VALUE 102 59 64 #endif
Note: See TracChangeset
for help on using the changeset viewer.