void RemoteMachineMonitorDialogImpl::sl_modifyPushButtonClicked() {
    assert( 1 == topLevelItemsSelectedNum() );
    int row = getSelectedTopLevelRow();
    assert( 0 <= row && row < machinesItemsByOrder.size() );

    QObjectScopedPointer<RemoteMachineSettingsDialog> settingsDlg = new RemoteMachineSettingsDialog(this, machinesItemsByOrder.at(row).settings);
    const int rc = settingsDlg->exec();
    CHECK(!settingsDlg.isNull(), );

    if( QDialog::Rejected == rc ) {
        return;
    }

    RemoteMachineSettingsPtr newMachine = settingsDlg->getMachineSettings();
    if( NULL == newMachine ) {
        return;
    }

    removeDialogItemAt( row );
    addMachineSettings( newMachine, true );
}
void RemoteMachineMonitorDialogImpl::sl_addPushButtonClicked() {

    QList< ProtocolInfo* > protoInfos = AppContext::getProtocolInfoRegistry()->getProtocolInfos();
    if (protoInfos.size() < 1) {
        QMessageBox::information(this, tr("Add remote macnine"), tr("No protocols for distributed computing are found.\nPlease check your plugin list."));
        return;
    }

    QObjectScopedPointer<RemoteMachineSettingsDialog> settingsDlg = new RemoteMachineSettingsDialog(this);
    const int rc = settingsDlg->exec();
    CHECK(!settingsDlg.isNull(), );

    if( QDialog::Rejected == rc ) {
        return;
    }
    assert( QDialog::Accepted == rc );

    RemoteMachineSettingsPtr newMachine = settingsDlg->getMachineSettings();
    if( NULL == newMachine ) {
        return;
    }
    addMachineSettings( newMachine, true );

}