Commit 4b53933f authored by Urs Fleisch's avatar Urs Fleisch
Browse files

Renamed Id3Form to Kid3Form, Kid3App to Kid3MainWindow.

parent e6a00dd6
......@@ -6,7 +6,7 @@ endif (HAVE_TAGLIB)
set(kid3_SRCS filelist.cpp fileproxymodel.cpp frame.cpp framelist.cpp
modeliterator.cpp taggedfileiconprovider.cpp comboboxdelegate.cpp
frametable.cpp frametablemodel.cpp genres.cpp id3form.cpp kid3.cpp main.cpp m4afile.cpp
frametable.cpp frametablemodel.cpp genres.cpp kid3form.cpp kid3mainwindow.cpp main.cpp m4afile.cpp
mp3file.cpp configdialog.cpp exportdialog.cpp formatconfig.cpp formatbox.cpp
importdialog.cpp importparser.cpp generalconfig.cpp
importconfig.cpp miscconfig.cpp freedbconfig.cpp
......@@ -111,7 +111,7 @@ if (UNIX AND NOT APPLE)
endif (UNIX AND NOT APPLE)
# Run moc on Q_OBJECT header files
set(kid3_MOC_HDRS filelist.h frametable.h frametablemodel.h id3form.h kid3.h configdialog.h
set(kid3_MOC_HDRS filelist.h frametable.h frametablemodel.h kid3form.h kid3mainwindow.h configdialog.h
exportdialog.h formatbox.h importdialog.h rendirdialog.h
musicbrainzdialog.h musicbrainzclient.h numbertracksdialog.h
serverimportdialog.h importclient.h serverimporter.h externalprocess.h stringlistedit.h
......
......@@ -28,7 +28,7 @@
#include <QRegExp>
#include <QDomDocument>
#include "trackdatamodel.h"
#include "kid3.h"
#include "kid3mainwindow.h"
/**
......@@ -77,7 +77,7 @@ const char* AmazonImporter::defaultServer() const { return "www.amazon.com:80";
const char* AmazonImporter::helpAnchor() const { return "import-amazon"; }
/** configuration, 0 if not used */
ServerImporterConfig* AmazonImporter::config() const { return &Kid3App::s_amazonCfg; }
ServerImporterConfig* AmazonImporter::config() const { return &Kid3MainWindow::s_amazonCfg; }
/** additional tags option, false if not used */
bool AmazonImporter::additionalTags() const { return true; }
......
......@@ -25,7 +25,7 @@
*/
#include "browsecoverartdialog.h"
#include "kid3.h"
#include "kid3mainwindow.h"
#include "externalprocess.h"
#include "configtable.h"
#include "configtablemodel.h"
......@@ -204,7 +204,7 @@ void BrowseCoverArtDialog::showPreview()
QString txt("<p><b>");
txt += i18n("Click Browse to start");
txt += "</b></p><p><tt>";
txt += Kid3App::s_miscCfg.m_browser;
txt += Kid3MainWindow::s_miscCfg.m_browser;
txt += " ";
txt += m_url;
txt += "</tt></p><p><b>";
......@@ -234,11 +234,11 @@ void BrowseCoverArtDialog::setFrames(const FrameCollection& frames)
*/
void BrowseCoverArtDialog::setSourceFromConfig()
{
m_urls = Kid3App::s_genCfg.m_pictureSourceUrls;
m_urls = Kid3MainWindow::s_genCfg.m_pictureSourceUrls;
m_sourceComboBox->clear();
m_sourceComboBox->addItems(Kid3App::s_genCfg.m_pictureSourceNames);
m_sourceComboBox->setCurrentIndex(Kid3App::s_genCfg.m_pictureSourceIdx);
setSourceLineEdit(Kid3App::s_genCfg.m_pictureSourceIdx);
m_sourceComboBox->addItems(Kid3MainWindow::s_genCfg.m_pictureSourceNames);
m_sourceComboBox->setCurrentIndex(Kid3MainWindow::s_genCfg.m_pictureSourceIdx);
setSourceLineEdit(Kid3MainWindow::s_genCfg.m_pictureSourceIdx);
}
/**
......@@ -247,12 +247,12 @@ void BrowseCoverArtDialog::setSourceFromConfig()
void BrowseCoverArtDialog::readConfig()
{
setSourceFromConfig();
m_matchUrlTableModel->setMap(Kid3App::s_genCfg.m_matchPictureUrlMap);
m_matchUrlTableModel->setMap(Kid3MainWindow::s_genCfg.m_matchPictureUrlMap);
if (Kid3App::s_genCfg.m_browseCoverArtWindowWidth > 0 &&
Kid3App::s_genCfg.m_browseCoverArtWindowHeight > 0) {
resize(Kid3App::s_genCfg.m_browseCoverArtWindowWidth,
Kid3App::s_genCfg.m_browseCoverArtWindowHeight);
if (Kid3MainWindow::s_genCfg.m_browseCoverArtWindowWidth > 0 &&
Kid3MainWindow::s_genCfg.m_browseCoverArtWindowHeight > 0) {
resize(Kid3MainWindow::s_genCfg.m_browseCoverArtWindowWidth,
Kid3MainWindow::s_genCfg.m_browseCoverArtWindowHeight);
}
}
......@@ -261,22 +261,22 @@ void BrowseCoverArtDialog::readConfig()
*/
void BrowseCoverArtDialog::saveConfig()
{
Kid3App::s_genCfg.m_pictureSourceIdx = m_sourceComboBox->currentIndex();
if (Kid3App::s_genCfg.m_pictureSourceIdx <
static_cast<int>(Kid3App::s_genCfg.m_pictureSourceNames.size())) {
Kid3App::s_genCfg.m_pictureSourceNames[Kid3App::s_genCfg.m_pictureSourceIdx] =
Kid3MainWindow::s_genCfg.m_pictureSourceIdx = m_sourceComboBox->currentIndex();
if (Kid3MainWindow::s_genCfg.m_pictureSourceIdx <
static_cast<int>(Kid3MainWindow::s_genCfg.m_pictureSourceNames.size())) {
Kid3MainWindow::s_genCfg.m_pictureSourceNames[Kid3MainWindow::s_genCfg.m_pictureSourceIdx] =
m_sourceComboBox->currentText();
Kid3App::s_genCfg.m_pictureSourceUrls[Kid3App::s_genCfg.m_pictureSourceIdx] =
Kid3MainWindow::s_genCfg.m_pictureSourceUrls[Kid3MainWindow::s_genCfg.m_pictureSourceIdx] =
m_urlLineEdit->text();
} else {
Kid3App::s_genCfg.m_pictureSourceIdx =
Kid3App::s_genCfg.m_pictureSourceNames.size();
Kid3App::s_genCfg.m_pictureSourceNames.append(m_sourceComboBox->currentText());
Kid3App::s_genCfg.m_pictureSourceUrls.append(m_urlLineEdit->text());
Kid3MainWindow::s_genCfg.m_pictureSourceIdx =
Kid3MainWindow::s_genCfg.m_pictureSourceNames.size();
Kid3MainWindow::s_genCfg.m_pictureSourceNames.append(m_sourceComboBox->currentText());
Kid3MainWindow::s_genCfg.m_pictureSourceUrls.append(m_urlLineEdit->text());
}
Kid3App::s_genCfg.m_matchPictureUrlMap = m_matchUrlTableModel->getMap();
Kid3App::s_genCfg.m_browseCoverArtWindowWidth = size().width();
Kid3App::s_genCfg.m_browseCoverArtWindowHeight = size().height();
Kid3MainWindow::s_genCfg.m_matchPictureUrlMap = m_matchUrlTableModel->getMap();
Kid3MainWindow::s_genCfg.m_browseCoverArtWindowWidth = size().width();
Kid3MainWindow::s_genCfg.m_browseCoverArtWindowHeight = size().height();
setSourceFromConfig();
}
......@@ -286,7 +286,7 @@ void BrowseCoverArtDialog::saveConfig()
*/
void BrowseCoverArtDialog::showHelp()
{
Kid3App::displayHelp("browse_pictures");
Kid3MainWindow::displayHelp("browse_pictures");
}
/**
......@@ -300,7 +300,7 @@ void BrowseCoverArtDialog::accept()
if (m_process) {
m_process->launchCommand(
i18n("Browse Cover Art"),
QStringList() << Kid3App::s_miscCfg.m_browser << m_url);
QStringList() << Kid3MainWindow::s_miscCfg.m_browser << m_url);
}
QDialog::accept();
}
......@@ -325,8 +325,8 @@ QString BrowseCoverArtDialog::getImageUrl(const QString& url)
}
else {
for (QMap<QString, QString>::ConstIterator it =
Kid3App::s_genCfg.m_matchPictureUrlMap.begin();
it != Kid3App::s_genCfg.m_matchPictureUrlMap.end();
Kid3MainWindow::s_genCfg.m_matchPictureUrlMap.begin();
it != Kid3MainWindow::s_genCfg.m_matchPictureUrlMap.end();
++it) {
QRegExp re(it.key());
if (re.exactMatch(url)) {
......
......@@ -57,7 +57,7 @@
#include "stringlistedit.h"
#include "configtable.h"
#include "commandstablemodel.h"
#include "kid3.h"
#include "kid3mainwindow.h"
enum { TextEncodingV1Latin1Index = 13 };
......@@ -631,7 +631,7 @@ void ConfigDialog::getConfig(FormatConfig* fnCfg,
*/
void ConfigDialog::slotHelp()
{
Kid3App::displayHelp("configure-kid3");
Kid3MainWindow::displayHelp("configure-kid3");
}
#ifndef CONFIG_USE_KDE
......
......@@ -27,7 +27,7 @@
#include "discogsimporter.h"
#include "serverimporterconfig.h"
#include "trackdatamodel.h"
#include "kid3.h"
#include "kid3mainwindow.h"
#include "genres.h"
static const char discogsServer[] = "www.discogs.com:80";
......@@ -62,7 +62,7 @@ QString DiscogsImporter::name() const { return "Discogs"; }
const char* DiscogsImporter::helpAnchor() const { return "import-discogs"; }
/** configuration, 0 if not used */
ServerImporterConfig* DiscogsImporter::config() const { return &Kid3App::s_discogsCfg; }
ServerImporterConfig* DiscogsImporter::config() const { return &Kid3MainWindow::s_discogsCfg; }
/** additional tags option, false if not used */
bool DiscogsImporter::additionalTags() const { return true; }
......
......@@ -25,7 +25,7 @@
*/
#include "editframefieldsdialog.h"
#include "kid3.h"
#include "kid3mainwindow.h"
#include "imageviewer.h"
#include "taggedfile.h"
#include <QPushButton>
......@@ -578,12 +578,12 @@ void BinaryOpenSave::loadData()
{
#ifdef CONFIG_USE_KDE
QString loadfilename = KFileDialog::getOpenFileName(
m_defaultDir.isEmpty() ? Kid3App::getDirName() : m_defaultDir,
m_defaultDir.isEmpty() ? Kid3MainWindow::getDirName() : m_defaultDir,
QString::null, this);
#else
QString loadfilename = QFileDialog::getOpenFileName(
this, QString(),
m_defaultDir.isEmpty() ? Kid3App::getDirName() : m_defaultDir
m_defaultDir.isEmpty() ? Kid3MainWindow::getDirName() : m_defaultDir
#if !defined Q_OS_WIN32 && !defined Q_OS_MAC
, QString(), 0, QFileDialog::DontUseNativeDialog
#endif
......@@ -611,7 +611,7 @@ void BinaryOpenSave::loadData()
*/
void BinaryOpenSave::saveData()
{
QString dir = m_defaultDir.isEmpty() ? Kid3App::getDirName() : m_defaultDir;
QString dir = m_defaultDir.isEmpty() ? Kid3MainWindow::getDirName() : m_defaultDir;
if (!m_defaultFile.isEmpty()) {
QChar separator = QDir::separator();
if (!dir.endsWith(separator)) {
......
......@@ -35,7 +35,7 @@
#include "taggedfile.h"
#include "genres.h"
#include "kid3.h"
#include "kid3mainwindow.h"
#include <QLayout>
#include <QPushButton>
#include <QLabel>
......@@ -186,7 +186,7 @@ bool ExportDialog::exportToFile(const QString& fn)
if (!fn.isEmpty()) {
QFile file(fn);
if (file.open(QIODevice::WriteOnly)) {
Kid3App::s_genCfg.m_importDir = QFileInfo(file).dir().path();
Kid3MainWindow::s_genCfg.m_importDir = QFileInfo(file).dir().path();
QTextStream stream(&file);
stream << m_edit->toPlainText();
file.close();
......@@ -203,10 +203,10 @@ void ExportDialog::slotToFile()
{
QString fileName =
#ifdef CONFIG_USE_KDE
KFileDialog::getSaveFileName(Kid3App::s_genCfg.m_importDir,
KFileDialog::getSaveFileName(Kid3MainWindow::s_genCfg.m_importDir,
QString::null, this);
#else
QFileDialog::getSaveFileName(this, QString(), Kid3App::s_genCfg.m_importDir
QFileDialog::getSaveFileName(this, QString(), Kid3MainWindow::s_genCfg.m_importDir
#if !defined Q_OS_WIN32 && !defined Q_OS_MAC
, QString(), 0, QFileDialog::DontUseNativeDialog
#endif
......@@ -296,13 +296,13 @@ void ExportDialog::setExportData(const ImportTrackDataVector& trackDataVector)
*/
void ExportDialog::setFormatFromConfig()
{
m_formatHeaders = Kid3App::s_genCfg.m_exportFormatHeaders;
m_formatTracks = Kid3App::s_genCfg.m_exportFormatTracks;
m_formatTrailers = Kid3App::s_genCfg.m_exportFormatTrailers;
m_formatHeaders = Kid3MainWindow::s_genCfg.m_exportFormatHeaders;
m_formatTracks = Kid3MainWindow::s_genCfg.m_exportFormatTracks;
m_formatTrailers = Kid3MainWindow::s_genCfg.m_exportFormatTrailers;
m_formatComboBox->clear();
m_formatComboBox->addItems(Kid3App::s_genCfg.m_exportFormatNames);
m_formatComboBox->setCurrentIndex(Kid3App::s_genCfg.m_exportFormatIdx);
setFormatLineEdit(Kid3App::s_genCfg.m_exportFormatIdx);
m_formatComboBox->addItems(Kid3MainWindow::s_genCfg.m_exportFormatNames);
m_formatComboBox->setCurrentIndex(Kid3MainWindow::s_genCfg.m_exportFormatIdx);
setFormatLineEdit(Kid3MainWindow::s_genCfg.m_exportFormatIdx);
}
/**
......@@ -310,14 +310,14 @@ void ExportDialog::setFormatFromConfig()
*/
void ExportDialog::readConfig()
{
m_srcComboBox->setCurrentIndex(Kid3App::s_genCfg.m_exportSrcV1 ? SrcV1 : SrcV2);
m_srcComboBox->setCurrentIndex(Kid3MainWindow::s_genCfg.m_exportSrcV1 ? SrcV1 : SrcV2);
setFormatFromConfig();
if (Kid3App::s_genCfg.m_exportWindowWidth > 0 &&
Kid3App::s_genCfg.m_exportWindowHeight > 0) {
resize(Kid3App::s_genCfg.m_exportWindowWidth,
Kid3App::s_genCfg.m_exportWindowHeight);
if (Kid3MainWindow::s_genCfg.m_exportWindowWidth > 0 &&
Kid3MainWindow::s_genCfg.m_exportWindowHeight > 0) {
resize(Kid3MainWindow::s_genCfg.m_exportWindowWidth,
Kid3MainWindow::s_genCfg.m_exportWindowHeight);
}
}
......@@ -326,22 +326,22 @@ void ExportDialog::readConfig()
*/
void ExportDialog::saveConfig()
{
Kid3App::s_genCfg.m_exportSrcV1 = (m_srcComboBox->currentIndex() == SrcV1);
Kid3App::s_genCfg.m_exportFormatIdx = m_formatComboBox->currentIndex();
if (Kid3App::s_genCfg.m_exportFormatIdx < static_cast<int>(Kid3App::s_genCfg.m_exportFormatNames.size())) {
Kid3App::s_genCfg.m_exportFormatNames[Kid3App::s_genCfg.m_exportFormatIdx] = m_formatComboBox->currentText();
Kid3App::s_genCfg.m_exportFormatHeaders[Kid3App::s_genCfg.m_exportFormatIdx] = m_headerLineEdit->text();
Kid3App::s_genCfg.m_exportFormatTracks[Kid3App::s_genCfg.m_exportFormatIdx] = m_trackLineEdit->text();
Kid3App::s_genCfg.m_exportFormatTrailers[Kid3App::s_genCfg.m_exportFormatIdx] = m_trailerLineEdit->text();
Kid3MainWindow::s_genCfg.m_exportSrcV1 = (m_srcComboBox->currentIndex() == SrcV1);
Kid3MainWindow::s_genCfg.m_exportFormatIdx = m_formatComboBox->currentIndex();
if (Kid3MainWindow::s_genCfg.m_exportFormatIdx < static_cast<int>(Kid3MainWindow::s_genCfg.m_exportFormatNames.size())) {
Kid3MainWindow::s_genCfg.m_exportFormatNames[Kid3MainWindow::s_genCfg.m_exportFormatIdx] = m_formatComboBox->currentText();
Kid3MainWindow::s_genCfg.m_exportFormatHeaders[Kid3MainWindow::s_genCfg.m_exportFormatIdx] = m_headerLineEdit->text();
Kid3MainWindow::s_genCfg.m_exportFormatTracks[Kid3MainWindow::s_genCfg.m_exportFormatIdx] = m_trackLineEdit->text();
Kid3MainWindow::s_genCfg.m_exportFormatTrailers[Kid3MainWindow::s_genCfg.m_exportFormatIdx] = m_trailerLineEdit->text();
} else {
Kid3App::s_genCfg.m_exportFormatIdx = Kid3App::s_genCfg.m_exportFormatNames.size();
Kid3App::s_genCfg.m_exportFormatNames.append(m_formatComboBox->currentText());
Kid3App::s_genCfg.m_exportFormatHeaders.append(m_headerLineEdit->text());
Kid3App::s_genCfg.m_exportFormatTracks.append(m_trackLineEdit->text());
Kid3App::s_genCfg.m_exportFormatTrailers.append(m_trailerLineEdit->text());
Kid3MainWindow::s_genCfg.m_exportFormatIdx = Kid3MainWindow::s_genCfg.m_exportFormatNames.size();
Kid3MainWindow::s_genCfg.m_exportFormatNames.append(m_formatComboBox->currentText());
Kid3MainWindow::s_genCfg.m_exportFormatHeaders.append(m_headerLineEdit->text());
Kid3MainWindow::s_genCfg.m_exportFormatTracks.append(m_trackLineEdit->text());
Kid3MainWindow::s_genCfg.m_exportFormatTrailers.append(m_trailerLineEdit->text());
}
Kid3App::s_genCfg.m_exportWindowWidth = size().width();
Kid3App::s_genCfg.m_exportWindowHeight = size().height();
Kid3MainWindow::s_genCfg.m_exportWindowWidth = size().width();
Kid3MainWindow::s_genCfg.m_exportWindowHeight = size().height();
setFormatFromConfig();
}
......@@ -351,5 +351,5 @@ void ExportDialog::saveConfig()
*/
void ExportDialog::showHelp()
{
Kid3App::displayHelp("export");
Kid3MainWindow::displayHelp("export");
}
......@@ -34,7 +34,7 @@
#include "fileproxymodel.h"
#include "modeliterator.h"
#include "taggedfile.h"
#include "kid3.h"
#include "kid3mainwindow.h"
#include "externalprocess.h"
#include "qtcompatmac.h"
......@@ -166,7 +166,7 @@ QString CommandFormatReplacer::getReplacement(const QString& code) const
}
}
} else if (name == "browser") {
result = Kid3App::s_miscCfg.m_browser;
result = Kid3MainWindow::s_miscCfg.m_browser;
} else if (name == "url") {
if (!m_files.empty()) {
QUrl url;
......@@ -235,8 +235,8 @@ QString CommandFormatReplacer::getToolTip(bool onlyRows)
* @param parent parent widget
* @param app application widget
*/
FileList::FileList(QWidget* parent, Kid3App* app) :
QTreeView(parent), m_process(0), m_app(app)
FileList::FileList(QWidget* parent, Kid3MainWindow* app) :
QTreeView(parent), m_process(0), m_mainWin(app)
{
setSelectionMode(ExtendedSelection);
setSortingEnabled(false);
......@@ -404,19 +404,19 @@ void FileList::updateCurrentSelection()
*/
void FileList::contextMenu(const QModelIndex& index, const QPoint& pos)
{
if (index.isValid() && !Kid3App::s_miscCfg.m_contextMenuCommands.empty()) {
if (index.isValid() && !Kid3MainWindow::s_miscCfg.m_contextMenuCommands.empty()) {
QMenu menu(this);
menu.addAction(i18n("&Expand all"), this, SLOT(expandAll()));
menu.addAction(i18n("&Collapse all"), this, SLOT(collapseAll()));
menu.addAction(i18n("&Rename"), m_app, SLOT(renameFile()));
menu.addAction(i18n("&Delete"), m_app, SLOT(deleteFile()));
menu.addAction(i18n("&Rename"), m_mainWin, SLOT(renameFile()));
menu.addAction(i18n("&Delete"), m_mainWin, SLOT(deleteFile()));
#ifdef HAVE_PHONON
menu.addAction(i18n("&Play"), m_app, SLOT(slotPlayAudio()));
menu.addAction(i18n("&Play"), m_mainWin, SLOT(slotPlayAudio()));
#endif
int id = 0;
for (QList<MiscConfig::MenuCommand>::const_iterator
it = Kid3App::s_miscCfg.m_contextMenuCommands.begin();
it != Kid3App::s_miscCfg.m_contextMenuCommands.end();
it = Kid3MainWindow::s_miscCfg.m_contextMenuCommands.begin();
it != Kid3MainWindow::s_miscCfg.m_contextMenuCommands.end();
++it) {
menu.addAction((*it).getName());
++id;
......@@ -532,9 +532,9 @@ QString FileList::getFormatToolTip(bool onlyRows)
*/
void FileList::executeContextCommand(int id)
{
if (id < static_cast<int>(Kid3App::s_miscCfg.m_contextMenuCommands.size())) {
if (id < static_cast<int>(Kid3MainWindow::s_miscCfg.m_contextMenuCommands.size())) {
QStringList args;
const MiscConfig::MenuCommand& menuCmd = Kid3App::s_miscCfg.m_contextMenuCommands[id];
const MiscConfig::MenuCommand& menuCmd = Kid3MainWindow::s_miscCfg.m_contextMenuCommands[id];
QString cmd = menuCmd.getCommand();
int len = cmd.length();
......@@ -590,8 +590,8 @@ void FileList::executeAction(QAction* action)
QString name = action->text().remove('&');
int id = 0;
for (QList<MiscConfig::MenuCommand>::const_iterator
it = Kid3App::s_miscCfg.m_contextMenuCommands.begin();
it != Kid3App::s_miscCfg.m_contextMenuCommands.end();
it = Kid3MainWindow::s_miscCfg.m_contextMenuCommands.begin();
it != Kid3MainWindow::s_miscCfg.m_contextMenuCommands.end();
++it) {
if (name == (*it).getName()) {
executeContextCommand(id);
......@@ -621,7 +621,7 @@ void FileList::playIfTaggedFile(const QModelIndex& index)
{
#ifdef HAVE_PHONON
if (FileProxyModel::getTaggedFileOfIndex(index)) {
m_app->slotPlayAudio();
m_mainWin->slotPlayAudio();
}
#endif
}
......@@ -30,7 +30,7 @@
#include <QTreeView>
#include <QList>
class Kid3App;
class Kid3MainWindow;
class ExternalProcess;
/**
......@@ -45,7 +45,7 @@ public:
* @param parent parent widget
* @param app application widget
*/
FileList(QWidget* parent, Kid3App* app);
FileList(QWidget* parent, Kid3MainWindow* app);
/**
* Destructor.
......@@ -199,7 +199,7 @@ private:
/** Process for context menu commands */
ExternalProcess* m_process;
QList<QPersistentModelIndex> m_currentSelection;
Kid3App* m_app;
Kid3MainWindow* m_mainWin;
};
#endif // FILELIST_H
......@@ -30,7 +30,7 @@
#include <kconfig.h>
#endif
#include "kid3.h"
#include "kid3mainwindow.h"
#include <QLayout>
#include <QPushButton>
#include <QLabel>
......@@ -156,12 +156,12 @@ void FilterDialog::setFilterLineEdit(int index)
*/
void FilterDialog::setFiltersFromConfig()
{
m_filterNames = Kid3App::s_filterCfg.m_filterNames;
m_filterExpressions = Kid3App::s_filterCfg.m_filterExpressions;
m_filterNames = Kid3MainWindow::s_filterCfg.m_filterNames;
m_filterExpressions = Kid3MainWindow::s_filterCfg.m_filterExpressions;
m_nameComboBox->clear();
m_nameComboBox->addItems(Kid3App::s_filterCfg.m_filterNames);
m_nameComboBox->setCurrentIndex(Kid3App::s_filterCfg.m_filterIdx);
setFilterLineEdit(Kid3App::s_filterCfg.m_filterIdx);
m_nameComboBox->addItems(Kid3MainWindow::s_filterCfg.m_filterNames);
m_nameComboBox->setCurrentIndex(Kid3MainWindow::s_filterCfg.m_filterIdx);
setFilterLineEdit(Kid3MainWindow::s_filterCfg.m_filterIdx);
}
/**
......@@ -175,10 +175,10 @@ void FilterDialog::readConfig()
setFiltersFromConfig();
if (Kid3App::s_filterCfg.m_windowWidth > 0 &&
Kid3App::s_filterCfg.m_windowHeight > 0) {
resize(Kid3App::s_filterCfg.m_windowWidth,
Kid3App::s_filterCfg.m_windowHeight);
if (Kid3MainWindow::s_filterCfg.m_windowWidth > 0 &&
Kid3MainWindow::s_filterCfg.m_windowHeight > 0) {
resize(Kid3MainWindow::s_filterCfg.m_windowWidth,
Kid3MainWindow::s_filterCfg.m_windowHeight);
}
}
......@@ -187,21 +187,21 @@ void FilterDialog::readConfig()
*/
void FilterDialog::saveConfig()
{
Kid3App::s_filterCfg.m_filterIdx = m_nameComboBox->currentIndex();
if (Kid3App::s_filterCfg.m_filterIdx <
static_cast<int>(Kid3App::s_filterCfg.m_filterNames.size())) {
Kid3App::s_filterCfg.m_filterNames[Kid3App::s_filterCfg.m_filterIdx] =
Kid3MainWindow::s_filterCfg.m_filterIdx = m_nameComboBox->currentIndex();
if (Kid3MainWindow::s_filterCfg.m_filterIdx <
static_cast<int>(Kid3MainWindow::s_filterCfg.m_filterNames.size())) {
Kid3MainWindow::s_filterCfg.m_filterNames[Kid3MainWindow::s_filterCfg.m_filterIdx] =
m_nameComboBox->currentText();
Kid3App::s_filterCfg.m_filterExpressions[Kid3App::s_filterCfg.m_filterIdx] =
Kid3MainWindow::s_filterCfg.m_filterExpressions[Kid3MainWindow::s_filterCfg.m_filterIdx] =
m_filterLineEdit->text();
} else {
Kid3App::s_filterCfg.m_filterIdx =
Kid3App::s_filterCfg.m_filterNames.size();
Kid3App::s_filterCfg.m_filterNames.append(m_nameComboBox->currentText());
Kid3App::s_filterCfg.m_filterExpressions.append(m_filterLineEdit->text());
Kid3MainWindow::s_filterCfg.m_filterIdx =
Kid3MainWindow::s_filterCfg.m_filterNames.size();
Kid3MainWindow::s_filterCfg.m_filterNames.append(m_nameComboBox->currentText());
Kid3MainWindow::s_filterCfg.m_filterExpressions.append(m_filterLineEdit->text());
}
Kid3App::s_filterCfg.m_windowWidth = size().width();
Kid3App::s_filterCfg.m_windowHeight = size().height();
Kid3MainWindow::s_filterCfg.m_windowWidth = size().width();
Kid3MainWindow::s_filterCfg.m_windowHeight = size().height();
setFiltersFromConfig();
}
......@@ -211,7 +211,7 @@ void FilterDialog::saveConfig()
*/
void FilterDialog::showHelp()
{
Kid3App::displayHelp("filter");
Kid3MainWindow::displayHelp("filter");
}
/**
......
......@@ -33,7 +33,7 @@
#include "frametablemodel.h"
#include "editframedialog.h"
#include "editframefieldsdialog.h"
#include "kid3.h"
#include "kid3mainwindow.h"
#include "qtcompatmac.h"
#ifdef CONFIG_USE_KDE
#include <kfiledialog.h>
......
......@@ -27,7 +27,7 @@
#include "frametablemodel.h"
#include <QApplication>
#include <QComboBox>
#include "kid3.h"
#include "kid3mainwindow.h"
#include "genres.h"
#include "qtcompatmac.h"
......@@ -116,7 +116,7 @@ QVariant FrameTableModel::data(const QModelIndex& index, int role) const
return m_frameSelected.at(index.row()) ? Qt::Checked : Qt::Unchecked;
} else if (role == Qt::BackgroundColorRole) {
if (index.column() == CI_Enable) {
return Kid3App::s_miscCfg.m_markChanges &&
return Kid3MainWindow::s_miscCfg.m_markChanges &&
(it->isValueChanged() ||
(static_cast<unsigned>((*it).getType()) < sizeof(m_changedFrames) * 8 &&
(m_changedFrames & (1 << (*it).getType())) != 0))
......@@ -541,9 +541,9 @@ FrameTableLineEdit::~FrameTableLineEdit() {}
*/
void FrameTableLineEdit::formatTextIfEnabled(const QString& txt)
{
if (Kid3App::s_id3FormatCfg.m_formatWhileEditing) {
if (Kid3MainWindow::s_id3FormatCfg.m_formatWhileEditing) {
QString str(txt);
Kid3App::s_id3FormatCfg.formatString(str);
Kid3MainWindow::s_id3FormatCfg.formatString(str);
if (str != txt) {
int curPos = cursorPosition();
setText(str);
......@@ -585,22 +585,22 @@ QWidget* FrameItemDelegate::createEditor(
for (const char** sl = Genres::s_strList; *sl != 0; ++sl) {
strList += *sl;
}
if (Kid3App::s_miscCfg.m_onlyCustomGenres) {
if (Kid3MainWindow::s_miscCfg.m_onlyCustomGenres) {
cb->addItem("");
} else {
cb->addItems(strList);
}
if (id3v1) {
for (QStringList::const_iterator it =
Kid3App::s_miscCfg.m_customGenres.begin();
it != Kid3App::s_miscCfg.m_customGenres.end();
Kid3MainWindow::s_miscCfg.m_customGenres.begin();
it != Kid3MainWindow::s_miscCfg.m_customGenres.end();
++it) {
if (Genres::getNumber(*it) != 255) {
cb->addItem(*it);
}
}
} else {
cb->addItems(Kid3App::s_miscCfg.m_customGenres);
cb->addItems(Kid3MainWindow::s_miscCfg.m_customGenres);
}
}
return cb;
......@@ -629,7 +629,7 @@ void FrameItemDelegate::setEditorData(
QString genreStr(index.model()->data(index).toString());
int genreIndex = genreStr.isNull() ? 0 :
Genres::getIndex(Genres::getNumber(genreStr));
if (Kid3App::s_miscCfg.m_onlyCustomGenres) {