Exemple #1
0
INT_PTR CDownloadSheet::DoModal()
{
	ASSUME_LOCK( Transfers.m_pSection );

	CTorrentFilesPage		pFiles;
	CTorrentTrackersPage	pTrackers;
	CTorrentGeneralPage		pGeneral;
	CDownloadEditPage		pDownload;
	CDownloadActionsPage	pActions;

	if ( m_pDownload->IsTorrent() )
	{
		SetTabTitle( &pFiles, m_sFilesTitle );
		AddPage( &pFiles );
		SetTabTitle( &pTrackers, m_sTrackersTitle );
		AddPage( &pTrackers );
		SetTabTitle( &pGeneral, m_sGeneralTitle );
		AddPage( &pGeneral );
	}

	if ( ! m_pDownload->IsMoving() && ! m_pDownload->IsCompleted() )
	{
		SetTabTitle( &pDownload, m_sDownloadTitle );
		AddPage( &pDownload );
		SetTabTitle( &pActions, m_sActionsTitle );
		AddPage( &pActions );
	}

	return CPropertySheetAdv::DoModal();
}
Exemple #2
0
static void SwapTabs(WindowInfo* win, int tab1, int tab2) {
    if (tab1 == tab2 || tab1 < 0 || tab2 < 0)
        return;

    std::swap(win->tabs.at(tab1), win->tabs.at(tab2));
    SetTabTitle(win, win->tabs.at(tab1));
    SetTabTitle(win, win->tabs.at(tab2));

    int current = TabCtrl_GetCurSel(win->hwndTabBar);
    if (tab1 == current)
        TabCtrl_SetCurSel(win->hwndTabBar, tab2);
    else if (tab2 == current)
        TabCtrl_SetCurSel(win->hwndTabBar, tab1);
}
Exemple #3
0
// Refresh the tab's title
void TabsOnChangedDoc(WindowInfo* win) {
    TabInfo* tab = win->currentTab;
    CrashIf(!tab != !win->tabs.size());
    if (!tab)
        return;

    CrashIf(win->tabs.Find(tab) != TabCtrl_GetCurSel(win->hwndTabBar));
    VerifyTabInfo(win, tab);
    SetTabTitle(win, tab);
}
INT_PTR CFilePropertiesSheet::DoModal(int nPage)
{
    CFileGeneralPage	pGeneral;
    CFileMetadataPage	pMetadata;
    CFileCommentsPage	pComments;
    CFileSharingPage	pSharing;
    CFileSourcesPage	pSources;

    CString strTabLabel;

    switch ( m_pList->GetCount() )
    {
    case 0:
        return IDCANCEL;
    case 1:
        SetTabTitle( &pGeneral, m_sGeneralTitle );
        AddPage( &pGeneral );
        SetTabTitle( &pMetadata, m_sMetadataTitle );
        AddPage( &pMetadata );
        SetTabTitle( &pComments, m_sCommentsTitle );
        AddPage( &pComments );
        SetTabTitle( &pSharing, m_sSharingTitle );
        AddPage( &pSharing );
        SetTabTitle( &pSources, m_sSourcesTitle );
        AddPage( &pSources );
        break;
    default:
        SetTabTitle( &pMetadata, m_sMetadataTitle );
        AddPage( &pMetadata );
        SetTabTitle( &pComments, m_sCommentsTitle );
        AddPage( &pComments );
        SetTabTitle( &pSharing, m_sSharingTitle );
        AddPage( &pSharing );
        if ( nPage == 1 ) nPage = 0;
        else if ( nPage == 2 ) nPage = 1;
        break;
    }

    m_psh.nStartPage = nPage;
    INT_PTR nRes = CPropertySheetAdv::DoModal();

    Settings.Save();

    return nRes;
}