Commit b99a5ea1 authored by Urs Fleisch's avatar Urs Fleisch
Browse files

Keyboard shortcuts configuration for Qt-only version.

parent 925301f2
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -79,7 +79,8 @@ sub getPoTranslations($)
return %trans;
}
# Set the translations in a .ts file replacing & by &amp;, < by &lt; and > by &gt;.
# Set the translations in a .ts file replacing & by &amp;, < by &lt;,
# > by &gt; and ' by &apos;.
sub setTsTranslations($$%)
{
my $infn = shift;
......@@ -111,12 +112,14 @@ sub setTsTranslations($$%)
$source =~ s/&amp;/&/g;
$source =~ s/&lt;/</g;
$source =~ s/&gt;/>/g;
$source =~ s/&apos;/'/g;
$source =~ s/\n/\\n/g;
if (exists $trans{$source}) {
$translation = $trans{$source};
$translation =~ s/&/&amp;/g;
$translation =~ s/</&lt;/g;
$translation =~ s/>/&gt;/g;
$translation =~ s/'/&apos;/g;
$translation =~ s/\\"/&quot;/g;
$translation =~ s/\\n/\n/g;
s/ type="unfinished"//;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -11,6 +11,9 @@ set(config_SRCS
config/musicbrainzconfig.cpp
config/playlistconfig.cpp
config/serverimporterconfig.cpp
config/shortcutsmodel.cpp
)
set(config_MOC_HDRS)
set(config_MOC_HDRS
config/shortcutsmodel.h
)
......@@ -26,6 +26,9 @@
#include "configstore.h"
#include "config.h"
#ifndef CONFIG_USE_KDE
#include "shortcutsmodel.h"
#endif
MiscConfig ConfigStore::s_miscCfg("General Options");
ImportConfig ConfigStore::s_genCfg("General Options");
......@@ -49,6 +52,7 @@ ConfigStore::ConfigStore()
#else
m_config = new Kid3Settings(QSettings::UserScope, "kid3.sourceforge.net", "Kid3");
m_config->beginGroup("/kid3");
m_shortcutsModel = new ShortcutsModel;
#endif
}
......@@ -57,6 +61,9 @@ ConfigStore::ConfigStore()
*/
ConfigStore::~ConfigStore()
{
#ifndef CONFIG_USE_KDE
delete m_shortcutsModel;
#endif
// m_config is not deleted because this could lead to a crash on Mac OS.
}
......
......@@ -38,6 +38,8 @@
#include "filterconfig.h"
#include "playlistconfig.h"
class ShortcutsModel;
/**
* Configuration storage.
*/
......@@ -69,6 +71,14 @@ public:
*/
Kid3Settings* getSettings() const { return m_config; }
#ifndef CONFIG_USE_KDE
/**
* Get keyboard shortcuts model.
* @return shortcuts model
*/
ShortcutsModel* getShortcutsModel() const { return m_shortcutsModel; }
#endif
/** Filename format configuration */
static FormatConfig s_fnFormatCfg;
/** ID3 format configuration */
......@@ -94,6 +104,9 @@ public:
private:
Kid3Settings* m_config;
#ifndef CONFIG_USE_KDE
ShortcutsModel* m_shortcutsModel;
#endif
};
#endif // CONFIGSTORE_H
This diff is collapsed.
This diff is collapsed.
......@@ -146,6 +146,12 @@ public:
*/
Kid3Settings* getSettings() const;
/**
* Get configuration.
* @return configuration.
*/
ConfigStore* getConfigStore() const { return m_configStore; }
/**
* Get download client.
* @return download client.
......
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