Changeset View
Changeset View
Standalone View
Standalone View
plugins/history/historydialog.cpp
Context not available. | |||||
105 | QVBoxLayout *mainLayout = new QVBoxLayout; | 105 | QVBoxLayout *mainLayout = new QVBoxLayout; | ||
---|---|---|---|---|---|
106 | setLayout(mainLayout); | 106 | setLayout(mainLayout); | ||
107 | mainLayout->addWidget(mainWidget); | 107 | mainLayout->addWidget(mainWidget); | ||
108 | connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); | 108 | connect(buttonBox, &QDialogButtonBox::accepted, this, &HistoryDialog::accept); | ||
109 | connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); | 109 | connect(buttonBox, &QDialogButtonBox::rejected, this, &HistoryDialog::reject); | ||
110 | //PORTING SCRIPT: WARNING mainLayout->addWidget(buttonBox) must be last item in layout. Please move it. | | |||
111 | mainLayout->addWidget(buttonBox); | | |||
112 | QString fontSize; | 110 | QString fontSize; | ||
113 | QString htmlCode; | 111 | QString htmlCode; | ||
114 | QString fontStyle; | 112 | QString fontStyle; | ||
Context not available. | |||||
156 | mHtmlView->setMarginHeight(4); | 154 | mHtmlView->setMarginHeight(4); | ||
157 | mHtmlView->setFocusPolicy(Qt::ClickFocus); | 155 | mHtmlView->setFocusPolicy(Qt::ClickFocus); | ||
158 | mHtmlView->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); | 156 | mHtmlView->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); | ||
159 | l->setMargin(0); | 157 | l->setMargin(4); | ||
160 | l->addWidget(mHtmlView); | 158 | l->addWidget(mHtmlView); | ||
161 | 159 | | |||
162 | QTextStream(&fontSize) << Kopete::AppearanceSettings::self()->chatFont().pointSize(); | 160 | QTextStream(&fontSize) << Kopete::AppearanceSettings::self()->chatFont().pointSize(); | ||
Context not available. | |||||
168 | mHtmlPart->write(QString::fromLatin1(htmlCode.toLatin1())); | 166 | mHtmlPart->write(QString::fromLatin1(htmlCode.toLatin1())); | ||
169 | mHtmlPart->end(); | 167 | mHtmlPart->end(); | ||
170 | 168 | | |||
171 | connect(mHtmlPart->browserExtension(), SIGNAL(openUrlRequestDelayed(QUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)), | 169 | connect(mHtmlPart->browserExtension(), &KParts::BrowserExtension::openUrlRequestDelayed, this, &HistoryDialog::slotOpenURLRequest); | ||
172 | this, SLOT(slotOpenURLRequest(QUrl,KParts::OpenUrlArguments,KParts::BrowserArguments))); | 170 | connect(mMainWidget->dateTreeWidget, &QTreeWidget::itemClicked, this, &HistoryDialog::dateSelected); | ||
173 | connect(mMainWidget->dateTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem *,int)), this, SLOT(dateSelected(QTreeWidgetItem *))); | 171 | connect(mMainWidget->searchButton, &QPushButton::clicked, this, &HistoryDialog::slotSearch); | ||
174 | connect(mMainWidget->searchButton, SIGNAL(clicked()), this, SLOT(slotSearch())); | 172 | connect(mMainWidget->searchLine, &KLineEdit::returnPressed, this, &HistoryDialog::slotSearch); | ||
175 | connect(mMainWidget->searchLine, SIGNAL(returnPressed()), this, SLOT(slotSearch())); | 173 | connect(mMainWidget->searchLine, &KLineEdit::textChanged, this, &HistoryDialog::slotSearchTextChanged); | ||
176 | connect(mMainWidget->searchLine, SIGNAL(textChanged(QString)), this, SLOT(slotSearchTextChanged(QString))); | 174 | connect(mMainWidget->contactComboBox, static_cast<void (KComboBox::*)(int)>(&KComboBox::activated), this, &HistoryDialog::slotContactChanged); | ||
177 | connect(mMainWidget->contactComboBox, SIGNAL(activated(int)), this, SLOT(slotContactChanged(int))); | 175 | connect(mMainWidget->messageFilterBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &HistoryDialog::slotFilterChanged); | ||
178 | connect(mMainWidget->messageFilterBox, SIGNAL(activated(int)), this, SLOT(slotFilterChanged(int))); | 176 | connect(mMainWidget->importHistory, &QPushButton::clicked, this, &HistoryDialog::slotImportHistory); | ||
179 | connect(mMainWidget->importHistory, SIGNAL(clicked()), this, SLOT(slotImportHistory())); | 177 | // connect(mHtmlPart, &KHTMLPart::popupMenu, this, &HistoryDialog::slotRightClick); | ||
180 | connect(mHtmlPart, SIGNAL(popupMenu(QString,QPoint)), this, SLOT(slotRightClick(QString,QPoint))); | | |||
181 | 178 | | |||
182 | //initActions | 179 | //initActions | ||
183 | mCopyAct = KStandardAction::copy(this, SLOT(slotCopy()), mHtmlView); | 180 | mCopyAct = KStandardAction::copy(this, SLOT(slotCopy()), mHtmlView); | ||
Context not available. | |||||
185 | 182 | | |||
186 | mCopyURLAct = new QAction(QIcon::fromTheme(QStringLiteral("edit-copy")), i18n("Copy Link Address"), mHtmlView); | 183 | mCopyURLAct = new QAction(QIcon::fromTheme(QStringLiteral("edit-copy")), i18n("Copy Link Address"), mHtmlView); | ||
187 | mHtmlView->addAction(mCopyURLAct); | 184 | mHtmlView->addAction(mCopyURLAct); | ||
188 | connect(mCopyURLAct, SIGNAL(triggered(bool)), this, SLOT(slotCopyURL())); | 185 | connect(mCopyURLAct, &QAction::triggered, this, &HistoryDialog::slotCopyURL); | ||
189 | 186 | mainLayout->addWidget(buttonBox); | |||
190 | resize(650, 700); | 187 | | ||
188 | resize(634, 555); | ||||
191 | 189 | | |||
192 | // show the dialog before people get impatient | 190 | // show the dialog before people get impatient | ||
193 | show(); | 191 | show(); | ||
Context not available. | |||||
603 | mCopyAct->setEnabled(mHtmlPart->hasSelection()); | 601 | mCopyAct->setEnabled(mHtmlPart->hasSelection()); | ||
604 | chatWindowPopup->addAction(mCopyAct); | 602 | chatWindowPopup->addAction(mCopyAct); | ||
605 | 603 | | |||
606 | connect(chatWindowPopup, SIGNAL(aboutToHide()), chatWindowPopup, SLOT(deleteLater())); | 604 | connect(chatWindowPopup, &QMenu::aboutToHide, chatWindowPopup, &QMenu::deleteLater); | ||
607 | chatWindowPopup->popup(point); | 605 | chatWindowPopup->popup(point); | ||
608 | } | 606 | } | ||
609 | 607 | | |||
Context not available. |