!39 Enhancements to Navigation Bar and English Translations, Redesign of About Window with GPLv3 License (2)

Merge pull request !39 from Kamey03/kameys
This commit is contained in:
爬山虎 2023-02-08 08:40:39 +00:00 committed by Gitee
commit 214ad0c114
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 128 additions and 68 deletions

View File

@ -6,6 +6,7 @@ AboutNdd::AboutNdd(QWidget *parent)
ui.setupUi(this);
ui.label->setOpenExternalLinks(true);
connect(ui.aboutPushButton, &QPushButton::clicked, this, &AboutNdd::onButtonOkayClicked);
}
AboutNdd::~AboutNdd()
@ -15,3 +16,8 @@ void AboutNdd::appendText(QString text)
{
ui.nddMsgText->appendPlainText(text);
}
void AboutNdd::onButtonOkayClicked()
{
close();
}

View File

@ -13,6 +13,9 @@ public:
void appendText(QString text);
private slots:
void onButtonOkayClicked();
private:
Ui::AboutNddClass ui;
};

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>400</width>
<height>114</height>
<height>180</height>
</rect>
</property>
<property name="maximumSize">
@ -17,7 +17,7 @@
</size>
</property>
<property name="windowTitle">
<string>AboutNdd</string>
<string>About Notepad--</string>
</property>
<property name="windowIcon">
<iconset resource="RealCompare.qrc">
@ -33,25 +33,76 @@
<property name="bottomMargin">
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayout0">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://gitee.com/cxasm/notepad--&quot;&gt;&lt;span style=&quot; font-size:10pt; text-decoration: underline; color:#0000ff;&quot;&gt;Click to get the latest version of notepad-- or source code&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>General Public License</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<item>
<widget class="QPlainTextEdit" name="nddMsgText">
<property name="readOnly">
<bool>true</bool>
</property>
<property name="plainText">
<string>opensoure webhttps://gitee.com/cxasm/notepad--</string>
<string>This software is licensed under the terms of the GNU General Public License version 3 (GPLv3). You are free to redistribute and modify the software in accordance with the license.
This software is distributed with the hope that it will be useful, but without any warranties, including the implied warranties of merchantability or fitness for a particular purpose. Please see the GNU General Public License for more information.
A copy of the GPLv3 license should have been provided along with this software. If you have not received a copy, it can be found at https://www.gnu.org/licenses/.</string>
</property>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout"/>
</layout>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Home: &lt;a href=&quot;https://gitee.com/cxasm/notepad--&quot;&gt;&lt;span style=&quot; font-size:10pt; text-decoration: underline; color:#0000ff;&quot;&gt;https://gitee.com/cxasm/notepad--&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="aboutPushButton">
<property name="minimumSize">
<size>
<width>100</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>28</height>
</size>
</property>
<property name="text">
<string>Okay</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>

View File

@ -7338,18 +7338,18 @@ void CCNotePad::slot_aboutNdd()
{
AboutNdd* pWin = new AboutNdd();
pWin->setAttribute(Qt::WA_DeleteOnClose);
QString title = tr("Ndd Version %1").arg(VersionStr);
QString title = tr("Notepad-- Version %1").arg(VersionStr);
pWin->setWindowTitle(title);
pWin->appendText(title);
int status = NddSetting::getKeyValueFromNumSets(SOFT_STATUS);
if (1 == status)
{
pWin->appendText(tr("Registered Version"));
}
else
{
pWin->appendText(tr("Free Trial"));
}
// int status = NddSetting::getKeyValueFromNumSets(SOFT_STATUS);
// if (1 == status)
// {
// pWin->appendText(tr("Registered Version"));
// }
// else
// {
// pWin->appendText(tr("Free Trial"));
// }
pWin->show();
registerEscKeyShort(pWin);
#ifdef uos
@ -7357,6 +7357,7 @@ void CCNotePad::slot_aboutNdd()
#endif
}
void CCNotePad::addWatchFilePath(QString filePath)
{
getRegularFilePath(filePath);
@ -7651,25 +7652,25 @@ void CCNotePad::slot_donate()
#endif
}
void CCNotePad::slot_registerCmd(int cmd, int code)
{
if (cmd == 1)
{
//服务器返回注册码的消息。 //0 试用 1 正版 2 正版过期 3 错误key
int status = NddSetting::getKeyValueFromNumSets(SOFT_STATUS);
if (status != code)
{
NddSetting::updataKeyValueFromNumSets(SOFT_STATUS, code);
}
emit signRegisterReplay(code);
}
}
// void CCNotePad::slot_registerCmd(int cmd, int code)
// {
// if (cmd == 1)
// {
// //服务器返回注册码的消息。 //0 试用 1 正版 2 正版过期 3 错误key
// int status = NddSetting::getKeyValueFromNumSets(SOFT_STATUS);
// if (status != code)
// {
// NddSetting::updataKeyValueFromNumSets(SOFT_STATUS, code);
// }
//
// emit signRegisterReplay(code);
// }
//}
//获取注册码
void CCNotePad::slot_register()
{
}
//void CCNotePad::slot_register()
//{
//}
//当前正在使用的所有语言的tags
void CCNotePad::getCurUseLexerTags(QVector<QString>& tags)
@ -8926,4 +8927,3 @@ void CCNotePad::slot_shortcutManager()
#endif
pWin->show();
}

