コード例 #1
0
    /* ---------------------------------------------------------
     * ----------------  EVENTS REPAIR -------------------------
     *  --------------------------------------------------------
     */
    private void on_repair_selected_jump_rj_clicked(object o, EventArgs args)
    {
        notebooks_change(1);
        Log.WriteLine("Repair selected subjump");
        //1.- check that there's a line selected
        //2.- check that this line is a jump and not a person (check also if it's not a individual RJ, the pass the parent RJ)
        if (myTreeViewJumpsRj.EventSelectedID > 0) {
            //3.- obtain the data of the selected jump
            JumpRj myJump = SqliteJumpRj.SelectJumpData( "jumpRj", myTreeViewJumpsRj.EventSelectedID, false );

            //4.- edit this jump
            repairJumpRjWin = RepairJumpRjWindow.Show(app1, myJump, prefsDigitsNumber);
            repairJumpRjWin.Button_accept.Clicked += new EventHandler(on_repair_selected_jump_rj_accepted);
        }
    }
コード例 #2
0
ファイル: jump.cs プロジェクト: GNOME/chronojump
 void on_delete_event(object o, DeleteEventArgs args)
 {
     RepairJumpRjWindowBox.repair_sub_event.Hide();
     RepairJumpRjWindowBox = null;
 }
コード例 #3
0
ファイル: jump.cs プロジェクト: GNOME/chronojump
    void on_button_accept_clicked(object o, EventArgs args)
    {
        //foreach all lines... extrac tcString and tvString
        TreeIter myIter;
        string tcString = "";
        string tvString = "";

        bool iterOk = store.GetIterFirst (out myIter);
        if(iterOk) {
            string equal= ""; //first iteration should not appear '='
            do {
                tcString = tcString + equal + (string) treeview_subevents.Model.GetValue (myIter, 1);
                tvString = tvString + equal + (string) treeview_subevents.Model.GetValue (myIter, 2);
                equal = "=";
            } while (store.IterNext (ref myIter));
        }

        jumpRj.TvString = tvString;
        jumpRj.TcString = tcString;
        jumpRj.Jumps = Util.GetNumberOfJumps(tvString, false);
        jumpRj.Time = Util.GetTotalTime(tcString, tvString);

        //calculate other variables needed for jumpRj creation

        if(jumpType.FixedValue > 0) {
            //if this jumpType has a fixed value of jumps or time, limitstring has not changed
            if(jumpType.JumpsLimited) {
                jumpRj.Limited = jumpType.FixedValue.ToString() + "J";
            } else {
                jumpRj.Limited = jumpType.FixedValue.ToString() + "T";
            }
        } else {
            //else limitstring should be calculated
            if(jumpType.JumpsLimited) {
                jumpRj.Limited = jumpRj.Jumps.ToString() + "J";
            } else {
                jumpRj.Limited = Util.GetTotalTime(tcString, tvString) + "T";
            }
        }

        //save it deleting the old first for having the same uniqueID
        Sqlite.Delete(false, Constants.JumpRjTable, jumpRj.UniqueID);
        jumpRj.InsertAtDB(false, Constants.JumpRjTable);
        /*
        SqliteJump.InsertRj("jumpRj", jumpRj.UniqueID.ToString(), jumpRj.PersonID, jumpRj.SessionID,
                jumpRj.Type, Util.GetMax(tvString), Util.GetMax(tcString),
                jumpRj.Fall, jumpRj.Weight, jumpRj.Description,
                Util.GetAverage(tvString), Util.GetAverage(tcString),
                tvString, tcString,
                jumps, Util.GetTotalTime(tcString, tvString), limitString
                );
                */

        //close the window
        RepairJumpRjWindowBox.repair_sub_event.Hide();
        RepairJumpRjWindowBox = null;
    }
コード例 #4
0
ファイル: jump.cs プロジェクト: GNOME/chronojump
 void on_button_cancel_clicked(object o, EventArgs args)
 {
     RepairJumpRjWindowBox.repair_sub_event.Hide();
     RepairJumpRjWindowBox = null;
 }
コード例 #5
0
ファイル: jump.cs プロジェクト: GNOME/chronojump
    public static RepairJumpRjWindow Show(Gtk.Window parent, JumpRj myJump, int pDN)
    {
        //LogB.Information(myJump);
        if (RepairJumpRjWindowBox == null) {
            RepairJumpRjWindowBox = new RepairJumpRjWindow (parent, myJump, pDN);
        }

        RepairJumpRjWindowBox.repair_sub_event.Show ();

        return RepairJumpRjWindowBox;
    }