feat: 优化触发器配置体验
- 根据触发器类型动态展示对应配置区域,减少无关字段干扰。 - 将单次、每日、每周、每月和生效时间范围改为日期选择器与时分秒下拉选择,避免手动输入时间格式。 - 为单次执行增加延后执行快捷设置,支持常用快捷按钮和自定义分钟、小时、天后执行。 - 移除开机自启设置、注册表写入逻辑和相关配置字段,降低对用户系统的影响。 - 同步优化部分任务状态、触发摘要和设置界面文案。
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using Forms = System.Windows.Forms;
|
||||
|
||||
namespace OmniScheduler;
|
||||
@@ -102,7 +104,16 @@ public partial class MainWindow : Window, INotifyPropertyChanged
|
||||
}
|
||||
|
||||
private void TasksGrid_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
=> EditTask_Click(sender, e);
|
||||
{
|
||||
var row = FindVisualParent<DataGridRow>(e.OriginalSource as DependencyObject);
|
||||
if (row?.Item is not ScheduledTask task)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SelectedTask = task;
|
||||
EditTask_Click(sender, e);
|
||||
}
|
||||
|
||||
private void DeleteTask_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
@@ -148,7 +159,6 @@ public partial class MainWindow : Window, INotifyPropertyChanged
|
||||
{
|
||||
if (SettingsWindow.Edit(this, State.Settings))
|
||||
{
|
||||
StartupRegistration.Apply(State.Settings.StartWithWindows);
|
||||
SaveAndRefresh("设置已保存");
|
||||
}
|
||||
}
|
||||
@@ -222,4 +232,19 @@ public partial class MainWindow : Window, INotifyPropertyChanged
|
||||
_allowExit = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private static T? FindVisualParent<T>(DependencyObject? child) where T : DependencyObject
|
||||
{
|
||||
while (child is not null)
|
||||
{
|
||||
if (child is T parent)
|
||||
{
|
||||
return parent;
|
||||
}
|
||||
|
||||
child = VisualTreeHelper.GetParent(child);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user