allow launching renaming utility separately
This commit is contained in:
parent
d4317b46a1
commit
4c61c9a9d4
|
@ -195,6 +195,10 @@ install(FILES resources/desktop/applications/${META_PROJECT_NAME}.desktop
|
|||
DESTINATION share/applications
|
||||
COMPONENT desktop
|
||||
)
|
||||
install(FILES resources/desktop/applications/${META_PROJECT_NAME}-renamingutility.desktop
|
||||
DESTINATION share/applications
|
||||
COMPONENT desktop
|
||||
)
|
||||
install(FILES ${QM_FILES}
|
||||
DESTINATION share/${META_PROJECT_NAME}/translations
|
||||
COMPONENT localization
|
||||
|
|
|
@ -176,14 +176,19 @@ int main(int argc, char *argv[])
|
|||
remBackupFilesArg.setValueNames({"directory"});
|
||||
remBackupFilesArg.setRequiredValueCount(1);
|
||||
remBackupFilesArg.setSecondaryArguments({&recursiveArg});
|
||||
// renaming utility
|
||||
Argument renamingUtilityArg("renaming-utility", string(), "launches the renaming utility instead of the main GUI");
|
||||
renamingUtilityArg.setCombinable(true);
|
||||
// set arguments to parser
|
||||
qtConfigArgs.qtWidgetsGuiArg().addSecondaryArgument(&filesArg);
|
||||
qtConfigArgs.qtWidgetsGuiArg().addSecondaryArgument(&renamingUtilityArg);
|
||||
parser.setMainArguments({&printFieldNamesArg, &displayFileInfoArg, &displayTagInfoArg, &setTagInfoArgs.setTagInfoArg, &extractFieldArg, &genInfoArg, &remBackupFilesArg, &qtConfigArgs.qtWidgetsGuiArg(), &helpArg});
|
||||
// parse given arguments
|
||||
try {
|
||||
parser.parseArgs(argc, argv);
|
||||
if(qtConfigArgs.areQtGuiArgsPresent()) {
|
||||
#ifdef GUI_QTWIDGETS
|
||||
return QtGui::runWidgetsGui(argc, argv, qtConfigArgs, filesArg.values().empty() ? QString() : QString::fromLocal8Bit(filesArg.values().front().data()));
|
||||
return QtGui::runWidgetsGui(argc, argv, qtConfigArgs, filesArg.values().empty() ? QString() : QString::fromLocal8Bit(filesArg.values().front().data()), renamingUtilityArg.isPresent());
|
||||
#else
|
||||
CMD_UTILS_START_CONSOLE;
|
||||
cout << "Application has not been build with Qt widgets GUI support." << endl;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "./initiate.h"
|
||||
#include "./mainwindow.h"
|
||||
#include "./renamefilesdialog.h"
|
||||
|
||||
#include "../application/settings.h"
|
||||
|
||||
|
@ -17,7 +18,7 @@ using namespace ApplicationUtilities;
|
|||
|
||||
namespace QtGui {
|
||||
|
||||
int runWidgetsGui(int argc, char *argv[], const QtConfigArguments &qtConfigArgs, const QString &path)
|
||||
int runWidgetsGui(int argc, char *argv[], const QtConfigArguments &qtConfigArgs, const QString &path, bool launchRenamingUtility)
|
||||
{
|
||||
SET_QT_APPLICATION_INFO;
|
||||
QApplication a(argc, argv);
|
||||
|
@ -27,12 +28,19 @@ int runWidgetsGui(int argc, char *argv[], const QtConfigArguments &qtConfigArgs,
|
|||
qtConfigArgs.applySettings();
|
||||
LOAD_QT_TRANSLATIONS;
|
||||
Settings::restore();
|
||||
MainWindow w;
|
||||
w.show();
|
||||
if(!path.isEmpty()) {
|
||||
w.startParsing(path, true);
|
||||
int res;
|
||||
if(launchRenamingUtility) {
|
||||
RenameFilesDialog w;
|
||||
w.show();
|
||||
res = a.exec();
|
||||
} else {
|
||||
MainWindow w;
|
||||
w.show();
|
||||
if(!path.isEmpty()) {
|
||||
w.startParsing(path, true);
|
||||
}
|
||||
res = a.exec();
|
||||
}
|
||||
int res = a.exec();
|
||||
Settings::save();
|
||||
// cleanup resources
|
||||
QtUtilitiesResources::cleanup();
|
||||
|
|
|
@ -11,7 +11,7 @@ class QtConfigArguments;
|
|||
|
||||
namespace QtGui {
|
||||
|
||||
int runWidgetsGui(int argc, char *argv[], const ApplicationUtilities::QtConfigArguments &qtConfigArgs, const QString &path);
|
||||
int runWidgetsGui(int argc, char *argv[], const ApplicationUtilities::QtConfigArguments &qtConfigArgs, const QString &path, bool launchRenamingUtility = false);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[Desktop Entry]
|
||||
Name=Tag Editor
|
||||
GenericName=Tag editor
|
||||
Comment=A tag editing utility supporting ID3 and iTunes tags.
|
||||
Comment=A tag editing utility supporting ID3, Vorbis, MP4 (iTunes style) and Matroska tags.
|
||||
Exec=tageditor
|
||||
Icon=tageditor
|
||||
Terminal=false
|
||||
|
|
|
@ -115,8 +115,9 @@ RESOURCES += \
|
|||
resources/icons.qrc \
|
||||
resources/scripts.qrc
|
||||
|
||||
TRANSLATIONS = translations/tageditor_en_US.ts \
|
||||
translations/tageditor_de_DE.ts
|
||||
TRANSLATIONS = \
|
||||
translations/tageditor_en_US.ts \
|
||||
translations/tageditor_de_DE.ts
|
||||
|
||||
OTHER_FILES += \
|
||||
README.md \
|
||||
|
@ -152,6 +153,8 @@ INSTALLS += target
|
|||
icon.files = $${PWD}/resources/icons/hicolor/scalable/apps/$${projectname}.svg
|
||||
INSTALLS += icon
|
||||
menu.path = $$(INSTALL_ROOT)/share/applications/
|
||||
menu.files = $${PWD}/resources/desktop/applications/$${projectname}.desktop
|
||||
menu.files = \
|
||||
$${PWD}/resources/desktop/applications/$${projectname}.desktop \
|
||||
$${PWD}/resources/desktop/applications/$${projectname}-renamingutility.desktop
|
||||
INSTALLS += menu
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue