Exemple #1
0
void TaskEditor::refreshFromServer(){
    ServerCommand *command =new ServerCommand(this);
    command->set("command","getTask");
    command->set("taskID",this->store.get("id","").asCString());
    this->connect(command,SIGNAL(saveComplete(Json::Value)),this,SLOT(refreshFromServerComplete(Json::Value)));
    this->connect(command,SIGNAL(saveComplete(Json::Value)),command,SLOT(deleteLater()));
    command->send();
}
Exemple #2
0
void TaskEditor::setStore(Json::Value &s, bool getNotes){
    this->store=s;
    //remove all notes
    while(this->notes.length()){
        this->notes.takeFirst()->deleteLater();
    }
    if(this->store.get("id","")!="" && getNotes){
        ServerCommand *command =new ServerCommand(this);
        command->set("command","getTaskNotes");
        command->set("taskID",this->store.get("id","").asCString());
        this->connect(command,SIGNAL(saveComplete(Json::Value)),this,SLOT(getNotesResponse(Json::Value)));
        this->connect(command,SIGNAL(saveComplete(Json::Value)),command,SLOT(deleteLater()));
        command->send();
    }
    this->updateFromStore();
}