.
This commit is contained in:
@@ -81,10 +81,16 @@ bool cBook::save()
|
||||
|
||||
QByteArray ba;
|
||||
|
||||
ba = description()->toHtml().toUtf8();
|
||||
if(description())
|
||||
ba = description()->toHtml().toUtf8();
|
||||
else
|
||||
ba = QString("").toUtf8();
|
||||
query.bindValue(":shortDescription", qCompress(ba));
|
||||
|
||||
ba = shortDescription()->toHtml().toUtf8();
|
||||
if(shortDescription())
|
||||
ba = shortDescription()->toHtml().toUtf8();
|
||||
else
|
||||
ba = QString("").toUtf8();
|
||||
query.bindValue(":description", qCompress(ba));
|
||||
|
||||
query.bindValue(":author", author());
|
||||
|
||||
+2
-1
@@ -66,7 +66,8 @@ void cChapterWindow::setChapter(cChapter* lpChapter, cSceneList* lpSceneList)
|
||||
|
||||
QStandardItem* lpItem = new QStandardItem(lpScene->name());
|
||||
lpItem->setData(QVariant::fromValue(lpScene));
|
||||
lpItem->setToolTip(lpScene->description()->toPlainText());
|
||||
if(lpScene->description())
|
||||
lpItem->setToolTip(lpScene->description()->toPlainText());
|
||||
m_lpSceneModel->appendRow(lpItem);
|
||||
}
|
||||
|
||||
|
||||
+129
-24
@@ -37,6 +37,8 @@
|
||||
#include <QMessageBox>
|
||||
#include <QInputDialog>
|
||||
|
||||
#include <QFileDialog>
|
||||
|
||||
|
||||
cMainWindow::cMainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
@@ -62,15 +64,7 @@ cMainWindow::cMainWindow(QWidget *parent) :
|
||||
|
||||
disableTextEdit();
|
||||
|
||||
QString szPath = QDir::homePath() + QDir::separator() + "OneDrive - WINDESIGN" + QDir::separator() + "__BOOKS__" + QDir::separator() + "qtStoryWriter" + QDir::separator() + "rückwärts.storyWriter" ;
|
||||
m_lpStoryBook = new cStoryBook(szPath);
|
||||
m_lpStoryBook->fillOutlineList(ui->m_lpOutlineList);
|
||||
m_lpStoryBook->fillCharacterList(ui->m_lpCharacterList);
|
||||
m_lpStoryBook->fillPlaceList(ui->m_lpPlaceList);
|
||||
m_lpStoryBook->fillObjectList(ui->m_lpObjectList);
|
||||
m_lpStoryBook->fillRechercheList(ui->m_lpRechercheList);
|
||||
|
||||
updateWindowTitle();
|
||||
onFileNew();
|
||||
}
|
||||
|
||||
cMainWindow::~cMainWindow()
|
||||
@@ -112,18 +106,6 @@ QAction* cMainWindow::actionAlignJustify()
|
||||
|
||||
void cMainWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("main/width", QVariant::fromValue(size().width()));
|
||||
settings.setValue("main/height", QVariant::fromValue(size().height()));
|
||||
settings.setValue("main/x", QVariant::fromValue(x()));
|
||||
settings.setValue("main/y", QVariant::fromValue(y()));
|
||||
settings.setValue("main/splitter1", QVariant::fromValue(ui->m_lpMainSplitter->sizes()[0]));
|
||||
settings.setValue("main/splitter2", QVariant::fromValue(ui->m_lpMainSplitter->sizes()[1]));
|
||||
if(this->isMaximized())
|
||||
settings.setValue("main/maximized", QVariant::fromValue(true));
|
||||
else
|
||||
settings.setValue("main/maximized", QVariant::fromValue(false));
|
||||
|
||||
if(m_bSomethingChanged)
|
||||
{
|
||||
switch(QMessageBox::question(this, tr("Save"), m_lpStoryBook->title() + tr(" has been changed.\nDo you want to save?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel))
|
||||
@@ -143,6 +125,18 @@ void cMainWindow::closeEvent(QCloseEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
QSettings settings;
|
||||
settings.setValue("main/width", QVariant::fromValue(size().width()));
|
||||
settings.setValue("main/height", QVariant::fromValue(size().height()));
|
||||
settings.setValue("main/x", QVariant::fromValue(x()));
|
||||
settings.setValue("main/y", QVariant::fromValue(y()));
|
||||
settings.setValue("main/splitter1", QVariant::fromValue(ui->m_lpMainSplitter->sizes()[0]));
|
||||
settings.setValue("main/splitter2", QVariant::fromValue(ui->m_lpMainSplitter->sizes()[1]));
|
||||
if(this->isMaximized())
|
||||
settings.setValue("main/maximized", QVariant::fromValue(true));
|
||||
else
|
||||
settings.setValue("main/maximized", QVariant::fromValue(false));
|
||||
|
||||
event->accept();
|
||||
}
|
||||
|
||||
@@ -259,6 +253,10 @@ void cMainWindow::createFileActions()
|
||||
m_lpFileMenu->addSeparator();
|
||||
#endif
|
||||
|
||||
lpAction = m_lpFileMenu->addAction(tr("P&roperties..."), this, &cMainWindow::onFileProperties);
|
||||
lpAction->setPriority(QAction::LowPriority);
|
||||
m_lpFileMenu->addSeparator();
|
||||
|
||||
lpAction = m_lpFileMenu->addAction(tr("&Quit"), this, &QWidget::close);
|
||||
lpAction->setShortcut(Qt::CTRL + Qt::Key_Q);
|
||||
}
|
||||
@@ -819,6 +817,29 @@ void cMainWindow::onRechercheDoubleClicked(const QModelIndex& index)
|
||||
onShowRechercheWindow(lpRecherche);
|
||||
}
|
||||
|
||||
void cMainWindow::onShowPropertiesWindow()
|
||||
{
|
||||
for(int x = 0;x < ui->m_lpMainTab->count();x++)
|
||||
{
|
||||
cWidget* lpWidget = (cWidget*)ui->m_lpMainTab->widget(x);
|
||||
if(lpWidget->type() == cWidget::TYPE_properties)
|
||||
{
|
||||
ui->m_lpMainTab->setCurrentIndex(x);
|
||||
ui->m_lpMdiArea->setActiveSubWindow(lpWidget->window());
|
||||
m_bUpdatingTab = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
cPropertiesWindow* lpPropertiesWindow = new cPropertiesWindow(this);
|
||||
lpPropertiesWindow->setBook(m_lpStoryBook->book());
|
||||
cWidget* lpWidget1 = new cWidget(lpPropertiesWindow);
|
||||
lpWidget1->setWindow(ui->m_lpMdiArea->addSubWindow(lpPropertiesWindow));
|
||||
ui->m_lpMainTab->addTab((QWidget*)lpWidget1, lpPropertiesWindow->windowTitle());
|
||||
|
||||
lpPropertiesWindow->show();
|
||||
}
|
||||
|
||||
void cMainWindow::onShowPartWindow(cPart* lpPart)
|
||||
{
|
||||
for(int x = 0;x < ui->m_lpMainTab->count();x++)
|
||||
@@ -1156,6 +1177,43 @@ void cMainWindow::onRechercheContextMenu(const QPoint& pos)
|
||||
|
||||
void cMainWindow::onFileNew()
|
||||
{
|
||||
// QString szPath = QDir::homePath() + QDir::separator() + "OneDrive - WINDESIGN" + QDir::separator() + "__BOOKS__" + QDir::separator() + "qtStoryWriter" + QDir::separator() + "rückwärts.storyWriter" ;
|
||||
// m_lpStoryBook = new cStoryBook(szPath);
|
||||
// m_lpStoryBook->fillOutlineList(ui->m_lpOutlineList);
|
||||
// m_lpStoryBook->fillCharacterList(ui->m_lpCharacterList);
|
||||
// m_lpStoryBook->fillPlaceList(ui->m_lpPlaceList);
|
||||
// m_lpStoryBook->fillObjectList(ui->m_lpObjectList);
|
||||
// m_lpStoryBook->fillRechercheList(ui->m_lpRechercheList);
|
||||
|
||||
if(m_bSomethingChanged)
|
||||
{
|
||||
switch(QMessageBox::question(this, tr("Save"), m_lpStoryBook->title() + tr(" has been changed.\nDo you want to save?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel))
|
||||
{
|
||||
case QMessageBox::Yes:
|
||||
if(!onFileSave())
|
||||
return;
|
||||
break;
|
||||
case QMessageBox::No:
|
||||
break;
|
||||
case QMessageBox::Cancel:
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(m_lpStoryBook)
|
||||
delete m_lpStoryBook;
|
||||
|
||||
m_lpStoryBook = new cStoryBook;
|
||||
|
||||
m_lpStoryBook->fillOutlineList(ui->m_lpOutlineList);
|
||||
m_lpStoryBook->fillCharacterList(ui->m_lpCharacterList);
|
||||
m_lpStoryBook->fillPlaceList(ui->m_lpPlaceList);
|
||||
m_lpStoryBook->fillObjectList(ui->m_lpObjectList);
|
||||
m_lpStoryBook->fillRechercheList(ui->m_lpRechercheList);
|
||||
|
||||
updateWindowTitle();
|
||||
}
|
||||
|
||||
void cMainWindow::onFileOpen()
|
||||
@@ -1165,7 +1223,23 @@ void cMainWindow::onFileOpen()
|
||||
bool cMainWindow::onFileSave()
|
||||
{
|
||||
if(m_lpStoryBook)
|
||||
m_lpStoryBook->save();
|
||||
{
|
||||
if(m_lpStoryBook->project().isEmpty())
|
||||
{
|
||||
QString szProjectName = getProjectName();
|
||||
if(szProjectName.isEmpty())
|
||||
return(false);
|
||||
|
||||
QFile file(szProjectName);
|
||||
if(file.exists())
|
||||
file.remove();
|
||||
|
||||
if(!m_lpStoryBook->saveAs(szProjectName))
|
||||
return(false);
|
||||
}
|
||||
else
|
||||
m_lpStoryBook->save();
|
||||
}
|
||||
m_bSomethingChanged = false;
|
||||
updateWindowTitle();
|
||||
|
||||
@@ -1174,8 +1248,21 @@ bool cMainWindow::onFileSave()
|
||||
|
||||
bool cMainWindow::onFileSaveAs()
|
||||
{
|
||||
return(onFileSave());
|
||||
// return(true);
|
||||
QString szProjectName = getProjectName();
|
||||
if(szProjectName.isEmpty())
|
||||
return(false);
|
||||
|
||||
QFile file(szProjectName);
|
||||
if(file.exists())
|
||||
file.remove();
|
||||
|
||||
if(!m_lpStoryBook->saveAs(szProjectName))
|
||||
return(false);
|
||||
|
||||
m_bSomethingChanged = false;
|
||||
updateWindowTitle();
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
void cMainWindow::onFilePrint()
|
||||
@@ -1190,6 +1277,11 @@ void cMainWindow::onFilePrintPdf()
|
||||
{
|
||||
}
|
||||
|
||||
void cMainWindow::onFileProperties()
|
||||
{
|
||||
onShowPropertiesWindow();
|
||||
}
|
||||
|
||||
void cMainWindow::onClipboardDataChanged()
|
||||
{
|
||||
#ifndef QT_NO_CLIPBOARD
|
||||
@@ -1725,3 +1817,16 @@ void cMainWindow::onEditRecherche()
|
||||
void cMainWindow::onDeleteRecherche()
|
||||
{
|
||||
}
|
||||
|
||||
QString cMainWindow::getProjectName(const QString& szFileName)
|
||||
{
|
||||
QFileDialog dialog;
|
||||
QString szPath = szFileName;
|
||||
|
||||
if(szPath.isEmpty())
|
||||
szPath = QDir::homePath();
|
||||
|
||||
QString szProjectName = QFileDialog::getSaveFileName(this, tr("Save Project"), szPath, tr("StoryWriter Files (*.storyWriter)"));
|
||||
|
||||
return(szProjectName);
|
||||
}
|
||||
|
||||
@@ -299,6 +299,13 @@ private slots:
|
||||
*/
|
||||
void onRechercheDoubleClicked(const QModelIndex& index);
|
||||
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn onShowPropertiesWindow
|
||||
*/
|
||||
void onShowPropertiesWindow();
|
||||
|
||||
/*!
|
||||
\brief
|
||||
|
||||
@@ -429,6 +436,12 @@ private slots:
|
||||
\fn onFilePrintPdf
|
||||
*/
|
||||
void onFilePrintPdf();
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn onFilePrintPdf
|
||||
*/
|
||||
void onFileProperties();
|
||||
|
||||
/*!
|
||||
\brief
|
||||
@@ -727,6 +740,14 @@ private:
|
||||
*/
|
||||
void disconnectTextEdit();
|
||||
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn getProjectName
|
||||
\return QString
|
||||
*/
|
||||
QString getProjectName(const QString& szFileName = QString());
|
||||
|
||||
protected:
|
||||
/*!
|
||||
\brief
|
||||
|
||||
+2
-1
@@ -64,7 +64,8 @@ void cPartWindow::setPart(cPart* lpPart, cChapterList* lpChapterList)
|
||||
|
||||
QStandardItem* lpItem = new QStandardItem(lpChapter->name());
|
||||
lpItem->setData(QVariant::fromValue(lpChapter));
|
||||
lpItem->setToolTip(lpChapter->description()->toPlainText());
|
||||
if(lpChapter->description())
|
||||
lpItem->setToolTip(lpChapter->description()->toPlainText());
|
||||
m_lpChapterModel->appendRow(lpItem);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
#include "cpropertieswindow.h"
|
||||
#include "ui_cpropertieswindow.h"
|
||||
|
||||
#include "cmainwindow.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
|
||||
cPropertiesWindow::cPropertiesWindow(QWidget *parent) :
|
||||
cMDISubWindow(parent),
|
||||
ui(new Ui::cPropertiesWindow),
|
||||
m_lpMainWindow((cMainWindow*)parent),
|
||||
m_lpBook(0)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->m_lpTitle, &cLineEdit::gotFocus, (cMainWindow*)parent, &cMainWindow::onLineEditGotFocus);
|
||||
connect(ui->m_lpTitle, &cLineEdit::lostFocus, (cMainWindow*)parent, &cMainWindow::onLineEditLostFocus);
|
||||
|
||||
connect(ui->m_lpSubTitle, &cLineEdit::gotFocus, (cMainWindow*)parent, &cMainWindow::onLineEditGotFocus);
|
||||
connect(ui->m_lpSubTitle, &cLineEdit::lostFocus, (cMainWindow*)parent, &cMainWindow::onLineEditLostFocus);
|
||||
|
||||
connect(ui->m_lpAuthor, &cLineEdit::gotFocus, (cMainWindow*)parent, &cMainWindow::onLineEditGotFocus);
|
||||
connect(ui->m_lpAuthor, &cLineEdit::lostFocus, (cMainWindow*)parent, &cMainWindow::onLineEditLostFocus);
|
||||
|
||||
connect(ui->m_lpStartedAt, &cDateTimeEdit::gotFocus, (cMainWindow*)parent, &cMainWindow::onDateTimeEditGotFocus);
|
||||
connect(ui->m_lpStartedAt, &cDateTimeEdit::lostFocus, (cMainWindow*)parent, &cMainWindow::onDateTimeEditLostFocus);
|
||||
|
||||
connect(ui->m_lpFinishedAt, &cDateTimeEdit::gotFocus, (cMainWindow*)parent, &cMainWindow::onDateTimeEditGotFocus);
|
||||
connect(ui->m_lpFinishedAt, &cDateTimeEdit::lostFocus, (cMainWindow*)parent, &cMainWindow::onDateTimeEditLostFocus);
|
||||
|
||||
connect(ui->m_lpTargetDate, &cDateTimeEdit::gotFocus, (cMainWindow*)parent, &cMainWindow::onDateTimeEditGotFocus);
|
||||
connect(ui->m_lpTargetDate, &cDateTimeEdit::lostFocus, (cMainWindow*)parent, &cMainWindow::onDateTimeEditLostFocus);
|
||||
|
||||
connect(ui->m_lpShortDescription, &cTextEdit::gotFocus, (cMainWindow*)parent, &cMainWindow::onTextEditGotFocus);
|
||||
connect(ui->m_lpShortDescription, &cTextEdit::lostFocus, (cMainWindow*)parent, &cMainWindow::onTextEditLostFocus);
|
||||
|
||||
connect(ui->m_lpDescription, &cTextEdit::gotFocus, (cMainWindow*)parent, &cMainWindow::onTextEditGotFocus);
|
||||
connect(ui->m_lpDescription, &cTextEdit::lostFocus, (cMainWindow*)parent, &cMainWindow::onTextEditLostFocus);
|
||||
}
|
||||
|
||||
|
||||
cPropertiesWindow::~cPropertiesWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void cPropertiesWindow::setBook(cBook* lpBook)
|
||||
{
|
||||
m_lpBook = lpBook;
|
||||
|
||||
ui->m_lpTitle->setText(lpBook->title());
|
||||
ui->m_lpSubTitle->setText(lpBook->subTitle());
|
||||
ui->m_lpAuthor->setText(lpBook->author());
|
||||
ui->m_lpStartedAt->setDateTime(lpBook->startedAt());
|
||||
ui->m_lpFinishedAt->setDateTime(lpBook->finishedAt());
|
||||
ui->m_lpTargetDate->setDateTime(lpBook->targetDate());
|
||||
ui->m_lpShortDescription->setDocument(lpBook->shortDescription());
|
||||
ui->m_lpDescription->setDocument(lpBook->description());
|
||||
|
||||
setWindowTitle(tr("[book] - properties"));
|
||||
|
||||
connect(ui->m_lpTitle, &cLineEdit::textChanged, this, &cPropertiesWindow::onTitleChanged);
|
||||
connect(ui->m_lpSubTitle, &cLineEdit::textChanged, this, &cPropertiesWindow::onSubTitleChanged);
|
||||
connect(ui->m_lpAuthor, &cLineEdit::textChanged, this, &cPropertiesWindow::onAuthorChanged);
|
||||
connect(ui->m_lpStartedAt, &cDateTimeEdit::dateTimeChanged, this, &cPropertiesWindow::onStartedAtChanged);
|
||||
connect(ui->m_lpFinishedAt, &cDateTimeEdit::dateTimeChanged, this, &cPropertiesWindow::onFinishedAtChanged);
|
||||
connect(ui->m_lpTargetDate, &cDateTimeEdit::dateTimeChanged, this, &cPropertiesWindow::onTargetDateChanged);
|
||||
connect(ui->m_lpShortDescription, &cTextEdit::textChanged, this, &cPropertiesWindow::onShortDescriptionChanged);
|
||||
connect(ui->m_lpDescription, &cTextEdit::textChanged, this, &cPropertiesWindow::onDescriptionChanged);
|
||||
}
|
||||
|
||||
cBook* cPropertiesWindow::book()
|
||||
{
|
||||
return(m_lpBook);
|
||||
}
|
||||
|
||||
void cPropertiesWindow::onTitleChanged(const QString& szName)
|
||||
{
|
||||
m_lpBook->setTitle(szName);
|
||||
m_lpMainWindow->somethingChanged();
|
||||
m_lpMainWindow->updateWindowTitle();
|
||||
}
|
||||
|
||||
void cPropertiesWindow::onSubTitleChanged(const QString& szName)
|
||||
{
|
||||
m_lpBook->setSubTitle(szName);
|
||||
m_lpMainWindow->somethingChanged();
|
||||
}
|
||||
|
||||
void cPropertiesWindow::onShortDescriptionChanged()
|
||||
{
|
||||
m_lpMainWindow->somethingChanged();
|
||||
}
|
||||
|
||||
void cPropertiesWindow::onAuthorChanged(const QString& szName)
|
||||
{
|
||||
m_lpBook->setAuthor(szName);
|
||||
m_lpMainWindow->somethingChanged();
|
||||
}
|
||||
|
||||
void cPropertiesWindow::onStartedAtChanged(const QDateTime& dateTime)
|
||||
{
|
||||
m_lpBook->setStartedAt(dateTime);
|
||||
m_lpMainWindow->somethingChanged();
|
||||
}
|
||||
|
||||
void cPropertiesWindow::onFinishedAtChanged(const QDateTime& dateTime)
|
||||
{
|
||||
m_lpBook->setFinishedAt(dateTime);
|
||||
m_lpMainWindow->somethingChanged();
|
||||
}
|
||||
|
||||
void cPropertiesWindow::onTargetDateChanged(const QDateTime& dateTime)
|
||||
{
|
||||
m_lpBook->setTargetDate(dateTime);
|
||||
m_lpMainWindow->somethingChanged();
|
||||
}
|
||||
|
||||
void cPropertiesWindow::onDescriptionChanged()
|
||||
{
|
||||
m_lpMainWindow->somethingChanged();
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
#ifndef CPROPERTIESWINDOW_H
|
||||
#define CPROPERTIESWINDOW_H
|
||||
|
||||
|
||||
#include "cbook.h"
|
||||
|
||||
#include "cmdisubwindow.h"
|
||||
#include "cmainwindow.h"
|
||||
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class cPropertiesWindow;
|
||||
}
|
||||
|
||||
class cPropertiesWindow : public cMDISubWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit cPropertiesWindow(QWidget *parent = 0);
|
||||
~cPropertiesWindow();
|
||||
|
||||
void setBook(cBook* lpBook);
|
||||
cBook* book();
|
||||
|
||||
private slots:
|
||||
void onTitleChanged(const QString& szName);
|
||||
void onSubTitleChanged(const QString& szName);
|
||||
void onAuthorChanged(const QString& szName);
|
||||
void onShortDescriptionChanged();
|
||||
void onDescriptionChanged();
|
||||
void onStartedAtChanged(const QDateTime& dateTime);
|
||||
void onFinishedAtChanged(const QDateTime& dateTime);
|
||||
void onTargetDateChanged(const QDateTime& dateTime);
|
||||
|
||||
private:
|
||||
Ui::cPropertiesWindow* ui;
|
||||
cMainWindow* m_lpMainWindow;
|
||||
cBook* m_lpBook;
|
||||
};
|
||||
|
||||
#endif // CPROPERTIESWINDOW_H
|
||||
@@ -0,0 +1,164 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>cPropertiesWindow</class>
|
||||
<widget class="QWidget" name="cPropertiesWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>725</width>
|
||||
<height>528</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout" rowstretch="1,0,0,0,0,0">
|
||||
<item row="3" column="1">
|
||||
<widget class="cDateTimeEdit" name="m_lpStartedAt">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Started at:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Short Description:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Finished at:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Author:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Description:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Title:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Subtitle:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="cDateTimeEdit" name="m_lpFinishedAt">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Target Date:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="5">
|
||||
<widget class="cLineEdit" name="m_lpTitle"/>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="5">
|
||||
<widget class="cLineEdit" name="m_lpSubTitle"/>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="5">
|
||||
<widget class="cLineEdit" name="m_lpAuthor"/>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="5">
|
||||
<widget class="cTextEdit" name="m_lpShortDescription"/>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="5">
|
||||
<widget class="cTextEdit" name="m_lpDescription"/>
|
||||
</item>
|
||||
<item row="3" column="5">
|
||||
<widget class="cDateTimeEdit" name="m_lpTargetDate"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>cTextEdit</class>
|
||||
<extends>QTextEdit</extends>
|
||||
<header>ctextedit.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>cLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>clineedit.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>cDateTimeEdit</class>
|
||||
<extends>QDateTimeEdit</extends>
|
||||
<header>cdatetimeedit.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>m_lpTitle</tabstop>
|
||||
<tabstop>m_lpSubTitle</tabstop>
|
||||
<tabstop>m_lpAuthor</tabstop>
|
||||
<tabstop>m_lpStartedAt</tabstop>
|
||||
<tabstop>m_lpFinishedAt</tabstop>
|
||||
<tabstop>m_lpTargetDate</tabstop>
|
||||
<tabstop>m_lpShortDescription</tabstop>
|
||||
<tabstop>m_lpDescription</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -29,6 +29,8 @@ cStoryBook::cStoryBook(QObject *parent) :
|
||||
m_szProject(""),
|
||||
m_bIsOpen(false)
|
||||
{
|
||||
m_book.setTitle("untitled");
|
||||
m_bIsOpen = true;
|
||||
}
|
||||
|
||||
cStoryBook::cStoryBook(const QString &szProject, QObject *parent) :
|
||||
@@ -519,6 +521,11 @@ QString cStoryBook::author()
|
||||
return(m_book.author());
|
||||
}
|
||||
|
||||
cBook* cStoryBook::book()
|
||||
{
|
||||
return(&m_book);
|
||||
}
|
||||
|
||||
cChapterList* cStoryBook::chapterList()
|
||||
{
|
||||
return(&m_chapterList);
|
||||
@@ -529,6 +536,11 @@ cSceneList* cStoryBook::sceneList()
|
||||
return(&m_sceneList);
|
||||
}
|
||||
|
||||
QString cStoryBook::project()
|
||||
{
|
||||
return(m_szProject);
|
||||
}
|
||||
|
||||
bool cStoryBook::addPart(const QString& szPartName)
|
||||
{
|
||||
cPart* lpPart = m_partList.add(-1);
|
||||
|
||||
@@ -144,6 +144,20 @@ public:
|
||||
*/
|
||||
bool fillRechercheList(QTreeView* lpView);
|
||||
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn project
|
||||
\return QString
|
||||
*/
|
||||
QString project();
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn book
|
||||
\return cBook
|
||||
*/
|
||||
cBook* book();
|
||||
/*!
|
||||
\brief
|
||||
|
||||
|
||||
@@ -6,6 +6,14 @@
|
||||
#include "cwidget.h"
|
||||
|
||||
|
||||
cWidget::cWidget(cPropertiesWindow* parent) :
|
||||
QWidget(parent),
|
||||
m_type(TYPE_properties),
|
||||
m_lpWidget(parent),
|
||||
m_lpWindow(0)
|
||||
{
|
||||
}
|
||||
|
||||
cWidget::cWidget(cPartWindow* parent) :
|
||||
QWidget(parent),
|
||||
m_type(TYPE_part),
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define CWIDGET_H
|
||||
|
||||
|
||||
#include "cpropertieswindow.h"
|
||||
#include "cpartwindow.h"
|
||||
#include "cchapterwindow.h"
|
||||
#include "cscenewindow.h"
|
||||
@@ -38,8 +39,17 @@ public:
|
||||
TYPE_object = 5, /*!< TODO: describe */
|
||||
TYPE_place = 6,
|
||||
TYPE_recherche = 7,
|
||||
TYPE_properties = 8,
|
||||
};
|
||||
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn cWidget
|
||||
\param parent
|
||||
*/
|
||||
explicit cWidget(cPropertiesWindow* parent);
|
||||
|
||||
/*!
|
||||
\brief
|
||||
|
||||
|
||||
+6
-3
@@ -73,7 +73,8 @@ SOURCES += \
|
||||
cdateedit.cpp \
|
||||
cdoublespinbox.cpp \
|
||||
ccombobox.cpp \
|
||||
cdatetimeedit.cpp
|
||||
cdatetimeedit.cpp \
|
||||
cpropertieswindow.cpp
|
||||
|
||||
HEADERS += \
|
||||
cmainwindow.h \
|
||||
@@ -108,7 +109,8 @@ HEADERS += \
|
||||
cdateedit.h \
|
||||
cdoublespinbox.h \
|
||||
ccombobox.h \
|
||||
cdatetimeedit.h
|
||||
cdatetimeedit.h \
|
||||
cpropertieswindow.h
|
||||
|
||||
FORMS += \
|
||||
cmainwindow.ui \
|
||||
@@ -119,7 +121,8 @@ FORMS += \
|
||||
cimagewidget.ui \
|
||||
cobjectwindow.ui \
|
||||
cplacewindow.ui \
|
||||
crecherchewindow.ui
|
||||
crecherchewindow.ui \
|
||||
cpropertieswindow.ui
|
||||
|
||||
DISTFILES += \
|
||||
storyBook.project \
|
||||
|
||||
Reference in New Issue
Block a user