Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 1d6b4e7

Browse files
committed
Change Select Folder Dialog
1 parent 7c860df commit 1d6b4e7

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

Deploy/Compress.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
$loc = Get-Location
22
Set-Location 'bin\Release\'
33
$compress = @{
4-
LiteralPath= "sourcepawn/", "Spcode.exe", "MahApps.Metro.dll", "ICSharpCode.AvalonEdit.dll", "System.Windows.Interactivity.dll", "Xceed.Wpf.AvalonDock.dll", "Xceed.Wpf.AvalonDock.Themes.Metro.dll", "smxdasm.dll", "LysisForSpedit.dll", "QueryMaster.dll", "Ionic.BZip2.dll", "SourcepawnCondenser.dll", "Renci.SshNet.dll", "Newtonsoft.Json.dll", "DiscordRPC.dll", "ControlzEx.dll", "Octokit.dll", "lang_0_spcode.xml", "GPLv3.txt"
4+
LiteralPath= "sourcepawn/", "Spcode.exe", "MahApps.Metro.dll", "ICSharpCode.AvalonEdit.dll", "System.Windows.Interactivity.dll", "Xceed.Wpf.AvalonDock.dll", "Xceed.Wpf.AvalonDock.Themes.Metro.dll", "smxdasm.dll", "LysisForSpedit.dll", "QueryMaster.dll", "Ionic.BZip2.dll", "SourcepawnCondenser.dll", "Renci.SshNet.dll", "Newtonsoft.Json.dll", "DiscordRPC.dll", "ControlzEx.dll", "Octokit.dll", "Microsoft.WindowsAPICodePack.dll", "icrosoft.WindowsAPICodePack.Shell.dll", "lang_0_spcode.xml", "GPLv3.txt"
55
#Path= "sourcepawn/"
66
#CompressionLevel = "Fastest"
77
DestinationPath = "SPCode.Portable.zip"

Deploy/SPCode.nsi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ File Newtonsoft.Json.dll
5454
File DiscordRPC.dll
5555
File ControlzEx.dll
5656
File Octokit.dll
57+
File Microsoft.WindowsAPICodePack.dll
58+
File Microsoft.WindowsAPICodePack.Shell.dll
5759

5860
File lang_0_spcode.xml
5961
File GPLv3.txt
@@ -137,7 +139,8 @@ Delete $INSTDIR\SourcepawnCondenser.dll
137139
Delete $INSTDIR\Renci.SshNet.dll
138140
Delete $INSTDIR\Newtonsoft.Json.dll
139141
Delete $INSTDIR\DiscordRPC.dll
140-
142+
Delete $INSTDIR\Microsoft.WindowsAPICodePack.dll
143+
Delete $INSTDIR\Microsoft.WindowsAPICodePack.Shell.dll
141144

142145
Delete $INSTDIR\lang_0_spcode.xml
143146
Delete $INSTDIR\GPLv3.txt

Spcode.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@
8181
<Private>True</Private>
8282
</Reference>
8383
<Reference Include="Microsoft.CSharp" />
84+
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
85+
<HintPath>packages\Windows7APICodePack-Core.1.1.0.0\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
86+
<Private>True</Private>
87+
</Reference>
88+
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
89+
<HintPath>packages\Windows7APICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
90+
<Private>True</Private>
91+
</Reference>
8492
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
8593
<HintPath>packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
8694
<Private>True</Private>

UI/Windows/ConfigWindow.xaml.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
using System.Text;
77
using System.Windows;
88
using System.Windows.Controls;
9-
using System.Windows.Forms;
109
using System.Windows.Input;
1110
using System.Xml;
1211
using MahApps.Metro;
1312
using MahApps.Metro.Controls.Dialogs;
13+
using Microsoft.Win32;
14+
using Microsoft.WindowsAPICodePack.Dialogs;
1415
using Spcode.Interop;
1516
using Spcode.Utils;
16-
using OpenFileDialog = Microsoft.Win32.OpenFileDialog;
17-
using TextBox = System.Windows.Controls.TextBox;
1817

1918
namespace Spcode.UI.Windows
2019
{
@@ -55,9 +54,14 @@ public ICommand TextBoxButtonFolderCmd
5554
{
5655
if (o is TextBox box)
5756
{
58-
var dialog = new FolderBrowserDialog();
57+
var dialog = new CommonOpenFileDialog();
58+
dialog.IsFolderPicker = true;
5959
var result = dialog.ShowDialog();
60-
if (result == System.Windows.Forms.DialogResult.OK) box.Text = dialog.SelectedPath;
60+
61+
if (result == CommonFileDialogResult.Ok) box.Text = dialog.FileName;
62+
// var dialog = new FolderBrowserDialog();
63+
// var result = dialog.ShowDialog();
64+
// if (result == System.Windows.Forms.DialogResult.OK) box.Text = dialog.SelectedPath;
6165
}
6266
}
6367
};
@@ -263,7 +267,7 @@ public void C_AutoRCON_Changed(object sender, RoutedEventArgs e)
263267
Debug.Assert(C_AutoUpload.IsChecked != null, "C_AutoUpload.IsChecked != null");
264268
Program.Configs[ConfigListBox.SelectedIndex].AutoRCON = C_AutoRCON.IsChecked.Value;
265269
}
266-
270+
267271
private void C_DeleteAfterCopy_Changed(object sender, RoutedEventArgs e)
268272
{
269273
if (!AllowChange) return;
@@ -402,7 +406,7 @@ private void Language_Translate()
402406
VerboseBlock.Text = Program.Translations.GetLanguage("VerboseLvl");
403407
C_AutoCopy.Content = Program.Translations.GetLanguage("AutoCopy");
404408
C_AutoUpload.Content = Program.Translations.GetLanguage("AutoUpload");
405-
C_AutoRCON.Content = Program.Translations.GetLanguage("AutoRCON");
409+
C_AutoRCON.Content = Program.Translations.GetLanguage("AutoRCON");
406410
C_DeleteAfterCopy.Content = Program.Translations.GetLanguage("DeleteOldSMX");
407411
FTPHostBlock.Text = Program.Translations.GetLanguage("FTPHost");
408412
FTPUserBlock.Text = Program.Translations.GetLanguage("FTPUser");

packages.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net45" />
99
<package id="Octokit" version="0.46.0" targetFramework="net48" />
1010
<package id="SSH.NET" version="2016.1.0" targetFramework="net45" />
11+
<package id="Windows7APICodePack-Core" version="1.1.0.0" targetFramework="net48" />
12+
<package id="Windows7APICodePack-Shell" version="1.1.0.0" targetFramework="net48" />
1113
</packages>

0 commit comments

Comments
 (0)