Skip to content

Commit

Permalink
v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
neroist committed Jul 19, 2021
1 parent 1c0f6b9 commit 1b0a01b
Show file tree
Hide file tree
Showing 25 changed files with 470 additions and 82 deletions.
233 changes: 162 additions & 71 deletions __main__.py

Large diffs are not rendered by default.

Binary file modified __pycache__/__main__.cpython-39.pyc
Binary file not shown.
47 changes: 47 additions & 0 deletions find.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
from PyQt5.QtWidgets import (
QDialog,
QDialogButtonBox,
QLineEdit,
QLabel,
QVBoxLayout,
QPushButton
)
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QFont

from modules import stillworking

class FindDialog(QDialog):
def __init__(self, parent=None):
super(FindDialog, self).__init__(parent)

self.setWindowTitle("Find")
self.setWindowFlag(Qt.WindowContextHelpButtonHint, False)

layout = QVBoxLayout(self)

label = QLabel("Find:", self)
label.setFont(QFont("Segoe UI", 10))
layout.addWidget(label)

entry = QLineEdit(self)
entry.setFont(QFont("Segoe UI", 9))
layout.addWidget(entry)

__k = QPushButton(self.tr("OK"), self)
__k.setFont(font := QFont("Segoe UI"))

__cancel = QPushButton(self.tr("Cancel"), self)
__cancel.setFont(font)

buttonbox = QDialogButtonBox(Qt.Horizontal, self)
buttonbox.addButton(__k, QDialogButtonBox.AcceptRole)
buttonbox.addButton(__cancel, QDialogButtonBox.RejectRole)
buttonbox.accepted.connect(self.__find_and_highlight)
buttonbox.rejected.connect(self.reject)
layout.addWidget(buttonbox)

def __find_and_highlight(self):
stillworking.stillworking(parent=self)
self.accept()

