Browse Source

MDI pretty much working

master
Ivan Holmes 4 years ago
parent
commit
fcf1e72c96
  1. 2
      _version.py
  2. 7
      chordsheet/common.py
  3. 67
      chordsheet/dialogs.py
  4. 118
      chordsheet/messageBox.py
  5. 54
      chordsheet/panels.py
  6. 42
      chordsheet/pdfViewer.py
  7. 1128
      gui.py
  8. BIN
      preview.pdf
  9. 225
      ui/blocks.ui
  10. 190
      ui/chords.ui
  11. 144
      ui/docinfo.ui
  12. 57
      ui/document.ui
  13. 172
      ui/new.ui
  14. 32
      ui/pdfarea.ui
  15. 52
      ui/preview.ui
  16. 273
      ui/psetup.ui
  17. 127
      ui/sections.ui
  18. 8
      version.rc

2
_version.py

@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
appName = "Chordsheet"
version = '0.4.6'
version = '0.5.0'

7
chordsheet/common.py

@ -0,0 +1,7 @@
import sys, os
# set the directory where our files are depending on whether we're running a pyinstaller binary or not
if getattr(sys, 'frozen', False):
scriptDir = sys._MEIPASS
else:
scriptDir = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir))

67
chordsheet/dialogs.py

@ -0,0 +1,67 @@
import os
from PyQt5.QtWidgets import QApplication, QAction, QLabel, QDialogButtonBox, QDialog, QFileDialog, QMessageBox, QPushButton, QLineEdit, QCheckBox, QSpinBox, QDoubleSpinBox, QTableWidgetItem, QTabWidget, QComboBox, QWidget, QScrollArea, QMainWindow, QShortcut
from PyQt5.QtCore import QFile, QObject, Qt
from PyQt5.QtGui import QImage, QPixmap
from PyQt5 import uic
from chordsheet.common import scriptDir
import _version
class GuitarDialog(QDialog):
"""
Dialogue to allow the user to enter a guitar chord voicing. Not particularly advanced at present!
May be extended in future.
"""
def __init__(self):
super().__init__()
self.UIFileLoader(
str(os.path.join(scriptDir, 'ui', 'guitardialog.ui')))
def UIFileLoader(self, ui_file):
ui_file = QFile(ui_file)
ui_file.open(QFile.ReadOnly)
self.dialog = uic.loadUi(ui_file)
ui_file.close()
def getVoicing(self):
"""
Show the dialogue and return the voicing that has been entered.
"""
if self.dialog.exec_() == QDialog.Accepted:
result = [self.dialog.ELineEdit.text(),
self.dialog.ALineEdit.text(),
self.dialog.DLineEdit.text(),
self.dialog.GLineEdit.text(),
self.dialog.BLineEdit.text(),
self.dialog.eLineEdit.text()]
resultJoined = ",".join(result)
return resultJoined
else:
return None
class AboutDialog(QDialog):
"""
Dialogue showing information about the program.
"""
def __init__(self):
super().__init__()
self.UIFileLoader(str(os.path.join(scriptDir, 'ui', 'aboutdialog.ui')))
icon = QImage(str(os.path.join(scriptDir, 'ui', 'icon.png')))
self.dialog.iconLabel.setPixmap(QPixmap.fromImage(icon).scaled(self.dialog.iconLabel.width(
), self.dialog.iconLabel.height(), Qt.KeepAspectRatio, transformMode=Qt.SmoothTransformation))
self.dialog.versionLabel.setText("Version " + _version.version)
self.dialog.exec()
def UIFileLoader(self, ui_file):
ui_file = QFile(ui_file)
ui_file.open(QFile.ReadOnly)
self.dialog = uic.loadUi(ui_file)
ui_file.close()

118
chordsheet/messageBox.py

