diff options
| -rw-r--r-- | src/kvirc/ui/kvi_input_editor.cpp | 38 | ||||
| -rw-r--r-- | src/modules/actioneditor/actioneditor.cpp | 31 | ||||
| -rw-r--r-- | src/modules/actioneditor/actioneditor.h | 2 | ||||
| -rw-r--r-- | src/modules/aliaseditor/aliaseditor.cpp | 31 | ||||
| -rw-r--r-- | src/modules/aliaseditor/aliaseditor.h | 2 | ||||
| -rw-r--r-- | src/modules/eventeditor/eventeditor.cpp | 27 | ||||
| -rw-r--r-- | src/modules/eventeditor/eventeditor.h | 2 | ||||
| -rw-r--r-- | src/modules/popupeditor/popupeditor.cpp | 31 | ||||
| -rw-r--r-- | src/modules/popupeditor/popupeditor.h | 2 | ||||
| -rw-r--r-- | src/modules/raweditor/raweditor.cpp | 27 | ||||
| -rw-r--r-- | src/modules/raweditor/raweditor.h | 2 |
11 files changed, 56 insertions, 139 deletions
diff --git a/src/kvirc/ui/kvi_input_editor.cpp b/src/kvirc/ui/kvi_input_editor.cpp index 37280d7d5..2f4110abd 100644 --- a/src/kvirc/ui/kvi_input_editor.cpp +++ b/src/kvirc/ui/kvi_input_editor.cpp @@ -1156,24 +1156,7 @@ void KviInputEditor::returnPressed(bool) m_iCurHistoryIdx = -1; - // FIXME: ALL THIS STUFF SHOULD BE CONVERTED TO QString - /* - if(m_pInputParent->inherits("KviInput")) - { - QString szBuffer(m_szTextBuffer); - m_szTextBuffer=""; - selectOneChar(-1); - m_iCursorPosition = 0; - m_iFirstVisibleChar = 0; - if(bRepaint)repaintWithCursorOn(); - KviUserInput::parse(szBuffer,m_pKviWindow); - } else { - */ emit enterPressed(); - /* - return; - } - */ } void KviInputEditor::focusInEvent(QFocusEvent *) @@ -1487,26 +1470,7 @@ void KviInputEditor::keyPressEvent(QKeyEvent * e) break; case Qt::Key_Return: case Qt::Key_Enter: - if(m_pInputParent->inherits("KviInput")) - { - QString szBuffer(m_szTextBuffer); - m_szTextBuffer=""; - selectOneChar(-1); - m_iCursorPosition = 0; - m_iFirstVisibleChar = 0; - repaintWithCursorOn(); - KviUserInput::parseNonCommand(szBuffer,m_pKviWindow); - if (!szBuffer.isEmpty()) - { - KviInputHistory::instance()->add(new QString(szBuffer)); - m_pHistory->insert(0,new QString(szBuffer)); - } - - __range_valid(KVI_INPUT_MAX_LOCAL_HISTORY_ENTRIES > 1); //ABSOLUTELY NEEDED, if not, pHist will be destroyed... - if(m_pHistory->count() > KVI_INPUT_MAX_LOCAL_HISTORY_ENTRIES)m_pHistory->removeLast(); - - m_iCurHistoryIdx = -1; - } + returnPressed(); break; default: if(!m_bReadOnly) insertText(e->text()); diff --git a/src/modules/actioneditor/actioneditor.cpp b/src/modules/actioneditor/actioneditor.cpp index b05e1e408..079cee80e 100644 --- a/src/modules/actioneditor/actioneditor.cpp +++ b/src/modules/actioneditor/actioneditor.cpp @@ -856,31 +856,29 @@ KviActionEditorWindow::KviActionEditorWindow(KviFrame * lpFrm) g_pActionEditorWindow = this; setFixedCaption(__tr2qs_ctx("Action Editor","editor")); - m_pEditor = new KviActionEditor(this); + QGridLayout * g = new QGridLayout(); - m_pBase = new QWidget(this); - QGridLayout * g = new QGridLayout(m_pBase); + m_pEditor = new KviActionEditor(this); + g->addWidget(m_pEditor,0,0,1,4); - QPushButton * btn = new QPushButton(__tr2qs_ctx("OK","editor"),m_pBase); - btn->setMinimumWidth(80); + QPushButton * btn = new QPushButton(__tr2qs_ctx("OK","editor"),this); connect(btn,SIGNAL(clicked()),this,SLOT(okClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT))); - g->addWidget(btn,0,1); + g->addWidget(btn,1,1); - btn = new QPushButton(__tr2qs_ctx("Apply","editor"),m_pBase); - btn->setMinimumWidth(80); + btn = new QPushButton(__tr2qs_ctx("Apply","editor"),this); connect(btn,SIGNAL(clicked()),this,SLOT(applyClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT))); - g->addWidget(btn,0,2); + g->addWidget(btn,1,2); - btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),m_pBase); - btn->setMinimumWidth(80); + btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),this); connect(btn,SIGNAL(clicked()),this,SLOT(cancelClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DISCARD))); - g->addWidget(btn,0,3); + g->addWidget(btn,1,3); + g->setRowStretch(0,1); g->setColumnStretch(0,1); - + setLayout(g); } KviActionEditorWindow::~KviActionEditorWindow() @@ -909,13 +907,6 @@ QPixmap * KviActionEditorWindow::myIconPtr() return g_pIconManager->getSmallIcon(KVI_SMALLICON_SCRIPTACTION); } -void KviActionEditorWindow::resizeEvent(QResizeEvent *) -{ - int hght = m_pBase->sizeHint().height(); - m_pEditor->setGeometry(0,0,width(),height()- hght); - m_pBase->setGeometry(0,height() - hght,width(),hght); -} - void KviActionEditorWindow::getConfigGroupName(QString &szName) { szName = "actioneditor"; diff --git a/src/modules/actioneditor/actioneditor.h b/src/modules/actioneditor/actioneditor.h index 3c3be4bbd..dc8ea08b6 100644 --- a/src/modules/actioneditor/actioneditor.h +++ b/src/modules/actioneditor/actioneditor.h @@ -188,10 +188,8 @@ public: ~KviActionEditorWindow(); protected: KviActionEditor * m_pEditor; - QWidget * m_pBase; protected: virtual QPixmap * myIconPtr(); - virtual void resizeEvent(QResizeEvent *e); virtual void getConfigGroupName(QString &szName); virtual void saveProperties(KviConfig *); virtual void loadProperties(KviConfig *); diff --git a/src/modules/aliaseditor/aliaseditor.cpp b/src/modules/aliaseditor/aliaseditor.cpp index 1e7bbdf47..e66bb5798 100644 --- a/src/modules/aliaseditor/aliaseditor.cpp +++ b/src/modules/aliaseditor/aliaseditor.cpp @@ -1415,7 +1415,7 @@ void KviAliasEditor::renameItem() // the name is changed explicitly with renameItem(), when needed void KviAliasEditor::saveLastEditedItem() { - if(!itemExists(m_pLastEditedItem)){debug("Item does not exists");return;} // dead ? + if(!itemExists(m_pLastEditedItem)) return; // dead ? ((KviAliasTreeWidgetItem *)m_pLastEditedItem)->setCursorPosition(m_pEditor->getCursor()); if(!m_pLastEditedItem || !m_pEditor->isModified()) return; if(m_pLastEditedItem->isNamespace())return; @@ -1555,27 +1555,29 @@ KviAliasEditorWindow::KviAliasEditorWindow(KviFrame * lpFrm) setFixedCaption(__tr2qs_ctx("Alias Editor","editor")); - m_pEditor = new KviAliasEditor(this); - - m_pBase = new QWidget(this); - QGridLayout * g = new QGridLayout(m_pBase); + QGridLayout * g = new QGridLayout(); - QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK","editor"),m_pBase); + m_pEditor = new KviAliasEditor(this); + g->addWidget(m_pEditor,0,0,1,4); + + QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK","editor"),this); connect(btn,SIGNAL(clicked()),this,SLOT(okClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT))); - g->addWidget(btn,0,1); + g->addWidget(btn,1,1); - btn = new QPushButton(__tr2qs_ctx("&Apply","editor"),m_pBase); + btn = new QPushButton(__tr2qs_ctx("&Apply","editor"),this); connect(btn,SIGNAL(clicked()),this,SLOT(applyClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT))); - g->addWidget(btn,0,2); + g->addWidget(btn,1,2); - btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),m_pBase); + btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),this); connect(btn,SIGNAL(clicked()),this,SLOT(cancelClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DISCARD))); - g->addWidget(btn,0,3); + g->addWidget(btn,1,3); + g->setRowStretch(0,1); g->setColumnStretch(0,1); + setLayout(g); } KviAliasEditorWindow::~KviAliasEditorWindow() @@ -1604,13 +1606,6 @@ QPixmap * KviAliasEditorWindow::myIconPtr() return g_pIconManager->getSmallIcon(KVI_SMALLICON_ALIAS); } -void KviAliasEditorWindow::resizeEvent(QResizeEvent *) -{ - int hght = m_pBase->sizeHint().height(); - m_pEditor->setGeometry(0,0,width(),height()- hght); - m_pBase->setGeometry(0,height() - hght,width(),hght); -} - void KviAliasEditorWindow::getConfigGroupName(QString &szName) { szName = "aliaseditor"; diff --git a/src/modules/aliaseditor/aliaseditor.h b/src/modules/aliaseditor/aliaseditor.h index 154fbaf46..2a2c3ab83 100644 --- a/src/modules/aliaseditor/aliaseditor.h +++ b/src/modules/aliaseditor/aliaseditor.h @@ -203,10 +203,8 @@ public: ~KviAliasEditorWindow(); protected: KviAliasEditor * m_pEditor; - QWidget * m_pBase; protected: virtual QPixmap * myIconPtr(); - virtual void resizeEvent(QResizeEvent *e); virtual void getConfigGroupName(QString &szName); virtual void saveProperties(KviConfig *); virtual void loadProperties(KviConfig *); diff --git a/src/modules/eventeditor/eventeditor.cpp b/src/modules/eventeditor/eventeditor.cpp index c99778c30..4e9daba03 100644 --- a/src/modules/eventeditor/eventeditor.cpp +++ b/src/modules/eventeditor/eventeditor.cpp @@ -498,27 +498,28 @@ KviEventEditorWindow::KviEventEditorWindow(KviFrame * lpFrm) { g_pEventEditorWindow = this; + QGridLayout * g = new QGridLayout(); m_pEditor = new KviEventEditor(this); + g->addWidget(m_pEditor,0,0,1,4); - m_pBase = new QWidget(this); - QGridLayout * g = new QGridLayout(m_pBase); - - QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK","editor"),m_pBase); + QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK","editor"),this); connect(btn,SIGNAL(clicked()),this,SLOT(okClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT))); - g->addWidget(btn,0,1); + g->addWidget(btn,1,1); - btn = new QPushButton(__tr2qs_ctx("&Apply","editor"),m_pBase); + btn = new QPushButton(__tr2qs_ctx("&Apply","editor"),this); connect(btn,SIGNAL(clicked()),this,SLOT(applyClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT))); - g->addWidget(btn,0,2); + g->addWidget(btn,1,2); - btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),m_pBase); + btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),this); connect(btn,SIGNAL(clicked()),this,SLOT(cancelClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DISCARD))); - g->addWidget(btn,0,3); + g->addWidget(btn,1,3); + g->setRowStretch(0,1); g->setColumnStretch(0,1); + setLayout(g); } KviEventEditorWindow::~KviEventEditorWindow() @@ -542,19 +543,11 @@ void KviEventEditorWindow::cancelClicked() close(); } - QPixmap * KviEventEditorWindow::myIconPtr() { return g_pIconManager->getSmallIcon(KVI_SMALLICON_EVENT); } -void KviEventEditorWindow::resizeEvent(QResizeEvent *) -{ - int hght = m_pBase->sizeHint().height(); - m_pEditor->setGeometry(0,0,width(),height()- hght); - m_pBase->setGeometry(0,height() - hght,width(),hght); -} - void KviEventEditorWindow::fillCaptionBuffers() { m_szPlainTextCaption = __tr2qs_ctx("Event Editor","editor"); diff --git a/src/modules/eventeditor/eventeditor.h b/src/modules/eventeditor/eventeditor.h index 52794fb4d..5770aab49 100644 --- a/src/modules/eventeditor/eventeditor.h +++ b/src/modules/eventeditor/eventeditor.h @@ -120,11 +120,9 @@ public: ~KviEventEditorWindow(); protected: KviEventEditor * m_pEditor; - QWidget * m_pBase; protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); - virtual void resizeEvent(QResizeEvent *e); virtual void getConfigGroupName(QString &szName); virtual void saveProperties(KviConfig *); virtual void loadProperties(KviConfig *); diff --git a/src/modules/popupeditor/popupeditor.cpp b/src/modules/popupeditor/popupeditor.cpp index 7a48627b6..6dda5fe8e 100644 --- a/src/modules/popupeditor/popupeditor.cpp +++ b/src/modules/popupeditor/popupeditor.cpp @@ -1303,27 +1303,28 @@ KviPopupEditorWindow::KviPopupEditorWindow(KviFrame * lpFrm) { g_pPopupEditorWindow = this; + QGridLayout * g = new QGridLayout(); m_pEditor = new KviPopupEditor(this); + g->addWidget(m_pEditor,0,0,1,4); - m_pBase = new QWidget(this); - QGridLayout * g = new QGridLayout(m_pBase); - - QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK","editor"),m_pBase); + QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK","editor"),this); connect(btn,SIGNAL(clicked()),this,SLOT(okClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT))); - g->addWidget(btn,0,1); + g->addWidget(btn,1,1); - btn = new QPushButton(__tr2qs_ctx("&Apply","editor"),m_pBase); + btn = new QPushButton(__tr2qs_ctx("&Apply","editor"),this); connect(btn,SIGNAL(clicked()),this,SLOT(applyClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT))); - g->addWidget(btn,0,2); + g->addWidget(btn,1,2); - btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),m_pBase); + btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),this); connect(btn,SIGNAL(clicked()),this,SLOT(cancelClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DISCARD))); - g->addWidget(btn,0,3); + g->addWidget(btn,1,3); + g->setRowStretch(0,1); g->setColumnStretch(0,1); + setLayout(g); } KviPopupEditorWindow::~KviPopupEditorWindow() @@ -1352,23 +1353,11 @@ QPixmap * KviPopupEditorWindow::myIconPtr() return g_pIconManager->getSmallIcon(KVI_SMALLICON_POPUP); } -void KviPopupEditorWindow::resizeEvent(QResizeEvent *) -{ - if(m_pBase) - { - int hght = m_pBase->sizeHint().height(); - if(m_pEditor) - m_pEditor->setGeometry(0,0,width(),height() - hght); - m_pBase->setGeometry(0, height() - hght, width(), hght); - } -} - void KviPopupEditorWindow::fillCaptionBuffers() { m_szPlainTextCaption = __tr2qs_ctx("Popup Editor","editor"); } - void KviPopupEditorWindow::getConfigGroupName(QString &szName) { szName = "popupeditor"; diff --git a/src/modules/popupeditor/popupeditor.h b/src/modules/popupeditor/popupeditor.h index 0aaeb68bd..67f2a90e1 100644 --- a/src/modules/popupeditor/popupeditor.h +++ b/src/modules/popupeditor/popupeditor.h @@ -188,11 +188,9 @@ public: ~KviPopupEditorWindow(); protected: KviPopupEditor * m_pEditor; - QWidget * m_pBase; protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); - virtual void resizeEvent(QResizeEvent *e); virtual void getConfigGroupName(QString &szName); virtual void saveProperties(KviConfig *); virtual void loadProperties(KviConfig *); diff --git a/src/modules/raweditor/raweditor.cpp b/src/modules/raweditor/raweditor.cpp index 42bd2a487..67f5ad225 100644 --- a/src/modules/raweditor/raweditor.cpp +++ b/src/modules/raweditor/raweditor.cpp @@ -473,27 +473,29 @@ KviRawEditorWindow::KviRawEditorWindow(KviFrame * lpFrm) { g_pRawEditorWindow = this; - m_pEditor = new KviRawEditor(this); + QGridLayout * g = new QGridLayout(); - m_pBase = new QWidget(this); - QGridLayout * g = new QGridLayout(m_pBase); + m_pEditor = new KviRawEditor(this); + g->addWidget(m_pEditor,0,0,1,4); - QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK","editor"),m_pBase); + QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK","editor"),this); connect(btn,SIGNAL(clicked()),this,SLOT(okClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT))); - g->addWidget(btn,0,1); + g->addWidget(btn,1,1); - btn = new QPushButton(__tr2qs_ctx("&Apply","editor"),m_pBase); + btn = new QPushButton(__tr2qs_ctx("&Apply","editor"),this); connect(btn,SIGNAL(clicked()),this,SLOT(applyClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT))); - g->addWidget(btn,0,2); + g->addWidget(btn,1,2); - btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),m_pBase); + btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),this); connect(btn,SIGNAL(clicked()),this,SLOT(cancelClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DISCARD))); - g->addWidget(btn,0,3); + g->addWidget(btn,1,3); + g->setRowStretch(0,1); g->setColumnStretch(0,1); + setLayout(g); } KviRawEditorWindow::~KviRawEditorWindow() @@ -522,13 +524,6 @@ QPixmap * KviRawEditorWindow::myIconPtr() return g_pIconManager->getSmallIcon(KVI_SMALLICON_RAWEVENT); } -void KviRawEditorWindow::resizeEvent(QResizeEvent *) -{ - int hght = m_pBase->sizeHint().height(); - m_pEditor->setGeometry(0,0,width(),height()- hght); - m_pBase->setGeometry(0,height() - hght,width(),hght); -} - void KviRawEditorWindow::fillCaptionBuffers() { m_szPlainTextCaption = __tr2qs_ctx("Raw Editor","editor"); diff --git a/src/modules/raweditor/raweditor.h b/src/modules/raweditor/raweditor.h index 1a9133f4a..541122b15 100644 --- a/src/modules/raweditor/raweditor.h +++ b/src/modules/raweditor/raweditor.h @@ -128,11 +128,9 @@ public: ~KviRawEditorWindow(); protected: KviRawEditor * m_pEditor; - QWidget * m_pBase; protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); - virtual void resizeEvent(QResizeEvent *e); virtual void getConfigGroupName(QString &szName); virtual void saveProperties(KviConfig *); virtual void loadProperties(KviConfig *); |
