/** Constructor */ GxsChannelDialog::GxsChannelDialog(QWidget *parent) : RsGxsUpdateBroadcastPage(rsGxsChannels, parent), GxsServiceDialog(dynamic_cast<GxsCommentContainer *>(parent)) { /* Invoke the Qt Designer generated object setup routine */ ui.setupUi(this); /* Setup UI helper */ mStateHelper = new UIStateHelper(this); mStateHelper->addWidget(TOKEN_TYPE_POSTS, ui.progressBar, UISTATE_LOADING_VISIBLE); mStateHelper->addWidget(TOKEN_TYPE_POSTS, ui.progressLabel, UISTATE_LOADING_VISIBLE); mStateHelper->addLoadPlaceholder(TOKEN_TYPE_GROUP_DATA, ui.nameLabel); mStateHelper->addWidget(TOKEN_TYPE_GROUP_DATA, ui.postButton); mStateHelper->addWidget(TOKEN_TYPE_GROUP_DATA, ui.logoLabel); mChannelQueue = new TokenQueue(rsGxsChannels->getTokenService(), this); connect(ui.postButton, SIGNAL(clicked()), this, SLOT(createMsg())); // connect(NotifyQt::getInstance(), SIGNAL(channelMsgReadSatusChanged(QString,QString,int)), this, SLOT(channelMsgReadSatusChanged(QString,QString,int))); /*************** Setup Left Hand Side (List of Channels) ****************/ connect(ui.treeWidget, SIGNAL(treeCustomContextMenuRequested(QPoint)), this, SLOT(channelListCustomPopupMenu(QPoint))); connect(ui.treeWidget, SIGNAL(treeCurrentItemChanged(QString)), this, SLOT(selectChannel(QString))); connect(ui.todoPushButton, SIGNAL(clicked()), this, SLOT(todo())); mChannelId.clear(); /* Set initial size the splitter */ QList<int> sizes; sizes << 300 << width(); // Qt calculates the right sizes ui.splitter->setSizes(sizes); /* Initialize group tree */ QToolButton *newChannelButton = new QToolButton(this); newChannelButton->setIcon(QIcon(":/images/add_channel24.png")); newChannelButton->setToolTip(tr("Create Channel")); connect(newChannelButton, SIGNAL(clicked()), this, SLOT(createChannel())); ui.treeWidget->addToolButton(newChannelButton); ownChannels = ui.treeWidget->addCategoryItem(tr("My Channels"), QIcon(IMAGE_CHANNELBLUE), true); subcribedChannels = ui.treeWidget->addCategoryItem(tr("Subscribed Channels"), QIcon(IMAGE_CHANNELRED), true); popularChannels = ui.treeWidget->addCategoryItem(tr("Popular Channels"), QIcon(IMAGE_CHANNELGREEN), false); otherChannels = ui.treeWidget->addCategoryItem(tr("Other Channels"), QIcon(IMAGE_CHANNELYELLOW), false); ui.progressLabel->hide(); ui.progressBar->hide(); ui.nameLabel->setMinimumWidth(20); /* load settings */ processSettings(true); /* Initialize empty GUI */ requestGroupData(mChannelId); }
/** Constructor */ ChannelFeed::ChannelFeed(QWidget *parent) : RsAutoUpdatePage(1000,parent) { /* Invoke the Qt Designer generated object setup routine */ setupUi(this); connect(newChannelButton, SIGNAL(clicked()), this, SLOT(createChannel())); connect(postButton, SIGNAL(clicked()), this, SLOT(createMsg())); connect(NotifyQt::getInstance(), SIGNAL(channelMsgReadSatusChanged(QString,QString,int)), this, SLOT(channelMsgReadSatusChanged(QString,QString,int))); /*************** Setup Left Hand Side (List of Channels) ****************/ connect(treeWidget, SIGNAL(treeCustomContextMenuRequested(QPoint)), this, SLOT( channelListCustomPopupMenu( QPoint ) ) ); connect(treeWidget, SIGNAL(treeCurrentItemChanged(QString)), this, SLOT(selectChannel(QString))); mChannelId.clear(); /* Set initial size the splitter */ QList<int> sizes; sizes << 300 << width(); // Qt calculates the right sizes splitter->setSizes(sizes); /* Initialize group tree */ treeWidget->initDisplayMenu(displayButton); ownChannels = treeWidget->addCategoryItem(tr("My Channels"), QIcon(IMAGE_CHANNELBLUE), true); subcribedChannels = treeWidget->addCategoryItem(tr("Subscribed Channels"), QIcon(IMAGE_CHANNELRED), true); popularChannels = treeWidget->addCategoryItem(tr("Popular Channels"), QIcon(IMAGE_CHANNELGREEN ), false); otherChannels = treeWidget->addCategoryItem(tr("Other Channels"), QIcon(IMAGE_CHANNELYELLOW), false); progressLabel->hide(); progressBar->hide(); fillThread = NULL; //added from ahead updateChannelList(); nameLabel->setMinimumWidth(20); /* load settings */ processSettings(true); updateChannelMsgs(); }