Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 532621b

Browse files
Merge branch 'master' into stanley/branches-view-fixes
2 parents 0b96c44 + 985c390 commit 532621b

File tree

8 files changed

+143
-174
lines changed

8 files changed

+143
-174
lines changed

src/GitHub.Api/Git/GitRemote.cs

Lines changed: 15 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -24,41 +24,6 @@ public struct GitRemote
2424
public GitRemoteFunction function;
2525
public string token;
2626

27-
public string Name
28-
{
29-
get { return name; }
30-
}
31-
32-
public string Url
33-
{
34-
get { return url; }
35-
}
36-
37-
public string Login
38-
{
39-
get { return login; }
40-
}
41-
42-
public string User
43-
{
44-
get { return user; }
45-
}
46-
47-
public string Token
48-
{
49-
get { return token; }
50-
}
51-
52-
public string Host
53-
{
54-
get { return host; }
55-
}
56-
57-
public GitRemoteFunction Function
58-
{
59-
get { return function; }
60-
}
61-
6227
public GitRemote(string name, string host, string url, GitRemoteFunction function, string user, string login, string token)
6328
{
6429
this.name = name;
@@ -77,8 +42,8 @@ public GitRemote(string name, string host, string url, GitRemoteFunction functio
7742
this.host = host;
7843
this.function = function;
7944
this.user = user;
80-
login = null;
81-
token = null;
45+
this.login = null;
46+
this.token = null;
8247
}
8348

8449
public GitRemote(string name, string host, string url, GitRemoteFunction function)
@@ -96,11 +61,11 @@ public GitRemote(string name, string url)
9661
{
9762
this.name = name;
9863
this.url = url;
99-
login = null;
100-
user = null;
101-
token = null;
102-
host = null;
103-
function = GitRemoteFunction.Unknown;
64+
this.login = null;
65+
this.user = null;
66+
this.token = null;
67+
this.host = null;
68+
this.function = GitRemoteFunction.Unknown;
10469
}
10570

10671
public override string ToString()
@@ -114,5 +79,13 @@ public override string ToString()
11479
sb.AppendLine(String.Format("Function: {0}", Function));
11580
return sb.ToString();
11681
}
82+
83+
public string Name => name;
84+
public string Url => url;
85+
public string Login => login;
86+
public string User => user;
87+
public string Token => token;
88+
public string Host => host;
89+
public GitRemoteFunction Function => function;
11790
}
11891
}

src/GitHub.Api/Localization.resx

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<root>
3-
<!--
4-
Microsoft ResX Schema
5-
3+
<!--
4+
Microsoft ResX Schema
5+
66
Version 2.0
7-
8-
The primary goals of this format is to allow a simple XML format
9-
that is mostly human readable. The generation and parsing of the
10-
various data types are done through the TypeConverter classes
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
1111
associated with the data types.
12-
12+
1313
Example:
14-
14+
1515
... ado.net/XML headers & schema ...
1616
<resheader name="resmimetype">text/microsoft-resx</resheader>
1717
<resheader name="version">2.0</resheader>
@@ -26,36 +26,36 @@
2626
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
2727
<comment>This is a comment</comment>
2828
</data>
29-
30-
There are any number of "resheader" rows that contain simple
29+
30+
There are any number of "resheader" rows that contain simple
3131
name/value pairs.
32-
33-
Each data row contains a name, and value. The row also contains a
34-
type or mimetype. Type corresponds to a .NET class that support
35-
text/value conversion through the TypeConverter architecture.
36-
Classes that don't support this are serialized and stored with the
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
3737
mimetype set.
38-
39-
The mimetype is used for serialized objects, and tells the
40-
ResXResourceReader how to depersist the object. This is currently not
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
4141
extensible. For a given mimetype the value must be set accordingly:
42-
43-
Note - application/x-microsoft.net.object.binary.base64 is the format
44-
that the ResXResourceWriter will generate, however the reader can
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
4545
read any of the formats listed below.
46-
46+
4747
mimetype: application/x-microsoft.net.object.binary.base64
48-
value : The object must be serialized with
48+
value : The object must be serialized with
4949
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
5050
: and then encoded with base64 encoding.
51-
51+
5252
mimetype: application/x-microsoft.net.object.soap.base64
53-
value : The object must be serialized with
53+
value : The object must be serialized with
5454
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
5555
: and then encoded with base64 encoding.
5656
5757
mimetype: application/x-microsoft.net.object.bytearray.base64
58-
value : The object must be serialized into a byte array
58+
value : The object must be serialized into a byte array
5959
: using a System.ComponentModel.TypeConverter
6060
: and then encoded with base64 encoding.
6161
-->
@@ -286,12 +286,12 @@
286286
<value>Branch pushed</value>
287287
</data>
288288
<data name="InitializeRepositoryButtonText" xml:space="preserve">
289-
<value>Initialize repository</value>
289+
<value>Initialize a git repository for this project</value>
290290
</data>
291291
<data name="SwitchBranchTitle" xml:space="preserve">
292292
<value>Switch branch</value>
293293
</data>
294294
<data name="SwitchBranchFailedDescription" xml:space="preserve">
295295
<value>Could not switch to branch {0}</value>
296296
</data>
297-
</root>
297+
</root>

