aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2021-02-09 18:38:31 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2021-02-09 18:38:31 +0000
commitb255a52aa82a7045c8d5afde7c9225dd053daeaa (patch)
tree59cb2841b32572e21e52b8a2d298cff8e867924a /src/qmmpui
parent2639e99bd74d5d16504f3bdb57802c77053cb93b (diff)
downloadqmmp-b255a52aa82a7045c8d5afde7c9225dd053daeaa.tar.gz
qmmp-b255a52aa82a7045c8d5afde7c9225dd053daeaa.tar.bz2
qmmp-b255a52aa82a7045c8d5afde7c9225dd053daeaa.zip
cue editor: fixed read-only mode
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9712 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui')
-rw-r--r--src/qmmpui/cueeditor.cpp7
-rw-r--r--src/qmmpui/detailsdialog.cpp13
2 files changed, 14 insertions, 6 deletions
diff --git a/src/qmmpui/cueeditor.cpp b/src/qmmpui/cueeditor.cpp
index 60a3c9b4a..8366e5024 100644
--- a/src/qmmpui/cueeditor.cpp
+++ b/src/qmmpui/cueeditor.cpp
@@ -76,6 +76,13 @@ CueEditor::CueEditor(MetaDataModel *model, const TrackInfo &info, QWidget *paren
m_lastDir = settings.value("CueEditor/last_dir", QDir::homePath()).toString();
m_editable = m_model && (m_model->dialogHints() & MetaDataModel::IsCueEditable) && !m_model->isReadOnly();
new CueSyntaxHighlighter(m_ui->plainTextEdit->document());
+
+ if(!m_editable)
+ {
+ m_ui->deleteButton->setEnabled(false);
+ m_ui->loadButton->setEnabled(false);
+ m_ui->plainTextEdit->setReadOnly(true);
+ }
}
CueEditor::~CueEditor()
diff --git a/src/qmmpui/detailsdialog.cpp b/src/qmmpui/detailsdialog.cpp
index e9dd55352..caaed7a4d 100644
--- a/src/qmmpui/detailsdialog.cpp
+++ b/src/qmmpui/detailsdialog.cpp
@@ -249,12 +249,6 @@ void DetailsDialog::updatePage()
m_ui->tabWidget->addTab(coverEditor, tr("Cover"));
}
- if(m_metaDataModel && (m_metaDataModel->dialogHints() & MetaDataModel::IsCueEditable))
- {
- CueEditor *cueEditor = new CueEditor(m_metaDataModel, m_info, this);
- m_ui->tabWidget->addTab(cueEditor, "CUE");
- }
-
if(m_metaDataModel)
{
for(TagModel *tagModel : m_metaDataModel->tags())
@@ -271,7 +265,14 @@ void DetailsDialog::updatePage()
textEdit->setPlainText(item.value().toString());
m_ui->tabWidget->addTab(textEdit, item.name());
}
+
+ if(m_metaDataModel->dialogHints() & MetaDataModel::IsCueEditable)
+ {
+ CueEditor *cueEditor = new CueEditor(m_metaDataModel, m_info, this);
+ m_ui->tabWidget->addTab(cueEditor, "CUE");
+ }
}
+
printInfo();
}