void Container::addUserWnd(UserWnd *wnd) { connect(wnd, SIGNAL(closed(UserWnd*)), this, SLOT(removeUserWnd(UserWnd*))); connect(wnd, SIGNAL(statusChanged(UserWnd*)), this, SLOT(statusChanged(UserWnd*))); m_wnds->addWidget(wnd, -1); bool bBold = false; for (list<msg_id>::iterator it = CorePlugin::m_plugin->unread.begin(); it != CorePlugin::m_plugin->unread.end(); ++it){ if ((*it).contact == wnd->id()){ bBold = true; break; } } QTab *tab = new UserTab(wnd, bBold); m_tabBar->addTab(tab); m_tabBar->setCurrentTab(tab); contactSelected(0); if ((m_tabBar->count() > 1) && !m_tabBar->isVisible()){ m_tabBar->show(); if (getStatusSize()){ QValueList<int> s; s.append(1); s.append(getStatusSize()); m_bStatusSize = true; m_tabSplitter->setSizes(s); m_bStatusSize = false; } m_tabSplitter->setResizeMode(m_status, QSplitter::KeepSize); } }
void Container::raiseUserWnd(UserWnd *wnd) { if (m_tabBar == NULL) return; m_tabBar->raiseTab(wnd->id()); contactSelected(0); }
void Container::removeUserWnd(UserWnd *wnd) { disconnect(wnd, SIGNAL(closed(UserWnd*)), this, SLOT(removeUserWnd(UserWnd*))); disconnect(wnd, SIGNAL(statusChanged(UserWnd*)), this, SLOT(statusChanged(UserWnd*))); m_wnds->removeWidget(wnd); m_tabBar->removeTab(wnd->id()); if (m_tabBar->count() == 0) QTimer::singleShot(0, this, SLOT(close())); if (m_tabBar->count() == 1) m_tabBar->hide(); contactSelected(0); }
void Container::showBar() { BarShow b; b.bar_id = ToolBarContainer; b.parent = this; Event e(EventShowBar, &b); m_bar = (CToolBar*)e.process(); m_bBarChanged = true; restoreToolbar(m_bar, data.barState); m_bar->show(); m_bBarChanged = false; contactSelected(0); }
// Child windows functions void MainWindow::createChildWindows() { currentRecipient = ALL_FRIENDS_ID; // Creating drawing window drawingWindow = new DrawingWindow(this); connect(drawingWindow, SIGNAL(clipartWindowRequest()), this, SLOT(onShowClipart())); connect(drawingWindow, SIGNAL(messageSent()), this, SLOT(onMessageSent())); connect(drawingWindow, SIGNAL(replyChanged()), tvWidget, SLOT(replyChanged())); drawingWindow->updatePosition(this); historyWindow = new HistoryWindow(this); historyWindow->setTvWidget(tvWidget); connect(historyWindow, SIGNAL(beginOfPreview(const MessageKey &)), tvWidget, SLOT(showHistoryMessage(const MessageKey &))); connect(historyWindow, SIGNAL(endOfPreview()), tvWidget, SLOT(stopShowingHistory())); connect(historyWindow, SIGNAL(clicked(const MessageKey &)), tvWidget, SLOT(scrollToMessage(const MessageKey &))); connect(historyWindow, SIGNAL(deleteMessages(const QList<MessageKey> &)), tvWidget, SLOT(deleteMessages(const QList<MessageKey> &))); connect(historyWindow, SIGNAL(saveMessage()), tvWidget, SLOT(saveMessage())); connect(historyWindow, SIGNAL(copyMessage()), tvWidget, SLOT(copyMessage())); connect(tvWidget, SIGNAL(publishRequest(const MessageKey &)), historyWindow, SLOT(publishMessage(const MessageKey &))); historyWindow->updatePosition(this); contactList = new NewContactListWindow(this); contactList->updatePosition(this); contactList->initAutoUpdater(&autoUpdater); // Connect menu signals connect(contactList, SIGNAL(goOnline()), this, SLOT(relogon())); connect(contactList, SIGNAL(goOffline()), this, SLOT(offline())); connect(contactList, SIGNAL(goLogout()), this, SLOT(logout())); connect(contactList, SIGNAL(goExit()), this, SLOT(shutDown())); connect(contactList, SIGNAL(contactSelected(qint32)), this, SLOT(onContactSelected(qint32))); connect(contactList, SIGNAL(contactImageDrop(qint32, const QImage &)), this, SLOT(onContactImageDrop(qint32, const QImage &))); connect(contactList, SIGNAL(soundStateChanged(const bool)), this, SLOT(onSoundStateChanged(const bool))); connect(contactList, SIGNAL(unreadContacts(int)), contactListButton, SLOT(update(int))); #ifdef Q_WS_MAC connect(contactList, SIGNAL(unreadContacts(int)), DockIconHandler::instance(), SLOT(unreadCountChanged(int))); #endif connect(contactList, SIGNAL(historyCleared()), tvWidget, SLOT(reload())); connect(welcomeWidget, SIGNAL(showProfileDialog()), contactList, SLOT(onShowProfileDialog())); connect(welcomeWidget, SIGNAL(showFindFriendsDialog()), contactList, SLOT(onShowFindDialog())); }
MobileWindow::MobileWindow(MusicPlayer* player) { ui.setupUi(this); this->player = player; //initFolderList(); // SIGNALS // CALL NUMBERS connect(ui.call1Button, SIGNAL(clicked()), this, SLOT(add1())); connect(ui.call2Button, SIGNAL(clicked()), this, SLOT(add2())); connect(ui.call3Button, SIGNAL(clicked()), this, SLOT(add3())); connect(ui.call4Button, SIGNAL(clicked()), this, SLOT(add4())); connect(ui.call5Button, SIGNAL(clicked()), this, SLOT(add5())); connect(ui.call6Button, SIGNAL(clicked()), this, SLOT(add6())); connect(ui.call7Button, SIGNAL(clicked()), this, SLOT(add7())); connect(ui.call8Button, SIGNAL(clicked()), this, SLOT(add8())); connect(ui.call9Button, SIGNAL(clicked()), this, SLOT(add9())); connect(ui.call0Button, SIGNAL(clicked()), this, SLOT(add0())); connect(ui.callAsteriskButton, SIGNAL(clicked()), this, SLOT(addAsterisk())); connect(ui.callHashButton, SIGNAL(clicked()), this, SLOT(addHash())); // CALL, HANG UP AND DELETE BUTTONS connect(ui.removeButton, SIGNAL(clicked()), this, SLOT(removeDigit())); connect(ui.callButton, SIGNAL(clicked()), this, SLOT(call())); connect(ui.hangUpButton, SIGNAL(clicked()), this, SLOT(hangUp())); // CONTACTS connect(ui.contactList, SIGNAL(itemSelectionChanged()), this, SLOT(contactSelected())); // FILL CONTACTS ddbb.readFromFile("ddbb\\contacts.xml"); QList<Contact*> contacts = ddbb.getContacts(); foreach (Contact* c,contacts) { ui.contactList->addItem(c->name); }
void Container::raiseUserWnd(UserWnd *wnd) { m_tabBar->raiseTab(wnd->id()); contactSelected(0); }
void QtContactList::dispatchListItemContactId() { Contact::ContactId selectedItemId = getSelectedContactId(); emit contactSelected(selectedItemId); }
MainWindow::MainWindow(ContactRoster *roster, bool showWhatsNew, QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); // Configure the main listView model = new ContactSelectionModel(ui->listView); model->setSortRole(Qt::UserRole + 2); ui->listView->setModel(model); ui->listView->installEventFilter(this); ChatDisplayDelegate *delegate = new ChatDisplayDelegate(ui->listView); ui->listView->setItemDelegate(delegate); connect(ui->createChatButton,SIGNAL(pressed()),this,SLOT(createChatWindow())); connect(ui->actionSettings,SIGNAL(triggered()),this,SLOT(showGlobalSettingsDialog())); connect(ui->actionStatus,SIGNAL(triggered()),this,SLOT(showStatusWindow())); connect(ui->actionQuit,SIGNAL(triggered()),this,SLOT(quit())); connect(ui->actionAbout,SIGNAL(triggered()),this,SLOT(showAboutDialog())); connect(ui->actionDonate,SIGNAL(triggered()),this,SLOT(showDonate())); connect(ui->actionSync,SIGNAL(triggered()),this,SLOT(requestSync())); connect(ui->actionProfile,SIGNAL(triggered()), this,SLOT(showProfileWindow())); connect(ui->actionAccountInfo,SIGNAL(triggered()), this,SLOT(showAccountInfoWindow())); connect(ui->actionNetworkUsage,SIGNAL(triggered()), this,SLOT(showNetworkUsageWindow())); connect(ui->actionCreateGroup,SIGNAL(triggered()), this,SLOT(showCreateGroupWindow())); connect(ui->actionBlockedContacts,SIGNAL(triggered()), this,SLOT(showBlockedContactsWindow())); connect(ui->listView,SIGNAL(clicked(QModelIndex)), this,SLOT(contactSelected(QModelIndex))); connect(this,SIGNAL(sendRightButtonClicked(QPoint)), this,SLOT(contextMenu(QPoint))); this->roster = roster; setAttribute(Qt::WA_Maemo5StackedWindow); setAttribute(Qt::WA_DeleteOnClose,false); setAttribute(Qt::WA_QuitOnClose,false); isScreenLocked = false; notifyObject = new NotifyObject(this); connect(this,SIGNAL(sendNotification(QString,FMessage)), notifyObject,SLOT(sendNotify(QString,FMessage))); newDayTimer = new QTimer(this); connect(newDayTimer,SIGNAL(timeout()),this,SLOT(updateTimestamps())); resetNewDayTimer(); loadOpenChats(); // WhatsNew Window if (showWhatsNew) { WhatsNewWindow *window = new WhatsNewWindow(this); window->setAttribute(Qt::WA_Maemo5StackedWindow); window->setAttribute(Qt::WA_DeleteOnClose); window->setWindowFlags(window->windowFlags() | Qt::Window); window->show(); } }