static public JumpTypeAddWindow Show(Gtk.Window parent, bool simple) { if (JumpTypeAddWindowBox == null) { JumpTypeAddWindowBox = new JumpTypeAddWindow(parent, simple); } JumpTypeAddWindowBox.jump_type_add.Show(); JumpTypeAddWindowBox.fillDialog(simple); return(JumpTypeAddWindowBox); }
/* --------------------------------------------------------- * ---------------- EVENTS TYPE ADD ----------------------- * -------------------------------------------------------- */ private void on_jump_simple_type_add_clicked(object o, EventArgs args) { Log.WriteLine("Add simple new jump type"); jumpTypeAddWin = JumpTypeAddWindow.Show(app1, true); //is simple jumpTypeAddWin.FakeButtonAccept.Clicked += new EventHandler(on_jump_type_add_accepted); }
void on_button_accept_clicked(object o, EventArgs args) { //check if this jump type exists, and check it's name is not AllJumpsName bool jumpTypeExists = Sqlite.Exists(false, Constants.JumpTypeTable, Util.RemoveTildeAndColonAndDot(entry_name.Text)); if (Util.RemoveTildeAndColonAndDot(entry_name.Text) == Constants.AllJumpsName) { jumpTypeExists = true; } if (jumpTypeExists) { //string myString = Catalog.GetString ("Jump type: '") + // Util.RemoveTildeAndColonAndDot(entry_name.Text) + // Catalog.GetString ("' exists. Please, use another name"); string myString = string.Format(Catalog.GetString("Jump type: '{0}' exists. Please, use another name"), Util.RemoveTildeAndColonAndDot(entry_name.Text)); LogB.Information(myString); ErrorWindow.Show(myString); } else { string myJump = ""; myJump = Util.RemoveTildeAndColonAndDot(entry_name.Text); if (radiobutton_startIn_yes.Active) { myJump = myJump + ":1"; } else { myJump = myJump + ":0"; } if (radiobutton_extra_weight_yes.Active) { myJump = myJump + ":1"; } else { myJump = myJump + ":0"; } if (radiobutton_simple.Active) { myJump = myJump + ":" + Util.RemoveTildeAndColon(textview_description.Buffer.Text); SqliteJumpType.JumpTypeInsert(myJump, false); //false, because dbcon is not opened InsertedSimple = true; } else { if (radiobutton_unlimited.Active) { //unlimited (but in jumps do like if it's limited by jumps //(explanation in sqlite/jumpType.cs) myJump = myJump + ":1:-1"; } else { if (radiobutton_limited_jumps.Active) { myJump = myJump + ":1"; } else { myJump = myJump + ":0"; } if (checkbutton_limited_fixed.Active) { myJump = myJump + ":" + spin_fixed_num.Value; } else { myJump = myJump + ":0"; } } myJump = myJump + ":" + Util.RemoveTildeAndColon(textview_description.Buffer.Text); SqliteJumpType.JumpRjTypeInsert(myJump, false); //false, because dbcon is not opened InsertedSimple = false; } LogB.Information(string.Format("Inserted: {0}", myJump)); fakeButtonAccept.Click(); JumpTypeAddWindowBox.jump_type_add.Hide(); JumpTypeAddWindowBox = null; } }
void on_button_cancel_clicked(object o, EventArgs args) { JumpTypeAddWindowBox.jump_type_add.Hide(); JumpTypeAddWindowBox = null; }
void on_jump_type_add_delete_event(object o, DeleteEventArgs args) { JumpTypeAddWindowBox.jump_type_add.Hide(); JumpTypeAddWindowBox = null; }
void on_button_accept_clicked(object o, EventArgs args) { string name = Util.RemoveTildeAndColonAndDot(entry_name.Text); name = Util.RemoveChar(name, '"'); //check if this jump type exists, and check it's name is not AllJumpsName bool jumpTypeExists = Sqlite.Exists (false, Constants.JumpTypeTable, name); if(name == Constants.AllJumpsName) jumpTypeExists = true; if(jumpTypeExists) { //string myString = Catalog.GetString ("Jump type: '") + // Util.RemoveTildeAndColonAndDot(entry_name.Text) + // Catalog.GetString ("' exists. Please, use another name"); string myString = string.Format(Catalog.GetString("Jump type: '{0}' exists. Please, use another name"), name); LogB.Information (myString); ErrorWindow.Show(myString); } else { string myJump = name; if(radiobutton_startIn_yes.Active) { myJump = myJump + ":1"; } else { myJump = myJump + ":0"; } if(radiobutton_extra_weight_yes.Active) { myJump = myJump + ":1"; } else { myJump = myJump + ":0"; } if(radiobutton_simple.Active) { myJump = myJump + ":" + Util.RemoveTildeAndColon(textview_description.Buffer.Text); SqliteJumpType.JumpTypeInsert(myJump, false); //false, because dbcon is not opened InsertedSimple = true; } else { if(radiobutton_unlimited.Active) { //unlimited (but in jumps do like if it's limited by jumps //(explanation in sqlite/jumpType.cs) myJump = myJump + ":1:-1"; } else { if(radiobutton_limited_jumps.Active) { myJump = myJump + ":1"; } else { myJump = myJump + ":0"; } if(checkbutton_limited_fixed.Active) { myJump = myJump + ":" + spin_fixed_num.Value; } else { myJump = myJump + ":0"; } } myJump = myJump + ":" + Util.RemoveTildeAndColon(textview_description.Buffer.Text); SqliteJumpType.JumpRjTypeInsert(myJump, false); //false, because dbcon is not opened InsertedSimple = false; } LogB.Information(string.Format("Inserted: {0}", myJump)); fakeButtonAccept.Click(); JumpTypeAddWindowBox.jump_type_add.Hide(); JumpTypeAddWindowBox = null; } }
public static JumpTypeAddWindow Show(Gtk.Window parent, bool simple) { if (JumpTypeAddWindowBox == null) { JumpTypeAddWindowBox = new JumpTypeAddWindow (parent, simple); } JumpTypeAddWindowBox.jump_type_add.Show (); JumpTypeAddWindowBox.fillDialog (simple); return JumpTypeAddWindowBox; }
private void on_jump_reactive_type_add_clicked(object o, EventArgs args) { LogB.Information("Add reactive new jump type"); jumpTypeAddWin = JumpTypeAddWindow.Show(app1, false); //is reactive jumpTypeAddWin.FakeButtonAccept.Clicked += new EventHandler(on_jump_type_add_accepted); }