diff options
| author | 2011-01-01 20:19:56 +0000 | |
|---|---|---|
| committer | 2011-01-01 20:19:56 +0000 | |
| commit | c601b5a27f74b16158adafe429faefbe573e64a2 (patch) | |
| tree | a3cde3206a45628f8ac86e8dfbdab70b20c3a831 /src/modules/popupeditor | |
| parent | probable compilation fix for rijndaled/crypto++ (diff) | |
| download | KVIrc-c601b5a27f74b16158adafe429faefbe573e64a2.tar.gz KVIrc-c601b5a27f74b16158adafe429faefbe573e64a2.tar.bz2 KVIrc-c601b5a27f74b16158adafe429faefbe573e64a2.zip | |
The big rename for modules. Still some details remaining.
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5284 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/popupeditor')
| -rw-r--r-- | src/modules/popupeditor/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/modules/popupeditor/PopupEditorWindow.cpp (renamed from src/modules/popupeditor/popupeditor.cpp) | 398 | ||||
| -rw-r--r-- | src/modules/popupeditor/PopupEditorWindow.h (renamed from src/modules/popupeditor/popupeditor.h) | 70 | ||||
| -rw-r--r-- | src/modules/popupeditor/libkvipopupeditor.cpp | 6 |
4 files changed, 239 insertions, 239 deletions
diff --git a/src/modules/popupeditor/CMakeLists.txt b/src/modules/popupeditor/CMakeLists.txt index 87c8617b4..7fd16323d 100644 --- a/src/modules/popupeditor/CMakeLists.txt +++ b/src/modules/popupeditor/CMakeLists.txt @@ -1,12 +1,12 @@ # CMakeLists for src/modules/popupeditor SET(kvipopupeditor_MOC_HDRS - popupeditor.h + PopupEditorWindow.h ) SET(kvipopupeditor_SRCS libkvipopupeditor.cpp - popupeditor.cpp + PopupEditorWindow.cpp ) # After this call, files will be moc'ed to moc_kvi_*.cpp diff --git a/src/modules/popupeditor/popupeditor.cpp b/src/modules/popupeditor/PopupEditorWindow.cpp index 8cacc85e6..f7e5ed24a 100644 --- a/src/modules/popupeditor/popupeditor.cpp +++ b/src/modules/popupeditor/PopupEditorWindow.cpp @@ -1,6 +1,6 @@ //============================================================================= // -// File : popupeditor.cpp +// File : PopupEditorWindow.cpp // Creation date : Mon Dec 23 2002 20:28:18 by Szymon Stefanek // // This file is part of the KVIrc irc client distribution @@ -22,7 +22,7 @@ // //============================================================================= -#include "popupeditor.h" +#include "PopupEditorWindow.h" #include "KviIconManager.h" #include "KviOptions.h" @@ -53,26 +53,26 @@ #include <QAbstractItemView> -extern KviPopupEditorWindow * g_pPopupEditorWindow; +extern PopupEditorWindow * g_pPopupEditorWindow; //KviPopupEntryItem -KviPopupTreeWidgetItem::KviPopupTreeWidgetItem(QTreeWidget * pTreeWidget,KviPopupTreeWidgetItem * after,Type t) +PopupTreeWidgetItem::PopupTreeWidgetItem(QTreeWidget * pTreeWidget,PopupTreeWidgetItem * after,Type t) : QTreeWidgetItem(pTreeWidget, after) { m_type = t; init(); } -KviPopupTreeWidgetItem::KviPopupTreeWidgetItem(KviPopupTreeWidgetItem * parent,KviPopupTreeWidgetItem * after,Type t) +PopupTreeWidgetItem::PopupTreeWidgetItem(PopupTreeWidgetItem * parent,PopupTreeWidgetItem * after,Type t) : QTreeWidgetItem(parent, after) { m_type = t; init(); } -void KviPopupTreeWidgetItem::init() +void PopupTreeWidgetItem::init() { switch(m_type) { @@ -105,7 +105,7 @@ void KviPopupTreeWidgetItem::init() } } -void KviPopupTreeWidgetItem::setItemText(const QString & szText) +void PopupTreeWidgetItem::setItemText(const QString & szText) { switch(m_type) { @@ -121,7 +121,7 @@ void KviPopupTreeWidgetItem::setItemText(const QString & szText) } } -void KviPopupTreeWidgetItem::setCondition(const QString & szCondition) +void PopupTreeWidgetItem::setCondition(const QString & szCondition) { switch(m_type) { @@ -137,7 +137,7 @@ void KviPopupTreeWidgetItem::setCondition(const QString & szCondition) } } -void KviPopupTreeWidgetItem::setCode(const QString & szCode) +void PopupTreeWidgetItem::setCode(const QString & szCode) { switch(m_type) { @@ -152,12 +152,12 @@ void KviPopupTreeWidgetItem::setCode(const QString & szCode) } } -void KviPopupTreeWidgetItem::setId(const QString & szId) +void PopupTreeWidgetItem::setId(const QString & szId) { m_szId = szId; } -void KviPopupTreeWidgetItem::setIcon(const QString & szIcon) +void PopupTreeWidgetItem::setIcon(const QString & szIcon) { switch(m_type) { @@ -180,7 +180,7 @@ void KviPopupTreeWidgetItem::setIcon(const QString & szIcon) } -KviSinglePopupEditor::KviSinglePopupEditor(QWidget * par) +SinglePopupEditor::SinglePopupEditor(QWidget * par) : QWidget(par) { m_pLastSelectedItem = 0; @@ -274,14 +274,14 @@ KviSinglePopupEditor::KviSinglePopupEditor(QWidget * par) g->setRowStretch(1,1); } -KviSinglePopupEditor::~KviSinglePopupEditor() +SinglePopupEditor::~SinglePopupEditor() { if(m_pClipboard)delete m_pClipboard; if(m_pTestPopup)delete m_pTestPopup; KviScriptEditor::destroyInstance(m_pEditor); } -void KviSinglePopupEditor::testPopup() +void SinglePopupEditor::testPopup() { if(m_pTestPopup)delete m_pTestPopup; @@ -297,11 +297,11 @@ void KviSinglePopupEditor::testPopup() m_pTestPopup->doPopup(pnt,g_pActiveWindow,parms,true); } -KviPopupTreeWidgetItem * KviSinglePopupEditor::findMatchingItem(KviKvsPopupMenuItem * it,KviPopupTreeWidgetItem * item) +PopupTreeWidgetItem * SinglePopupEditor::findMatchingItem(KviKvsPopupMenuItem * it,PopupTreeWidgetItem * item) { if(it->type() != KviKvsPopupMenuItem::Item)goto not_this_one; - if(item->m_type != KviPopupTreeWidgetItem::Item)goto not_this_one; + if(item->m_type != PopupTreeWidgetItem::Item)goto not_this_one; if(it->name() != item->m_szId)goto not_this_one; if(it->kvsText()) { @@ -334,15 +334,15 @@ not_this_one: int count=item->childCount(); for(int i=0; i<count; i++) { - item = (KviPopupTreeWidgetItem *)item->child(i); - KviPopupTreeWidgetItem * found = findMatchingItem(it,item); + item = (PopupTreeWidgetItem *)item->child(i); + PopupTreeWidgetItem * found = findMatchingItem(it,item); if(found)return found; } return 0; } -void KviSinglePopupEditor::testModeMenuItemClicked(KviKvsPopupMenuItem * it) +void SinglePopupEditor::testModeMenuItemClicked(KviKvsPopupMenuItem * it) { saveLastSelectedItem(); // that's the first thingie @@ -350,8 +350,8 @@ void KviSinglePopupEditor::testModeMenuItemClicked(KviKvsPopupMenuItem * it) int count=m_pTreeWidget->topLevelItemCount(); for(int i=0; i<count; i++) { - KviPopupTreeWidgetItem * item = (KviPopupTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); - KviPopupTreeWidgetItem * found = findMatchingItem(it,item); + PopupTreeWidgetItem * item = (PopupTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); + PopupTreeWidgetItem * found = findMatchingItem(it,item); if(found) { // set the item as current @@ -365,19 +365,19 @@ void KviSinglePopupEditor::testModeMenuItemClicked(KviKvsPopupMenuItem * it) } -void KviSinglePopupEditor::customContextMenuRequested(const QPoint &pos) +void SinglePopupEditor::customContextMenuRequested(const QPoint &pos) { QTreeWidgetItem *it=m_pTreeWidget->itemAt(pos); m_pContextPopup->clear(); - KviPopupTreeWidgetItem * parentMenu = 0; + PopupTreeWidgetItem * parentMenu = 0; bool bIsMenu = false; if(it) { - parentMenu = (KviPopupTreeWidgetItem *) (((KviPopupTreeWidgetItem *)it)->parent()); - bIsMenu = ((KviPopupTreeWidgetItem *)it)->m_type == KviPopupTreeWidgetItem::Menu; + parentMenu = (PopupTreeWidgetItem *) (((PopupTreeWidgetItem *)it)->parent()); + bIsMenu = ((PopupTreeWidgetItem *)it)->m_type == PopupTreeWidgetItem::Menu; } m_pContextPopup->insertItem(__tr2qs_ctx("New Separator Below","editor"),this,SLOT(contextNewSeparatorBelow())); @@ -466,119 +466,119 @@ void KviSinglePopupEditor::customContextMenuRequested(const QPoint &pos) m_pContextPopup->popup(QCursor::pos()); } -void KviSinglePopupEditor::createNewItemAboveLastSelected(KviPopupTreeWidgetItem::Type t) +void SinglePopupEditor::createNewItemAboveLastSelected(PopupTreeWidgetItem::Type t) { m_pTreeWidget->setCurrentItem(newItemAbove(m_pLastSelectedItem,t)); } -void KviSinglePopupEditor::createNewItemBelowLastSelected(KviPopupTreeWidgetItem::Type t) +void SinglePopupEditor::createNewItemBelowLastSelected(PopupTreeWidgetItem::Type t) { m_pTreeWidget->setCurrentItem(newItemBelow(m_pLastSelectedItem,t)); } -void KviSinglePopupEditor::createNewItemInsideLastSelected(KviPopupTreeWidgetItem::Type t) +void SinglePopupEditor::createNewItemInsideLastSelected(PopupTreeWidgetItem::Type t) { if(m_pLastSelectedItem)m_pLastSelectedItem->setExpanded(true); m_pTreeWidget->setCurrentItem(newItemInside(m_pLastSelectedItem,t)); } -void KviSinglePopupEditor::contextNewSeparatorAbove() +void SinglePopupEditor::contextNewSeparatorAbove() { - createNewItemAboveLastSelected(KviPopupTreeWidgetItem::Separator); + createNewItemAboveLastSelected(PopupTreeWidgetItem::Separator); } -void KviSinglePopupEditor::contextNewSeparatorBelow() +void SinglePopupEditor::contextNewSeparatorBelow() { - createNewItemBelowLastSelected(KviPopupTreeWidgetItem::Separator); + createNewItemBelowLastSelected(PopupTreeWidgetItem::Separator); } -void KviSinglePopupEditor::contextNewSeparatorInside() +void SinglePopupEditor::contextNewSeparatorInside() { - createNewItemInsideLastSelected(KviPopupTreeWidgetItem::Separator); + createNewItemInsideLastSelected(PopupTreeWidgetItem::Separator); } -void KviSinglePopupEditor::contextNewItemBelow() +void SinglePopupEditor::contextNewItemBelow() { - createNewItemBelowLastSelected(KviPopupTreeWidgetItem::Item); + createNewItemBelowLastSelected(PopupTreeWidgetItem::Item); } -void KviSinglePopupEditor::contextNewItemAbove() +void SinglePopupEditor::contextNewItemAbove() { - createNewItemAboveLastSelected(KviPopupTreeWidgetItem::Item); + createNewItemAboveLastSelected(PopupTreeWidgetItem::Item); } -void KviSinglePopupEditor::contextNewItemInside() +void SinglePopupEditor::contextNewItemInside() { - createNewItemInsideLastSelected(KviPopupTreeWidgetItem::Item); + createNewItemInsideLastSelected(PopupTreeWidgetItem::Item); } -void KviSinglePopupEditor::contextNewMenuBelow() +void SinglePopupEditor::contextNewMenuBelow() { - createNewItemBelowLastSelected(KviPopupTreeWidgetItem::Menu); + createNewItemBelowLastSelected(PopupTreeWidgetItem::Menu); } -void KviSinglePopupEditor::contextNewMenuAbove() +void SinglePopupEditor::contextNewMenuAbove() { - createNewItemAboveLastSelected(KviPopupTreeWidgetItem::Menu); + createNewItemAboveLastSelected(PopupTreeWidgetItem::Menu); } -void KviSinglePopupEditor::contextNewMenuInside() +void SinglePopupEditor::contextNewMenuInside() { - createNewItemInsideLastSelected(KviPopupTreeWidgetItem::Menu); + createNewItemInsideLastSelected(PopupTreeWidgetItem::Menu); } -void KviSinglePopupEditor::contextNewExtMenuBelow() +void SinglePopupEditor::contextNewExtMenuBelow() { - createNewItemBelowLastSelected(KviPopupTreeWidgetItem::ExtMenu); + createNewItemBelowLastSelected(PopupTreeWidgetItem::ExtMenu); } -void KviSinglePopupEditor::contextNewExtMenuAbove() +void SinglePopupEditor::contextNewExtMenuAbove() { - createNewItemAboveLastSelected(KviPopupTreeWidgetItem::ExtMenu); + createNewItemAboveLastSelected(PopupTreeWidgetItem::ExtMenu); } -void KviSinglePopupEditor::contextNewExtMenuInside() +void SinglePopupEditor::contextNewExtMenuInside() { - createNewItemInsideLastSelected(KviPopupTreeWidgetItem::ExtMenu); + createNewItemInsideLastSelected(PopupTreeWidgetItem::ExtMenu); } -void KviSinglePopupEditor::contextNewLabelBelow() +void SinglePopupEditor::contextNewLabelBelow() { - createNewItemBelowLastSelected(KviPopupTreeWidgetItem::Label); + createNewItemBelowLastSelected(PopupTreeWidgetItem::Label); } -void KviSinglePopupEditor::contextNewLabelAbove() +void SinglePopupEditor::contextNewLabelAbove() { - createNewItemAboveLastSelected(KviPopupTreeWidgetItem::Label); + createNewItemAboveLastSelected(PopupTreeWidgetItem::Label); } -void KviSinglePopupEditor::contextNewLabelInside() +void SinglePopupEditor::contextNewLabelInside() { - createNewItemInsideLastSelected(KviPopupTreeWidgetItem::Label); + createNewItemInsideLastSelected(PopupTreeWidgetItem::Label); } -KviPopupTreeWidgetItem * KviSinglePopupEditor::newItem(KviPopupTreeWidgetItem * par,KviPopupTreeWidgetItem * after,KviPopupTreeWidgetItem::Type t) +PopupTreeWidgetItem * SinglePopupEditor::newItem(PopupTreeWidgetItem * par,PopupTreeWidgetItem * after,PopupTreeWidgetItem::Type t) { - if(par)return new KviPopupTreeWidgetItem(par,after,t); - return new KviPopupTreeWidgetItem(m_pTreeWidget,after,t); + if(par)return new PopupTreeWidgetItem(par,after,t); + return new PopupTreeWidgetItem(m_pTreeWidget,after,t); } -KviPopupTreeWidgetItem * KviSinglePopupEditor::newItemBelow(KviPopupTreeWidgetItem * it,KviPopupTreeWidgetItem::Type t) +PopupTreeWidgetItem * SinglePopupEditor::newItemBelow(PopupTreeWidgetItem * it,PopupTreeWidgetItem::Type t) { if(!it)return newItem(0,0,t); - return newItem((KviPopupTreeWidgetItem *)it->parent(),it,t); + return newItem((PopupTreeWidgetItem *)it->parent(),it,t); } -KviPopupTreeWidgetItem * KviSinglePopupEditor::newItemAbove(KviPopupTreeWidgetItem * it,KviPopupTreeWidgetItem::Type t) +PopupTreeWidgetItem * SinglePopupEditor::newItemAbove(PopupTreeWidgetItem * it,PopupTreeWidgetItem::Type t) { if(!it)return newItem(0,0,t); - return newItem((KviPopupTreeWidgetItem *)it->parent(),(KviPopupTreeWidgetItem *)m_pTreeWidget->itemAbove(it),t); + return newItem((PopupTreeWidgetItem *)it->parent(),(PopupTreeWidgetItem *)m_pTreeWidget->itemAbove(it),t); } -KviPopupTreeWidgetItem * KviSinglePopupEditor::newItemInside(KviPopupTreeWidgetItem * it,KviPopupTreeWidgetItem::Type t) +PopupTreeWidgetItem * SinglePopupEditor::newItemInside(PopupTreeWidgetItem * it,PopupTreeWidgetItem::Type t) { if(it) { - if(it->m_type != KviPopupTreeWidgetItem::Menu) + if(it->m_type != PopupTreeWidgetItem::Menu) { return newItemBelow(it,t); } @@ -586,36 +586,36 @@ KviPopupTreeWidgetItem * KviSinglePopupEditor::newItemInside(KviPopupTreeWidgetI return newItem(it,it,t); } -void KviSinglePopupEditor::contextNewPrologue() +void SinglePopupEditor::contextNewPrologue() { - KviPopupTreeWidgetItem * it = m_pLastSelectedItem ? (KviPopupTreeWidgetItem *)m_pLastSelectedItem->parent() : 0; + PopupTreeWidgetItem * it = m_pLastSelectedItem ? (PopupTreeWidgetItem *)m_pLastSelectedItem->parent() : 0; // if(!findPrologue(it)) // { - m_pTreeWidget->setCurrentItem(newItem(it,it,KviPopupTreeWidgetItem::Prologue)); + m_pTreeWidget->setCurrentItem(newItem(it,it,PopupTreeWidgetItem::Prologue)); // } } -void KviSinglePopupEditor::contextNewEpilogue() +void SinglePopupEditor::contextNewEpilogue() { - KviPopupTreeWidgetItem * it = m_pLastSelectedItem ? (KviPopupTreeWidgetItem *)m_pLastSelectedItem->parent() : 0; + PopupTreeWidgetItem * it = m_pLastSelectedItem ? (PopupTreeWidgetItem *)m_pLastSelectedItem->parent() : 0; // if(!findEpilogue(it)) // { - KviPopupTreeWidgetItem * after = it ? (KviPopupTreeWidgetItem *)it->child(0) : (KviPopupTreeWidgetItem *)m_pTreeWidget->topLevelItem(0); + PopupTreeWidgetItem * after = it ? (PopupTreeWidgetItem *)it->child(0) : (PopupTreeWidgetItem *)m_pTreeWidget->topLevelItem(0); if(after) { while(m_pTreeWidget->itemAbove(after)) { if(after->parent()==m_pTreeWidget->itemAbove(after)->parent()) - after = (KviPopupTreeWidgetItem *)m_pTreeWidget->itemAbove(after); + after = (PopupTreeWidgetItem *)m_pTreeWidget->itemAbove(after); } } else { after = it; } - m_pTreeWidget->setCurrentItem(newItem(it,after,KviPopupTreeWidgetItem::Epilogue)); + m_pTreeWidget->setCurrentItem(newItem(it,after,PopupTreeWidgetItem::Epilogue)); // } } -void KviSinglePopupEditor::contextCopy() +void SinglePopupEditor::contextCopy() { if(!m_pLastSelectedItem)return; if(m_pClipboard)delete m_pClipboard; @@ -623,38 +623,38 @@ void KviSinglePopupEditor::contextCopy() addItemToMenu(m_pClipboard,m_pLastSelectedItem); } -void KviSinglePopupEditor::contextCut() +void SinglePopupEditor::contextCut() { if(!m_pLastSelectedItem)return; contextCopy(); - KviPopupTreeWidgetItem * it = m_pLastSelectedItem; + PopupTreeWidgetItem * it = m_pLastSelectedItem; m_pLastSelectedItem = 0; delete it; if(!m_pLastSelectedItem)selectionChanged(); } -void KviSinglePopupEditor::contextPasteBelow() +void SinglePopupEditor::contextPasteBelow() { if(!m_pClipboard)return; - KviPopupTreeWidgetItem * par = m_pLastSelectedItem ? (KviPopupTreeWidgetItem *)m_pLastSelectedItem->parent() : 0; + PopupTreeWidgetItem * par = m_pLastSelectedItem ? (PopupTreeWidgetItem *)m_pLastSelectedItem->parent() : 0; populateMenu(m_pClipboard,par,m_pLastSelectedItem); } -void KviSinglePopupEditor::contextPasteAbove() +void SinglePopupEditor::contextPasteAbove() { if(!m_pClipboard)return; - KviPopupTreeWidgetItem * par = m_pLastSelectedItem ? (KviPopupTreeWidgetItem *)m_pLastSelectedItem->parent() : 0; - KviPopupTreeWidgetItem * above = m_pLastSelectedItem ? (KviPopupTreeWidgetItem *)m_pTreeWidget->itemAbove(m_pLastSelectedItem) : 0; + PopupTreeWidgetItem * par = m_pLastSelectedItem ? (PopupTreeWidgetItem *)m_pLastSelectedItem->parent() : 0; + PopupTreeWidgetItem * above = m_pLastSelectedItem ? (PopupTreeWidgetItem *)m_pTreeWidget->itemAbove(m_pLastSelectedItem) : 0; populateMenu(m_pClipboard,par,above); } -void KviSinglePopupEditor::contextPasteInside() +void SinglePopupEditor::contextPasteInside() { if(!m_pClipboard)return; if(m_pLastSelectedItem) { - if(m_pLastSelectedItem->m_type != KviPopupTreeWidgetItem::Menu) + if(m_pLastSelectedItem->m_type != PopupTreeWidgetItem::Menu) { contextPasteBelow(); return; @@ -664,7 +664,7 @@ void KviSinglePopupEditor::contextPasteInside() populateMenu(m_pClipboard,m_pLastSelectedItem,0); } -void KviSinglePopupEditor::saveLastSelectedItem() +void SinglePopupEditor::saveLastSelectedItem() { if(!m_pLastSelectedItem)return; @@ -672,9 +672,9 @@ void KviSinglePopupEditor::saveLastSelectedItem() switch(m_pLastSelectedItem->m_type) { - case KviPopupTreeWidgetItem::Prologue: - case KviPopupTreeWidgetItem::Epilogue: - case KviPopupTreeWidgetItem::Item: + case PopupTreeWidgetItem::Prologue: + case PopupTreeWidgetItem::Epilogue: + case PopupTreeWidgetItem::Item: { QString tmpx; m_pEditor->getText(tmpx); @@ -689,9 +689,9 @@ void KviSinglePopupEditor::saveLastSelectedItem() switch(m_pLastSelectedItem->m_type) { - case KviPopupTreeWidgetItem::Menu: - case KviPopupTreeWidgetItem::ExtMenu: - case KviPopupTreeWidgetItem::Item: + case PopupTreeWidgetItem::Menu: + case PopupTreeWidgetItem::ExtMenu: + case PopupTreeWidgetItem::Item: m_pLastSelectedItem->setIcon(m_pIconEditor->text()); break; default: @@ -700,10 +700,10 @@ void KviSinglePopupEditor::saveLastSelectedItem() switch(m_pLastSelectedItem->m_type) { - case KviPopupTreeWidgetItem::Menu: - case KviPopupTreeWidgetItem::Item: - case KviPopupTreeWidgetItem::Label: - case KviPopupTreeWidgetItem::ExtMenu: + case PopupTreeWidgetItem::Menu: + case PopupTreeWidgetItem::Item: + case PopupTreeWidgetItem::Label: + case PopupTreeWidgetItem::ExtMenu: m_pLastSelectedItem->setItemText(m_pTextEditor->text()); break; default: @@ -712,61 +712,61 @@ void KviSinglePopupEditor::saveLastSelectedItem() switch(m_pLastSelectedItem->m_type) { - case KviPopupTreeWidgetItem::Menu: - case KviPopupTreeWidgetItem::Item: - case KviPopupTreeWidgetItem::Label: - case KviPopupTreeWidgetItem::ExtMenu: - case KviPopupTreeWidgetItem::Separator: + case PopupTreeWidgetItem::Menu: + case PopupTreeWidgetItem::Item: + case PopupTreeWidgetItem::Label: + case PopupTreeWidgetItem::ExtMenu: + case PopupTreeWidgetItem::Separator: m_pLastSelectedItem->setCondition(m_pConditionEditor->text()); break; default: break; } - if(m_pLastSelectedItem->m_type == KviPopupTreeWidgetItem::ExtMenu) + if(m_pLastSelectedItem->m_type == PopupTreeWidgetItem::ExtMenu) { m_pLastSelectedItem->setCode(m_pExtNameEditor->text()); } } -void KviSinglePopupEditor::addItemToMenu(KviKvsPopupMenu * p,KviPopupTreeWidgetItem *it) +void SinglePopupEditor::addItemToMenu(KviKvsPopupMenu * p,PopupTreeWidgetItem *it) { it->m_szId.trimmed(); switch(it->m_type) { - case KviPopupTreeWidgetItem::Prologue: + case PopupTreeWidgetItem::Prologue: it->m_szCode.trimmed(); p->addPrologue(it->m_szId,it->m_szCode); break; - case KviPopupTreeWidgetItem::Epilogue: + case PopupTreeWidgetItem::Epilogue: it->m_szCode.trimmed(); p->addEpilogue(it->m_szId,it->m_szCode); break; - case KviPopupTreeWidgetItem::Separator: + case PopupTreeWidgetItem::Separator: it->m_szCondition.trimmed(); p->addSeparator(it->m_szId,it->m_szCondition); break; - case KviPopupTreeWidgetItem::Label: + case PopupTreeWidgetItem::Label: it->m_szText.trimmed(); it->m_szCondition.trimmed(); it->m_szIcon.trimmed(); p->addLabel(it->m_szId,it->m_szText,it->m_szIcon,it->m_szCondition); break; - case KviPopupTreeWidgetItem::Item: + case PopupTreeWidgetItem::Item: it->m_szText.trimmed(); it->m_szIcon.trimmed(); it->m_szCondition.trimmed(); it->m_szCode.trimmed(); p->addItem(it->m_szId,it->m_szCode,it->m_szText,it->m_szIcon,it->m_szCondition); break; - case KviPopupTreeWidgetItem::ExtMenu: + case PopupTreeWidgetItem::ExtMenu: it->m_szText.trimmed(); it->m_szIcon.trimmed(); it->m_szCondition.trimmed(); it->m_szCode.trimmed();// <-- this is the ext name in fact p->addExtPopup(it->m_szId,it->m_szCode,it->m_szText,it->m_szIcon,it->m_szCondition); break; - case KviPopupTreeWidgetItem::Menu: + case PopupTreeWidgetItem::Menu: { it->m_szText.trimmed(); it->m_szIcon.trimmed(); @@ -775,7 +775,7 @@ void KviSinglePopupEditor::addItemToMenu(KviKvsPopupMenu * p,KviPopupTreeWidgetI int count= it->childCount(); for(int i=0; i<count; i++) { - addItemToMenu(menu,(KviPopupTreeWidgetItem *)it->child(i)); + addItemToMenu(menu,(PopupTreeWidgetItem *)it->child(i)); } } break; @@ -784,7 +784,7 @@ void KviSinglePopupEditor::addItemToMenu(KviKvsPopupMenu * p,KviPopupTreeWidgetI } } -KviKvsPopupMenu * KviSinglePopupEditor::getMenu() +KviKvsPopupMenu * SinglePopupEditor::getMenu() { saveLastSelectedItem(); @@ -796,12 +796,12 @@ KviKvsPopupMenu * KviSinglePopupEditor::getMenu() int count= m_pTreeWidget->topLevelItemCount(); for(int i=0; i<count; i++) { - addItemToMenu(p,(KviPopupTreeWidgetItem *)m_pTreeWidget->topLevelItem(i)); + addItemToMenu(p,(PopupTreeWidgetItem *)m_pTreeWidget->topLevelItem(i)); } return p; } -void KviSinglePopupEditor::selectionChanged() +void SinglePopupEditor::selectionChanged() { saveLastSelectedItem(); @@ -822,67 +822,67 @@ void KviSinglePopupEditor::selectionChanged() if(it) { - m_pIdEditor->setText(((KviPopupTreeWidgetItem *)it)->m_szId); + m_pIdEditor->setText(((PopupTreeWidgetItem *)it)->m_szId); - switch(((KviPopupTreeWidgetItem *)it)->m_type) + switch(((PopupTreeWidgetItem *)it)->m_type) { - case KviPopupTreeWidgetItem::Prologue: - case KviPopupTreeWidgetItem::Epilogue: - case KviPopupTreeWidgetItem::Item: - m_pEditor->setText(((KviPopupTreeWidgetItem *)it)->m_szCode); + case PopupTreeWidgetItem::Prologue: + case PopupTreeWidgetItem::Epilogue: + case PopupTreeWidgetItem::Item: + m_pEditor->setText(((PopupTreeWidgetItem *)it)->m_szCode); bEditorEnabled = true; break; default: break; } - switch(((KviPopupTreeWidgetItem *)it)->m_type) + switch(((PopupTreeWidgetItem *)it)->m_type) { - case KviPopupTreeWidgetItem::Menu: - case KviPopupTreeWidgetItem::Item: - case KviPopupTreeWidgetItem::Label: - case KviPopupTreeWidgetItem::ExtMenu: - m_pIconEditor->setText(((KviPopupTreeWidgetItem *)it)->m_szIcon); + case PopupTreeWidgetItem::Menu: + case PopupTreeWidgetItem::Item: + case PopupTreeWidgetItem::Label: + case PopupTreeWidgetItem::ExtMenu: + m_pIconEditor->setText(((PopupTreeWidgetItem *)it)->m_szIcon); bIconEditorEnabled = true; break; default: break; } - switch(((KviPopupTreeWidgetItem *)it)->m_type) + switch(((PopupTreeWidgetItem *)it)->m_type) { - case KviPopupTreeWidgetItem::Menu: - case KviPopupTreeWidgetItem::Item: - case KviPopupTreeWidgetItem::Label: - case KviPopupTreeWidgetItem::ExtMenu: - m_pTextEditor->setText(((KviPopupTreeWidgetItem *)it)->m_szText); + case PopupTreeWidgetItem::Menu: + case PopupTreeWidgetItem::Item: + case PopupTreeWidgetItem::Label: + case PopupTreeWidgetItem::ExtMenu: + m_pTextEditor->setText(((PopupTreeWidgetItem *)it)->m_szText); bTextEditorEnabled = true; break; default: break; } - switch(((KviPopupTreeWidgetItem *)it)->m_type) + switch(((PopupTreeWidgetItem *)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); + case PopupTreeWidgetItem::Menu: + case PopupTreeWidgetItem::Item: + case PopupTreeWidgetItem::Label: + case PopupTreeWidgetItem::ExtMenu: + case PopupTreeWidgetItem::Separator: + m_pConditionEditor->setText(((PopupTreeWidgetItem *)it)->m_szCondition); bConditionEditorEnabled = true; break; default: break; } - if(((KviPopupTreeWidgetItem *)it)->m_type == KviPopupTreeWidgetItem::ExtMenu) + if(((PopupTreeWidgetItem *)it)->m_type == PopupTreeWidgetItem::ExtMenu) { - m_pExtNameEditor->setText(((KviPopupTreeWidgetItem *)it)->m_szCode); + m_pExtNameEditor->setText(((PopupTreeWidgetItem *)it)->m_szCode); bNameEditorEnabled =true; } } - m_pLastSelectedItem = (KviPopupTreeWidgetItem *)it; + m_pLastSelectedItem = (PopupTreeWidgetItem *)it; if(!bEditorEnabled)m_pEditor->setText(""); m_pEditor->setEnabled(bEditorEnabled); @@ -898,25 +898,25 @@ void KviSinglePopupEditor::selectionChanged() m_pIdEditor->setEnabled(it); } -void KviSinglePopupEditor::populateMenu(KviKvsPopupMenu * pop,KviPopupTreeWidgetItem * par,KviPopupTreeWidgetItem * theItem) +void SinglePopupEditor::populateMenu(KviKvsPopupMenu * pop,PopupTreeWidgetItem * par,PopupTreeWidgetItem * theItem) { if(!pop)return; for(KviKvsScript * sp = pop->prologues()->first();sp;sp = pop->prologues()->next()) { - if(par)theItem = new KviPopupTreeWidgetItem(par,theItem,KviPopupTreeWidgetItem::Prologue); - else theItem = new KviPopupTreeWidgetItem(m_pTreeWidget,theItem,KviPopupTreeWidgetItem::Prologue); + if(par)theItem = new PopupTreeWidgetItem(par,theItem,PopupTreeWidgetItem::Prologue); + else theItem = new PopupTreeWidgetItem(m_pTreeWidget,theItem,PopupTreeWidgetItem::Prologue); theItem->setCode(sp->code()); theItem->setId(sp->name()); } - for(KviKvsPopupMenuItem * item = pop->m_pItemList->first();item;item = pop->m_pItemList->next()) + for(KviKvsPopupMenuItem * item = pop->itemList()->first();item;item = pop->itemList()->next()) { switch(item->type()) { case KviKvsPopupMenuItem::Item: - if(par)theItem = new KviPopupTreeWidgetItem(par,theItem,KviPopupTreeWidgetItem::Item); - else theItem = new KviPopupTreeWidgetItem(m_pTreeWidget,theItem,KviPopupTreeWidgetItem::Item); + if(par)theItem = new PopupTreeWidgetItem(par,theItem,PopupTreeWidgetItem::Item); + else theItem = new PopupTreeWidgetItem(m_pTreeWidget,theItem,PopupTreeWidgetItem::Item); theItem->setIcon(item->kvsIcon() ? item->kvsIcon()->code() : QString()); theItem->setItemText(item->kvsText() ? item->kvsText()->code() : QString()); theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : QString()); @@ -924,8 +924,8 @@ void KviSinglePopupEditor::populateMenu(KviKvsPopupMenu * pop,KviPopupTreeWidget theItem->setId(item->name()); break; case KviKvsPopupMenuItem::ExtMenu: - if(par)theItem = new KviPopupTreeWidgetItem(par,theItem,KviPopupTreeWidgetItem::ExtMenu); - else theItem = new KviPopupTreeWidgetItem(m_pTreeWidget,theItem,KviPopupTreeWidgetItem::ExtMenu); + if(par)theItem = new PopupTreeWidgetItem(par,theItem,PopupTreeWidgetItem::ExtMenu); + else theItem = new PopupTreeWidgetItem(m_pTreeWidget,theItem,PopupTreeWidgetItem::ExtMenu); theItem->setIcon(item->kvsIcon() ? item->kvsIcon()->code() : QString()); theItem->setItemText(item->kvsText() ? item->kvsText()->code() : QString()); theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : QString()); @@ -933,22 +933,22 @@ void KviSinglePopupEditor::populateMenu(KviKvsPopupMenu * pop,KviPopupTreeWidget theItem->setId(item->name()); break; case KviKvsPopupMenuItem::Label: - if(par)theItem = new KviPopupTreeWidgetItem(par,theItem,KviPopupTreeWidgetItem::Label); - else theItem = new KviPopupTreeWidgetItem(m_pTreeWidget,theItem,KviPopupTreeWidgetItem::Label); + if(par)theItem = new PopupTreeWidgetItem(par,theItem,PopupTreeWidgetItem::Label); + else theItem = new PopupTreeWidgetItem(m_pTreeWidget,theItem,PopupTreeWidgetItem::Label); theItem->setIcon(item->kvsIcon() ? item->kvsIcon()->code() : QString()); theItem->setItemText(item->kvsText() ? item->kvsText()->code() : QString()); theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : QString()); theItem->setId(item->name()); break; case KviKvsPopupMenuItem::Separator: - if(par)theItem = new KviPopupTreeWidgetItem(par,theItem,KviPopupTreeWidgetItem::Separator); - else theItem = new KviPopupTreeWidgetItem(m_pTreeWidget,theItem,KviPopupTreeWidgetItem::Separator); + if(par)theItem = new PopupTreeWidgetItem(par,theItem,PopupTreeWidgetItem::Separator); + else theItem = new PopupTreeWidgetItem(m_pTreeWidget,theItem,PopupTreeWidgetItem::Separator); theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : QString()); theItem->setId(item->name()); break; case KviKvsPopupMenuItem::Menu: - if(par)theItem = new KviPopupTreeWidgetItem(par,theItem,KviPopupTreeWidgetItem::Menu); - else theItem = new KviPopupTreeWidgetItem(m_pTreeWidget,theItem,KviPopupTreeWidgetItem::Menu); + if(par)theItem = new PopupTreeWidgetItem(par,theItem,PopupTreeWidgetItem::Menu); + else theItem = new PopupTreeWidgetItem(m_pTreeWidget,theItem,PopupTreeWidgetItem::Menu); theItem->setIcon(item->kvsIcon() ? item->kvsIcon()->code() : QString()); theItem->setItemText(item->kvsText() ? item->kvsText()->code() : QString()); theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : QString()); @@ -962,8 +962,8 @@ void KviSinglePopupEditor::populateMenu(KviKvsPopupMenu * pop,KviPopupTreeWidget for(KviKvsScript * se = pop->epilogues()->first();se;se = pop->epilogues()->next()) { - if(par)theItem = new KviPopupTreeWidgetItem(par,theItem,KviPopupTreeWidgetItem::Epilogue); - else theItem = new KviPopupTreeWidgetItem(m_pTreeWidget,theItem,KviPopupTreeWidgetItem::Epilogue); + if(par)theItem = new PopupTreeWidgetItem(par,theItem,PopupTreeWidgetItem::Epilogue); + else theItem = new PopupTreeWidgetItem(m_pTreeWidget,theItem,PopupTreeWidgetItem::Epilogue); theItem->setCode(se->code()); theItem->setId(se->name()); } @@ -971,7 +971,7 @@ void KviSinglePopupEditor::populateMenu(KviKvsPopupMenu * pop,KviPopupTreeWidget m_pTreeWidget->resizeColumnToContents(0); } -void KviSinglePopupEditor::edit(KviMenuTreeWidgetItem * it) +void SinglePopupEditor::edit(MenuTreeWidgetItem * it) { saveLastSelectedItem(); @@ -1007,7 +1007,7 @@ void KviSinglePopupEditor::edit(KviMenuTreeWidgetItem * it) } -KviMenuTreeWidgetItem::KviMenuTreeWidgetItem(QTreeWidget * par,KviKvsPopupMenu * popup) +MenuTreeWidgetItem::MenuTreeWidgetItem(QTreeWidget * par,KviKvsPopupMenu * popup) : QTreeWidgetItem(par) { setIcon(0,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_POPUP))); @@ -1015,18 +1015,18 @@ KviMenuTreeWidgetItem::KviMenuTreeWidgetItem(QTreeWidget * par,KviKvsPopupMenu * m_pPopup = popup; } -KviMenuTreeWidgetItem::~KviMenuTreeWidgetItem() +MenuTreeWidgetItem::~MenuTreeWidgetItem() { delete m_pPopup; } -void KviMenuTreeWidgetItem::replacePopup(KviKvsPopupMenu * popup) +void MenuTreeWidgetItem::replacePopup(KviKvsPopupMenu * popup) { delete m_pPopup; m_pPopup = popup; } -KviPopupEditor::KviPopupEditor(QWidget * par) +PopupEditorWidget::PopupEditorWidget(QWidget * par) : QWidget(par) { m_bSaving = false; @@ -1049,7 +1049,7 @@ KviPopupEditor::KviPopupEditor(QWidget * par) QPushButton * gn = new QPushButton(__tr2qs_ctx("&Export selected To...","editor"),box); connect(gn,SIGNAL(clicked()),this,SLOT(exportSelected())); - m_pEditor = new KviSinglePopupEditor(spl); + m_pEditor = new SinglePopupEditor(spl); m_bOneTimeSetupDone = false; m_pLastEditedItem = 0; @@ -1063,11 +1063,11 @@ KviPopupEditor::KviPopupEditor(QWidget * par) currentItemChanged(0,0); } -KviPopupEditor::~KviPopupEditor() +PopupEditorWidget::~PopupEditorWidget() { } -void KviPopupEditor::oneTimeSetup() +void PopupEditorWidget::oneTimeSetup() { if(m_bOneTimeSetupDone)return; m_bOneTimeSetupDone = true; @@ -1082,7 +1082,7 @@ void KviPopupEditor::oneTimeSetup() KviKvsPopupMenu * popup = it.current(); KviKvsPopupMenu * copy = new KviKvsPopupMenu(popup->popupName()); copy->copyFrom(popup); - new KviMenuTreeWidgetItem(m_pTreeWidget,copy); + new MenuTreeWidgetItem(m_pTreeWidget,copy); ++it; } @@ -1093,7 +1093,7 @@ void KviPopupEditor::oneTimeSetup() connect(KviKvsPopupManager::instance(),SIGNAL(popupRefresh(const QString &)),this,SLOT(popupRefresh(const QString &))); } -void KviPopupEditor::popupRefresh(const QString &szName) +void PopupEditorWidget::popupRefresh(const QString &szName) { if(m_bSaving) return; @@ -1106,7 +1106,7 @@ void KviPopupEditor::popupRefresh(const QString &szName) // if it already exists, replace its popup for(int i=0; i<m_pTreeWidget->topLevelItemCount();i++) { - KviMenuTreeWidgetItem * ch = (KviMenuTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); + MenuTreeWidgetItem * ch = (MenuTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); if(KviQString::equalCI(szName,ch->m_pPopup->popupName())) { @@ -1131,10 +1131,10 @@ void KviPopupEditor::popupRefresh(const QString &szName) // create it KviKvsPopupMenu * pCopy = new KviKvsPopupMenu(szName); pCopy->copyFrom(pPopup); - new KviMenuTreeWidgetItem(m_pTreeWidget,pCopy); + new MenuTreeWidgetItem(m_pTreeWidget,pCopy); } -void KviPopupEditor::customContextMenuRequested(const QPoint &pos) +void PopupEditorWidget::customContextMenuRequested(const QPoint &pos) { QTreeWidgetItem *it=m_pTreeWidget->itemAt(pos); KVI_ASSERT(m_bOneTimeSetupDone); @@ -1172,7 +1172,7 @@ void KviPopupEditor::customContextMenuRequested(const QPoint &pos) } } -void KviPopupEditor::exportCurrentPopup() +void PopupEditorWidget::exportCurrentPopup() { if(!m_pLastEditedItem)return; saveLastEditedItem(); @@ -1196,19 +1196,19 @@ void KviPopupEditor::exportCurrentPopup() } } -void KviPopupEditor::exportAll() +void PopupEditorWidget::exportAll() { bool bSelectedOnly=true; exportPopups(bSelectedOnly); } -void KviPopupEditor::exportSelected() +void PopupEditorWidget::exportSelected() { bool bSelectedOnly=false; exportPopups(bSelectedOnly); } -void KviPopupEditor::exportPopups(bool bSelectedOnly) +void PopupEditorWidget::exportPopups(bool bSelectedOnly) { saveLastEditedItem(); @@ -1217,7 +1217,7 @@ void KviPopupEditor::exportPopups(bool bSelectedOnly) for(int i=0; i<topcount;i++) { - KviMenuTreeWidgetItem * it = (KviMenuTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); + MenuTreeWidgetItem * it = (MenuTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); if ( (it->isSelected()) || (bSelectedOnly == true) ) { count++; @@ -1243,26 +1243,26 @@ void KviPopupEditor::exportPopups(bool bSelectedOnly) } } -void KviPopupEditor::removeCurrentPopup() +void PopupEditorWidget::removeCurrentPopup() { if(m_pLastEditedItem) { - KviMenuTreeWidgetItem * it = m_pLastEditedItem; + MenuTreeWidgetItem * it = m_pLastEditedItem; m_pLastEditedItem = 0; delete it; if(!m_pLastEditedItem)currentItemChanged(0,0); } } -void KviPopupEditor::newPopup() +void PopupEditorWidget::newPopup() { QString newName; getUniquePopupName(0,newName); - KviMenuTreeWidgetItem * it = new KviMenuTreeWidgetItem(m_pTreeWidget,new KviKvsPopupMenu(newName)); + MenuTreeWidgetItem * it = new MenuTreeWidgetItem(m_pTreeWidget,new KviKvsPopupMenu(newName)); m_pTreeWidget->setCurrentItem(it); } -void KviPopupEditor::saveLastEditedItem() +void PopupEditorWidget::saveLastEditedItem() { if(m_pLastEditedItem == 0)return; @@ -1279,22 +1279,22 @@ void KviPopupEditor::saveLastEditedItem() m_pLastEditedItem->setText(0,m->popupName()); } -void KviPopupEditor::currentItemChanged(QTreeWidgetItem *it, QTreeWidgetItem *) +void PopupEditorWidget::currentItemChanged(QTreeWidgetItem *it, QTreeWidgetItem *) { saveLastEditedItem(); - m_pLastEditedItem = (KviMenuTreeWidgetItem *)it; + m_pLastEditedItem = (MenuTreeWidgetItem *)it; m_pEditor->edit(m_pLastEditedItem); } -void KviPopupEditor::showEvent(QShowEvent *e) +void PopupEditorWidget::showEvent(QShowEvent *e) { oneTimeSetup(); QWidget::showEvent(e); } -void KviPopupEditor::commit() +void PopupEditorWidget::commit() { m_bSaving = true; if(!m_bOneTimeSetupDone)return; @@ -1311,7 +1311,7 @@ void KviPopupEditor::commit() for(int i=0; i<topcount;i++) { - KviMenuTreeWidgetItem * it = (KviMenuTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); + MenuTreeWidgetItem * it = (MenuTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); KviKvsPopupMenu * p = KviKvsPopupManager::instance()->get(it->m_pPopup->popupName()); p->doClear(); p->copyFrom(it->m_pPopup); @@ -1334,7 +1334,7 @@ void KviPopupEditor::commit() m_bSaving = false; } -void KviPopupEditor::getUniquePopupName(KviMenuTreeWidgetItem *item,QString &buffer) +void PopupEditorWidget::getUniquePopupName(MenuTreeWidgetItem *item,QString &buffer) { KVI_ASSERT(m_bOneTimeSetupDone); @@ -1351,7 +1351,7 @@ void KviPopupEditor::getUniquePopupName(KviMenuTreeWidgetItem *item,QString &buf for(int i=0; i<topcount;i++) { - KviMenuTreeWidgetItem * ch = (KviMenuTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); + MenuTreeWidgetItem * ch = (MenuTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); if(KviQString::equalCI(newName,ch->m_pPopup->popupName()) && (ch != item)) { @@ -1368,13 +1368,13 @@ void KviPopupEditor::getUniquePopupName(KviMenuTreeWidgetItem *item,QString &buf } -KviPopupEditorWindow::KviPopupEditorWindow(KviMainWindow * lpFrm) +PopupEditorWindow::PopupEditorWindow(KviMainWindow * lpFrm) : KviWindow(KVI_WINDOW_TYPE_SCRIPTEDITOR,lpFrm,"popupeditor",0) { g_pPopupEditorWindow = this; QGridLayout * g = new QGridLayout(); - m_pEditor = new KviPopupEditor(this); + m_pEditor = new PopupEditorWidget(this); g->addWidget(m_pEditor,0,0,1,4); QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK","editor"),this); @@ -1397,43 +1397,43 @@ KviPopupEditorWindow::KviPopupEditorWindow(KviMainWindow * lpFrm) setLayout(g); } -KviPopupEditorWindow::~KviPopupEditorWindow() +PopupEditorWindow::~PopupEditorWindow() { g_pPopupEditorWindow = 0; } -void KviPopupEditorWindow::okClicked() +void PopupEditorWindow::okClicked() { m_pEditor->commit(); close(); } -void KviPopupEditorWindow::applyClicked() +void PopupEditorWindow::applyClicked() { m_pEditor->commit(); } -void KviPopupEditorWindow::cancelClicked() +void PopupEditorWindow::cancelClicked() { close(); } -QPixmap * KviPopupEditorWindow::myIconPtr() +QPixmap * PopupEditorWindow::myIconPtr() { return g_pIconManager->getSmallIcon(KVI_SMALLICON_POPUP); } -void KviPopupEditorWindow::fillCaptionBuffers() +void PopupEditorWindow::fillCaptionBuffers() { m_szPlainTextCaption = __tr2qs_ctx("Popup Editor","editor"); } -void KviPopupEditorWindow::getConfigGroupName(QString &szName) +void PopupEditorWindow::getConfigGroupName(QString &szName) { szName = "popupeditor"; } -void KviPopupEditorWindow::saveProperties(KviConfigurationFile *) //cfg +void PopupEditorWindow::saveProperties(KviConfigurationFile *) //cfg { /* #ifdef COMPILE_SCRIPTTOOLBAR @@ -1444,7 +1444,7 @@ void KviPopupEditorWindow::saveProperties(KviConfigurationFile *) //cfg */ } -void KviPopupEditorWindow::loadProperties(KviConfigurationFile *) // cfg +void PopupEditorWindow::loadProperties(KviConfigurationFile *) // cfg { /* #ifdef COMPILE_SCRIPTTOOLBAR diff --git a/src/modules/popupeditor/popupeditor.h b/src/modules/popupeditor/PopupEditorWindow.h index 75089d246..cb2873502 100644 --- a/src/modules/popupeditor/popupeditor.h +++ b/src/modules/popupeditor/PopupEditorWindow.h @@ -2,7 +2,7 @@ #define _POPUPEDITOR_H_ //============================================================================= // -// File : popupeditor.h +// File : PopupEditorWindow.h // Creation date : Mon Dec 23 2002 20:24:55 CEST by Szymon Stefanek // // This file is part of the KVIrc irc client distribution @@ -36,16 +36,16 @@ class KviKvsPopupMenu; class KviKvsPopupMenuItem; class KviScriptEditor; -class KviMenuTreeWidgetItem; +class MenuTreeWidgetItem; -// KviPopupTreeWidgetItem -class KviPopupTreeWidgetItem : public QTreeWidgetItem +// PopupTreeWidgetItem +class PopupTreeWidgetItem : public QTreeWidgetItem { public: enum Type { Item, Menu, Separator, Label, Epilogue, Prologue, ExtMenu }; public: - KviPopupTreeWidgetItem(QTreeWidget * pTreeWidget,KviPopupTreeWidgetItem * after,Type t); - KviPopupTreeWidgetItem(KviPopupTreeWidgetItem * parent,KviPopupTreeWidgetItem * after,Type t); + PopupTreeWidgetItem(QTreeWidget * pTreeWidget,PopupTreeWidgetItem * after,Type t); + PopupTreeWidgetItem(PopupTreeWidgetItem * parent,PopupTreeWidgetItem * after,Type t); public: Type m_type; QString m_szText; @@ -64,17 +64,17 @@ public: }; -class KviSinglePopupEditor : public QWidget +class SinglePopupEditor : public QWidget { Q_OBJECT public: - KviSinglePopupEditor(QWidget * par); - ~KviSinglePopupEditor(); + SinglePopupEditor(QWidget * par); + ~SinglePopupEditor(); protected: QPushButton * m_pMenuButton; KviKvsPopupMenu * m_pClipboard; KviKvsPopupMenu * m_pTestPopup; - KviPopupTreeWidgetItem * m_pLastSelectedItem; + PopupTreeWidgetItem * m_pLastSelectedItem; QTreeWidget * m_pTreeWidget; QLineEdit * m_pNameEditor; KviScriptEditor * m_pEditor; @@ -85,21 +85,21 @@ protected: QLineEdit * m_pExtNameEditor; KviTalPopupMenu * m_pContextPopup; public: - void edit(KviMenuTreeWidgetItem * it); + void edit(MenuTreeWidgetItem * it); KviKvsPopupMenu * getMenu(); protected: // theItem is the item above the first item that has to be inserted - void populateMenu(KviKvsPopupMenu * pop,KviPopupTreeWidgetItem * par,KviPopupTreeWidgetItem * theItem = 0); + void populateMenu(KviKvsPopupMenu * pop,PopupTreeWidgetItem * par,PopupTreeWidgetItem * theItem = 0); void saveLastSelectedItem(); - void addItemToMenu(KviKvsPopupMenu * pop,KviPopupTreeWidgetItem * par); - KviPopupTreeWidgetItem * newItem(KviPopupTreeWidgetItem * par,KviPopupTreeWidgetItem * after,KviPopupTreeWidgetItem::Type t); - KviPopupTreeWidgetItem * newItemBelow(KviPopupTreeWidgetItem * it,KviPopupTreeWidgetItem::Type t); - KviPopupTreeWidgetItem * newItemAbove(KviPopupTreeWidgetItem * it,KviPopupTreeWidgetItem::Type t); - KviPopupTreeWidgetItem * newItemInside(KviPopupTreeWidgetItem * it,KviPopupTreeWidgetItem::Type t); - void createNewItemAboveLastSelected(KviPopupTreeWidgetItem::Type t); - void createNewItemBelowLastSelected(KviPopupTreeWidgetItem::Type t); - void createNewItemInsideLastSelected(KviPopupTreeWidgetItem::Type t); - KviPopupTreeWidgetItem * findMatchingItem(KviKvsPopupMenuItem * it,KviPopupTreeWidgetItem * item); + void addItemToMenu(KviKvsPopupMenu * pop,PopupTreeWidgetItem * par); + PopupTreeWidgetItem * newItem(PopupTreeWidgetItem * par,PopupTreeWidgetItem * after,PopupTreeWidgetItem::Type t); + PopupTreeWidgetItem * newItemBelow(PopupTreeWidgetItem * it,PopupTreeWidgetItem::Type t); + PopupTreeWidgetItem * newItemAbove(PopupTreeWidgetItem * it,PopupTreeWidgetItem::Type t); + PopupTreeWidgetItem * newItemInside(PopupTreeWidgetItem * it,PopupTreeWidgetItem::Type t); + void createNewItemAboveLastSelected(PopupTreeWidgetItem::Type t); + void createNewItemBelowLastSelected(PopupTreeWidgetItem::Type t); + void createNewItemInsideLastSelected(PopupTreeWidgetItem::Type t); + PopupTreeWidgetItem * findMatchingItem(KviKvsPopupMenuItem * it,PopupTreeWidgetItem * item); protected slots: void contextCut(); void contextCopy(); @@ -131,11 +131,11 @@ protected slots: -class KviMenuTreeWidgetItem : public QTreeWidgetItem +class MenuTreeWidgetItem : public QTreeWidgetItem { public: - KviMenuTreeWidgetItem(QTreeWidget * par,KviKvsPopupMenu * popup); - ~KviMenuTreeWidgetItem(); + MenuTreeWidgetItem(QTreeWidget * par,KviKvsPopupMenu * popup); + ~MenuTreeWidgetItem(); public: KviKvsPopupMenu * m_pPopup; public: @@ -145,16 +145,16 @@ public: }; -class KviPopupEditor : public QWidget +class PopupEditorWidget : public QWidget { Q_OBJECT public: - KviPopupEditor(QWidget * par); - ~KviPopupEditor(); + PopupEditorWidget(QWidget * par); + ~PopupEditorWidget(); public: - KviSinglePopupEditor * m_pEditor; + SinglePopupEditor * m_pEditor; QTreeWidget * m_pTreeWidget; - KviMenuTreeWidgetItem * m_pLastEditedItem; + MenuTreeWidgetItem * m_pLastEditedItem; bool m_bOneTimeSetupDone; KviTalPopupMenu * m_pContextPopup; KviTalPopupMenu * m_pEmptyContextPopup; @@ -173,23 +173,23 @@ protected slots: void popupRefresh(const QString &szName); protected: void showEvent(QShowEvent *e); - void getExportPopupBuffer(QString &buffer,KviMenuTreeWidgetItem * it); + void getExportPopupBuffer(QString &buffer,MenuTreeWidgetItem * it); private: void oneTimeSetup(); void saveLastEditedItem(); - void getUniquePopupName(KviMenuTreeWidgetItem * it,QString &buffer); + void getUniquePopupName(MenuTreeWidgetItem * it,QString &buffer); }; -class KviPopupEditorWindow : public KviWindow +class PopupEditorWindow : public KviWindow { Q_OBJECT public: - KviPopupEditorWindow(KviMainWindow * lpFrm); - ~KviPopupEditorWindow(); + PopupEditorWindow(KviMainWindow * lpFrm); + ~PopupEditorWindow(); protected: - KviPopupEditor * m_pEditor; + PopupEditorWidget * m_pEditor; protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); diff --git a/src/modules/popupeditor/libkvipopupeditor.cpp b/src/modules/popupeditor/libkvipopupeditor.cpp index 6fef3cddd..6db24dc08 100644 --- a/src/modules/popupeditor/libkvipopupeditor.cpp +++ b/src/modules/popupeditor/libkvipopupeditor.cpp @@ -22,14 +22,14 @@ // //============================================================================= -#include "popupeditor.h" +#include "PopupEditorWindow.h" #include "KviModule.h" #include "KviLocale.h" #include "KviMainWindow.h" -KviPopupEditorWindow * g_pPopupEditorWindow = 0; +PopupEditorWindow * g_pPopupEditorWindow = 0; /* @@ -50,7 +50,7 @@ static bool popupeditor_kvs_cmd_open(KviKvsModuleCommandCall * c) { if(!g_pPopupEditorWindow) { - g_pPopupEditorWindow = new KviPopupEditorWindow(c->window()->frame()); + g_pPopupEditorWindow = new PopupEditorWindow(c->window()->frame()); c->window()->frame()->addWindow(g_pPopupEditorWindow); } |
