diff options
author | Graham Bloice <graham.bloice@trihedral.com> | 2019-11-16 15:38:30 +0000 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2019-11-16 23:20:43 +0000 |
commit | 81b97d04a98ca6d7f3898ea04326ee6f2dfb5d99 (patch) | |
tree | 2a23be3771d023befc0f9a5382a856db14328eee | |
parent | 669613f41d3d8fa3a23730f9b2fbd95571d085d3 (diff) |
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>
-rw-r--r-- | ui/qt/about_dialog.cpp | 14 | ||||
-rw-r--r-- | ui/qt/about_dialog.h | 2 | ||||
-rw-r--r-- | ui/qt/about_dialog.ui | 35 |
3 files changed, 50 insertions, 1 deletions
diff --git a/ui/qt/about_dialog.cpp b/ui/qt/about_dialog.cpp index 50c4482370..3f35683cec 100644 --- a/ui/qt/about_dialog.cpp +++ b/ui/qt/about_dialog.cpp @@ -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) diff --git a/ui/qt/about_dialog.h b/ui/qt/about_dialog.h index e4c1d100ea..835191f9d0 100644 --- a/ui/qt/about_dialog.h +++ b/ui/qt/about_dialog.h @@ -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 diff --git a/ui/qt/about_dialog.ui b/ui/qt/about_dialog.ui index 5db4534211..f986b76d45 100644 --- a/ui/qt/about_dialog.ui +++ b/ui/qt/about_dialog.ui @@ -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"> |