Binary file modified icons/save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions main.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
__main__ [level 20 INFO 2021/07/19 01:24:32.950 AM, line 499 in __main__.py | Thread MainThread 29124 Process MainProcess 1164] Application started.
__main__ [level 20 INFO 2021/07/19 01:26:02.787 AM, line 499 in __main__.py | Thread MainThread 16424 Process MainProcess 15512] Application started.
__main__ [level 20 INFO 2021/07/19 01:26:15.117 AM, line 499 in __main__.py | Thread MainThread 13864 Process MainProcess 16252] Application started.
__main__ [level 20 INFO 2021/07/19 01:26:24.819 AM, line 499 in __main__.py | Thread MainThread 15292 Process MainProcess 18176] Application started.
__main__ [level 20 INFO 2021/07/19 01:26:50.338 AM, line 499 in __main__.py | Thread MainThread 20468 Process MainProcess 26368] Application started.
__main__ [level 20 INFO 2021/07/19 01:27:17.39 AM, line 485 in __main__.py | Thread MainThread 20468 Process MainProcess 26368] Application closed.
__main__ [level 20 INFO 2021/07/19 02:05:16.803 AM, line 499 in __main__.py | Thread MainThread 28488 Process MainProcess 28972] Application started.
__main__ [level 20 INFO 2021/07/19 02:05:25.574 AM, line 485 in __main__.py | Thread MainThread 28488 Process MainProcess 28972] Application closed.
__main__ [level 20 INFO 2021/07/19 02:05:59.943 AM, line 499 in __main__.py | Thread MainThread 12004 Process MainProcess 28248] Application started.
__main__ [level 20 INFO 2021/07/19 02:06:27.302 AM, line 485 in __main__.py | Thread MainThread 12004 Process MainProcess 28248] Application closed.
__main__ [level 20 INFO 2021/07/19 02:18:25.713 AM, line 499 in __main__.py | Thread MainThread 19056 Process MainProcess 2920] Application started.
__main__ [level 20 INFO 2021/07/19 02:19:59.574 AM, line 499 in __main__.py | Thread MainThread 19004 Process MainProcess 14836] Application started.
__main__ [level 20 INFO 2021/07/19 02:22:23.733 AM, line 499 in __main__.py | Thread MainThread 524 Process MainProcess 16040] Application started.
__main__ [level 20 INFO 2021/07/19 02:22:28.660 AM, line 485 in __main__.py | Thread MainThread 524 Process MainProcess 16040] Application closed.
__main__ [level 20 INFO 2021/07/19 02:30:58.163 AM, line 499 in __main__.py | Thread MainThread 27544 Process MainProcess 3700] Application started.
__main__ [level 20 INFO 2021/07/19 02:31:10.170 AM, line 485 in __main__.py | Thread MainThread 27544 Process MainProcess 3700] Application closed.
__main__ [level 20 INFO 2021/07/19 02:40:17.883 AM, line 499 in __main__.py | Thread MainThread 12012 Process MainProcess 4284] Application started.
__main__ [level 20 INFO 2021/07/19 02:41:09.530 AM, line 485 in __main__.py | Thread MainThread 12012 Process MainProcess 4284] Application closed.
__main__ [level 20 INFO 2021/07/19 02:46:32.281 AM, line 499 in __main__.py | Thread MainThread 5736 Process MainProcess 24416] Application started.
__main__ [level 20 INFO 2021/07/19 02:46:36.567 AM, line 485 in __main__.py | Thread MainThread 5736 Process MainProcess 24416] Application closed.
__main__ [level 20 INFO 2021/07/19 02:48:36.478 AM, line 499 in __main__.py | Thread MainThread 25236 Process MainProcess 28900] Application started.
__main__ [level 20 INFO 2021/07/19 02:48:37.596 AM, line 485 in __main__.py | Thread MainThread 25236 Process MainProcess 28900] Application closed.
__main__ [level 20 INFO 2021/07/19 02:48:45.661 AM, line 499 in __main__.py | Thread MainThread 8916 Process MainProcess 13636] Application started.
__main__ [level 20 INFO 2021/07/19 02:49:20.253 AM, line 485 in __main__.py | Thread MainThread 8916 Process MainProcess 13636] Application closed.
__main__ [level 20 INFO 2021/07/19 02:49:54.206 AM, line 499 in __main__.py | Thread MainThread 12216 Process MainProcess 19628] Application started.
__main__ [level 20 INFO 2021/07/19 02:50:11.849 AM, line 485 in __main__.py | Thread MainThread 12216 Process MainProcess 19628] Application closed.
__main__ [level 20 INFO 2021/07/19 02:51:46.392 AM, line 499 in __main__.py | Thread MainThread 2236 Process MainProcess 15216] Application started.
__main__ [level 10 DEBUG 2021/07/19 02:51:54.638 AM, line 370 in __main__.py | Thread MainThread 2236 Process MainProcess 15216] Attempted to decode "" by Base64. Result: ""
__main__ [level 20 INFO 2021/07/19 02:52:03.182 AM, line 485 in __main__.py | Thread MainThread 2236 Process MainProcess 15216] Application closed.
__main__ [level 20 INFO 2021/07/19 02:54:28.798 AM, line 499 in __main__.py | Thread MainThread 10032 Process MainProcess 25044] Application started.
__main__ [level 20 INFO 2021/07/19 02:54:35.435 AM, line 485 in __main__.py | Thread MainThread 10032 Process MainProcess 25044] Application closed.
__main__ [level 20 INFO 2021/07/19 02:54:40.700 AM, line 499 in __main__.py | Thread MainThread 4840 Process MainProcess 23656] Application started.
__main__ [level 20 INFO 2021/07/19 02:54:47.323 AM, line 485 in __main__.py | Thread MainThread 4840 Process MainProcess 23656] Application closed.
__main__ [level 20 INFO 2021/07/19 02:55:56.102 AM, line 499 in __main__.py | Thread MainThread 13428 Process MainProcess 26908] Application started.
__main__ [level 20 INFO 2021/07/19 02:55:59.771 AM, line 485 in __main__.py | Thread MainThread 13428 Process MainProcess 26908] Application closed.
__main__ [level 20 INFO 2021/07/19 02:56:15.794 AM, line 499 in __main__.py | Thread MainThread 12928 Process MainProcess 24356] Application started.
__main__ [level 20 INFO 2021/07/19 02:56:17.624 AM, line 485 in __main__.py | Thread MainThread 12928 Process MainProcess 24356] Application closed.
__main__ [level 20 INFO 2021/07/19 02:56:37.934 AM, line 499 in __main__.py | Thread MainThread 29624 Process MainProcess 28472] Application started.
__main__ [level 20 INFO 2021/07/19 02:56:54.107 AM, line 485 in __main__.py | Thread MainThread 29624 Process MainProcess 28472] Application closed.
__main__ [level 20 INFO 2021/07/19 02:57:37.508 AM, line 499 in __main__.py | Thread MainThread 28000 Process MainProcess 9296] Application started.
__main__ [level 20 INFO 2021/07/19 02:57:53.702 AM, line 485 in __main__.py | Thread MainThread 28000 Process MainProcess 9296] Application closed.
__main__ [level 20 INFO 2021/07/19 02:58:55.854 AM, line 499 in __main__.py | Thread MainThread 14712 Process MainProcess 25260] Application started.
__main__ [level 20 INFO 2021/07/19 02:59:44.565 AM, line 485 in __main__.py | Thread MainThread 14712 Process MainProcess 25260] Application closed.
__main__ [level 20 INFO 2021/07/19 03:01:00.805 AM, line 499 in __main__.py | Thread MainThread 28132 Process MainProcess 28680] Application started.
__main__ [level 20 INFO 2021/07/19 03:01:02.499 AM, line 485 in __main__.py | Thread MainThread 28132 Process MainProcess 28680] Application closed.
__main__ [level 20 INFO 2021/07/19 03:01:12.157 AM, line 499 in __main__.py | Thread MainThread 20572 Process MainProcess 11880] Application started.
__main__ [level 20 INFO 2021/07/19 03:01:42.87 AM, line 499 in __main__.py | Thread MainThread 15900 Process MainProcess 21912] Application started.
__main__ [level 20 INFO 2021/07/19 03:02:16.70 AM, line 485 in __main__.py | Thread MainThread 15900 Process MainProcess 21912] Application closed.
__main__ [level 20 INFO 2021/07/19 03:02:40.761 AM, line 499 in __main__.py | Thread MainThread 29392 Process MainProcess 10540] Application started.
__main__ [level 20 INFO 2021/07/19 03:04:18.936 AM, line 485 in __main__.py | Thread MainThread 29392 Process MainProcess 10540] Application closed.
__main__ [level 20 INFO 2021/07/19 03:08:47.4 AM, line 499 in __main__.py | Thread MainThread 9064 Process MainProcess 11476] Application started.
__main__ [level 20 INFO 2021/07/19 03:09:01.197 AM, line 485 in __main__.py | Thread MainThread 9064 Process MainProcess 11476] Application closed.
Binary file modified modules/__pycache__/conversions.cpython-39.pyc
Binary file not shown.
Binary file modified modules/__pycache__/stillworking.cpython-39.pyc
Binary file not shown.
4 changes: 0 additions & 4 deletions modules/attributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ class Images(object):
i = '<a href="https://icon-library.com/icon/i-icon-29.html">I Icon #285925</a> from <a href="https://icon-library.com/">icon-library.com </a>'
home = '<a href="https://www.rawshorts.com/freeicons/?download=home-icon-8"> Home Icon </a> made by <a href="https://www.rawshorts.com/freeicons/?page_id=243&vendor=rawshorts"> Rawshorts </a>'
open_file = 'Icon made by <a href="https://www.freepik.com" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>'
dark_mode = 'Icon made by <a href="https://www.freepik.com" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>'
light_mode = '<div>Icon made from <a href="http://www.onlinewebfonts.com/icon">Icon Fonts</a> is licensed by CC BY 3.0</div>'

