Skip to content

Commit 1fa14c5

Browse files
committedApr 24, 2018
Issue #161: Сообщения о лицензии.
1 parent a3b319a commit 1fa14c5

8 files changed

+199
-4
lines changed
 

‎appveyor.yml

+2
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ after_build:
127127
128128
call .\windeploycrt.cmd %QT_PATH%\bin tool1cd\bin
129129
130+
xcopy COPYING tool1cd\bin
131+
130132
7z a -r tool1cd-%APPVEYOR_BUILD_VERSION%.zip tool1cd\bin
131133
132134
candle tool1cd.wxs

‎src/ctool1cd/App.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -505,13 +505,23 @@ void App::find_and_save_lost_objects(const ParsedCommand &pc)
505505
base1CD->find_and_save_lost_objects(lost_objects);
506506
}
507507

508+
void out_gpl_header()
509+
{
510+
cout << "cTool_1CD Copyright 2009-2017 awa, Copyright 2017-2018 E8 Tools Contributors"
511+
<< endl
512+
<< "This program comes with ABSOLUTELY NO WARRANTY; "
513+
"This is free software, and you are welcome to redistribute it under certain conditions."
514+
<< endl;
515+
}
516+
508517
int App::Run()
509518
{
510519

511520
vector<ParsedCommand> &commands = comm.getcommands();
512521

513522
if (commands.empty()) {
514-
cout << "cTool_1CD (c) awa 2009 - 2017" << endl << "Запусти cTool_1CD -h для справки" << endl;
523+
out_gpl_header();
524+
cout << "Запусти cTool_1CD -h для справки" << endl;
515525
return 0;
516526
}
517527

‎src/gtool1cd/CMakeLists.txt

+5-3
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,15 @@ file (GLOB MODEL_SOURCES "models/*.cpp")
4949
set(HEADER_FILES mainwindow.h starter.h littlelogwindow.h cache.h table_fields_window.h table_data_window.h
5050
skobkatextwindow.h models/tables_list_model.h models/fields_list_model.h models/table_data_model.h
5151
export_table_to_xml_dialog.h configurations_window.h
52-
${MODEL_HEADERS} ${QHEXEDIT_HEADERS} BlobViewer/blob_viewer.h container_form.h)
52+
${MODEL_HEADERS} ${QHEXEDIT_HEADERS} BlobViewer/blob_viewer.h container_form.h
53+
about_dialog.h)
5354
set(UI_FILES mainwindow.ui starter.ui littlelogwindow.ui table_fields_window.ui table_data_window.ui
5455
skobkatextwindow.ui export_table_to_xml_dialog.ui configurations_window.ui BlobViewer/blob_viewer.ui
55-
container_form.ui)
56+
container_form.ui about_dialog.ui)
5657
set(SOURCE_FILES main.cpp mainwindow.cpp starter.cpp littlelogwindow.cpp cache.cpp table_fields_window.cpp table_data_window.cpp
5758
skobkatextwindow.cpp export_table_to_xml_dialog.cpp configurations_window.cpp
58-
${MODEL_SOURCES} ${QHEXEDIT_SOURCES} BlobViewer/blob_viewer.cpp container_form.cpp)
59+
${MODEL_SOURCES} ${QHEXEDIT_SOURCES} BlobViewer/blob_viewer.cpp container_form.cpp
60+
about_dialog.cpp)
5961

6062
set (RESOURCES gtool1cd.rc gtool1cd.qrc)
6163

‎src/gtool1cd/about_dialog.cpp

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
GTool1CD provides GUI front end to Tool1CD library
3+
Copyright © 2009-2017 awa
4+
Copyright © 2017-2018 E8 Tools contributors
5+
6+
This file is part of GTool1CD.
7+
8+
GTool1CD is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU General Public License as published by
10+
the Free Software Foundation, either version 3 of the License, or
11+
(at your option) any later version.
12+
13+
GTool1CD is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
GNU General Public License for more details.
17+
18+
You should have received a copy of the GNU General Public License
19+
along with GTool1CD. If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
#include "about_dialog.h"
22+
#include "ui_about_dialog.h"
23+
24+
AboutDialog::AboutDialog(QWidget *parent) :
25+
QDialog(parent),
26+
ui(new Ui::AboutDialog)
27+
{
28+
ui->setupUi(this);
29+
}
30+
31+
AboutDialog::~AboutDialog()
32+
{
33+
delete ui;
34+
}