View File

@ -178,7 +178,7 @@ public slots:
void slot_batch_rename();
void slot_options();
void slot_donate();
void slot_registerCmd(int cmd, int code);
// void slot_registerCmd(int cmd, int code);
void slot_viewStyleChange(QString tag, int styleId, QColor & fgColor, QColor & bkColor, QFont & font, bool fontChange);
void slot_viewLexerChange(QString tag);
void slot_findInDir();
@ -278,7 +278,7 @@ private slots:
void slot_toDarkStyle();
void slot_toLavenderBlush();
void slot_toMistyRose();*/
void slot_register();
//void slot_register();
void slot_slectionChanged();
void slot_preHexPage();

View File

@ -60,7 +60,7 @@
<item>
<widget class="QCheckBox" name="leftBox">
<property name="text">
<string>save left document ?</string>
<string>Save Left Document?</string>
</property>
<property name="checked">
<bool>true</bool>
@ -70,7 +70,7 @@
<item>
<widget class="QCheckBox" name="rightBox">
<property name="text">
<string>save right document ?</string>
<string>Save Right Document?</string>
</property>
<property name="checked">
<bool>true</bool>
@ -140,7 +140,7 @@
</size>
</property>
<property name="text">
<string>save selected</string>
<string>Save Selected</string>
</property>
</widget>
</item>
@ -159,7 +159,7 @@
</size>
</property>
<property name="text">
<string>discard</string>
<string>Discard</string>
</property>
</widget>
</item>
@ -178,7 +178,7 @@
</size>
</property>
<property name="text">
<string>cancel</string>
<string>Cancel</string>
</property>
</widget>
</item>

View File

@ -40,7 +40,7 @@
</size>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab_find">
<attribute name="title">
@ -1462,8 +1462,8 @@
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>572</x>
<y>251</y>
<x>674</x>
<y>288</y>
</hint>
<hint type="destinationlabel">
<x>169</x>
@ -1510,8 +1510,8 @@
<slot>slot_replaceFindNext()</slot>
<hints>
<hint type="sourcelabel">
<x>94</x>
<y>60</y>
<x>448</x>
<y>69</y>
</hint>
<hint type="destinationlabel">
<x>588</x>
@ -1526,8 +1526,8 @@
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>94</x>
<y>45</y>
<x>448</x>
<y>213</y>
</hint>
<hint type="destinationlabel">
<x>588</x>
@ -1542,8 +1542,8 @@
<slot>slot_replace()</slot>
<hints>
<hint type="sourcelabel">
<x>94</x>
<y>64</y>
<x>448</x>
<y>103</y>
</hint>
<hint type="destinationlabel">
<x>588</x>
@ -1558,8 +1558,8 @@
<slot>slot_replaceAll()</slot>
<hints>
<hint type="sourcelabel">
<x>94</x>
<y>67</y>
<x>448</x>
<y>137</y>
</hint>
<hint type="destinationlabel">
<x>588</x>
@ -1574,8 +1574,8 @@
<slot>slot_replaceAllInOpenDoc()</slot>
<hints>
<hint type="sourcelabel">
<x>94</x>
<y>76</y>
<x>448</x>
<y>180</y>
</hint>
<hint type="destinationlabel">
<x>588</x>
@ -1638,8 +1638,8 @@
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>572</x>
<y>142</y>
<x>674</x>
<y>171</y>
</hint>
<hint type="destinationlabel">
<x>564</x>
@ -1718,8 +1718,8 @@
<slot>slot_findPrev()</slot>
<hints>
<hint type="sourcelabel">
<x>484</x>
<y>73</y>
<x>674</x>
<y>103</y>
</hint>
<hint type="destinationlabel">
<x>294</x>