Skip to content

Commit

Permalink
Update OMERO.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
BiologyTools committed Jan 20, 2025
1 parent 7e6a75b commit bc4ce81
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Source/OMERO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ protected OMERO(Builder builder, IntPtr handle) : base(handle)

private void UploadMenu_ButtonPressEvent(object o, ButtonPressEventArgs args)
{
files.Clear();
FileChooserDialog filechooser = new FileChooserDialog("Choose files to import.", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "OK", ResponseType.Accept);
filechooser.SelectMultiple = true;
if (filechooser.Run() != (int)ResponseType.Accept)
Expand Down Expand Up @@ -115,7 +116,7 @@ public static void StartUpload()
uploading = true;
Thread th = new Thread(UpdateProgress);
th.Start();
BioLib.OMERO.Upload(BioImage.OpenFile(f), dataset, id);
BioLib.OMERO.Upload(BioImage.OpenFile(f), id);
uploading = false;
prog.Hide();
prog.Destroy();
Expand All @@ -132,6 +133,7 @@ public static void UpdateProgress()

private void View_DragDataReceived(object o, DragDataReceivedArgs args)
{
files.Clear();
// Convert the received data to a string
string receivedData = System.Text.Encoding.UTF8.GetString(args.SelectionData.Data);

Expand All @@ -142,10 +144,10 @@ private void View_DragDataReceived(object o, DragDataReceivedArgs args)
if (Uri.TryCreate(uri, UriKind.Absolute, out Uri fileUri) && fileUri.IsFile)
{
string filePath = fileUri.LocalPath;
BioLib.OMERO.Upload(BioImage.OpenFile(filePath), dataset, id);
files.Add(filePath);
}
}

StartUpload();
args.RetVal = true; // Indicate the drop was handled
}

Expand Down

0 comments on commit bc4ce81

Please sign in to comment.