@ -0,0 +1,118 @@
from PyQt5.QtWidgets import QApplication, QAction, QLabel, QDialogButtonBox, QDialog, QFileDialog, QMessageBox, QPushButton, QLineEdit, QCheckBox, QSpinBox, QDoubleSpinBox, QTableWidgetItem, QTabWidget, QComboBox, QWidget, QScrollArea, QMainWindow, QShortcut
class UnsavedMessageBox(QMessageBox):
"""
Message box to alert the user of unsaved changes and allow them to choose how to act.
"""
def __init__(self):
super().__init__()
self.setIcon(QMessageBox.Question)
self.setWindowTitle("Unsaved changes")
self.setText("The document has been modified.")
self.setInformativeText("Do you want to save your changes?")
self.setStandardButtons(
QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel)
self.setDefaultButton(QMessageBox.Save)
class UnreadableMessageBox(QMessageBox):
"""
Message box to warn the user that the chosen file cannot be opened.
"""
def __init__(self):
super().__init__()
self.setIcon(QMessageBox.Warning)
self.setWindowTitle("File cannot be opened")
self.setText("The file you have selected cannot be opened.")
self.setInformativeText("Please make sure it is in the right format.")
self.setStandardButtons(QMessageBox.Ok)
self.setDefaultButton(QMessageBox.Ok)
class ChordNameWarningMessageBox(QMessageBox):
"""
Message box to warn the user that a chord must have a name
"""
def __init__(self):
super().__init__()
self.setIcon(QMessageBox.Warning)
self.setWindowTitle("Unnamed chord")
self.setText("Chords must have a name.")
self.setInformativeText("Please give your chord a name and try again.")
self.setStandardButtons(QMessageBox.Ok)
self.setDefaultButton(QMessageBox.Ok)
class SectionNameWarningMessageBox(QMessageBox):
"""
Message box to warn the user that a section must have a name
"""
def __init__(self):
super().__init__()
self.setIcon(QMessageBox.Warning)
self.setWindowTitle("Unnamed section")
self.setText("Sections must have a unique name.")
self.setInformativeText(
"Please give your section a unique name and try again.")
self.setStandardButtons(QMessageBox.Ok)
self.setDefaultButton(QMessageBox.Ok)
class BlockMustHaveSectionWarningMessageBox(QMessageBox):
"""
Message box to warn the user that a block must belong to a section
"""
def __init__(self):
super().__init__()
self.setIcon(QMessageBox.Warning)
self.setWindowTitle("No sections found")
self.setText("Each block must belong to a section, but no sections have yet been created.")
self.setInformativeText(
"Please create a section before adding blocks.")
self.setStandardButtons(QMessageBox.Ok)
self.setDefaultButton(QMessageBox.Ok)
class VoicingWarningMessageBox(QMessageBox):
"""
Message box to warn the user that the voicing entered could not be parsed
"""
def __init__(self):
super().__init__()
self.setIcon(QMessageBox.Warning)
self.setWindowTitle("Malformed voicing")
self.setText(
"The voicing you entered was not understood and has not been applied.")
self.setInformativeText(
"Please try re-entering it in the correct format.")
self.setStandardButtons(QMessageBox.Ok)
self.setDefaultButton(QMessageBox.Ok)
class LengthWarningMessageBox(QMessageBox):
"""
Message box to warn the user that a block must have a length
"""
def __init__(self):
super().__init__()
self.setIcon(QMessageBox.Warning)
self.setWindowTitle("Block without valid length")
self.setText("Blocks must have a length.")
self.setInformativeText(
"Please enter a valid length for your block and try again.")
self.setStandardButtons(QMessageBox.Ok)
self.setDefaultButton(QMessageBox.Ok)

54
chordsheet/panels.py

@ -0,0 +1,54 @@
import os
from PyQt5.QtWidgets import QApplication, QAction, QLabel, QDialogButtonBox, QDialog, QFileDialog, QMessageBox, QPushButton, QLineEdit, QCheckBox, QSpinBox, QDoubleSpinBox, QTableWidgetItem, QTabWidget, QComboBox, QWidget, QScrollArea, QMainWindow, QShortcut, QDockWidget
from PyQt5.QtCore import QFile, QObject, Qt
from PyQt5.QtGui import QImage, QPixmap
from PyQt5 import uic
from chordsheet.common import scriptDir
class UIFileDockWidget(QDockWidget):
def __init__(self):
super().__init__()
def UIFileLoader(self, ui_file):
ui_file = QFile(os.path.join(scriptDir, 'ui', ui_file))
ui_file.open(QFile.ReadOnly)
self.setWidget(uic.loadUi(ui_file))
ui_file.close()
class DocInfoDockWidget(UIFileDockWidget):
def __init__(self):
super().__init__()
self.UIFileLoader('docinfo.ui')
self.setWindowTitle("Document information")
class PageSetupDockWidget(UIFileDockWidget):
def __init__(self):
super().__init__()
self.UIFileLoader('psetup.ui')
self.setWindowTitle("Page setup")
class ChordsDockWidget(UIFileDockWidget):
def __init__(self):
super().__init__()
self.UIFileLoader('chords.ui')
self.setWindowTitle("Chords")
class SectionsDockWidget(UIFileDockWidget):
def __init__(self):
super().__init__()
self.UIFileLoader('sections.ui')
self.setWindowTitle("Sections")
class BlocksDockWidget(UIFileDockWidget):
def __init__(self):
super().__init__()
self.UIFileLoader('blocks.ui')
self.setWindowTitle("Blocks")
class PreviewDockWidget(UIFileDockWidget):
def __init__(self):
super().__init__()
self.UIFileLoader('preview.ui')
self.setWindowTitle("Preview")

42
chordsheet/pdfViewer.py

@ -1,9 +1,29 @@
from PyQt5.QtWidgets import QScrollArea, QLabel, QVBoxLayout, QWidget
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap, QImage
from PyQt5.QtWidgets import QScrollArea, QLabel, QVBoxLayout, QWidget, QSizePolicy
from PyQt5.QtCore import Qt, QPoint, QSize
from PyQt5.QtGui import QPixmap, QImage, QResizeEvent, QPainter
import fitz
class PDFLabel(QLabel):
def __init__(self, parent):
super().__init__(parent)
self.parent = parent
self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred)
def paintEvent(self, event):
self.adjustSize()
if self.pixmap() is not None:
painter = QPainter(self)
painter.setRenderHint(QPainter.Antialiasing)
idealWidth = self.parent.width()-45
pixSize = self.pixmap().size()
pixSize.scale(idealWidth, 1000000, Qt.KeepAspectRatio)
scaledPix = self.pixmap().scaled(pixSize, Qt.KeepAspectRatio, Qt.SmoothTransformation)
painter.drawPixmap(QPoint(), scaledPix)
self.setMaximumSize(pixSize)
class PDFViewer(QScrollArea):
def __init__(self, parent):
super().__init__(parent)
@ -16,11 +36,7 @@ class PDFViewer(QScrollArea):
self.scrollAreaContents.setLayout(self.scrollAreaLayout)
self.pixmapList = []
def resizeEvent(self, event):
pass
# do something about this later
def update(self, pdf):
def update_pdf(self, pdf):
self.render(pdf)
self.clear()
self.show()
@ -32,9 +48,9 @@ class PDFViewer(QScrollArea):
self.pixmapList = []
pdfView = fitz.Document(stream=pdf, filetype='pdf')
# render at 4x resolution and scale
# render at 8x resolution and scale
for page in pdfView:
self.pixmapList.append(page.getPixmap(matrix=fitz.Matrix(4, 4), alpha=False))
self.pixmapList.append(page.getPixmap(matrix=fitz.Matrix(8, 8), alpha=False))
def clear(self):
while self.scrollAreaLayout.count():
@ -45,12 +61,14 @@ class PDFViewer(QScrollArea):
def show(self):
for p in self.pixmapList:
label = QLabel(parent=self.scrollAreaContents)
label = PDFLabel(parent=self)
label.setAlignment(Qt.AlignHCenter)
qtimg = QImage(p.samples, p.width, p.height, p.stride, QImage.Format_RGB888)
# -45 because of various margins... value obtained by trial and error.
label.setPixmap(QPixmap.fromImage(qtimg).scaled(self.width()-45, self.height()*2, Qt.KeepAspectRatio, transformMode=Qt.SmoothTransformation))
label.setPixmap(QPixmap.fromImage(qtimg))
self.scrollAreaLayout.addWidget(label)
self.scrollAreaLayout.addStretch(1)
# necessary on Mojave with PyInstaller (or previous contents will be shown)
self.repaint()

1128
gui.py
File diff suppressed because it is too large
View File

BIN
preview.pdf

225
ui/blocks.ui

@ -0,0 +1,225 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>blocksWidget</class>
<widget class="QWidget" name="blocksWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>437</width>
<height>371</height>
</rect>
</property>
<property name="windowTitle">
<string>Blocks</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="blockTabLayout">
<item>
<layout class="QFormLayout" name="formLayout_5">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="blockSectionLabel">
<property name="text">
<string>Section</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="MComboBox" name="blockSectionComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="BlockTableView" name="blockTableView">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropOverwriteMode">
<bool>false</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::InternalMove</enum>
</property>
<property name="defaultDropAction">
<enum>Qt::TargetMoveAction</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="showGrid">
<bool>false</bool>
</property>
<property name="cornerButtonEnabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="blockGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="blockLengthLabel">
<property name="text">
<string>Length</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QComboBox" name="blockChordComboBox"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="blockNotesLabel">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Notes</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="blockChordLabel">
<property name="text">
<string>Chord</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="blockLengthLineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="1" column="1" colspan="4">
<widget class="QLineEdit" name="blockNotesLineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="bottomBlockHorizontalLayout">
<item>
<widget class="QPushButton" name="removeBlockButton">
<property name="text">
<string>Remove block</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="updateBlockButton">
<property name="text">
<string>Update block</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="addBlockButton">
<property name="text">
<string>Add block</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>BlockTableView</class>
<extends>QTableView</extends>
<header>chordsheet/tableView.h</header>
</customwidget>
<customwidget>
<class>MComboBox</class>
<extends>QComboBox</extends>
<header>chordsheet/comboBox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>blockSectionComboBox</tabstop>
<tabstop>blockTableView</tabstop>
<tabstop>blockLengthLineEdit</tabstop>
<tabstop>blockChordComboBox</tabstop>
<tabstop>blockNotesLineEdit</tabstop>
<tabstop>removeBlockButton</tabstop>
<tabstop>updateBlockButton</tabstop>
<tabstop>addBlockButton</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

190
ui/chords.ui

@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>chordsWidget</class>
<widget class="QWidget" name="chordsWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>443</width>
<height>359</height>
</rect>
</property>
<property name="windowTitle">
<string>Chords</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="chordTabLayout">
<item>
<widget class="ChordTableView" name="chordTableView">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropOverwriteMode">
<bool>false</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::InternalMove</enum>
</property>
<property name="defaultDropAction">
<enum>Qt::IgnoreAction</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="showGrid">
<bool>false</bool>
</property>
<property name="sortingEnabled">
<bool>false</bool>
</property>
<property name="cornerButtonEnabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="chordGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="chordNameLabel">
<property name="text">
<string>Chord name</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="guitarVoicingLineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="guitarVoicingLabel">
<property name="text">
<string>Guitar voicing</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="chordNameLineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="guitarVoicingButton">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Editor...</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="pianoVoicingLineEdit"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="pianoVoicingLabel">
<property name="text">
<string>Piano voicing</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="bottomChordHorizontalLayout">
<item>
<widget class="QPushButton" name="removeChordButton">
<property name="text">
<string>Remove chord</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="updateChordButton">
<property name="text">
<string>Update chord</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="addChordButton">
<property name="text">
<string>Add chord</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ChordTableView</class>
<extends>QTableView</extends>
<header>chordsheet/tableView.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>chordTableView</tabstop>
<tabstop>chordNameLineEdit</tabstop>
<tabstop>guitarVoicingLineEdit</tabstop>
<tabstop>guitarVoicingButton</tabstop>
<tabstop>pianoVoicingLineEdit</tabstop>
<tabstop>removeChordButton</tabstop>
<tabstop>updateChordButton</tabstop>
<tabstop>addChordButton</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

