source/MainGUI.cpp
/**
 * Updates the text of the refresh button and enables it if the wait time has elapsed.
 */
Updates the text of the refresh button and enables it if the wait time has elapsed.
Updates the text of the refresh button and enables it if the wait time has elapsed .
void MainGUI::updateRefreshButton ()
{
    QString text = widget.refreshButton->text();
    int secondsLeft = text.mid(9, text.length() - 10).toInt();
    if (secondsLeft != 1)
    {
        widget.refreshButton->setText("Refresh ("
                + QString::number(secondsLeft - 1) + ")");
        QTimer::singleShot(1000, this, SLOT(updateRefreshButton()));
    }
    else
    {
        widget.refreshButton->setText("Refresh");
        widget.refreshButton->setEnabled(true);
    }
}
void MainGUI :: updateRefreshButton ( ) { QString text = widget . refreshButton -> text ( ) ; int secondsLeft = text . mid ( 9 , text . length ( ) - 10 ) . toInt ( ) ; if ( secondsLeft != 1 ) { widget . refreshButton -> setText ( " " + QString :: number ( secondsLeft - 1 ) + " " ) ; QTimer :: singleShot ( 1000 , this , SLOT ( updateRefreshButton ( ) ) ) ; } else { widget . refreshButton -> setText ( " " ) ; widget . refreshButton -> setEnabled ( true ) ; } }
Updates the text of the refresh button and enables it if the wait time has elapsed.
Updates the text of the refresh button and enables it if the wait time has elapsed .