diff --git a/TwitchDownloaderWPF/PageQueue.xaml b/TwitchDownloaderWPF/PageQueue.xaml
index 31733e35..1f8431cb 100644
--- a/TwitchDownloaderWPF/PageQueue.xaml
+++ b/TwitchDownloaderWPF/PageQueue.xaml
@@ -87,7 +87,17 @@
-
+
+
+
+
+
diff --git a/TwitchDownloaderWPF/PageQueue.xaml.cs b/TwitchDownloaderWPF/PageQueue.xaml.cs
index 47ce873f..a12fee62 100644
--- a/TwitchDownloaderWPF/PageQueue.xaml.cs
+++ b/TwitchDownloaderWPF/PageQueue.xaml.cs
@@ -290,9 +290,12 @@ private static void RemoveTask(TwitchTask task)
return;
}
- if (!taskList.Remove(task))
+ lock (taskLock)
{
- MessageBox.Show(Application.Current.MainWindow!, Translations.Strings.TaskCouldNotBeRemoved, Translations.Strings.UnknownErrorOccurred, MessageBoxButton.OK, MessageBoxImage.Error);
+ if (!taskList.Remove(task))
+ {
+ MessageBox.Show(Application.Current.MainWindow!, Translations.Strings.TaskCouldNotBeRemoved, Translations.Strings.UnknownErrorOccurred, MessageBoxButton.OK, MessageBoxImage.Error);
+ }
}
}
@@ -333,5 +336,39 @@ private static void RetryTask(TwitchTask task)
task.Reinitialize();
}
}
+
+ private void BtnMoveTaskUp_Click(object sender, RoutedEventArgs e)
+ {
+ if (sender is not Button { DataContext: TwitchTask task })
+ {
+ return;
+ }
+
+ lock (taskLock)
+ {
+ var index = taskList.IndexOf(task);
+ if (index < 1)
+ return;
+
+ taskList.Move(index, index - 1);
+ }
+ }
+
+ private void BtnMoveTaskDown_Click(object sender, RoutedEventArgs e)
+ {
+ if (sender is not Button { DataContext: TwitchTask task })
+ {
+ return;
+ }
+
+ lock (taskLock)
+ {
+ var index = taskList.IndexOf(task);
+ if (index == -1 || index == taskList.Count - 1)
+ return;
+
+ taskList.Move(index, index + 1);
+ }
+ }
}
}