Run() public method

public Run ( ) : int
return int
Esempio n. 1
0
 void ButtonClicked(object s, EventArgs a)
 {
     using (TextEditorDialog dlg = new TextEditorDialog()) {
         dlg.Text = entry.Text;
         dlg.SetTranslatable(prop.Translatable);
         dlg.TransientFor = this.Toplevel as Gtk.Window;
         if (prop.Translatable)
         {
             dlg.Translated  = prop.IsTranslated(obj);
             dlg.ContextHint = prop.TranslationContext(obj);
             dlg.Comment     = prop.TranslationComment(obj);
         }
         if (dlg.Run() == (int)ResponseType.Ok)
         {
             if (prop.Translatable)
             {
                 prop.SetTranslated(obj, dlg.Translated);
                 if (dlg.Translated)
                 {
                     prop.SetTranslationComment(obj, dlg.Comment);
                     prop.SetTranslationContext(obj, dlg.ContextHint);
                 }
             }
             entry.Text = dlg.Text;
             TextChanged(null, null);
         }
     }
 }
Esempio n. 2
0
		void ButtonClicked (object s, EventArgs a)
		{
			using (TextEditorDialog dlg = new TextEditorDialog ()) {
				dlg.Text = strings != null ? string.Join ("\n", strings) : "";
				dlg.SetTranslatable (prop.Translatable);
				dlg.TransientFor = this.Toplevel as Gtk.Window;
				if (prop.Translatable) {
					dlg.Translated = prop.IsTranslated (obj);
					dlg.ContextHint = prop.TranslationContext (obj);
					dlg.Comment = prop.TranslationComment (obj);
				}
				if (dlg.Run () == (int) ResponseType.Ok) {
					if (prop.Translatable) {
						prop.SetTranslated (obj, dlg.Translated);
						if (dlg.Translated) {
							prop.SetTranslationComment (obj, dlg.Comment);
							prop.SetTranslationContext (obj, dlg.ContextHint);
						}
					}
					if (dlg.Text.Length == 0)
						strings = null;
					else
						strings = dlg.Text.Split ('\n');
					UpdateLabel ();
					if (ValueChanged != null)
						ValueChanged (this, EventArgs.Empty);
				}
			}
		}
Esempio n. 3
0
        void ButtonClicked(object s, EventArgs a)
        {
            using (TextEditorDialog dlg = new TextEditorDialog())
            {
                dlg.Text = strings != null?string.Join("\n", strings) : "";

                dlg.SetTranslatable(prop.Translatable);
                dlg.TransientFor = this.Toplevel as Gtk.Window;
                if (prop.Translatable)
                {
                    dlg.Translated  = prop.IsTranslated(obj);
                    dlg.ContextHint = prop.TranslationContext(obj);
                    dlg.Comment     = prop.TranslationComment(obj);
                }
                if (dlg.Run() == (int)ResponseType.Ok)
                {
                    if (prop.Translatable)
                    {
                        prop.SetTranslated(obj, dlg.Translated);
                        if (dlg.Translated)
                        {
                            prop.SetTranslationComment(obj, dlg.Comment);
                            prop.SetTranslationContext(obj, dlg.ContextHint);
                        }
                    }
                    if (dlg.Text.Length == 0)
                    {
                        strings = null;
                    }
                    else
                    {
                        strings = dlg.Text.Split('\n');
                    }
                    UpdateLabel();
                    if (ValueChanged != null)
                    {
                        ValueChanged(this, EventArgs.Empty);
                    }
                }
            }
        }
Esempio n. 4
0
 void ButtonClicked(object s, EventArgs a)
 {
     using (TextEditorDialog dlg = new TextEditorDialog ()) {
         dlg.Text = entry.Text;
         dlg.SetTranslatable (prop.Translatable);
         if (prop.Translatable) {
             dlg.Translated = prop.IsTranslated (obj);
             dlg.ContextHint = prop.TranslationContext (obj);
             dlg.Comment = prop.TranslationComment (obj);
         }
         if (dlg.Run () == (int) ResponseType.Ok) {
             if (prop.Translatable) {
                 prop.SetTranslated (obj, dlg.Translated);
                 if (dlg.Translated) {
                     prop.SetTranslationComment (obj, dlg.Comment);
                     prop.SetTranslationContext (obj, dlg.ContextHint);
                 }
             }
             entry.Text = dlg.Text;
             TextChanged (null, null);
         }
     }
 }