Skip to content

Commit c131ea2

Browse files
committed
Merge pull request #988 from Neverbirth/toggle_track_button_revert
Revert "Merge pull request #639 from Gama11/TrackActiveDocument"
2 parents 73cbfd6 + b75a542 commit c131ea2

File tree

8 files changed

+22
-29
lines changed

8 files changed

+22
-29
lines changed

External/Plugins/ProjectManager/Controls/TreeBar.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
using System.Windows.Forms;
2-
using PluginCore.Localization;
31
using System.Drawing;
4-
using PluginCore.Helpers;
2+
using System.Windows.Forms;
53
using PluginCore;
64
using PluginCore.Controls;
5+
using PluginCore.Helpers;
6+
using PluginCore.Localization;
77
using ProjectManager.Controls.TreeView;
88

99
namespace ProjectManager.Controls
@@ -50,7 +50,6 @@ public TreeBar(FDMenus menus, ProjectContextMenu treeMenu)
5050
Synchronize = new ToolStripButton(Icons.SyncToFile.Img);
5151
Synchronize.ToolTipText = TextHelper.GetString("ToolTip.Synchronize");
5252
Synchronize.Padding = new Padding(0);
53-
Synchronize.Checked = PluginMain.Settings.TrackActiveDocument;
5453
PluginBase.MainForm.RegisterShortcutItem("ProjectTree.LocateActiveFile", Keys.Shift | Keys.Alt | Keys.L);
5554
PluginBase.MainForm.RegisterSecondaryItem("ProjectTree.LocateActiveFile", Synchronize);
5655

External/Plugins/ProjectManager/PluginMain.cs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public void Initialize()
234234
pluginUI.ImportProject += delegate { ImportProject(); };
235235
pluginUI.Rename += fileActions.Rename;
236236
pluginUI.TreeBar.ShowHidden.Click += delegate { ToggleShowHidden(); };
237-
pluginUI.TreeBar.Synchronize.Click += delegate { ToggleTrackActiveDocument(); };
237+
pluginUI.TreeBar.Synchronize.Click += delegate { TreeSyncToCurrentFile(); };
238238
pluginUI.TreeBar.SynchronizeMain.Click += delegate { TreeSyncToMainFile(); };
239239
pluginUI.TreeBar.CollapseAll.Click += delegate { CollapseAll(); };
240240
pluginUI.TreeBar.ProjectProperties.Click += delegate { OpenProjectProperties(); };
@@ -577,7 +577,7 @@ private bool HandleKeyEvent(KeyEvent ke)
577577
}
578578
else if (shortcutId == "ProjectTree.LocateActiveFile")
579579
{
580-
ToggleTrackActiveDocument();
580+
TreeSyncToCurrentFile();
581581
}
582582

583583
// Handle tree-level simple shortcuts like copy/paste/del
@@ -1619,16 +1619,6 @@ private void CollapseAll()
16191619
}
16201620
}
16211621

