Crossfire Server, Trunk
SoundFilePanel.cpp
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2022 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #include "SoundFilePanel.h"
14 
15 SoundFilePanel::SoundFilePanel(QWidget *parent, AssetModel *model) : AssetSWrapperPanel(parent) {
16  addLabel(tr("Filename:"), "displayName");
17  addAssetUseTree(tr("Used by"), model, "self");
18  addWidget(tr("License information"), myLicense = new QTreeWidget(this), false, nullptr, nullptr);
19  myLicense->setColumnCount(2);
20  myLicense->setHeaderLabels(QStringList(tr("License field")) << tr("Value"));
21 }
22 
24  myLicense->clear();
25  for (auto license : myItem->license()) {
26  new QTreeWidgetItem(myLicense, QStringList(license.first.c_str()) << license.second.c_str());
27  }
28 }
SoundFilePanel::SoundFilePanel
SoundFilePanel(QWidget *parent, AssetModel *model)
Definition: SoundFilePanel.cpp:15
AssetSWrapperPanel< SoundFile >::myItem
SoundFile * myItem
Definition: AssetWrapperPanel.h:126
SoundFilePanel::updateItem
virtual void updateItem()
Definition: SoundFilePanel.cpp:23
SoundFile::license
std::vector< LicenseManager::LicenseItem > & license()
Definition: SoundFile.h:25
AssetWrapperPanel::addAssetUseTree
AssetUseTree * addAssetUseTree(const QString &label, AssetModel *assets, const char *property)
Definition: AssetWrapperPanel.cpp:150
AssetWrapperPanel::addLabel
QLabel * addLabel(const QString &label, const char *property, bool wrapText=false)
Definition: AssetWrapperPanel.cpp:68
SoundFilePanel::myLicense
QTreeWidget * myLicense
Definition: SoundFilePanel.h:30
AssetModel
Definition: AssetModel.h:29
AssetSWrapperPanel
Definition: AssetWrapperPanel.h:113
SoundFilePanel.h
AssetWrapperPanel::addWidget
T * addWidget(const QString &label, T *widget, bool sideBySide, const char *property, const char *widgetProperty)
Definition: AssetWrapperPanel.h:64