diff options
| author | 2008-09-23 19:09:39 +0000 | |
|---|---|---|
| committer | 2008-09-23 19:09:39 +0000 | |
| commit | 340216afa6e46702a92a018620437e9a4716724e (patch) | |
| tree | fefebab4c2a83fe9da98ffb4ec09db874878692d | |
| parent | ajuist that files that i missed in the last commit, refs r2469 (diff) | |
| download | KVIrc-340216afa6e46702a92a018620437e9a4716724e.tar.gz KVIrc-340216afa6e46702a92a018620437e9a4716724e.tar.bz2 KVIrc-340216afa6e46702a92a018620437e9a4716724e.zip | |
ported reguser module
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@2537 17fca916-40b9-46aa-a4ea-0a15b648b75c
| -rw-r--r-- | TODO-Qt4 | 1 | ||||
| -rw-r--r-- | src/kvilib/tal/kvi_tal_tabdialog.cpp | 2 | ||||
| -rw-r--r-- | src/kvirc/ui/kvi_windowlist_tree.h | 2 | ||||
| -rw-r--r-- | src/modules/list/listwindow.cpp | 7 | ||||
| -rw-r--r-- | src/modules/reguser/dialog.cpp | 269 | ||||
| -rw-r--r-- | src/modules/reguser/dialog.h | 62 | ||||
| -rw-r--r-- | src/modules/reguser/edituser.cpp | 59 | ||||
| -rw-r--r-- | src/modules/reguser/edituser.h | 4 | ||||
| -rw-r--r-- | src/modules/reguser/libkvireguser.cpp | 4 | ||||
| -rw-r--r-- | src/modules/reguser/wizard.cpp | 23 | ||||
| -rw-r--r-- | src/modules/spaste/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/modules/term/CMakeLists.txt | 7 | ||||
| -rw-r--r-- | src/modules/theme/CMakeLists.txt | 1 |
13 files changed, 251 insertions, 191 deletions
@@ -30,7 +30,6 @@ src/modules torrent - broken help <-done, needs some fixing notifier <-done, needs fixing - popupeditor reguser theme (dynamic tooltip) trayicon diff --git a/src/kvilib/tal/kvi_tal_tabdialog.cpp b/src/kvilib/tal/kvi_tal_tabdialog.cpp index c75bdba67..1d71a1f6e 100644 --- a/src/kvilib/tal/kvi_tal_tabdialog.cpp +++ b/src/kvilib/tal/kvi_tal_tabdialog.cpp @@ -41,7 +41,7 @@ KviTalTabDialog::KviTalTabDialog(QWidget * pParent,const char * name,bool bModal setLayout(m_pLayout); m_pTabWidget = new QTabWidget(this); - m_pLayout->addWidget(m_pTabWidget,0,0,1,2); + m_pLayout->addWidget(m_pTabWidget,0,0,1,3); } KviTalTabDialog::~KviTalTabDialog() diff --git a/src/kvirc/ui/kvi_windowlist_tree.h b/src/kvirc/ui/kvi_windowlist_tree.h index ee1918022..2827c1843 100644 --- a/src/kvirc/ui/kvi_windowlist_tree.h +++ b/src/kvirc/ui/kvi_windowlist_tree.h @@ -146,7 +146,7 @@ public: KviTreeWindowListItemDelegate(QAbstractItemView * pWidget=0) : KviTalIconAndRichTextItemDelegate(pWidget) {}; ~KviTreeWindowListItemDelegate(){}; - QSize sizeHint(const QStyleOptionViewItem &option,const QModelIndex &index) const; + QSize sizeHint(const QStyleOptionViewItem &option,const QModelIndex &index) const; void paint ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const; int calculateColor(int col1,int col2, int iStepNumber) const; }; diff --git a/src/modules/list/listwindow.cpp b/src/modules/list/listwindow.cpp index 314197b63..95216b5c5 100644 --- a/src/modules/list/listwindow.cpp +++ b/src/modules/list/listwindow.cpp @@ -107,22 +107,21 @@ int KviChannelTreeWidgetItem::width ( const QFontMetrics & fm, const KviTalTreeW void KviChannelTreeWidgetItemDelegate::paint( QPainter * p, const QStyleOptionViewItem & option, const QModelIndex & index ) const { - QPalette cg; KviChannelTreeWidgetItem *item=static_cast<KviChannelTreeWidgetItem *>(index.internalPointer()); KviTalTreeWidget* lv = (KviTalTreeWidget *)parent(); if (option.state & QStyle::State_Selected) - p->fillRect(option.rect, cg.brush( QPalette::Highlight ) ); + p->fillRect(option.rect, option.palette.brush( QPalette::Highlight ) ); //reset the color - p->setPen( cg.text().color() ); + p->setPen( option.palette.text().color() ); switch(index.column()) { case 0: p->drawText(option.rect, item->channelData()->m_szChan); break; case 1: p->drawText(option.rect, item->channelData()->m_szUsers); break; - default: KviTopicWidget::paintColoredText(p,item->channelData()->m_szTopic,cg,option.rect); break; + default: KviTopicWidget::paintColoredText(p,item->channelData()->m_szTopic,option.palette,option.rect); break; } } diff --git a/src/modules/reguser/dialog.cpp b/src/modules/reguser/dialog.cpp index f2ef95f43..581e53d05 100644 --- a/src/modules/reguser/dialog.cpp +++ b/src/modules/reguser/dialog.cpp @@ -60,6 +60,8 @@ #include <QEvent> #include <QCloseEvent> #include <QAbstractItemView> +#include <QTextDocument> +#include <QAbstractTextDocumentLayout> #define LVI_ICON_SIZE 32 #define LVI_BORDER 4 @@ -70,7 +72,42 @@ extern KviRegisteredUsersDialog * g_pRegisteredUsersDialog; -KviRegisteredUsersDialogItem::KviRegisteredUsersDialogItem(KviTalListViewItem * par,KviRegisteredUser * u) +KviRegisteredUsersListView::KviRegisteredUsersListView(QWidget * par) +: KviTalTreeWidget(par) +{ + setColumnCount(2); + + QStringList labels; + labels << __tr2qs("Name") << __tr2qs("Flags"); + setHeaderLabels(labels); + setColumnWidth(0,360); + setColumnWidth(1,20); + + setAllColumnsShowFocus(true); + + setSelectionBehavior(QAbstractItemView::SelectRows); + setSelectionMode(QAbstractItemView::ExtendedSelection); + setRootIsDecorated(TRUE); + setSortingEnabled(true); + + setToolTip(__tr2qs("<center>This is the list of registered users. " \ + "KVIrc can automatically recognize and associate properties to them.<br>" \ + "Use the buttons on the right to add, edit and remove entries. " \ + "The \"notify\" column allows you to quickly add users to the notify list. " \ + "Notify list fine-tuning can be performed by editing the entry properties.</center>")); +} + +void KviRegisteredUsersListView::mousePressEvent (QMouseEvent *e) +{ + if (e->button() == Qt::RightButton) + { + KviTalTreeWidgetItem *i= (KviTalTreeWidgetItem*)itemAt(e->pos()); + if (i) emit rightButtonPressed(i,QCursor::pos()); + } + KviTalTreeWidget::mousePressEvent(e); +} + +KviRegisteredUsersDialogItem::KviRegisteredUsersDialogItem(KviTalTreeWidgetItem * par,KviRegisteredUser * u) : KviRegisteredUsersDialogItemBase(User,par), m_pUser(u) { QString szTmp; @@ -97,15 +134,13 @@ KviRegisteredUsersDialogItem::KviRegisteredUsersDialogItem(KviTalListViewItem * t += m_pUser->getProperty("comment"); } t += "</font></nobr>"; - m_pText = new QTextDocument(); - m_pText->setHtml(t); - m_pText->setDefaultFont(listView()->font()); - //setText(0,u->name()); + m_pText.setHtml(t); + m_pText.setTextWidth(-1); +// setText(0,t); } KviRegisteredUsersDialogItem::~KviRegisteredUsersDialogItem() { - delete m_pText; } QString KviRegisteredUsersDialogItem::key(int,bool) const @@ -113,48 +148,61 @@ QString KviRegisteredUsersDialogItem::key(int,bool) const return m_pUser->name(); } -void KviRegisteredUsersDialogItem::paintCell(QPainter * p,const QColorGroup &cg,int column,int width,int align) +void KviRegisteredUsersDialogItemDelegate::paint( QPainter * p, const QStyleOptionViewItem & option, const QModelIndex & index ) const { - KviTalListViewItem::paintCell(p,cg,column,width,align); - if(column==0) + + KviRegisteredUsersDialogItemBase *item=static_cast<KviRegisteredUsersDialogItemBase *>(index.internalPointer()); + + if(item->type()==KviRegisteredUsersDialogItemBase::Group) { - if (isSelected()) - { - QColor col(listView()->palette().highlight()); - col.setAlpha(127); - p->setBrush(col); - p->drawRect(0, 0, listView()->visibleWidth(), height()); - } - p->drawPixmap(LVI_BORDER,LVI_BORDER, *(g_pIconManager->getBigIcon(QString(KVI_BIGICON_REGUSERS))) ); - int afterIcon = LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING; - int www = listView()->visibleWidth() - (afterIcon + LVI_BORDER); - p->translate(afterIcon,LVI_BORDER); - m_pText->setPageSize(QSizeF(www,height() - (LVI_BORDER * 2))); - m_pText->drawContents(p); + //groups + QItemDelegate::paint(p, option, index); } else { - if(m_pUser) + if (option.state & QStyle::State_Selected) + p->fillRect(option.rect, option.palette.brush( QPalette::Highlight ) ); + + KviRegisteredUsersDialogItem *it=(KviRegisteredUsersDialogItem*)item; + + if(index.column()==0) { - if(!m_pUser->getProperty("notify").isEmpty()) - p->drawPixmap(LVI_BORDER,LVI_BORDER,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NOTIFYONLINE))); - if(m_pUser->ignoreEnagled()) - p->drawPixmap(LVI_BORDER,2*LVI_BORDER+16,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_IGNORE))); + QPoint pt=option.rect.topLeft(); + pt.setX(pt.x()+LVI_BORDER); + pt.setY(pt.y()+LVI_BORDER); + + p->drawPixmap(pt, *(g_pIconManager->getBigIcon(KVI_BIGICON_REGUSERS))); + QRect cliprect=QRect(QPoint(0,0),QSize(option.rect.width()-(LVI_ICON_SIZE+LVI_SPACING+LVI_BORDER),option.rect.height())); + p->save(); + + p->translate(option.rect.x()+LVI_ICON_SIZE+LVI_SPACING, option.rect.y()); + it->m_pText.drawContents(p, cliprect); + p->restore(); + } else { + if(it->user()) + { + if(!it->user()->getProperty("notify").isEmpty()) + p->drawPixmap(option.rect.topLeft().x()+LVI_BORDER,option.rect.topLeft().y()+LVI_BORDER,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NOTIFYONLINE))); + if(it->user()->ignoreEnagled()) + p->drawPixmap(option.rect.topLeft().x()+LVI_BORDER,option.rect.topLeft().y()+2*LVI_BORDER+16,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_IGNORE))); + } } } } -void KviRegisteredUsersDialogItem::setup() +QSize KviRegisteredUsersDialogItemDelegate::sizeHint( const QStyleOptionViewItem & option, const QModelIndex & index ) const { - KviTalListViewItem::setup(); - int iWidth = listView()->visibleWidth(); - if(iWidth < LVI_MINIMUM_CELL_WIDTH)iWidth = LVI_MINIMUM_CELL_WIDTH; - iWidth -= LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING + LVI_BORDER; - //m_pText->setWidth(iWidth); - //int iHeight = m_pText->height() + (2 * LVI_BORDER); - int iHeight = m_pText->size().height() + (2 * LVI_BORDER); - if(iHeight < (LVI_ICON_SIZE + (2 * LVI_BORDER)))iHeight = LVI_ICON_SIZE + (2 * LVI_BORDER); - setHeight(iHeight+2); -} + KviRegisteredUsersDialogItemBase *item=static_cast<KviRegisteredUsersDialogItemBase *>(index.internalPointer()); + if(item->type()==KviRegisteredUsersDialogItemBase::Group) + { + //groups + return QItemDelegate::sizeHint(option, index); + } else { + //users +// KviRegisteredUsersDialogItem *it=(KviRegisteredUsersDialogItem*)item; + + return QSize(300, LVI_ICON_SIZE+2.0*LVI_BORDER); + } +} KviRegisteredUsersDialog::KviRegisteredUsersDialog(QWidget * par) : QWidget(par) @@ -164,32 +212,19 @@ KviRegisteredUsersDialog::KviRegisteredUsersDialog(QWidget * par) g_pLocalRegisteredUserDataBase = new KviRegisteredUserDataBase(); g_pLocalRegisteredUserDataBase->copyFrom(g_pRegisteredUserDataBase); - setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_REGUSERS))); + setWindowIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_REGUSERS))); setWindowTitle(__tr2qs("Registered Users - KVIrc")); QGridLayout * g = new QGridLayout(this); - m_pListView = new KviTalListView(this); - - m_pListView->addColumn(__tr2qs("Name"),200); - m_pListView->addColumn(__tr2qs("Flags"),20); + m_pListView = new KviRegisteredUsersListView(this); + m_pListView->setItemDelegate(new KviRegisteredUsersDialogItemDelegate()); - m_pListView->setAllColumnsShowFocus(true); + connect(m_pListView,SIGNAL(itemPressed(KviTalTreeWidgetItem *,int)),this,SLOT(itemPressed(KviTalTreeWidgetItem *,int))); + connect(m_pListView,SIGNAL(itemDoubleClicked(KviTalTreeWidgetItem *, int)),this,SLOT(itemDoubleClicked(KviTalTreeWidgetItem *, int))); - m_pListView->setSelectionMode(Q3ListView::Extended); - m_pListView->setRootIsDecorated(TRUE); - - QToolTip::add(m_pListView,__tr2qs("<center>This is the list of registered users. " \ - "KVIrc can automatically recognize and associate properties to them.<br>" \ - "Use the buttons on the right to add, edit and remove entries. " \ - "The \"notify\" column allows you to quickly add users to the notify list. " \ - "Notify list fine-tuning can be performed by editing the entry properties.</center>")); - - connect(m_pListView,SIGNAL(pressed(KviTalListViewItem *,const QPoint &,int)),this,SLOT(itemPressed(KviTalListViewItem *,const QPoint &,int))); - connect(m_pListView,SIGNAL(doubleClicked(KviTalListViewItem *)),this,SLOT(itemDoubleClicked(KviTalListViewItem *))); - - g->addMultiCellWidget(m_pListView,0,1,0,1); + g->addWidget(m_pListView,0,0,2,2); KviTalVBox * vbox = new KviTalVBox(this); vbox->setSpacing(4); @@ -197,31 +232,31 @@ KviRegisteredUsersDialog::KviRegisteredUsersDialog(QWidget * par) m_pWizardAddButton = new QPushButton(__tr2qs("Add (Wizard)..."),vbox); connect(m_pWizardAddButton,SIGNAL(clicked()),this,SLOT(addWizardClicked())); - QToolTip::add(m_pWizardAddButton,__tr2qs("Add a registered user by means of a user-friendly wizard.")); + m_pWizardAddButton->setToolTip(__tr2qs("Add a registered user by means of a user-friendly wizard.")); m_pWizardAddButton->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NEWITEMBYWIZARD))); m_pAddButton = new QPushButton(__tr2qs("&Add..."),vbox); connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked())); - QToolTip::add(m_pAddButton,__tr2qs("Open the edit dialog to create a new user entry.")); + m_pAddButton->setToolTip(__tr2qs("Open the edit dialog to create a new user entry.")); m_pAddButton->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NEWITEM))); m_pAddGroupButton = new QPushButton(__tr2qs("&Add Group..."),vbox); connect(m_pAddGroupButton,SIGNAL(clicked()),this,SLOT(addGroupClicked())); - QToolTip::add(m_pAddGroupButton,__tr2qs("Adds a new group")); + m_pAddGroupButton->setToolTip(__tr2qs("Adds a new group")); m_pAddGroupButton->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NEWITEM))); m_pRemoveButton = new QPushButton(__tr2qs("Re&move"),vbox); connect(m_pRemoveButton,SIGNAL(clicked()),this,SLOT(removeClicked())); m_pRemoveButton->setEnabled(false); - QToolTip::add(m_pRemoveButton,__tr2qs("Remove the currently selected entries.")); + m_pRemoveButton->setToolTip(__tr2qs("Remove the currently selected entries.")); m_pRemoveButton->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DELETEITEM))); m_pEditButton = new QPushButton(__tr2qs("&Edit..."),vbox); connect(m_pEditButton,SIGNAL(clicked()),this,SLOT(editClicked())); m_pEditButton->setEnabled(false); - QToolTip::add(m_pEditButton,__tr2qs("Edit the first selected entry.")); + m_pEditButton->setToolTip(__tr2qs("Edit the first selected entry.")); m_pEditButton->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_EDITITEM))); QFrame * f = new QFrame(vbox); @@ -230,19 +265,19 @@ KviRegisteredUsersDialog::KviRegisteredUsersDialog(QWidget * par) m_pExportButton = new QPushButton(__tr("Export To..."),vbox); m_pExportButton->setEnabled(false); connect(m_pExportButton,SIGNAL(clicked()),this,SLOT(exportClicked())); - QToolTip::add(m_pExportButton,__tr2qs("Export the selected entries to a file.<br>All the data associated with the selected registered users will be exported.<br>You (or anyone else) can later import the entries by using the \"Import\" button.")); + m_pExportButton->setToolTip(__tr2qs("Export the selected entries to a file.<br>All the data associated with the selected registered users will be exported.<br>You (or anyone else) can later import the entries by using the \"Import\" button.")); m_pExportButton->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_FLOPPY))); m_pImportButton = new QPushButton(__tr("Import From..."),vbox); connect(m_pImportButton,SIGNAL(clicked()),this,SLOT(importClicked())); - QToolTip::add(m_pImportButton,__tr2qs("Import entries from a file exported earlier by the \"export\" function of this dialog.")); + m_pImportButton->setToolTip(__tr2qs("Import entries from a file exported earlier by the \"export\" function of this dialog.")); m_pImportButton->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_FOLDER))); KviTalHBox * hbox = new KviTalHBox(this); hbox->setSpacing(4); - g->addMultiCellWidget(hbox,3,3,1,2); + g->addWidget(hbox,3,1,1,2); QPushButton * b; @@ -257,12 +292,12 @@ KviRegisteredUsersDialog::KviRegisteredUsersDialog(QWidget * par) b->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DISCARD))); //b->setMinimumWidth(120); - g->addRowSpacing(2,15); - g->setColStretch(0,1); + g->addItem(new QSpacerItem(0, 15), 2, 0); + g->setColumnStretch(0,1); g->setRowStretch(1,1); - connect(m_pListView,SIGNAL(selectionChanged()),this,SLOT(selectionChanged())); - connect(m_pListView,SIGNAL(rightButtonClicked ( KviTalListViewItem *, const QPoint &, int ) ),this,SLOT(listViewRightButtonClicked ( KviTalListViewItem *, const QPoint &, int ))); + connect(m_pListView,SIGNAL(itemSelectionChanged()),this,SLOT(selectionChanged())); + connect(m_pListView,SIGNAL(rightButtonPressed(KviTalTreeWidgetItem *, QPoint)),this,SLOT(listViewRightButtonClicked(KviTalTreeWidgetItem *, QPoint))); fillList(); @@ -294,7 +329,7 @@ KviRegisteredUsersDialog::~KviRegisteredUsersDialog() g_pLocalRegisteredUserDataBase = 0; } -void KviRegisteredUsersDialog::itemPressed(KviTalListViewItem *it,const QPoint &pnt,int c) +void KviRegisteredUsersDialog::itemPressed(KviTalTreeWidgetItem *it,int c) { if(!it)return; KviRegisteredUsersDialogItemBase* b=(KviRegisteredUsersDialogItemBase*)it; @@ -302,10 +337,10 @@ void KviRegisteredUsersDialog::itemPressed(KviTalListViewItem *it,const QPoint & { KviRegisteredUsersDialogItem *i = (KviRegisteredUsersDialogItem *)it; - QRect r = m_pListView->itemRect(i); + QRect r = m_pListView->visualItemRect(i); int daw = m_pListView->columnWidth(0); - QPoint ppp = m_pListView->mapFromGlobal(pnt); + QPoint ppp = m_pListView->mapFromGlobal(QCursor::pos()); if((c == 1) && (ppp.x() < (r.height() + 5 + daw))) { @@ -340,7 +375,7 @@ void KviRegisteredUsersDialog::itemPressed(KviTalListViewItem *it,const QPoint & } } -void KviRegisteredUsersDialog::itemDoubleClicked(KviTalListViewItem *it) +void KviRegisteredUsersDialog::itemDoubleClicked(KviTalTreeWidgetItem *it, int) { if(!it)return; KviRegisteredUsersDialogItemBase* b=(KviRegisteredUsersDialogItemBase*)it; @@ -356,9 +391,9 @@ void KviRegisteredUsersDialog::itemDoubleClicked(KviTalListViewItem *it) void KviRegisteredUsersDialog::addGroupClicked() { bool ok; - QString text = QInputDialog::getText( + QString text = QInputDialog::getText( this, "KVIrc", __tr("Group name:"), QLineEdit::Normal, - QString::null, &ok, this ); + QString::null, &ok ); if ( ok && !text.isEmpty() ) { g_pLocalRegisteredUserDataBase->addGroup(text); fillList(); @@ -369,9 +404,9 @@ void KviRegisteredUsersDialog::editGroup(KviRegisteredUserGroup* group) { bool ok; - QString text = QInputDialog::getText( + QString text = QInputDialog::getText( this, "KVIrc", __tr("Group name:"), QLineEdit::Normal, - group->name(), &ok, this ); + group->name(), &ok ); if ( ok && !text.isEmpty() ) { QString szOldGroup=group->name(); g_pLocalRegisteredUserDataBase->groupDict()->setAutoDelete(0); @@ -392,7 +427,8 @@ void KviRegisteredUsersDialog::editGroup(KviRegisteredUserGroup* group) } } -void KviRegisteredUsersDialog::listViewRightButtonClicked ( KviTalListViewItem * pItem, const QPoint & point, int ) + +void KviRegisteredUsersDialog::listViewRightButtonClicked ( KviTalTreeWidgetItem * pItem, QPoint pnt) { if(pItem) { @@ -413,22 +449,22 @@ void KviRegisteredUsersDialog::listViewRightButtonClicked ( KviTalListViewItem * KviTalPopupMenu *mainPopup = new KviTalPopupMenu; mainPopup->insertItem(__tr("Move to group"),groups); - mainPopup->exec(point); + mainPopup->exec(pnt); } } } void KviRegisteredUsersDialog::moveToGroupMenuClicked(int id) { - QString szGroup=m_TmpDict.find(id)->name(); - KviTalListViewItemIterator it( m_pListView, KviTalListViewItemIterator::Selected ); - while ( it.current() ) { - KviRegisteredUsersDialogItemBase* b=(KviRegisteredUsersDialogItemBase*)(it.current()); + QString szGroup=(*(m_TmpDict.find(id)))->name(); + QList<QTreeWidgetItem *> list = m_pListView->selectedItems(); + for(int i=0; i<list.count(); i++) + { + KviRegisteredUsersDialogItemBase* b=(KviRegisteredUsersDialogItemBase*)(list.at(i)); if(b->type()==KviRegisteredUsersDialogItemBase::User) { - ((KviRegisteredUsersDialogItem *)(it.current()))->user()->setGroup(szGroup); + ((KviRegisteredUsersDialogItem *)list.at(i))->user()->setGroup(szGroup); } - ++it; } fillList(); } @@ -444,7 +480,7 @@ void KviRegisteredUsersDialog::fillList() { KviRegisteredUsersGroupItem* pCur = new KviRegisteredUsersGroupItem(m_pListView,g); groupItems.insert(g->name(),pCur); - pCur->setOpen(TRUE); + pCur->setExpanded(TRUE); } KviPointerHashTable<QString,KviRegisteredUser> * d = g_pLocalRegisteredUserDataBase->userDict(); @@ -465,10 +501,10 @@ void KviRegisteredUsersDialog::fillList() item = new KviRegisteredUsersDialogItem(pCur,u); } } - if(m_pListView->firstChild()) + if(m_pListView->topLevelItem(0)) { - m_pListView->setSelected(m_pListView->firstChild(),true); - m_pListView->setCurrentItem(m_pListView->firstChild()); + m_pListView->topLevelItem(0)->setSelected(true); + m_pListView->setCurrentItem(m_pListView->topLevelItem(0)); } } @@ -522,16 +558,16 @@ void KviRegisteredUsersDialog::addWizardClicked() void KviRegisteredUsersDialog::removeClicked() { - KviTalListViewItemIterator it( m_pListView, KviTalListViewItemIterator::Selected ); - while ( it.current() ) { - KviRegisteredUsersDialogItemBase* b=(KviRegisteredUsersDialogItemBase*)(it.current()); + QList<QTreeWidgetItem *> list = m_pListView->selectedItems(); + for(int i=0; i<list.count(); i++) + { + KviRegisteredUsersDialogItemBase* b=(KviRegisteredUsersDialogItemBase*)(list.at(i)); if(b->type()==KviRegisteredUsersDialogItemBase::User) { - g_pLocalRegisteredUserDataBase->removeUser(((KviRegisteredUsersDialogItem *)(it.current()))->user()->name()); + g_pLocalRegisteredUserDataBase->removeUser(((KviRegisteredUsersDialogItem *)list.at(i))->user()->name()); } else { - g_pLocalRegisteredUserDataBase->removeGroup(((KviRegisteredUsersGroupItem *)(it.current()))->group()->name()); + g_pLocalRegisteredUserDataBase->removeGroup(((KviRegisteredUsersGroupItem *)list.at(i))->group()->name()); } - ++it; } fillList(); // KviRegisteredUsersDialogItem *it = (KviRegisteredUsersDialogItem *)m_pListView->firstChild(); @@ -589,17 +625,17 @@ void KviRegisteredUsersDialog::editItem(KviRegisteredUsersDialogItem * i) fillList(); // select the last edited item - KviTalListViewItem * i = m_pListView->firstChild(); - while(i) + int count = m_pListView->topLevelItemCount(); + for(int c=0;c<count;c++) { + KviTalTreeWidgetItem * i = m_pListView->topLevelItem(c); QString szTmp = i->text(0); if(KviQString::equalCI(szTmp,szName)) { - m_pListView->setSelected(i,true); + i->setSelected(true); m_pListView->setCurrentItem(i); break; } - i = i->nextSibling(); } return; @@ -611,7 +647,7 @@ void KviRegisteredUsersDialog::editItem(KviRegisteredUsersDialogItem * i) void KviRegisteredUsersDialog::selectionChanged() { - bool bHaveSelected = !m_pListView->selectedItem(); + bool bHaveSelected = !m_pListView->selectedItems().empty(); m_pEditButton->setEnabled(bHaveSelected); m_pRemoveButton->setEnabled(bHaveSelected); @@ -633,12 +669,13 @@ void KviRegisteredUsersDialog::exportClicked() { unsigned int nEntries = 0; - KviTalListViewItemIterator it( m_pListView, KviTalListViewItemIterator::Selected ); - KviTalListViewItemIterator cit( m_pListView, KviTalListViewItemIterator::Selected ); - while ( cit.current() ) { - if(((KviRegisteredUsersDialogItemBase *)(cit.current()))->type() == KviRegisteredUsersDialogItemBase::User) + QList<QTreeWidgetItem *> list = m_pListView->selectedItems(); + + //only "user" entries matters, discard groups from count + for(int i=0; i<list.count(); i++) + { + if(((KviRegisteredUsersDialogItemBase *)list.at(i))->type() == KviRegisteredUsersDialogItemBase::User) nEntries++; - ++cit; } if(nEntries < 1) @@ -654,7 +691,7 @@ void KviRegisteredUsersDialog::exportClicked() if(!g_pRegisteredUsersDialog)return; // we have been deleted! KviFile f(buffer); - if(!f.open(IO_WriteOnly | IO_Truncate)) + if(!f.open(QIODevice::WriteOnly | QIODevice::Truncate)) { KviMessageBox::warning(__tr("Can't open file %Q for writing."),&buffer); return; @@ -667,15 +704,14 @@ void KviRegisteredUsersDialog::exportClicked() if(f.writeBlock((const char *)&hf,sizeof(KviReguserDbFileHeader)) != sizeof(KviReguserDbFileHeader))goto write_error; - while ( it.current() ) { - KviRegisteredUsersDialogItemBase *pBase = (KviRegisteredUsersDialogItemBase *)(it.current()); + for(int i=0; i<list.count(); i++) + { + KviRegisteredUsersDialogItemBase *pBase = (KviRegisteredUsersDialogItemBase *)list.at(i); if(pBase->type()!=KviRegisteredUsersDialogItemBase::User) - { - ++it; continue; - } - QString szName = it.current()->text(0); - KviRegisteredUser * u = ((KviRegisteredUsersDialogItem *)(it.current()))->user(); + + QString szName = list.at(i)->text(0); + KviRegisteredUser * u = ((KviRegisteredUsersDialogItem *)list.at(i))->user(); if(u) { if(!f.save(szName))goto write_error; @@ -719,7 +755,7 @@ void KviRegisteredUsersDialog::exportClicked() QImageWriter io; io.setDevice(&f); io.setFormat("PNG"); - if(!io.write(av->pixmap()->convertToImage()))goto write_error; + if(!io.write(av->pixmap()->toImage()))goto write_error; } else { if(!f.save(0))goto write_error; } @@ -730,7 +766,6 @@ void KviRegisteredUsersDialog::exportClicked() if(!f.save(0))goto write_error; } } - ++it; } goto succesfull_export; @@ -756,7 +791,7 @@ void KviRegisteredUsersDialog::importClicked() if(!g_pRegisteredUsersDialog)return; // we have been deleted! KviFile f(buffer); - if(!f.open(IO_ReadOnly)) + if(!f.open(QIODevice::ReadOnly)) { KviMessageBox::warning(__tr2qs("Can't open file %s for reading."),&buffer); return; @@ -833,7 +868,7 @@ void KviRegisteredUsersDialog::importClicked() if(!img.save(fPath,"PNG")) { - debug("Can't save image %s",fPath.local8Bit().data()); + debug("Can't save image %s",fPath.toUtf8().data()); } else { u->setProperty("avatar",fPath); } diff --git a/src/modules/reguser/dialog.h b/src/modules/reguser/dialog.h index a85dbef86..2376b9ddf 100644 --- a/src/modules/reguser/dialog.h +++ b/src/modules/reguser/dialog.h @@ -28,36 +28,57 @@ #include "kvi_regusersdb.h" #include "kvi_selectors.h" #include "kvi_pointerhashtable.h" -#include "kvi_tal_listview.h" -#include "kvi_tal_listbox.h" +#include "kvi_tal_treewidget.h" +#include "kvi_tal_listwidget.h" #include "kvi_tal_popupmenu.h" #include <QWidget> #include <QLineEdit> #include <QPushButton> +#include <QItemDelegate> +#include <QMultiHash> +#include <QTextDocument> + +class KviRegisteredUsersListView : public KviTalTreeWidget +{ + Q_OBJECT +public: + KviRegisteredUsersListView(QWidget*); + ~KviRegisteredUsersListView(){}; +protected: + void mousePressEvent (QMouseEvent *e); +signals: + void rightButtonPressed(KviTalTreeWidgetItem *,QPoint); +}; -// FIXME: Qt4 #include <QMultiHash> -#include <q3intdict.h> +class KviRegisteredUsersDialogItemDelegate : public QItemDelegate +{ +public: + KviRegisteredUsersDialogItemDelegate(KviRegisteredUsersListView * pWidget=0) + : QItemDelegate(pWidget) {}; + ~KviRegisteredUsersDialogItemDelegate(){}; + QSize sizeHint(const QStyleOptionViewItem &option,const QModelIndex &index) const; + void paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const; -#include <QTextDocument> +}; -class KviRegisteredUsersDialogItemBase : public KviTalListViewItem +class KviRegisteredUsersDialogItemBase : public KviTalTreeWidgetItem { public: enum Types { User,Group }; protected: - KviRegisteredUsersDialogItemBase(Types type,KviTalListView * par) - :KviTalListViewItem(par),m_iType(type) + KviRegisteredUsersDialogItemBase(Types type,KviRegisteredUsersListView * par) + :KviTalTreeWidgetItem(par),m_iType(type) { }; - KviRegisteredUsersDialogItemBase(Types type,KviTalListViewItem * par) - :KviTalListViewItem(par),m_iType(type) + KviRegisteredUsersDialogItemBase(Types type,KviTalTreeWidgetItem * par) + :KviTalTreeWidgetItem(par),m_iType(type) { }; ~KviRegisteredUsersDialogItemBase() { }; - + private: KviRegisteredUsersDialogItemBase::Types m_iType; public: @@ -69,7 +90,7 @@ class KviRegisteredUsersGroupItem : public KviRegisteredUsersDialogItemBase protected: KviRegisteredUserGroup * m_pGroup; public: - KviRegisteredUsersGroupItem(KviTalListView * par,KviRegisteredUserGroup * g) + KviRegisteredUsersGroupItem(KviRegisteredUsersListView * par,KviRegisteredUserGroup * g) :KviRegisteredUsersDialogItemBase(Group,par), m_pGroup(g) { setText(0,m_pGroup->name()); @@ -82,17 +103,16 @@ public: class KviRegisteredUsersDialogItem : public KviRegisteredUsersDialogItemBase { + friend class KviRegisteredUsersDialogItemDelegate; protected: KviRegisteredUser * m_pUser; - QTextDocument * m_pText; + QTextDocument m_pText; public: - KviRegisteredUsersDialogItem(KviTalListViewItem * par,KviRegisteredUser * u); + KviRegisteredUsersDialogItem(KviTalTreeWidgetItem * par,KviRegisteredUser * u); ~KviRegisteredUsersDialogItem(); public: KviRegisteredUser * user(){ return m_pUser; }; void setUser(KviRegisteredUser * u){ m_pUser = u; }; - virtual void paintCell(QPainter * p,const QColorGroup &cg,int column,int width,int align); - virtual void setup(); virtual QString key(int,bool) const; }; @@ -103,7 +123,7 @@ public: KviRegisteredUsersDialog(QWidget * par = 0); ~KviRegisteredUsersDialog(); public: - KviTalListView * m_pListView; + KviRegisteredUsersListView * m_pListView; QPushButton * m_pAddButton; QPushButton * m_pWizardAddButton; QPushButton * m_pRemoveButton; @@ -111,10 +131,10 @@ public: QPushButton * m_pImportButton; QPushButton * m_pExportButton; QPushButton * m_pAddGroupButton; - Q3IntDict<KviRegisteredUserGroup> m_TmpDict; + QMultiHash<int, KviRegisteredUserGroup*> m_TmpDict; protected slots: - void itemPressed(KviTalListViewItem *it,const QPoint &pnt,int c); - void itemDoubleClicked(KviTalListViewItem *it); + void itemPressed(KviTalTreeWidgetItem *it,int c); + void itemDoubleClicked(KviTalTreeWidgetItem *it, int); protected: void fillList(); protected: @@ -132,7 +152,7 @@ protected slots: void exportClicked(); void addWizardClicked(); void addGroupClicked(); - void listViewRightButtonClicked ( KviTalListViewItem *, const QPoint &, int ); + void listViewRightButtonClicked ( KviTalTreeWidgetItem *, QPoint); void moveToGroupMenuClicked(int); }; diff --git a/src/modules/reguser/edituser.cpp b/src/modules/reguser/edituser.cpp index f55621019..cf8c464ef 100644 --- a/src/modules/reguser/edituser.cpp +++ b/src/modules/reguser/edituser.cpp @@ -69,12 +69,14 @@ KviRegisteredUserDataBase * g_pLocalRegisteredUserDataBase; // local copy! KviReguserPropertiesDialog::KviReguserPropertiesDialog(QWidget * p,KviPointerHashTable<QString,QString> * dict) -: QDialog(p,"property_editor",true) +: QDialog(p) { + setObjectName("property_editor"); + setWindowModality(Qt::WindowModal); m_pPropertyDict = dict; setWindowTitle(__tr2qs("Property Editor")); - setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_LINUX))); + setWindowIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_LINUX))); QGridLayout * g = new QGridLayout(this); @@ -217,8 +219,10 @@ void KviReguserPropertiesDialog::delClicked() KviReguserMaskDialog::KviReguserMaskDialog(QWidget * p,KviIrcMask * m) -: QDialog(p,"reguser_mask_editor",true) +: QDialog(p) { + setObjectName("reguser_mask_editor"); + setWindowModality(Qt::WindowModal); m_pMask = m; setWindowTitle(__tr2qs("Mask Editor")); @@ -227,15 +231,15 @@ KviReguserMaskDialog::KviReguserMaskDialog(QWidget * p,KviIrcMask * m) QLabel * l = new QLabel(__tr2qs("Insert a mask for this user.<br>It can contain the wildcard characters '*' and '?'."),this); //l->setAlignment(Qt::AlignCenter); - g->addMultiCellWidget(l,0,0,0,1); + g->addWidget(l,0,0,1,2); KviTalHBox * b = new KviTalHBox(this); - g->addMultiCellWidget(b,1,1,0,1); + g->addWidget(b,1,0,1,2); m_pNickEdit = new QLineEdit(b); //m_pNickEdit->setMinimumWidth(120); m_pNickEdit->setAlignment(Qt::AlignRight); - QToolTip::add(m_pNickEdit,__tr2qs("<center>This the <b>nickname</b> that will match this user, default value is the registered name.</center>")); + m_pNickEdit->setToolTip(__tr2qs("<center>This the <b>nickname</b> that will match this user, default value is the registered name.</center>")); l = new QLabel("<center><b>!</b></center>",b); l->setAlignment(Qt::AlignCenter); @@ -244,7 +248,7 @@ KviReguserMaskDialog::KviReguserMaskDialog(QWidget * p,KviIrcMask * m) m_pUserEdit = new QLineEdit(b); //m_pUserEdit->setMinimumWidth(120); m_pUserEdit->setAlignment(Qt::AlignCenter); - QToolTip::add(m_pUserEdit,__tr2qs("<center>This the <b>username</b> that will match this user. <b>*</b> will match any username.</center>")); + m_pUserEdit->setToolTip(__tr2qs("<center>This the <b>username</b> that will match this user. <b>*</b> will match any username.</center>")); l = new QLabel("<center><b>@</b></center>",b); l->setAlignment(Qt::AlignCenter); @@ -253,7 +257,7 @@ KviReguserMaskDialog::KviReguserMaskDialog(QWidget * p,KviIrcMask * m) m_pHostEdit = new QLineEdit(b); //m_pHostEdit->setMinimumWidth(120); m_pHostEdit->setAlignment(Qt::AlignLeft); - QToolTip::add(m_pHostEdit,__tr2qs("<center>This the <b>hostname</b> that will match this user. <b>*</b> will match any hostname.</center>")); + m_pHostEdit->setToolTip(__tr2qs("<center>This the <b>hostname</b> that will match this user. <b>*</b> will match any hostname.</center>")); // just a spacer // l = new QLabel("<nobr> <nobr>",this); @@ -328,7 +332,7 @@ KviRegisteredUserEntryDialog::KviRegisteredUserEntryDialog(QWidget *p,KviRegiste //setMinimumSize(400,450); - setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_LINUX))); + setWindowIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_LINUX))); setWindowTitle(__tr2qs("Registered User Entry")); QWidget * p1 = new QWidget(this); @@ -348,20 +352,20 @@ KviRegisteredUserEntryDialog::KviRegisteredUserEntryDialog(QWidget *p,KviRegiste g->addWidget(m_pCommentEdit,1,1); QFrame * f = new QFrame(p1); - g->addMultiCellWidget(f,2,2,0,1); + g->addWidget(f,2,0,1,2); f->setFrameStyle(QFrame::HLine | QFrame::Sunken); l = new QLabel(__tr2qs("Masks:"),p1); - g->addMultiCellWidget(l,3,3,0,1); + g->addWidget(l,3,0,1,2); m_pMaskListBox = new QListWidget(p1); - connect(m_pMaskListBox,SIGNAL(itemActivated(QListWidgetItem *)),this,SLOT(maskCurrentChanged(QListWidgetItem *))); + connect(m_pMaskListBox,SIGNAL(itemSelectionChanged()),this,SLOT(maskCurrentChanged())); m_pMaskListBox->setMinimumSize(300,200); - g->addMultiCellWidget(m_pMaskListBox,4,4,0,1); + g->addWidget(m_pMaskListBox,4,0,1,2); KviTalHBox * b = new KviTalHBox(p1); - g->addMultiCellWidget(b,5,5,0,1); + g->addWidget(b,5,0,1,2); b->setSpacing(4); m_pAddMaskButton = new QPushButton(__tr2qs("&Add..."),b); @@ -388,24 +392,25 @@ KviRegisteredUserEntryDialog::KviRegisteredUserEntryDialog(QWidget *p,KviRegiste g = new QGridLayout(p2); m_pNotifyCheck = new QCheckBox(__tr2qs("Notify when user is online"),p2); - g->addMultiCellWidget(m_pNotifyCheck,0,0,0,2); + g->addWidget(m_pNotifyCheck,0,0,1,3); l = new QLabel(__tr2qs("Notify nicknames:"),p2); l->setEnabled(m_pNotifyCheck->isChecked()); g->addWidget(l,1,0); connect(m_pNotifyCheck,SIGNAL(toggled(bool)),l,SLOT(setEnabled(bool))); - QToolTip::add(m_pNotifyCheck,__tr2qs("<center>You can enter a space separated list of nicknames.</center>")); + m_pNotifyCheck->setToolTip(__tr2qs("<center>You can enter a space separated list of nicknames.</center>")); m_pNotifyNick = new QLineEdit(p2); m_pNotifyNick->setEnabled(false); - g->addMultiCellWidget(m_pNotifyNick,1,1,1,2); + + g->addWidget(m_pNotifyNick,1,1,1,2); connect(m_pNotifyCheck,SIGNAL(toggled(bool)),m_pNotifyNick,SLOT(setEnabled(bool))); f = new QFrame(p2); f->setFrameStyle(QFrame::HLine | QFrame::Sunken); - g->addMultiCellWidget(f,2,2,0,2); + g->addWidget(f,2,0,1,3); m_pAvatar = 0; if(r) @@ -419,16 +424,16 @@ KviRegisteredUserEntryDialog::KviRegisteredUserEntryDialog(QWidget *p,KviRegiste if(!m_pAvatar)m_pAvatar = new KviPixmap(); m_pAvatarSelector = new KviPixmapSelector(p2,__tr2qs("Avatar"),m_pAvatar,true); - g->addMultiCellWidget(m_pAvatarSelector,3,3,0,2); + g->addWidget(m_pAvatarSelector,3,0,1,3); f = new QFrame(p2); f->setFrameStyle(QFrame::HLine | QFrame::Sunken); - g->addMultiCellWidget(f,4,4,0,2); + g->addWidget(f,4,0,1,3); m_pCustomColorCheck = new QCheckBox(__tr2qs("Use custom color in userlist"),p2); if(r) m_pCustomColorCheck->setChecked(r->getBoolProperty("useCustomColor")); - g->addMultiCellWidget(m_pCustomColorCheck,5,5,0,1); + g->addWidget(m_pCustomColorCheck,5,0,1,2); m_pCustomColorSelector = new KviColorSelector(p2,QString::null,m_pCustomColor,1); g->addWidget(m_pCustomColorSelector,5,2); @@ -451,7 +456,9 @@ KviRegisteredUserEntryDialog::KviRegisteredUserEntryDialog(QWidget *p,KviRegiste QGroupBox * gb = new QGroupBox(__tr2qs("Ignore features"),vb); connect(m_pIgnoreEnabled,SIGNAL(toggled(bool)),gb,SLOT(setEnabled(bool))); - QVBoxLayout * layout = new QVBoxLayout(gb,20,3); + QVBoxLayout * layout = new QVBoxLayout(gb); + layout->setMargin(20); + layout->setSpacing(3); m_pIgnoreQuery = new QCheckBox(__tr2qs("Ignore query-messages"),gb); layout->addWidget(m_pIgnoreQuery); @@ -546,10 +553,12 @@ KviRegisteredUserEntryDialog::~KviRegisteredUserEntryDialog() delete m_pCustomColor; } -void KviRegisteredUserEntryDialog::maskCurrentChanged(QListWidgetItem *it) +void KviRegisteredUserEntryDialog::maskCurrentChanged() { - m_pDelMaskButton->setEnabled(it); - m_pEditMaskButton->setEnabled(it); + bool bHaveSelected = !m_pMaskListBox->selectedItems().empty(); + + m_pDelMaskButton->setEnabled(bHaveSelected); + m_pEditMaskButton->setEnabled(bHaveSelected); } void KviRegisteredUserEntryDialog::okClicked() diff --git a/src/modules/reguser/edituser.h b/src/modules/reguser/edituser.h index 26452cf3d..fa2c312dc 100644 --- a/src/modules/reguser/edituser.h +++ b/src/modules/reguser/edituser.h @@ -28,7 +28,7 @@ #include "kvi_regusersdb.h" #include "kvi_selectors.h" #include "kvi_pointerhashtable.h" -#include "kvi_tal_listview.h" +#include "kvi_tal_treewidget.h" #include "kvi_tal_popupmenu.h" #include <kvi_tal_tabdialog.h> @@ -132,7 +132,7 @@ protected slots: void delMaskClicked(); void editMaskClicked(); void editAllPropertiesClicked(); - void maskCurrentChanged(QListWidgetItem *it); + void maskCurrentChanged(); }; #endif //_EDITUSER_H_ diff --git a/src/modules/reguser/libkvireguser.cpp b/src/modules/reguser/libkvireguser.cpp index 2ff0a14fd..4fbddd774 100644 --- a/src/modules/reguser/libkvireguser.cpp +++ b/src/modules/reguser/libkvireguser.cpp @@ -116,12 +116,12 @@ static bool reguser_kvs_cmd_edit(KviKvsModuleCommandCall * c) { if(g_pRegisteredUsersDialog->parent()) { - g_pRegisteredUsersDialog->reparent(0,QPoint(0,0),true); + g_pRegisteredUsersDialog->setParent(0); } } else { if(g_pRegisteredUsersDialog->parent() != c->window()->frame()->splitter()) { - g_pRegisteredUsersDialog->reparent(c->window()->frame()->splitter(),QPoint(0,0),true); + g_pRegisteredUsersDialog->setParent(c->window()->frame()->splitter()); } } } else { diff --git a/src/modules/reguser/wizard.cpp b/src/modules/reguser/wizard.cpp index eeaee88fb..fd70a99a6 100644 --- a/src/modules/reguser/wizard.cpp +++ b/src/modules/reguser/wizard.cpp @@ -75,7 +75,7 @@ KviRegistrationWizard::KviRegistrationWizard(const QString &startMask,KviRegiste // resize( 490, 456 ); setWindowTitle(__tr2qs("User Registration Wizard - KVIrc")); - setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_LINUX))); + setWindowIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_LINUX))); setSizeGripEnabled( TRUE ); @@ -86,6 +86,7 @@ KviRegistrationWizard::KviRegistrationWizard(const QString &startMask,KviRegiste m_pLabel1 = new QLabel(m_pPage1); m_pLabel1->setText(__tr2qs("<p>Welcome to the user registration wizard.<br>This process allows you to add an IRC user to the database and set properties for that user. KVIrc will be (hopefully) able to recognize the user, add him to the notify list, and display the associated avatar.<br><br>First of all, you must insert an <b>entry name or real name</b> for the user you're going to register. The name will be used to identify the database entry and has no specific requirements, it can be a given name, nickname, or just some text to remind you of the real person.<br>Examples: \"George W Bush\", \"Dubya\".\n</p>" )); + m_pLabel1->setWordWrap(true); m_pPage1Layout->addWidget(m_pLabel1, 0, 0); @@ -109,8 +110,9 @@ KviRegistrationWizard::KviRegistrationWizard(const QString &startMask,KviRegiste m_pLabel2 = new QLabel( m_pPage2); m_pLabel2->setText(__tr2qs("<p>A registered user is identified by one or more <b>IRC masks</b>.<br>A mask must be in the following form:<br><b>nickname!username@hostname</b><br>and can contain wildcard characters '*' and '?'. Be careful in choosing the masks, as they are the only way to verify the identity of a registered user.<br><br>You can enter at most two masks here, if you wish to add more masks, use the \"<b>Edit</b>\" button in the Registered Users dialog. You must enter at least one mask.</p>")); + m_pLabel2->setWordWrap(true); - m_pPage2Layout->addMultiCellWidget(m_pLabel2,0,0,0,4); + m_pPage2Layout->addWidget(m_pLabel2,0,0,1,5); //KviStr szMask; @@ -148,22 +150,22 @@ KviRegistrationWizard::KviRegistrationWizard(const QString &startMask,KviRegiste TextLabel10_2 = new QLabel(m_pPage2); TextLabel10_2->setText("<center><b>!</b></center>"); - TextLabel10_2->setAlignment(int(Qt::AlignCenter)); + TextLabel10_2->setAlignment(Qt::AlignCenter); m_pPage2Layout->addWidget(TextLabel10_2,2,1); TextLabel10 = new QLabel(m_pPage2); TextLabel10->setText("<center><b>!</b></center>"); - TextLabel10->setAlignment(int(Qt::AlignCenter)); + TextLabel10->setAlignment(Qt::AlignCenter); m_pPage2Layout->addWidget(TextLabel10,1,1); TextLabel10_3 = new QLabel(m_pPage2); TextLabel10_3->setText("<center><b>@</b></center>"); - TextLabel10_3->setAlignment(int(Qt::AlignCenter)); + TextLabel10_3->setAlignment(Qt::AlignCenter); m_pPage2Layout->addWidget(TextLabel10_3,1,3); TextLabel10_3_2 = new QLabel(m_pPage2); TextLabel10_3_2->setText("<center><b>@</b></center>"); - TextLabel10_3_2->setAlignment(int(Qt::AlignCenter)); + TextLabel10_3_2->setAlignment(Qt::AlignCenter); m_pPage2Layout->addWidget(TextLabel10_3_2,2,3); addPage(m_pPage2,__tr2qs("Step 2: Mask Selection")); @@ -179,6 +181,7 @@ KviRegistrationWizard::KviRegistrationWizard(const QString &startMask,KviRegiste m_pLabel3 = new QLabel(m_pPage3); m_pLabel3->setText(__tr2qs("<p>If you want to store an avatar image for this user, you can set it here. KVIrc will show the avatar in the userlist next to the user's nickname.<br>An avatar can be in any supported image format (PNG is recommended). Keep in mind that KVIrc stores avatars in memory and has to resize them to fit in the userlist, thus it's better to use small, low-resolution images.</p>")); + m_pLabel3->setWordWrap(true); m_pPage3Layout->addWidget(m_pLabel3,0,0); f = new QFrame(m_pPage3); @@ -203,18 +206,19 @@ KviRegistrationWizard::KviRegistrationWizard(const QString &startMask,KviRegiste m_pLabel4 = new QLabel(m_pPage4); m_pLabel4->setText(__tr2qs("<p>If you want to be notified when this user is online or goes offline, you must specify the list of nicknames that KVIrc will look for.<br><br>You can enter at most two nicknames here, if you wish to add more nicknames, use the \"<b>Edit</b>\" button in the Registered Users dialog.</p>")); - m_pPage4Layout->addMultiCellWidget(m_pLabel4,0,0,0,1); + m_pLabel4->setWordWrap(true); + m_pPage4Layout->addWidget(m_pLabel4,0,0,1,2); f = new QFrame(m_pPage4); f->setFrameStyle(QFrame::HLine | QFrame::Sunken); - m_pPage4Layout->addMultiCellWidget(f,1,1,0,1); + m_pPage4Layout->addWidget(f,1,0,1,2); m_pNotifyCheck = new QCheckBox(m_pPage4); m_pNotifyCheck->setText(__tr2qs("Add this user to the notify list")); m_pNotifyCheck->setChecked(false); connect(m_pNotifyCheck,SIGNAL(toggled(bool)),this,SLOT(notifyCheckToggled(bool))); - m_pPage4Layout->addMultiCellWidget(m_pNotifyCheck,2,2,0,1); + m_pPage4Layout->addWidget(m_pNotifyCheck,2,0,1,2); m_pNotifyNickLabel1 = new QLabel(m_pPage4); m_pNotifyNickLabel1->setText(__tr2qs("Nickname:")); @@ -248,6 +252,7 @@ KviRegistrationWizard::KviRegistrationWizard(const QString &startMask,KviRegiste m_pTextLabel5 = new QLabel(m_pPage5); m_pTextLabel5->setText(__tr2qs("<p>That's it. The user registration has been completed.<br><br>Click \"<b>Finish</b>\" to close this dialog.</p>")); + m_pTextLabel5->setWordWrap(true); m_pPage5Layout->addWidget(m_pTextLabel5,0,0); addPage(m_pPage5,__tr2qs("Registration Complete")); diff --git a/src/modules/spaste/CMakeLists.txt b/src/modules/spaste/CMakeLists.txt index f007fea54..68ed47aa3 100644 --- a/src/modules/spaste/CMakeLists.txt +++ b/src/modules/spaste/CMakeLists.txt @@ -2,7 +2,6 @@ SET(kvispaste_MOC_HDRS controller.h - libkvispaste.h ) SET(kvispaste_SRCS diff --git a/src/modules/term/CMakeLists.txt b/src/modules/term/CMakeLists.txt index 3598ab444..8f4d2c54a 100644 --- a/src/modules/term/CMakeLists.txt +++ b/src/modules/term/CMakeLists.txt @@ -1,10 +1,5 @@ # CMakeLists for src/modules/term -SET(kviterm_MOC_HDRS - termwidget.h - termwindow.h -) - SET(kviterm_SRCS libkviterm.cpp termwidget.cpp @@ -12,7 +7,7 @@ SET(kviterm_SRCS ) # After this call, files will be moc'ed to moc_kvi_*.cpp -QT4_WRAP_CPP(kviterm_MOC_SRCS ${kviterm_MOC_HDRS}) +QT4_WRAP_CPP(kviterm_MOC_SRCS) SET(kvi_module_name kviterm) INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt) diff --git a/src/modules/theme/CMakeLists.txt b/src/modules/theme/CMakeLists.txt index fb359436a..2e810769b 100644 --- a/src/modules/theme/CMakeLists.txt +++ b/src/modules/theme/CMakeLists.txt @@ -4,7 +4,6 @@ SET(kvitheme_MOC_HDRS managementdialog.h packthemedialog.h savethemedialog.h - themefunctions.h ) SET(kvitheme_SRCS |
