📄 preferences.h
字号:
int8 addserversfromclient;
int16 maxsourceperfile;
int16 trafficOMeterInterval;
int32 totalDownloaded; // outdated
int32 totalUploaded; // outdated
int maxGraphDownloadRate;
int maxGraphUploadRate;
uint8 beepOnError;
uint8 confirmExit;
WINDOWPLACEMENT EmuleWindowPlacement;
int transferColumnWidths[9];
int serverColumnWidths[8];
uint8 splashscreen;
uint8 filterBadIP;
int64 totalDownloadedBytes;
int64 totalUploadedBytes;
};
#pragma pack()
class CPreferences{
public:
enum Table { tableDownload, tableUpload, tableQueue, tableSearch,
tableShared, tableServer, tableClientList };
friend class CPreferencesWnd;
friend class CPPgGeneral;
friend class CPPgConnection;
friend class CPPgServer;
friend class CPPgDirectories;
friend class CPPgFiles;
friend class CPPgNotify;
friend class CPPgIRC;
friend class Wizard;
friend class CPPgTweaks;
friend class CPPgDisplay;
friend class CPPgSecurity;
//friend class CPPgScheduler;
CPreferences();
~CPreferences();
char* GetAppDir() {return appdir;}
bool Save();
int8 Score() {return prefs->scorsystem;}
bool Reconnect() {return prefs->reconnect;}
int8 DeadServer() {return prefs->deadserver;}
char* GetUserNick() {return prefs->nick;}
void SetUserNick(CString in) {sprintf(prefs->nick,"%s",in);}
uint16 GetPort() {return prefs->port;}
uint16 GetUDPPort() {return prefs->udpport;}
char* GetIncomingDir(){return prefs->incomingdir;}
char* GetTempDir() {return prefs->tempdir;}
char* GetUserHash() {return userhash;}
uint16 GetMaxUpload() {return prefs->maxupload;}
bool IsICHEnabled() {return prefs->ICH;}
bool AutoServerlist(){return prefs->autoserverlist;}
bool UpdateNotify() {return prefs->updatenotify;}
bool DoMinToTray() {return prefs->mintotray;}
bool DoAutoConnect() {return prefs->autoconnect;}
void SetAutoConnect( bool inautoconnect) {prefs->autoconnect = inautoconnect;}
bool AddServersFromServer() {return prefs->addserversfromserver;}
bool AddServersFromClient() {return prefs->addserversfromclient;}
int8* GetMinTrayPTR() {return &prefs->mintotray;}
uint16 GetTrafficOMeterInterval() { return prefs->trafficOMeterInterval;}
void SetTrafficOMeterInterval(int16 in) { prefs->trafficOMeterInterval=in;}
uint16 GetStatsInterval() { return prefs->statsInterval;}
void SetStatsInterval(int16 in) { prefs->statsInterval=in;}
void Add2TotalDownloaded(uint64 in) {prefs->totalDownloadedBytes+=in;}
void Add2TotalUploaded(uint64 in) {prefs->totalUploadedBytes+=in;}
uint64 GetTotalDownloaded() {return prefs->totalDownloadedBytes;}
uint64 GetTotalUploaded() {return prefs->totalUploadedBytes;}
bool IsErrorBeepEnabled() {return prefs->beepOnError;}
bool IsConfirmExitEnabled() {return prefs->confirmExit;}
bool UseSplashScreen() {return prefs->splashscreen;}
bool FilterBadIPs() {return prefs->filterBadIP;}
bool IsOnlineSignatureEnabled() {return prefs->onlineSig;}
int GetMaxGraphUploadRate() {return prefs->maxGraphUploadRate;}
int GetMaxGraphDownloadRate() {return prefs->maxGraphDownloadRate;}
void SetMaxGraphUploadRate(int in){prefs->maxGraphUploadRate=in;}
void SetMaxGraphDownloadRate(int in){prefs->maxGraphDownloadRate=in;}
uint16 GetMaxDownload();
uint16 GetMaxConnections() {return prefs->maxconnections;}
uint16 GetMaxSourcePerFile() {return prefs->maxsourceperfile;}
uint16 GetMaxSourcePerFileSoft() { uint16 temp = prefs->maxsourceperfile*0.9;
if( temp > 1000 )
return 1000;
return temp;}
uint16 GetMaxSourcePerFileUDP() { uint16 temp = prefs->maxsourceperfile*0.75;
if( temp > 100 )
return 100;
return temp;
}
uint16 GetDeadserverRetries() {return prefs->deadserverretries;}
int GetColumnWidth (Table t, int index) const;
BOOL GetColumnHidden(Table t, int index) const;
int GetColumnOrder (Table t, int index) const;
void SetColumnWidth (Table t, int index, int width);
void SetColumnHidden(Table t, int index, BOOL bHidden);
void SetColumnOrder (Table t, INT *piOrder);
// Barry - Provide a mechanism for all tables to store/retrieve sort order
int GetColumnSortItem (Table t) const;
bool GetColumnSortAscending (Table t) const;
void SetColumnSortItem (Table t, int sortItem);
void SetColumnSortAscending (Table t, bool sortAscending);
WORD GetLanguageID() {return prefs->languageID;}
int8 IsDoubleClickEnabled() {return prefs->transferDoubleclick;}
int8 CanSeeShares(void) {return prefs->m_iSeeShares;}
int8 GetToolTipDelay(void) {return prefs->m_iToolDelayTime;}
int8 IsBringToFront() {return prefs->bringtoforeground;}
int8 GetSplitterbarPosition() {return prefs->splitterbarPosition;}
void SetSplitterbarPosition(int8 pos) {prefs->splitterbarPosition=pos;}
int8 GetStatsMax() {return prefs->statsMax;}
int8 UseFlatBar() {return (prefs->depth3D==0);}
int8 GetStatsAverageMinutes() {return prefs->statsAverageMinutes;}
void SetStatsAverageMinutes(int8 in) {prefs->statsAverageMinutes=in;}
bool GetUseDownloadNotifier() {return prefs->useDownloadNotifier;}
bool GetUseChatNotifier() {return prefs->useChatNotifier;}
bool GetUseLogNotifier() {return prefs->useLogNotifier;}
bool GetUseSoundInNotifier() {return prefs->useSoundInNotifier;}
bool GetNotifierPopsEveryChatMsg() {return prefs->notifierPopsEveryChatMsg;}
bool GetNotifierPopOnImportantError() {return prefs->notifierImportantError;}
bool GetNotifierPopOnNewVersion() {return prefs->notifierNewVersion;}
char* GetNotifierWavSoundPath() {return prefs->notifierSoundFilePath;}
CString GetIRCNick() {return (CString)prefs->m_sircnick;}
void SetIRCNick( char in_nick[] ) { strcpy(prefs->m_sircnick,in_nick);}
CString GetIRCServer() {return (CString)prefs->m_sircserver;}
void SetIRCServer( char in_serv[] ) { strcpy(prefs->m_sircserver,in_serv);}
bool GetIRCAddTimestamp() {return prefs->m_bircaddtimestamp;}
void SetIRCAddTimestamp( bool flag ) {prefs->m_bircaddtimestamp = flag;}
CString GetIRCChanNameFilter() {return (CString)prefs->m_sircchannamefilter;}
bool GetIRCUseChanFilter() {return prefs->m_bircusechanfilter;}
uint16 GetIRCChannelUserFilter() {return prefs->m_iircchanneluserfilter;}
void SetIRCChanNameFilter( char in_name[] ) { strcpy(prefs->m_sircchannamefilter,in_name);}
void SetIRCUseChanFilter( bool flag ) {prefs->m_bircusechanfilter = flag;}
void SetIRCChanUserFilter( uint16 in_user) {prefs->m_iircchanneluserfilter = in_user;}
CString GetIrcPerformString() {return (CString)prefs->m_sircperformstring;}
bool GetIrcUsePerform() {return prefs->m_bircuseperform;}
bool GetIRCListOnConnect() {return prefs->m_birclistonconnect;}
void SetIRCListonConnect( bool flag ) {prefs->m_birclistonconnect = flag;}
void SetIRCPerformString( char in_perf[] ) { strcpy(prefs->m_sircperformstring, in_perf);}
void SetIrcUsePerform( bool flag ) {prefs->m_bircuseperform = flag;}
bool GetIrcAcceptLinks() {return prefs->m_bircacceptlinks;}
void SetIrcAcceptLInks( bool flag ) {prefs->m_bircacceptlinks = flag;}
bool GetIrcIgnoreInfoMessage() {return prefs->m_bircignoreinfomessage;}
void SetIrcIgnoreInfoMessage( bool flag ) {prefs->m_bircignoreinfomessage = flag;}
bool GetIrcIgnoreEmuleProtoInfoMessage() {return prefs->m_bircignoreemuleprotoinfomessage;}
void SetIrcIgnoreEmuleProtoInfoMessage( bool flag ) {prefs->m_bircignoreemuleprotoinfomessage = flag;}
WORD GetWindowsVersion();
bool GetStartMinimized() {return prefs->startMinimized;}
void SetStartMinimized( bool instartMinimized) {prefs->startMinimized = instartMinimized;}
bool GetSmartIdCheck() {return prefs->smartidcheck;}
void SetSmartIdCheck( bool in_smartidcheck ) {prefs->smartidcheck = in_smartidcheck;}
uint8 GetSmartIdState() {return prefs->smartidstate;}
void SetSmartIdState( uint8 in_smartidstate ) {prefs->smartidstate = in_smartidstate;}
bool GetVerbose() {return prefs->m_bVerbose;}
bool GetPreviewPrio() {return prefs->m_bpreviewprio;}
void SetPreviewPrio(bool in) {prefs->m_bpreviewprio=in;}
bool GetUpdateQueueList() {return prefs->m_bupdatequeuelist;}
bool GetManualHighPrio() {return prefs->m_bmanualhighprio;}
bool TransferFullChunks() {return prefs->m_btransferfullchunks;}
void SetTransferFullChunks( bool m_bintransferfullchunks ) {prefs->m_btransferfullchunks = m_bintransferfullchunks;}
bool StartNextFile() {return prefs->m_bstartnextfile;}
bool ShowOverhead() {return prefs->m_bshowoverhead;}
void SetNewAutoUp(bool m_bInUAP) {prefs->m_bUAP = m_bInUAP;}
bool GetNewAutoUp() {return prefs->m_bUAP;}
void SetNewAutoDown(bool m_bInDAP) {prefs->m_bDAP = m_bInDAP;}
bool GetNewAutoDown() {return prefs->m_bDAP;}
bool IsKnownClientListDisabled() {return prefs->m_bDisableKnownClientList;}
bool IsQueueListDisabled() {return prefs->m_bDisableQueueList;}
bool IsFirstStart() {return prefs->m_bFirstStart;}
bool UseCreditSystem() {return prefs->m_bCreditSystem;}
void SetCreditSystem(bool m_bInCreditSystem) {prefs->m_bCreditSystem = m_bInCreditSystem;}
char* GetTxtEditor() {return prefs->TxtEditor;}
CString GetVideoPlayer() {if (strlen(prefs->VideoPlayer)==0) return ""; else return CString(prefs->VideoPlayer);}
uint32 GetFileBufferSize() {return prefs->m_iFileBufferSize*15000;}
uint32 GetQueueSize() {return prefs->m_iQueueSize*100;}
// Barry
uint16 Get3DDepth() { return prefs->depth3D;}
bool AutoTakeED2KLinks() {return prefs->autotakeed2klinks;}
bool AddNewFilesPaused() {return prefs->addnewfilespaused;}
void SetStatsColor(int index,DWORD value) {prefs->statcolors[index]=value;}
DWORD GetStatsColor(int index) {return prefs->statcolors[index];}
void SetMaxConsPerFive(int in) {prefs->MaxConperFive=in;}
uint16 GetMaxConperFive() {return prefs->MaxConperFive;}
uint16 GetDefaultMaxConperFive();
void ResetStatsColor(int index);
bool IsSafeServerConnectEnabled() {return prefs->safeServerConnect;}
void SetSafeServerConnectEnabled(bool in){prefs->safeServerConnect=in;}
bool IsMoviePreviewBackup() {return prefs->moviePreviewBackup;}
// quick-speed changer [xrmb]
void SetMaxUpload(uint16 in) {prefs->maxupload =in;};
void SetMaxDownload(uint16 in) {prefs->maxdownload=in; };
WINDOWPLACEMENT GetEmuleWindowPlacement() {return prefs->EmuleWindowPlacement; }
void SetWindowLayout(WINDOWPLACEMENT in) {prefs->EmuleWindowPlacement=in; }
CStringList shareddir_list;
CStringList adresses_list;
void SetLanguage();
int8 AutoConnectStaticOnly() {return prefs->autoconnectstaticonly;}
int8 GetUpdateDays() {return prefs->versioncheckdays;}
uint32 GetLastVC() {return prefs->versioncheckLastAutomatic;}
void UpdateLastVC() {prefs->versioncheckLastAutomatic=mktime(CTime::GetCurrentTime().GetLocalTm());}
int GetIPFilterLevel() { return prefs->filterlevel;}
CString GetMessageFilter() { return CString(prefs->messageFilter);}
CString GetCommentFilter() { return CString(prefs->commentFilter);}
bool ShowRatesOnTitle() { return prefs->showRatesInTitle;}
char* GetNotifierConfiguration() {return prefs->notifierConfiguration;}; //<<-- enkeyDEV(kei-kun) -skinnable notifier-
void SetNotifierConfiguration(CString configFullPath) {sprintf(prefs->notifierConfiguration,configFullPath); } //<<-- enkeyDEV(kei-kun) -skinnable notifier-
void LoadCats();
CString GetDateTimeFormat() { return CString(prefs->datetimeformat);}
// Download Categories (Ornis)
int AddCat(Category_Struct* cat) { catMap.Add(cat); return catMap.GetCount()-1;}
void RemoveCat(int index);
int GetCatCount() { return catMap.GetCount();}
Category_Struct* GetCategory(int index) { if (index>=0 && index<catMap.GetCount()) return catMap.GetAt(index); else return NULL;}
char* GetCatPath(uint8 index) { return catMap.GetAt(index)->incomingpath;}
DWORD GetCatColor(uint8 index) { if (index>=0 && index<catMap.GetCount()) return catMap.GetAt(index)->color; else return 0;}
bool ShowRatingIndicator() { return prefs->indicateratings;}
bool ShowAllNotCats() { return prefs->showAllNotCats;}
bool WatchClipboard4ED2KLinks() { return prefs->watchclipboard;}
void InvertShowAllNotCats() { prefs->showAllNotCats=!prefs->showAllNotCats; }
bool FilterServerByIP() { return prefs->filterserverbyip;}
bool Log2Disk() { return prefs->log2disk;}
bool Debug2Disk() { return prefs->debug2disk;}
// WebServer
uint16 GetWSPort() { return prefs->m_nWebPort; }
void SetWSPort(uint16 uPort) { prefs->m_nWebPort=uPort; }
CString GetWSPass() { return CString(prefs->m_sWebPassword); }
void SetWSPass(CString strNewPass) { sprintf(prefs->m_sWebPassword,"%s",MD5Sum(strNewPass).GetHash().GetBuffer(0)); }
bool GetWSIsEnabled() { return prefs->m_bWebEnabled; }
void SetWSIsEnabled(bool bEnable) { prefs->m_bWebEnabled=bEnable; }
bool GetWebUseGzip() { return prefs->m_bWebUseGzip; }
void SetWebUseGzip(bool bUse) { prefs->m_bWebUseGzip=bUse; }
int GetWebPageRefresh() { return prefs->m_nWebPageRefresh; }
void SetWebPageRefresh(int nRefresh) { prefs->m_nWebPageRefresh=nRefresh; }
bool GetWSIsLowUserEnabled() { return prefs->m_bWebLowEnabled; }
void SetWSIsLowUserEnabled(bool in) { prefs->m_bWebLowEnabled=in; }
CString GetWSLowPass() { return CString(prefs->m_sWebLowPassword); }
void SetWSLowPass(CString strNewPass) { sprintf(prefs->m_sWebLowPassword,"%s",MD5Sum(strNewPass).GetHash().GetBuffer(0)); }
CString GetWSResDir() { return CString(prefs->m_sWebResDir);}
void SetMaxSourcesPerFile(uint16 in) { prefs->maxsourceperfile=in;}
void SetMaxConnections(uint16 in) { prefs->maxconnections =in;}
bool IsSchedulerEnabled() { return prefs->scheduler;}
bool GetDontCompressAvi() { return prefs->dontcompressavi;}
bool MsgOnlyFriends() { return prefs->msgonlyfriends;}
bool MsgOnlySecure() { return prefs->msgsecure;}
uint16 GetMsgSessionsMax() { return prefs->maxmsgsessions;}
protected:
void CreateUserHash();
void SetStandartValues();
static int GetRecommendedMaxConnections();
private:
char* appdir;
Preferences_Struct* prefs;
Preferences_Ext_Struct* prefsExt;
Preferences_Import19c_Struct* prefsImport19c;
Preferences_Import20a_Struct* prefsImport20a;
Preferences_Import20b_Struct* prefsImport20b;
char userhash[16];
WORD m_wWinVer;
void LoadPreferences();
void SavePreferences();
CArray<Category_Struct*,Category_Struct*> catMap;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -