name = NULL;
config = NULL;
+ configIndex = -1;
eWhat = eBlock = NULL;
iface = NULL;
void DhcpcdPreferences::clearConfig()
{
+ QIcon icon = DhcpcdQt::getIcon("actions", "document-new");
+ blocks->setItemIcon(blocks->currentIndex(), icon);
autoConf->setChecked(true);
ip->setText("");
router->setText("");
*cancel = true;
return false;
case QMessageBox::Discard:
- *cancel = true;
+ *cancel = false;
return true;
default:
break;
.arg(strerror(errno)));
goto err;
}
+
+ /* Braces to avoid jump error */
+ {
+ QIcon icon = DhcpcdQt::getIcon("actions", "document-save");
+ blocks->setItemIcon(configIndex, icon);
+ }
return true;
err:
} else
config = NULL;
+ if (config == NULL)
+ configIndex = -1;
+ else
+ configIndex = blocks->currentIndex();
+
showConfig();
bool enabled = dhcpcd_config_writeable(con) && eBlock != NULL;
autoConf->setEnabled(enabled);