private static void Init(SafeCallDialog diag, string text, string posLabel, int pos_id, string negLabel, int neg_id) { diag.ContentArea.PackStart(new Label(text), true, true, 0); if (negLabel != null) { diag.AddButton(negLabel, neg_id); } if (posLabel != null) { diag.AddButton(posLabel, pos_id); } diag.ShowAll(); }
private void OnOk(object sender, EventArgs args) { Dialog diag = null; switch (DbStatus) { case (int)status.BAD_FILE: diag = new SafeCallDialog(Bad_File, "Ok"); break; case (int)status.NO_FILE: diag = new SafeCallDialog(No_File, "Ok"); break; case (int)status.INVALID: diag = new SafeCallDialog(Invalid, "Ok, Weiter", 0, "Abbrechen", 1); if (diag.Run() == 0) { StartMainWindow(); } diag.Destroy(); diag = null; break; case (int)status.TO_CHECK: Validate(false); // Check db first OnOk(null, null); // Recursive call break; case (int)status.VALID: StartMainWindow(); break; } if (diag != null) { diag.Run(); diag.Destroy(); } }