mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-14 10:55:42 +12:00
fixed #127: Pushbullet device name null check
This commit is contained in:
parent
65e07b618c
commit
1c3f6e6d9a
|
@ -224,24 +224,6 @@ public void LoadSettings(UploadersConfig uploadersConfig)
|
||||||
|
|
||||||
txtPaste_eeUserAPIKey.Text = Config.Paste_eeUserAPIKey;
|
txtPaste_eeUserAPIKey.Text = Config.Paste_eeUserAPIKey;
|
||||||
|
|
||||||
//Pushbullet
|
|
||||||
|
|
||||||
txtPushbulletUserKey.Text = Config.PushbulletSettings.UserAPIKey;
|
|
||||||
|
|
||||||
if (Config.PushbulletSettings.DeviceList.Count > 0)
|
|
||||||
{
|
|
||||||
Config.PushbulletSettings.DeviceList.ForEach(x => cboPushbulletDevices.Items.Add(x.Name));
|
|
||||||
|
|
||||||
if (Config.PushbulletSettings.DeviceList.IsValidIndex(Config.PushbulletSettings.SelectedDevice))
|
|
||||||
{
|
|
||||||
cboPushbulletDevices.SelectedIndex = Config.PushbulletSettings.SelectedDevice;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cboPushbulletDevices.SelectedIndex = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gist
|
// Gist
|
||||||
|
|
||||||
atcGistAccountType.SelectedAccountType = Config.GistAnonymousLogin ? AccountType.Anonymous : AccountType.User;
|
atcGistAccountType.SelectedAccountType = Config.GistAnonymousLogin ? AccountType.Anonymous : AccountType.User;
|
||||||
|
@ -424,6 +406,24 @@ public void LoadSettings(UploadersConfig uploadersConfig)
|
||||||
|
|
||||||
MegaConfigureTab(false);
|
MegaConfigureTab(false);
|
||||||
|
|
||||||
|
//Pushbullet
|
||||||
|
|
||||||
|
txtPushbulletUserKey.Text = Config.PushbulletSettings.UserAPIKey;
|
||||||
|
|
||||||
|
if (Config.PushbulletSettings.DeviceList.Count > 0)
|
||||||
|
{
|
||||||
|
Config.PushbulletSettings.DeviceList.ForEach(x => cboPushbulletDevices.Items.Add(x.Name ?? "Invalid device name"));
|
||||||
|
|
||||||
|
if (Config.PushbulletSettings.DeviceList.IsValidIndex(Config.PushbulletSettings.SelectedDevice))
|
||||||
|
{
|
||||||
|
cboPushbulletDevices.SelectedIndex = Config.PushbulletSettings.SelectedDevice;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cboPushbulletDevices.SelectedIndex = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Amazon S3
|
// Amazon S3
|
||||||
|
|
||||||
txtAmazonS3AccessKey.Text = Config.AmazonS3Settings.AccessKeyID;
|
txtAmazonS3AccessKey.Text = Config.AmazonS3Settings.AccessKeyID;
|
||||||
|
|
|
@ -1135,7 +1135,7 @@ public void PushbulletGetDevices()
|
||||||
|
|
||||||
Config.PushbulletSettings.DeviceList.ForEach(pbDevice =>
|
Config.PushbulletSettings.DeviceList.ForEach(pbDevice =>
|
||||||
{
|
{
|
||||||
cboPushbulletDevices.Items.Add(pbDevice.Name);
|
cboPushbulletDevices.Items.Add(pbDevice.Name ?? "Invalid device name");
|
||||||
});
|
});
|
||||||
|
|
||||||
cboPushbulletDevices.SelectedIndex = 0;
|
cboPushbulletDevices.SelectedIndex = 0;
|
||||||
|
|
Loading…
Reference in a new issue