1622-
private void ToggleTrackActiveDocument()
1623-
{
1624-
bool newValue = !Settings.TrackActiveDocument;
1625-
pluginUI.TreeBar.Synchronize.Checked = newValue;
1626-
Settings.TrackActiveDocument = newValue;
1627-
1628-
if (newValue)
1629-
TreeSyncToCurrentFile();
1630-
}
1631-
16321622
private void TreeSyncToCurrentFile()
16331623
{
16341624
ITabbedDocument doc = PluginBase.MainForm.CurrentDocument;
@@ -1637,7 +1627,11 @@ private void TreeSyncToCurrentFile()
16371627
string path = doc.FileName;
16381628

16391629
if (Tree.SelectedNode != null && Tree.SelectedNode.BackingPath == path)
1630+
{
1631+
Tree.SelectedNode.EnsureVisible();
1632+
Tree.PathToSelect = null;
16401633
return;
1634+
}
16411635

16421636
Tree.Select(path);
16431637
if (Tree.SelectedNode.BackingPath == path)

External/Plugins/ProjectManager/PluginUI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
using System;
22
using System.IO;
3+
using System.Collections.Generic;
34
using System.Drawing;
45
using System.Windows.Forms;
56
using ProjectManager.Actions;
67
using ProjectManager.Controls;
78
using ProjectManager.Controls.TreeView;
89
using ProjectManager.Projects;
10+
using PluginCore;
911
using PluginCore.Localization;
1012
using PluginCore.Managers;
11-
using PluginCore;
12-
using System.Collections.Generic;
1313

1414
namespace ProjectManager
1515
{

PluginCore/PluginCore/Resources/de_DE.resX

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3739,8 +3739,8 @@ Bitte bedenken Sie, dass Sie viele Projektoptionen nicht mehr nutzen können, so
37393739
<value>Fehlerzeile:</value>
37403740
</data>
37413741
<data name="ProjectManager.ToolTip.Synchronize" xml:space="preserve">
3742-
<value>Track Active Document</value>
3743-
<comment>Modified after 4.7.2</comment>
3742+
<value>Locate Active Document</value>
3743+
<comment>Modified after 4.7.0</comment>
37443744
</data>
37453745
<data name="ProjectManager.ToolTip.SynchronizeMain" xml:space="preserve">
37463746
<value>Locate Document Class</value>

PluginCore/PluginCore/Resources/en_US.resX

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3750,8 +3750,8 @@ Please note that with injection enabled, you will not be able to use many projec
37503750
<value>Error line:</value>
37513751
</data>
37523752
<data name="ProjectManager.ToolTip.Synchronize" xml:space="preserve">
3753-
<value>Track Active Document</value>
3754-
<comment>Modified after 4.7.2</comment>
3753+
<value>Locate Active Document</value>
3754+
<comment>Modified after 4.7.0</comment>
37553755
</data>
37563756
<data name="ProjectManager.ToolTip.SynchronizeMain" xml:space="preserve">
37573757
<value>Locate Document Class</value>

PluginCore/PluginCore/Resources/eu_ES.resX

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<root>
33
<!--
44
Microsoft ResX Schema
@@ -3737,8 +3737,8 @@ Kontutan izan injekzioa gaituz gero, ezin izanen diren proiektuaren hainbat auke
37373737
<value>Errore lerroa:</value>
37383738
</data>
37393739
<data name="ProjectManager.ToolTip.Synchronize" xml:space="preserve">
3740-
<value>Dokumentu aktiboa jarraitu</value>
3741-
<comment>Modified after 4.7.2</comment>
3740+
<value>Dokumentu aktiboa kokatu</value>
3741+
<comment>Modified after 5.0.2</comment>
37423742
</data>
37433743
<data name="ProjectManager.ToolTip.SynchronizeMain" xml:space="preserve">
37443744
<value>Klase-dokumentua kokatu</value>

PluginCore/PluginCore/Resources/ja_JP.resX

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3739,8 +3739,8 @@ AfterSimilarAccessorMethod: 同様のアクセサメソッドの後に配置。"
37393739
<value>エラー行の背景:</value>
37403740
</data>
37413741
<data name="ProjectManager.ToolTip.Synchronize" xml:space="preserve">
3742-
<value>Track Active Document</value>
3743-
<comment>Modified after 4.7.2</comment>
3742+
<value>Locate Active Document</value>
3743+
<comment>Modified after 4.7.0</comment>
37443744
</data>
37453745
<data name="ProjectManager.ToolTip.SynchronizeMain" xml:space="preserve">
37463746
<value>Locate Document Class</value>

PluginCore/PluginCore/Resources/zh_CN.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3745,8 +3745,8 @@
37453745
<value>错误行:</value>
37463746
</data>
37473747
<data name="ProjectManager.ToolTip.Synchronize" xml:space="preserve">
3748-
<value>Track Active Document</value>
3749-
<comment>Modified after 4.7.2</comment>
3748+
<value>Locate Active Document</value>
3749+
<comment>Modified after 4.7.0</comment>
37503750
</data>
37513751
<data name="ProjectManager.ToolTip.SynchronizeMain" xml:space="preserve">
37523752
<value>Locate Document Class</value>

0 commit comments

Comments
 (0)