Skip to content

Commit

Permalink
Merge pull request #28 from luni64/Support_gcc-arm
Browse files Browse the repository at this point in the history
IntellisenseMode : gcc-arm
cppStandard: gnu++14
Added MRU project list
Icons for tabs and menu entries
  • Loading branch information
luni64 authored Oct 16, 2020
2 parents d671ca0 + d64b6d6 commit 7b92363
Show file tree
Hide file tree
Showing 13 changed files with 541 additions and 76 deletions.
7 changes: 5 additions & 2 deletions VisualTeensy/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup>

<system.net>
<system.net>
<connectionManagement>
<add address="*" maxconnection="40"/>
</connectionManagement>
Expand All @@ -34,7 +34,7 @@
<appender-ref ref="LogFileAppender"/>
</root>
</log4net>

<userSettings>
<VisualTeensy.Properties.Settings>
<setting name="updateNeeded" serializeAs="String">
Expand Down Expand Up @@ -103,6 +103,9 @@
<setting name="FirstStart" serializeAs="String">
<value>True</value>
</setting>
<setting name="mruString" serializeAs="String">
<value />
</setting>
</VisualTeensy.Properties.Settings>
</userSettings>
</configuration>
24 changes: 8 additions & 16 deletions VisualTeensy/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ SetupData loadSetup()
if (Settings.Default.FirstStart)
{
log.Info("First startup");
var vm = new StartupSettingsView(new StartupSettingsVM(setupData)).ShowDialog();
new StartupSettingsView(new StartupSettingsVM(setupData)).ShowDialog();

setupData.projectBaseDefault = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "source");
setupData.uplPjrcBase.path = Helpers.findTyToolsFolder();
Expand All @@ -50,7 +50,6 @@ SetupData loadSetup()
//setupData.tdLibBase = Path.Combine(Helpers.getSketchbookFolder() ?? "", "libraries");
setupData.tdLibBase = Path.Combine(setupData.arduinoCoreBase ?? "", "libraries");


setupData.isColoredOutput = true;
setupData.colorCore = Color.FromArgb(255, 187, 206, 251);
setupData.colorUserLib = Color.FromArgb(255, 206, 244, 253);
Expand Down Expand Up @@ -81,6 +80,8 @@ SetupData loadSetup()
setupData.colorLink = Settings.Default.ColLink;
setupData.colorErr = Settings.Default.ColErr;
}

setupData.mru.load(Settings.Default.mruString);
Helpers.arduinoPath = setupData.arduinoBase;

using (var reader = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualTeensy.Embedded.makefile_make")))
Expand Down Expand Up @@ -115,6 +116,7 @@ void saveSetup(SetupData setupData)
Settings.Default.ColOk = setupData.colorOk;
Settings.Default.ColLink = setupData.colorLink;
Settings.Default.ColErr = setupData.colorErr;
Settings.Default.mruString = setupData.mru.ToString();

Settings.Default.mainWinBounds = new Rect(mainWin.Left, mainWin.Top, mainWin.Width, mainWin.Height);

Expand Down Expand Up @@ -150,29 +152,19 @@ protected override void OnStartup(StartupEventArgs e)

try
{



var setup = loadSetup();
if (setup.errors.Count > 0)
{
string errors = "";
setup.errors.ForEach(err => errors += (err + '\n'));
log.Error(errors);

MessageBox.Show($"Setting errors found!\n{errors}", caption: "VisualTeensy",MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show($"Setting errors found!\n{errors}", caption: "VisualTeensy", MessageBoxButton.OK, MessageBoxImage.Error);
}

//// download list of arduino libraries if outdated
//if (!File.Exists(setup.libIndex_json))
//{
// var libIndexSource = new Uri("https://downloads.arduino.cc/libraries/library_index.json", UriKind.Absolute);

// if (MessageBoxResult.Yes == MessageBox.Show(
// $"The Arduino library index was not found!\nDownload from {libIndexSource}? \n\nThis may take some time...", caption: "VisualTeensy, Information",
// MessageBoxButton.YesNo, MessageBoxImage.Information))
// {
// await Helpers.downloadFileAsync(libIndexSource, setup.libIndex_json);
// }
//}

var libManager = Factory.makeLibManager(setup);
var project = Factory.makeProject(setup, libManager);

Expand Down
66 changes: 39 additions & 27 deletions VisualTeensy/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions VisualTeensy/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,8 @@
<Setting Name="FirstStart" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="mruString" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>
2 changes: 1 addition & 1 deletion VisualTeensy/ViewModel/LibrariesTab/LibrariesTabVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace ViewModel
{
class LibrariesTabVM : BaseViewModel, IDropTarget
public class LibrariesTabVM : BaseViewModel, IDropTarget
{
#region commands --------------------------------------------
public RelayCommand cmdDel { get; }
Expand Down
Loading

0 comments on commit 7b92363

Please sign in to comment.