diff options
author | Kandrashin Denis <mail@lintest.ru> | 2012-09-19 13:20:39 +0400 |
---|---|---|
committer | Kandrashin Denis <mail@lintest.ru> | 2012-09-19 13:20:39 +0400 |
commit | b73af560cb658c8d853d167481e82337b52f3451 (patch) | |
tree | 6f1526f982681b8b583ac76cb5f73103cc5f456a | |
parent | 5aed63b3c3d43827640ad52fc1d7544964217cce (diff) |
Section actions
-rw-r--r-- | 3rdparty/gnome/16x16/format-indent-less.png | bin | 0 -> 616 bytes | |||
-rw-r--r-- | 3rdparty/gnome/16x16/format-indent-more.png | bin | 0 -> 647 bytes | |||
-rw-r--r-- | 3rdparty/gnome/24x24/format-indent-less.png | bin | 0 -> 797 bytes | |||
-rw-r--r-- | 3rdparty/gnome/24x24/format-indent-more.png | bin | 0 -> 804 bytes | |||
-rw-r--r-- | 3rdparty/gnome/gnome.qrc | 66 | ||||
-rw-r--r-- | source/fb2main.cpp | 17 | ||||
-rw-r--r-- | source/fb2main.hpp | 4 | ||||
-rw-r--r-- | source/fb2text.cpp | 6 | ||||
-rw-r--r-- | source/fb2text.hpp | 3 |
9 files changed, 91 insertions, 5 deletions
diff --git a/3rdparty/gnome/16x16/format-indent-less.png b/3rdparty/gnome/16x16/format-indent-less.png Binary files differnew file mode 100644 index 0000000..ed971bc --- /dev/null +++ b/3rdparty/gnome/16x16/format-indent-less.png diff --git a/3rdparty/gnome/16x16/format-indent-more.png b/3rdparty/gnome/16x16/format-indent-more.png Binary files differnew file mode 100644 index 0000000..81b8859 --- /dev/null +++ b/3rdparty/gnome/16x16/format-indent-more.png diff --git a/3rdparty/gnome/24x24/format-indent-less.png b/3rdparty/gnome/24x24/format-indent-less.png Binary files differnew file mode 100644 index 0000000..3a489e2 --- /dev/null +++ b/3rdparty/gnome/24x24/format-indent-less.png diff --git a/3rdparty/gnome/24x24/format-indent-more.png b/3rdparty/gnome/24x24/format-indent-more.png Binary files differnew file mode 100644 index 0000000..481e7b7 --- /dev/null +++ b/3rdparty/gnome/24x24/format-indent-more.png diff --git a/3rdparty/gnome/gnome.qrc b/3rdparty/gnome/gnome.qrc index 2a96728..77811d6 100644 --- a/3rdparty/gnome/gnome.qrc +++ b/3rdparty/gnome/gnome.qrc @@ -60,5 +60,71 @@ <file>24x24/zoom-in.png</file> <file>24x24/zoom-original.png</file> <file>24x24/zoom-out.png</file> + <file>16x16/application-exit.png</file> + <file>16x16/document-new.png</file> + <file>16x16/document-open.png</file> + <file>16x16/document-properties.png</file> + <file>16x16/document-save.png</file> + <file>16x16/edit-clear.png</file> + <file>16x16/edit-copy.png</file> + <file>16x16/edit-cut.png</file> + <file>16x16/edit-find.png</file> + <file>16x16/edit-find-replace.png</file> + <file>16x16/edit-paste.png</file> + <file>16x16/edit-redo.png</file> + <file>16x16/edit-undo.png</file> + <file>16x16/format-indent-less.png</file> + <file>16x16/format-indent-more.png</file> + <file>16x16/format-text-bold.png</file> + <file>16x16/format-text-italic.png</file> + <file>16x16/format-text-strikethrough.png</file> + <file>16x16/go-down.png</file> + <file>16x16/go-next.png</file> + <file>16x16/go-previous.png</file> + <file>16x16/go-up.png</file> + <file>16x16/insert-image.png</file> + <file>16x16/insert-link.png</file> + <file>16x16/insert-object.png</file> + <file>16x16/insert-text.png</file> + <file>16x16/list-add.png</file> + <file>16x16/list-remove.png</file> + <file>16x16/preferences-desktop.png</file> + <file>16x16/window-close.png</file> + <file>16x16/zoom-in.png</file> + <file>16x16/zoom-original.png</file> + <file>16x16/zoom-out.png</file> + <file>24x24/application-exit.png</file> + <file>24x24/document-new.png</file> + <file>24x24/document-open.png</file> + <file>24x24/document-properties.png</file> + <file>24x24/document-save.png</file> + <file>24x24/edit-clear.png</file> + <file>24x24/edit-copy.png</file> + <file>24x24/edit-cut.png</file> + <file>24x24/edit-find.png</file> + <file>24x24/edit-find-replace.png</file> + <file>24x24/edit-paste.png</file> + <file>24x24/edit-redo.png</file> + <file>24x24/edit-undo.png</file> + <file>24x24/format-indent-less.png</file> + <file>24x24/format-indent-more.png</file> + <file>24x24/format-text-bold.png</file> + <file>24x24/format-text-italic.png</file> + <file>24x24/format-text-strikethrough.png</file> + <file>24x24/go-down.png</file> + <file>24x24/go-next.png</file> + <file>24x24/go-previous.png</file> + <file>24x24/go-up.png</file> + <file>24x24/insert-image.png</file> + <file>24x24/insert-link.png</file> + <file>24x24/insert-object.png</file> + <file>24x24/insert-text.png</file> + <file>24x24/list-add.png</file> + <file>24x24/list-remove.png</file> + <file>24x24/preferences-desktop.png</file> + <file>24x24/window-close.png</file> + <file>24x24/zoom-in.png</file> + <file>24x24/zoom-original.png</file> + <file>24x24/zoom-out.png</file> </qresource> </RCC> diff --git a/source/fb2main.cpp b/source/fb2main.cpp index 9071c74..6c5e300 100644 --- a/source/fb2main.cpp +++ b/source/fb2main.cpp @@ -391,7 +391,7 @@ void FbMainWindow::createActions() menu->addSeparator(); - actionSectSeparator = act = new QAction(tr("Section break"), this); + actionSimpleText = act = new QAction(tr("Simple text"), this); menu->addAction(act); actionParaSeparator = act = new QAction(tr("Paragraph"), this); @@ -434,6 +434,14 @@ void FbMainWindow::createActions() menu->addAction(act); act->setEnabled(false); + menu->addSeparator(); + + actionSectionAdd = act = new FbTextAction(FbIcon("format-indent-more"), tr("Create section"), QWebPage::ToggleSubscript, this); + menu->addAction(act); + + actionSectionDel = act = new FbTextAction(FbIcon("format-indent-less"), tr("Remove section"), QWebPage::ToggleSubscript, this); + menu->addAction(act); + menuView = menu = menuBar()->addMenu(tr("&View")); tool->addSeparator(); @@ -709,10 +717,12 @@ void FbMainWindow::createTextToolbar() connect(actionDate, SIGNAL(triggered()), textPage, SLOT(insertDate())); connect(actionBody, SIGNAL(triggered()), textPage, SLOT(insertBody())); - connect(actionSectSeparator, SIGNAL(triggered()), textPage, SLOT(separateSection())); connect(actionParaSeparator, SIGNAL(triggered()), textEdit->pageAction(QWebPage::InsertParagraphSeparator), SIGNAL(triggered())); connect(actionLineSeparator, SIGNAL(triggered()), textEdit->pageAction(QWebPage::InsertLineSeparator), SIGNAL(triggered())); + connect(actionSectionAdd, SIGNAL(triggered()), textPage, SLOT(createSection())); + connect(actionSectionDel, SIGNAL(triggered()), textPage, SLOT(deleteSection())); + connect(actionZoomIn, SIGNAL(triggered()), textEdit, SLOT(zoomIn())); connect(actionZoomOut, SIGNAL(triggered()), textEdit, SLOT(zoomOut())); connect(actionZoomReset, SIGNAL(triggered()), textEdit, SLOT(zoomReset())); @@ -725,7 +735,10 @@ void FbMainWindow::createTextToolbar() textEdit->addTools(tool); tool->addSeparator(); + tool->addAction(actionSectionAdd); + tool->addAction(actionSectionDel); + tool->addSeparator(); tool->addAction(actionImage); tool->addAction(actionNote); tool->addAction(actionLink); diff --git a/source/fb2main.hpp b/source/fb2main.hpp index 2bdcb2f..b9481d0 100644 --- a/source/fb2main.hpp +++ b/source/fb2main.hpp @@ -139,7 +139,7 @@ private: *actionStanza, *actionAuthor, *actionSection, - *actionSectSeparator, + *actionSimpleText, *actionParaSeparator, *actionLineSeparator, *actionClearFormat, @@ -149,6 +149,8 @@ private: *actionTextCode, *actionTextSub, *actionTextSup, + *actionSectionAdd, + *actionSectionDel, *actionContents, *actionPictures, *actionInspect, diff --git a/source/fb2text.cpp b/source/fb2text.cpp index cddbd57..f3259d3 100644 --- a/source/fb2text.cpp +++ b/source/fb2text.cpp @@ -277,12 +277,16 @@ void FbTextPage::insertDate() { } -void FbTextPage::separateSection() +void FbTextPage::createSection() { static const QString javascript = FB2::read(":/js/new_section.js"); mainFrame()->evaluateJavaScript(javascript); } +void FbTextPage::deleteSection() +{ +} + FbTextElement FbTextPage::current() { return element(location()); diff --git a/source/fb2text.hpp b/source/fb2text.hpp index 0c74ae3..da35357 100644 --- a/source/fb2text.hpp +++ b/source/fb2text.hpp @@ -90,7 +90,8 @@ public slots: void insertPoem(); void insertStanza(); void insertDate(); - void separateSection(); + void createSection(); + void deleteSection(); protected: virtual bool acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type); |