diff --git a/newscrambles1.txt b/FirstLayerScrambles/newscrambles1.txt similarity index 100% rename from newscrambles1.txt rename to FirstLayerScrambles/newscrambles1.txt diff --git a/newscrambles2.txt b/FirstLayerScrambles/newscrambles2.txt similarity index 100% rename from newscrambles2.txt rename to FirstLayerScrambles/newscrambles2.txt diff --git a/newscrambles3.txt b/FirstLayerScrambles/newscrambles3.txt similarity index 100% rename from newscrambles3.txt rename to FirstLayerScrambles/newscrambles3.txt diff --git a/newscrambles4.txt b/FirstLayerScrambles/newscrambles4.txt similarity index 100% rename from newscrambles4.txt rename to FirstLayerScrambles/newscrambles4.txt diff --git a/newscrambles5.txt b/FirstLayerScrambles/newscrambles5.txt similarity index 100% rename from newscrambles5.txt rename to FirstLayerScrambles/newscrambles5.txt diff --git a/newscrambles6.txt b/FirstLayerScrambles/newscrambles6.txt similarity index 100% rename from newscrambles6.txt rename to FirstLayerScrambles/newscrambles6.txt diff --git a/newscrambles7.txt b/FirstLayerScrambles/newscrambles7.txt similarity index 100% rename from newscrambles7.txt rename to FirstLayerScrambles/newscrambles7.txt diff --git a/favicon.ico b/Icons/favicon.ico similarity index 100% rename from favicon.ico rename to Icons/favicon.ico diff --git a/logo.pdn b/Icons/logo.pdn similarity index 100% rename from logo.pdn rename to Icons/logo.pdn diff --git a/logo.png b/Icons/logo.png similarity index 100% rename from logo.png rename to Icons/logo.png diff --git a/logogreen.png b/Icons/logogreen.png similarity index 100% rename from logogreen.png rename to Icons/logogreen.png diff --git a/logogreenicon.png b/Icons/logogreenicon.png similarity index 100% rename from logogreenicon.png rename to Icons/logogreenicon.png diff --git a/logoicon.png b/Icons/logoicon.png similarity index 100% rename from logoicon.png rename to Icons/logoicon.png diff --git a/logored.png b/Icons/logored.png similarity index 100% rename from logored.png rename to Icons/logored.png diff --git a/logoredicon.png b/Icons/logoredicon.png similarity index 100% rename from logoredicon.png rename to Icons/logoredicon.png diff --git a/l4c.txt b/Last2LayerScrambles/l4c.txt similarity index 100% rename from l4c.txt rename to Last2LayerScrambles/l4c.txt diff --git a/l5c.txt b/Last2LayerScrambles/l5c.txt similarity index 100% rename from l5c.txt rename to Last2LayerScrambles/l5c.txt diff --git a/p3s.txt b/Last2LayerScrambles/p3s.txt similarity index 100% rename from p3s.txt rename to Last2LayerScrambles/p3s.txt diff --git a/phu.txt b/Last2LayerScrambles/phu.txt similarity index 100% rename from phu.txt rename to Last2LayerScrambles/phu.txt diff --git a/phzpure.txt b/Last2LayerScrambles/phzpure.txt similarity index 100% rename from phzpure.txt rename to Last2LayerScrambles/phzpure.txt diff --git a/pi3s.txt b/Last2LayerScrambles/pi3s.txt similarity index 100% rename from pi3s.txt rename to Last2LayerScrambles/pi3s.txt diff --git a/pihu.txt b/Last2LayerScrambles/pihu.txt similarity index 100% rename from pihu.txt rename to Last2LayerScrambles/pihu.txt diff --git a/pihz.txt b/Last2LayerScrambles/pihz.txt similarity index 100% rename from pihz.txt rename to Last2LayerScrambles/pihz.txt diff --git a/pio.txt b/Last2LayerScrambles/pio.txt similarity index 100% rename from pio.txt rename to Last2LayerScrambles/pio.txt diff --git a/piswirl.txt b/Last2LayerScrambles/piswirl.txt similarity index 100% rename from piswirl.txt rename to Last2LayerScrambles/piswirl.txt diff --git a/pivu.txt b/Last2LayerScrambles/pivu.txt similarity index 100% rename from pivu.txt rename to Last2LayerScrambles/pivu.txt diff --git a/piwat.txt b/Last2LayerScrambles/piwat.txt similarity index 100% rename from piwat.txt rename to Last2LayerScrambles/piwat.txt diff --git a/pix.txt b/Last2LayerScrambles/pix.txt similarity index 100% rename from pix.txt rename to Last2LayerScrambles/pix.txt diff --git a/pizconj.txt b/Last2LayerScrambles/pizconj.txt similarity index 100% rename from pizconj.txt rename to Last2LayerScrambles/pizconj.txt diff --git a/po.txt b/Last2LayerScrambles/po.txt similarity index 100% rename from po.txt rename to Last2LayerScrambles/po.txt diff --git a/pswirl.txt b/Last2LayerScrambles/pswirl.txt similarity index 100% rename from pswirl.txt rename to Last2LayerScrambles/pswirl.txt diff --git a/pvu.txt b/Last2LayerScrambles/pvu.txt similarity index 100% rename from pvu.txt rename to Last2LayerScrambles/pvu.txt diff --git a/pwat.txt b/Last2LayerScrambles/pwat.txt similarity index 100% rename from pwat.txt rename to Last2LayerScrambles/pwat.txt diff --git a/px.txt b/Last2LayerScrambles/px.txt similarity index 100% rename from px.txt rename to Last2LayerScrambles/px.txt diff --git a/pzconj.txt b/Last2LayerScrambles/pzconj.txt similarity index 100% rename from pzconj.txt rename to Last2LayerScrambles/pzconj.txt diff --git a/MainWindow.py b/MainWindow.py index 01e9a87..b47cb88 100644 --- a/MainWindow.py +++ b/MainWindow.py @@ -1,5 +1,6 @@ import random import sys +import os from PyQt5.QtWidgets import QLCDNumber, QAction, QApplication, QWidget,\ QMainWindow, QCheckBox, QPushButton, QLabel, QSlider, QGroupBox, QVBoxLayout, QGridLayout from PyQt5 import QtGui @@ -15,12 +16,13 @@ def __init__(self): self.width = 1000 self.height = 750 - self.setWindowIcon(QtGui.QIcon("logoicon.png")) + self.setWindowIcon(QtGui.QIcon(os.path.join(os.path.dirname(__file__), "Icons/logoicon.png"))) self.setWindowTitle(self.title) self.setGeometry(self.left, self.top, self.width, self.height) self.mainMenu = self.menuBar() + self.generalMenu = self.mainMenu.addMenu('General Functions') self.funcMenu = self.mainMenu.addMenu('Practice Mode') #fileMenu = mainMenu.addMenu('File') #editMenu = mainMenu.addMenu('Edit') @@ -29,15 +31,18 @@ def __init__(self): #toolsMenu = mainMenu.addMenu('Tools') self.helpMenu = self.mainMenu.addMenu('Help') + self.closeButton = QAction('Close Window', self) + self.closeButton.setShortcut(Qt.Key_Escape) + self.closeButton.triggered.connect(self.close) + self.generalMenu.addAction(self.closeButton) + self.fltButton = QAction('First Layer Trainer', self) self.fltButton.setShortcut('F') - self.fltButton.setStatusTip('First Layer Trainer') self.fltButton.triggered.connect(self.StartFirstLayerTrainer) self.funcMenu.addAction(self.fltButton) self.l2ltButton = QAction('Last 2 Layer Alg Trainer', self) self.l2ltButton.setShortcut('A') - self.l2ltButton.setStatusTip('Last 2 Layer Alg Trainer') self.l2ltButton.triggered.connect(self.StartAlgTrainer) self.funcMenu.addAction(self.l2ltButton) @@ -66,16 +71,18 @@ def CreateLayout(self): # button to start the first layer trainer self.firstlayerbut = QPushButton("First Layer Trainer (or press F)", self) self.firstlayerbut.setMinimumHeight(80) - self.firstlayerbut.setToolTip("Generates scrambles from 1 up to 7 moves and random " - "colours to start the first layer with, if you wish.") + self.firstlayerbut.setToolTip("Generates scrambles from 1 up to 7 moves. They either" + " appear shuffled or ordered (depending on your choice).\n" + "You will either see only white or random starting colours.\n" + "With stopwatch to time your solutions.") self.firstlayerbut.clicked.connect(self.StartFirstLayerTrainer) gridLayout.addWidget(self.firstlayerbut, 0, 0) # button to start the alg trainer - self.algbut = QPushButton("Alg Trainer (or press A)", self) + self.algbut = QPushButton("Last 2 Layer Alg Trainer (or press A)", self) self.algbut.setMinimumHeight(80) self.algbut.setToolTip("Shows you L2L-cases (scramble + drawing) to the sets you choose.\n" - "With timer function.") + "With stopwatch to time your solutions.") self.algbut.clicked.connect(self.StartAlgTrainer) gridLayout.addWidget(self.algbut, 0, 1) @@ -99,7 +106,7 @@ def CreateLayout(self): # this label shows a picture self.scrpic = QLabel(self) self.scrpic.setMinimumHeight(50) - self.scrpic.setPixmap(QtGui.QPixmap("logogreen").scaled(50, 50, Qt.KeepAspectRatio, Qt.FastTransformation)) + self.scrpic.setPixmap(QtGui.QPixmap(os.path.join(os.path.dirname(__file__), "Icons/logogreen")).scaled(50, 50, Qt.KeepAspectRatio, Qt.FastTransformation)) gridLayout.addWidget(self.scrpic, 2, 0) # this label shows some info about the creator @@ -139,7 +146,7 @@ def __init__(self, parent=None): self.width = 1000 self.height = 750 - self.setWindowIcon(QtGui.QIcon("logoicon.png")) + self.setWindowIcon(QtGui.QIcon(os.path.join(os.path.dirname(__file__), "Icons/logoicon.png"))) self.setWindowTitle(self.title) self.setGeometry(self.left, self.top, self.width, self.height) @@ -147,6 +154,7 @@ def __init__(self, parent=None): self.ReadAllScrambles() self.mainMenu = self.menuBar() + self.generalMenu = self.mainMenu.addMenu('General Functions') self.funcMenu = self.mainMenu.addMenu('Practice Mode') self.fltMenu = self.mainMenu.addMenu('FLT Functions') # editMenu = mainMenu.addMenu('Edit') @@ -155,6 +163,11 @@ def __init__(self, parent=None): # toolsMenu = mainMenu.addMenu('Tools') self.helpMenu = self.mainMenu.addMenu('Help') + self.closeButton = QAction('Close Window', self) + self.closeButton.setShortcut(Qt.Key_Escape) + self.closeButton.triggered.connect(self.close) + self.generalMenu.addAction(self.closeButton) + self.fltButton = QAction('First Layer Trainer', self) self.fltButton.setShortcut('F') self.fltButton.setStatusTip('First Layer Trainer') @@ -279,38 +292,38 @@ def ReadAllScrambles(self): # final scramblelist self.newscramble1list = [] - datei = open('newscrambles1.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "FirstLayerScrambles/newscrambles1.txt"), 'r', encoding='utf-8') for line in datei: self.newscramble1list.append(line[:-1]) self.scramblelist = self.newscramble1list.copy() self.newscramble2list = [] - datei = open('newscrambles2.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "FirstLayerScrambles/newscrambles2.txt"), 'r', encoding='utf-8') for line in datei: self.newscramble2list.append(line[:-1]) self.newscramble3list = [] - datei = open('newscrambles3.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "FirstLayerScrambles/newscrambles3.txt"), 'r', encoding='utf-8') for line in datei: self.newscramble3list.append(line[:-1]) self.newscramble4list = [] - datei = open('newscrambles4.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "FirstLayerScrambles/newscrambles4.txt"), 'r', encoding='utf-8') for line in datei: self.newscramble4list.append(line[:-1]) self.newscramble5list = [] - datei = open('newscrambles5.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "FirstLayerScrambles/newscrambles5.txt"), 'r', encoding='utf-8') for line in datei: self.newscramble5list.append(line[:-1]) self.newscramble6list = [] - datei = open('newscrambles6.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "FirstLayerScrambles/newscrambles6.txt"), 'r', encoding='utf-8') for line in datei: self.newscramble6list.append(line[:-1]) self.newscramble7list = [] - datei = open('newscrambles7.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "FirstLayerScrambles/newscrambles7.txt"), 'r', encoding='utf-8') for line in datei: self.newscramble7list.append(line[:-1]) @@ -375,7 +388,7 @@ def CreateLayout(self): self.scrpic = QLabel(self) self.scrpic.setMinimumHeight(50) - self.scrpic.setPixmap(QtGui.QPixmap("logogreen").scaled(50, 50, Qt.KeepAspectRatio, Qt.FastTransformation)) + self.scrpic.setPixmap(QtGui.QPixmap(os.path.join(os.path.dirname(__file__), "Icons/logogreen")).scaled(50, 50, Qt.KeepAspectRatio, Qt.FastTransformation)) self.gridLayout.addWidget(self.scrpic, 4, 0) self.start = QPushButton("Start (SPACE)", self) @@ -618,7 +631,7 @@ def __init__(self, parent=None): self.width = 1600 self.height = 800 - self.setWindowIcon(QtGui.QIcon("logoicon.png")) + self.setWindowIcon(QtGui.QIcon(os.path.join(os.path.dirname(__file__), "Icons/logoicon.png"))) self.setWindowTitle(self.title) self.setGeometry(self.left, self.top, self.width, self.height) @@ -627,10 +640,16 @@ def __init__(self, parent=None): self.ReadAllScrambles() self.mainMenu = self.menuBar() + self.generalMenu = self.mainMenu.addMenu('General Functions') self.funcMenu = self.mainMenu.addMenu('Practice Mode') self.l2lMenu = self.mainMenu.addMenu('Alg Trainer Functions') self.helpMenu = self.mainMenu.addMenu('Help') + self.closeButton = QAction('Close Window', self) + self.closeButton.setShortcut(Qt.Key_Escape) + self.closeButton.triggered.connect(self.close) + self.generalMenu.addAction(self.closeButton) + self.fltButton = QAction('First Layer Trainer', self) self.fltButton.setShortcut('F') self.fltButton.triggered.connect(self.StartFirstLayerTrainer) @@ -811,102 +830,102 @@ def whattodowithspace(self): def ReadAllScrambles(self): self.scrpiswirl = [] - datei = open('piswirl.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/piswirl.txt"), 'r', encoding='utf-8') for line in datei: self.scrpiswirl.append(line[:-1]) self.scrpiwat = [] - datei = open('piwat.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/piwat.txt"), 'r', encoding='utf-8') for line in datei: self.scrpiwat.append(line[:-1]) self.scrpix = [] - datei = open('pix.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/pix.txt"), 'r', encoding='utf-8') for line in datei: self.scrpix.append(line[:-1]) self.scrpihu = [] - datei = open('pihu.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/pihu.txt"), 'r', encoding='utf-8') for line in datei: self.scrpihu.append(line[:-1]) self.scrpivu = [] - datei = open('pivu.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/pivu.txt"), 'r', encoding='utf-8') for line in datei: self.scrpivu.append(line[:-1]) self.scrpio = [] - datei = open('pio.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/pio.txt"), 'r', encoding='utf-8') for line in datei: self.scrpio.append(line[:-1]) self.scrpizconj = [] - datei = open('pizconj.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/pizconj.txt"), 'r', encoding='utf-8') for line in datei: self.scrpizconj.append(line[:-1]) self.scrpi3s = [] - datei = open('pi3s.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/pi3s.txt"), 'r', encoding='utf-8') for line in datei: self.scrpi3s.append(line[:-1]) self.scrpihz = [] - datei = open('pihz.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/pihz.txt"), 'r', encoding='utf-8') for line in datei: self.scrpihz.append(line[:-1]) self.scrpswirl = [] - datei = open('pswirl.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/pswirl.txt"), 'r', encoding='utf-8') for line in datei: self.scrpswirl.append(line[:-1]) self.scrpwat = [] - datei = open('pwat.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/pwat.txt"), 'r', encoding='utf-8') for line in datei: self.scrpwat.append(line[:-1]) self.scrpx = [] - datei = open('px.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/px.txt"), 'r', encoding='utf-8') for line in datei: self.scrpx.append(line[:-1]) self.scrphu = [] - datei = open('phu.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/phu.txt"), 'r', encoding='utf-8') for line in datei: self.scrphu.append(line[:-1]) self.scrpvu = [] - datei = open('pvu.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/pvu.txt"), 'r', encoding='utf-8') for line in datei: self.scrpvu.append(line[:-1]) self.scrpo = [] - datei = open('po.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/po.txt"), 'r', encoding='utf-8') for line in datei: self.scrpo.append(line[:-1]) self.scrpzconj = [] - datei = open('pzconj.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/pzconj.txt"), 'r', encoding='utf-8') for line in datei: self.scrpzconj.append(line[:-1]) self.scrp3s = [] - datei = open('p3s.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/p3s.txt"), 'r', encoding='utf-8') for line in datei: self.scrp3s.append(line[:-1]) self.scrphzpure = [] - datei = open('phzpure.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/phzpure.txt"), 'r', encoding='utf-8') for line in datei: self.scrphzpure.append(line[:-1]) self.scrl4c = [] - datei = open('l4c.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/l4c.txt"), 'r', encoding='utf-8') for line in datei: self.scrl4c.append(line[:-1]) self.scrl5c = [] - datei = open('l5c.txt', 'r', encoding='utf-8') + datei = open(os.path.join(os.path.dirname(__file__), "Last2LayerScrambles/l5c.txt"), 'r', encoding='utf-8') for line in datei: self.scrl5c.append(line[:-1]) @@ -1080,7 +1099,7 @@ def CreateLayout(self): self.scrpic = QLabel(self) self.scrpic.setMinimumHeight(50) - self.scrpic.setPixmap(QtGui.QPixmap("logogreen").scaled(50, 50, Qt.KeepAspectRatio, Qt.FastTransformation)) + self.scrpic.setPixmap(QtGui.QPixmap(os.path.join(os.path.dirname(__file__), "Icons/logogreen")).scaled(50, 50, Qt.KeepAspectRatio, Qt.FastTransformation)) self.gridLayout.addWidget(self.scrpic, 11, 0) # this label shows some info about the creator @@ -1436,11 +1455,19 @@ def __init__(self): self.width = 1000 self.height = 800 - self.setWindowIcon(QtGui.QIcon("logoicon.png")) + self.setWindowIcon(QtGui.QIcon(os.path.join(os.path.dirname(__file__), "Icons/logoicon.png"))) self.setWindowTitle(self.title) self.setGeometry(self.left, self.top, self.width, self.height) + self.mainMenu = self.menuBar() + self.generalMenu = self.mainMenu.addMenu('General Functions') + + self.helpbut = QAction('Close Help Window', self) + self.helpbut.setShortcut(Qt.Key_Escape) + self.helpbut.triggered.connect(self.close) + self.generalMenu.addAction(self.helpbut) + self.central2 = QWidget() self.CreateLayout() self.setCentralWidget(self.central2) diff --git a/README.md b/README.md index 5213afe..a9f5333 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ by Annika Stein (also known as HugaCuba on social media such as ![SkewbSkills Logo](logogreen.png) # What's new? +Release of 1.2: ++ Create subfolders that contain the scrambles and icons Release of v1.1: + Better way to generate the first layer trainer scrambles, less code, less disk space - faster in general. @@ -80,7 +82,7 @@ Besides that, there is always the option to download the sources and run If I'm informed correctly, it should already be possible for linux users to run python files, only the package 'PyQt5' has to be installed besides the -standard libraries (in our case: 'random' and 'sys'). +standard libraries (in our case: 'random', 'sys' and 'os'). # Usage After opening SkewbSkills, type 'H' or choose Help from the menubar to get diff --git a/SkewbSkills.spec b/SkewbSkills.spec index 34094bb..3a362a9 100644 --- a/SkewbSkills.spec +++ b/SkewbSkills.spec @@ -30,4 +30,4 @@ exe = EXE(pyz, upx=True, upx_exclude=[], runtime_tmpdir=None, - console=False , icon='favicon.ico') + console=False , icon='Icons\\favicon.ico') diff --git a/SkewbSkillsFilesv1.2.zip b/SkewbSkillsFilesv1.2.zip new file mode 100644 index 0000000..e5f936a Binary files /dev/null and b/SkewbSkillsFilesv1.2.zip differ diff --git a/doc.txt b/doc.txt index b4ec662..c41fa29 100644 --- a/doc.txt +++ b/doc.txt @@ -272,4 +272,11 @@ Help button / window Shortcuts added for both modes Scrambles are generated way faster, using less disk space - Used "pyinstaller -w -F -n SkewbSkills -i favicon.ico MainWindow.py" to generate executable \ No newline at end of file + Used "pyinstaller -w -F -n SkewbSkills -i favicon.ico MainWindow.py" to generate executable + +28.08.2019: + added 'General Functions' menu with shortcut to close the window + create subfolders where the .txt files are located and work with those + instead of having all files in only one folder (requested by Elias) + create new exe and release new zip-folder, marked as v1. with + "pyinstaller -w -F -n SkewbSkills -i Icons/favicon.ico MainWindow.py" \ No newline at end of file