Pushbullet ui changes

This commit is contained in:
Jaex 2014-03-30 13:28:34 +03:00
parent 166f2a38c8
commit 29d23fb4cb
5 changed files with 550 additions and 545 deletions

File diff suppressed because it is too large Load diff

View file

@ -379,6 +379,67 @@ private void txtYFrogPassword_TextChanged(object sender, EventArgs e)
#endregion Image Uploaders
#region Text Uploaders
#region Pastebin
private void btnPastebinLogin_Click(object sender, EventArgs e)
{
PastebinLogin();
}
#endregion Pastebin
#region Paste.ee
private void txtPaste_eeUserAPIKey_TextChanged(object sender, EventArgs e)
{
Config.Paste_eeUserAPIKey = txtPaste_eeUserAPIKey.Text;
}
#endregion Paste.ee
#region Gist
private void atcGistAccountType_AccountTypeChanged(AccountType accountType)
{
Config.GistAnonymousLogin = accountType == AccountType.Anonymous;
oAuth2Gist.Enabled = !Config.GistAnonymousLogin;
}
private void oAuth2Gist_OpenButtonClicked()
{
GistAuthOpen();
}
private void oAuth2Gist_CompleteButtonClicked(string code)
{
GistAuthComplete(code);
}
private void chkGistPublishPublic_CheckedChanged(object sender, EventArgs e)
{
Config.GistPublishPublic = ((CheckBox)sender).Checked;
}
#endregion Gist
#region uPaste
private void txtUpasteUserKey_TextChanged(object sender, EventArgs e)
{
Config.UpasteUserKey = txtUpasteUserKey.Text;
}
private void cbUpasteIsPublic_CheckedChanged(object sender, EventArgs e)
{
Config.UpasteIsPublic = cbUpasteIsPublic.Checked;
}
#endregion uPaste
#endregion Text Uploaders
#region File Uploaders
#region Dropbox
@ -926,67 +987,6 @@ private void cbAmazonS3CustomCNAME_CheckedChanged(object sender, EventArgs e)
#endregion Amazon S3
#endregion File Uploaders
#region Text Uploaders
#region Pastebin
private void btnPastebinLogin_Click(object sender, EventArgs e)
{
PastebinLogin();
}
#endregion Pastebin
#region Paste.ee
private void txtPaste_eeUserAPIKey_TextChanged(object sender, EventArgs e)
{
Config.Paste_eeUserAPIKey = txtPaste_eeUserAPIKey.Text;
}
#endregion Paste.ee
#region Gist
private void atcGistAccountType_AccountTypeChanged(AccountType accountType)
{
Config.GistAnonymousLogin = accountType == AccountType.Anonymous;
oAuth2Gist.Enabled = !Config.GistAnonymousLogin;
}
private void oAuth2Gist_OpenButtonClicked()
{
GistAuthOpen();
}
private void oAuth2Gist_CompleteButtonClicked(string code)
{
GistAuthComplete(code);
}
private void chkGistPublishPublic_CheckedChanged(object sender, EventArgs e)
{
Config.GistPublishPublic = ((CheckBox)sender).Checked;
}
#endregion Gist
#region uPaste
private void txtUpasteUserKey_TextChanged(object sender, EventArgs e)
{
Config.UpasteUserKey = txtUpasteUserKey.Text;
}
private void cbUpasteIsPublic_CheckedChanged(object sender, EventArgs e)
{
Config.UpasteIsPublic = cbUpasteIsPublic.Checked;
}
#endregion uPaste
#region Pushbullet
private void txtPushbulletUserKey_TextChanged(object sender, EventArgs e)
@ -1017,7 +1017,7 @@ private void cbPushbulletReturnPushURL_CheckedChanged(object sender, EventArgs e
#endregion Pushbullet
#endregion Text Uploaders
#endregion File Uploaders
#region URL Shorteners

View file

@ -71,6 +71,7 @@ private void ControlSettings()
fileUploadersImageList.Images.Add("Jira", Resources.jira);
fileUploadersImageList.Images.Add("Mega", Resources.Mega);
fileUploadersImageList.Images.Add("AmazonS3", Resources.AmazonS3);
fileUploadersImageList.Images.Add("Pushbullet", Resources.Pushbullet);
tcFileUploaders.ImageList = fileUploadersImageList;
ImageList textUploadersImageList = new ImageList();
@ -78,7 +79,6 @@ private void ControlSettings()
textUploadersImageList.Images.Add("Pastebin", Resources.Pastebin);
textUploadersImageList.Images.Add("Gist", Resources.Gist);
textUploadersImageList.Images.Add("Upaste", Resources.Upaste);
textUploadersImageList.Images.Add("Pushbullet", Resources.Pushbullet);
tcTextUploaders.ImageList = textUploadersImageList;
ImageList urlShortenersImageList = new ImageList();

View file

@ -1080,22 +1080,26 @@ public void PushbulletGetDevices()
Pushbullet pushbullet = new Pushbullet(Config.PushbulletSettings);
cboPushbulletDevices.Items.Clear();
cboPushbulletDevices.Text = "";
Config.PushbulletSettings.DeviceList = pushbullet.GetDeviceList();
if (Config.PushbulletSettings.DeviceList.Count < 1) { throw new NullReferenceException("Pushbullet device list came back empty"); }
if (Config.PushbulletSettings.CurrentDevice == null) { Config.PushbulletSettings.CurrentDevice = Config.PushbulletSettings.DeviceList[0]; }
cboPushbulletDevices.Enabled = true;
lblPushbulletDevices.Enabled = true;
Config.PushbulletSettings.DeviceList.ForEach(pbDevice =>
if (Config.PushbulletSettings.DeviceList.Count > 0)
{
cboPushbulletDevices.Items.Add(pbDevice.Name);
});
if (Config.PushbulletSettings.CurrentDevice == null)
{
Config.PushbulletSettings.CurrentDevice = Config.PushbulletSettings.DeviceList[0];
}
cboPushbulletDevices.Text = Config.PushbulletSettings.CurrentDevice.Name;
cboPushbulletDevices.Enabled = true;
Config.PushbulletSettings.DeviceList.ForEach(pbDevice =>
{
cboPushbulletDevices.Items.Add(pbDevice.Name);
});
cboPushbulletDevices.Text = Config.PushbulletSettings.CurrentDevice.Name;
}
}
#endregion Pushbullet

View file

@ -354,7 +354,8 @@ public bool IsActive(FileDestination destination)
case FileDestination.Mega:
return MegaAuthInfos != null && MegaAuthInfos.Email != null && MegaAuthInfos.Hash != null && MegaAuthInfos.PasswordAesKey != null;
case FileDestination.Pushbullet:
return PushbulletSettings != null && !string.IsNullOrEmpty(PushbulletSettings.UserAPIKey) && PushbulletSettings.DeviceList != null;
return PushbulletSettings != null && !string.IsNullOrEmpty(PushbulletSettings.UserAPIKey) && PushbulletSettings.DeviceList != null &&
PushbulletSettings.DeviceList.Count > 0 && PushbulletSettings.CurrentDevice != null;
default:
return true;
}