Skip to content
Permalink
Browse files

implemented LicenseDialog, and add license.txt to Resources.(refs #62)

  • Loading branch information...
haraki committed Jun 28, 2019
1 parent a889fc8 commit 7dda618ac5eebfcfce5b9e9566b6bb939a33fd6c
Showing with 150 additions and 0 deletions.
  1. +3 −0 farman.pro
  2. +31 −0 licensedialog.cpp
  3. +22 −0 licensedialog.h
  4. +70 −0 licensedialog.ui
  5. +1 −0 resources.qrc
  6. +23 −0 text/license.txt
@@ -25,6 +25,7 @@ SOURCES += main.cpp\
bookmarkeditdialog.cpp \
bookmarkinfomodel.cpp \
bookmarkmanagerdialog.cpp \
licensedialog.cpp \
mainwindow.cpp \
folderform.cpp \
folderview.cpp \
@@ -67,6 +68,7 @@ HEADERS += mainwindow.h \
foldermodel.h \
folderview.h \
doublefolderpanel.h \
licensedialog.h \
misc.h \
selectbookmarkdialog.h \
types.h \
@@ -100,6 +102,7 @@ FORMS += mainwindow.ui \
bookmarkmanagerdialog.ui \
folderform.ui \
doublefolderpanel.ui \
licensedialog.ui \
selectbookmarkdialog.ui \
sortdialog.ui \
filterdialog.ui \
@@ -0,0 +1,31 @@
#include <QFile>
#include <QDebug>
#include "licensedialog.h"
#include "ui_licensedialog.h"

LicenseDialog::LicenseDialog(QWidget *parent/* = Q_NULLPTR*/) :
QDialog(parent),
ui(new Ui::LicenseDialog)
{
ui->setupUi(this);

QFile licenseTxt(":/text/license.txt");
if(licenseTxt.open(QFile::ReadOnly))
{
QString licenseHtml;

while(!licenseTxt.atEnd())
{
licenseHtml.push_back(licenseTxt.readLine() + "<br />");
}

ui->licenseTextBrowser->setHtml(licenseHtml);

licenseTxt.close();
}
}

LicenseDialog::~LicenseDialog()
{
delete ui;
}
@@ -0,0 +1,22 @@
#ifndef LICENSEDIALOG_H
#define LICENSEDIALOG_H

#include <QDialog>

namespace Ui {
class LicenseDialog;
}

class LicenseDialog : public QDialog
{
Q_OBJECT

public:
explicit LicenseDialog(QWidget *parent = Q_NULLPTR);
~LicenseDialog();

private:
Ui::LicenseDialog *ui;
};

#endif // LICENSEDIALOG_H
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LicenseDialog</class>
<widget class="QDialog" name="LicenseDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>679</width>
<height>389</height>
</rect>
</property>
<property name="windowTitle">
<string>License</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTextBrowser" name="licenseTextBrowser"/>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
<property name="centerButtons">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>LicenseDialog</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>LicenseDialog</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>
@@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/">
<file>text/license.txt</file>
<file>images/bookmark_off.svg</file>
<file>images/bookmark_on.svg</file>
</qresource>
@@ -0,0 +1,23 @@
<strong>QHexView</strong>

The MIT License (MIT)

Copyright (c) 2015 Victor Anjin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

0 comments on commit 7dda618

Please sign in to comment.
You can’t perform that action at this time.