[Phase L6] 런처 워크플로우 자동화 확장 완료
MacroEntry/MacroStep 모델 (AppSettings.Models.cs):
- MacroEntry: Id, Name, Description, Steps, CreatedAt
- MacroStep: Type(app/url/folder/notification/cmd), Target, Args, Label, DelayMs
- AppSettings.Macros List<MacroEntry> 추가
Handlers/MacroHandler.cs (170줄 신규):
- prefix=macro, 서브커맨드: new/edit/del/play
- 목록: 단계 미리보기(최대 3단계) 표시
- 재생: Process.Start + 알림 + PowerShell 순서 실행
Views/MacroEditorWindow.xaml (135줄 신규):
- 이름/설명 입력, 열 헤더(유형/대상/표시이름/딜레이)
- 동적 행 ScrollViewer + 하단 단계 추가/저장 버튼
Views/MacroEditorWindow.xaml.cs (230줄 신규):
- StepRowUi 내부 클래스: Grid+TypeButton+TargetBox+LabelBox+DelayBox
- 공유 Popup 타입 선택기(5종): PlacementTarget 동적 설정
- BtnSave: 빈 Target 행 필터링 후 MacroEntry 저장
Handlers/ContextHandler.cs (185줄 신규):
- prefix=ctx, GetForegroundWindow P/Invoke 프로세스 감지
- 5개 컨텍스트 규칙(웹/코드/오피스/탐색기/커뮤니케이션) → 상황별 제안
- Enter 시 Views.LauncherWindow.SetInputText(prefix) 호출
ScheduleEntry 조건 필드 (AppSettings.Models.cs):
- ConditionProcess: 프로세스 이름 (비어있으면 조건 없음)
- ConditionProcessMustRun: true=실행중, false=비실행중
Services/SchedulerService.cs:
- ShouldFire() 확장: Process.GetProcessesByName() 조건 체크
Views/ScheduleEditorWindow.xaml / .cs:
- 조건 섹션 UI: 프로세스명 TextBox + 실행중/비실행중 세그먼트
- LoadFromEntry/BtnSave_Click 조건 필드 연동
App.xaml.cs:
- Phase L6-2 MacroHandler(settings) 등록
- Phase L6-3 ContextHandler() 등록
docs/LAUNCHER_ROADMAP.md:
- Phase L6 섹션 추가 (L6-1~4 전체 ✅)
빌드: 경고 0, 오류 0
This commit is contained in:
@@ -363,6 +363,72 @@ public class ScheduleEntry
|
||||
|
||||
[JsonPropertyName("lastRun")]
|
||||
public DateTime? LastRun { get; set; }
|
||||
|
||||
// ─── 조건 (L6-4) ─────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// 실행 조건: 특정 프로세스가 실행 중이어야(또는 아니어야) 트리거를 발화합니다.
|
||||
/// 비어 있으면 조건 없음.
|
||||
/// </summary>
|
||||
[JsonPropertyName("conditionProcess")]
|
||||
public string ConditionProcess { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// true=해당 프로세스가 실행 중일 때만 발화.
|
||||
/// false=해당 프로세스가 실행 중이지 않을 때만 발화.
|
||||
/// </summary>
|
||||
[JsonPropertyName("conditionProcessMustRun")]
|
||||
public bool ConditionProcessMustRun { get; set; } = true;
|
||||
}
|
||||
|
||||
// ─── 런처 매크로 (L6-2) ─────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// 런처 명령 시퀀스를 저장하는 매크로 항목.
|
||||
/// macro 핸들러로 생성·편집·실행합니다.
|
||||
/// </summary>
|
||||
public class MacroEntry
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public string Id { get; set; } = Guid.NewGuid().ToString("N")[..8];
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("description")]
|
||||
public string Description { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("steps")]
|
||||
public List<MacroStep> Steps { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("createdAt")]
|
||||
public DateTime CreatedAt { get; set; } = DateTime.Now;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매크로 단일 단계.
|
||||
/// </summary>
|
||||
public class MacroStep
|
||||
{
|
||||
/// <summary>실행 유형. app | url | folder | notification | cmd</summary>
|
||||
[JsonPropertyName("type")]
|
||||
public string Type { get; set; } = "app";
|
||||
|
||||
/// <summary>앱 경로 / URL / 폴더 경로 / 알림 메시지 / PowerShell 명령</summary>
|
||||
[JsonPropertyName("target")]
|
||||
public string Target { get; set; } = "";
|
||||
|
||||
/// <summary>추가 인자 (app 유형 전용)</summary>
|
||||
[JsonPropertyName("args")]
|
||||
public string Args { get; set; } = "";
|
||||
|
||||
/// <summary>표시 이름</summary>
|
||||
[JsonPropertyName("label")]
|
||||
public string Label { get; set; } = "";
|
||||
|
||||
/// <summary>이 단계 실행 전 대기 시간(ms). 기본값 500.</summary>
|
||||
[JsonPropertyName("delayMs")]
|
||||
public int DelayMs { get; set; } = 500;
|
||||
}
|
||||
|
||||
// ─── 잠금 해제 알림 설정 ───────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user