From d5bb30030db3f96b903382a8f862c76d73fdc2b2 Mon Sep 17 00:00:00 2001 From: Jan Cermak Date: Sun, 8 Mar 2009 15:51:52 +0100 Subject: [PATCH] doxygen comments --- abouttab.cc | 11 +++++++++++ abouttab.h | 3 +++ clubtab.cc | 21 +++++++++++++++++++++ clubtab.h | 2 ++ configtab.cc | 30 +++++++++++++++++++++++++++++ configtab.h | 1 + loadtab.cc | 21 ++++++++++++++++++++- loadtab.h | 3 ++- main.cc | 25 +++++++++++++++++++------ mainwindow.cc | 6 ++++++ mainwindow.h | 5 +++++ performance.cc | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ performance.h | 1 + playerdetail.cc | 6 ++++++ playerdetail.h | 2 ++ playertab.cc | 25 +++++++++++++++++++++++++ playertab.h | 2 ++ proxyset.cc | 12 ++++++++++++ proxyset.h | 1 + stadiumtab.cc | 15 +++++++++++++++ stadiumtab.h | 1 + staffmember.cc | 9 +++++++++ staffmember.h | 1 + stafftab.cc | 15 +++++++++++++++ stafftab.h | 1 + 25 files changed, 261 insertions(+), 8 deletions(-) diff --git a/abouttab.cc b/abouttab.cc index 7e7d500..d4be83e 100644 --- a/abouttab.cc +++ b/abouttab.cc @@ -6,15 +6,26 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode #include "abouttab.h" +/** + * \brief About Tab constructor. + */ AboutTab::AboutTab(QWidget *parent) : QWidget(parent) { init(); } +/** + * \brief About Tab destructor. + */ AboutTab::~AboutTab() { delete label; delete mainLayout; } +/** + * \brief About Tab initializer. + * + * Set some text into about tab. + */ void AboutTab::init() { mainLayout = new QVBoxLayout; QString text; diff --git a/abouttab.h b/abouttab.h index fb2e7c7..ee6245a 100644 --- a/abouttab.h +++ b/abouttab.h @@ -11,6 +11,9 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode #include #include +/** + * \brief About Tab widget. + */ class AboutTab: public QWidget { Q_OBJECT QVBoxLayout *mainLayout; diff --git a/clubtab.cc b/clubtab.cc index 8418ee9..887076e 100644 --- a/clubtab.cc +++ b/clubtab.cc @@ -6,15 +6,26 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode #include "clubtab.h" +/** + * Club Tab constructor. + */ ClubTab::ClubTab(QWidget *parent) : QWidget(parent) { init(); } +/** + * Club Tab destructor. + */ ClubTab::~ClubTab() { delete label; delete mainLayout; } +/** + * \brief Club Tab initializer. + * + * Set text into Club Tab. + */ void ClubTab::init() { mainLayout = new QVBoxLayout; QString text; @@ -59,10 +70,20 @@ void ClubTab::init() { setLayout(mainLayout); } +/** + * \brief Slot assigned to data change action. + * + * Rebuild UI with new data. + */ void ClubTab::dataChanged() { rebuildUI(); } +/** + * \brief Redraw UI with new data. + * + * Destroy old widget and initialize new one.. + */ void ClubTab::rebuildUI() { label->clear(); delete mainLayout; diff --git a/clubtab.h b/clubtab.h index 54e0b1a..2b537c4 100644 --- a/clubtab.h +++ b/clubtab.h @@ -12,6 +12,7 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode #include #include +/// Struct with club information. struct ClubStruct { QString name, budget, rat, fndd, spirit, curpos, curdiv, totgmade, totgrecv, curgmade, curgrecv, curlgmade, curlgrecv, tothgames, totwins, totdraws, totlosts, curhgames, curwins, curdraws, curlosts, curlwins, curldraws, curllosts, totmaxatt, curmaxatt, totavgatt, curavgatt, form, for_a, tactic_a, attstyle_a, agr_a, cap_a; bool incup; @@ -20,6 +21,7 @@ struct ClubStruct { extern void parse(const QString &); extern ClubStruct club; +/// Club Tab widget. class ClubTab: public QWidget { Q_OBJECT QVBoxLayout *mainLayout; diff --git a/configtab.cc b/configtab.cc index 841dd04..fa2b24c 100755 --- a/configtab.cc +++ b/configtab.cc @@ -6,6 +6,9 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode #include "configtab.h" +/** + * \brief Config Tab constructor. + */ ConfigTab::ConfigTab(QWidget *parent): QWidget(parent) { file = 0; http = new QHttp; @@ -76,6 +79,9 @@ ConfigTab::ConfigTab(QWidget *parent): QWidget(parent) { setLayout(mainLayout); } +/** + * \brief Config Tab destructor. + */ ConfigTab::~ConfigTab() { if(file) delete file; delete http; @@ -100,14 +106,24 @@ ConfigTab::~ConfigTab() { delete mainLayout; } +/** + * \brief Slot assigned to language change action. + * \param langId language ID. + */ void ConfigTab::changeLang(int langId) { langToSave = langId; } +/** + * \brief Slot assigned to proxy settings opening action. + */ void ConfigTab::openProxy() { proxyWin = new ProxySet(); } +/** + * \brief Slot assigned to save button click. + */ void ConfigTab::saveSettings() { const char* langs[5] = {"en", "cs", "ro", "pl", "lt"}; QSettings settings("config/global.ini", QSettings::IniFormat); @@ -117,6 +133,9 @@ void ConfigTab::saveSettings() { } } +/** + * \brief Slot assigned to download button click. + */ void ConfigTab::downloadLatest() { QSettings settings("config/global.ini", QSettings::IniFormat); useProxy = settings.value("Network/proxyUsed", 0).toInt(); @@ -134,6 +153,9 @@ void ConfigTab::downloadLatest() { settings.sync(); } +/** + * \brief Slot assigned to download finished action. + */ void ConfigTab::httpRequestFinished(int requestId, bool error) { if (requestId != httpId) return; @@ -171,6 +193,10 @@ void ConfigTab::httpRequestFinished(int requestId, bool error) { file = 0; } +/** + * \brief Slot assigned to QHttp response action. + * \param responseHeader QHttp response. + */ void ConfigTab::readResponseHeader(const QHttpResponseHeader &responseHeader) { if (responseHeader.statusCode() != 200) { QMessageBox::information(this, tr("HTTP"), tr("Download failed: %1.").arg(responseHeader.reasonPhrase())); @@ -179,6 +205,10 @@ void ConfigTab::readResponseHeader(const QHttpResponseHeader &responseHeader) { } } +/** + * \brief Slot assigned to errMsgBox signal. + * \param text text to show. + */ void ConfigTab::showMsgBox(const QString &text) { msgbox->clear(); msgbox->setText(text); diff --git a/configtab.h b/configtab.h index 047a4a3..67ac038 100755 --- a/configtab.h +++ b/configtab.h @@ -25,6 +25,7 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode extern void parse(const QString &); +/// Config widget. class ConfigTab: public QWidget { Q_OBJECT QVBoxLayout *mainLayout, *group1Layout, *group2Layout; diff --git a/loadtab.cc b/loadtab.cc index 62fdc47..ce20923 100644 --- a/loadtab.cc +++ b/loadtab.cc @@ -6,16 +6,25 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode #include "loadtab.h" +/** + * \brief Load Tab constructor. + */ LoadTab::LoadTab(QWidget * parent) : QWidget(parent) { init(); } +/** + * \brief Load Tab destructor. + */ LoadTab::~LoadTab() { delete label; delete older; delete mainLayout; } +/** + * Init UI for this tab. + */ void LoadTab::init() { QSettings settings("config/global.ini", QSettings::IniFormat); QString num = settings.value("nextXmlId", "0").toString(); @@ -26,7 +35,7 @@ void LoadTab::init() { int j = 0; for(int i=num.toInt()-1; i>=0; i--) { - quickparse("data/data_"+QString().setNum(i)+".xml"); + quickparse("data/data_"+QString().setNum(i)+".xml"); // should be stored somewhere else if(globSlot) { dataParsed[j][0] = globSlot; dataParsed[j][1] = curSlot; @@ -57,10 +66,17 @@ void LoadTab::init() { connect(older, SIGNAL(currentIndexChanged(int)), this, SLOT(indexChanged(int))); } +/** + * \brief Slot assigned to data change action. + */ void LoadTab::dataChanged() { rebuildUI(); } +/** + * \brief Slot assigned to combobox index change. + * \param i selected index. + */ void LoadTab::indexChanged(int i) { int fileNum = dataParsed[i][3]; parse("data/data_" + QString().setNum(fileNum) + ".xml"); @@ -69,6 +85,9 @@ void LoadTab::indexChanged(int i) { label->setText(tr("Loaded file: ") + "data_" + QString().setNum(fileNum) + ".xml"); } +/** + * \brief Delete UI and draw it again. + */ void LoadTab::rebuildUI() { delete older; delete label; diff --git a/loadtab.h b/loadtab.h index d72debf..70f9da5 100644 --- a/loadtab.h +++ b/loadtab.h @@ -15,7 +15,7 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode #include #include -extern int dataParsed[20][4]; // glob slot || slot || seazon || data # +extern int dataParsed[20][4]; // glob slot || slot || season || data # extern int globSlot; extern int curSlot; extern int curSeason; @@ -23,6 +23,7 @@ extern int curSeason; extern void parse(const QString &); extern void quickparse(const QString &); +/// Load Tab widget. class LoadTab: public QWidget { Q_OBJECT QVBoxLayout *mainLayout; diff --git a/main.cc b/main.cc index f112a34..632b23c 100644 --- a/main.cc +++ b/main.cc @@ -8,15 +8,21 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode void parse(const QString &data); -int playerCnt; -Player pls[45]; -int staffCnt; -StaffMemberStruct staff[7]; -StadiumStruct stadium; -ClubStruct club; +int playerCnt; ///< number of players parsed +Player pls[45]; ///< parsed players array +int staffCnt; ///< number of staff parsed +StaffMemberStruct staff[7]; ///< parsed staff array +StadiumStruct stadium; ///< parsed stadium +ClubStruct club; ///< parsed club int dataParsed[20][4]; int globSlot, curSlot, curSeason; +/** + * \brief Function parsing input XML. + * + * Parse players, staff, stadium etc. info from soccerproject XML. + * \param[in] data path to input xml. + */ void parse(const QString &data) { QDomDocument doc("spdt"); QFile file( data ); @@ -717,6 +723,13 @@ void parse(const QString &data) { } } +/** + * \brief Function partially parsing input XML. + * + * Parse only information about current season. + * Used to assigning season to input xml on the fly. + * \param[in] data path to input xml. + */ void quickparse(const QString &data) { QDomDocument doc("spdt"); QFile file( data ); diff --git a/mainwindow.cc b/mainwindow.cc index ad44c8d..89fb885 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -6,6 +6,9 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode #include "mainwindow.h" +/** + * \brief Main Window constructor. + */ MainWindow::MainWindow(QWidget * parent) : QWidget(parent) { tabWidget = new QTabWidget; conf = new ConfigTab(this); @@ -42,6 +45,9 @@ MainWindow::MainWindow(QWidget * parent) : QWidget(parent) { setLayout(mainLayout); } +/** + * \brief Main Window destructor. + */ MainWindow::~MainWindow() { delete conf; delete player; diff --git a/mainwindow.h b/mainwindow.h index df0a47f..1643cc2 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -19,6 +19,11 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode #include "abouttab.h" #include "performance.h" +/** + * \brief Main Window widget. + * + * Holds all tabs inside it. + */ class MainWindow: public QWidget { Q_OBJECT QVBoxLayout *mainLayout; diff --git a/performance.cc b/performance.cc index 9da30aa..a5d3d7e 100644 --- a/performance.cc +++ b/performance.cc @@ -6,6 +6,9 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode #include "performance.h" +/** + * \brief Init UI. + */ void PerformanceTab::init() { QSettings settings("config/formation.ini", QSettings::IniFormat); @@ -89,12 +92,18 @@ void PerformanceTab::init() { mainLayout->update(); } +/** + * \brief Performance Tab constructor. + */ PerformanceTab::PerformanceTab(QWidget *parent): QWidget(parent), defs(0), mids(0), fors(0) { mainLayout = new QVBoxLayout; setLayout(mainLayout); init(); } +/** + * \brief Performance Tab destructor. + */ PerformanceTab::~PerformanceTab() { for(int i=0; i<11; ++i) { delete player[i]; @@ -113,6 +122,9 @@ PerformanceTab::~PerformanceTab() { delete mainLayout; } +/** + * \brief Slot assigned to data change action. + */ void PerformanceTab::dataChanged() { container->removeWidget(format); delete format; @@ -141,6 +153,9 @@ void PerformanceTab::dataChanged() { init(); } +/** + * \brief Set adequate player post by selected formation. + */ void PerformanceTab::postLabels() { int LMpos = 0; if(!defsC) { @@ -241,6 +256,11 @@ void PerformanceTab::postLabels() { } } +/** + * \brief Count performance of each line (def, mid, fwd). + * + * Count with offensive/defensive order of each player. + */ void PerformanceTab::countPerf() { defs = 0; mids = 0; @@ -278,6 +298,11 @@ void PerformanceTab::countPerf() { } } +/** + * \brief Slot assigned to "count performance" button. + * + * Print all play-variants points.. + */ void PerformanceTab::recount() { double homeMod = home->itemData(home->currentIndex()).toDouble(); double pre = (1.0+((double)aggress/1000))/(7.0 - (club.spirit.toDouble()/1000) + homeMod); @@ -294,6 +319,12 @@ void PerformanceTab::recount() { result->setText(text); } +/** + * \brief Slot assigned to aggression change. + * + * \param[in] a Aggression ID. + * Save aggression to config file. + */ void PerformanceTab::aggressChange(int a) { aggress = a*5; QSettings settings("config/formation.ini", QSettings::IniFormat); @@ -301,6 +332,10 @@ void PerformanceTab::aggressChange(int a) { settings.sync(); } +/** + * \brief Slot assigned to formation change. + * \param[in] t Formation ID. + */ void PerformanceTab::formatChange(int t) { QSettings settings("config/formation.ini", QSettings::IniFormat); if(t<8 && t>=0) { settings.setValue("form", t); settings.sync(); } @@ -334,6 +369,10 @@ void PerformanceTab::formatChange(int t) { reorderPlayers(); } +/** + * \brief Slot assigned to player combobox changes. + * \param[in] id possition ID + */ void PerformanceTab::playerChange(int id) { id = 1; //avoid warning :-D QSettings settings("config/formation.ini", QSettings::IniFormat); @@ -344,6 +383,13 @@ void PerformanceTab::playerChange(int id) { settings.sync(); } +/** + * \brief Slot assigned to "re-order players" button. + * + * If there are players assigned to wrong possition (by selected formation), + * then this function give here players with correct post. + * This do not look at player performance, first is selected.. + */ void PerformanceTab::reorderPlayers() { int i; int from = 0; @@ -404,6 +450,10 @@ void PerformanceTab::reorderPlayers() { } } +/** + * \brief Searching for first player with this post. + * \param[in] post player possition. + */ int PerformanceTab::findFirstOnPost(const QString &post) { for(int i=0; i #include +/// Struct with information parsed for each player. struct Player { QString id; QString fname; @@ -34,6 +35,7 @@ struct Player { extern Player pls[]; extern int playerCnt; +/// Player detail widget. class PlayerDetail: public QWidget { Q_OBJECT QVBoxLayout *mainLayout; diff --git a/playertab.cc b/playertab.cc index 9c05369..d297a18 100755 --- a/playertab.cc +++ b/playertab.cc @@ -6,6 +6,11 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode #include "playertab.h" +/** + * \brief Player Container constructor. + * + * Add player to adequate Tab by player possition (GK, LB etc.). + */ PlayerCont::PlayerCont(int pos, QWidget *parent) : QWidget(parent) { tabWidget = new QTabWidget; tabWidget->setTabPosition(QTabWidget::West); @@ -39,20 +44,34 @@ PlayerCont::PlayerCont(int pos, QWidget *parent) : QWidget(parent) { setLayout(mainLayout); } +/** + * \brief Player Container destructor. + */ PlayerCont::~PlayerCont() { delete tabWidget; delete mainLayout; } +/** + * \brief Players Tab constructor. + * + * Hold player possition Tabs (GK, LB...). + */ PlayerTab::PlayerTab(QWidget *parent) : QWidget(parent) { initTabs(); } +/** + * \brief Players Tab destructor. + */ PlayerTab::~PlayerTab() { delete tabWidget; delete mainLayout; } +/** + * \brief Init Player Tab - add Tabs with player possition. + */ void PlayerTab::initTabs() { tabWidget = new QTabWidget; tabWidget->setTabPosition(QTabWidget::North); @@ -73,10 +92,16 @@ void PlayerTab::initTabs() { setLayout(mainLayout); } +/** + * \brief Slot assigned to data change action. + */ void PlayerTab::dataChanged() { rebuildUI(); } +/** + * \brief Redraw UI with new data. + */ void PlayerTab::rebuildUI() { delete tabWidget; delete mainLayout; diff --git a/playertab.h b/playertab.h index f09a6f4..c31efd0 100755 --- a/playertab.h +++ b/playertab.h @@ -19,6 +19,7 @@ extern void parse(const QString &); extern int playerCnt; extern Player pls[]; +/// Container for players with same possition (GK, LB..) class PlayerCont: public QWidget { Q_OBJECT QTabWidget *tabWidget; @@ -28,6 +29,7 @@ public: ~PlayerCont(); }; +/// Widget with player possition Tabs. class PlayerTab: public QWidget { Q_OBJECT QTabWidget *tabWidget; diff --git a/proxyset.cc b/proxyset.cc index 51de32b..6da3d4a 100644 --- a/proxyset.cc +++ b/proxyset.cc @@ -6,6 +6,9 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode #include "proxyset.h" +/** + * \brief Proxy settings widget constructor. + */ ProxySet::ProxySet(QWidget *parent) : QWidget(parent) { QSettings settings("config/global.ini", QSettings::IniFormat); useProxy = settings.value("Network/proxyUsed", 0).toInt(); @@ -43,6 +46,9 @@ ProxySet::ProxySet(QWidget *parent) : QWidget(parent) { this->show(); } +/** + * \brief Proxy settings destructor. + */ ProxySet::~ProxySet() { delete addrP; delete portP; @@ -57,6 +63,9 @@ ProxySet::~ProxySet() { delete mainLayout; } +/** + * \brief Slot assigned to save button click. + */ void ProxySet::save() { QSettings settings("config/global.ini", QSettings::IniFormat); settings.setValue("Network/proxyUsed", useProxy); @@ -67,6 +76,9 @@ void ProxySet::save() { settings.sync(); } +/** + * \brief Slot assigned to check box changes. + */ void ProxySet::checkChange(int state) { useProxy = state; } diff --git a/proxyset.h b/proxyset.h index a9d388c..d231afe 100644 --- a/proxyset.h +++ b/proxyset.h @@ -15,6 +15,7 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode #include #include +/// Proxy settings widget. class ProxySet: public QWidget { Q_OBJECT QVBoxLayout *mainLayout; diff --git a/stadiumtab.cc b/stadiumtab.cc index 97f027b..82f4b37 100644 --- a/stadiumtab.cc +++ b/stadiumtab.cc @@ -6,17 +6,26 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode #include "stadiumtab.h" +/** + * \brief Stadium Tab constructor. + */ StadiumTab::StadiumTab(QWidget *parent) : QWidget(parent) { mainLayout = new QVBoxLayout; setLayout(mainLayout); init(); } +/** + * \brief Stadium Tab destructor. + */ StadiumTab::~StadiumTab() { delete label; delete mainLayout; } +/** + * \brief Print info about stadium from parsed data. + */ void StadiumTab::init() { int cap = stadium.cap_n.toInt() + stadium.cap_e.toInt() + stadium.cap_w.toInt() + stadium.cap_s.toInt(); QString text; @@ -58,10 +67,16 @@ void StadiumTab::init() { mainLayout->update(); } +/** + * \brief Slot assigned to data change action. + */ void StadiumTab::dataChanged() { rebuildUI(); } +/** + * \brief Destroy current UI and draw it again. + */ void StadiumTab::rebuildUI() { mainLayout->removeWidget(label); delete label; diff --git a/stadiumtab.h b/stadiumtab.h index 7db1513..5cee158 100644 --- a/stadiumtab.h +++ b/stadiumtab.h @@ -20,6 +20,7 @@ struct StadiumStruct { extern void parse(const QString &); extern StadiumStruct stadium; +/// Stadium Tab widget. class StadiumTab: public QWidget { Q_OBJECT QVBoxLayout *mainLayout; diff --git a/staffmember.cc b/staffmember.cc index afb512b..9e834d5 100644 --- a/staffmember.cc +++ b/staffmember.cc @@ -6,6 +6,12 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode #include "staffmember.h" +/** + * \brief Staff Member constructor. + * + * Display info about requested staff. + * \param idx staff member ID. + */ StaffMember::StaffMember(int idx, QWidget *parent): QWidget(parent), i(idx) { mainLayout = new QVBoxLayout; QString info = ""; @@ -34,6 +40,9 @@ StaffMember::StaffMember(int idx, QWidget *parent): QWidget(parent), i(idx) { setLayout(mainLayout); } +/** + * \brief Staff member destructor. + */ StaffMember::~StaffMember() { delete player; delete mainLayout; diff --git a/staffmember.h b/staffmember.h index fbf3dc9..8db88ed 100644 --- a/staffmember.h +++ b/staffmember.h @@ -29,6 +29,7 @@ struct StaffMemberStruct { extern StaffMemberStruct staff[]; extern int staffCnt; +/// Staff widget. class StaffMember: public QWidget { Q_OBJECT QVBoxLayout *mainLayout; diff --git a/stafftab.cc b/stafftab.cc index da5a965..cfb8087 100644 --- a/stafftab.cc +++ b/stafftab.cc @@ -6,15 +6,24 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode #include "stafftab.h" +/** + * \brief Staff Tab constructor. + */ StaffTab::StaffTab(QWidget *parent) : QWidget(parent) { initTabs(); } +/** + * \brief Staff Tab destructor. + */ StaffTab::~StaffTab() { delete tabWidget; delete mainLayout; } +/** + * \brief Add tabs for each staff members. + */ void StaffTab::initTabs() { tabWidget = new QTabWidget; tabWidget->setTabPosition(QTabWidget::West); @@ -27,10 +36,16 @@ void StaffTab::initTabs() { setLayout(mainLayout); } +/** + * \brief Slot assigned to data change action. + */ void StaffTab::dataChanged() { rebuildUI(); } +/** + * \brief Delete widget and draw it again. + */ void StaffTab::rebuildUI() { delete tabWidget; delete mainLayout; diff --git a/stafftab.h b/stafftab.h index 1818a57..1b19457 100644 --- a/stafftab.h +++ b/stafftab.h @@ -19,6 +19,7 @@ extern void parse(const QString &); extern int staffCnt; extern StaffMemberStruct staff[]; +/// Staff Tab widget. class StaffTab: public QWidget { Q_OBJECT QTabWidget *tabWidget; -- 2.20.1