all = {
"icons/save.png": save,
"icons/i.png": i,
"icons/open file.png": open_file,
"icons/dark mode.png": dark_mode,
"icons/light mode.png": light_mode
}
Binary file added modules/dialogs/__pycache__/about.cpython-39.pyc
Binary file not shown.
Binary file not shown.
Binary file modified modules/dialogs/__pycache__/find.cpython-39.pyc
Binary file not shown.
Binary file modified modules/dialogs/__pycache__/replace.cpython-39.pyc
Binary file not shown.
Binary file modified modules/dialogs/__pycache__/web.cpython-39.pyc
Binary file not shown.
17 changes: 17 additions & 0 deletions modules/dialogs/about.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import requests
import base64
import markdown as md

from PyQt5.QtWidgets import QDialog, QVBoxLayout, QPushButton
from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtCore import QUrl, Qt
from PyQt5.QtGui import QFont

class AboutDialog(QDialog):
def __init__(self, parent=None):
super(AboutDialog, self).__init__(parent)

self.setWindowTitle("About")
self.setWindowFlag(Qt.WindowContextHelpButtonHint, False)
self.setWindowFlag(Qt.WindowMaximizeButtonHint, True)
self.resize(600, 600)
44 changes: 44 additions & 0 deletions modules/dialogs/credits.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import os

