granatier
arenaselector.cpp
Go to the documentation of this file.
77 ArenaSelector::ArenaSelector(QWidget* parent, KConfigSkeleton* aconfig, QStringList* randomArenaModeArenaList, ArenaSelector::Options options, const QString& groupName, const QString& directory)
101 ArenaSelector::Private::Private(ArenaSelector* parent, Options options) : q(parent), m_options(options), m_arena(NULL), m_graphicsScene(NULL), m_svgScaleFactor(1)
155 KGlobal::dirs()->addResourceType("arenaselector", "data", KGlobal::mainComponent().componentName() + '/' + lookupDirectory + '/');
173 KGlobal::dirs()->findAllResources("arenaselector", "*.desktop", KStandardDirs::Recursive, arenasAvailable);
243 const QList<QListWidgetItem *> itemList = ui.arenaList->findItems(arenaSettings->arenaProperty("Name"), Qt::MatchExactly);
255 connect(ui.arenaList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), q, SLOT(_k_updatePreview(QListWidgetItem*)));
258 connect(ui.arenaList, SIGNAL(itemChanged(QListWidgetItem*)), q, SLOT(_k_updateRandomArenaModeArenaList(QListWidgetItem*)));
278 if(emailstr.compare("-") == 0) // the imported clanbomber arenas have a "-" if no email address was defined in the clanbomber arena file
287 ui.arenaAuthor->setText(i18nc("Author attribution, e.g. \"by Jack\"", "by %1", selArena->arenaProperty(authstr)));
312 ui.arenaPreview->setSceneRect(0, 0, m_arena->getNbColumns()*Granatier::CellSize, m_arena->getNbRows()*Granatier::CellSize);
329 int horizontalPixelsPerCell = (ui.arenaPreview->size().width() - 4) / (minSize.width()/Granatier::CellSize);
330 int verticalPixelsPerCell = (ui.arenaPreview->size().height() - 4) / (minSize.height()/Granatier::CellSize);
365 ArenaItem* arenaItem = new ArenaItem(j * Granatier::CellSize, i * Granatier::CellSize, m_renderer, "");
498 desktopFile.setFileName(QString("%1clanbomber_%2.desktop").arg(KStandardDirs::locateLocal("appdata", "arenas/")).arg(strName));
541 arenaFile.setFileName(QString("%1clanbomber_%2.xml").arg(KStandardDirs::locateLocal("appdata", "arenas/")).arg(strName));
547 streamArenaFile << "<Arena arenaFileVersion=\"1\" rowCount=\"" << arena.count() << "\" colCount=\"" << arena[0].count() << "\">\n";
564 disconnect(ui.arenaList, SIGNAL(itemChanged(QListWidgetItem*)), q, SLOT(_k_updateRandomArenaModeArenaList(QListWidgetItem*)));
597 connect(ui.arenaList, SIGNAL(itemChanged(QListWidgetItem*)), q, SLOT(_k_updateRandomArenaModeArenaList(QListWidgetItem*)));
Definition: granatierglobals.h:74
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
Definition: granatierglobals.h:77
void setHeight(int height)
QString & append(QChar ch)
Qt::CheckState checkState() const
This class handles XML reader events in order to initialize the Arena properties. ...
Definition: mapparser.h:30
Definition: granatierglobals.h:80
bool contains(const QString &str, Qt::CaseSensitivity cs) const
QString & remove(int position, int n)
Qt::ItemFlags flags() const
QString homePath()
void setHeight(qreal height)
void clear()
int count(const T &value) const
void append(const T &value)
Definition: granatierglobals.h:82
QString & insert(int position, QChar ch)
QTransform & scale(qreal sx, qreal sy)
ArenaSelector(QWidget *parent, KConfigSkeleton *aconfig, QStringList *randomArenaModeArenaList, Options options=DefaultBehavior, const QString &groupName=QLatin1String("Arena"), const QString &directory=QLatin1String("arenas"))
Load a specific arena file.
Definition: arenaselector.cpp:77
void resizeEvent(QResizeEvent *p_event)
Resizes the items when the view is resized.
Definition: arenaselector.cpp:91
int toInt(bool *ok, int base) const
void setWidth(int width)
void setFlags(QFlags< Qt::ItemFlag > flags)
bool isEmpty() const
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
typedef Iterator
Definition: granatierglobals.h:75
QStringList & replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs)
T & first()
void setCheckState(Qt::CheckState state)
void showEvent(QShowEvent *p_event)
Resizes the items when the view is showed.
Definition: arenaselector.cpp:96
qreal width() const
virtual QString arenaProperty(const QString &key) const
Possible keys:
Definition: arenasettings.cpp:164
void setWidth(qreal width)
virtual bool parse(const QXmlInputSource &input)
Definition: granatierglobals.h:79
qreal height() const
Definition: granatierglobals.h:78
Definition: granatierglobals.h:81
QObject * parent() const
Definition: granatierglobals.h:73
int compare(const QString &other) const
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QString text() const
virtual void setContentHandler(QXmlContentHandler *handler)
Definition: granatierglobals.h:76
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.