aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/options/optw_identity.cpp16
-rw-r--r--src/modules/options/optw_identity.h1
2 files changed, 15 insertions, 2 deletions
diff --git a/src/modules/options/optw_identity.cpp b/src/modules/options/optw_identity.cpp
index 57d2a5e35..aacdd20f6 100644
--- a/src/modules/options/optw_identity.cpp
+++ b/src/modules/options/optw_identity.cpp
@@ -775,7 +775,6 @@ void KviIdentityProfileOptionsWidget::addProfileEntry()
void KviIdentityProfileOptionsWidget::editProfileEntry()
{
- debug("Edit profile entry");
KviTalTreeWidgetItem * pItem = (KviTalTreeWidgetItem *)m_pTreeWidget->currentItem();
if(!pItem)
return;
@@ -910,7 +909,7 @@ KviIdentityProfileEditor::KviIdentityProfileEditor(QWidget * pParent)
m_pBtnOk = new QPushButton(__tr2qs_ctx("OK","options"),pBox);
m_pBtnOk->setEnabled(false);
- connect(m_pBtnOk,SIGNAL(clicked()),this,SLOT(accept()));
+ connect(m_pBtnOk,SIGNAL(clicked()),this,SLOT(okPressed()));
pLayout->setColumnStretch(1,1);
@@ -966,6 +965,19 @@ void KviIdentityProfileEditor::toggleButton(const QString & szText)
m_pBtnOk->setEnabled(bEnabled);
}
+void KviIdentityProfileEditor::okPressed()
+{
+ KviIdentityProfileSet * pSet = KviIdentityProfileSet::instance();
+
+ if(pSet->findProfile(m_pNameEdit->text()))
+ {
+ QMessageBox::warning(this,__tr2qs_ctx("Invalid Profile Rule","options"),__tr2qs_ctx("There is already a profile with that name","options"),__tr2qs_ctx("OK","options"));
+ return;
+ }
+
+ accept();
+}
+
#ifndef COMPILE_USE_STANDALONE_MOC_SOURCES
#include "m_optw_identity.moc"
#endif //COMPILE_USE_STANDALONE_MOC_SOURCES
diff --git a/src/modules/options/optw_identity.h b/src/modules/options/optw_identity.h
index f35e533a3..bcf31fe15 100644
--- a/src/modules/options/optw_identity.h
+++ b/src/modules/options/optw_identity.h
@@ -129,6 +129,7 @@ public:
bool editProfile(KviIdentityProfile * pProfile);
protected slots:
void toggleButton(const QString & szText);
+ void okPressed();
};