diff options
| author | 2010-09-03 15:23:27 +0000 | |
|---|---|---|
| committer | 2010-09-03 15:23:27 +0000 | |
| commit | a27933290601425bd856a22da5135f16c5e87f62 (patch) | |
| tree | da7569f32d338d99d5df3811ada75ecb78cfff76 /src/modules/popupeditor | |
| parent | added userlist module: userlist.select userlist.ensureVisible $userlist.selec... (diff) | |
| download | KVIrc-a27933290601425bd856a22da5135f16c5e87f62.tar.gz KVIrc-a27933290601425bd856a22da5135f16c5e87f62.tar.bz2 KVIrc-a27933290601425bd856a22da5135f16c5e87f62.zip | |
added separatorid to defpopup (fixes #938)
enable condition editing for separators in popup editor
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4974 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/popupeditor')
| -rw-r--r-- | src/modules/popupeditor/popupeditor.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/modules/popupeditor/popupeditor.cpp b/src/modules/popupeditor/popupeditor.cpp index 02ad0f26d..855e23571 100644 --- a/src/modules/popupeditor/popupeditor.cpp +++ b/src/modules/popupeditor/popupeditor.cpp @@ -129,6 +129,7 @@ void KviPopupTreeWidgetItem::setCondition(const QString & szCondition) case Menu: case Label: case ExtMenu: + case Separator: m_szCondition = szCondition; break; default: @@ -704,6 +705,18 @@ void KviSinglePopupEditor::saveLastSelectedItem() case KviPopupTreeWidgetItem::Label: case KviPopupTreeWidgetItem::ExtMenu: m_pLastSelectedItem->setItemText(m_pTextEditor->text()); + break; + default: + break; + } + + switch(m_pLastSelectedItem->m_type) + { + case KviPopupTreeWidgetItem::Menu: + case KviPopupTreeWidgetItem::Item: + case KviPopupTreeWidgetItem::Label: + case KviPopupTreeWidgetItem::ExtMenu: + case KviPopupTreeWidgetItem::Separator: m_pLastSelectedItem->setCondition(m_pConditionEditor->text()); break; default: @@ -841,8 +854,6 @@ void KviSinglePopupEditor::selectionChanged() case KviPopupTreeWidgetItem::Item: case KviPopupTreeWidgetItem::Label: case KviPopupTreeWidgetItem::ExtMenu: - m_pConditionEditor->setText(((KviPopupTreeWidgetItem *)it)->m_szCondition); - bConditionEditorEnabled = true; m_pTextEditor->setText(((KviPopupTreeWidgetItem *)it)->m_szText); bTextEditorEnabled = true; break; @@ -850,6 +861,20 @@ void KviSinglePopupEditor::selectionChanged() break; } + switch(((KviPopupTreeWidgetItem *)it)->m_type) + { + case KviPopupTreeWidgetItem::Menu: + case KviPopupTreeWidgetItem::Item: + case KviPopupTreeWidgetItem::Label: + case KviPopupTreeWidgetItem::ExtMenu: + case KviPopupTreeWidgetItem::Separator: + m_pConditionEditor->setText(((KviPopupTreeWidgetItem *)it)->m_szCondition); + bConditionEditorEnabled = true; + break; + default: + break; + } + if(((KviPopupTreeWidgetItem *)it)->m_type == KviPopupTreeWidgetItem::ExtMenu) { m_pExtNameEditor->setText(((KviPopupTreeWidgetItem *)it)->m_szCode); @@ -918,6 +943,7 @@ void KviSinglePopupEditor::populateMenu(KviKvsPopupMenu * pop,KviPopupTreeWidget case KviKvsPopupMenuItem::Separator: if(par)theItem = new KviPopupTreeWidgetItem(par,theItem,KviPopupTreeWidgetItem::Separator); else theItem = new KviPopupTreeWidgetItem(m_pTreeWidget,theItem,KviPopupTreeWidgetItem::Separator); + theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : QString()); theItem->setId(item->name()); break; case KviKvsPopupMenuItem::Menu: |
