Skip to content

Commit

Permalink
Initial public commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dail8859 committed Nov 27, 2019
0 parents commit 99e1a5e
Show file tree
Hide file tree
Showing 806 changed files with 256,794 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# C++ objects and libs

*.slo
*.lo
*.o
*.a
*.la
*.lai
*.so
*.dll
*.dylib

# Qt-es

object_script.*.Release
object_script.*.Debug
*_plugin_import.cpp
/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.qbs.user
*.qbs.user.*
*.moc
moc_*.cpp
moc_*.h
qrc_*.cpp
ui_*.h
Makefile*
*build-*


# Qt unit tests
target_wrapper.*


# QtCreator

*.autosave

# QtCtreator Qml
*.qmlproject.user
*.qmlproject.user.*

# QtCtreator CMake
CMakeLists.txt.user*

*.pyc
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Notepad Next
A cross-platform, reimplementation of Notepad++.

Though the application overall is stable and usable, it should not be considered for daily use and is missing most features.

There are numerous bugs and half working implementations. Pull requests are greatly appreciated.

![screenshot](/doc/screenshot.png)

# Development
Current development has been done using Visual Studio 2017 and Qt v5.13. Other platforms/compilers have not been tested but should be usable.

1. Install Visual Studio 2017 (Community Edition is fine)
1. Download the [Qt Installer](https://www.qt.io/download-qt-installer)
1. Use the Qt Installer to install `Qt 5.13.X` (MSVC 2017 64-bit) and `Qt Creator`
1. Open `src/NotepadNext.pro`
1. Build/Run the project

# License
This code is released under the [GNU General Public License version 3](http://www.gnu.org/licenses/gpl-3.0.txt).
Binary file added doc/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions installer/config/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>Notepad Next</Name>
<Version>0.1</Version>
<Title>Notepad Next v0.1</Title>
<Publisher>Notepad Next</Publisher>
<StartMenuDir>Notepad Next</StartMenuDir>

<AllowNonAsciiCharacters>true</AllowNonAsciiCharacters>
<SupportsModify>true</SupportsModify>
<TargetDir>@ApplicationsDirX64@/Notepad Next</TargetDir>

<!--<StyleSheet>style.qss</StyleSheet>-->
<!--<TitleColor>#88FF33</TitleColor>-->
<WizardStyle>Modern</WizardStyle>

<ControlScript>controller.qs</ControlScript>
</Installer>
38 changes: 38 additions & 0 deletions installer/config/controller.qs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// This file is part of Notepad Next.
// Copyright 2019 Justin Dailey
//
// Notepad Next 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 3 of the License, or
// (at your option) any later version.
//
// Notepad Next 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 Notepad Next. If not, see <https://www.gnu.org/licenses/>.


function Controller()
{
console.log("OS: " + systemInfo.prettyProductName);
console.log("Kernel: " + systemInfo.kernelType + "/" + systemInfo.kernelVersion);
console.log("CPU Architecture: " + systemInfo.currentCpuArchitecture);

installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);

installer.uninstallationFinished.connect(this, function() {
var key_exists =installer.execute("reg", new Array("QUERY", "HKEY_CLASSES_ROOT\\*\\shell\\notepadnext", "/VE"))[1];
if (key_exists == 0) {
console.log("Removing key for context menu");
if (installer.gainAdminRights()) {
installer.execute("reg", new Array("DELETE", "HKEY_CLASSES_ROOT\\*\\shell\\notepadnext", "/f"));
}
else {
console.log("Couldn't gain admin rights");
}
}
});
}
46 changes: 46 additions & 0 deletions installer/installer.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This file is part of Notepad Next.
# Copyright 2019 Justin Dailey
#
# Notepad Next 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 3 of the License, or
# (at your option) any later version.
#
# Notepad Next 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 Notepad Next. If not, see <https://www.gnu.org/licenses/>.


include(../src/Version.pri)

TEMPLATE = aux

INSTALLER = "NotepadNext-v$$APP_VERSION"

!win32 {
error(Building the installer is only supported on Windows currently)
}

!exists ($$PWD/packages/app/data/data.7z) {
error(packages/app/data/data.7z missing)
}

INPUT = config/config.xml \
config/controller.qs \
$$files(packages/**package.xml, true) \
$$files(packages/**.qs, true) \
$$files(packages/**.ui, true)

installer.input = INPUT
installer.output = $$INSTALLER
installer.CONFIG += target_predeps no_link combine
#installer.depends = predeploy
installer.commands = C:/Qt/Tools/QtInstallerFramework/3.1/bin/binarycreator --offline-only -c $$PWD/config/config.xml -p $$PWD/packages ${QMAKE_FILE_OUT}

QMAKE_EXTRA_COMPILERS += installer

#win32:RC_FILE += "$$PWD/resources/res.rc"
55 changes: 55 additions & 0 deletions installer/packages/app/meta/installoptions.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>InstallOptionsForm</class>
<widget class="QWidget" name="InstallOptionsForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="addContextMenu">
<property name="text">
<string>Add Context Menu</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="addDesktopShortcut">
<property name="text">
<string>Add Desktop Shortcut</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="addStartMenuShortcut">
<property name="text">
<string>Add Start Menu Shortcut</string>
</property>
</widget>
</item>
<item>
<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>
<resources/>
<connections/>
</ui>
73 changes: 73 additions & 0 deletions installer/packages/app/meta/installscript.qs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// This file is part of Notepad Next.
// Copyright 2019 Justin Dailey
//
// Notepad Next 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 3 of the License, or
// (at your option) any later version.
//
// Notepad Next 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 Notepad Next. If not, see <https://www.gnu.org/licenses/>.


function Component()
{
component.loaded.connect(this, function() {
if (installer.isInstaller()) {
if (systemInfo.productType === "windows") {
installer.addWizardPageItem(component, "InstallOptionsForm", QInstaller.TargetDirectory);
}
}
});
}

Component.prototype.createOperations = function()
{
// call default implementation to actually install the registeredfile
component.createOperations();

var isContextMenuChecked = component.userInterface("InstallOptionsForm").addContextMenu.checked;
var isDesktopShortcutChecked = component.userInterface("InstallOptionsForm").addDesktopShortcut.checked;
var isStartMenuShortcutChecked = component.userInterface("InstallOptionsForm").addStartMenuShortcut.checked;
if (systemInfo.productType === "windows") {
// Right-click context menu
if (isContextMenuChecked) {
component.addElevatedOperation("GlobalConfig", "HKEY_CLASSES_ROOT\\*\\shell\\notepadnext", "Default", "Open with Notepad Next");
component.addElevatedOperation("GlobalConfig", "HKEY_CLASSES_ROOT\\*\\shell\\notepadnext", "icon", "\"@TargetDir@\\NotepadNext.exe\"");
component.addElevatedOperation("GlobalConfig", "HKEY_CLASSES_ROOT\\*\\shell\\notepadnext\\command", "Default", "\"@TargetDir@\\NotepadNext.exe\" \"%1\"");
}

// Create desktop shortcut
if (isDesktopShortcutChecked) {
component.addOperation("CreateShortcut",
"@TargetDir@/NotepadNext.exe",
"@DesktopDir@/NotepadNext.lnk",
"workingDirectory=@TargetDir@",
"iconPath=@TargetDir@/NotepadNext.exe",
"iconId=0");
}

// Create start menu shortcut
if (isStartMenuShortcutChecked) {
component.addOperation("CreateShortcut",
"@TargetDir@/NotepadNext.exe",
"@StartMenuDir@/NotepadNext.lnk",
"workingDirectory=@TargetDir@",
"iconPath=@TargetDir@/NotepadNext.exe",
"iconId=0"
);
component.addOperation("CreateShortcut",
"@TargetDir@/maintenancetool.exe",
"@StartMenuDir@/Uninstall NotepadNext.lnk",
"workingDirectory=@TargetDir@",
"iconPath=@TargetDir@/NotepadNext.exe",
"iconId=0"
);
}
}
}
13 changes: 13 additions & 0 deletions installer/packages/app/meta/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<Package>
<DisplayName>Notepad Next</DisplayName>
<Description>Notepad Next v0.1</Description>
<Version>0.1</Version>
<ForcedInstallation>true</ForcedInstallation>
<ReleaseDate>2019-03-19</ReleaseDate>
<!-- <RequiresAdminRights>true</RequiresAdminRights> -->
<Script>installscript.qs</Script>
<UserInterfaces>
<UserInterface>installoptions.ui</UserInterface>
</UserInterfaces>
</Package>
Loading

0 comments on commit 99e1a5e

Please sign in to comment.