‎src/gtool1cd/about_dialog.h

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
GTool1CD provides GUI front end to Tool1CD library
3+
Copyright © 2009-2017 awa
4+
Copyright © 2017-2018 E8 Tools contributors
5+
6+
This file is part of GTool1CD.
7+
8+
GTool1CD is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU General Public License as published by
10+
the Free Software Foundation, either version 3 of the License, or
11+
(at your option) any later version.
12+
13+
GTool1CD is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
GNU General Public License for more details.
17+
18+
You should have received a copy of the GNU General Public License
19+
along with GTool1CD. If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
#ifndef ABOUT_DIALOG_H
22+
#define ABOUT_DIALOG_H
23+
24+
#include <QDialog>
25+
26+
namespace Ui {
27+
class AboutDialog;
28+
}
29+
30+
class AboutDialog : public QDialog
31+
{
32+
Q_OBJECT
33+
34+
public:
35+
explicit AboutDialog(QWidget *parent = 0);
36+
~AboutDialog();
37+
38+
private:
39+
Ui::AboutDialog *ui;
40+
};
41+
42+
#endif // ABOUT_DIALOG_H

‎src/gtool1cd/about_dialog.ui

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>AboutDialog</class>
4+
<widget class="QDialog" name="AboutDialog">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>577</width>
10+
<height>300</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>Dialog</string>
15+
</property>
16+
<widget class="QDialogButtonBox" name="buttonBox">
17+
<property name="geometry">
18+
<rect>
19+
<x>30</x>
20+
<y>240</y>
21+
<width>341</width>
22+
<height>32</height>
23+
</rect>
24+
</property>
25+
<property name="orientation">
26+
<enum>Qt::Horizontal</enum>
27+
</property>
28+
<property name="standardButtons">
29+
<set>QDialogButtonBox::Ok</set>
30+
</property>
31+
</widget>
32+
<widget class="QLabel" name="label">
33+
<property name="geometry">
34+
<rect>
35+
<x>10</x>
36+
<y>20</y>
37+
<width>501</width>
38+
<height>211</height>
39+
</rect>
40+
</property>
41+
<property name="text">
42+
<string>gTool1CD Copyright (C) 2009-2017 awa, Copyright 2017-2018 E8 Tools Contributors.
43+
44+
This program comes with ABSOLUTELY NO WARRANTY.
45+
This is free software, and you are welcome to redistribute it under certain conditions.
46+
47+
You should have received a copy of the GNU General Public License
48+
along with this program. If not, see &lt;https://www.gnu.org/licenses/&gt;.</string>
49+
</property>
50+
<property name="textFormat">
51+
<enum>Qt::PlainText</enum>
52+
</property>
53+
<property name="wordWrap">
54+
<bool>true</bool>
55+
</property>
56+
</widget>
57+
</widget>
58+
<resources/>
59+
<connections>
60+
<connection>
61+
<sender>buttonBox</sender>
62+
<signal>accepted()</signal>
63+
<receiver>AboutDialog</receiver>
64+
<slot>accept()</slot>
65+
<hints>
66+
<hint type="sourcelabel">
67+
<x>248</x>
68+
<y>254</y>
69+
</hint>
70+
<hint type="destinationlabel">
71+
<x>157</x>
72+
<y>274</y>
73+
</hint>
74+
</hints>
75+
</connection>
76+
<connection>
77+
<sender>buttonBox</sender>
78+
<signal>rejected()</signal>
79+
<receiver>AboutDialog</receiver>
80+
<slot>reject()</slot>
81+
<hints>
82+
<hint type="sourcelabel">
83+
<x>316</x>
84+
<y>260</y>
85+
</hint>
86+
<hint type="destinationlabel">
87+
<x>286</x>
88+
<y>274</y>
89+
</hint>
90+
</hints>
91+
</connection>
92+
</connections>
93+
</ui>

‎src/gtool1cd/mainwindow.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "table_data_window.h"
3030
#include "models/tables_list_model.h"
3131
#include "configurations_window.h"
32+
#include "about_dialog.h"
3233

3334
void MainWindow::AddDetailedMessage(
3435
const std::string &description,
@@ -109,3 +110,11 @@ void MainWindow::on_tableListView_activated(const QModelIndex &index)
109110
{
110111
emit ui->tableListView->doubleClicked(index);
111112
}
113+
114+
void MainWindow::on_aboutAction_triggered()
115+
{
116+
if (about_window == nullptr) {
117+
about_window = new AboutDialog(this);
118+
}
119+
about_window->show();
120+
}

‎src/gtool1cd/mainwindow.h

+3
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,15 @@ private slots:
6262

6363
void on_tableListView_activated(const QModelIndex &index);
6464

65+
void on_aboutAction_triggered();
66+
6567
private:
6668
Ui::MainWindow *ui;
6769
T_1CD *db;
6870
QStringList logData;
6971
QMap<Table *, QWidget *> table_windows;
7072
QWidget *configurationsWindow;
73+
QWidget *about_window {nullptr};
7174
};
7275

7376
#endif // MAINWINDOW_H

0 commit comments

Comments
 (0)
Please sign in to comment.