-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Makefile and possibility to delete a deck
The Makefile is compatible with Linux, macOS and Windows To delete a deck there is now an option in the file menu Also added a way to quit from the file menu
- Loading branch information
MarcoBenelli
committed
Dec 9, 2021
1 parent
bc0a962
commit 8398333
Showing
8 changed files
with
148 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
**/__pycache__ | ||
src/img/fugue-icons-3.5.6 | ||
build | ||
dist | ||
*.spec | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
ifeq ($(OS),Windows_NT) | ||
pathsep = ; | ||
options = --onefile --windowed | ||
else | ||
pathsep = : | ||
UNAME := $(shell uname) | ||
ifeq ($(UNAME),Darwin) | ||
options = --windowed --name 'Study and Repeat' | ||
else | ||
options = --onefile | ||
endif | ||
endif | ||
|
||
dist/study_and_repeat : src/**/*.py | ||
pyinstaller $(options) --icon src/img/favicon.ico \ | ||
--add-data 'src/img/fugue-icons-3.5.6/icons-shadowless/*.png$(pathsep)src/img/fugue-icons-3.5.6/icons-shadowless' \ | ||
--add-data 'src/img/favicon.ico$(pathsep)src/img' \ | ||
src/study_and_repeat.py | ||
|
||
.PHONY : clean | ||
clean : | ||
ifeq ($(OS),Windows_NT) | ||
-rmdir /s /q build dist | ||
-erase .\*.spec | ||
else | ||
rm --recursive --force build dist ./*.spec | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,38 @@ | ||
|
||
|
||
from PyQt5 import QtWidgets | ||
from PyQt5 import QtWidgets, QtGui | ||
|
||
from view import home_widget | ||
from model import deck | ||
import config | ||
|
||
|
||
class SecondaryWidget(QtWidgets.QWidget): | ||
|
||
def __init__(self, *args, **kwargs) -> None: | ||
def __init__(self, d: deck.Deck, *args, **kwargs) -> None: | ||
super().__init__(*args, **kwargs) | ||
self._deck = d | ||
self.window().setWindowTitle(f'Study and Repeat - {self._deck.name}') | ||
|
||
self._layout = QtWidgets.QVBoxLayout() | ||
self.setLayout(self._layout) | ||
back_btn = QtWidgets.QPushButton(QtGui.QIcon( | ||
f'{config.ICONS_DIR}home.png'), '') | ||
f'{config.ICONS_DIR}home.png'), '') | ||
back_btn.setFixedWidth(32) | ||
self._layout.addWidget(back_btn) | ||
back_btn.released.connect(self.back_home) | ||
self._central_widget = QtWidgets.QWidget() | ||
self._layout.addWidget(self._central_widget) | ||
self.window().setCentralWidget(self) | ||
self.window().setCentralWidget(self) | ||
self.window().action_new_deck.setVisible(False) | ||
|
||
def back_home(self) -> None: | ||
self.window().action_new_deck.setVisible(True) | ||
self.window().setCentralWidget(home_widget.HomeWidget()) | ||
self.window().setWindowTitle('Study and Repeat') | ||
self.exit() | ||
|
||
def delete_deck(self) -> None: | ||
self._deck.delete() | ||
self.window().action_new_deck.setVisible(True) | ||
self.window().setCentralWidget(home_widget.HomeWidget()) | ||
self.window().setWindowTitle('Study and Repeat') | ||
self.exit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters