Fixed exception due to wrong init.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1773 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-04-11 11:23:17 +00:00
commit d8ee90e5f1
3 changed files with 9 additions and 9 deletions

View file

@ -27,9 +27,8 @@ namespace GreenshotJiraPlugin {
/// Description of PasswordRequestForm.
/// </summary>
public partial class SettingsForm : GreenshotPlugin.Controls.GreenshotForm {
private ILanguage lang = Language.GetInstance();
public SettingsForm(JiraConfiguration config) {
language = Language.GetInstance();
//
// The InitializeComponent() call is required for Windows Forms designer support.
//

View file

@ -120,12 +120,13 @@ namespace GreenshotJiraPlugin {
/// </summary>
public virtual void Configure() {
string url = config.Url;
config.ShowConfigDialog();
// check for re-login
if (jiraConnector.isLoggedIn && !string.IsNullOrEmpty(url)) {
if (!url.Equals(config.Url)) {
jiraConnector.logout();
jiraConnector.login();
if (config.ShowConfigDialog()) {
// check for re-login
if (jiraConnector != null && jiraConnector.isLoggedIn && !string.IsNullOrEmpty(url)) {
if (!url.Equals(config.Url)) {
jiraConnector.logout();
jiraConnector.login();
}
}
}
}

View file

@ -46,7 +46,7 @@ namespace GreenshotPlugin.Controls {
/// </summary>
protected void ApplyLanguage() {
if (language == null) {
throw new ArgumentNullException("Language not set!!");
throw new ArgumentNullException("Language not set!! Please use 'language = Language.GetInstance()' in your form constructor!");
}
// Set title of the form
if (!string.IsNullOrEmpty(LanguageKey)) {