]> sigrok.org Git - pulseview.git/commitdiff
Moved pv::About into the pv::dialogs::About namespace
authorJoel Holdsworth <redacted>
Thu, 20 Dec 2012 20:27:54 +0000 (20:27 +0000)
committerJoel Holdsworth <redacted>
Mon, 24 Dec 2012 15:26:08 +0000 (15:26 +0000)
CMakeLists.txt
pv/about.cpp [deleted file]
pv/about.h [deleted file]
pv/about.ui [deleted file]
pv/dialogs/about.cpp [new file with mode: 0644]
pv/dialogs/about.h [new file with mode: 0644]
pv/dialogs/about.ui [new file with mode: 0644]
pv/mainwindow.cpp

index 52c5b56688f27f5b5e3d036fb741d52f545b2d37..e1893b6c1c47a90edd29434b7de4f5e236a22889 100644 (file)
@@ -80,7 +80,6 @@ configure_file (
 
 set(pulseview_SOURCES
        main.cpp
-       pv/about.cpp
        pv/analogdata.cpp
        pv/analogdatasnapshot.cpp
        pv/datasnapshot.cpp
@@ -90,6 +89,7 @@ set(pulseview_SOURCES
        pv/samplingbar.cpp
        pv/signaldata.cpp
        pv/sigsession.cpp
+       pv/dialogs/about.cpp
        pv/view/analogsignal.cpp
        pv/view/cursor.cpp
        pv/view/header.cpp
@@ -102,10 +102,10 @@ set(pulseview_SOURCES
 )
 
 set(pulseview_HEADERS
-       pv/about.h
        pv/mainwindow.h
        pv/samplingbar.h
        pv/sigsession.h
+       pv/dialogs/about.h
        pv/view/cursor.h
        pv/view/header.h
        pv/view/ruler.h
@@ -115,7 +115,7 @@ set(pulseview_HEADERS
 )
 
 set(pulseview_FORMS
-       pv/about.ui
+       pv/dialogs/about.ui
 )
 
 set(pulseview_RESOURCES
diff --git a/pv/about.cpp b/pv/about.cpp
deleted file mode 100644 (file)
index 48c1f59..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- */
-
-extern "C" {
-#include <sigrokdecode.h>
-}
-
-#include <QTextDocument>
-
-#include "about.h"
-#include <ui_about.h>
-
-extern "C" {
-/* __STDC_FORMAT_MACROS is required for PRIu64 and friends (in C++). */
-#define __STDC_FORMAT_MACROS
-#include <glib.h>
-#include <libsigrok/libsigrok.h>
-}
-
-namespace pv {
-
-About::About(QWidget *parent) :
-       QDialog(parent),
-       ui(new Ui::About)
-{
-       GSList *l;
-       struct sr_dev_driver **drivers;
-       struct sr_input_format **inputs;
-       struct sr_output_format **outputs;
-       struct srd_decoder *dec;
-       QString s;
-
-       ui->setupUi(this);
-
-       /* Setup the version field */
-       ui->versionInfo->setText(tr("%1 %2<br />%3<br /><a href=\"%4\">%4</a>")
-                                .arg(QApplication::applicationName())
-                                .arg(QApplication::applicationVersion())
-                                .arg(tr("GNU GPL, version 2 or later"))
-                                .arg(QApplication::organizationDomain()));
-
-       s.append("<table>");
-
-       /* Set up the supported field */
-       s.append("<tr><td colspan=\"2\"><b>" +
-               tr("Supported hardware drivers:") +
-               "</b></td></tr>");
-       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("<tr><td colspan=\"2\"><b>" +
-               tr("Supported input formats:") +
-               "</b></td></tr>");
-       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("<tr><td colspan=\"2\"><b>" +
-               tr("Supported output formats:") +
-               "</b></td></tr>");
-       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("<tr><td colspan=\"2\"><b>" +
-               tr("Supported protocol decoders:") +
-               "</b></td></tr>");
-       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>");
-
-       supportedDoc.reset(new QTextDocument(this));
-       supportedDoc->setHtml(s);
-       ui->supportList->setDocument(supportedDoc.get());
-}
-
-About::~About()
-{
-       delete ui;
-}
-
-} // namespace pv
diff --git a/pv/about.h b/pv/about.h
deleted file mode 100644 (file)
index 5b845cb..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- */
-
-#ifndef PULSEVIEW_PV_ABOUT_H
-#define PULSEVIEW_PV_ABOUT_H
-
-#include <QDialog>
-
-#include <memory>
-
-class QTextDocument;
-
-namespace Ui {
-class About;
-}
-
-namespace pv {
-
-class About : public QDialog
-{
-       Q_OBJECT
-
-public:
-       explicit About(QWidget *parent = 0);
-       ~About();
-
-private:
-       Ui::About *ui;
-       std::auto_ptr<QTextDocument> supportedDoc;
-};
-
-} // namespace pv
-
-#endif // PULSEVIEW_PV_ABOUT_H
diff --git a/pv/about.ui b/pv/about.ui
deleted file mode 100644 (file)
index 10163f9..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>About</class>
- <widget class="QDialog" name="About">
-  <property name="windowModality">
-   <enum>Qt::WindowModal</enum>
-  </property>
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>600</width>
-    <height>400</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>About</string>
-  </property>
-  <property name="whatsThis">
-   <string/>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <item>
-    <layout class="QGridLayout" name="gridLayout">
-     <item row="0" column="0">
-      <widget class="QLabel" name="icon">
-       <property name="text">
-        <string/>
-       </property>
-       <property name="pixmap">
-        <pixmap resource="pulseview.qrc">:/icons/sigrok-logo-notext.png</pixmap>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="1">
-      <widget class="QLabel" name="versionInfo">
-       <property name="text">
-        <string/>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="1">
-      <widget class="QTextBrowser" name="supportList"/>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="QDialogButtonBox" name="buttonBox">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="standardButtons">
-      <set>QDialogButtonBox::Ok</set>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="pulseview.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>accepted()</signal>
-   <receiver>About</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>248</x>
-     <y>254</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>157</x>
-     <y>274</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>rejected()</signal>
-   <receiver>About</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>316</x>
-     <y>260</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>286</x>
-     <y>274</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/pv/dialogs/about.cpp b/pv/dialogs/about.cpp
new file mode 100644 (file)
index 0000000..a777854
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+extern "C" {
+#include <sigrokdecode.h>
+}
+
+#include <QTextDocument>
+
+#include "about.h"
+#include <ui_about.h>
+
+extern "C" {
+/* __STDC_FORMAT_MACROS is required for PRIu64 and friends (in C++). */
+#define __STDC_FORMAT_MACROS
+#include <glib.h>
+#include <libsigrok/libsigrok.h>
+}
+
+namespace pv {
+namespace dialogs {
+
+About::About(QWidget *parent) :
+       QDialog(parent),
+       ui(new Ui::About)
+{
+       GSList *l;
+       struct sr_dev_driver **drivers;
+       struct sr_input_format **inputs;
+       struct sr_output_format **outputs;
+       struct srd_decoder *dec;
+       QString s;
+
+       ui->setupUi(this);
+
+       /* Setup the version field */
+       ui->versionInfo->setText(tr("%1 %2<br />%3<br /><a href=\"%4\">%4</a>")
+                                .arg(QApplication::applicationName())
+                                .arg(QApplication::applicationVersion())
+                                .arg(tr("GNU GPL, version 2 or later"))
+                                .arg(QApplication::organizationDomain()));
+
+       s.append("<table>");
+
+       /* Set up the supported field */
+       s.append("<tr><td colspan=\"2\"><b>" +
+               tr("Supported hardware drivers:") +
+               "</b></td></tr>");
+       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("<tr><td colspan=\"2\"><b>" +
+               tr("Supported input formats:") +
+               "</b></td></tr>");
+       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("<tr><td colspan=\"2\"><b>" +
+               tr("Supported output formats:") +
+               "</b></td></tr>");
+       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("<tr><td colspan=\"2\"><b>" +
+               tr("Supported protocol decoders:") +
+               "</b></td></tr>");
+       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>");
+
+       supportedDoc.reset(new QTextDocument(this));
+       supportedDoc->setHtml(s);
+       ui->supportList->setDocument(supportedDoc.get());
+}
+
+About::~About()
+{
+       delete ui;
+}
+
+} // namespace dialogs
+} // namespace pv
diff --git a/pv/dialogs/about.h b/pv/dialogs/about.h
new file mode 100644 (file)
index 0000000..cc153ad
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#ifndef PULSEVIEW_PV_ABOUT_H
+#define PULSEVIEW_PV_ABOUT_H
+
+#include <QDialog>
+
+#include <memory>
+
+class QTextDocument;
+
+namespace Ui {
+class About;
+}
+
+namespace pv {
+namespace dialogs {
+
+class About : public QDialog
+{
+       Q_OBJECT
+
+public:
+       explicit About(QWidget *parent = 0);
+       ~About();
+
+private:
+       Ui::About *ui;
+       std::auto_ptr<QTextDocument> supportedDoc;
+};
+
+} // namespace dialogs
+} // namespace pv
+
+#endif // PULSEVIEW_PV_ABOUT_H
diff --git a/pv/dialogs/about.ui b/pv/dialogs/about.ui
new file mode 100644 (file)
index 0000000..10163f9
--- /dev/null
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>About</class>
+ <widget class="QDialog" name="About">
+  <property name="windowModality">
+   <enum>Qt::WindowModal</enum>
+  </property>
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>600</width>
+    <height>400</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>About</string>
+  </property>
+  <property name="whatsThis">
+   <string/>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <layout class="QGridLayout" name="gridLayout">
+     <item row="0" column="0">
+      <widget class="QLabel" name="icon">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="pixmap">
+        <pixmap resource="pulseview.qrc">:/icons/sigrok-logo-notext.png</pixmap>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="QLabel" name="versionInfo">
+       <property name="text">
+        <string/>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1">
+      <widget class="QTextBrowser" name="supportList"/>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="pulseview.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>About</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>248</x>
+     <y>254</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>157</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>About</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
index 3f338a12a09e1124cec927350878656c15828a8f..d8083b5f636ce14ce9d90a7ebfcc5aeb718ec9b6 100644 (file)
@@ -32,9 +32,9 @@ extern "C" {
 #include <QVBoxLayout>
 #include <QWidget>
 
-#include "about.h"
 #include "mainwindow.h"
 #include "samplingbar.h"
+#include "dialogs/about.h"
 #include "pv/view/view.h"
 
 extern "C" {
@@ -183,7 +183,7 @@ void MainWindow::on_actionViewShowCursors_triggered()
 
 void MainWindow::on_actionAbout_triggered()
 {
-       About dlg(this);
+       dialogs::About dlg(this);
        dlg.exec();
 }