|
|
|
@ -10,6 +10,7 @@ |
|
|
|
|
#include "AddServer.h" |
|
|
|
|
#include "ConfigMgr.h" |
|
|
|
|
#include "ServerItem.h" |
|
|
|
|
#include <QMessageBox> |
|
|
|
|
#include <QDebug> |
|
|
|
|
|
|
|
|
|
IConfigServers::IConfigServers(QWidget *parent) : |
|
|
|
@ -147,5 +148,23 @@ void IConfigServers::on_btnAddServer_clicked() |
|
|
|
|
|
|
|
|
|
void IConfigServers::on_btnDeleteSelected_clicked() |
|
|
|
|
{ |
|
|
|
|
auto index = ui->servers->currentIndex(); |
|
|
|
|
if (!index.isValid()) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
const auto* item = static_cast<const ServerItem*>(index.internalPointer()); |
|
|
|
|
QMessageBox::StandardButton btn; |
|
|
|
|
if (item->isNetwork()) |
|
|
|
|
btn = QMessageBox::question(this, |
|
|
|
|
tr("Delete entire network"), |
|
|
|
|
tr("You are about to delete an entire network!\nConfirm deletion of %1?").arg(item->name())); |
|
|
|
|
else |
|
|
|
|
btn = QMessageBox::question(this, |
|
|
|
|
tr("Delete server"), |
|
|
|
|
tr("Confirm deletion of %1?").arg(item->name())); |
|
|
|
|
|
|
|
|
|
if (btn == QMessageBox::No) |
|
|
|
|
return; |
|
|
|
|
else |
|
|
|
|
smodel.deleteEntry(index); |
|
|
|
|
} |
|
|
|
|