24 #include <QTextCursor>
27 #include <QTextDocumentFragment>
29 #define IMG_COPY ":/images/22x22/edit-copy.png"
38 QShortcut *shortcut =
new QShortcut(QKeySequence::Copy,
this,
48 QMenu *menu =
new QMenu();
50 QAction *copyAction =
new QAction(QIcon(
IMG_COPY), tr(
"Copy"), menu);
51 copyAction->setShortcut(QKeySequence::Copy);
54 if (textCursor().selectedText().isEmpty())
55 copyAction->setEnabled(
false);
57 menu->addAction(copyAction);
58 menu->exec(event->globalPos());
66 QString selectedText = textCursor().selection().toPlainText();
67 selectedText.replace(
":\n",
": ");
68 vApp->clipboard()->setText(selectedText);
76 QDateTime now = QDateTime::currentDateTime().toUTC();
78 if (now < published) {
81 return (uptime + (now.toTime_t() - published.toTime_t()));
89 QString html =
"<html><body>";
91 for (
int r = 0; r < rdlist.size(); r++) {
100 html.append(
"<table>");
108 html.append(
trow(
tcol(
b(tr(
"IP Address:"))) +
tcol(rd.
ip().toString())));
116 html.append(
trow(
tcol(
b(tr(
"Bandwidth:"))) +
118 html.append(
trow(
tcol(
b(tr(
"Uptime:"))) +
124 html.append(
trow(
tcol(
b(tr(
"Last Updated:"))) +
127 html.append(
"</table>");
131 if (r+1 != rdlist.size()) {
132 html.append(
"<center><hr width=\"50%\"/></center>");
135 html.append(
"</body></html>");
143 display(QList<RouterDescriptor>() << rd);