Ejemplo n.º 1
0
const char* Cpyfileselect::FolderSelectionDlg(TCommonDialogType dialogType,
		TDesC& memory, const TDesC& heading, const TDesC& rightRoot, const TDesC& left)
	{
	TFileName folder;
	folder.Append(memory);
	// Create select folder dialog
	CAknFileSelectionDialog* dlg = CAknFileSelectionDialog::NewL(dialogType);

	// some dialog customizations:
	dlg->SetTitleL(heading);
	dlg->SetRightSoftkeyRootFolderL(rightRoot); // for root folder
	dlg->SetLeftSoftkeyFileL(left);
	//dlg->SetLeftSoftkeyFolderL(left);
	TBool result = EFalse;
	if (dlg->ExecuteL(folder))
		{
		// we got our folder and finish loop
		result = ETrue;
		}

	delete dlg;

	if (result)
		{
		return descriptorToStringL(folder);
		}

	char* emptystring = new (ELeave) char[1];
	emptystring[0] = '\0';
	return emptystring;
	}
Ejemplo n.º 2
0
void CFileSelectionSettingItem::EditItemL(TBool /*aCalledFromMenu*/)
{
	// Select memory
	CAknMemorySelectionDialog* memSelectionDialog = CAknMemorySelectionDialog::NewL
		(ECFDDialogTypeNormal, /*aShowUnavailableDrives*/EFalse);
	CleanupStack::PushL(memSelectionDialog);

	CAknMemorySelectionDialog::TMemory mem(CAknMemorySelectionDialog::EPhoneMemory);

	TInt ret = memSelectionDialog->ExecuteL(mem);
	CleanupStack::PopAndDestroy(memSelectionDialog);
	if (!ret) return;

	CAknFileSelectionDialog* fileSelectionDialog = 
		CAknFileSelectionDialog::NewL(iDialogType);	
	CleanupStack::PushL(fileSelectionDialog);
	
	fileSelectionDialog->SetTitleL(_L("Download files to"));
	fileSelectionDialog->SetLeftSoftkeyFileL(_L("Select"));	
	
	if (mem == CAknMemorySelectionDialog::EMemoryCard)	
		iOwnedFileName = _L("E:\\");
	else
		iOwnedFileName = _L("C:\\");

	// launch file select dialog
	TBool result = fileSelectionDialog->ExecuteL(iOwnedFileName);
	CleanupStack::PopAndDestroy(); // fileSelectionDialog
	
	if (result)
		iFileName = iOwnedFileName;
}
void CFileSelectionSettingItem::EditItemL(TBool /*aCalledFromMenu*/)
{
    // Select drive
    CAknMemorySelectionDialogMultiDrive* memSelectionDialog = CAknMemorySelectionDialogMultiDrive::NewL
            (ECFDDialogTypeNormal, /*aShowUnavailableDrives*/EFalse);
    CleanupStack::PushL(memSelectionDialog);

    TDriveNumber mem;
    TFileName memRootPath;

    TInt ret = memSelectionDialog->ExecuteL(mem, &iOwnedFileName, NULL);
    CleanupStack::PopAndDestroy(memSelectionDialog);
    if (!ret) return;

    // Select file on the selected drive
    CAknFileSelectionDialog* fileSelectionDialog =
        CAknFileSelectionDialog::NewL(iDialogType);
    CleanupStack::PushL(fileSelectionDialog);

    fileSelectionDialog->SetTitleL(_L("Download files to"));
    fileSelectionDialog->SetLeftSoftkeyFileL(_L("Select"));

    // launch file select dialog
    TBool result = fileSelectionDialog->ExecuteL(iOwnedFileName);
    CleanupStack::PopAndDestroy(fileSelectionDialog);

    if (result)
        iFileName = iOwnedFileName;
}