void WelcomeDialog::on_webView_linkClicked(const QUrl& url) { CString strUrl = url.toString(); strUrl.MakeLower(); CString strStart("http://wiz.cn/cmd/"); if (strUrl.startsWith(strStart)) { strUrl.remove(0, strStart.length()); if (strUrl == "view_guide") { QDesktopServices::openUrl(QUrl("http://www.wiz.cn/")); } else if (strUrl == "create_account") { CreateAccountDialog dlg(this); if (QDialog::Accepted != dlg.exec()) return; QString strUserId = dlg.userId(); QString strPassword = dlg.password(); ui->comboUsers->insertItem(0, strUserId); ui->comboUsers->setCurrentIndex(0); ui->editPassword->setText(strPassword); } } else { QDesktopServices::openUrl(url); } }
bool CWizFolder::CanMove(const CString& strSrcLocation, const CString& strDestLocation) const { if (m_db.GetDeletedItemsLocation() == strSrcLocation) return false; if (strDestLocation.startsWith(strSrcLocation)) return false; return true; }
TKey CApplication::getKeyCode(const CString& keycode) { // Ça commence mal... if (!keycode.startsWith("Key_")) { return Key_Unknown; } CString str = keycode.subString(4); // Chiffres if (str == "0") return Key_0; if (str == "1") return Key_1; if (str == "2") return Key_2; if (str == "3") return Key_3; if (str == "4") return Key_4; if (str == "5") return Key_5; if (str == "6") return Key_6; if (str == "7") return Key_7; if (str == "8") return Key_8; if (str == "9") return Key_9; // Chiffres (pavé numérique) if (str == "Num0") return Key_Num0; if (str == "Num1") return Key_Num1; if (str == "Num2") return Key_Num2; if (str == "Num3") return Key_Num3; if (str == "Num4") return Key_Num4; if (str == "Num5") return Key_Num5; if (str == "Num6") return Key_Num6; if (str == "Num7") return Key_Num7; if (str == "Num8") return Key_Num8; if (str == "Num9") return Key_Num9; // Lettres if (str == "A") return Key_A; if (str == "B") return Key_B; if (str == "C") return Key_C; if (str == "D") return Key_D; if (str == "E") return Key_E; if (str == "F") return Key_F; if (str == "G") return Key_G; if (str == "H") return Key_H; if (str == "I") return Key_I; if (str == "J") return Key_J; if (str == "K") return Key_K; if (str == "L") return Key_L; if (str == "M") return Key_M; if (str == "N") return Key_N; if (str == "O") return Key_O; if (str == "P") return Key_P; if (str == "Q") return Key_Q; if (str == "R") return Key_R; if (str == "S") return Key_S; if (str == "T") return Key_T; if (str == "U") return Key_U; if (str == "V") return Key_V; if (str == "W") return Key_W; if (str == "X") return Key_X; if (str == "Y") return Key_Y; if (str == "Z") return Key_Z; // Autres caractères ASCII if (str == "Space" ) return Key_Space; if (str == "Exclam" ) return Key_Exclam; if (str == "Paragraph" ) return Key_Paragraph; if (str == "BracketRight") return Key_BracketRight; if (str == "ParenRight" ) return Key_ParenRight; if (str == "Degree" ) return Key_Degree; if (str == "Comma" ) return Key_Comma; if (str == "Question" ) return Key_Question; if (str == "Colon" ) return Key_Colon; if (str == "Slash" ) return Key_Slash; if (str == "Semicolon" ) return Key_Semicolon; if (str == "Less" ) return Key_Less; if (str == "Greater" ) return Key_Greater; if (str == "Equal" ) return Key_Equal; if (str == "Plus" ) return Key_Plus; if (str == "BraceRight" ) return Key_BraceRight; if (str == "Euro" ) return Key_Euro; if (str == "TwoSuperior" ) return Key_TwoSuperior; if (str == "At" ) return Key_At; if (str == "Ampersand" ) return Key_Ampersand; if (str == "Tilde" ) return Key_Tilde; if (str == "QuoteDbl" ) return Key_QuoteDbl; if (str == "Apostrophe" ) return Key_Apostrophe; if (str == "BraceLeft" ) return Key_BraceLeft; if (str == "ParenLeft" ) return Key_ParenLeft; if (str == "BracketLeft" ) return Key_BracketLeft; if (str == "Minus" ) return Key_Minus; if (str == "Bar" ) return Key_Bar; if (str == "Quote" ) return Key_Quote; if (str == "Underscore" ) return Key_Underscore; if (str == "Backslash" ) return Key_Backslash; if (str == "Dollar" ) return Key_Dollar; if (str == "Sterling" ) return Key_Sterling; if (str == "Circum" ) return Key_Circum; if (str == "Asterisk" ) return Key_Asterisk; if (str == "Mu" ) return Key_Mu; if (str == "Percent" ) return Key_Percent; if (str == "Add" ) return Key_Add; if (str == "Subtract" ) return Key_Subtract; if (str == "Divide" ) return Key_Divide; if (str == "Multiply" ) return Key_Multiply; // Touches spéciales if (str == "LAlt" ) return Key_LAlt; if (str == "RAlt" ) return Key_RAlt; if (str == "LControl") return Key_LControl; if (str == "RControl") return Key_RControl; if (str == "LShift" ) return Key_LShift; if (str == "RShift" ) return Key_RShift; if (str == "LMeta" ) return Key_LMeta; if (str == "RMeta" ) return Key_RMeta; if (str == "Menu" ) return Key_Menu; if (str == "Print" ) return Key_Print; if (str == "Pause" ) return Key_Pause; if (str == "Tab" ) return Key_Tab; if (str == "Backspace" ) return Key_Backspace; if (str == "Enter" ) return Key_Enter; if (str == "NumEnter" ) return Key_NumEnter; if (str == "Insert" ) return Key_Insert; if (str == "Delete" ) return Key_Delete; if (str == "Home" ) return Key_Home; if (str == "End" ) return Key_End; if (str == "PageUp" ) return Key_PageUp; if (str == "PageDown" ) return Key_PageDown; if (str == "Left" ) return Key_Left; if (str == "Up" ) return Key_Up; if (str == "Right" ) return Key_Right; if (str == "Down" ) return Key_Down; if (str == "CapsLock" ) return Key_CapsLock; if (str == "NumLock" ) return Key_NumLock; if (str == "ScrollLock") return Key_ScrollLock; if (str == "Function" ) return Key_Function; if (str == "Escape" ) return Key_Escape; // Fonctions if (str == "F1" ) return Key_F1; if (str == "F2" ) return Key_F2; if (str == "F3" ) return Key_F3; if (str == "F4" ) return Key_F4; if (str == "F5" ) return Key_F5; if (str == "F6" ) return Key_F6; if (str == "F7" ) return Key_F7; if (str == "F8" ) return Key_F8; if (str == "F9" ) return Key_F9; if (str == "F10") return Key_F10; if (str == "F11") return Key_F11; if (str == "F12") return Key_F12; if (str == "F13") return Key_F13; if (str == "F14") return Key_F14; if (str == "F15") return Key_F15; return Key_Unknown; }
bool CWizDatabase::IsInDeletedItems(const CString& strLocation) { return strLocation.startsWith(GetDeletedItemsLocation()); }
static PEData* OpenPE(const CString& path, bool prompt) { PEData* ret = GetPEData(path); if (ret != NULL) return ret; int len = path.getLength(); int p1 = path.lastIndexOf('/') + 1; int p2 = path.lastIndexOf('.'); if (p1 > p2) return NULL; CString ext = path.substring(p2, len - p2).toUpper(), ext2; if (ext.startsWith(".EX")) { ext2 = ".EXE"; } else if (ext.startsWith(".DL")) { ext2 = ".DLL"; } else { return NULL; } ret = new PEData(); ret->Name = path.substring(p1, p2 - p1) + ext2; ret->Path = path; if (path.endsWith("2")) { ret->Data = monapi_call_file_decompress_bz2_file(path, prompt); } else if (path.endsWith("5")) { ret->Data = monapi_call_file_decompress_st5_file(path, prompt); } else { ret->Data = monapi_file_read_all(path); } if (ret->Data == NULL) { delete ret; return NULL; } if (!ret->Parser.Parse(ret->Data->data(), ret->Data->size())) { if (prompt) _printf("%s: file is not valid PE: %s\n", SVR, (const char*)path); // ret->Data->unmap(); delete ret->Data; ret->Data = NULL; } #ifndef NO_CACHE // For now, we assume DLL is not replaced online. if (isDLL(ret)) { cache.add(ret); } #endif return ret; }
bool CWizDatabase::IsInDeletedItems(const CString& strLocation) { return strLocation.startsWith(LOCATION_DELETED_ITEMS); }