Beispiel #1
0
//---------------------------------------------------------------------------
void __fastcall TLocationProfilesDialog::DirectoryEditChange(TObject * /*Sender*/)
{
  if (!FChanging)
  {
    FindProfile();
    UpdateControls();
    FBookmarkSelected = false;
  }
}
Beispiel #2
0
//---------------------------------------------------------------------------
void __fastcall TLocationProfilesDialog::SetRemoteDirectory(UnicodeString value)
{
  if (RemoteDirectory != value)
  {
    RemoteDirectoryEdit->Text = value;
    FindProfile();
    UpdateControls();
  }
}
 static void MergeProfileInfo(ProfileNodeInfo &info)
 {
     OSEnterMutex(hProfilerMutex);
     ProfileNodeInfo *sum = FindProfile(info.lpName);
     if(!sum)
     {
         sum = profilerData.CreateNew();
         sum->lpName = info.lpName;
     }
     sum->MergeProfileInfo(&info, info.lastCall, sum->lastCall + info.lastCall);
     OSLeaveMutex(hProfilerMutex);
 }
int ReplaceList::AddProfile(wchar_t *profile)
{
	int i = FindProfile(profile);
	if (i >= 0) return i;

	if (numLists % 16 == 0)
		lists = (ReplaceSubList*) realloc(lists, sizeof(ReplaceSubList) * (numLists+16));
	i = numLists ++;
	memset(lists+i, 0, sizeof(lists[i]));
	wcscpy(lists[i].profile, profile);
	return i;
}
Beispiel #5
0
void ProfileBox::OnProfileSave() {
	QString name = GetProfileName();
	if(name.isEmpty())
		return;
	QString filename = GetApplicationUserDir(m_type) + "/" + name + ".conf";
	if(MessageBox(QMessageBox::Warning, this, MainWindow::WINDOW_CAPTION, tr("Are you sure that you want to overwrite this profile?"), BUTTON_YES | BUTTON_NO, BUTTON_YES) == BUTTON_YES) {
		{
			QSettings settings(filename, QSettings::IniFormat);
			m_save_callback(&settings, m_userdata);
		}
		LoadProfiles();
		SetProfile(FindProfile(name));
		UpdateProfileFields();
	}
}
Beispiel #6
0
void ProfileBox::OnProfileNew() {
	QString name = InputBox(this, MainWindow::WINDOW_CAPTION, tr("Enter a name for the new profile:"), "");
	if(name.isEmpty())
		return;
	name = name.toAscii().toPercentEncoding();
	QString filename = GetApplicationUserDir(m_type) + "/" + name + ".conf";
	if(!QFileInfo(filename).exists() || MessageBox(QMessageBox::Warning, this, MainWindow::WINDOW_CAPTION,
			tr("A profile with the same name already exists. Are you sure that you want to replace it?"), BUTTON_YES | BUTTON_NO, BUTTON_YES) == BUTTON_YES) {
		{
			QSettings settings(filename, QSettings::IniFormat);
			m_save_callback(&settings, m_userdata);
		}
		LoadProfiles();
		SetProfile(FindProfile(name));
		UpdateProfileFields();
	}
}
Beispiel #7
0
//---------------------------------------------------------------------------
void __fastcall TLocationProfilesDialog::ProfilesViewChange(
  TObject * /*Sender*/, TTreeNode * Node)
{
  if (Node && Node->Data)
  {
    assert(!FChanging);
    FChanging = true;
    try
    {
      LocalDirectoryEdit->Text = ((TBookmark *)Node->Data)->Local;
      RemoteDirectoryEdit->Text = ((TBookmark *)Node->Data)->Remote;
    }
    __finally
    {
      FChanging = false;
    }
    // try to locate the same profile in the other set
    FindProfile();
    FBookmarkSelected = true;
  }
void UDeviceProfileManager::LoadProfiles()
{
	if( !HasAnyFlags( RF_ClassDefaultObject ) )
	{
		TArray< FString > DeviceProfileMapArray;
		GConfig->GetArray(TEXT("DeviceProfiles"), TEXT("DeviceProfileNameAndTypes"), DeviceProfileMapArray, DeviceProfileFileName);

		for (int32 DeviceProfileIndex = 0; DeviceProfileIndex < DeviceProfileMapArray.Num(); ++DeviceProfileIndex)
		{
			FString NewDeviceProfileSelectorPlatformName;
			FString NewDeviceProfileSelectorPlatformType;
			DeviceProfileMapArray[DeviceProfileIndex].Split(TEXT(","), &NewDeviceProfileSelectorPlatformName, &NewDeviceProfileSelectorPlatformType);

			if (FindObject<UDeviceProfile>(GetTransientPackage(), *NewDeviceProfileSelectorPlatformName) == NULL)
			{
				CreateProfile(NewDeviceProfileSelectorPlatformName, NewDeviceProfileSelectorPlatformType);
			}
		}

#if WITH_EDITOR
		if (!FPlatformProperties::RequiresCookedData())
		{
			// Register Texture LOD settings with each Target Platform
			ITargetPlatformManagerModule& TargetPlatformManager = GetTargetPlatformManagerRef();
			const TArray<ITargetPlatform*>& TargetPlatforms = TargetPlatformManager.GetTargetPlatforms();
			for (int32 PlatformIndex = 0; PlatformIndex < TargetPlatforms.Num(); ++PlatformIndex)
			{
				ITargetPlatform* Platform = TargetPlatforms[PlatformIndex];
				if (const UTextureLODSettings* TextureLODSettingsObj = (UTextureLODSettings*)&FindProfile(*Platform->GetPlatformInfo().VanillaPlatformName.ToString()))
				{
					// Set TextureLODSettings
					Platform->RegisterTextureLODSettings(TextureLODSettingsObj);
				}
			}
		}
#endif

		ManagerUpdatedDelegate.Broadcast();
	}
}
Beispiel #9
0
//---------------------------------------------------------------------------
void __fastcall TLocationProfilesDialog::FormShow(TObject * /*Sender*/)
{
  if (Terminal)
  {
    // cache session key, in case terminal is closed while the window is open
    FSessionKey = Terminal->SessionData->SessionKey;
    // WORKAROUND
    // Has to load this only now (not in Execute before ShowModal),
    // when the trees are finally (re)created,
    // otherwise the references in *Folders would be invalid already
    LoadBookmarks(SessionProfilesView, FSessionFolders, FSessionBookmarkList, WinConfiguration->Bookmarks[FSessionKey]);
    LoadBookmarks(SharedProfilesView, FSharedFolders, FSharedBookmarkList, WinConfiguration->SharedBookmarks);
    #ifdef _DEBUG
    FSessionProfilesViewHandle = SessionProfilesView->Handle;
    FSharedProfilesViewHandle = SharedProfilesView->Handle;
    #endif
  }
  if (Mode == odAddBookmark)
  {
    AddAsBookmark(GetProfilesSheet(), true);
  }

  InstallPathWordBreakProc(LocalDirectoryEdit);
  InstallPathWordBreakProc(RemoteDirectoryEdit);

  FindProfile();
  if (OperationSide == osLocal)
  {
    ActiveControl = LocalDirectoryEdit;
  }
  else
  {
    ActiveControl = RemoteDirectoryEdit;
  }
  UpdateControls();
}
Beispiel #10
0
//---------------------------------------------------------------------------
void __fastcall TLocationProfilesDialog::FindProfile()
{
  FindProfile(SessionProfilesView);
  FindProfile(SharedProfilesView);
}
void ReplaceList::DeleteString(wchar_t *old, wchar_t *profile)
{
	int i = FindProfile(profile);
	if (i >= 0)
		lists[i].DeleteString(old);
}