from modules.dialogs.submodules.customwebenginepage import CustomWebEnginePage

from PyQt5.QtWidgets import QDialog, QVBoxLayout, QPushButton
from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtCore import QUrl, Qt
from PyQt5.QtGui import QFont


class CreditsDialog(QDialog):
def __init__(self, parent=None):
super(CreditsDialog, self).__init__(parent)

self.setWindowTitle("Credits")
self.setWindowFlag(Qt.WindowContextHelpButtonHint, False)
self.setWindowFlag(Qt.WindowMaximizeButtonHint, True)
self.resize(800, 625)

Layout = QVBoxLayout(self)

self.central = QWebEngineView(self)
self.central.setPage(CustomWebEnginePage(self))
self.central.setUrl(
QUrl.fromLocalFile(
os.path.abspath(
os.path.join(
os.path.split(
os.path.split(
__file__
)[0]
)[0], "html/credits.html"
)
)
)
)

Layout.addWidget(self.central)

button = QPushButton(self.tr("OK"), self)
button.setFont(QFont("Segoe UI"))
button.clicked.connect(self.accept)
Layout.addWidget(button)

1 change: 1 addition & 0 deletions modules/dialogs/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def __init__(self, parent=None):
super(FindDialog, self).__init__(parent)

self.setWindowTitle("Find")
self.setWindowFlag(Qt.WindowContextHelpButtonHint, False)

layout = QVBoxLayout(self)

Expand Down
4 changes: 3 additions & 1 deletion modules/dialogs/replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ class ReplaceDialog(QDialog):
def __init__(self, inputWidget: QWidget, parent=None) -> None:
super(ReplaceDialog, self).__init__(parent)

self.resize(400, 150)
self.setWindowTitle(self.tr("Replace"))
self.setWindowFlag(Qt.WindowContextHelpButtonHint, False)
self.resize(400, 150)


self.gridLayout = QGridLayout(self)

