/** Constructor */ MessageWidget::MessageWidget(bool controlled, QWidget *parent, Qt::WindowFlags flags) : QWidget(parent, flags), toolButtonReply(NULL) { /* Invoke the Qt Designer generated object setup routine */ ui.setupUi(this); isControlled = controlled; isWindow = false; currMsgFlags = 0; connect(ui.msgList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(msgfilelistWidgetCostumPopupMenu(QPoint))); connect(ui.expandFilesButton, SIGNAL(clicked()), this, SLOT(togglefileview())); connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(getallrecommended())); connect(ui.msgText, SIGNAL(anchorClicked(QUrl)), this, SLOT(anchorClicked(QUrl))); connect(ui.sendInviteButton, SIGNAL(clicked()), this, SLOT(sendInvite())); connect(NotifyQt::getInstance(), SIGNAL(messagesTagsChanged()), this, SLOT(messagesTagsChanged())); connect(NotifyQt::getInstance(), SIGNAL(messagesChanged()), this, SLOT(messagesChanged())); ui.imageBlockWidget->addButtonAction(tr("Load images always for this message"), this, SLOT(loadImagesAlways()), true); ui.msgText->setImageBlockWidget(ui.imageBlockWidget); /* hide the Tree +/- */ ui.msgList->setRootIsDecorated( false ); ui.msgList->setSelectionMode( QAbstractItemView::ExtendedSelection ); /* Set header resize modes and initial section sizes */ QHeaderView * msglheader = ui.msgList->header () ; QHeaderView_setSectionResizeModeColumn(msglheader, COLUMN_FILE_NAME, QHeaderView::Interactive); QHeaderView_setSectionResizeModeColumn(msglheader, COLUMN_FILE_SIZE, QHeaderView::Interactive); QHeaderView_setSectionResizeModeColumn(msglheader, COLUMN_FILE_HASH, QHeaderView::Interactive); msglheader->resizeSection (COLUMN_FILE_NAME, 200); msglheader->resizeSection (COLUMN_FILE_SIZE, 100); msglheader->resizeSection (COLUMN_FILE_HASH, 200); QFont font = QFont("Arial", 10, QFont::Bold); ui.subjectText->setFont(font); ui.toText->setMaximumHeight(ui.toText->fontMetrics().lineSpacing()*1.5); ui.ccLabel->setVisible(false); ui.ccText->setVisible(false); ui.ccText->setMaximumHeight(ui.ccText->fontMetrics().lineSpacing()*1.5); ui.bccLabel->setVisible(false); ui.bccText->setVisible(false); ui.bccText->setMaximumHeight(ui.bccText->fontMetrics().lineSpacing()*1.5); ui.tagsLabel->setVisible(false); ui.msgText->activateLinkClick(false); if (isControlled == false) { processSettings("MessageWidget", true); } ui.dateText-> setText(""); ui.inviteFrame->hide(); }
void MessageWidget::msgfilelistWidgetCostumPopupMenu( QPoint /*point*/ ) { QMenu contextMnu(this); contextMnu.addAction(QIcon(IMAGE_DOWNLOAD), tr("Download"), this, SLOT(getcurrentrecommended())); contextMnu.addAction(QIcon(IMAGE_DOWNLOADALL), tr("Download all"), this, SLOT(getallrecommended())); contextMnu.exec(QCursor::pos()); }
/** Constructor */ MessageWidget::MessageWidget(bool controlled, QWidget *parent, Qt::WFlags flags) : QWidget(parent, flags) { /* Invoke the Qt Designer generated object setup routine */ ui.setupUi(this); isControlled = controlled; isWindow = false; currMsgFlags = 0; connect(ui.msgList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(msgfilelistWidgetCostumPopupMenu(QPoint))); connect(ui.expandFilesButton, SIGNAL(clicked()), this, SLOT(togglefileview())); connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(getallrecommended())); connect(ui.msgText, SIGNAL(anchorClicked(QUrl)), this, SLOT(anchorClicked(QUrl))); connect(NotifyQt::getInstance(), SIGNAL(messagesTagsChanged()), this, SLOT(messagesTagsChanged())); connect(NotifyQt::getInstance(), SIGNAL(messagesChanged()), this, SLOT(messagesChanged())); /* hide the Tree +/- */ ui.msgList->setRootIsDecorated( false ); ui.msgList->setSelectionMode( QAbstractItemView::ExtendedSelection ); /* Set header resize modes and initial section sizes */ QHeaderView * msglheader = ui.msgList->header () ; msglheader->setResizeMode (COLUMN_FILE_NAME, QHeaderView::Interactive); msglheader->setResizeMode (COLUMN_FILE_SIZE, QHeaderView::Interactive); msglheader->setResizeMode (COLUMN_FILE_HASH, QHeaderView::Interactive); msglheader->resizeSection (COLUMN_FILE_NAME, 200); msglheader->resizeSection (COLUMN_FILE_SIZE, 100); msglheader->resizeSection (COLUMN_FILE_HASH, 200); QFont font = QFont("Arial", 10, QFont::Bold); ui.subjectText->setFont(font); ui.bcclabel->setVisible(false); ui.bccText->setVisible(false); ui.cclabel->setVisible(false); ui.ccText->setVisible(false); ui.tagsLabel->setVisible(false); if (isControlled == false) { processSettings("MessageWidget", true); } ui.dateText-> setText(""); /* Hide platform specific features */ #ifdef Q_WS_WIN #endif }
void MessagesDialog::msgfilelistWidgetCostumPopupMenu( QPoint point ) { QMenu contextMnu( this ); QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier ); // getRecAct = new QAction(QIcon(IMAGE_DOWNLOAD), tr( "Download" ), this ); // connect( getRecAct , SIGNAL( triggered() ), this, SLOT( getcurrentrecommended() ) ); getAllRecAct = new QAction(QIcon(IMAGE_DOWNLOADALL), tr( "Download All" ), this ); connect( getAllRecAct , SIGNAL( triggered() ), this, SLOT( getallrecommended() ) ); contextMnu.clear(); // contextMnu.addAction( getRecAct); contextMnu.addAction( getAllRecAct); contextMnu.exec( mevent->globalPos() ); }