示例#1
0
void CrateFeature::activateCrate(int crateId) {
    //qDebug() << "CrateFeature::activateCrate()" << crateId;
    QModelIndex index = indexFromCrateId(crateId);
    if (crateId != -1 && index.isValid()) {
        m_crateTableModel.setTableModel(crateId);
        emit(showTrackModel(&m_crateTableModel));
        emit(enableCoverArtDisplay(true));
        // Update selection
        emit(featureSelect(this, m_lastRightClickedIndex));
        activateChild(m_lastRightClickedIndex);
    }
}
示例#2
0
void CrateFeature::slotImportPlaylist() {
    //qDebug() << "slotImportPlaylist() row:" ; //<< m_lastRightClickedIndex.data();

    QString playlist_file = getPlaylistFile();
    if (playlist_file.isEmpty()) return;

    // Update the import/export crate directory
    QFileInfo fileName(playlist_file);
    m_pConfig->set(ConfigKey("[Library]","LastImportExportCrateDirectory"),
                   ConfigValue(fileName.dir().absolutePath()));

    slotImportPlaylistFile(playlist_file);
    activateChild(m_lastRightClickedIndex);
}
void ChatContainer::addChild(ChatWindow *child) {
	TCITEM tci;
	int tabId;
	HWND hwndTabs = GetDlgItem(hWnd, IDC_TABS);
	childCount++;
	tci.mask = TCIF_TEXT | TCIF_PARAM;
	tci.pszText = (char *)child->getRoomName();
	tci.lParam = (LPARAM) child;
	tabId = TabCtrl_InsertItem(hwndTabs, childCount-1, &tci);
	TabCtrl_SetCurSel(hwndTabs, tabId);
	activateChild(child);
	SendMessage(hWnd, WM_SIZE, 0, 0);
	ShowWindow(hWnd, SW_SHOWNORMAL);
	SetForegroundWindow(hWnd);
}
void ChatContainer::removeChild(ChatWindow *child) {
	HWND hwndTabs = GetDlgItem(hWnd, IDC_TABS);
	int iSel = getChildTab(child);
	if (iSel >= 0) {
		TabCtrl_DeleteItem(hwndTabs, iSel);
	}
	childCount--;
	if (childCount > 0) {
		TCITEM tci;
		if (iSel == childCount) iSel--;
		TabCtrl_SetCurSel(hwndTabs, iSel);
		tci.mask = TCIF_PARAM;
		if (TabCtrl_GetItem(hwndTabs, iSel, &tci)) {
			child = (ChatWindow *)tci.lParam;
			activateChild(child);
		}
	} else {//if (!released) {
		SendMessage(hWnd, WM_CLOSE, 0, 0);
	}
}