Expand Down
Binary file not shown.
29 changes: 29 additions & 0 deletions modules/dialogs/submodules/customwebenginepage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""
from https://www.pythonguis.com/faq/qwebengineview-open-links-new-window/
"""

from PyQt5.QtWebEngineWidgets import QWebEnginePage, QWebEngineView
from PyQt5.QtWidgets import QMainWindow

class CustomWebEnginePage(QWebEnginePage):
"""
Custom WebEnginePage to customize how we handle link navigation
"""
# Store external windows.
external_windows = []

def acceptNavigationRequest(self, url, _type, isMainFrame):
if _type == QWebEnginePage.NavigationTypeLinkClicked:

window = QMainWindow(self.parent())
w = QWebEngineView(window)
w.setUrl(url)
window.setCentralWidget(w)
window.show()


# Keep reference to external window, so it isn't garbage collected.
self.external_windows.append(window)
return False

return super().acceptNavigationRequest(url, _type, isMainFrame)
1 change: 1 addition & 0 deletions modules/dialogs/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def __init__(self, inputWidget: QWidget, parent=None):
super(WebDialog, self).__init__(parent)

self.setWindowTitle("Enter Website URL")
self.setWindowFlag(Qt.WindowContextHelpButtonHint, False)
self.resize(500, 100)
self.setMinimumSize(225, 100)
self.setMaximumSize(500, 100)
Expand Down
64 changes: 64 additions & 0 deletions modules/html/credits.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE html>

<html>

<head>
<title>Page Title</title>
<link href="style.css" rel="stylesheet">
</head>

<body>
<h2 style="text-align: center">Credits and Attributions</h2>
<hr>

<br>
<h3>Images</h3>

<ul>

<li>
<div>
<img src="https://icon-library.com/images/i-icon/i-icon-29.jpg" width="50">
<a href="https://icon-library.com/icon/i-icon-29.html">I Icon #285925</a> from <a href="https://icon-library.com/">icon-library.com</a>
</div>
</li>

<li>
<div>
<img src="https://www.rawshorts.com/freeicons/wp-content/uploads/2017/01/black_repicthousebase_1484336385-1.png" width="50">
<a href="https://www.rawshorts.com/freeicons/?download=home-icon-8">Home Icon</a> made by <a href="https://www.rawshorts.com/freeicons/?page_id=243&vendor=rawshorts">Rawshorts</a>
</div>
</li>

<li>
<div>
<img src="https://www.iconsdb.com/icons/preview/black/save-xxl.png" width="50">
<a href="https://www.iconsdb.com/black-icons/save-icon.html">Black save icon</a> from <a href="https://icons8.com/">Icons8.com</a>
</div>
</li>

<li>
<div>
<img src="https://image.flaticon.com/icons/png/512/62/62319.png" width="50">
Open file button icon made by <a href="https://www.freepik.com" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>
</div>
</li>

</ul>
<br>

<h3>Style Sheets</h3>

<ul>
<li>
<div>
<a href="https://github.com/sommerc/pyqt-stylesheets/blob/master/pyqtcss/src/dark_orange/style.qss">dark_orange/style.qss</a> from the <a href="https://github.com/sommerc/pyqt-stylesheets">pyqt-stylesheets github repo</a> by <a href="https://github.com/sommerc">sommerc</a>
<p>(used as <code>main.qss</code> in this application)</p>
<!--the code thing doesn't show up and idk why >:(-->
</div>
</li>

</ul>
</body>

</html>
16 changes: 16 additions & 0 deletions modules/html/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
* {
font-family: "Segoe UI";
color: lightgrey;
}

hr {
color: silver;
}

body {
background-color: #323232;
}

a {
color: rgb(159, 98, 222); /*0 98 255*/
}
6 changes: 4 additions & 2 deletions modules/stillworking.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PyQt5.QtWidgets import QMessageBox, QWidget

def stillworking(title: str = "Sorry", text: str = "I'm still working on this :/", parent: QWidget = None) -> None:
def stillworking(title: str = "Sorry", text: str = "I'm still working on this", parent: QWidget = None) -> None:
"""
Display a "Still working" message.
Expand All @@ -11,4 +11,6 @@ def stillworking(title: str = "Sorry", text: str = "I'm still working on this :/
:return: None
"""

QMessageBox.information(parent, title, text, QMessageBox.Ok, QMessageBox.Ok)
QMessageBox.information(parent, title, text, QMessageBox.Ok, QMessageBox.Ok)

# In a module because other modules need to use it
8 changes: 5 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
PyQt5~=5.15.4
colorlog~=5.0.1
requests~=2.25.1
PyQt5==5.15.4
colorlog>=5.0.1
requests>=2.25.1
clipboard>=0.0.4
Markdown>=3.3.4
26 changes: 25 additions & 1 deletion stylesheets/main.qss
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
Copyright (c) 2015, Christoph Sommer
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
I am not Christoph Sommer.
*/

QToolTip {
border: 1px solid black;
background-color: #ffa02f;
Expand Down Expand Up @@ -124,7 +148,7 @@ QComboBox QAbstractItemView {
}

QComboBox::down-arrow {
image: url("icons/down arrow icon.png");
image: url("icons/down arrow.png");
border-radius: 6px;
width: 10px;
height: 15px;
Expand Down

0 comments on commit 1b0a01b

Please sign in to comment.