int BfBootDRI::NObjBfTaskUpdateFw::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { typedef Domain::NamedObject QMocSuperClass; _id = QMocSuperClass::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: Init((*reinterpret_cast< QString(*)>(_a[1]))); break; case 1: SetFirmware((*reinterpret_cast< QString(*)>(_a[1]))); break; case 2: Run((*reinterpret_cast< DRI::IAsyncCmd*(*)>(_a[1]))); break; default: ; } _id -= 3; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< bool*>(_v) = m_checkAfter; break; } _id -= 1; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: m_checkAfter = *reinterpret_cast< bool*>(_v); break; } _id -= 1; } else if (_c == QMetaObject::ResetProperty) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 1; } #endif // QT_NO_PROPERTIES return _id; }
MainFrame::MainFrame(wxApp* a, const wxString& title) : wxFrame(NULL, -1, title, wxDefaultPosition, wxSize(560, 590)) { app = a; Centre(); #ifdef WIN32 SetIcon(wxICON(fon_flash_icon)); #endif panel = new ImagePanel(this); testThread = NULL; gargoyle_conf = get_gargoyle_configuration(); fonera_conf = get_fonera_configuration(); ddwrt_conf = get_ddwrt_configuration(); current_conf = NULL; wxArrayString* firmwareTypes = new wxArrayString(); firmwareTypes->Add(wxT("OpenWrt / Gargoyle")); firmwareTypes->Add(wxT("Fonera Firmware")); firmwareTypes->Add(wxT("DD-WRT")); wxStaticText *firmwareLabel = new wxStaticText(panel,-1,wxT("Select Firmware Type:"),wxPoint(3,30)); firmwareChoice = new wxChoice(panel, SELECT_FIRMWARE_ID, wxPoint(3,50), wxSize(195,25), *firmwareTypes, 0, wxDefaultValidator); firmwareChoice->SetSelection(0); wxArrayString *devChoiceNames = new wxArrayString(); devNames = new wxArrayString(); pcap_if_t *alldevs; pcap_if_t *d; char errbuf[PCAP_ERRBUF_SIZE]; pcap_findalldevs(&alldevs, errbuf); int selectedDevIndex = 0; int nextDevIndex = 0; for(d= alldevs; d != NULL; d= d->next) { if(strstr(d->name, "lo") != d->name) { if (d->description) { wxString s = wxString::FromAscii(d->description); devChoiceNames->Add( wxString::FromAscii(d->description), 1); if(strstr(d->description, "VPN") != NULL && selectedDevIndex == nextDevIndex) { selectedDevIndex++; } } else { devChoiceNames->Add(wxString::FromAscii(d->name), 1); } devNames->Add(wxString::FromAscii(d->name), 1); nextDevIndex++; } } if(selectedDevIndex == nextDevIndex) { selectedDevIndex = 0; } wxStaticText *interfaceLabel = new wxStaticText(panel,-1,wxT("Select Network Interface:"),wxPoint(5,115)); #ifdef WIN32 interfaceChoice = new wxChoice(panel, -1, wxPoint(5,135), wxSize(450,25), *devChoiceNames, 0, wxDefaultValidator); #else interfaceChoice = new wxChoice(panel, -1, wxPoint(5,135), wxSize(195,25), *devChoiceNames, 0, wxDefaultValidator); #endif interfaceChoice->SetSelection(selectedDevIndex); file1Label = new wxStaticText(panel,-1,wxT("Select File 1:"),wxPoint(5,185), wxSize(200, 20)); file1Text = new wxTextCtrl( panel, 5, wxString(wxT("")), wxPoint(5, 205), wxSize(450, 25), 0); file1Button = new wxButton(panel, FILE1_BROWSE_BUTTON_ID, wxT("Browse"), wxPoint(455,205), wxSize(85, 25)); file2Label = new wxStaticText(panel,-1,wxT("Select File 2:"),wxPoint(5,250), wxSize(200, 20)); file2Text = new wxTextCtrl( panel, 5, wxString(wxT("")), wxPoint(5, 270), wxSize(450, 25), 0); file2Button = new wxButton(panel, FILE2_BROWSE_BUTTON_ID, wxT("Browse"), wxPoint(455,270), wxSize(85, 25)); file3Label = new wxStaticText(panel,-1,wxT("Select File 3:"),wxPoint(5,315), wxSize(200, 20)); file3Text = new wxTextCtrl( panel, 5, wxString(wxT("")), wxPoint(5, 335), wxSize(450, 25), 0); file3Button = new wxButton(panel, FILE3_BROWSE_BUTTON_ID, wxT("Browse"), wxPoint(455,335), wxSize(85, 25)); outputText = new wxTextCtrl( panel, 5, wxString(wxT("")), wxPoint(5, 380), wxSize(535, 130), wxTE_READONLY | wxTE_MULTILINE); startButton = new wxButton(panel, FLASH_ROUTER_BUTTON_ID, wxT("Flash Router Now!"), wxPoint(75,520), wxSize(400, 25)); wxCommandEvent evt; SetFirmware(evt); }