diff --git a/resources/mainwindow.ui b/resources/mainwindow.ui new file mode 100644 index 0000000..ade3771 --- /dev/null +++ b/resources/mainwindow.ui @@ -0,0 +1,381 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + Ukatali + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + 0 + 0 + 800 + 28 + + + + + &File + + + + + + + + + + + + + + &Edit + + + + + + + + + + + &Settings + + + + + + &Help + + + + + + + + + + + + Preview + + + 2 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + about:blank + + + + + + + + + + toolBar + + + TopToolBarArea + + + false + + + + + + + + + + + + + + + + + + + + + + + &New + + + Create a new ChordPro file + + + Ctrl+N + + + + + + + + &Open... + + + Open an existing ChordPro file + + + Ctrl+O + + + + + + + + &Save + + + Save the current ChordPro file + + + Ctrl+S + + + + + + + + Save &As... + + + Save the current file under a new name + + + Ctrl+Shift+S + + + + + + + + &Print + + + Print the current ChordPro file + + + Ctrl+P + + + + + + + + &Export... + + + Export the current file as a different format + + + Ctrl+E + + + + + + + + &Undo + + + Undo the last edit + + + Ctrl+Z + + + + + + + + &Redo + + + Redo the last undone action + + + Ctrl+Shift+Z + + + + + + + + Cu&t + + + Cut the currently selected text + + + Ctrl+X + + + + + + + + &Copy + + + Copy the currently selected text to the clipboard + + + Ctrl+C + + + + + + + + &Paste + + + Paste the current clipboard text into the editor + + + Ctrl+V + + + + + + + + &Configure... + + + Configure Ukatali + + + + + + + + &About + + + About Ukatali + + + + + + + + E&xit + + + Quit Ukatali + + + Alt+F4 + + + + + + QsciScintilla + QFrame +
Qsci/qsciscintilla.h
+
+ + QWebEngineView + QWidget +
QtWebEngineWidgets/QWebEngineView
+
+
+ + + + exitAction + triggered() + MainWindow + close() + + + -1 + -1 + + + 399 + 299 + + + + +
diff --git a/src/ukatali/app.py b/src/ukatali/app.py new file mode 100644 index 0000000..af34e6a --- /dev/null +++ b/src/ukatali/app.py @@ -0,0 +1,8 @@ +from PyQt5 import QtWidgets +from mainwindow import MainWindow + + +app = QtWidgets.QApplication([]) +window = MainWindow() +window.show() +app.exec() diff --git a/src/ukatali/mainwindow.py b/src/ukatali/mainwindow.py new file mode 100644 index 0000000..0653c07 --- /dev/null +++ b/src/ukatali/mainwindow.py @@ -0,0 +1,207 @@ +# -*- coding: utf-8 -*- +from PyQt5 import QtCore, QtGui, QtWidgets, QtWebEngineWidgets, Qsci + + +class MainWindow(QtWidgets.QMainWindow): + def __init__(self, parent=None): + super().__init__(parent) + self.setup_ui() + + def setup_ui(self): + self.setObjectName("MainWindow") + self.resize(800, 600) + self.editorWidget = QtWidgets.QWidget(self) + self.editorWidget.setObjectName("editorWidget") + self.editorLayout = QtWidgets.QVBoxLayout(self.editorWidget) + self.editorLayout.setContentsMargins(0, 0, 0, 0) + self.editorLayout.setSpacing(0) + self.editorLayout.setObjectName("editorLayout") + self.fileEditor = Qsci.QsciScintilla(self.editorWidget) + self.fileEditor.setColor(QtWidgets.QApplication.palette().windowText().color()) + self.fileEditor.setFont(QtGui.QFont("monospace")) + self.fileEditor.setObjectName("fileEditor") + self.editorLayout.addWidget(self.fileEditor) + self.setCentralWidget(self.editorWidget) + self.menubar = QtWidgets.QMenuBar(self) + self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 28)) + self.menubar.setObjectName("menubar") + self.fileMenu = QtWidgets.QMenu(self.menubar) + self.fileMenu.setObjectName("fileMenu") + self.editMenu = QtWidgets.QMenu(self.menubar) + self.editMenu.setObjectName("editMenu") + self.settingsMenu = QtWidgets.QMenu(self.menubar) + self.settingsMenu.setObjectName("settingsMenu") + self.helpMenu = QtWidgets.QMenu(self.menubar) + self.helpMenu.setObjectName("helpMenu") + self.setMenuBar(self.menubar) + self.statusbar = QtWidgets.QStatusBar(self) + self.statusbar.setObjectName("statusbar") + self.setStatusBar(self.statusbar) + self.previewDock = QtWidgets.QDockWidget(self) + self.previewDock.setObjectName("previewDock") + self.previewDockContents = QtWidgets.QWidget() + self.previewDockContents.setObjectName("previewDockContents") + self.previewLayout = QtWidgets.QVBoxLayout(self.previewDockContents) + self.previewLayout.setContentsMargins(0, 0, 0, 0) + self.previewLayout.setSpacing(0) + self.previewLayout.setObjectName("previewLayout") + self.previewView = QtWebEngineWidgets.QWebEngineView(self.previewDockContents) + self.previewView.setUrl(QtCore.QUrl("about:blank")) + self.previewView.setObjectName("previewView") + self.previewLayout.addWidget(self.previewView) + self.previewDock.setWidget(self.previewDockContents) + self.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.previewDock) + self.toolBar = QtWidgets.QToolBar(self) + self.toolBar.setObjectName("toolBar") + self.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) + self.newAction = QtWidgets.QAction(self) + icon = QtGui.QIcon.fromTheme("document-new") + self.newAction.setIcon(icon) + self.newAction.setObjectName("newAction") + self.openAction = QtWidgets.QAction(self) + icon = QtGui.QIcon.fromTheme("document-open") + self.openAction.setIcon(icon) + self.openAction.setObjectName("openAction") + self.saveAction = QtWidgets.QAction(self) + icon = QtGui.QIcon.fromTheme("document-save") + self.saveAction.setIcon(icon) + self.saveAction.setObjectName("saveAction") + self.saveAsAction = QtWidgets.QAction(self) + icon = QtGui.QIcon.fromTheme("document-save-as") + self.saveAsAction.setIcon(icon) + self.saveAsAction.setObjectName("saveAsAction") + self.printAction = QtWidgets.QAction(self) + icon = QtGui.QIcon.fromTheme("document-print") + self.printAction.setIcon(icon) + self.printAction.setObjectName("printAction") + self.exportAction = QtWidgets.QAction(self) + icon = QtGui.QIcon.fromTheme("document-export") + self.exportAction.setIcon(icon) + self.exportAction.setObjectName("exportAction") + self.undoAction = QtWidgets.QAction(self) + icon = QtGui.QIcon.fromTheme("edit-undo") + self.undoAction.setIcon(icon) + self.undoAction.setObjectName("undoAction") + self.redoAction = QtWidgets.QAction(self) + icon = QtGui.QIcon.fromTheme("edit-redo") + self.redoAction.setIcon(icon) + self.redoAction.setObjectName("redoAction") + self.cutAction = QtWidgets.QAction(self) + icon = QtGui.QIcon.fromTheme("edit-cut") + self.cutAction.setIcon(icon) + self.cutAction.setObjectName("cutAction") + self.copyAction = QtWidgets.QAction(self) + icon = QtGui.QIcon.fromTheme("edit-copy") + self.copyAction.setIcon(icon) + self.copyAction.setObjectName("copyAction") + self.pasteAction = QtWidgets.QAction(self) + icon = QtGui.QIcon.fromTheme("edit-paste") + self.pasteAction.setIcon(icon) + self.pasteAction.setObjectName("pasteAction") + self.configureAction = QtWidgets.QAction(self) + icon = QtGui.QIcon.fromTheme("configure") + self.configureAction.setIcon(icon) + self.configureAction.setObjectName("configureAction") + self.aboutAction = QtWidgets.QAction(self) + icon = QtGui.QIcon.fromTheme("help-about") + self.aboutAction.setIcon(icon) + self.aboutAction.setObjectName("aboutAction") + self.exitAction = QtWidgets.QAction(self) + icon = QtGui.QIcon.fromTheme("application-exit") + self.exitAction.setIcon(icon) + self.exitAction.setObjectName("exitAction") + self.fileMenu.addAction(self.newAction) + self.fileMenu.addAction(self.openAction) + self.fileMenu.addAction(self.saveAction) + self.fileMenu.addAction(self.saveAsAction) + self.fileMenu.addSeparator() + self.fileMenu.addAction(self.exportAction) + self.fileMenu.addAction(self.printAction) + self.fileMenu.addSeparator() + self.fileMenu.addAction(self.exitAction) + self.editMenu.addAction(self.undoAction) + self.editMenu.addAction(self.redoAction) + self.editMenu.addSeparator() + self.editMenu.addAction(self.cutAction) + self.editMenu.addAction(self.copyAction) + self.editMenu.addAction(self.pasteAction) + self.settingsMenu.addAction(self.configureAction) + self.helpMenu.addAction(self.aboutAction) + self.menubar.addAction(self.fileMenu.menuAction()) + self.menubar.addAction(self.editMenu.menuAction()) + self.menubar.addAction(self.settingsMenu.menuAction()) + self.menubar.addAction(self.helpMenu.menuAction()) + self.toolBar.addAction(self.newAction) + self.toolBar.addAction(self.openAction) + self.toolBar.addAction(self.saveAction) + self.toolBar.addSeparator() + self.toolBar.addAction(self.exportAction) + self.toolBar.addAction(self.printAction) + self.toolBar.addSeparator() + self.toolBar.addAction(self.undoAction) + self.toolBar.addAction(self.redoAction) + self.toolBar.addSeparator() + self.toolBar.addAction(self.cutAction) + self.toolBar.addAction(self.copyAction) + self.toolBar.addAction(self.pasteAction) + self.toolBar.addSeparator() + self.toolBar.addAction(self.configureAction) + + self.retranslate_ui() + self.exitAction.triggered.connect(self.close) + self.undoAction.triggered.connect(self.fileEditor.undo) + self.redoAction.triggered.connect(self.fileEditor.redo) + self.cutAction.triggered.connect(self.fileEditor.cut) + self.copyAction.triggered.connect(self.fileEditor.copy) + self.pasteAction.triggered.connect(self.fileEditor.paste) + QtCore.QMetaObject.connectSlotsByName(self) + + def retranslate_ui(self): + _translate = QtCore.QCoreApplication.translate + self.setWindowTitle(_translate("MainWindow", "Ukatali")) + self.fileMenu.setTitle(_translate("MainWindow", "&File")) + self.editMenu.setTitle(_translate("MainWindow", "&Edit")) + self.settingsMenu.setTitle(_translate("MainWindow", "&Settings")) + self.helpMenu.setTitle(_translate("MainWindow", "&Help")) + self.previewDock.setWindowTitle(_translate("MainWindow", "Preview")) + self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar")) + self.newAction.setText(_translate("MainWindow", "&New")) + self.newAction.setToolTip(_translate("MainWindow", "Create a new ChordPro file")) + self.newAction.setShortcut(_translate("MainWindow", "Ctrl+N")) + self.openAction.setText(_translate("MainWindow", "&Open...")) + self.openAction.setToolTip(_translate("MainWindow", "Open an existing ChordPro file")) + self.openAction.setShortcut(_translate("MainWindow", "Ctrl+O")) + self.saveAction.setText(_translate("MainWindow", "&Save")) + self.saveAction.setToolTip(_translate("MainWindow", "Save the current ChordPro file")) + self.saveAction.setShortcut(_translate("MainWindow", "Ctrl+S")) + self.saveAsAction.setText(_translate("MainWindow", "Save &As...")) + self.saveAsAction.setToolTip(_translate("MainWindow", "Save the current file under a new name")) + self.saveAsAction.setShortcut(_translate("MainWindow", "Ctrl+Shift+S")) + self.printAction.setText(_translate("MainWindow", "&Print")) + self.printAction.setToolTip(_translate("MainWindow", "Print the current ChordPro file")) + self.printAction.setShortcut(_translate("MainWindow", "Ctrl+P")) + self.exportAction.setText(_translate("MainWindow", "&Export...")) + self.exportAction.setToolTip(_translate("MainWindow", "Export the current file as a different format")) + self.exportAction.setShortcut(_translate("MainWindow", "Ctrl+E")) + self.undoAction.setText(_translate("MainWindow", "&Undo")) + self.undoAction.setToolTip(_translate("MainWindow", "Undo the last edit")) + self.undoAction.setShortcut(_translate("MainWindow", "Ctrl+Z")) + self.redoAction.setText(_translate("MainWindow", "&Redo")) + self.redoAction.setToolTip(_translate("MainWindow", "Redo the last undone action")) + self.redoAction.setShortcut(_translate("MainWindow", "Ctrl+Shift+Z")) + self.cutAction.setText(_translate("MainWindow", "Cu&t")) + self.cutAction.setToolTip(_translate("MainWindow", "Cut the currently selected text")) + self.cutAction.setShortcut(_translate("MainWindow", "Ctrl+X")) + self.copyAction.setText(_translate("MainWindow", "&Copy")) + self.copyAction.setToolTip(_translate("MainWindow", "Copy the currently selected text to the clipboard")) + self.copyAction.setShortcut(_translate("MainWindow", "Ctrl+C")) + self.pasteAction.setText(_translate("MainWindow", "&Paste")) + self.pasteAction.setToolTip(_translate("MainWindow", "Paste the current clipboard text into the editor")) + self.pasteAction.setShortcut(_translate("MainWindow", "Ctrl+V")) + self.configureAction.setText(_translate("MainWindow", "&Configure...")) + self.configureAction.setToolTip(_translate("MainWindow", "Configure Ukatali")) + self.aboutAction.setText(_translate("MainWindow", "&About")) + self.aboutAction.setToolTip(_translate("MainWindow", "About Ukatali")) + self.exitAction.setText(_translate("MainWindow", "E&xit")) + self.exitAction.setToolTip(_translate("MainWindow", "Quit Ukatali")) + self.exitAction.setShortcut(_translate("MainWindow", "Alt+F4"))