144
ui/docinfo.ui

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>docInfoWidget</class>
<widget class="QWidget" name="docInfoWidget">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>202</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Document information</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QFormLayout" name="formLayoutOverview">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="titleLabel">
<property name="text">
<string>Title</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="titleLineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="subtitleLabel">
<property name="text">
<string>Subtitle</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="subtitleLineEdit"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="composerLabel">
<property name="text">
<string>Composer</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="composerLineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="arrangerLabel">
<property name="text">
<string>Arranger</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="arrangerLineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="tempoLabel">
<property name="text">
<string>Tempo</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="tempoLineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="timeSignatureLabel">
<property name="text">
<string>Time</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="timeSignatureSpinBox">
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
<property name="specialValueText">
<string/>
</property>
<property name="value">
<number>4</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

57
ui/document.ui

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>docWindow</class>
<widget class="QWidget" name="docWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>424</width>
<height>324</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="PDFViewer" name="pdfArea" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>400</width>
<height>300</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>PDFViewer</class>
<extends>QWidget</extends>
<header>chordsheet/pdfViewer.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

172
ui/new.ui

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1061</width>
<height>659</height>
</rect>
</property>
<property name="windowTitle">
<string>Chordsheet</string>
</property>
<property name="documentMode">
<bool>false</bool>
</property>
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QMdiArea" name="mdiArea">
<property name="enabled">
<bool>true</bool>
</property>
<property name="documentMode">
<bool>true</bool>
</property>
<property name="tabsClosable">
<bool>true</bool>
</property>
<property name="tabsMovable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1061</width>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>File</string>
</property>
<addaction name="actionNew"/>
<addaction name="actionOpen"/>
<addaction name="separator"/>
<addaction name="actionSave"/>
<addaction name="actionSave_as"/>
<addaction name="actionSave_PDF"/>
<addaction name="separator"/>
<addaction name="actionPrint"/>
<addaction name="separator"/>
<addaction name="actionClose"/>
</widget>
<widget class="QMenu" name="menuEdit">
<property name="title">
<string>Edit</string>
</property>
<addaction name="actionUndo"/>
<addaction name="actionRedo"/>
<addaction name="separator"/>
<addaction name="actionCut"/>
<addaction name="actionCopy"/>
<addaction name="actionPaste"/>
<addaction name="separator"/>
<addaction name="actionAbout"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuEdit"/>
</widget>
<action name="actionNew">
<property name="text">
<string>New...</string>
</property>
</action>
<action name="actionOpen">
<property name="text">
<string>Open...</string>
</property>
</action>
<action name="actionSave">
<property name="text">
<string>Save</string>
</property>
</action>
<action name="actionSave_PDF">
<property name="text">
<string>Save PDF...</string>
</property>
</action>
<action name="actionPrint">
<property name="text">
<string>Print...</string>
</property>
</action>
<action name="actionClose">
<property name="text">
<string>Close</string>
</property>
</action>
<action name="actionSave_as">
<property name="text">
<string>Save as...</string>
</property>
</action>
<action name="actionQuit">
<property name="text">
<string>Quit</string>
</property>
</action>
<action name="actionUndo">
<property name="text">
<string>Undo</string>
</property>
</action>
<action name="actionRedo">
<property name="text">
<string>Redo</string>
</property>
</action>
<action name="actionCut">
<property name="text">
<string>Cut</string>
</property>
</action>
<action name="actionCopy">
<property name="text">
<string>Copy</string>
</property>
</action>
<action name="actionPaste">
<property name="text">
<string>Paste</string>
</property>
</action>
<action name="actionPreferences">
<property name="text">
<string>Preferences</string>
</property>
</action>
<action name="actionAbout">
<property name="text">
<string>About</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>

32
ui/pdfarea.ui

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>PDF Viewer</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="PDFViewer" name="pdfArea" native="true"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>PDFViewer</class>
<extends>QWidget</extends>
<header>chordsheet/pdfViewer.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

52
ui/preview.ui

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>previewPanel</class>
<widget class="QWidget" name="previewPanel">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>40</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<property name="windowTitle">
<string>Preview</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="updatePreviewButton">
<property name="text">
<string>Update preview</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

