diff --git a/ccharacter.cpp b/ccharacter.cpp index 4260fd9..30d2d7e 100644 --- a/ccharacter.cpp +++ b/ccharacter.cpp @@ -345,6 +345,15 @@ cTextDocument* cCharacter::description() return(m_lpDescription); } +void cCharacter::setItem(QList itemList) +{ + m_itemList = itemList; +} + +QList cCharacter::item() +{ + return(m_itemList); +} void cCharacter::setDeleted(bool bDeleted) { diff --git a/ccharacter.h b/ccharacter.h index 0efc360..b14696a 100644 --- a/ccharacter.h +++ b/ccharacter.h @@ -17,6 +17,8 @@ #include #include +#include + /*! \brief @@ -476,6 +478,21 @@ public: */ QList images(); + /*! + \brief + + \fn setItem + \param itemList + */ + void setItem(QList itemList); + /*! + \brief + + \fn item + \return QList + */ + QList item(); + /*! \brief @@ -518,6 +535,7 @@ private: QString m_szJob; /*!< TODO: describe */ cTextDocument* m_lpDescription; /*!< TODO: describe */ QList m_imageList; /*!< TODO: describe */ + QList m_itemList; /*!< TODO: describe */ bool m_bDeleted; /*!< TODO: describe */ signals: diff --git a/ccharacterwindow.cpp b/ccharacterwindow.cpp index 955143a..2378ad5 100644 --- a/ccharacterwindow.cpp +++ b/ccharacterwindow.cpp @@ -201,21 +201,38 @@ cCharacter* cCharacterWindow::character() void cCharacterWindow::onFirstNameChanged(const QString& szText) { m_lpCharacter->setFirstName(szText); + + nameChanged(); + m_lpMainWindow->somethingChanged(); } void cCharacterWindow::onMiddleNameChanged(const QString& szText) { m_lpCharacter->setMiddleName(szText); + + nameChanged(); + m_lpMainWindow->somethingChanged(); } void cCharacterWindow::onLastNameChanged(const QString& szText) { m_lpCharacter->setLastName(szText); + + nameChanged(); + m_lpMainWindow->somethingChanged(); } +void cCharacterWindow::nameChanged() +{ + QList items = m_lpCharacter->item(); + + if(items.count()) + items[0]->setText(m_lpCharacter->name()); +} + void cCharacterWindow::onNickNameChanged(const QString& szText) { m_lpCharacter->setNickName(szText); @@ -225,12 +242,40 @@ void cCharacterWindow::onNickNameChanged(const QString& szText) void cCharacterWindow::onMainCharacterClicked(bool bChecked) { m_lpCharacter->setMainCharacter(bChecked); + + QList items = m_lpCharacter->item(); + + if(items.count()) + { + QFont font = items[0]->font(); + + if(bChecked) + { + font.setBold(true); + font.setItalic(false); + } + else + { + font.setBold(false); + font.setItalic(true); + } + + for(int x = 0;x < items.count();x++) + items[x]->setFont(font); + } + m_lpMainWindow->somethingChanged(); } void cCharacterWindow::onCreatureChanged(const QString& szText) { m_lpCharacter->setCreature(szText); + + QList items = m_lpCharacter->item(); + + if(items.count() >= 2) + items[1]->setText(szText); + m_lpMainWindow->somethingChanged(); } @@ -243,6 +288,8 @@ void cCharacterWindow::onGenderMaleClicked(bool /*bChecked*/) else m_lpCharacter->setGender(cCharacter::GENDER_undefined); + genderChanged(); + m_lpMainWindow->somethingChanged(); } @@ -255,6 +302,8 @@ void cCharacterWindow::onGenderFemaleClicked(bool /*bChecked*/) else m_lpCharacter->setGender(cCharacter::GENDER_undefined); + genderChanged(); + m_lpMainWindow->somethingChanged(); } @@ -267,9 +316,19 @@ void cCharacterWindow::onGenderOtherClicked(bool /*bChecked*/) else m_lpCharacter->setGender(cCharacter::GENDER_undefined); + genderChanged(); + m_lpMainWindow->somethingChanged(); } +void cCharacterWindow::genderChanged() +{ + QList items = m_lpCharacter->item(); + + if(items.count() >= 3) + items[2]->setText(m_lpCharacter->genderText()); +} + void cCharacterWindow::onTitleChanged(const QString& szText) { m_lpCharacter->setTitle(szText); diff --git a/ccharacterwindow.h b/ccharacterwindow.h index f8ee7d2..a11e83c 100644 --- a/ccharacterwindow.h +++ b/ccharacterwindow.h @@ -238,6 +238,20 @@ private: Ui::cCharacterWindow* ui; /*!< TODO: describe */ cMainWindow* m_lpMainWindow; /*!< TODO: describe */ cCharacter* m_lpCharacter; /*!< TODO: describe */ + + /*! + \brief + + \fn nameChanged + */ + void nameChanged(); + + /*! + \brief + + \fn genderChanged + */ + void genderChanged(); }; #endif // CCHARACTERWINDOW_H diff --git a/cobject.cpp b/cobject.cpp index 6723261..6585163 100644 --- a/cobject.cpp +++ b/cobject.cpp @@ -61,6 +61,16 @@ cTextDocument* cObject::description() return(m_lpDescription); } +void cObject::setItem(QList itemList) +{ + m_itemList = itemList; +} + +QList cObject::item() +{ + return(m_itemList); +} + void cObject::setDeleted(bool bDeleted) { m_bDeleted = bDeleted; diff --git a/cobject.h b/cobject.h index 01f83ef..d1fce25 100644 --- a/cobject.h +++ b/cobject.h @@ -15,6 +15,8 @@ #include #include +#include + /*! \brief @@ -110,20 +112,35 @@ public: */ QList images(); + /*! + \brief + + \fn setItem + \param itemList + */ + void setItem(QList itemList); + /*! + \brief + + \fn item + \return QList + */ + QList item(); + /*! \brief \fn setDeleted \param bDeleted */ - void setDeleted(bool bDeleted); + void setDeleted(bool bDeleted); /*! \brief \fn deleted \return bool */ - bool deleted(); + bool deleted(); private: qint32 m_iID; /*!< TODO: describe */ @@ -131,6 +148,7 @@ private: QString m_szType; /*!< TODO: describe */ cTextDocument* m_lpDescription; /*!< TODO: describe */ QList m_imageList; /*!< TODO: describe */ + QList m_itemList; /*!< TODO: describe */ bool m_bDeleted; /*!< TODO: describe */ signals: diff --git a/cobjectwindow.cpp b/cobjectwindow.cpp index 696b548..93b2fdb 100644 --- a/cobjectwindow.cpp +++ b/cobjectwindow.cpp @@ -76,12 +76,24 @@ cObject* cObjectWindow::object() void cObjectWindow::onNameChanged(const QString& szName) { m_lpObject->setName(szName); + + QList items = m_lpObject->item(); + + if(items.count()) + items[0]->setText(szName); + m_lpMainWindow->somethingChanged(); } void cObjectWindow::onTypeChanged(const QString& szName) { m_lpObject->setType(szName); + + QList items = m_lpObject->item(); + + if(items.count() >= 2) + items[1]->setText(szName); + m_lpMainWindow->somethingChanged(); } diff --git a/cplace.cpp b/cplace.cpp index e4acd13..2140bdf 100644 --- a/cplace.cpp +++ b/cplace.cpp @@ -72,6 +72,16 @@ cTextDocument* cPlace::description() return(m_lpDescription); } +void cPlace::setItem(QList itemList) +{ + m_itemList = itemList; +} + +QList cPlace::item() +{ + return(m_itemList); +} + void cPlace::setDeleted(bool bDeleted) { m_bDeleted = bDeleted; diff --git a/cplace.h b/cplace.h index 69c8acb..e76556c 100644 --- a/cplace.h +++ b/cplace.h @@ -15,6 +15,8 @@ #include #include +#include + /*! \brief @@ -125,20 +127,35 @@ public: */ QList images(); + /*! + \brief + + \fn setItem + \param itemList + */ + void setItem(QList itemList); + /*! + \brief + + \fn item + \return QList + */ + QList item(); + /*! \brief \fn setDeleted \param bDeleted */ - void setDeleted(bool bDeleted); + void setDeleted(bool bDeleted); /*! \brief \fn deleted \return bool */ - bool deleted(); + bool deleted(); private: qint32 m_iID; /*!< TODO: describe */ @@ -147,6 +164,7 @@ private: QString m_szType; /*!< TODO: describe */ cTextDocument* m_lpDescription; /*!< TODO: describe */ QList m_imageList; /*!< TODO: describe */ + QList m_itemList; /*!< TODO: describe */ bool m_bDeleted; /*!< TODO: describe */ signals: diff --git a/cplacewindow.cpp b/cplacewindow.cpp index 2175c00..e4e0fb3 100644 --- a/cplacewindow.cpp +++ b/cplacewindow.cpp @@ -81,18 +81,36 @@ cPlace* cPlaceWindow::place() void cPlaceWindow::onNameChanged(const QString& szName) { m_lpPlace->setName(szName); + + QList items = m_lpPlace->item(); + + if(items.count()) + items[0]->setText(szName); + m_lpMainWindow->somethingChanged(); } void cPlaceWindow::onTypeChanged(const QString& szName) { m_lpPlace->setType(szName); + + QList items = m_lpPlace->item(); + + if(items.count() >= 2) + items[1]->setText(szName); + m_lpMainWindow->somethingChanged(); } void cPlaceWindow::onLocationChanged(const QString& szName) { m_lpPlace->setLocation(szName); + + QList items = m_lpPlace->item(); + + if(items.count() >= 3) + items[2]->setText(szName); + m_lpMainWindow->somethingChanged(); } diff --git a/crecherche.cpp b/crecherche.cpp index 75d0be2..6a4ba41 100644 --- a/crecherche.cpp +++ b/crecherche.cpp @@ -61,6 +61,16 @@ cTextDocument* cRecherche::description() return(m_lpDescription); } +void cRecherche::setItem(QList itemList) +{ + m_itemList = itemList; +} + +QList cRecherche::item() +{ + return(m_itemList); +} + void cRecherche::setDeleted(bool bDeleted) { m_bDeleted = bDeleted; diff --git a/crecherche.h b/crecherche.h index a6a8008..483a2c4 100644 --- a/crecherche.h +++ b/crecherche.h @@ -18,6 +18,8 @@ #include #include +#include + /*! \brief @@ -159,6 +161,21 @@ public: */ QList placeList(); + /*! + \brief + + \fn setItem + \param itemList + */ + void setItem(QList itemList); + /*! + \brief + + \fn item + \return QList + */ + QList item(); + /*! \brief @@ -183,6 +200,7 @@ private: QList m_characterList; /*!< TODO: describe */ QList m_objectList; /*!< TODO: describe */ QList m_placeList; /*!< TODO: describe */ + QList m_itemList; /*!< TODO: describe */ bool m_bDeleted; /*!< TODO: describe */ signals: diff --git a/crecherchewindow.cpp b/crecherchewindow.cpp index 8fd8469..3073ee5 100644 --- a/crecherchewindow.cpp +++ b/crecherchewindow.cpp @@ -218,12 +218,24 @@ void cRechercheWindow::onObjectDoubleClicked(const QModelIndex& index) void cRechercheWindow::onNameChanged(const QString& szName) { m_lpRecherche->setName(szName); + + QList items = m_lpRecherche->item(); + + if(items.count()) + items[0]->setText(szName); + m_lpMainWindow->somethingChanged(); } void cRechercheWindow::onLinkChanged(const QString& szName) { m_lpRecherche->setLink(szName); + + QList items = m_lpRecherche->item(); + + if(items.count() >= 2) + items[1]->setText(szName); + m_lpMainWindow->somethingChanged(); } diff --git a/cstorybook.cpp b/cstorybook.cpp index 5c571f5..cd104c3 100644 --- a/cstorybook.cpp +++ b/cstorybook.cpp @@ -855,6 +855,7 @@ bool cStoryBook::fillCharacterList(QTreeView* lpView) } lpModel->appendRow(lpItems); + lpCharacter->setItem(lpItems); } lpView->header()->setStretchLastSection(true); @@ -896,6 +897,7 @@ bool cStoryBook::fillPlaceList(QTreeView* lpView) } lpModel->appendRow(lpItems); + lpPlace->setItem(lpItems); } lpView->header()->setStretchLastSection(true); @@ -936,6 +938,7 @@ bool cStoryBook::fillObjectList(QTreeView* lpView) } lpModel->appendRow(lpItems); + lpObject->setItem(lpItems); } lpView->header()->setStretchLastSection(true); @@ -976,6 +979,7 @@ bool cStoryBook::fillRechercheList(QTreeView* lpView) } lpModel->appendRow(lpItems); + lpRecherche->setItem(lpItems); } lpView->header()->setStretchLastSection(true); diff --git a/main.cpp b/main.cpp index a3ca75d..cdb16a7 100644 --- a/main.cpp +++ b/main.cpp @@ -12,12 +12,17 @@ #include "csplashscreen.h" +//#define SHOW_SPLASH int main(int argc, char *argv[]) { QApplication a(argc, argv); + +#ifdef SHOW_SPLASH QPixmap pixmap(":/images/splash.png"); -// QPixmap pixmap(":/images/splashEmpty.png"); +#else + QPixmap pixmap(":/images/splashEmpty.png"); +#endif cSplashScreen* lpSplash = new cSplashScreen(pixmap); // int id = QFontDatabase::addApplicationFont(":/fonts/Stingray.otf"); // int id = QFontDatabase::addApplicationFont(":/fonts/Luna.ttf");