aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/options/optw_identity.cpp
diff options
context:
space:
mode:
authorGravatar Elvio Basello2008-10-21 14:28:30 +0000
committerGravatar Elvio Basello2008-10-21 14:28:30 +0000
commit6489498baf8e36c2f0cad2da45ac4f9f2476fc75 (patch)
tree4c5f537aab520f1e8db279f10c8b4031ff8baf04 /src/modules/options/optw_identity.cpp
parentfixed input completer (need test) (diff)
downloadKVIrc-6489498baf8e36c2f0cad2da45ac4f9f2476fc75.tar.gz
KVIrc-6489498baf8e36c2f0cad2da45ac4f9f2476fc75.tar.bz2
KVIrc-6489498baf8e36c2f0cad2da45ac4f9f2476fc75.zip
more work on identity profiles (wip)
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@2766 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/options/optw_identity.cpp')
-rw-r--r--src/modules/options/optw_identity.cpp16
1 files changed, 14 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