diff options
| author | 2008-10-21 14:28:30 +0000 | |
|---|---|---|
| committer | 2008-10-21 14:28:30 +0000 | |
| commit | 6489498baf8e36c2f0cad2da45ac4f9f2476fc75 (patch) | |
| tree | 4c5f537aab520f1e8db279f10c8b4031ff8baf04 /src/modules/options | |
| parent | fixed input completer (need test) (diff) | |
| download | KVIrc-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')
| -rw-r--r-- | src/modules/options/optw_identity.cpp | 16 | ||||
| -rw-r--r-- | src/modules/options/optw_identity.h | 1 |
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(); }; |
