Commit 6b5146b9 authored by Urs Fleisch's avatar Urs Fleisch
Browse files

Support separators and submenus in user action context menu.

parent 846b8b15
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2015-05-13 21:43+0200\n"
"Last-Translator: Pavel Fric <pavelfric@seznam.cz>\n"
"Language-Team: Czech <kde-i18n-doc@kde.org>\n"
......@@ -701,6 +701,15 @@ msgstr "Základní adresář QML"
msgid "Encode as URL"
msgstr "Zakódovat jako URL"
msgid "--- separator ---"
msgstr "--- oddělovač ---"
msgid "Begin of submenu"
msgstr "Podřazená nabídka"
msgid "End of submenu"
msgstr "Začátek podřazená nabídka"
msgid "Confirm"
msgstr "Potvrzení"
......
......@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2011-04-26 23:41+0200\n"
"Last-Translator: Frank Steinmetzger <Warp_7@gmx.de>\n"
"Language-Team: German <kde-i18n-doc@kde.org>\n"
......@@ -702,6 +702,15 @@ msgstr "QML Basisordner"
msgid "Encode as URL"
msgstr "Als URL kodieren"
msgid "--- separator ---"
msgstr "--- Trenner ---"
msgid "Begin of submenu"
msgstr "Beginn eines Untermenüs"
msgid "End of submenu"
msgstr "Ende eines Untermenüs"
msgid "Confirm"
msgstr "Nachfragen"
......
......@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2011-01-15 17:29+0100\n"
"Last-Translator: \n"
"Language-Team: Spanish <kde-i18n-doc@kde.org>\n"
......@@ -702,6 +702,15 @@ msgstr "Directorio base QML"
msgid "Encode as URL"
msgstr "Codificación URL"
msgid "--- separator ---"
msgstr "--- separador ---"
msgid "Begin of submenu"
msgstr "Comenzar de submenú"
msgid "End of submenu"
msgstr "Final de submenú"
msgid "Confirm"
msgstr "Confirmar"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2014-01-23 22:00+0200\n"
"Last-Translator: Mihkel Tõnnov <mihhkel@gmail.com>\n"
"Language-Team: Estonian <kde-i18n-doc@kde.org>\n"
......@@ -701,6 +701,15 @@ msgstr "QML baaskataloog"
msgid "Encode as URL"
msgstr "URL-i jaoks sobivas kodeeringus esitaja jm"
msgid "--- separator ---"
msgstr "--- eraldaja ---"
msgid "Begin of submenu"
msgstr "Algus alammenüü"
msgid "End of submenu"
msgstr "Alammenüü lõpp"
msgid "Confirm"
msgstr "Kinnitus"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2014-01-25 00:31+0200\n"
"Last-Translator: Tommi Nieminen <translator@legisign.org>\n"
"Language-Team: Finnish <kde-i18n-doc@kde.org>\n"
......@@ -701,6 +701,15 @@ msgstr "QML juurikansio"
msgid "Encode as URL"
msgstr "Koodaa verkko-osoitteeksi"
msgid "--- separator ---"
msgstr "--- erotin ---"
msgid "Begin of submenu"
msgstr "Alivalikko alkaa"
msgid "End of submenu"
msgstr "Alivalikko loppu"
msgid "Confirm"
msgstr "Vahvista"
......
......@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2011-01-15 17:32+0100\n"
"Last-Translator: \n"
"Language-Team: French <kde-i18n-doc@kde.org>\n"
......@@ -702,6 +702,15 @@ msgstr "Dossier de base QML"
msgid "Encode as URL"
msgstr "Encodée en URL"
msgid "--- separator ---"
msgstr "--- séparateur ---"
msgid "Begin of submenu"
msgstr "Début d'un sous menu"
msgid "End of submenu"
msgstr "Fin de sous menu"
msgid "Confirm"
msgstr "Confirmer"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2011-01-15 17:33+0100\n"
"Last-Translator: \n"
"Language-Team: Italian <kde-i18n-doc@kde.org>\n"
......@@ -700,6 +700,15 @@ msgstr "Cartella di base QML"
msgid "Encode as URL"
msgstr "Codifica come URL"
msgid "--- separator ---"
msgstr "--- separatore ---"
msgid "Begin of submenu"
msgstr "Inizio di un sottomenu"
msgid "End of submenu"
msgstr "Fine sottomenu"
msgid "Confirm"
msgstr "Conferma"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:56+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -697,6 +697,15 @@ msgstr ""
msgid "Encode as URL"
msgstr ""
msgid "--- separator ---"
msgstr ""
msgid "Begin of submenu"
msgstr ""
msgid "End of submenu"
msgstr ""
msgid "Confirm"
msgstr ""
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2012-12-07 15:47+0100\n"
"Last-Translator: toon <toon@vgerwen.nl>\n"
"Language-Team: Dutch <kde-i18n-doc@kde.org>\n"
......@@ -701,6 +701,15 @@ msgstr "QML basismap"
msgid "Encode as URL"
msgstr "Coderen als URL-adres"
msgid "--- separator ---"
msgstr "---scheiding---"
msgid "Begin of submenu"
msgstr "Begin van submenu"
msgid "End of submenu"
msgstr "Einde van submenu"
msgid "Confirm"
msgstr "Bevestigen"
......
......@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2011-01-15 17:37+0100\n"
"Last-Translator: \n"
"Language-Team: Polish <kde-i18n-doc@kde.org>\n"
......@@ -702,6 +702,15 @@ msgstr "Katalog bazowy QML"
msgid "Encode as URL"
msgstr "Wyświetlaj pasek stanu"
msgid "--- separator ---"
msgstr "--- separator ---"
msgid "Begin of submenu"
msgstr "Początek podmenu"
msgid "End of submenu"
msgstr "Koniec podmenu"
msgid "Confirm"
msgstr "Potwierdź"
......
......@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2011-01-15 17:41+0100\n"
"Last-Translator: \n"
"Language-Team: Russian <kde-i18n-doc@kde.org>\n"
......@@ -702,6 +702,15 @@ msgstr "Основной каталог QML"
msgid "Encode as URL"
msgstr "Кодировать URL"
msgid "--- separator ---"
msgstr "--- разделитель ---"
msgid "Begin of submenu"
msgstr "Начните из подменю"
msgid "End of submenu"
msgstr "Конец подменю"
msgid "Confirm"
msgstr "Подтверждение"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2011-04-26 23:41+0200\n"
"Last-Translator: Mladen Pejaković <pejakm@gmail.com>\n"
"Language-Team: Serbian <kde-i18n-sr@lists.kde.org>\n"
......@@ -700,6 +700,15 @@ msgstr "Основна фасцикла QML"
msgid "Encode as URL"
msgstr "Кодирај као УРЛ"
msgid "--- separator ---"
msgstr "--- раздвајач ---"
msgid "Begin of submenu"
msgstr "Почетак Подмени"
msgid "End of submenu"
msgstr "Крај подмени"
msgid "Confirm"
msgstr "Потврди"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2011-04-26 23:41+0200\n"
"Last-Translator: Mladen Pejaković <pejakm@gmail.com>\n"
"Language-Team: Serbian <kde-i18n-sr@lists.kde.org>\n"
......@@ -700,6 +700,15 @@ msgstr "Основна фасцикла QML"
msgid "Encode as URL"
msgstr "Кодирај као УРЛ"
msgid "--- separator ---"
msgstr "--- раздвајач ---"
msgid "Begin of submenu"
msgstr "Почетак Подмени"
msgid "End of submenu"
msgstr "Крај подмени"
msgid "Confirm"
msgstr "Потврди"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2011-04-26 23:41+0200\n"
"Last-Translator: Mladen Pejaković <pejakm@gmail.com>\n"
"Language-Team: Serbian <kde-i18n-sr@lists.kde.org>\n"
......@@ -700,6 +700,15 @@ msgstr "Osnovna fascikla QML"
msgid "Encode as URL"
msgstr "Kodiraj kao URL"
msgid "--- separator ---"
msgstr "--- razdvajač ---"
msgid "Begin of submenu"
msgstr "Podmeni početak"
msgid "End of submenu"
msgstr "Kraj podmeni"
msgid "Confirm"
msgstr "Potvrdi"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2011-04-26 23:41+0200\n"
"Last-Translator: Mladen Pejaković <pejakm@gmail.com>\n"
"Language-Team: Serbian <kde-i18n-sr@lists.kde.org>\n"
......@@ -700,6 +700,15 @@ msgstr "Osnovna fascikla QML"
msgid "Encode as URL"
msgstr "Kodiraj kao URL"
msgid "--- separator ---"
msgstr "--- razdvajač ---"
msgid "Begin of submenu"
msgstr "Podmeni početak"
msgid "End of submenu"
msgstr "Kraj podmeni"
msgid "Confirm"
msgstr "Potvrdi"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2011-01-15 17:42+0100\n"
"Last-Translator: \n"
"Language-Team: Turkish <kde-i18n-doc@kde.org>\n"
......@@ -700,6 +700,15 @@ msgstr "Temel Dizini QML"
msgid "Encode as URL"
msgstr ""
msgid "--- separator ---"
msgstr "--- ayraç ---"
msgid "Begin of submenu"
msgstr "Alt menü başlangıcı"
msgid "End of submenu"
msgstr "Alt menü sonu"
msgid "Confirm"
msgstr "Onayla"
......
......@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2014-08-24 15:11+0800\n"
"Last-Translator: shlinux <lishaohui.qd@163.com>\n"
"Language-Team: Chinese Simplified <kde-china@kde.org>\n"
......@@ -699,6 +699,15 @@ msgstr "QML 础文件夹"
msgid "Encode as URL"
msgstr "编码成网址"
msgid "--- separator ---"
msgstr "分隔線"
msgid "Begin of submenu"
msgstr "子菜单起点"
msgid "End of submenu"
msgstr "子菜单結束"
msgid "Confirm"
msgstr "确认"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Kid3 3.2.1\n"
"Report-Msgid-Bugs-To: http://sourceforge.net/p/kid3/bugs/\n"
"POT-Creation-Date: 2015-08-11 21:22+0200\n"
"POT-Creation-Date: 2015-08-13 18:29+0200\n"
"PO-Revision-Date: 2011-01-15 17:43+0100\n"
"Last-Translator: \n"
"Language-Team: Chinese (traditional) <kde-i18n-doc@kde.org>\n"
......@@ -703,6 +703,15 @@ msgstr "QML 底層目錄"
msgid "Encode as URL"
msgstr "編碼成網址"
msgid "--- separator ---"
msgstr "分隔器"
msgid "Begin of submenu"
msgstr "子選單開始"
msgid "End of submenu"
msgstr "子選單结束"
msgid "Confirm"
msgstr "確認"
......
......@@ -98,24 +98,34 @@ void UserActionsConfig::readFromConfig(ISettings* config)
config->endGroup();
if (cmdNr == 1) {
#ifdef Q_OS_WIN32
QString prgDir = QString::fromLocal8Bit(qgetenv("ProgramFiles"));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(
QLatin1String("Windows Media Player"),
QLatin1Char('"') + prgDir + QLatin1String("\\Windows Media Player\\wmplayer.exe\" %{files}")));
#elif !defined Q_OS_MAC
UserActionsConfig::MenuCommand(QString(), QLatin1String("@separator")));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("Amarok"), QLatin1String("amarok %{files}")));
UserActionsConfig::MenuCommand(QLatin1String("Album Art"), QLatin1String("@beginmenu")));
#ifdef HAVE_QML
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("Resize Album Art"), QLatin1String("@qml %{qmlpath}/script/ResizeAlbumArt.qml"), false, true));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("Extract Album Art"), QLatin1String("@qml %{qmlpath}/script/ExtractAlbumArt.qml"), false, true));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("Embed Album Art"), QLatin1String("@qml %{qmlpath}/script/EmbedAlbumArt.qml"), false, true));
#endif
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("Google Images"), QLatin1String("%{browser} http://www.google.com/search?tbm=isch&q=%u{artist}%20%u{album}")));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("Amazon"), QLatin1String("%{browser} http://www.amazon.com/s?search-alias=aps&field-keywords=%u{artist}+%u{album}")));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QString(), QLatin1String("@endmenu")));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("Lyrics"), QLatin1String("@beginmenu")));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("LyricWiki"), QLatin1String("%{browser} http://lyricwiki.org/%u{artist}:%u{title}")));
#ifdef HAVE_QML
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("Embed Lyrics"), QLatin1String("@qml %{qmlpath}/script/EmbedLyrics.qml"), false, true));
#endif
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("Lyrics.com"), QLatin1String("%{browser} http://www.lyrics.com/search.php?keyword=%u{artist}+%u{title}&what=all")));
UserActionsConfig::MenuCommand(QLatin1String("Lyrics.com"), QLatin1String("%{browser} http://www.lyrics.com/search.php?what=all&keyword=%u{artist}+%u{title}")));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("AZLyrics"), QLatin1String("%{browser} http://search.azlyrics.com/search.php?q=%u{artist}+%u{title}")));
m_contextMenuCommands.push_back(
......@@ -124,39 +134,29 @@ void UserActionsConfig::readFromConfig(ISettings* config)
UserActionsConfig::MenuCommand(QLatin1String("Metro Lyrics"), QLatin1String("%{browser} http://www.metrolyrics.com/search.php?category=artisttitle&search=%u{artist}+%u{title}")));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("SongLyrics"), QLatin1String("%{browser} http://www.songlyrics.com/index.php?section=search&searchW=%u{artist}+%u{title}")));
}
if (ConfigStore::getConfigVersion() < 1) {
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("LyricsMode"), QLatin1String("%{browser} http://www.lyricsmode.com/search.php?search=%u{artist}+%u{title}")));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("Lyrster"), QLatin1String("%{browser} http://www.lyrster.com/songs-lyrics/%u{artist}+%u{title}")));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("MP3 Lyrics"), QLatin1String("%{browser} http://www.mp3lyrics.org/Search/%u{artist}+%u{title}")));
UserActionsConfig::MenuCommand(QLatin1String("MP3 Lyrics"), QLatin1String("%{browser} http://mp3lyrics.com/Search/Advanced/?Track=%u{title}&Artist=%u{artist}")));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("LRC123"), QLatin1String("%{browser} http://www.lrc123.com/?keyword=%u{artist}+%u{title}&field=all")));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("LyrDB LRC"), QLatin1String("%{browser} http://lyrdb.com/karaoke/index.htm?q=%u{artist}+%u{title}&action=search")));
}
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QString(), QLatin1String("@endmenu")));
#ifdef HAVE_QML
if (ConfigStore::getConfigVersion() < 2) {
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("QML Console"), QLatin1String("@qmlview %{qmlpath}/script/QmlConsole.qml"), false, true));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("ReplayGain to SoundCheck"), QLatin1String("@qml %{qmlpath}/script/ReplayGain2SoundCheck.qml"), false, true));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("Resize Album Art"), QLatin1String("@qml %{qmlpath}/script/ResizeAlbumArt.qml"), false, true));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("Extract Album Art"), QLatin1String("@qml %{qmlpath}/script/ExtractAlbumArt.qml"), false, true));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("Embed Album Art"), QLatin1String("@qml %{qmlpath}/script/EmbedAlbumArt.qml"), false, true));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("Embed Lyrics"), QLatin1String("@qml %{qmlpath}/script/EmbedLyrics.qml"), false, true));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("Text Encoding ID3v1"), QLatin1String("@qml %{qmlpath}/script/ShowTextEncodingV1.qml"), false, true));
m_contextMenuCommands.push_back(
UserActionsConfig::MenuCommand(QLatin1String("Export CSV"), QLatin1String("@qml %{qmlpath}/script/ExportCsv.qml %{directory}/export.csv"), false, true));
}
#endif
}
}
void UserActionsConfig::setContextMenuCommands(const QList<MenuCommand>& contextMenuCommands)
......
......@@ -179,6 +179,18 @@ QString CommandFormatReplacer::getToolTip(bool onlyRows)
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Encode as URL"));
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td></td><td>@separator</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "--- separator ---"));
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td></td><td>@beginmenu</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "Begin of submenu"));
str += QLatin1String("</td></tr>\n");
str += QLatin1String("<tr><td></td><td>@endmenu</td><td>");
str += QCoreApplication::translate("@default", QT_TRANSLATE_NOOP("@default", "End of submenu"));
str += QLatin1String("</td></tr>\n");
if (!onlyRows) str += QLatin1String("</table>\n");
return str;
}
......@@ -287,7 +287,9 @@ QList<UserActionsConfig::MenuCommand> CommandsTableModel::getCommandList() const
for (QList<UserActionsConfig::MenuCommand>::const_iterator it = m_cmdList.constBegin();
it != m_cmdList.constEnd();
++it) {
if (!it->getName().isEmpty()) {
if (!it->getName().isEmpty() ||
it->getCommand() == QLatin1String("@separator") ||
it->getCommand() == QLatin1String("@endmenu")) {
cmdList.append(*it);
}
}
......
......@@ -104,6 +104,7 @@ void FileList::contextMenu(const QModelIndex& index, const QPoint& pos)
menu.addAction(tr("Open Containing &Folder"),
this, SLOT(openContainingFolder()));
int id = 0;
QMenu* userMenu = &menu;
QList<UserActionsConfig::MenuCommand> commands =
UserActionsConfig::instance().contextMenuCommands();
for (QList<UserActionsConfig::MenuCommand>::const_iterator
......@@ -112,7 +113,17 @@ void FileList::contextMenu(const QModelIndex& index, const QPoint& pos)
++it) {
QString name((*it).getName());
if (!name.isEmpty()) {
menu.addAction(name);
if (it->getCommand() == QLatin1String("@beginmenu")) {
userMenu = userMenu->addMenu(name);
} else {
userMenu->addAction(name);
}
} else if (it->getCommand() == QLatin1String("@separator")) {
userMenu->addSeparator();
} else if (it->getCommand() == QLatin1String("@endmenu")) {
if (QMenu* parentMenu = qobject_cast<QMenu*>(userMenu->parent())) {
userMenu = parentMenu;
}
}
++id;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment