About Dialog: Add a copy to clipboard button for the version info

Make life a little simpler when asking for the version info on Ask

Change-Id: I51fd8a390398f7e42e3edcc889d9e53dbfd0980c
Reviewed-on: https://code.wireshark.org/review/35104
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
This commit is contained in:
Graham Bloice 2019-11-16 15:38:30 +00:00 committed by Roland Knall
parent 669613f41d
commit 81b97d04a9
3 changed files with 50 additions and 1 deletions

View File

@ -297,6 +297,7 @@ AboutDialog::AboutDialog(QWidget *parent) :
ui->pte_wireshark->setFrameStyle(QFrame::NoFrame);
ui->pte_wireshark->viewport()->setAutoFillBackground(false);
connect(ui->copyToClipboard, SIGNAL(clicked()), this, SLOT(copyToClipboardTriggered()));
/* Check if it is a dev release... (VERSION_MINOR is odd in dev release) */
#if VERSION_MINOR & 1
@ -451,6 +452,19 @@ void AboutDialog::updateWiresharkText()
message += "<a href=https://www.wireshark.org>https://www.wireshark.org</a> ";
message += "for more information.</p>\n\n";
ui->pte_wireshark->setHtml(message);
/* Save the info for the clipboard copy */
clipboardInfo = "";
clipboardInfo += vcs_version_info_str + "\n\n";
clipboardInfo += gstring_free_to_qbytearray(get_compiled_version_info(get_wireshark_qt_compiled_info,
get_gui_compiled_info)) + "\n";
clipboardInfo += gstring_free_to_qbytearray(get_runtime_version_info(get_wireshark_runtime_info));
}
void AboutDialog::on_copyToClipboard_clicked()
{
QClipboard * clipBoard = QApplication::clipboard();
clipBoard->setText(clipboardInfo);
}
void AboutDialog::urlDoubleClicked(const QModelIndex &idx)

View File

@ -95,6 +95,7 @@ private:
Ui::AboutDialog *ui;
QString script_pattern;
QString clipboardInfo;
private slots:
void urlDoubleClicked(const QModelIndex &);
@ -103,6 +104,7 @@ private slots:
void copyActionTriggered(bool row = false);
void copyRowActionTriggered();
void on_tblPlugins_doubleClicked(const QModelIndex &index);
void on_copyToClipboard_clicked();
};
#endif // ABOUT_DIALOG_H

View File

@ -35,7 +35,7 @@
<attribute name="title">
<string>Wireshark</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,1,0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_logo">
<property name="text">
@ -81,6 +81,39 @@
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="copyToClipboard">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Copy the version information to the clipboard</string>
</property>
<property name="text">
<string>Copy To Clipboard</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_authors">