@@ -323,10 +323,7 @@ public void OpenExternalMergeToolAllConflicts()
323
323
324
324
public void OpenAssumeUnchanged ( )
325
325
{
326
- App . OpenDialog ( new Views . AssumeUnchangedManager ( )
327
- {
328
- DataContext = new AssumeUnchangedManager ( _repo )
329
- } ) ;
326
+ App . ShowWindow ( new AssumeUnchangedManager ( _repo ) , true ) ;
330
327
}
331
328
332
329
public void StashAll ( bool autoStart )
@@ -726,8 +723,7 @@ public ContextMenu CreateContextMenuForUnstagedChanges()
726
723
history . Icon = App . CreateMenuIcon ( "Icons.Histories" ) ;
727
724
history . Click += ( _ , e ) =>
728
725
{
729
- var window = new Views . FileHistories ( ) { DataContext = new FileHistories ( _repo , change . Path ) } ;
730
- window . Show ( ) ;
726
+ App . ShowWindow ( new FileHistories ( _repo , change . Path ) , false ) ;
731
727
e . Handled = true ;
732
728
} ;
733
729
@@ -1093,8 +1089,7 @@ public ContextMenu CreateContextMenuForStagedChanges()
1093
1089
{
1094
1090
ai . Click += ( _ , e ) =>
1095
1091
{
1096
- var dialog = new Views . AIAssistant ( services [ 0 ] , _repo . FullPath , this , _selectedStaged ) ;
1097
- App . OpenDialog ( dialog ) ;
1092
+ App . ShowWindow ( new AIAssistant ( _repo , services [ 0 ] , _selectedStaged , t => CommitMessage = t ) , true ) ;
1098
1093
e . Handled = true ;
1099
1094
} ;
1100
1095
}
@@ -1108,8 +1103,7 @@ public ContextMenu CreateContextMenuForStagedChanges()
1108
1103
item . Header = service . Name ;
1109
1104
item . Click += ( _ , e ) =>
1110
1105
{
1111
- var dialog = new Views . AIAssistant ( dup , _repo . FullPath , this , _selectedStaged ) ;
1112
- App . OpenDialog ( dialog ) ;
1106
+ App . ShowWindow ( new AIAssistant ( _repo , dup , _selectedStaged , t => CommitMessage = t ) , true ) ;
1113
1107
e . Handled = true ;
1114
1108
} ;
1115
1109
@@ -1193,8 +1187,7 @@ public ContextMenu CreateContextMenuForStagedChanges()
1193
1187
history . Icon = App . CreateMenuIcon ( "Icons.Histories" ) ;
1194
1188
history . Click += ( _ , e ) =>
1195
1189
{
1196
- var window = new Views . FileHistories ( ) { DataContext = new FileHistories ( _repo , change . Path ) } ;
1197
- window . Show ( ) ;
1190
+ App . ShowWindow ( new FileHistories ( _repo , change . Path ) , false ) ;
1198
1191
e . Handled = true ;
1199
1192
} ;
1200
1193
@@ -1490,8 +1483,7 @@ public ContextMenu CreateContextForOpenAI()
1490
1483
1491
1484
if ( services . Count == 1 )
1492
1485
{
1493
- var dialog = new Views . AIAssistant ( services [ 0 ] , _repo . FullPath , this , _staged ) ;
1494
- App . OpenDialog ( dialog ) ;
1486
+ App . ShowWindow ( new AIAssistant ( _repo , services [ 0 ] , _staged , t => CommitMessage = t ) , true ) ;
1495
1487
return null ;
1496
1488
}
1497
1489
@@ -1503,8 +1495,7 @@ public ContextMenu CreateContextForOpenAI()
1503
1495
item . Header = service . Name ;
1504
1496
item . Click += ( _ , e ) =>
1505
1497
{
1506
- var dialog = new Views . AIAssistant ( dup , _repo . FullPath , this , _staged ) ;
1507
- App . OpenDialog ( dialog ) ;
1498
+ App . ShowWindow ( new AIAssistant ( _repo , dup , _staged , t => CommitMessage = t ) , true ) ;
1508
1499
e . Handled = true ;
1509
1500
} ;
1510
1501
@@ -1705,29 +1696,15 @@ private void DoCommit(bool autoStage, bool autoPush, bool allowEmpty = false, bo
1705
1696
if ( ! string . IsNullOrEmpty ( _filter ) && _staged . Count > _visibleStaged . Count && ! confirmWithFilter )
1706
1697
{
1707
1698
var confirmMessage = App . Text ( "WorkingCopy.ConfirmCommitWithFilter" , _staged . Count , _visibleStaged . Count , _staged . Count - _visibleStaged . Count ) ;
1708
- App . OpenDialog ( new Views . ConfirmCommit ( )
1709
- {
1710
- DataContext = new ConfirmCommit ( confirmMessage , ( ) =>
1711
- {
1712
- DoCommit ( autoStage , autoPush , allowEmpty , true ) ;
1713
- } )
1714
- } ) ;
1715
-
1699
+ App . ShowWindow ( new ConfirmCommit ( confirmMessage , ( ) => DoCommit ( autoStage , autoPush , allowEmpty , true ) ) , true ) ;
1716
1700
return ;
1717
1701
}
1718
1702
1719
1703
if ( ! _useAmend && ! allowEmpty )
1720
1704
{
1721
1705
if ( ( autoStage && _count == 0 ) || ( ! autoStage && _staged . Count == 0 ) )
1722
1706
{
1723
- App . OpenDialog ( new Views . ConfirmEmptyCommit ( )
1724
- {
1725
- DataContext = new ConfirmEmptyCommit ( _count > 0 , stageAll =>
1726
- {
1727
- DoCommit ( stageAll , autoPush , true , confirmWithFilter ) ;
1728
- } )
1729
- } ) ;
1730
-
1707
+ App . ShowWindow ( new ConfirmEmptyCommit ( _count > 0 , stageAll => DoCommit ( stageAll , autoPush , true , confirmWithFilter ) ) , true ) ;
1731
1708
return ;
1732
1709
}
1733
1710
}
0 commit comments