Changeset 4363 for trunk/console
- Timestamp:
- 01/15/06 10:58:47 (3 years ago)
- Location:
- trunk/console/src
- Files:
-
- 5 modified
-
console.cpp (modified) (44 diffs)
-
console_menu.cpp (modified) (26 diffs)
-
console_print.cpp (modified) (14 diffs)
-
window.cpp (modified) (1 diff)
-
window.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/console/src/console.cpp
r4351 r4363 91 91 const struct SColorMap aColorMaps[NUM_COLORMAPS] = 92 92 { 93 { "green", 24, A_NORMAL }93 { "green", COLOR_GREEN, A_NORMAL } 94 94 , // 0 95 { "red", 16, A_NORMAL }95 { "red", COLOR_RED, A_NORMAL } 96 96 , // 1 97 { "cyan", 56, A_NORMAL }97 { "cyan", COLOR_CYAN, A_NORMAL } 98 98 , // 2 99 { "white", 8, A_NORMAL }99 { "white", COLOR_WHITE, A_NORMAL } 100 100 , // 3 101 { "magenta", 48, A_NORMAL }101 { "magenta", COLOR_MAGENTA, A_NORMAL } 102 102 , // 4 103 { "blue", 40, A_NORMAL }103 { "blue", COLOR_BLUE, A_NORMAL } 104 104 , // 5 105 { "yellow", 32, A_NORMAL }105 { "yellow", COLOR_YELLOW, A_NORMAL } 106 106 , // 6 107 { "black", 8, A_NORMAL }107 { "black", COLOR_BLACK, A_NORMAL } 108 108 , // 7 109 { "bright_green", 24, A_BOLD }109 { "bright_green", COLOR_GREEN, A_BOLD } 110 110 , // 8 111 { "bright_red", 16, A_BOLD }111 { "bright_red", COLOR_RED, A_BOLD } 112 112 , // 9 113 { "bright_cyan", 56, A_BOLD }113 { "bright_cyan", COLOR_CYAN, A_BOLD } 114 114 , // 10 115 { "bright_white", 8, A_BOLD }115 { "bright_white", COLOR_WHITE, A_BOLD } 116 116 , // 11 117 { "bright_magenta", 48, A_BOLD }117 { "bright_magenta", COLOR_MAGENTA, A_BOLD } 118 118 , // 12 119 { "bright_blue", 40, A_BOLD }119 { "bright_blue", COLOR_BLUE, A_BOLD } 120 120 , // 13 121 { "bright_yellow", 32, A_BOLD } // 14121 { "bright_yellow", COLOR_YELLOW, A_BOLD } // 14 122 122 }; 123 123 … … 436 436 { 437 437 case L_WARN: 438 cp = 32;438 cp = COLOR_YELLOW; 439 439 break; 440 440 case L_ERROR: 441 cp = 16;441 cp = COLOR_RED; 442 442 break; 443 443 case L_PACKET: 444 cp = 40;444 cp = COLOR_BLUE; 445 445 break; 446 446 case L_UNKNOWN: 447 cp = 48;447 cp = COLOR_MAGENTA; 448 448 break; 449 449 case L_INFO: 450 450 default: 451 cp = 8;451 cp = COLOR_WHITE; 452 452 break; 453 453 } … … 455 455 char *l = &p[LOG_PREFIX_OFFSET]; 456 456 p[LOG_PREFIX_OFFSET - 1] = '\0'; 457 winLog->wprintf("%C%s %C%s", 24, p, cp, l);457 winLog->wprintf("%C%s %C%s", COLOR_GREEN, p, cp, l); 458 458 if (log->NextLogType() == L_ERROR) 459 459 { 460 winMain->wprintf("%C%s %C%s", 24, p, cp, l);460 winMain->wprintf("%C%s %C%s", COLOR_GREEN, p, cp, l); 461 461 winMain->RefreshWin(); 462 462 } … … 632 632 case ICQ_CMDxSND_LOGON: 633 633 if (e->Result() != EVENT_SUCCESS) 634 winMain->wprintf("%CLogon failed. See the log console for details.\n", 16);634 winMain->wprintf("%CLogon failed. See the log console for details.\n", COLOR_RED); 635 635 break; 636 636 … … 670 670 winMain->wprintf("%C%AFile transfer could not connect. See network " 671 671 "window for details.%C%Z\n", 672 16, A_BOLD, 8, A_BOLD);672 COLOR_RED, A_BOLD, COLOR_WHITE, A_BOLD); 673 673 bCloseFT = true; 674 674 break; … … 677 677 winMain->wprintf("%C%AFile transfer could not bind to a port. See " 678 678 "network window for details.%C%Z\n", 679 16, A_BOLD, 8, A_BOLD);679 COLOR_RED, A_BOLD, COLOR_WHITE, A_BOLD); 680 680 bCloseFT = true; 681 681 break; … … 684 684 winMain->wprintf("%C%AFile transfer unable to create new thread. See " 685 685 "network window for details.%C%Z\n", 686 16, A_BOLD, 8, A_BOLD);686 COLOR_RED, A_BOLD, COLOR_WHITE, A_BOLD); 687 687 bCloseFT = true; 688 688 break; … … 693 693 case FT_DONExBATCH: 694 694 winMain->wprintf("%C%AFile transfer successfuly finished.%C%Z\n", 695 24, A_BOLD, 8, A_BOLD);695 COLOR_GREEN, A_BOLD, COLOR_WHITE, A_BOLD); 696 696 bCloseFT = true; 697 697 break; … … 699 699 case FT_ERRORxCLOSED: 700 700 winMain->wprintf("%C%AFile transfer closed.%C%Z\n", 701 16, A_BOLD, 8, A_BOLD);701 COLOR_RED, A_BOLD, COLOR_WHITE, A_BOLD); 702 702 bCloseFT = true; 703 703 break; … … 705 705 case FT_ERRORxFILE: 706 706 winMain->wprintf("%C%AFile transfer I/O error.%C%Z\n", 707 16, A_BOLD, 8, A_BOLD);707 COLOR_RED, A_BOLD, COLOR_WHITE, A_BOLD); 708 708 bCloseFT = true; 709 709 break; … … 711 711 case FT_ERRORxHANDSHAKE: 712 712 winMain->wprintf("%C%AFile transfer handshake error.%C%Z\n", 713 16, A_BOLD, 8, A_BOLD);713 COLOR_RED, A_BOLD, COLOR_WHITE, A_BOLD); 714 714 bCloseFT = true; 715 715 break; … … 761 761 if (e == NULL) 762 762 { 763 win->wprintf("%A%Cerror\n", A_BOLD, 16);763 win->wprintf("%A%Cerror\n", A_BOLD, COLOR_RED); 764 764 } 765 765 else … … 797 797 { 798 798 win->wprintf("%C%ADirect send failed, send through server (y/N)? %C%Z", 799 m_cColorQuery->nColor, m_cColorQuery->nAttr, 8,799 m_cColorQuery->nColor, m_cColorQuery->nAttr, COLOR_WHITE, 800 800 A_BOLD); 801 801 win->state = STATE_QUERY; … … 965 965 { 966 966 win->wprintf("%C%s%A,%Z %s %s %A(%Z%s%A) -%Z %lu %A(%Z%s%A)\n", 967 8,967 COLOR_WHITE, 968 968 e->SearchAck()->Alias(), 969 969 A_BOLD, A_BOLD, … … 1003 1003 else 1004 1004 { 1005 win->wprintf("%CSearch failed.\n", 16);1005 win->wprintf("%CSearch failed.\n", COLOR_RED); 1006 1006 } 1007 1007 … … 1039 1039 winConStatus->wprintf("%A%C) ]", A_BOLD, 29); 1040 1040 wclrtoeol(winConStatus->Win()); 1041 wbkgdset(winConStatus->Win(), COLOR_PAIR( 8));1041 wbkgdset(winConStatus->Win(), COLOR_PAIR(COLOR_WHITE)); 1042 1042 mvwhline(winConStatus->Win(), 1, 0, ACS_HLINE, COLS); 1043 1043 //mvwaddch(winConStatus->Win(), 1, COLS - USER_WIN_WIDTH - 1, ACS_TTEE); … … 1274 1274 { // No matches 1275 1275 Beep(); 1276 winMain->wprintf("%CNo matches.\n", 16);1276 winMain->wprintf("%CNo matches.\n", COLOR_RED); 1277 1277 wprintw(winPrompt->Win(), ""); 1278 1278 break; … … 1454 1454 if (iter == listMacros.end()) 1455 1455 { 1456 winMain->wprintf("%CNo such macro \"%A%s%Z\"\n", 16, A_BOLD,1456 winMain->wprintf("%CNo such macro \"%A%s%Z\"\n", COLOR_RED, A_BOLD, 1457 1457 szMacro, A_BOLD); 1458 1458 szMacro[0] = '\0'; … … 1532 1532 "for %s (%s)? %C%Z", 1533 1533 m_cColorQuery->nColor, m_cColorQuery->nAttr, 1534 u->GetAlias(), szId, 8, A_BOLD);1534 u->GetAlias(), szId, COLOR_WHITE, A_BOLD); 1535 1535 winMain->RefreshWin(); 1536 1536 gUserManager.DropUser(u); … … 1574 1574 break; 1575 1575 default: 1576 winMain->wprintf("%CInvalid key.\n", 16);1576 winMain->wprintf("%CInvalid key.\n", COLOR_RED); 1577 1577 } 1578 1578 … … 1590 1590 1591 1591 default: 1592 winMain->wprintf("%CInvalid state: %A%d%Z.\n", 16, A_BOLD, A_BOLD);1592 winMain->wprintf("%CInvalid state: %A%d%Z.\n", COLOR_RED, A_BOLD, A_BOLD); 1593 1593 } 1594 1594 … … 1665 1665 winMain->wprintf("%C%ARemove %s (%s) from contact list (y/N)? %C%Z", 1666 1666 m_cColorQuery->nColor, m_cColorQuery->nAttr, 1667 u->GetAlias(), szId, 8, A_BOLD);1667 u->GetAlias(), szId, COLOR_WHITE, A_BOLD); 1668 1668 winMain->RefreshWin(); 1669 1669 gUserManager.DropUser(u); … … 1706 1706 1707 1707 default: 1708 winMain->wprintf("%CInvalid state: %A%d%Z.\n", 16, A_BOLD, A_BOLD);1708 winMain->wprintf("%CInvalid state: %A%d%Z.\n", COLOR_RED, A_BOLD, A_BOLD); 1709 1709 } 1710 1710 … … 1812 1812 { 1813 1813 winMain->wprintf("%CYou must specify an event number. (1-%d)\n", 1814 16, nLast);1814 COLOR_RED, nLast); 1815 1815 } 1816 1816 else 1817 1817 { 1818 winMain->wprintf("%CNo System Events.\n", 8);1818 winMain->wprintf("%CNo System Events.\n", COLOR_WHITE); 1819 1819 } 1820 1820 free(szFrom); … … 1833 1833 if (nStart == -1) 1834 1834 { 1835 winMain->wprintf("%CInvalid start range: %A%s\n", 16,1835 winMain->wprintf("%CInvalid start range: %A%s\n", COLOR_RED, 1836 1836 A_BOLD, szStart); 1837 1837 free(szFrom); … … 1841 1841 { 1842 1842 winMain->wprintf("%CStart value out of range, history contains %d events.\n", 1843 16, nLast);1843 COLOR_RED, nLast); 1844 1844 free(szFrom); 1845 1845 return; … … 1851 1851 if (nEnd == -1) 1852 1852 { 1853 winMain->wprintf("%CInvalid end range: %A%s\n", 16,1853 winMain->wprintf("%CInvalid end range: %A%s\n", COLOR_RED, 1854 1854 A_BOLD, szEnd); 1855 1855 free(szFrom); … … 1859 1859 { 1860 1860 winMain->wprintf("%CEnd value out of range, history contains %d events.\n", 1861 16, nLast);1861 COLOR_RED, nLast); 1862 1862 free(szFrom); 1863 1863 return; … … 1992 1992 1993 1993 default: 1994 winMain->wprintf("%CInvalid state: %A%d%Z.\n", 16, A_BOLD, A_BOLD);1994 winMain->wprintf("%CInvalid state: %A%d%Z.\n", COLOR_RED, A_BOLD, A_BOLD); 1995 1995 } 1996 1996 … … 2161 2161 2162 2162 default: 2163 winMain->wprintf("%CInvalid state: %A%d%Z.\n", 16, A_BOLD, A_BOLD);2163 winMain->wprintf("%CInvalid state: %A%d%Z.\n", COLOR_RED, A_BOLD, A_BOLD); 2164 2164 } 2165 2165 … … 2268 2268 2269 2269 default: 2270 winMain->wprintf("%CInvalid state: %A%d%Z.\n", 16, A_BOLD, A_BOLD);2270 winMain->wprintf("%CInvalid state: %A%d%Z.\n", COLOR_RED, A_BOLD, A_BOLD); 2271 2271 } 2272 2272 … … 2341 2341 2342 2342 default: 2343 winMain->wprintf("%CInvalid state: %A%d%Z.\n", 16, A_BOLD, A_BOLD);2343 winMain->wprintf("%CInvalid state: %A%d%Z.\n", COLOR_RED, A_BOLD, A_BOLD); 2344 2344 } 2345 2345 … … 2403 2403 2404 2404 default: 2405 winMain->wprintf("%CInvalid state: %A%d%Z.\n", 16, A_BOLD, A_BOLD);2405 winMain->wprintf("%CInvalid state: %A%d%Z.\n", COLOR_RED, A_BOLD, A_BOLD); 2406 2406 } 2407 2407 … … 2702 2702 "2 %A-%Z Male\n" 2703 2703 "%A%CGender: ", 2704 8, A_BOLD, A_BOLD, A_BOLD, A_BOLD,2704 COLOR_WHITE, A_BOLD, A_BOLD, A_BOLD, A_BOLD, 2705 2705 A_BOLD, A_BOLD, m_cColorQuery->nAttr, m_cColorQuery->nColor); 2706 2706 return; … … 2732 2732 { 2733 2733 winMain->wprintf("%C%s %A(%Z%d%A)%s%Z", 2734 8, gLanguages[i].szName,2734 COLOR_WHITE, gLanguages[i].szName, 2735 2735 A_BOLD, A_BOLD, gLanguages[i].nCode, 2736 2736 A_BOLD, … … 2790 2790 { 2791 2791 winMain->wprintf("%C%s %A(%Z%d%A)%s%Z", 2792 8, gCountries[i].szName,2792 COLOR_WHITE, gCountries[i].szName, 2793 2793 A_BOLD, A_BOLD, gCountries[i].nCode, 2794 2794 A_BOLD, … … 2902 2902 2903 2903 winMain->wprintf("%A%CWelcome to the Licq Console Registration Wizard\n\nPress 1 to register a new UIN\nPress 2 if you have a UIN and password\n\n", 2904 A_BOLD, 24);2904 A_BOLD, COLOR_GREEN); 2905 2905 2906 2906 return; … … 3089 3089 winMain->data = new DataFileChatOffer(f, _szId, _nPPID); 3090 3090 winMain->wprintf("%C%ADo you wish to accept this request? (y/N) %C%Z", 3091 m_cColorQuery->nColor, m_cColorQuery->nAttr, 8, A_BOLD);3091 m_cColorQuery->nColor, m_cColorQuery->nAttr, COLOR_WHITE, A_BOLD); 3092 3092 winMain->RefreshWin(); 3093 3093 … … 3112 3112 case 'y': 3113 3113 { 3114 winMain->wprintf("%C%A\nAccepting file\n", 24, A_BOLD);3114 winMain->wprintf("%C%A\nAccepting file\n", COLOR_GREEN, A_BOLD); 3115 3115 3116 3116 // Make the ftman … … 3189 3189 { 3190 3190 winMain->wprintf("%CYou need to recompile Licq with OpenSSL for this " 3191 "feature to work!\n", 16);3191 "feature to work!\n", COLOR_RED); 3192 3192 return; 3193 3193 } … … 3196 3196 { 3197 3197 winMain->wprintf("%CThe remote end is not using a supported client. " 3198 "This may not work!\n", 16);3198 "This may not work!\n", COLOR_RED); 3199 3199 } 3200 3200 … … 3238 3238 else 3239 3239 { 3240 winMain->wprintf("%C<user> secure <open | close | (blank)>\n", 16);3240 winMain->wprintf("%C<user> secure <open | close | (blank)>\n", COLOR_RED); 3241 3241 } 3242 3242 … … 3262 3262 ICQOwner *o = gUserManager.FetchOwner(LOCK_R); 3263 3263 winMain->wprintf("%A%CEnter your password for %s (%lu):%C%Z\n", A_BOLD, 3264 24, o->GetAlias(), o->Uin(), 8, A_BOLD);3264 COLOR_GREEN, o->GetAlias(), o->Uin(), COLOR_WHITE, A_BOLD); 3265 3265 gUserManager.DropOwner(); 3266 3266 } … … 3284 3284 3285 3285 // Next stage is saving the password possibly 3286 winMain->wprintf("%C%ASave password? (y/N) %C%Z", 24, A_BOLD,3287 8, A_BOLD);3286 winMain->wprintf("%C%ASave password? (y/N) %C%Z", COLOR_GREEN, A_BOLD, 3287 COLOR_WHITE, A_BOLD); 3288 3288 winMain->state = STATE_QUERY; 3289 3289 break; -
trunk/console/src/console_menu.cpp
r4273 r4363 263 263 ProtoPluginsListIter pit; 264 264 licqDaemon->ProtoPluginList(p1); 265 PrintBoxTop("Plugins", 40, 70);265 PrintBoxTop("Plugins", COLOR_BLUE, 70); 266 266 for (it = l.begin(); it != l.end(); it++) 267 267 { … … 316 316 } 317 317 } 318 winMain->wprintf("%CNo such macro \"%A%s%Z\"\n", 16, A_BOLD,318 winMain->wprintf("%CNo such macro \"%A%s%Z\"\n", COLOR_RED, A_BOLD, 319 319 szArg, A_BOLD); 320 320 return; … … 374 374 if (nCurrentGroup > NUM_GROUPS_SYSTEM || nCurrentGroup == 0) 375 375 { 376 winMain->wprintf("%CInvalid group number (0 - %d)\n", 16,376 winMain->wprintf("%CInvalid group number (0 - %d)\n", COLOR_RED, 377 377 NUM_GROUPS_SYSTEM); 378 378 return; … … 392 392 if (nCurrentGroup > gUserManager.NumGroups()) 393 393 { 394 winMain->wprintf("%CInvalid group number (0 - %d)\n", 16,394 winMain->wprintf("%CInvalid group number (0 - %d)\n", COLOR_RED, 395 395 gUserManager.NumGroups()); 396 396 return; … … 420 420 if (szArg == NULL) 421 421 { 422 winMain->wprintf("%CSpecify a UIN to add.\n", 16);422 winMain->wprintf("%CSpecify a UIN to add.\n", COLOR_RED); 423 423 return; 424 424 } … … 438 438 { 439 439 winMain->wprintf("%CAdding user %s failed (duplicate user or invalid uin).\n", 440 16, szArg);440 COLOR_RED, szArg); 441 441 return; 442 442 } … … 465 465 if (szArg == NULL) 466 466 { 467 winMain->wprintf("%CSpecify \"grant/refuse\" and a UIN/Screen Name to authorize.\n", 16);467 winMain->wprintf("%CSpecify \"grant/refuse\" and a UIN/Screen Name to authorize.\n", COLOR_RED); 468 468 return; 469 469 } … … 506 506 if (_szArg == NULL) 507 507 { 508 winMain->wprintf("%CSpecify status.\n", 16);508 winMain->wprintf("%CSpecify status.\n", COLOR_RED); 509 509 return; 510 510 } … … 528 528 if (i == NUM_STATUS) 529 529 { 530 winMain->wprintf("%CInvalid status: %A%s\n", 16, A_BOLD, _szArg);530 winMain->wprintf("%CInvalid status: %A%s\n", COLOR_RED, A_BOLD, _szArg); 531 531 return; 532 532 } … … 613 613 if (szCmd == NULL) 614 614 { 615 winMain->wprintf("%CUnbalanced quotes.\n", 16);615 winMain->wprintf("%CUnbalanced quotes.\n", COLOR_RED); 616 616 return (unsigned long)-1; 617 617 } … … 664 664 if (nUin == 0) 665 665 { 666 winMain->wprintf("%CInvalid user: %A%s\n", 16, A_BOLD, szAlias);666 winMain->wprintf("%CInvalid user: %A%s\n", COLOR_RED, A_BOLD, szAlias); 667 667 return (unsigned long)-1; 668 668 } … … 672 672 if (!gUserManager.IsOnList(nUin)) 673 673 { 674 winMain->wprintf("%CInvalid uin: %A%lu\n", 16, A_BOLD, nUin);674 winMain->wprintf("%CInvalid uin: %A%lu\n", COLOR_RED, A_BOLD, nUin); 675 675 return (unsigned long)-1; 676 676 } … … 732 732 if (szCmd == NULL) 733 733 { 734 winMain->wprintf("%CUnbalanced quotes.\n", 16);734 winMain->wprintf("%CUnbalanced quotes.\n", COLOR_RED); 735 735 return scon; 736 736 } … … 785 785 if (scon.szId == NULL) 786 786 { 787 winMain->wprintf("%CInvalid user: %A%s\n", 16, A_BOLD, szAlias);787 winMain->wprintf("%CInvalid user: %A%s\n", COLOR_RED, A_BOLD, szAlias); 788 788 scon.szId = NULL; 789 789 scon.nPPID = (unsigned long)-1; … … 805 805 806 806 if (!scon.szId && scon.nPPID != (unsigned long)-1) 807 winMain->wprintf("%CYou must specify a user to send a message to.\n", 16);807 winMain->wprintf("%CYou must specify a user to send a message to.\n", COLOR_RED); 808 808 else if (scon.nPPID != (unsigned long)-1) 809 809 UserCommand_Msg(scon.szId, scon.nPPID, sz); … … 821 821 822 822 if (nUin == gUserManager.OwnerUin()) 823 winMain->wprintf("%CSetting personal info not implemented yet.\n", 16);823 winMain->wprintf("%CSetting personal info not implemented yet.\n", COLOR_RED); 824 824 else if (nUin == 0) { 825 825 char szUin[24]; … … 842 842 843 843 if (nUin == gUserManager.OwnerUin()) 844 winMain->wprintf("%CYou can't send URLs to yourself!\n", 16);844 winMain->wprintf("%CYou can't send URLs to yourself!\n", COLOR_RED); 845 845 else if (nUin == 0) 846 winMain->wprintf("%CYou must specify a user to send a URL to.\n", 16);846 winMain->wprintf("%CYou must specify a user to send a URL to.\n", COLOR_RED); 847 847 else if (nUin != (unsigned long)-1) 848 848 sprintf(szArg, "%lu", nUin); … … 862 862 863 863 if (nUin == 0) 864 winMain->wprintf("%CInvalid user\n", 16);864 winMain->wprintf("%CInvalid user\n", COLOR_RED); 865 865 else if (nUin != (unsigned long)-1) 866 866 { … … 933 933 934 934 if (nUin == gUserManager.OwnerUin()) 935 winMain->wprintf("%CYou can't establish a secure connection to yourself!\n", 16);935 winMain->wprintf("%CYou can't establish a secure connection to yourself!\n", COLOR_RED); 936 936 else if (nUin == 0) 937 winMain->wprintf("%CYou must specify a user to talk to.\n", 16);937 winMain->wprintf("%CYou must specify a user to talk to.\n", COLOR_RED); 938 938 else if (nUin != (unsigned long)-1) 939 939 { … … 953 953 954 954 if (nUin == gUserManager.OwnerUin()) 955 winMain->wprintf("%CYou can't send files to yourself!\n", 16);955 winMain->wprintf("%CYou can't send files to yourself!\n", COLOR_RED); 956 956 else if (nUin == 0) 957 957 { … … 997 997<
