diff --git a/build.sh b/build.sh index 6e3adda..44b28bb 100755 --- a/build.sh +++ b/build.sh @@ -65,13 +65,13 @@ if [[ $unamestr == "Darwin" ]]; then make macdeployqt MapMap.app #cp -R /Library/Frameworks/GStreamer.framework ./MapMap.app/Contents/Frameworks/ - lrelease mapmap_fr.ts + lrelease resources/texts/mapmap_fr.ts # do_fix_qt_plugins_in_app do_create_dmg elif [[ $unamestr == "Linux" ]]; then qmake # -qt4 make - lrelease mapmap_fr.ts + lrelease resources/texts/mapmap_fr.ts fi diff --git a/main.cpp b/main.cpp index 1790185..490a27c 100644 --- a/main.cpp +++ b/main.cpp @@ -77,6 +77,9 @@ int main(int argc, char *argv[]) QCommandLineOption oscPortOption(QStringList() << "p" << "osc-port", "Use OSC port number .", "osc-port", ""); parser.addOption(oscPortOption); + // Positional argument: file + parser.addPositionalArgument("file", "Load project from that file."); + parser.process(app); if (parser.isSet(versionOption) || parser.isSet(helpOption)) { @@ -86,7 +89,8 @@ int main(int argc, char *argv[]) { Util::eraseSettings(); } -#endif + +#endif // USING_QT_5 if (! QGLFormat::hasOpenGL()) qFatal("This system has no OpenGL support."); @@ -127,7 +131,22 @@ int main(int argc, char *argv[]) //win.setLocale(QLocale("fr")); #if USING_QT_5 - QString projectFileValue = parser.value("file"); + // read positional argument: + const QStringList args = parser.positionalArguments(); + QString projectFileValue = QString(); + + // there are two ways to specify the project file name. + // The 2nd overrides the first: + + // read the file option value: (overrides the positional argument) + projectFileValue = parser.value("file"); + // read the first positional argument: + if (! args.isEmpty()) + { + projectFileValue = args.first(); + } + + // finally, load the project file. if (projectFileValue != "") { win.loadFile(projectFileValue); diff --git a/mapmap.pro b/mapmap.pro index bdd61f0..6474264 100644 --- a/mapmap.pro +++ b/mapmap.pro @@ -54,7 +54,7 @@ SOURCES = \ main.cpp RESOURCES = mapmap.qrc -TRANSLATIONS = mapmap_fr.ts mapmap_ar.ts +TRANSLATIONS = resources/texts/mapmap_fr.ts include(contrib/qtpropertybrowser/src/qtpropertybrowser.pri) include(contrib/qtpropertybrowser-extension/qtpropertybrowser-extension.pri) @@ -76,9 +76,26 @@ unix:!mac { mapmapfile.files = mapmap mapmapfile.path = /usr/bin INSTALLS += mapmapfile - desktopfile.files = mapmap.desktop + desktopfile.files = resources/texts/mapmap.desktop desktopfile.path = /usr/share/applications INSTALLS += desktopfile + iconfile.files = resources/images/logo/mapmap.svg + iconfile.path = /usr/share/icons/hicolor/scalable/apps + INSTALLS += iconfile + mimetypesfile.files = resources/texts/mapmap.xml + mimetypesfile.path = /usr/share/mime/packages + INSTALLS += mimetypesfile + updatemimetypes.path = /usr/share/mime/packages + updatemimetypes.commands = update-mime-database /usr/share/mime + INSTALLS += updatemimetypes + updatemimeappdefault.path = /usr/share/applications + updatemimeappdefault.commands='grep mapmap.desktop /usr/share/applications/defaults.list >/dev/null|| sudo echo "application/mapmap=mapmap.desktop;" >> /usr/share/applications/defaults.list' + INSTALLS += updatemimeappdefault + + # Add the docs target: + docs.depends = $(HEADERS) $(SOURCES) + docs.commands = (cat Doxyfile; echo "INPUT = $?") | doxygen - + QMAKE_EXTRA_TARGETS += docs } # Mac OS X-specific: diff --git a/mapmap_ar.ts b/mapmap_ar.ts deleted file mode 100644 index cc7cd4f..0000000 --- a/mapmap_ar.ts +++ /dev/null @@ -1,889 +0,0 @@ - - - - - MainWindow - - - Open project - - - - - All files (*) - - - - - Save project - - - - - MapMap files (*.%1) - - - - - Import media source file - - - - - About MapMap - - - - - <h2>MapMap - - - - - - - MapMap - - - - - Remove this paint and all its associated mappings? - - - - - &New - - - - - Create a new project - - - - - &Open... - - - - - Open an existing project - - - - - &Save - - - - - Save the project - - - - - Save &As... - - - - - Save the project as... - - - - - &Import media source file... - - - - - Import a media source file... - - - - - Add &Color paint... - - - - - Add a color paint... - - - - - E&xit - - - - - Ctrl+Q - - - - - Exit the application - - - - - &About - - - - - Show the application's About box - - - - - Delete - - - - - CTRL+DEL - - - - - Delete item - - - - - Add Quad/&Mesh - - - - - CTRL+M - - - - - Add quad/mesh - - - - - Add &Triangle - - - - - CTRL+T - - - - - Add triangle - - - - - Add &Ellipse - - - - - CTRL+E - - - - - Add ellipse - - - - - &Display output window - - - - - Ctrl+D - - - - - Display output window - - - - - &Full screen - - - - - Ctrl+F - - - - - Full screen - - - - - &Display canvas controls - - - - - Display canvas controls - - - - - - &File - - - - - &Edit - - - - - &View - - - - - &Help - - - - - The document has been modified. -Do you want to save your changes? - - - - - - Error reading mapping project file - - - - - - Cannot read file %1: -%2. - - - - - Parse error in file %1: - -%2 - - - - - File loaded - - - - - Error saving mapping project - - - - - Cannot write file %1: -%2. - - - - - File saved - - - - - Untitled - - - - - %1[*] - %2 - - - - - - MapMap Project - - - - - File imported - - - - - Color paint added - - - - - QObject - - - Texture mapping - - - - - Output shape - - - - - Input shape - - - - - Point %1 - - - - - - Dimensions - - - - - The file is not a mapmap version 0.1 file. - - - - - %1 -Line %2, column %3 - - - - - Cannot create media with uri %1. - - - - - Cannot create color with RGB hex code %1. - - - - - Unsupported paint type: %1. - - - - - Cannot create triangle texture mapping - - - - - Cannot create mesh texture mapping - - - - - Cannot create ellipse texture mapping - - - - - Cannot create triangle color mapping - - - - - Cannot create quad color mapping - - - - - Cannot create ellipse color mapping - - - - - Unsupported mapping type: %1. - - - - - Wrong shape type "%1" for destination: expected "%2". - - - - - Shape of type '%1' has %2 vertices: expected %3. - - - - - Shape has %1 vertices: expected 4 or 5. - - - - - Wrong shape type for destination: %1. - - - - - Shape has wrong number of vertices. - - - - - Initiating program... - - - - - Done. - - - - - QtBoolEdit - - - - - True - - - - - - False - - - - - QtBoolPropertyManager - - - True - - - - - False - - - - - QtCharEdit - - - Clear Char - - - - - QtColorEditWidget - - - ... - - - - - QtColorPropertyManager - - - Red - - - - - Green - - - - - Blue - - - - - Alpha - - - - - QtCursorDatabase - - - Arrow - - - - - Up Arrow - - - - - Cross - - - - - Wait - - - - - IBeam - - - - - Size Vertical - - - - - Size Horizontal - - - - - Size Backslash - - - - - Size Slash - - - - - Size All - - - - - Blank - - - - - Split Vertical - - - - - Split Horizontal - - - - - Pointing Hand - - - - - Forbidden - - - - - Open Hand - - - - - Closed Hand - - - - - What's This - - - - - Busy - - - - - QtFontEditWidget - - - ... - - - - - Select Font - - - - - QtFontPropertyManager - - - Family - - - - - Point Size - - - - - Bold - - - - - Italic - - - - - Underline - - - - - Strikeout - - - - - Kerning - - - - - QtKeySequenceEdit - - - Clear Shortcut - - - - - QtLocalePropertyManager - - - %1, %2 - - - - - Language - - - - - Country - - - - - QtPointFPropertyManager - - - (%1, %2) - - - - - X - - - - - Y - - - - - QtPointPropertyManager - - - (%1, %2) - - - - - X - - - - - Y - - - - - QtPropertyBrowserUtils - - - [%1, %2, %3] (%4) - - - - - [%1, %2] - - - - - QtRectFPropertyManager - - - [(%1, %2), %3 x %4] - - - - - X - - - - - Y - - - - - Width - - - - - Height - - - - - QtRectPropertyManager - - - [(%1, %2), %3 x %4] - - - - - X - - - - - Y - - - - - Width - - - - - Height - - - - - QtSizeFPropertyManager - - - %1 x %2 - - - - - Width - - - - - Height - - - - - QtSizePolicyPropertyManager - - - - <Invalid> - - - - - [%1, %2, %3, %4] - - - - - Horizontal Policy - - - - - Vertical Policy - - - - - Horizontal Stretch - - - - - Vertical Stretch - - - - - QtSizePropertyManager - - - %1 x %2 - - - - - Width - - - - - Height - - - - - QtTreePropertyBrowser - - - Property - - - - - Value - - - - diff --git a/mapmap.desktop b/resources/texts/mapmap.desktop similarity index 75% rename from mapmap.desktop rename to resources/texts/mapmap.desktop index 4af7a85..83354dc 100644 --- a/mapmap.desktop +++ b/resources/texts/mapmap.desktop @@ -5,9 +5,10 @@ GenericName=Video Mapping editor GenericName[fr]=Éditeur pour le video mapping Comment=MapMap is a free/libre video projection mapping editor Comment[fr]=MapMap est un éditeur pour la projection video mapping -Icon=mapmap -Exec=mapmap %U +TryExec=mapmap +Exec=mapmap %f Terminal=false +StartupNotify=true Type=Application Categories=Qt;AudioVideo;Video; - +Icon=/usr/share/icons/hicolor/scalable/apps/mapmap.svg diff --git a/resources/texts/mapmap.xml b/resources/texts/mapmap.xml new file mode 100644 index 0000000..1a73979 --- /dev/null +++ b/resources/texts/mapmap.xml @@ -0,0 +1,14 @@ + + + + MapMap file type + + + + + + Pure Data Document + MapMap Document + Document MapMap + + diff --git a/mapmap_fr.ts b/resources/texts/mapmap_fr.ts similarity index 100% rename from mapmap_fr.ts rename to resources/texts/mapmap_fr.ts