21 changed files with 856 additions and 1794 deletions
			
			
		- 
					25chordsheet/document.py
- 
					11chordsheet/parsers.py
- 
					11chordsheet/render.py
- 
					43cli.py
- 
					0csgui/comboBox.py
- 
					30csgui/dialogs.py
- 
					8csgui/messageBox.py
- 
					14csgui/panels.py
- 
					26csgui/pdfViewer.py
- 
					29csgui/tableView.py
- 
					1022gui.py
- 
					BINpreview.pdf
- 
					17ui/aboutdialog.ui
- 
					4ui/blocks.ui
- 
					2ui/chords.ui
- 
					4ui/document.ui
- 
					1095ui/mainwindow.ui
- 
					233ui/new.ui
- 
					32ui/pdfarea.ui
- 
					42ui/preview.ui
- 
					2ui/sections.ui
| @ -0,0 +1,43 @@ | |||
| #!/usr/bin/env python3 | |||
| # -*- coding: utf-8 -*- | |||
| 
 | |||
| import sys | |||
| import os | |||
| import time | |||
| 
 | |||
| from reportlab.lib.units import mm, cm, inch, pica | |||
| from reportlab.lib.pagesizes import A4, A5, LETTER, LEGAL | |||
| from reportlab.pdfbase import pdfmetrics | |||
| from reportlab.pdfbase.ttfonts import TTFont | |||
| 
 | |||
| from chordsheet.common import scriptDir | |||
| from chordsheet.document import Document, Style, Chord, Block, Section | |||
| from chordsheet.render import Renderer | |||
| from chordsheet.parsers import parseFingering, parseName | |||
| 
 | |||
| import _version | |||
| 
 | |||
| pdfmetrics.registerFont( | |||
|     TTFont('FreeSans', os.path.join(scriptDir, 'fonts', 'FreeSans.ttf'))) | |||
| if sys.platform == "darwin": | |||
|     pdfmetrics.registerFont( | |||
|         TTFont('HelveticaNeue', 'HelveticaNeue.ttc', subfontIndex=0)) | |||
| 
 | |||
| if len(sys.argv) == 2: | |||
|     inputFilePath = sys.argv[1] | |||
| else: | |||
|     print("Please provide a .cml, .xml, or .cma file to process.") | |||
|     sys.exit() | |||
|      | |||
| doc = Document() | |||
| if inputFilePath[-4:] == ".cma": | |||
|     doc.loadCSMacro(inputFilePath) | |||
| else: | |||
|     doc.loadXML(inputFilePath) | |||
| 
 | |||
| style = Style() | |||
| 
 | |||
| renderer = Renderer(doc, style) | |||
| 
 | |||
| outputFilePath = ".".join(inputFilePath.split(".")[:-1]) + ".pdf" | |||
| renderer.savePDF(outputFilePath) | |||
						
							
						
						
							1022
	
						
						gui.py
						
							File diff suppressed because it is too large
							
							
								
									View File
								
							
						
					
				File diff suppressed because it is too large
							
							
								
									View File
								
							
						
						
							
						
						
							1095
	
						
						ui/mainwindow.ui
						
							File diff suppressed because it is too large
							
							
								
									View File
								
							
						
					
				File diff suppressed because it is too large
							
							
								
									View File
								
							
						| @ -1,233 +0,0 @@ | |||
| <?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>639</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> | |||
|    <widget class="QMenu" name="menuWindow"> | |||
|     <property name="title"> | |||
|      <string>Window</string> | |||
|     </property> | |||
|     <addaction name="actionDocument_information"/> | |||
|     <addaction name="actionPage_setup"/> | |||
|     <addaction name="actionChords"/> | |||
|     <addaction name="actionSections"/> | |||
|     <addaction name="actionBlocks"/> | |||
|     <addaction name="separator"/> | |||
|     <addaction name="actionPreview"/> | |||
|    </widget> | |||
|    <addaction name="menuFile"/> | |||
|    <addaction name="menuEdit"/> | |||
|    <addaction name="menuWindow"/> | |||
|   </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> | |||
|   <action name="actionDocument_information"> | |||
|    <property name="checkable"> | |||
|     <bool>true</bool> | |||
|    </property> | |||
|    <property name="text"> | |||
|     <string>Document information</string> | |||
|    </property> | |||
|   </action> | |||
|   <action name="actionPage_setup"> | |||
|    <property name="checkable"> | |||
|     <bool>true</bool> | |||
|    </property> | |||
|    <property name="text"> | |||
|     <string>Page setup</string> | |||
|    </property> | |||
|   </action> | |||
|   <action name="actionChords"> | |||
|    <property name="checkable"> | |||
|     <bool>true</bool> | |||
|    </property> | |||
|    <property name="text"> | |||
|     <string>Chords</string> | |||
|    </property> | |||
|   </action> | |||
|   <action name="actionSections"> | |||
|    <property name="checkable"> | |||
|     <bool>true</bool> | |||
|    </property> | |||
|    <property name="text"> | |||
|     <string>Sections</string> | |||
|    </property> | |||
|   </action> | |||
|   <action name="actionBlocks"> | |||
|    <property name="checkable"> | |||
|     <bool>true</bool> | |||
|    </property> | |||
|    <property name="text"> | |||
|     <string>Blocks</string> | |||
|    </property> | |||
|   </action> | |||
|   <action name="actionPreview"> | |||
|    <property name="checkable"> | |||
|     <bool>true</bool> | |||
|    </property> | |||
|    <property name="text"> | |||
|     <string>Preview</string> | |||
|    </property> | |||
|   </action> | |||
|  </widget> | |||
|  <resources/> | |||
|  <connections/> | |||
| </ui> | |||
| @ -1,32 +0,0 @@ | |||
| <?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> | |||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue