* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+extern "C" {
+#include <sigrokdecode.h>
+}
+
+#include <QMessageBox>
+
#include "mainwindow.h"
#include "ui_mainwindow.h"
+extern "C" {
+/* __STDC_FORMAT_MACROS is required for PRIu64 and friends (in C++). */
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
+#include <stdint.h>
+#include <stdarg.h>
+#include <glib.h>
+#include <libsigrok/libsigrok.h>
+}
+
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
delete ui;
}
+
+void MainWindow::on_actionAbout_triggered()
+{
+ GSList *l;
+ struct sr_dev_driver **drivers;
+ struct sr_input_format **inputs;
+ struct sr_output_format **outputs;
+ struct srd_decoder *dec;
+
+ QString s = tr("%1 %2<br />%3<br /><a href=\"%4\">%4</a>\n<p>")
+ .arg(QApplication::applicationName())
+ .arg(QApplication::applicationVersion())
+ .arg(tr("GNU GPL, version 2 or later"))
+ .arg(QApplication::organizationDomain());
+
+ s.append("<b>" + tr("Supported hardware drivers:") + "</b><table>");
+ drivers = sr_driver_list();
+ for (int i = 0; drivers[i]; ++i) {
+ s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
+ .arg(QString(drivers[i]->name))
+ .arg(QString(drivers[i]->longname)));
+ }
+ s.append("</table><p>");
+
+ s.append("<b>" + tr("Supported input formats:") + "</b><table>");
+ inputs = sr_input_list();
+ for (int i = 0; inputs[i]; ++i) {
+ s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
+ .arg(QString(inputs[i]->id))
+ .arg(QString(inputs[i]->description)));
+ }
+ s.append("</table><p>");
+
+ s.append("<b>" + tr("Supported output formats:") + "</b><table>");
+ outputs = sr_output_list();
+ for (int i = 0; outputs[i]; ++i) {
+ s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
+ .arg(QString(outputs[i]->id))
+ .arg(QString(outputs[i]->description)));
+ }
+ s.append("</table><p>");
+
+ s.append("<b>" + tr("Supported protocol decoders:") + "</b><table>");
+ for (l = srd_decoder_list(); l; l = l->next) {
+ dec = (struct srd_decoder *)l->data;
+ s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
+ .arg(QString(dec->id))
+ .arg(QString(dec->longname)));
+ }
+ s.append("</table>");
+
+ QMessageBox::about(this, tr("About"), s);
+}
<iconset>
<normaloff>:/icons/sigrok-logo-notext.png</normaloff>:/icons/sigrok-logo-notext.png</iconset>
</property>
- <widget class="QMenuBar" name="menuBar" />
+ <widget class="QMenuBar" name="menuBar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>25</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menu_Help">
+ <property name="title">
+ <string>&Help</string>
+ </property>
+ <addaction name="actionAbout"/>
+ </widget>
+ <addaction name="menu_Help"/>
+ </widget>
<widget class="QWidget" name="centralWidget" />
<widget class="QStatusBar" name="statusBar" />
+ <action name="actionAbout">
+ <property name="text">
+ <string>&About...</string>
+ </property>
+ </action>
</widget>
- <layoutDefault spacing="6" margin="11" />
- <pixmapfunction></pixmapfunction>
- <resources/>
+ <layoutdefault spacing="6" margin="11"/>
<resources>
<include location="sigrok-qt2.qrc"/>
</resources>