This commit is contained in:
Herwig Birke
2018-05-08 16:25:19 +02:00
parent f2ebeb631d
commit d3eeee295e
15 changed files with 238 additions and 72 deletions
+4 -4
View File
@@ -2233,7 +2233,7 @@ HIDE_UNDOC_RELATIONS = YES
# set to NO # set to NO
# The default value is: NO. # The default value is: NO.
HAVE_DOT = NO HAVE_DOT = YES
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
# to run in parallel. When set to 0 doxygen will base this on the number of # to run in parallel. When set to 0 doxygen will base this on the number of
@@ -2350,7 +2350,7 @@ INCLUDED_BY_GRAPH = YES
# The default value is: NO. # The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES. # This tag requires that the tag HAVE_DOT is set to YES.
CALL_GRAPH = NO CALL_GRAPH = YES
# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller # If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
# dependency graph for every global function or class method. # dependency graph for every global function or class method.
@@ -2362,7 +2362,7 @@ CALL_GRAPH = NO
# The default value is: NO. # The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES. # This tag requires that the tag HAVE_DOT is set to YES.
CALLER_GRAPH = NO CALLER_GRAPH = YES
# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical # If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
# hierarchy of all classes instead of a textual one. # hierarchy of all classes instead of a textual one.
@@ -2411,7 +2411,7 @@ INTERACTIVE_SVG = NO
# found. If left blank, it is assumed the dot tool can be found in the path. # found. If left blank, it is assumed the dot tool can be found in the path.
# This tag requires that the tag HAVE_DOT is set to YES. # This tag requires that the tag HAVE_DOT is set to YES.
DOT_PATH = DOT_PATH = ../../../PortableApps/Graphviz/bin
# The DOTFILE_DIRS tag can be used to specify one or more directories that # The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the \dotfile # contain dot files that are included in the documentation (see the \dotfile
+32 -13
View File
@@ -6,8 +6,6 @@
#include "cchapterwindow.h" #include "cchapterwindow.h"
#include "ui_cchapterwindow.h" #include "ui_cchapterwindow.h"
#include "cmainwindow.h"
#include "common.h" #include "common.h"
#include <QStandardItem> #include <QStandardItem>
@@ -16,6 +14,7 @@
cChapterWindow::cChapterWindow(QWidget *parent) : cChapterWindow::cChapterWindow(QWidget *parent) :
cMDISubWindow(parent), cMDISubWindow(parent),
ui(new Ui::cChapterWindow), ui(new Ui::cChapterWindow),
m_lpMainWindow((cMainWindow*)parent),
m_lpChapter(0), m_lpChapter(0),
m_lpSceneList(0) m_lpSceneList(0)
{ {
@@ -24,22 +23,26 @@ cChapterWindow::cChapterWindow(QWidget *parent) :
m_lpSceneModel = new QStandardItemModel(0, 1); m_lpSceneModel = new QStandardItemModel(0, 1);
ui->m_lpSceneList->setModel(m_lpSceneModel); ui->m_lpSceneList->setModel(m_lpSceneModel);
connect(ui->m_lpSceneList, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(onSceneDoubleClicked(QModelIndex))); connect(ui->m_lpSceneList, &cTreeView::doubleClicked, this, &cChapterWindow::onSceneDoubleClicked);
connect(ui->m_lpName, SIGNAL(gotFocus(cLineEdit*)), (cMainWindow*)parent, SLOT(onLineEditGotFocus(cLineEdit*))); connect(ui->m_lpName, &cLineEdit::gotFocus, m_lpMainWindow, &cMainWindow::onLineEditGotFocus);
connect(ui->m_lpName, SIGNAL(lostFocus(cLineEdit*)), (cMainWindow*)parent, SLOT(onLineEditLostFocus(cLineEdit*))); connect(ui->m_lpName, &cLineEdit::lostFocus, m_lpMainWindow, &cMainWindow::onLineEditLostFocus);
connect(ui->m_lpPart, SIGNAL(gotFocus(cLineEdit*)), (cMainWindow*)parent, SLOT(onLineEditGotFocus(cLineEdit*))); connect(ui->m_lpPart, &cLineEdit::gotFocus, m_lpMainWindow, &cMainWindow::onLineEditGotFocus);
connect(ui->m_lpPart, SIGNAL(lostFocus(cLineEdit*)), (cMainWindow*)parent, SLOT(onLineEditLostFocus(cLineEdit*))); connect(ui->m_lpPart, &cLineEdit::lostFocus, m_lpMainWindow, &cMainWindow::onLineEditLostFocus);
connect(ui->m_lpSceneList, SIGNAL(gotFocus(cTreeView*)), (cMainWindow*)parent, SLOT(onTreeViewGotFocus(cTreeView*))); connect(ui->m_lpSceneList, &cTreeView::gotFocus, m_lpMainWindow, &cMainWindow::onTreeViewGotFocus);
connect(ui->m_lpSceneList, SIGNAL(lostFocus(cTreeView*)), (cMainWindow*)parent, SLOT(onTreeViewLostFocus(cTreeView*))); connect(ui->m_lpSceneList, &cTreeView::lostFocus, m_lpMainWindow, &cMainWindow::onTreeViewLostFocus);
connect(ui->m_lpDescription, SIGNAL(gotFocus(cTextEdit*)), (cMainWindow*)parent, SLOT(onTextEditGotFocus(cTextEdit*))); connect(ui->m_lpDescription, &cTextEdit::gotFocus, m_lpMainWindow, &cMainWindow::onTextEditGotFocus);
connect(ui->m_lpDescription, SIGNAL(lostFocus(cTextEdit*)), (cMainWindow*)parent, SLOT(onTextEditLostFocus(cTextEdit*))); connect(ui->m_lpDescription, &cTextEdit::lostFocus, m_lpMainWindow, &cMainWindow::onTextEditLostFocus);
connect(ui->m_lpText, SIGNAL(gotFocus(cTextEdit*)), (cMainWindow*)parent, SLOT(onTextEditGotFocus(cTextEdit*))); connect(ui->m_lpText, &cTextEdit::gotFocus, m_lpMainWindow, &cMainWindow::onTextEditGotFocus);
connect(ui->m_lpText, SIGNAL(lostFocus(cTextEdit*)), (cMainWindow*)parent, SLOT(onTextEditLostFocus(cTextEdit*))); connect(ui->m_lpText, &cTextEdit::lostFocus, m_lpMainWindow, &cMainWindow::onTextEditLostFocus);
connect(ui->m_lpName, &cLineEdit::textChanged, this, &cChapterWindow::onNameChanged);
connect(ui->m_lpDescription, &cTextEdit::textChanged, this, &cChapterWindow::onDescriptionChanged);
connect(ui->m_lpText, &cTextEdit::textChanged, this, &cChapterWindow::onTextChanged);
} }
cChapterWindow::~cChapterWindow() cChapterWindow::~cChapterWindow()
@@ -88,3 +91,19 @@ void cChapterWindow::onSceneDoubleClicked(const QModelIndex& index)
if(lpScene) if(lpScene)
showSceneWindow(lpScene); showSceneWindow(lpScene);
} }
void cChapterWindow::onNameChanged(const QString& szName)
{
m_lpChapter->setName(szName);
m_lpMainWindow->somethingChanged();
}
void cChapterWindow::onDescriptionChanged()
{
m_lpMainWindow->somethingChanged();
}
void cChapterWindow::onTextChanged()
{
m_lpMainWindow->somethingChanged();
}
+12 -11
View File
@@ -1,8 +1,3 @@
/*!
\file cchapterwindow.h
*/
#ifndef CCHAPTERWINDOW_H #ifndef CCHAPTERWINDOW_H
#define CCHAPTERWINDOW_H #define CCHAPTERWINDOW_H
@@ -13,6 +8,8 @@
#include "cmdisubwindow.h" #include "cmdisubwindow.h"
#include "cmainwindow.h"
#include <QWidget> #include <QWidget>
#include <QStandardItemModel> #include <QStandardItemModel>
@@ -52,14 +49,14 @@ public:
\param lpChapter \param lpChapter
\param lpSceneList \param lpSceneList
*/ */
void setChapter(cChapter* lpChapter, cSceneList* lpSceneList); void setChapter(cChapter* lpChapter, cSceneList* lpSceneList);
/*! /*!
\brief \brief
\fn chapter \fn chapter
\return cChapter \return cChapter
*/ */
cChapter* chapter(); cChapter* chapter();
private slots: private slots:
/*! /*!
@@ -70,6 +67,9 @@ private slots:
*/ */
void onSceneDoubleClicked(const QModelIndex& index); void onSceneDoubleClicked(const QModelIndex& index);
void onNameChanged(const QString& szName);
void onDescriptionChanged();
void onTextChanged();
signals: signals:
/*! /*!
\brief \brief
@@ -80,10 +80,11 @@ signals:
void showSceneWindow(cScene* lpScene); void showSceneWindow(cScene* lpScene);
private: private:
Ui::cChapterWindow *ui; /*!< TODO: describe */ Ui::cChapterWindow* ui; /*!< TODO: describe */
cChapter* m_lpChapter; /*!< TODO: describe */ cMainWindow* m_lpMainWindow; /*!< TODO: describe */
cSceneList* m_lpSceneList; /*!< TODO: describe */ cChapter* m_lpChapter; /*!< TODO: describe */
QStandardItemModel* m_lpSceneModel; /*!< TODO: describe */ cSceneList* m_lpSceneList; /*!< TODO: describe */
QStandardItemModel* m_lpSceneModel; /*!< TODO: describe */
}; };
#endif // CCHAPTERWINDOW_H #endif // CCHAPTERWINDOW_H
-5
View File
@@ -1,8 +1,3 @@
/*!
\file ccharacterwindow.h
*/
#ifndef CCHARACTERWINDOW_H #ifndef CCHARACTERWINDOW_H
#define CCHARACTERWINDOW_H #define CCHARACTERWINDOW_H
+49 -3
View File
@@ -31,7 +31,11 @@
#include <QToolBar> #include <QToolBar>
#include <QSqlQuery>
#include <QSqlError>
#include <QMessageBox> #include <QMessageBox>
#include <QInputDialog>
cMainWindow::cMainWindow(QWidget *parent) : cMainWindow::cMainWindow(QWidget *parent) :
@@ -76,6 +80,15 @@ cMainWindow::~cMainWindow()
delete ui; delete ui;
} }
void cMainWindow::somethingChanged()
{
if(!m_bSomethingChanged)
{
m_bSomethingChanged = true;
updateWindowTitle();
}
}
QAction* cMainWindow::actionAlignLeft() QAction* cMainWindow::actionAlignLeft()
{ {
return(m_lpActionAlignLeft); return(m_lpActionAlignLeft);
@@ -572,11 +585,16 @@ void cMainWindow::updateWindowTitle()
QString szTitle = m_lpStoryBook->title(); QString szTitle = m_lpStoryBook->title();
QString szAuthor = m_lpStoryBook->author(); QString szAuthor = m_lpStoryBook->author();
QString szWindowTitle;
if(szAuthor.isEmpty()) if(szAuthor.isEmpty())
setWindowTitle(QString("\"%1\" - qtStoryWriter").arg(szTitle)); szWindowTitle = QString("\"%1\" - qtStoryWriter").arg(szTitle);
else else
setWindowTitle(QString("\"%1\" by %2 - qtStoryWriter").arg(szTitle).arg(szAuthor)); szWindowTitle = QString("\"%1\" by %2 - qtStoryWriter").arg(szTitle).arg(szAuthor);
if(m_bSomethingChanged)
szWindowTitle.append(" *");
setWindowTitle(szWindowTitle);
} }
void cMainWindow::onTextEditGotFocus(cTextEdit* lpTextEdit) void cMainWindow::onTextEditGotFocus(cTextEdit* lpTextEdit)
@@ -1178,6 +1196,34 @@ void cMainWindow::onAlignmentChanged(const Qt::Alignment &alignment)
void cMainWindow::onAddPart() void cMainWindow::onAddPart()
{ {
bool bOK;
QString szPartName = "";
for(;;)
{
szPartName = QInputDialog::getText(this, tr("New Part"), tr("Name:"), QLineEdit::Normal, "", &bOK);
if(!bOK)
return;
if(szPartName.isEmpty())
{
QMessageBox::critical(this, tr("New Part"), tr("Part Name is empty."));
bOK = false;
}
else
break;
}
if(bOK && !szPartName.isEmpty())
{
if(!m_lpStoryBook->addPart(szPartName))
{
QMessageBox::critical(this, tr("New Part"), tr("Part could not be created."));
return;
}
m_lpStoryBook->fillOutlineList(ui->m_lpOutlineList);
}
} }
void cMainWindow::onEditPart() void cMainWindow::onEditPart()
+117 -1
View File
@@ -61,6 +61,13 @@ public:
*/ */
~cMainWindow(); ~cMainWindow();
/*!
\brief
\fn somethingChanged
*/
void somethingChanged();
/*! /*!
\brief \brief
@@ -97,7 +104,7 @@ public:
*/ */
QAction* actionAlignJustify(); QAction* actionAlignJustify();
private slots: public slots:
/*! /*!
\brief \brief
@@ -225,6 +232,7 @@ private slots:
*/ */
void onComboBoxLostFocus(cComboBox* lpComboBox); void onComboBoxLostFocus(cComboBox* lpComboBox);
private slots:
/*! /*!
\brief \brief
@@ -451,32 +459,139 @@ private slots:
*/ */
void onAlignmentChanged(const Qt::Alignment& alignment); void onAlignmentChanged(const Qt::Alignment& alignment);
/*!
\brief
\fn onAddPart
*/
void onAddPart(); void onAddPart();
/*!
\brief
\fn onEditPart
*/
void onEditPart(); void onEditPart();
/*!
\brief
\fn onDeletePart
*/
void onDeletePart(); void onDeletePart();
/*!
\brief
\fn onAddChapter
*/
void onAddChapter(); void onAddChapter();
/*!
\brief
\fn onEditChapter
*/
void onEditChapter(); void onEditChapter();
/*!
\brief
\fn onDeleteChapter
*/
void onDeleteChapter(); void onDeleteChapter();
/*!
\brief
\fn onAddScene
*/
void onAddScene(); void onAddScene();
/*!
\brief
\fn onEditScene
*/
void onEditScene(); void onEditScene();
/*!
\brief
\fn onDeleteScene
*/
void onDeleteScene(); void onDeleteScene();
/*!
\brief
\fn onAddCharacter
*/
void onAddCharacter(); void onAddCharacter();
/*!
\brief
\fn onEditCharacter
*/
void onEditCharacter(); void onEditCharacter();
/*!
\brief
\fn onDeleteCharacter
*/
void onDeleteCharacter(); void onDeleteCharacter();
/*!
\brief
\fn onAddPlace
*/
void onAddPlace(); void onAddPlace();
/*!
\brief
\fn onEditPlace
*/
void onEditPlace(); void onEditPlace();
/*!
\brief
\fn onDeletePlace
*/
void onDeletePlace(); void onDeletePlace();
/*!
\brief
\fn onAddObject
*/
void onAddObject(); void onAddObject();
/*!
\brief
\fn onEditObject
*/
void onEditObject(); void onEditObject();
/*!
\brief
\fn onDeleteObject
*/
void onDeleteObject(); void onDeleteObject();
/*!
\brief
\fn onAddRecherche
*/
void onAddRecherche(); void onAddRecherche();
/*!
\brief
\fn onEditRecherche
*/
void onEditRecherche(); void onEditRecherche();
/*!
\brief
\fn onDeleteRecherche
*/
void onDeleteRecherche(); void onDeleteRecherche();
private: private:
@@ -487,6 +602,7 @@ private:
QStandardItemModel* m_lpObjectModel; /*!< TODO: describe */ QStandardItemModel* m_lpObjectModel; /*!< TODO: describe */
QStandardItemModel* m_lpRechercheModel; /*!< TODO: describe */ QStandardItemModel* m_lpRechercheModel; /*!< TODO: describe */
bool m_bUpdatingTab; /*!< TODO: describe */ bool m_bUpdatingTab; /*!< TODO: describe */
bool m_bSomethingChanged; /*!< TODO: describe */
cStoryBook* m_lpStoryBook; /*!< TODO: describe */ cStoryBook* m_lpStoryBook; /*!< TODO: describe */
QList<QWidget*> m_focusException; /*!< TODO: describe */ QList<QWidget*> m_focusException; /*!< TODO: describe */
-5
View File
@@ -1,8 +1,3 @@
/*!
\file cobjectwindow.h
*/
#ifndef COBJECTWINDOW_H #ifndef COBJECTWINDOW_H
#define COBJECTWINDOW_H #define COBJECTWINDOW_H
+3
View File
@@ -86,6 +86,9 @@ cPart* cPartList::add(const qint32& iID)
cPart* cPartList::find(const qint32& iID) cPart* cPartList::find(const qint32& iID)
{ {
if(iID == -1)
return(0);
for(int x = 0;x < count();x++) for(int x = 0;x < count();x++)
{ {
if(at(x)->id() == iID) if(at(x)->id() == iID)
+2 -7
View File
@@ -1,8 +1,3 @@
/*!
\file cpartwindow.h
*/
#ifndef CPARTWINDOW_H #ifndef CPARTWINDOW_H
#define CPARTWINDOW_H #define CPARTWINDOW_H
@@ -73,8 +68,8 @@ signals:
/*! /*!
\brief \brief
\fn showPartWindow \fn showChapterWindow
\param lpPart \param lpChapter
*/ */
void showChapterWindow(cChapter* lpChapter); void showChapterWindow(cChapter* lpChapter);
-5
View File
@@ -1,8 +1,3 @@
/*!
\file cplacewindow.h
*/
#ifndef CPLACEWINDOW_H #ifndef CPLACEWINDOW_H
#define CPLACEWINDOW_H #define CPLACEWINDOW_H
-5
View File
@@ -1,8 +1,3 @@
/*!
\file crecherchewindow.h
*/
#ifndef CRECHERCHEWINDOW_H #ifndef CRECHERCHEWINDOW_H
#define CRECHERCHEWINDOW_H #define CRECHERCHEWINDOW_H
-5
View File
@@ -1,8 +1,3 @@
/*!
\file cscenewindow.h
*/
#ifndef CSCENEWINDOW_H #ifndef CSCENEWINDOW_H
#define CSCENEWINDOW_H #define CSCENEWINDOW_H
+9 -1
View File
@@ -410,6 +410,13 @@ cSceneList* cStoryBook::sceneList()
return(&m_sceneList); return(&m_sceneList);
} }
bool cStoryBook::addPart(const QString& szPartName)
{
cPart* lpPart = m_partList.add(-1);
lpPart->setName(szPartName);
return(true);
}
bool cStoryBook::fillOutlineList(QTreeView* lpView) bool cStoryBook::fillOutlineList(QTreeView* lpView)
{ {
QMap<qint32, QStandardItem*> part; QMap<qint32, QStandardItem*> part;
@@ -436,7 +443,8 @@ bool cStoryBook::fillOutlineList(QTreeView* lpView)
lpItem->setData(QVariant::fromValue(lpPart)); lpItem->setData(QVariant::fromValue(lpPart));
lpItem->setFont(fontPart); lpItem->setFont(fontPart);
lpItem->setBackground(QBrush(background)); lpItem->setBackground(QBrush(background));
lpItem->setToolTip(lpPart->description()->toPlainText()); if(lpPart->description())
lpItem->setToolTip(lpPart->description()->toPlainText());
part.insert(lpPart->id(), lpItem); part.insert(lpPart->id(), lpItem);
lpModel->appendRow(lpItem); lpModel->appendRow(lpItem);
+9
View File
@@ -135,6 +135,15 @@ public:
\return cSceneList \return cSceneList
*/ */
cSceneList* sceneList(); cSceneList* sceneList();
/*!
\brief
\fn addPart
\param szPartName
\return bool
*/
bool addPart(const QString& szPartName);
private: private:
QString m_szProject; /*!< TODO: describe */ QString m_szProject; /*!< TODO: describe */
bool m_bIsOpen; /*!< TODO: describe */ bool m_bIsOpen; /*!< TODO: describe */
+1 -7
View File
@@ -1,8 +1,3 @@
/*!
\file cwidget.h
*/
#ifndef CWIDGET_H #ifndef CWIDGET_H
#define CWIDGET_H #define CWIDGET_H
@@ -40,7 +35,7 @@ public:
TYPE_chapter = 2, TYPE_chapter = 2,
TYPE_scene = 3, TYPE_scene = 3,
TYPE_character = 4, TYPE_character = 4,
TYPE_object = 5, TYPE_object = 5, /*!< TODO: describe */
TYPE_place = 6, TYPE_place = 6,
TYPE_recherche = 7, TYPE_recherche = 7,
}; };
@@ -124,7 +119,6 @@ public:
\return QMdiSubWindow \return QMdiSubWindow
*/ */
QMdiSubWindow* window(); QMdiSubWindow* window();
/*! /*!
\brief \brief