예제 #1
0
        public override void Save()
        {
            log.WARN ("Save () called");

            // re-construct the data from the widget
            taskViewWidget.ConvertToTaskCore ();
            this.ContentName = taskViewWidget.TargetCore.Title;

            if (Role == CurrentRole.EditTask) {
                // the task is already hooked up to the provider
                // just force an update of the TFStore for now
                targetTask.Label = taskViewWidget.TargetCore.Title;
                targetTask.TriggerUpdate ();
                TaskForceMain.Instance.StartTFStoreUpdate ();
            } else if (Role == CurrentRole.NewTask) {
                // create a new task
                TaskData data = new TaskData ();

                data.CoreDataObject = taskViewWidget.TargetCore;
                data.Label = taskViewWidget.TargetCore.Title;

                providerNode.AddChild (data);
                TaskForceMain.Instance.StartTFStoreUpdate ();

                Role = CurrentRole.EditTask;

                // the new task now becomes the target
                targetTask = data;
            }

            // Unset the IsDirry
            IsDirty = false;
        }
예제 #2
0
        /// <summary>
        /// Takes a taskdata and populates the treeview's store with session's
        /// start time, end time, and duration
        /// </summary>
        /// <param name="data">
        /// A <see cref="TaskData"/>
        /// </param>
        public void SetTaskData(TaskData data)
        {
            try {
                foreach (TaskSession session in data.TaskContext.Sessions) {
                    string lengthString = String.Format("{0} Hours, {1} Minutes", session.GetLength().Hours, session.GetLength().Minutes);
                    sessionStore.AppendValues (session.StartTime.ToString (), session.EndTime.ToString (), lengthString);
                }
            } catch {

            }
        }
예제 #3
0
        public void PopulateFromTaskData(TaskData _data)
        {
            // get the coredata
            TargetCore = _data.CoreDataObject as TaskCore;

            // Initialize the comments
            commentwidget21.Initialize (TargetCore.Comments);

            // Populate the other fields
            nameEntry.Text = TargetCore.Title;
            descriptionTextView.Buffer.Text = TargetCore.Description;
            try {
                priorityCombo.Active = TargetCore.Priority;
            } catch {
                log.ERROR ("Priority wasn't loaded properly into the priority combo box");
            }

            commentwidget21.NewCommentAdded += OnNewCommentAdded;

            this.sessiondisplaywidget1.SetTaskData (_data);
        }
예제 #4
0
        public void EditTaskRole(ProviderData _providerNode, TaskData _target)
        {
            providerNode = _providerNode;
            targetTask = _target;

            taskViewWidget.PopulateFromTaskData (_target);
            Role = CurrentRole.EditTask;

            this.ContentName = _target.Label;
            this.IsDirty = false;
        }
예제 #5
0
        public void SeedDataForTesting(string seedString)
        {
            providerNode.CoreDataObject = new ProviderCore ();

            // initialize the database
            // DBHelper.Initialize();

            // get an arraylist of all the taskcores
            // TODO: Phasing out the database model
                        /* List<TaskCore> tasks = DBHelper.GetAllTasks(); // get all the coredata
            foreach(TaskCore core in tasks)
            {
                log.INFO("The core object is: " + core);
                // create a new task node
                TaskData taskNode = new TaskData();

                // set the core data object
                taskNode.CoreDataObject = core;

                // set the label and icon
                taskNode.Label = core.Title;

                // update the tree without updating gui
                providerNode.AddChildSilent(taskNode);

            }*/

            // create a few random taskcore items
            for (int i = 0; i < 3; i++) {
                // create a core data object and seed it
                TaskCore core = new TaskCore ();
                core.SeedTaskCore (seedString, i);

                TaskData taskNode = new TaskData ();
                taskNode.CoreDataObject = core;

                taskNode.Label = core.Title;

                providerNode.AddChildSilent (taskNode);
            }
        }
예제 #6
0
 public void ViewTask(TaskData target)
 {
 }
예제 #7
0
        /// <summary>
        /// Initializes the provider and populates the node
        /// </summary>
        /// <param name="providerNode">
        /// A <see cref="ProviderData"/>
        /// </param>
        public void InitializeProvider(ProviderData _providerNode)
        {
            providerNode = _providerNode;

            if (providerNode == null) {
                log.ERROR ("Provider is wrong!");
            }
            // Set the options for the provider
            _providerNode.CoreDataObject = new ProviderCore ();

            // initialize the database
            DBHelper.Initialize ();

            // set any required details about the provider
            providerNode.Label = "Local Provider";

            // get an arraylist of all the taskcores
            List<TaskCore> tasks = DBHelper.GetAllTasks ();
            // get all the coredata
            foreach (TaskCore core in tasks) {
                log.INFO ("The core object is: " + core);
                // create a new task node
                TaskData taskNode = new TaskData ();

                // set the core data object
                taskNode.CoreDataObject = core;

                // set the label and icon
                taskNode.Label = core.Title;

                // update the tree without updating gui
                providerNode.AddChildSilent (taskNode);

            }

            // trigger changes in the gui
            providerNode.TriggerUpdate ();
        }
예제 #8
0
        public void EditTask(TaskData target)
        {
            // Right now, it's safe to assume that the parent will be the provider
                        /*EditTaskView newTab = new EditTaskView(target.parent as ProviderData, target);

            IdeApp.Workbench.OpenDocument(newTab, true);*/

            // only open if the edit window is not open already
            if(!target.EditWindowOpen)
            {
                TaskView taskView = new TaskView ();
                taskView.EditTaskRole (providerNode, target);

                IdeApp.Workbench.OpenDocument (taskView, true);
                target.EditWindowOpen = true;
            }
        }
예제 #9
0
        public void SeedDataForTesting(string seedString)
        {
            log.DEBUG("Seeding data for testing");
            for (int i = 0 ; i < 3; i++)
            {
                TaskData taskNode = new TaskData();
                taskNode.CoreDataObject = new BugzillaTaskCore() as ICoreData;
                taskNode.Label = seedString + i.ToString();

                providerNode.AddChild(taskNode);
            }
        }
예제 #10
0
        public void Initialize(TaskData _taskData)
        {
            parentTask = _taskData;

            // any more intialization
        }
예제 #11
0
        protected virtual void OnApplyButtonClicked(object sender, System.EventArgs e)
        {
            // Create a TaskCore object and populate with values from GUI
            TaskCore core = new TaskCore ();
            /*
             * TODO: Why isn't this working? all the objects are defined in stetic
            core.Title = this.taskNameEntry.Text;
            core.Description = this.taskDescText.Buffer.Text;
            core.CreateDate = DateTime.Now;

            core.DueDate = this.dueDateCal.Date;
            core.Priority = this.prioritySpin.Value;*/
            core.Title = "Stub A";
            core.Description = "Stub B";
            core.CreateDate = DateTime.Now;
            core.DueDate = DateTime.Now;
            core.Priority = 10;

            log.INFO ("Added new TaskCore - " + core.ToString ());
            // create a taskdata object
            TaskData task = new TaskData ();

            // attach the new core object to the task
            task.CoreDataObject = core;

            // write the task data to the database
            DBHelper.AddTask (core);

            // set the title of the task node
            task.Label = core.Title;

            // Add the task to the provider's children and thus trigger
            // an update of the treeview
            ProviderNode.AddChild (task);
        }