Skip to content

Commit 27f7087

Browse files
author
Jordan
committed
Add README. Get ready to merge with master.
1 parent ae8c17b commit 27f7087

21 files changed

+401
-395
lines changed

Plotline.pro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ SUBDIRS = src \
99
test \
1010
doc
1111

12+
OTHER_FILES = \
13+
README.markdown

README.markdown

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Plotline
2+
3+
Plotline is an application to assist in the creation of a novel. While this does
4+
not fully replace the old-school P&P (pencil & paper) method, it is nice to have
5+
everything in one place. Some of the [planned] features include:
6+
7+
- Planning the novel plot arc, form inciting incident to the climax.
8+
- Adding characters, with prompts for character biographies.
9+
- Creating plotlines for the novel, and assigning characters as part of the
10+
plotlines.
11+
- Adding scenes to the novel to plan out exactly how the novel will work out.
12+
- Best feature: a full-fleged editor, with markdown syntax highlighting support
13+
and a distraction-free mode.
14+
- Better feature: binding the novel content into a various format, ebook or
15+
otherwise.
16+
17+
## Current State
18+
19+
The back-end works fine and passes all tests. If someone wants to go for more
20+
test coverage I wouldn't complain.
21+
22+
After a revamp to refactor the code into the seperate tab frames I've been
23+
reconnecting the signals. The basic theory looks like this:
24+
25+
[Main App, *novel]
26+
|
27+
+---------+--------+-----------+-----------+
28+
| | | | |
29+
Novel Character Plotline Scene Chapter
30+
Frame Frame Frame frame frame
31+
[*novel] [*novel] [*novel] [*novel] [*novel]
32+
33+
Each frame will contain a pointer to the currently-opened novel stored in the
34+
pointer `novel`. Each frame corresponds to the named backend class, so
35+
`NovelFrame` is the view for the `Novel` class, `CharacterFrame` is the view for
36+
the `Character` class and so-on.
37+
38+
Each frame is a subclass `PlotlineAppFrame`, which inherits the signal
39+
`novelModified()` (which will notify the `MainWindow` when a change occurs)
40+
and the slots `noNovelLoad()` (which will update the frame fields when a new
41+
novel is loaded) and `onNovelNew()` (which will clear the frame's fields).
42+
43+
## Getting a Development Environment Set Up
44+
45+
### Getting Qt
46+
47+
Plotline was developed in Qt, a C++ applicaiton framework. If you're new to Qt,
48+
now is the best time to learn!
49+
50+
Side note: if you're new to Qt, Qt doesn't use a conventional build system like
51+
CMake or Make. Instead, it uses QMake, which generates the Make files and meta
52+
objects. So if you try to load the project in KDevelop or Eclipse or try to
53+
compile on the command line it might get kind of frustrating. QtCreator was used
54+
to develop this application, and that's what I would recommend.
55+
56+
Okay, back to set-up.
57+
58+
First thing's first, you'll need to install Qt5. Either install it with your
59+
distribution's package manager (in the case of Linux) or download from
60+
[Qt.io](http://www.qt.io/) and install that way.
61+
62+
### Getting the source.
63+
64+
Installing Qt should have also installed QtCreator. Open QtCreator and go to
65+
**File > New File or Project > Import Project > Git Clone**. In *Repository*
66+
enter `https://github.com/plotline.git`. Check **Recursive** --this will import
67+
submodules. If the current version doesn't have submodules, most likely others
68+
will.
69+
70+
#### Command line
71+
72+
Alternatively, if you're a command-line mastro, you can git clone the
73+
repository:
74+
75+
$ git clone https://github.com/plotline.git
76+
$ cd plotline
77+
$ git submodule init
78+
$ git submdoule sync
79+
80+
And then open the project with **File > Open File or Project**, and open the
81+
Project (`.pro`) file.
82+
83+
84+
### Important!!! Set the Library path
85+
86+
One more thing needs to be attended to. The core application code (in **lib** )
87+
is a static library in order to allow linking with either the **test**
88+
subproject or the **app** subproject.
89+
90+
To add this path to the library, go to the **Projects** tab along the lefthand
91+
side of QtDesigner. Up at the top click on the **Run** tab. Expand the
92+
**Environment** section and modify the `LD_LIBRARY_PATH` variable to append the
93+
path `../lib/`. For example, if the original value was
94+
95+
/usr/lib/x86_64-linux-gnu/
96+
97+
Modify the value to look like this:
98+
99+
/usr/lib/x86_64-linux-gnu/:../lib/
100+
101+
Remember, `:` means "append" in make. ;-)
102+
103+
Do the same for the other subprojects by selecting the run button (that looks
104+
like this:
105+
106+
![Qt Run Button](./doc/images/qt-run-button.png)
107+
108+
)

doc/images/qt-run-button.png

2.09 KB
Loading

src/app/app.pro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ HEADERS += mainwindow.h \
2121
plotframe.h \
2222
sceneframe.h \
2323
chaptersframe.h \
24-
novelframe.h
24+
novelframe.h \
25+
plotlineappframe.h
2526

2627
SOURCES += main.cpp \
2728
mainwindow.cpp \
@@ -35,7 +36,8 @@ SOURCES += main.cpp \
3536
plotframe.cpp \
3637
sceneframe.cpp \
3738
chaptersframe.cpp \
38-
novelframe.cpp
39+
novelframe.cpp \
40+
plotlineappframe.cpp
3941

4042
LIBS += \
4143
../lib/libplotline.so

src/app/chaptersframe.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include "chaptersframe.h"
22
#include "ui_chaptersframe.h"
33

4-
ChaptersFrame::ChaptersFrame(QWidget *parent) :
5-
QFrame(parent),
4+
ChaptersFrame::ChaptersFrame(Novel *novel, QWidget *parent) :
5+
PlotlineAppFrame(novel, parent),
66
ui(new Ui::ChaptersFrame)
77
{
88
ui->setupUi(this);
@@ -12,3 +12,13 @@ ChaptersFrame::~ChaptersFrame()
1212
{
1313
delete ui;
1414
}
15+
16+
void ChaptersFrame::onNovelLoad()
17+
{
18+
19+
}
20+
21+
void ChaptersFrame::onNovelNew()
22+
{
23+
24+
}

src/app/chaptersframe.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
#ifndef CHAPTERSFRAME_H
22
#define CHAPTERSFRAME_H
33

4-
#include <QFrame>
4+
#include "plotlineappframe.h"
55

66
namespace Ui {
77
class ChaptersFrame;
88
}
99

10-
class ChaptersFrame : public QFrame
10+
class ChaptersFrame : public PlotlineAppFrame
1111
{
1212
Q_OBJECT
1313

1414
public:
15-
explicit ChaptersFrame(QWidget *parent = 0);
15+
explicit ChaptersFrame(Novel *novel, QWidget *parent = 0);
1616
~ChaptersFrame();
1717

1818
private:
1919
Ui::ChaptersFrame *ui;
20+
21+
signals:
22+
void novelModified();
23+
24+
public slots:
25+
void onNovelLoad();
26+
void onNovelNew();
2027
};
2128

2229
#endif // CHAPTERSFRAME_H

src/app/characterframe.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
#include "characterframe.h"
22
#include "ui_characterframe.h"
33

4-
CharacterFrame::CharacterFrame(QWidget *parent) :
5-
QFrame(parent),
4+
CharacterFrame::CharacterFrame(Novel *novel, QWidget *parent) :
5+
PlotlineAppFrame(novel, parent),
66
ui(new Ui::CharacterFrame)
77
{
88
ui->setupUi(this);
9+
mItemModel = new CharacterItemModel(mNovel);
910
}
1011

1112
CharacterFrame::~CharacterFrame()
1213
{
1314
delete ui;
1415
}
16+
17+
void CharacterFrame::onNovelLoad()
18+
{
19+
mItemModel = new CharacterItemModel(mNovel);
20+
}
21+
22+
void CharacterFrame::onNovelNew()
23+
{
24+
mItemModel = new CharacterItemModel(mNovel);
25+
}
26+
27+
void CharacterFrame::on_addCharacter_clicked()
28+
{
29+
mItemModel->addCharacter();
30+
emit novelModified();
31+
}

src/app/characterframe.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,32 @@
22
#define CHARACTERFRAME_H
33

44
#include <QFrame>
5+
#include "plotlineappframe.h"
6+
#include "characteritemmodel.h"
57

68
namespace Ui {
79
class CharacterFrame;
810
}
911

10-
class CharacterFrame : public QFrame
12+
class CharacterFrame : public PlotlineAppFrame
1113
{
1214
Q_OBJECT
1315

1416
public:
15-
explicit CharacterFrame(QWidget *parent = 0);
17+
explicit CharacterFrame(Novel *novel, QWidget *parent = 0);
1618
~CharacterFrame();
1719

20+
public slots:
21+
void onNovelLoad();
22+
void onNovelNew();
23+
24+
private slots:
25+
void on_addCharacter_clicked();
26+
1827
private:
1928
Ui::CharacterFrame *ui;
29+
30+
CharacterItemModel *mItemModel;
2031
};
2132

2233
#endif // CHARACTERFRAME_H

0 commit comments

Comments
 (0)