void MainFrame::SurChangementOngletRuban( wxRibbonBarEvent& event ) { if(m_ribbonBar1->GetActivePage() == 1) { //On remet immédiatement le 1er onglet m_ribbonBar1->SetActivePage((std::size_t)0); //Lancement de l'aide wxFileName exeFileName(wxStandardPaths::Get().GetExecutablePath()); wxLaunchDefaultBrowser("file:///" + exeFileName.GetPath() + "/aide.html"); } }
void CAudioFormatDlg::OnVolume() { // Ver 1.1 if (waveInGetNumDevs() == 0) { //CString msgstr; //msgstr.Format("Unable to detect audio input device. You need a sound card with microphone input."); //MessageBox(msgstr,"Note", MB_OK | MB_ICONEXCLAMATION); MessageOut(this->m_hWnd,IDS_STRING_NOINPUT1 ,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION); return; } TCHAR dirx[300]; GetWindowsDirectory(dirx,300); CString Windir(dirx); //Test Windows\sndvol32.exe CString exeFileName("\\sndvol32.exe"); CString AppDir = Windir; CString SubDir = ""; CString testLaunchPath = AppDir + SubDir + exeFileName; CString launchPath(""); if (launchPath == "") { //Verify sndvol32.exe exists OFSTRUCT ofs; HFILE hdir = OpenFile(testLaunchPath, &ofs, OF_EXIST); if (hdir != HFILE_ERROR) { launchPath=testLaunchPath; } CloseHandle((HANDLE)hdir); } if (launchPath == "") { //Test Windows\system32\sndvol32.exe //Verify sndvol32.exe exists SubDir = "\\system32"; testLaunchPath = AppDir + SubDir + exeFileName; OFSTRUCT ofs; HFILE hdir = OpenFile(testLaunchPath, &ofs,OF_EXIST); if (hdir != HFILE_ERROR) { launchPath = testLaunchPath; } CloseHandle((HANDLE)hdir); } if (launchPath == "") { //Test Windows\system\sndvol32.exe //Verify sndvol32.exe exists SubDir = "\\system32"; testLaunchPath = AppDir + SubDir + exeFileName; OFSTRUCT ofs; HFILE hdir = OpenFile(testLaunchPath, &ofs,OF_EXIST); if (hdir != HFILE_ERROR) { launchPath = testLaunchPath; } CloseHandle((HANDLE)hdir); } if (launchPath != "") { //launch Volume Control //not sure launchPath = launchPath + " /r /rec /record"; if (WinExec(launchPath,SW_SHOW) != 0) { } else { //MessageBox("Error launching Volume Control!","Note",MB_OK | MB_ICONEXCLAMATION); MessageOut(this->m_hWnd,IDS_STRING_ERRVOLCTRL1 ,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION); } } // Sound mixer moved in Windows Vista! check new exe name only if windows version matches OSVERSIONINFO osinfo; osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); if (GetVersionEx((LPOSVERSIONINFO) &osinfo)) { if (osinfo.dwMajorVersion >= 6) //Vista { testLaunchPath = AppDir + SubDir + "\\SndVol.exe"; OFSTRUCT ofs; HFILE hdir = OpenFile(testLaunchPath, &ofs, OF_EXIST); if (hdir != HFILE_ERROR) { launchPath=testLaunchPath; } } } if (launchPath != "") { //launch Volume Control //not sure launchPath = launchPath + " /r /rec /record"; if (WinExec(launchPath,SW_SHOW) != 0) { } else { //MessageBox("Error launching Volume Control!","Note",MB_OK | MB_ICONEXCLAMATION); MessageOut(this->m_hWnd,IDS_STRING_ERRVOLCTRL1 ,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION); } } }
void preferenceDialog::on_buttonBox_clicked(QAbstractButton* button) { if (ui->buttonBox->buttonRole(button)==QDialogButtonBox::HelpRole) { hlpDlg=new helpDialog(this); rphMPFEhelp hlp; switch(ui->stackedWidget->currentIndex()) { case 0:hlpDlg->setHelpText(hlp.playerhlpstr); hlpDlg->show(); break; case 1:hlpDlg->setHelpText(hlp.audiohlpstr); hlpDlg->show(); break; case 2:hlpDlg->setHelpText(hlp.videohlpstr); hlpDlg->show(); break; case 3:hlpDlg->setHelpText(hlp.subtitlehlpstr); hlpDlg->show(); break; case 4:hlpDlg->setHelpText(hlp.internethlpstr); hlpDlg->show(); break; case 5:hlpDlg->setHelpText(hlp.keyboardhlpstr); hlpDlg->show(); break; case 6:hlpDlg->setHelpText(hlp.mousehlpstr); hlpDlg->show(); break; } } if (ui->buttonBox->buttonRole(button)==QDialogButtonBox::ApplyRole) apply=false; if(!apply) {if(ui->buttonBox->buttonRole(button)==QDialogButtonBox::ApplyRole) {qDebug("setting"); switch(ui->stackedWidget->currentIndex()) { case 0:emit settingChanged("General","Priority",ui->comboBox->currentText()); emit settingChanged("Skin","style",ui->comboBoxStyle->currentText()); emit disableSS(); emit settingChanged("General","recentFilesClear",QString::number(ui->checkBoxRemrm->checkState())); if (ui->comboBoxStyle->currentText()=="wood") QApplication::setStyle(new NorwegianWoodStyle); else if(ui->comboBoxStyle->currentText()=="aqua") emit setAqua(); else qApp->setStyle(ui->comboBoxStyle->currentText()); //if(ui->comboBoxStyle->currentText()!="windowsxp"&&ui->comboBoxStyle->currentText()!="aqua") QApplication::setPalette(QApplication::style()->standardPalette()); emit restartComplete(); break; case 1:{ emit settingChanged("Audio","EnableEQ",QString::number(ui->cbEnableAEq->checkState())); emit settingChanged("Audio","Driver",ui->cmbAO->currentText()); emit settingChanged("Audio","DevNo",QString::number(ui->cmbAO->currentIndex())); emit settingChanged("Audio","VolumeBoost",QString::number(ui->hSliderVolumeBoost->value())); emit restartComplete(); break; } case 2: emit restartComplete(); break; case 3 :{AssStyles ass; //qDebug()<<ui->texcol->palette().color(QPalette::Base).toRgb().value(); ass.primarycolor=ui->texcol->palette().color(QPalette::Base).rgb(); ass.backcolor=ui->shcol->palette().color(QPalette::Base).rgb(); ass.outlinecolor=ui->borcol->palette().color(QPalette::Base).rgb(); ass.fontname=ui->fontComboBox->currentFont().family(); ass.fontsize=ui->spinBoxFs->value(); ass.bold=ui->checkBoxBold->isChecked(); ass.italic=ui->checkBoxItalic->isChecked(); ass.valignment=ui->comboBoxVa->currentIndex(); ass.halignment=ui->comboBoxHa->itemData(ui->comboBoxHa->currentIndex()).toInt(); ass.save(_settings); ass.exportStyles(Paths::configPath()+"/styles.ass"); emit settingChanged("Subtitles","UseCodePage",QString::number(ui->checkBoxUseCodePage->checkState())); emit settingChanged("Subtitles","CodePage",ui->comboBoxSubEncoding->currentText()); #ifdef Q_OS_WIN //Open fontconfig //Calculate Sha1 //QStringList fontConfLst; /*QByteArray hashData; QFile inputFile(qApp->applicationDirPath()+"/mplayer/fonts/fonts.conf"); if (inputFile.open(QIODevice::ReadOnly)) { QByteArray fileData = inputFile.readAll(); hashData = QCryptographicHash::hash(fileData, QCryptographicHash::Sha1); } qDebug() << hashData.toHex(); QMessageBox::critical(this,QString(hashData.toHex()),"gfd"); QString actHash="c8ba9d01342f8488c815fb5e63e96f53ba9f46fb";*/ // if ( QString(hashData.toHex())!=actHash) //{ // qDebug() << "Differnt font config"; QString exeFileName(qApp->applicationDirPath()+"/exmplayer-font-cache.exe"); int result = (int)::ShellExecuteA(0, "open", exeFileName.toUtf8().constData(), 0, 0, SW_HIDE); if (SE_ERR_ACCESSDENIED == result) { // Requesting elevation(Windows Vista/Window7/window8) result = (int)::ShellExecuteA(0, "runas", exeFileName.toUtf8().constData(), 0, 0, SW_HIDE); } //c8ba9d01342f8488c815fb5e63e96f53ba9f46fb /*if (inputFile.open(QIODevice::ReadOnly)) { QTextStream in(&inputFile); while ( !in.atEnd() ) { fontConfLst<< in.readLine(); } inputFile.close(); } if(fontConfLst.filter(QRegExp(".*<dir></dir>")).count()==1) { fontConfLst.replaceInStrings("<dir></dir>","<dir>WINDOWSFONTDIR</dir>"); qDebug()<<fontConfLst; QFile outFile(qApp->applicationDirPath()+"/mplayer/fonts/fonts.conf"); if (outFile.open(QFile::WriteOnly|QFile::Truncate)) { foreach (QString fontConfig, fontConfLst) { outFile.write(fontConfig.toAscii()+"\n"); } } else { //What to do? (Beta) // QMessageBox::critical(this,"Error","failed to open file for writing"); } outFile.close(); }*/ #endif emit restartComplete(); break; } case 4:{ emit settingChanged("Network","ipv",ui->cmbiv->currentText()); emit settingChanged("Network","Bandwidth",QString::number(ui->sbNetBw->value())); emit settingChanged("Network","cache",QString::number(ui->sbNetCache->value())); emit settingChanged("Network","seekmin",QString::number(ui->sbseekmin->value())); emit settingChanged("Network","cachemin",QString::number(ui->sbNetCachemin->value())); break; } case 5:if( !resetsc) {saveActionToXml(); //emit reloadshortcut(); QMessageBox::information(this,qApp->applicationName(),tr("Shortcut will be active after a restart."),QMessageBox::Ok,QMessageBox::Cancel); } break; case 6: {emit settingChanged("Mouse","Wheel",QString::number(mw)); emit setmousewheelrole(); break; } case 7:settingChanged("Updates","Automatic",QString::number(ui->checkUpdates->isChecked())); } } } apply=true; if(ui->buttonBox->buttonRole(button)==QDialogButtonBox::AcceptRole) this->close(); }
void AudioFormat::OnVolume() { // Ver 1.1 if (waveInGetNumDevs() == 0) { CString msgstr; msgstr.Format("Unable to detect audio input device. You need a sound card with microphone input."); MessageBox(msgstr,"Note", MB_OK | MB_ICONEXCLAMATION); return; } CString launchPath(""); CString testLaunchPath; CString exeFileName("\\sndvol32.exe"); char dirx[300]; GetWindowsDirectory(dirx,300); CString Windir(dirx); CString AppDir; CString SubDir; //Test Windows\sndvol32.exe AppDir = Windir; SubDir = ""; testLaunchPath=AppDir+SubDir+exeFileName; if (launchPath=="") { //Verify sndvol32.exe exists OFSTRUCT ofs; HFILE hdir = OpenFile(testLaunchPath, &ofs,OF_EXIST); if (hdir != HFILE_ERROR) { launchPath=testLaunchPath; } } //Test Windows\system32\sndvol32.exe AppDir = Windir; SubDir = "\\system32"; testLaunchPath=AppDir+SubDir+exeFileName; if (launchPath=="") { //Verify sndvol32.exe exists OFSTRUCT ofs; HFILE hdir = OpenFile(testLaunchPath, &ofs,OF_EXIST); if (hdir != HFILE_ERROR) { launchPath=testLaunchPath; //need CloseHandle ? //BOOL ret = CloseHandle((HANDLE) hdir); //if (!ret) MessageBox("Close handle Fails","Note",MB_OK | MB_ICONEXCLAMATION); } } //Test Windows\system\sndvol32.exe AppDir = Windir; SubDir = "\\system32"; testLaunchPath=AppDir+SubDir+exeFileName; if (launchPath=="") { //Verify sndvol32.exe exists OFSTRUCT ofs; HFILE hdir = OpenFile(testLaunchPath, &ofs,OF_EXIST); if (hdir != HFILE_ERROR) { launchPath=testLaunchPath; } } if (launchPath!="") { //launch Volume Control //not sure launchPath = launchPath + " /r /rec /record"; if (WinExec(launchPath,SW_SHOW)!=0) { } else { MessageBox("Error launching Volume Control!","Note",MB_OK | MB_ICONEXCLAMATION); } } }