예제 #1
0
/**
 * @brief Start operations after checking update.
 * @param update  Metadata of the latest hosts data file on the server.
 */
void QDialogDaemon::finish_update(QJsonObject update)
{
    update_ = update;
    set_label_text(ui->labelLatestData, update["version"].toString());
    if(update["version"].toString() == QApplication::translate("Util", "[Error]")){
        set_conn_status(0);
    }else{
        set_conn_status(1);
    }
    if(down_flag_){
        fetch_update_after_check();
    }else{
        set_update_finish_btns();
    }
}
예제 #2
0
/**
 * @brief Start operations after downloading data file.
 * @param refresh  An flag indicating whether the downloading progress is
 * successfully finished or not. Default by 1.
 * @param error  An flag indicating whether the downloading
 * progress is successfully finished or not. Default by 0.
 */
void QDialogDaemon::finish_fetch(int refresh, int error)
{
    down_flag_ = 0;
    if(error){
        //Error occurred while downloading
        set_down_progress(0, QApplication::translate("Util", "Error"));
        QFile::remove(QString(PATH_PREFIX) + filename_);
        warning_download();
        QString msg_title("Warning");
        QString msg = QApplication::translate("Util", "Incorrect Data file!\n"
                                                      "Please use the \"Download\" key to \n"
                                                      "fetch a new data file.");
        set_message(msg_title, msg);
        set_conn_status(0);
    }else{
        //Data file retrieved successfully
        set_down_progress(100, QApplication::translate("Util", "Download Complete"));
        refresh_info(refresh);
    }
    set_fetch_finish_btns(error);
}
예제 #3
0
파일: home.c 프로젝트: CalcMan/model-t
static void
dispatch_api_status(home_screen_t* s, api_status_t* msg)
{
  s->api_state = msg->state;
  set_conn_status(s);
}
예제 #4
0
/**
 * @brief `progress` position of the progress bar with a `message`.
 * @param progress  Progress position to be set on the progress bar.
 * @param message  Message to be set on the progress bar.
 */
void QDialogUI::set_down_progress(int progress, QString message)
{
    ui->Prog->setProperty("value", progress);
    set_conn_status(1);
    ui->Prog->setFormat(message);
}
예제 #5
0
파일: home.c 프로젝트: CalcMan/model-t
static void
dispatch_net_status(home_screen_t* s, net_status_t* msg)
{
  s->net_state = msg->net_state;
  set_conn_status(s);
}