273
ui/psetup.ui

@ -0,0 +1,273 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>psetupWidget</class>
<widget class="QWidget" name="psetupWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>500</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Page setup</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="pageGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Page options</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="pageSizeLabel">
<property name="text">
<string>Page size</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="pageSizeComboBox"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="documentUnitsLabel">
<property name="text">
<string>Document units</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="documentUnitsComboBox"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="leftMarginLabel">
<property name="text">
<string>Left margin</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="leftMarginLineEdit">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="topMarginLabel">
<property name="text">
<string>Top margin</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="topMarginLineEdit">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="rightMarginLabel">
<property name="text">
<string>Right margin</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="rightMarginLineEdit">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="bottomMarginLabel">
<property name="text">
<string>Bottom margin</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="bottomMarginLineEdit">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="fontGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Font options</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="fontLabel">
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Font</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="fontComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="includedFontCheckBox">
<property name="text">
<string>Use included FreeSans</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="textGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Text options</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="lineSpacingLabel">
<property name="text">
<string>Line spacing</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="lineSpacingDoubleSpinBox">
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>70</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="blockOptions">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Block options</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="beatWidthLabel">
<property name="text">
<string>Beat width</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="beatWidthLineEdit">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>pageSizeComboBox</tabstop>
<tabstop>documentUnitsComboBox</tabstop>
<tabstop>leftMarginLineEdit</tabstop>
<tabstop>rightMarginLineEdit</tabstop>
<tabstop>topMarginLineEdit</tabstop>
<tabstop>bottomMarginLineEdit</tabstop>
<tabstop>lineSpacingDoubleSpinBox</tabstop>
<tabstop>fontComboBox</tabstop>
<tabstop>includedFontCheckBox</tabstop>
<tabstop>beatWidthLineEdit</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

127
ui/sections.ui

@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>sectionsWidget</class>
<widget class="QWidget" name="sectionsWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>431</width>
<height>325</height>
</rect>
</property>
<property name="windowTitle">
<string>Sections</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="sectionTabLayout">
<item>
<widget class="SectionTableView" name="sectionTableView">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropOverwriteMode">
<bool>false</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::InternalMove</enum>
</property>
<property name="defaultDropAction">
<enum>Qt::TargetMoveAction</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="showGrid">
<bool>false</bool>
</property>
<property name="cornerButtonEnabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout_3">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="sectionNameLabel">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="sectionNameLineEdit"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="bottomSectionHorizontalLayout">
<item>
<widget class="QPushButton" name="removeSectionButton">
<property name="text">
<string>Remove section</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="updateSectionButton">
<property name="text">
<string>Update section</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="addSectionButton">
<property name="text">
<string>Add section</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>SectionTableView</class>
<extends>QTableView</extends>
<header>chordsheet/tableView.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

8
version.rc

@ -6,8 +6,8 @@ VSVersionInfo(
ffi=FixedFileInfo(
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
# Set not needed items to zero 0.
filevers=(0, 4, 6, 0),
prodvers=(0, 4, 6, 0),
filevers=(0, 5, 0, 0),
prodvers=(0, 5, 0, 0),
# Contains a bitmask that specifies the valid bits 'flags'r
mask=0x3f,
# Contains a bitmask that specifies the Boolean attributes of the file.
@ -31,12 +31,12 @@ StringFileInfo(
u'040904B0',
[StringStruct(u'CompanyName', u'Ivan Holmes'),
StringStruct(u'FileDescription', u'Chordsheet'),
StringStruct(u'FileVersion', u'0.4.6'),
StringStruct(u'FileVersion', u'0.5.0'),
StringStruct(u'InternalName', u'Chordsheet'),
StringStruct(u'LegalCopyright', u'Copyright (c) Ivan Holmes, 2020. Some rights reserved.'),
StringStruct(u'OriginalFilename', u'chordsheet.exe'),
StringStruct(u'ProductName', u'Chordsheet'),
StringStruct(u'ProductVersion', u'0.4.6')])
StringStruct(u'ProductVersion', u'0.5.0')])
]),
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
]
Loading…
Cancel
Save