improve the about menu, add manual and issue report link
@@ -400,6 +400,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION bin/)
|
||||
install(DIRECTORY res DESTINATION share/${PROJECT_NAME})
|
||||
install(FILES icons/logo.png DESTINATION share/${PROJECT_NAME} RENAME logo.png)
|
||||
install(FILES ../NEWS DESTINATION share/${PROJECT_NAME}/res RENAME NEWS)
|
||||
install(FILES DreamSourceLab.rules DESTINATION /etc/udev/rules.d/)
|
||||
install(FILES DSView.desktop DESTINATION /usr/share/applications/)
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
<file>icons/protocol.png</file>
|
||||
<file>icons/logo_noColor.png</file>
|
||||
<file>icons/logo_color.png</file>
|
||||
<file>icons/about.png</file>
|
||||
<file>icons/capture.png</file>
|
||||
<file>icons/stop.png</file>
|
||||
<file>icons/start.png</file>
|
||||
@@ -32,7 +31,6 @@
|
||||
<file>icons/search-bar_dis.png</file>
|
||||
<file>icons/params_dis.png</file>
|
||||
<file>icons/gear.png</file>
|
||||
<file>icons/wiki.png</file>
|
||||
<file>icons/wait.gif</file>
|
||||
<file>icons/instant_dis.png</file>
|
||||
<file>icons/start_dis.png</file>
|
||||
@@ -64,5 +62,9 @@
|
||||
<file>icons/del.png</file>
|
||||
<file>icons/add_dis.png</file>
|
||||
<file>icons/del_dis.png</file>
|
||||
<file>icons/about.png</file>
|
||||
<file>icons/manual.png</file>
|
||||
<file>icons/bug.png</file>
|
||||
<file>icons/support.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -609,7 +609,7 @@ background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1,
|
||||
stop: 0.6 #4E4D4D, stop: 1 #302F2F);
|
||||
}
|
||||
|
||||
QComboBox:hover,QAbstractSpinBox:hover,QLineEdit:hover,QTextEdit:hover,QPlainTextEdit:hover,QAbstractView:hover,QTreeView:hover
|
||||
QComboBox:hover,QAbstractSpinBox:hover,QLineEdit:hover,QPlainTextEdit:hover,QAbstractView:hover,QTreeView:hover
|
||||
{
|
||||
border: 1px solid #606060;
|
||||
color: silver;
|
||||
|
||||
BIN
DSView/icons/about.png
Normal file → Executable file
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
DSView/icons/bug.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
DSView/icons/dsl_logo.png
Normal file → Executable file
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 11 KiB |
BIN
DSView/icons/logo_color.png
Normal file → Executable file
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 860 B |
BIN
DSView/icons/logo_noColor.png
Normal file → Executable file
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 721 B |
BIN
DSView/icons/manual.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
DSView/icons/support.png
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
@@ -23,6 +23,11 @@
|
||||
|
||||
#include <QPixmap>
|
||||
#include <QApplication>
|
||||
#include <QTextBrowser>
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#include <QTextStream>
|
||||
#include <QScrollBar>
|
||||
|
||||
#include "about.h"
|
||||
|
||||
@@ -32,22 +37,59 @@ namespace dialogs {
|
||||
About::About(QWidget *parent) :
|
||||
DSDialog(parent, true)
|
||||
{
|
||||
QPixmap pix(":/icons/dsl_logo.png");
|
||||
_logo = new QLabel(this);
|
||||
_logo->setPixmap(pix);
|
||||
_logo->setAlignment(Qt::AlignCenter);
|
||||
setFixedHeight(360);
|
||||
|
||||
_info = new QLabel(this);
|
||||
_info->setText(tr("%1 %2<br /><a href=\"%4\">%4</a>")
|
||||
.arg(QApplication::applicationName())
|
||||
.arg(QApplication::applicationVersion())
|
||||
.arg(QApplication::organizationDomain()));
|
||||
_info->setOpenExternalLinks(true);
|
||||
_info->setAlignment(Qt::AlignCenter);
|
||||
#if defined(__x86_64__) || defined(_M_X64)
|
||||
QString arch = "x64";
|
||||
#elif defined(__i386) || defined(_M_IX86)
|
||||
QString arch = "x86";
|
||||
#endif
|
||||
|
||||
QString version = tr("<font size=24>DSView %1 (%2)</font><br />")
|
||||
.arg(QApplication::applicationVersion())
|
||||
.arg(arch);
|
||||
|
||||
QString url = tr("Website: <a href=\"%1\" style=\"color:#C0C0C0\">%1</a><br />"
|
||||
"Gitbub: <a href=\"%2\" style=\"color:#C0C0C0\">%2</a><br />"
|
||||
"<br /><br />")
|
||||
.arg(QApplication::organizationDomain())
|
||||
.arg("https://github.com/DreamSourceLab/DSView");
|
||||
|
||||
QString thanks = tr("<font size=16>Special Thanks</font><br />"
|
||||
"<a href=\"%1\" style=\"color:#C0C0C0\">All backers on kickstarter</a><br />"
|
||||
"<a href=\"%1\" style=\"color:#C0C0C0\">All members of Sigrok project</a><br />"
|
||||
"All contributors of open-source projects</a><br />"
|
||||
"<br /><br />")
|
||||
.arg("https://www.kickstarter.com/projects/dreamsourcelab/dslogic-multifunction-instruments-for-everyone")
|
||||
.arg("http://sigrok.org/");
|
||||
|
||||
QString changlogs = tr("<font size=16>Changelogs</font><br />");
|
||||
QDir dir(DS_RES_PATH);
|
||||
QString filename = dir.absolutePath() + "/NEWS";
|
||||
QFile news(filename);
|
||||
if (news.open(QIODevice::ReadOnly)) {
|
||||
QTextStream stream(&news);
|
||||
QString line;
|
||||
while (!stream.atEnd()){
|
||||
line = stream.readLine();
|
||||
changlogs += line + "<br />";
|
||||
}
|
||||
}
|
||||
|
||||
QPixmap pix(":/icons/dsl_logo.png");
|
||||
QImage logo = pix.toImage();
|
||||
|
||||
QTextBrowser *about = new QTextBrowser(this);
|
||||
about->setOpenExternalLinks(true);
|
||||
about->setFrameStyle(QFrame::NoFrame);
|
||||
QTextCursor cur = about->textCursor();
|
||||
cur.insertImage(logo);
|
||||
cur.insertHtml("<br /><br /><br />");
|
||||
cur.insertHtml(version+url+thanks+changlogs);
|
||||
about->moveCursor(QTextCursor::Start);
|
||||
|
||||
QVBoxLayout *xlayout = new QVBoxLayout();
|
||||
xlayout->addWidget(_logo);
|
||||
xlayout->addWidget(_info);
|
||||
xlayout->addWidget(about);
|
||||
|
||||
layout()->addLayout(xlayout);
|
||||
setTitle(tr("About"));
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#include <QLabel>
|
||||
#include "dsdialog.h"
|
||||
|
||||
#include <libsigrok4DSL/libsigrok.h>
|
||||
|
||||
namespace pv {
|
||||
namespace dialogs {
|
||||
|
||||
@@ -37,10 +39,6 @@ class About : public DSDialog
|
||||
public:
|
||||
explicit About(QWidget *parent = 0);
|
||||
~About();
|
||||
|
||||
private:
|
||||
QLabel *_logo;
|
||||
QLabel *_info;
|
||||
};
|
||||
|
||||
} // namespace dialogs
|
||||
|
||||
@@ -52,14 +52,23 @@ LogoBar::LogoBar(SigSession &session, QWidget *parent) :
|
||||
_logo_button.addAction(_about);
|
||||
connect(_about, SIGNAL(triggered()), this, SLOT(on_actionAbout_triggered()));
|
||||
|
||||
_wiki = new QAction(this);
|
||||
_wiki->setText(QApplication::translate(
|
||||
"File", "&Wiki", 0));
|
||||
_wiki->setIcon(QIcon::fromTheme("file",
|
||||
QIcon(":/icons/wiki.png")));
|
||||
_wiki->setObjectName(QString::fromUtf8("actionWiki"));
|
||||
_logo_button.addAction(_wiki);
|
||||
connect(_wiki, SIGNAL(triggered()), this, SLOT(on_actionWiki_triggered()));
|
||||
_manual = new QAction(this);
|
||||
_manual->setText(QApplication::translate(
|
||||
"File", "&Manual", 0));
|
||||
_manual->setIcon(QIcon::fromTheme("file",
|
||||
QIcon(":/icons/manual.png")));
|
||||
_manual->setObjectName(QString::fromUtf8("actionManual"));
|
||||
_logo_button.addAction(_manual);
|
||||
connect(_manual, SIGNAL(triggered()), this, SLOT(on_actionManual_triggered()));
|
||||
|
||||
_issue = new QAction(this);
|
||||
_issue->setText(QApplication::translate(
|
||||
"File", "&Bug Report", 0));
|
||||
_issue->setIcon(QIcon::fromTheme("file",
|
||||
QIcon(":/icons/bug.png")));
|
||||
_issue->setObjectName(QString::fromUtf8("actionManual"));
|
||||
_logo_button.addAction(_issue);
|
||||
connect(_issue, SIGNAL(triggered()), this, SLOT(on_actionIssue_triggered()));
|
||||
|
||||
_logo_button.setPopupMode(QToolButton::InstantPopup);
|
||||
_logo_button.setIcon(QIcon(":/icons/logo_noColor.png"));
|
||||
@@ -106,10 +115,18 @@ void LogoBar::on_actionAbout_triggered()
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
void LogoBar::on_actionWiki_triggered()
|
||||
void LogoBar::on_actionManual_triggered()
|
||||
{
|
||||
QDir dir(QCoreApplication::applicationDirPath());
|
||||
QDesktopServices::openUrl(
|
||||
QUrl(QLatin1String("http://www.dreamsourcelab.com/wiki")));
|
||||
QUrl("file:///"+dir.absolutePath() + "/ug.pdf"));
|
||||
}
|
||||
|
||||
void LogoBar::on_actionIssue_triggered()
|
||||
{
|
||||
QDir dir(QCoreApplication::applicationDirPath());
|
||||
QDesktopServices::openUrl(
|
||||
QUrl(QLatin1String("https://github.com/DreamSourceLab/DSView/issues")));
|
||||
}
|
||||
|
||||
void LogoBar::enable_toggle(bool enable)
|
||||
|
||||
@@ -53,7 +53,8 @@ signals:
|
||||
|
||||
private slots:
|
||||
void on_actionAbout_triggered();
|
||||
void on_actionWiki_triggered();
|
||||
void on_actionManual_triggered();
|
||||
void on_actionIssue_triggered();
|
||||
|
||||
private:
|
||||
bool _enable;
|
||||
@@ -62,7 +63,8 @@ private:
|
||||
QToolButton _logo_button;
|
||||
|
||||
QAction *_about;
|
||||
QAction *_wiki;
|
||||
QAction *_manual;
|
||||
QAction *_issue;
|
||||
|
||||
};
|
||||
|
||||
|
||||