src/UnityExtension/Assets/Editor/GitHub.Unity/GitHub.Unity.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@
151151
<EmbeddedResource Include="IconsAndLogos\dot.png" />
152152
<EmbeddedResource Include="IconsAndLogos\dropdown-list-icon%402x.png" />
153153
<EmbeddedResource Include="IconsAndLogos\dropdown-list-icon.png" />
154+
<EmbeddedResource Include="IconsAndLogos\[email protected]" />
155+
<EmbeddedResource Include="IconsAndLogos\empty-state-init.png" />
154156
<EmbeddedResource Include="IconsAndLogos\favorite-branch-indicator.png" />
155157
<EmbeddedResource Include="IconsAndLogos\git-merge%402x.png" />
156158
<EmbeddedResource Include="IconsAndLogos\git-merge-light%402x.png" />
@@ -207,12 +209,12 @@
207209
</ItemGroup>
208210
<Import Project="..\..\..\..\..\common\nativelibraries.props" />
209211
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
210-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
212+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
211213
Other similar extension points exist, see Microsoft.Common.targets.
212214
<Target Name="BeforeBuild">
213215
</Target>
214216
<Target Name="AfterBuild">
215217
</Target>
216218
-->
217219
<Import Project="..\..\..\..\..\common\build.targets" />
218-
</Project>
220+
</Project>
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

src/UnityExtension/Assets/Editor/GitHub.Unity/Misc/Styles.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class Styles
7070
commitFileAreaStyle,
7171
commitButtonStyle,
7272
textFieldStyle,
73+
boldCenteredLabel,
7374
centeredLabel,
7475
commitDescriptionFieldStyle,
7576
toggleMixedStyle,
@@ -95,6 +96,7 @@ class Styles
9596
localCommitIcon,
9697
repoIcon,
9798
lockIcon,
99+
emptyStateInit,
98100
dropdownListIcon;
99101

100102
public static Texture2D GetFileStatusIcon(GitFileStatus status, bool isLocked)
@@ -557,6 +559,22 @@ public static GUIStyle CenteredLabel
557559
}
558560
}
559561

562+
public static GUIStyle BoldCenteredLabel
563+
{
564+
get
565+
{
566+
if (boldCenteredLabel == null)
567+
{
568+
boldCenteredLabel = new GUIStyle(EditorStyles.boldLabel);
569+
boldCenteredLabel.name = "BoldCenteredLabelStyle";
570+
boldCenteredLabel.alignment = TextAnchor.MiddleCenter;
571+
boldCenteredLabel.wordWrap = true;
572+
}
573+
return boldCenteredLabel;
574+
}
575+
}
576+
577+
560578
public static GUIStyle CommitDescriptionFieldStyle
561579
{
562580
get
@@ -788,6 +806,19 @@ public static Texture2D LockIcon
788806
}
789807
}
790808

809+
public static Texture2D EmptyStateInit
810+
{
811+
get
812+
{
813+
if (emptyStateInit == null)
814+
{
815+
emptyStateInit = Utility.GetIcon("empty-state-init.png", "[email protected]");
816+
}
817+
return emptyStateInit;
818+
}
819+
820+
}
821+
791822
public static Texture2D DropdownListIcon
792823
{
793824
get
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Linq;
43
using UnityEngine;
54

6-
75
namespace GitHub.Unity
86
{
97
//http://answers.unity3d.com/answers/809221/view.html
108

119
[Serializable]
1210
public class SerializableDictionary<TKey, TValue> : Dictionary<TKey, TValue>, ISerializationCallbackReceiver
1311
{
14-
[SerializeField]
15-
private List<TKey> keys = new List<TKey>();
16-
17-
[SerializeField]
18-
private List<TValue> values = new List<TValue>();
12+
[SerializeField] private List<TKey> keys = new List<TKey>();
13+
[SerializeField] private List<TValue> values = new List<TValue>();
1914

2015
// save the dictionary to lists
2116
public void OnBeforeSerialize()
2217
{
2318
keys.Clear();
2419
values.Clear();
25-
foreach (KeyValuePair<TKey, TValue> pair in this)
20+
foreach (var pair in this)
2621
{
2722
keys.Add(pair.Key);
2823
values.Add(pair.Value);
@@ -32,13 +27,19 @@ public void OnBeforeSerialize()
3227
// load dictionary from lists
3328
public void OnAfterDeserialize()
3429
{
35-
this.Clear();
30+
Clear();
3631

3732
if (keys.Count != values.Count)
38-
throw new Exception(string.Format("there are {0} keys and {1} values after deserialization. Make sure that both key and value types are serializable.", keys.Count, values.Count));
33+
{
34+
throw new Exception(
35+
string.Format("there are {0} keys and {1} values after deserialization. Make sure that both key and value types are serializable.",
36+
keys.Count, values.Count));
37+
}
3938

40-
for (int i = 0; i < keys.Count; i++)
41-
this.Add(keys[i], values[i]);
39+
for (var i = 0; i < keys.Count; i++)
40+
{
41+
Add(keys[i], values[i]);
42+
}
4243
}
4344
}
44-
}
45+
}

0 commit comments

Comments
 (0)