forked from osmocom/wireshark
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:
parent
669613f41d
commit
81b97d04a9
|
@ -297,6 +297,7 @@ AboutDialog::AboutDialog(QWidget *parent) :
|
||||||
|
|
||||||
ui->pte_wireshark->setFrameStyle(QFrame::NoFrame);
|
ui->pte_wireshark->setFrameStyle(QFrame::NoFrame);
|
||||||
ui->pte_wireshark->viewport()->setAutoFillBackground(false);
|
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) */
|
/* Check if it is a dev release... (VERSION_MINOR is odd in dev release) */
|
||||||
#if VERSION_MINOR & 1
|
#if VERSION_MINOR & 1
|
||||||
|
@ -451,6 +452,19 @@ void AboutDialog::updateWiresharkText()
|
||||||
message += "<a href=https://www.wireshark.org>https://www.wireshark.org</a> ";
|
message += "<a href=https://www.wireshark.org>https://www.wireshark.org</a> ";
|
||||||
message += "for more information.</p>\n\n";
|
message += "for more information.</p>\n\n";
|
||||||
ui->pte_wireshark->setHtml(message);
|
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)
|
void AboutDialog::urlDoubleClicked(const QModelIndex &idx)
|
||||||
|
|
|
@ -95,6 +95,7 @@ private:
|
||||||
|
|
||||||
Ui::AboutDialog *ui;
|
Ui::AboutDialog *ui;
|
||||||
QString script_pattern;
|
QString script_pattern;
|
||||||
|
QString clipboardInfo;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void urlDoubleClicked(const QModelIndex &);
|
void urlDoubleClicked(const QModelIndex &);
|
||||||
|
@ -103,6 +104,7 @@ private slots:
|
||||||
void copyActionTriggered(bool row = false);
|
void copyActionTriggered(bool row = false);
|
||||||
void copyRowActionTriggered();
|
void copyRowActionTriggered();
|
||||||
void on_tblPlugins_doubleClicked(const QModelIndex &index);
|
void on_tblPlugins_doubleClicked(const QModelIndex &index);
|
||||||
|
void on_copyToClipboard_clicked();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ABOUT_DIALOG_H
|
#endif // ABOUT_DIALOG_H
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Wireshark</string>
|
<string>Wireshark</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,1,0">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_logo">
|
<widget class="QLabel" name="label_logo">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -81,6 +81,39 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_authors">
|
<widget class="QWidget" name="tab_authors">
|
||||||
|
|
Loading…
Reference in New Issue