void VSCMainWindows::SetupConnections() { connect(m_pMainArea, SIGNAL(tabCloseRequested(int)), this, SLOT(MainCloseTab(int))); connect(m_pDeviceList, SIGNAL(SurveillanceClicked()), this, SLOT(AddSurveillance())); connect(m_pDeviceList, SIGNAL(CameraAddClicked()), this, SLOT(AddCamera())); connect(m_pDeviceList, SIGNAL(PlaybackClicked()), this, SLOT(AddPlayback())); connect(m_pDeviceList, SIGNAL(SearchClicked()), this, SLOT(Search())); connect(m_pDeviceList, SIGNAL(RecorderClicked()), this, SLOT(AddRecorder())); connect(m_pDeviceList, SIGNAL(SiteAddClicked()), this, SLOT(AddSite())); connect(m_pDeviceList, SIGNAL(CameraEditClicked(int)), this, SLOT(EditCamera(int))); connect(m_pDeviceList, SIGNAL(CameraDeleteClicked(int)), this, SLOT(DeleteCamera(int))); connect(m_pDeviceList, SIGNAL(SiteEditClicked(int)), this, SLOT(EditSite(int))); connect(m_pDeviceList, SIGNAL(SiteDeleteClicked(int)), this, SLOT(DeleteSite(int))); /* Disk edit */ connect(m_pDeviceList, SIGNAL(DiskEditClicked()), this, SLOT(EditDisk())); //connect(this, SIGNAL(CameraDeleted()), m_pDeviceList, SLOT(CameraTreeUpdated())); connect(m_pToolBar->ui.pbFullScreen, SIGNAL(clicked()), this, SLOT(SetFullScreen())); connect(m_pToolBar->ui.pbAbout, SIGNAL(clicked()), this, SLOT(about())); connect(m_pToolBar->ui.pbAlarm, SIGNAL(clicked()), this, SLOT(AddEvent())); connect(m_pToolBar->ui.pbSetting, SIGNAL(clicked()), this, SLOT(Setting())); connect(m_pEventThread, SIGNAL(EventNotifyNoParam()), m_pToolBar, SLOT(NewAlarm())); }
void ReplayList::LoadPlaybacks(const std::vector<std::string>& filenames) { m_replays.clear(); for (size_t i = 0; i < filenames.size(); ++i) { StoredGame& playback = AddPlayback(i); GetReplayInfos(filenames[i], playback); } }
void PlaybackTab<PlaybackTraits>::AddAllPlaybacks( wxCommandEvent& /*unused*/ ) { const typename ListType::playback_map_t& replays = playbacklist<ListType>().GetPlaybacksMap(); for ( typename ListType::playback_const_iter_t i = replays.begin();i != replays.end();++i ) { AddPlayback( i->second ); } m_replay_listctrl->SortList( true ); }
void PlaybackTab::AddAllPlaybacks(wxCommandEvent& /*unused*/) { assert(wxThread::IsMain()); const auto& replays = replaylist().GetPlaybacksMap(); for (auto i = replays.begin(); i != replays.end(); ++i) { AddPlayback(i->second, false); } m_replay_dataview->Resort(); }
void SavegameList::LoadPlaybacks(const std::vector<std::string>& filenames) { m_replays.clear(); const size_t size = filenames.size(); for (size_t i = 0; i < size; ++i) { const std::string fn = filenames[i]; StoredGame& rep_ref = AddPlayback(i); if (!GetSavegameInfos(fn, rep_ref)) { RemovePlayback(rep_ref.id); } } }
void ReplayList::LoadPlaybacks(const std::vector<std::string> &filenames ) { std::string datadir; m_replays.clear(); const size_t size = filenames.size(); for ( size_t i = 0; i < size; ++i) { const wxString wfilename = TowxString(filenames[i]); PlaybackType& playback = AddPlayback(i); if (!GetReplayInfos(wfilename, playback)) { //wxLogError(_T("Couldn't open replay %s"), wfilename.c_str() ); //FIXME, see https://github.com/springlobby/springlobby/issues/186 RemovePlayback(i); //FIXME: stupid logic: always add but remove on fail, why not add on success only? } } }
void PlaybackTab<PlaybackTraits>::UpdatePlayback( const PlaybackType& replay ) { if ( m_filter->GetActiv() && !m_filter->FilterPlayback( replay ) ) { RemovePlayback( replay ); return; } int index = m_replay_listctrl->GetIndexFromData( &replay ); if ( index != -1 ) m_replay_listctrl->RefreshItem( index ); else AddPlayback( replay ); }
void PlaybackTab::UpdatePlayback(const StoredGame& replay) { if (m_filter->GetActiv() && !m_filter->FilterPlayback(replay)) { RemovePlayback(replay); return; } bool contains = m_replay_dataview->ContainsItem(replay); if (contains) { m_replay_dataview->RefreshItem(replay); } else { AddPlayback(replay); } }
void ReplayList::LoadPlaybacks( const wxArrayString& filenames ) { m_fails = 0; m_replays.clear(); size_t size = filenames.GetCount(); for ( size_t i = 0; i < size; ++i) { Replay& rep_ref = AddPlayback( i ); // don't touch this reference, since elements inside this data structure are filled using pointers, adding & not fecthing the new addresses would screw up references when rep gets destroyed if ( !GetReplayInfos( filenames[i] , rep_ref ) ) { RemovePlayback( rep_ref.id ); m_fails++; } } }