AddResult::AddResult(JabberClient *client) { m_client = client; tblUser->addColumn(i18n("ID")); tblUser->setExpandingColumn(0); connect(tblUser, SIGNAL(dragStart()), this, SLOT(dragStart())); connect(tblUser, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(doubleClicked(QListViewItem*))); connect(tblUser, SIGNAL(currentChanged(QListViewItem*)), this, SLOT(currentChanged(QListViewItem*))); connect(tblUser, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(currentChanged(QListViewItem*))); m_bConnect = false; }
void CQDrag:: mouseMoveEvent(QMouseEvent *event) { // set press point (if not already set) if (! pressed_) { pressPos_ = event->pos(); pressed_ = true; } // Ignore if left button isn't pressed if (! (event->buttons() & Qt::LeftButton)) return; // If the distance is too small then return if ((event->pos() - pressPos_).manhattanLength() < QApplication::startDragDistance()) return; emit dragStart(); // initiate drag QDrag *drag = new QDrag(this); drag->setPixmap(QPixmap(drag_data)); QMimeData *mimeData = new QMimeData; mimeData->setData("action", "CQDrag"); drag->setMimeData(mimeData); drag->exec(); emit dragEnd(); }
SearchDialog::SearchDialog() { SET_WNDPROC("search") setIcon(Pict("find")); setButtonsPict(this); setCaption(i18n("Search")); m_current = NULL; m_currentResult = NULL; m_bAdd = true; m_id = 0; m_result_id = 0; m_active = NULL; m_search = new SearchBase(this); m_update = new QTimer(this); connect(m_update, SIGNAL(timeout()), this, SLOT(update())); setCentralWidget(m_search); m_status = statusBar(); m_result = NULL; setAdd(false); m_search->btnOptions->setIconSet(Icon("1downarrow")); m_search->btnAdd->setIconSet(Icon("add")); m_search->btnNew->setIconSet(Icon("new")); connect(m_search->wndCondition, SIGNAL(aboutToShow(QWidget*)), this, SLOT(aboutToShow(QWidget*))); connect(m_search->wndResult, SIGNAL(aboutToShow(QWidget*)), this, SLOT(resultShow(QWidget*))); fillClients(); connect(m_search->cmbClients, SIGNAL(activated(int)), this, SLOT(clientActivated(int))); m_result = new ListView(m_search->wndResult); m_result->addColumn(i18n("Results")); m_result->setShowSortIndicator(true); m_result->setExpandingColumn(0); m_result->setFrameShadow(QFrame::Sunken); m_result->setLineWidth(1); addResult(m_result); showResult(NULL); aboutToShow(m_search->wndCondition->visibleWidget()); connect(m_search->btnSearch, SIGNAL(clicked()), this, SLOT(searchClick())); m_search->cmbClients->setFocus(); connect(m_search->btnOptions, SIGNAL(clicked()), this, SLOT(optionsClick())); connect(m_search->btnAdd, SIGNAL(clicked()), this, SLOT(addClick())); m_search->btnOptions->setEnabled(false); m_search->btnAdd->setEnabled(false); connect(m_result, SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); connect(m_result, SIGNAL(dragStart()), this, SLOT(dragStart())); connect(m_search->btnNew, SIGNAL(clicked()), this, SLOT(newSearch())); m_result->setMenu(MenuSearchItem); resultShow(m_result); }
JabberBrowser::JabberBrowser(JabberClient *client) : QMainWindow(NULL, NULL, WDestructiveClose) { m_client = client; m_info = NULL; SET_WNDPROC("jbrowser") setIcon(Pict("Jabber_online")); setTitle(); m_status = statusBar(); m_list = new ListView(this); m_list->addColumn(i18n("Name")); m_list->addColumn(i18n("JID")); m_list->addColumn(i18n("Node")); m_list->setExpandingColumn(0); m_list->setMenu(0); connect(m_list, SIGNAL(currentChanged(QListViewItem*)), this, SLOT(currentChanged(QListViewItem*))); connect(m_list, SIGNAL(dragStart()), this, SLOT(dragStart())); BarShow b; b.bar_id = BarBrowser; b.parent = this; Event e(EventShowBar, &b); m_bar = (CToolBar*)e.process(); m_bar->setParam(this); restoreToolbar(m_bar, m_client->data.browser_bar); m_bar->show(); setCentralWidget(m_list); m_historyPos = -1; Command cmd; cmd->id = CmdUrl; cmd->param = this; Event eWidget(EventCommandWidget, cmd); CToolCombo *cmbUrl = (CToolCombo*)(eWidget.process()); if (cmbUrl){ QString h = m_client->getBrowserHistory(); while (h.length()) cmbUrl->insertItem(getToken(h, ';')); cmbUrl->setText(QString::null); } m_search = NULL; m_reg = NULL; m_config = NULL; m_bInProcess = false; }
void MapEditorToolBase::startDragging() { Q_ASSERT(!dragging); dragging = true; dragging_canceled = false; dragStart(); dragMove(); }
JabberBrowser::JabberBrowser() { m_client = NULL; m_info = NULL; m_list = new ListView(this); m_list->addColumn(i18n("Name")); m_list->addColumn(i18n("JID")); m_list->addColumn(i18n("Node")); m_list->setExpandingColumn(0); m_list->setMenu(0); connect(m_list, SIGNAL(currentChanged(QListViewItem*)), this, SLOT(currentChanged(QListViewItem*))); connect(m_list, SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); connect(m_list, SIGNAL(dragStart()), this, SLOT(dragStart())); BarShow b; b.bar_id = BarBrowser; b.parent = this; Event e(EventShowBar, &b); m_bar = (CToolBar*)e.process(); m_bar->setParam(this); restoreToolbar(m_bar, JabberPlugin::plugin->data.browser_bar); m_bar->show(); resize(qApp->desktop()->width(), qApp->desktop()->height()); setCentralWidget(m_list); m_historyPos = -1; Command cmd; cmd->id = CmdUrl; cmd->param = this; Event eWidget(EventCommandWidget, cmd); CToolCombo *cmbUrl = (CToolCombo*)(eWidget.process()); if (cmbUrl){ QString h = JabberPlugin::plugin->getBrowserHistory(); while (h.length()) cmbUrl->insertItem(getToken(h, ';')); cmbUrl->setText(QString::null); } m_reg = NULL; m_config = NULL; m_search = NULL; m_bInProcess = false; m_list->setMenu(MenuSearchItem); }
void ListView::startDrag() { #if QT_VERSION < 300 if (m_mousePressPos.isNull()) return; m_mousePressPos = QPoint(0, 0); #endif emit dragStart(); startDrag(dragObject()); }
IgnoreList::IgnoreList(QWidget *parent) : IgnoreListBase(parent) { lstIgnore->addColumn(i18n("Contact")); lstIgnore->addColumn(i18n("Name")); lstIgnore->addColumn(i18n("EMail")); connect(lstIgnore, SIGNAL(deleteItem(QListViewItem*)), this, SLOT(deleteItem(QListViewItem*))); connect(lstIgnore, SIGNAL(dragStart()), this, SLOT(dragStart())); connect(lstIgnore, SIGNAL(dragEnter(QMimeSource*)), this, SLOT(dragEnter(QMimeSource*))); connect(lstIgnore, SIGNAL(drop(QMimeSource*)), this, SLOT(drop(QMimeSource*))); Contact *contact; ContactList::ContactIterator it; while ((contact = ++it) != NULL){ if (!contact->getIgnore()) continue; QListViewItem *item = new QListViewItem(lstIgnore); updateItem(item, contact); } }
ICQSearchResult::ICQSearchResult(QWidget *parent, ICQClient *client) : ICQSearchResultBase(parent) { m_id = SEARCH_DONE; m_nFound = 0; m_client = client; int wChar = QFontMetrics(font()).width('0'); tblUser->addColumn(i18n("UIN"), -10*wChar); tblUser->setColumnAlignment(0, AlignRight); tblUser->addColumn(i18n("Alias"), 20*wChar); tblUser->addColumn(""); tblUser->addColumn(i18n("Name")); tblUser->addColumn(i18n("Email")); tblUser->setExpandingColumn(3); tblUser->setSorting(0); tblUser->setMenu(static_cast<ICQPlugin*>(m_client->protocol()->plugin())->MenuSearchResult); connect(tblUser, SIGNAL(dragStart()), this, SLOT(dragStart())); connect(tblUser, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(doubleClicked(QListViewItem*))); }
JabberBrowser::JabberBrowser(JabberClient *client) : QMainWindow(NULL, NULL, WDestructiveClose) { m_client = client; m_info = NULL; SET_WNDPROC("jbrowser") setIcon(Pict("Jabber_online")); setTitle(); m_status = statusBar(); m_list = new ListView(this); m_list->addColumn(i18n("JID")); m_list->addColumn(i18n("Name")); m_list->addColumn(i18n("Node")); m_list->setExpandingColumn(1); connect(m_list, SIGNAL(clickItem(QListViewItem*)), this, SLOT(clickItem(QListViewItem*))); connect(m_list, SIGNAL(dragStart()), this, SLOT(dragStart())); BarShow b; b.bar_id = static_cast<JabberPlugin*>(m_client->protocol()->plugin())->BarBrowser; b.parent = this; Event e(EventShowBar, &b); m_bar = (CToolBar*)e.process(); m_bar->setParam(this); restoreToolbar(m_bar, m_client->data.browser_bar); m_bar->show(); setCentralWidget(m_list); m_historyPos = -1; Command cmd; cmd->id = static_cast<JabberPlugin*>(m_client->protocol()->plugin())->CmdUrl; cmd->param = this; Event eWidget(EventCommandWidget, cmd); CToolCombo *cmbFind = (CToolCombo*)(eWidget.process()); if (cmbFind) cmbFind->setText(QString::null); m_search = NULL; m_reg = NULL; }
ICQSearchResult::ICQSearchResult(QWidget *parent, ICQClient *client) : ICQSearchResultBase(parent) { m_id1 = SEARCH_DONE; m_id2 = SEARCH_DONE; m_nFound = 0; m_client = client; int wChar = QFontMetrics(font()).width('0'); tblUser->addColumn("", -10*wChar); tblUser->setColumnAlignment(0, AlignRight); tblUser->addColumn(i18n("Alias"), 20*wChar); tblUser->addColumn(i18n("Name")); tblUser->setExpandingColumn(COL_NAME); tblUser->setSorting(COL_SCREEN); tblUser->setMenu(MenuSearchResult); tblUser->header()->hide(); connect(tblUser, SIGNAL(dragStart()), this, SLOT(dragStart())); connect(tblUser, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(doubleClicked(QListViewItem*))); connect(tblUser, SIGNAL(selectionChanged()), this, SLOT(selectChanged())); QWizard *wizard = static_cast<QWizard*>(topLevelWidget()); wizard->setFinishEnabled(this, false); connect(wizard->finishButton(), SIGNAL(clicked()), this, SLOT(finishClicked())); }
void ListView::startDrag() { emit dragStart(); startDrag(dragObject()); }