Clip::~Clip() { emit unloaded( this ); delete m_childs; if ( isRootClip() == true ) delete m_media; }
void CUnitSync::unload() { if (IsLoaded) { m_UnInit(); IsLoaded = false; Mods.clear(); emit(unloaded()); } }
void ClipboardBrowser::connectModelAndDelegate() { Q_ASSERT(&m != model()); // set new model QAbstractItemModel *oldModel = model(); setModel(&m); delete oldModel; // delegate for rendering and editing items setItemDelegate(&d); connect( &m, SIGNAL(dataChanged(QModelIndex,QModelIndex)), SLOT(onDataChanged(QModelIndex,QModelIndex)) ); connect( &m, SIGNAL(tabNameChanged(QString)), SLOT(onTabNameChanged(QString)) ); connect( &m, SIGNAL(unloaded()), SLOT(onModelUnloaded()) ); // update on change connect( &m, SIGNAL(rowsInserted(QModelIndex, int, int)), SLOT(onModelDataChanged()) ); connect( &m, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), SLOT(onModelDataChanged()) ); connect( &m, SIGNAL(rowsInserted(QModelIndex, int, int)), SLOT(onItemCountChanged()) ); connect( &m, SIGNAL(rowsRemoved(QModelIndex,int,int)), SLOT(onItemCountChanged()) ); connect( &m, SIGNAL(rowsAboutToBeMoved(QModelIndex, int, int, QModelIndex, int)), SLOT(onModelDataChanged()) ); connect( &m, SIGNAL(dataChanged(QModelIndex,QModelIndex)), SLOT(onModelDataChanged()) ); connect( &d, SIGNAL(rowSizeChanged()), SLOT(updateCurrentPage()) ); connect( &m, SIGNAL(rowsInserted(QModelIndex, int, int)), &d, SLOT(rowsInserted(QModelIndex, int, int)) ); connect( &m, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), &d, SLOT(rowsRemoved(QModelIndex,int,int)) ); connect( &m, SIGNAL(rowsAboutToBeMoved(QModelIndex, int, int, QModelIndex, int)), &d, SLOT(rowsMoved(QModelIndex, int, int, QModelIndex, int)) ); connect( &m, SIGNAL(dataChanged(QModelIndex,QModelIndex)), &d, SLOT(dataChanged(QModelIndex,QModelIndex)) ); updateCurrentPage(); }
void ClipboardModel::unloadItems() { emit unloaded(); removeRows(0, rowCount()); }
void CMainWindow::connectSignals() { CChatManager *Manager = CChatManager::instance(); CNetworkClient *Network = CNetworkClient::instance(); CBattleManager *BattleManager = CBattleManager::instance(); connect(ui->ChatTabWidget->tabBar(), SIGNAL(tabCloseRequested(int)), Manager, SLOT(closeChannel(int))); connect(ui->ChatTabWidget->tabBar(), SIGNAL(currentChanged(int)), Manager, SLOT(changeCurrentChannel(int))); connect(ui->ChatTabWidget->tabBar(), SIGNAL(tabMoved(int,int)), Manager, SLOT(moveChannel(int,int))); connect(Manager, SIGNAL(joined(CChannel*)), this, SLOT(createTab(CChannel*))); connect(Manager, SIGNAL(closeTab(int)), this, SLOT(removeTab(int))); connect(Manager, SIGNAL(currentChanged(CChannel*)), ui->ChatTabWidget->chatView(), SLOT(loadChannel(CChannel*))); connect(ui->ChannelsView, SIGNAL(doubleClicked(QModelIndex)), CChatManager::instance(), SLOT(doubleClicked(QModelIndex))); connect(ui->ChannelUserView, SIGNAL(doubleClicked(QModelIndex)), CUserManager::instance()->chatModel(), SLOT(doubleClicked(QModelIndex))); connect(ui->actionChatSend, SIGNAL(triggered()), this, SLOT(sendChat())); connect(ui->actionBattleSend, SIGNAL(triggered()), this, SLOT(sendBattle())); connect(Manager, SIGNAL(currentChanged(int)), ui->ChatTabWidget->tabBar(), SLOT(setCurrentIndex(int))); connect(ui->BattleListView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), CBattleManager::instance(), SLOT(battleSelected(QModelIndex))); connect(ui->BattleListView, SIGNAL(doubleClicked(QModelIndex)), CBattleManager::instance(), SLOT(doubleClicked(QModelIndex))); connect(ui->BattlePreviewView, SIGNAL(doubleClicked(QModelIndex)), CBattleManager::instance()->battlePreviewModel(), SLOT(doubleClicked(QModelIndex))); connect(ui->actionConnect, SIGNAL(triggered()), this, SLOT(showConnectDialog())); connect(&ConnectDialog, SIGNAL(connect(QString,int,QString,QString)), Network, SLOT(connectToServer(QString,int,QString,QString))); connect(Network, SIGNAL(disconnected()), this, SLOT(networkDisconnected())); connect(Network, SIGNAL(connected()), this, SLOT(networkConnected())); connect(Network, SIGNAL(multiplayerDisabled()), this, SLOT(disableMultiplayerGUI())); connect(Network, SIGNAL(multiplayerEnabled()), this, SLOT(enableMultiplayerGUI())); connect(ui->actionDisconnect, SIGNAL(triggered()), Network, SLOT(disconnect())); connect(CBattleManager::instance(), SIGNAL(currentMapChanged(CMap*)), ui->MapInfo, SLOT(setMap(CMap*))); connect(CBattleroomManager::instance(), SIGNAL(mapChanged(CMap*)), ui->BattleMapInfo, SLOT(setMap(CMap*))); connect(CBattleroomManager::instance(), SIGNAL(updateChat(CChannel*)), ui->BattleChatText, SLOT(loadChannel(CChannel*))); connect(CBattleroomManager::instance(), SIGNAL(error(int,QString)), this, SLOT(error(int,QString))); connect(ui->LeaveBattleButton, SIGNAL(clicked()), CBattleroomManager::instance(), SLOT(leaveBattle())); connect(ui->DownloadButton, SIGNAL(clicked()), this, SLOT(execDownload())); connect(ui->actionDeleteDownload, SIGNAL(triggered()), this, SLOT(removeDownload())); connect(ui->actionDownloadMap, SIGNAL(triggered()), BattleManager, SLOT(downloadMapForBattle())); connect(ui->actionDownloadMod, SIGNAL(triggered()), BattleManager, SLOT(downloadModForBattle())); connect(ui->DownloadView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showDownloadContextMenu(QPoint))); connect(ui->BattleListView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showBattleContextMenu(QPoint))); connect(Network, SIGNAL(error(int,QString)), this, SLOT(error(int,QString))); connect(CDownloadManager::instance(), SIGNAL(error(int,QString)), this, SLOT(error(int,QString))); connect(Manager, SIGNAL(error(int,QString)), this, SLOT(error(int,QString))); connect(CDownloadManager::instance(), SIGNAL(error(int,QString)), this, SLOT(error(int,QString))); connect(Network, SIGNAL(agreement(QString)), this, SLOT(showAgreement(QString))); connect(ui->actionReloadUnitSync, SIGNAL(triggered()), CUnitSync::instance(), SLOT(reload())); connect(CUnitSync::instance(), SIGNAL(error(int,QString)), this, SLOT(error(int,QString))); connect(CUserManager::instance(), SIGNAL(lobbyUserBattleStatusChanged(CBattleStatus*)), this, SLOT(updateBattleStatus(CBattleStatus*))); connect(CUnitSync::instance(), SIGNAL(loaded()), this, SLOT(unitsyncLoaded())); connect(CUnitSync::instance(), SIGNAL(unloaded()), this, SLOT(unitsyncUnloaded())); connect(ui->actionUpdateStatus, SIGNAL(triggered()), this, SLOT(changeBattleStatus())); connect(CBattleroomManager::instance(), SIGNAL(battleJoined(CBattle*)), this, SLOT(enableBattleroom(CBattle*))); connect(CBattleroomManager::instance(), SIGNAL(battleClosed()), this, SLOT(disableBattleroom())); connect(CBattleroomManager::instance(), SIGNAL(gameStarted()), this, SLOT(lockBattleroom())); connect(CBattleroomManager::instance(), SIGNAL(gameEnded()), this, SLOT(unlockBattleroom())); connect(CBattleroomManager::instance(), SIGNAL(battleStarted()), this, SLOT(onBattleStarted())); connect(CBattleroomManager::instance(), SIGNAL(battleEnded()), this, SLOT(onBattleEnded())); connect(ui->SelectColorButton, SIGNAL(clicked()), this, SLOT(selectColor())); connect(ui->StartBattleButton, SIGNAL(clicked()), CBattleroomManager::instance(), SLOT(startGame())); connect(&ColorDialog, SIGNAL(colorSelected(QColor)), this, SLOT(colorSelected(QColor))); }