void sipXTabbedCodecPage::OnSelect(wxCommandEvent &event) { wxArrayInt selections; UtlString s; int index; if (!mbCodecByName) { int numSels = mpCodecList->GetSelections(selections); if (numSels) { mCodecName = ""; for (int i=0; i<numSels; i++) { s = mpCodecList->GetString(selections[i]); if ((index = s.index(" ")) != UTL_NOT_FOUND) { // Only get name up to first space s = s.remove(index, s.length() - index); } mCodecName = mCodecName + s + " "; } mbCodecByName = true; mpCodecPref->Append("By name:"); mpCodecPref->SetSelection(3); mCodecPref = 3; sipXmgr::getInstance().setAudioCodecByName((const char *)mCodecName.data()); rebuildCodecList(0); } } }
void Editor::addEncoding() { #ifndef QT_NO_FILEDIALOG QString fn = QFileDialog::getOpenFileName( QString::null, "*.map", this ); if ( !fn.isEmpty() ) { QFile f(fn); if (f.open(IO_ReadOnly)) { if (QTextCodec::loadCharmap(&f)) { rebuildCodecList(); } else { QMessageBox::warning(0,"Charmap error", "The file did not contain a valid charmap.\n\n" "A charmap file should look like this:\n" " <code_set_name> thename\n" " <escape_char> /\n" " % alias thealias\n" " CHARMAP\n" " <tokenname> /x12 <U3456>\n" " <tokenname> /xAB/x12 <U0023>\n" " ...\n" " END CHARMAP\n" ); } } } #endif }
Editor::Editor( QWidget * parent , const char * name ) : QWidget( parent, name, WDestructiveClose ) { m = new QMenuBar( this, "menu" ); QPopupMenu * file = new QPopupMenu(); Q_CHECK_PTR( file ); m->insertItem( "&File", file ); file->insertItem( "&New", this, SLOT(newDoc()), ALT+Key_N ); file->insertItem( "&Open...", this, SLOT(load()), ALT+Key_O ); file->insertItem( "&Save...", this, SLOT(save()), ALT+Key_S ); file->insertSeparator(); open_as = new QPopupMenu(); file->insertItem( "Open &As", open_as ); save_as = new QPopupMenu(); file->insertItem( "Sa&ve As", save_as ); file->insertItem( "Add &Encoding", this, SLOT(addEncoding()) ); #ifndef QT_NO_PRINTER file->insertSeparator(); file->insertItem( "&Print...", this, SLOT(print()), ALT+Key_P ); #endif file->insertSeparator(); file->insertItem( "&Close", this, SLOT(close()),ALT+Key_W ); file->insertItem( "&Quit", qApp, SLOT(closeAllWindows()), ALT+Key_Q ); connect( save_as, SIGNAL(activated(int)), this, SLOT(saveAsEncoding(int)) ); connect( open_as, SIGNAL(activated(int)), this, SLOT(openAsEncoding(int)) ); rebuildCodecList(); QPopupMenu * edit = new QPopupMenu(); Q_CHECK_PTR( edit ); m->insertItem( "&Edit", edit ); edit->insertItem( "To &Uppercase", this, SLOT(toUpper()), ALT+Key_U ); edit->insertItem( "To &Lowercase", this, SLOT(toLower()), ALT+Key_L ); #ifndef QT_NO_FONTDIALOG edit->insertSeparator(); edit->insertItem( "&Select Font" , this, SLOT(font()), ALT+Key_T ); #endif changed = FALSE; e = new QMultiLineEdit( this, "editor" ); connect( e, SIGNAL( textChanged() ), this, SLOT( textChanged() ) ); // We use Unifont - if you have it installed you'll see all // Unicode character glyphs. // // Unifont only comes in one pixel size, so we cannot let // it change pixel size as the display DPI changes. // QFont unifont("unifont",16,50); unifont.setPixelSize(16); e->setFont( unifont ); e->setFocus(); }
void sipXTabbedCodecPage::OnDblClick(wxCommandEvent &event) { if (!mbCodecByName) { int sel = event.GetSelection(); mbCodecByName = true; mCodecName = mpCodecList->GetStringSelection(); mpCodecPref->Append("By name:"); mpCodecPref->SetSelection(3); mCodecPref = 3; sipXmgr::getInstance().setAudioCodecByName((const char *)mCodecName.data()); rebuildCodecList(0); } }
void sipXTabbedCodecPage::OnBandwidthChange(wxCommandEvent &event) { int sel = event.GetSelection(); if (mbCodecByName && sel < 3) { // Delete 'By name:' entry in drop-down list mpCodecPref->Delete(3); mbCodecByName = false; } if (mpCodecList && sel < 3) { sipXmgr::getInstance().setCodecPreferences(sel + 1); mCodecPref = sel; rebuildCodecList(sel); } }
void sipXAudioPage::setData() { UtlString mCodecName = sipXezPhoneSettings::getInstance().getSelectedAudioCodecs(); mCodecPref = sipXezPhoneSettings::getInstance().getCodecPref() - 1; if (mCodecPref == 3) { mbCodecByName = true; mpCodecPref->Append("By name:"); } mpCodecPref->SetSelection(mCodecPref); mOrigCodecPref = mCodecPref; mOrigCodecName = mCodecName; rebuildCodecList(mCodecPref); mpDtmf->SetValue(sipXezPhoneSettings::getInstance().getEnableOOBDTMF()); mpEcho->SetValue(sipXezPhoneSettings::getInstance().getEnableAEC()); mbInitialized = true; }