Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/lintest/fb2edit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKandrashin Denis <mail@lintest.ru>2012-09-14 22:46:43 +0400
committerKandrashin Denis <mail@lintest.ru>2012-09-14 22:47:06 +0400
commitc37f785bf2259ddbbad3d711c9845073d6d44deb (patch)
treeaa31da6e3e4ec6323c3632f06ff2bd653770e475
parentf84a377601cefff8412d4b4039208bad05c091dc (diff)
Replace: &view => *m_view
-rw-r--r--fb2edit.pro3
-rw-r--r--source/fb2head.cpp4
-rw-r--r--source/fb2head.hpp2
-rw-r--r--source/fb2main.cpp46
-rw-r--r--source/fb2temp.cpp12
-rw-r--r--source/fb2temp.hpp4
-rw-r--r--source/fb2text.cpp36
-rw-r--r--source/fb2text.hpp12
-rw-r--r--source/fb2tree.cpp4
-rw-r--r--source/fb2tree.hpp2
-rw-r--r--source/ts/ru.ts11
11 files changed, 81 insertions, 55 deletions
diff --git a/fb2edit.pro b/fb2edit.pro
index 86b2fba..e986d84 100644
--- a/fb2edit.pro
+++ b/fb2edit.pro
@@ -65,4 +65,5 @@ if (unix) {
}
FORMS += \
- source/fb2find.ui
+ source/fb2find.ui \
+ ../untitled.ui
diff --git a/source/fb2head.cpp b/source/fb2head.cpp
index 42f9a85..5c137fe 100644
--- a/source/fb2head.cpp
+++ b/source/fb2head.cpp
@@ -459,9 +459,9 @@ Qt::ItemFlags FbHeadModel::flags(const QModelIndex &index) const
// FbTreeView
//---------------------------------------------------------------------------
-FbHeadView::FbHeadView(FbTextEdit &view, QWidget *parent)
+FbHeadView::FbHeadView(FbTextEdit *view, QWidget *parent)
: QTreeView(parent)
- , m_view(view)
+ , m_view(*view)
{
QAction * act;
diff --git a/source/fb2head.hpp b/source/fb2head.hpp
index 86b9212..68cee58 100644
--- a/source/fb2head.hpp
+++ b/source/fb2head.hpp
@@ -156,7 +156,7 @@ class FbHeadView : public QTreeView
Q_OBJECT
public:
- explicit FbHeadView(FbTextEdit &view, QWidget *parent = 0);
+ explicit FbHeadView(FbTextEdit *view, QWidget *parent = 0);
void initToolbar(QToolBar &toolbar);
signals:
diff --git a/source/fb2main.cpp b/source/fb2main.cpp
index 0243fc2..fe83214 100644
--- a/source/fb2main.cpp
+++ b/source/fb2main.cpp
@@ -54,7 +54,7 @@ FbMainWindow::FbMainWindow(const QString &filename, ViewMode mode)
setCurrentFile(filename);
if (mode == FB2) {
viewText();
- textFrame->view.load(filename.isEmpty() ? ":blank.fb2" : filename);
+ textFrame->view()->load(filename.isEmpty() ? ":blank.fb2" : filename);
} else {
viewCode();
if (!filename.isEmpty()) loadXML(filename);
@@ -141,7 +141,7 @@ void FbMainWindow::fileOpen()
if (textFrame) {
if (isUntitled && !isWindowModified()) {
setCurrentFile(filename);
- textFrame->view.load(filename);
+ textFrame->view()->load(filename);
} else {
FbMainWindow * other = new FbMainWindow(filename, FB2);
other->move(x() + 40, y() + 40);
@@ -469,7 +469,7 @@ void FbMainWindow::createTree()
{
if (textFrame && centralWidget() == textFrame) {
dockTree = new FbDockWidget(tr("Contents"), this);
- dockTree->setWidget(new FbTreeWidget(textFrame->view, this));
+ dockTree->setWidget(new FbTreeWidget(textFrame->view(), this));
connect(dockTree, SIGNAL(destroyed()), SLOT(treeDestroyed()));
addDockWidget(Qt::LeftDockWidgetArea, dockTree);
}
@@ -479,7 +479,7 @@ void FbMainWindow::createImgs()
{
if (textFrame && centralWidget() == textFrame) {
dockImgs = new FbDockWidget(tr("Pictures"), this);
- dockImgs->setWidget(new FbListWidget(textFrame->view, this));
+ dockImgs->setWidget(new FbListWidget(textFrame->view(), this));
connect(dockImgs, SIGNAL(destroyed()), SLOT(imgsDestroyed()));
addDockWidget(Qt::RightDockWidgetArea, dockImgs);
}
@@ -487,16 +487,16 @@ void FbMainWindow::createImgs()
void FbMainWindow::selectionChanged()
{
- actionCut->setEnabled(textFrame->view.CutEnabled());
- actionCopy->setEnabled(textFrame->view.CopyEnabled());
+ actionCut->setEnabled(textFrame->view()->CutEnabled());
+ actionCopy->setEnabled(textFrame->view()->CopyEnabled());
- actionTextBold->setChecked(textFrame->view.BoldChecked());
- actionTextItalic->setChecked(textFrame->view.ItalicChecked());
- actionTextStrike->setChecked(textFrame->view.StrikeChecked());
- actionTextSub->setChecked(textFrame->view.SubChecked());
- actionTextSup->setChecked(textFrame->view.SupChecked());
+ actionTextBold->setChecked(textFrame->view()->BoldChecked());
+ actionTextItalic->setChecked(textFrame->view()->ItalicChecked());
+ actionTextStrike->setChecked(textFrame->view()->StrikeChecked());
+ actionTextSub->setChecked(textFrame->view()->SubChecked());
+ actionTextSup->setChecked(textFrame->view()->SupChecked());
- statusBar()->showMessage(textFrame->view.page()->status());
+ statusBar()->showMessage(textFrame->view()->page()->status());
}
void FbMainWindow::canUndoChanged(bool canUndo)
@@ -511,12 +511,12 @@ void FbMainWindow::canRedoChanged(bool canRedo)
void FbMainWindow::undoChanged()
{
- actionUndo->setEnabled(textFrame->view.UndoEnabled());
+ actionUndo->setEnabled(textFrame->view()->UndoEnabled());
}
void FbMainWindow::redoChanged()
{
- actionRedo->setEnabled(textFrame->view.RedoEnabled());
+ actionRedo->setEnabled(textFrame->view()->RedoEnabled());
}
void FbMainWindow::createStatusBar()
@@ -542,7 +542,7 @@ void FbMainWindow::writeSettings()
bool FbMainWindow::maybeSave()
{
- if (textFrame && textFrame->view.isModified()) {
+ if (textFrame && textFrame->view()->isModified()) {
QMessageBox::StandardButton ret;
ret = QMessageBox::warning(this, qApp->applicationName(),
tr("The document has been modified. Do you want to save your changes?"),
@@ -566,7 +566,7 @@ bool FbMainWindow::saveFile(const QString &fileName, const QString &codec)
if (textFrame) {
isSwitched = false;
- textFrame->view.save(&file, codec);
+ textFrame->view()->save(&file, codec);
setCurrentFile(fileName);
return true;
}
@@ -625,7 +625,7 @@ void FbMainWindow::viewCode()
bool load = false;
QByteArray xml;
if (textFrame) {
- textFrame->view.save(&xml);
+ textFrame->view()->save(&xml);
isSwitched = true;
load = true;
}
@@ -695,22 +695,22 @@ void FbMainWindow::viewText()
textFrame = new FbTextFrame(this);
}
setCentralWidget(textFrame);
- textFrame->view.setFocus();
+ textFrame->view()->setFocus();
viewTree();
- FbTextEdit * textEdit = &textFrame->view;
+ FbTextEdit *textEdit = textFrame->view();
connect(textEdit, SIGNAL(loadFinished(bool)), SLOT(loadFinished(bool)));
connect(textEdit->pageAction(QWebPage::Undo), SIGNAL(changed()), SLOT(undoChanged()));
connect(textEdit->pageAction(QWebPage::Redo), SIGNAL(changed()), SLOT(redoChanged()));
connect(actionInspect, SIGNAL(triggered()), textFrame, SLOT(showInspector()));
- if (load) textFrame->view.load(curFile, xml);
+ if (load) textFrame->view()->load(curFile, xml);
}
void FbMainWindow::loadFinished(bool)
{
- FbTextEdit * textEdit = &textFrame->view;
+ FbTextEdit * textEdit = textFrame->view();
FbTextPage * textPage = textEdit->page();
connect(textPage->undoStack(), SIGNAL(cleanChanged(bool)), SLOT(cleanChanged(bool)));
@@ -791,7 +791,7 @@ void FbMainWindow::viewHead()
}
if (!headTree) {
- headTree = new FbHeadView(textFrame->view, this);
+ headTree = new FbHeadView(textFrame->view(), this);
connect(headTree, SIGNAL(status(QString)), this, SLOT(status(QString)));
}
@@ -803,7 +803,7 @@ void FbMainWindow::viewHead()
headTree->setFocus();
- if (!xml.isEmpty()) textFrame->view.load(curFile, xml);
+ if (!xml.isEmpty()) textFrame->view()->load(curFile, xml);
if (textFrame) {
actionUndo->disconnect();
diff --git a/source/fb2temp.cpp b/source/fb2temp.cpp
index c655f4b..e1d1942 100644
--- a/source/fb2temp.cpp
+++ b/source/fb2temp.cpp
@@ -300,9 +300,9 @@ QVariant FbListModel::data(const QModelIndex &index, int role) const
#include <QSplitter>
#include <QScrollArea>
-FbListView::FbListView(FbNetworkAccessManager &files, QWidget *parent)
+FbListView::FbListView(FbNetworkAccessManager *files, QWidget *parent)
: QTreeView(parent)
- , m_files(files)
+ , m_files(*files)
{
m_label = new QLabel(this);
m_label->setScaledContents(true);
@@ -330,9 +330,9 @@ FbListModel * FbListView::model() const
// FbListWidget
//---------------------------------------------------------------------------
-FbListWidget::FbListWidget(FbTextEdit &view, QWidget* parent)
+FbListWidget::FbListWidget(FbTextEdit *view, QWidget* parent)
: QWidget(parent)
- , m_view(view)
+ , m_view(*view)
{
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setSpacing(0);
@@ -340,10 +340,10 @@ FbListWidget::FbListWidget(FbTextEdit &view, QWidget* parent)
QSplitter *splitter = new QSplitter(Qt::Vertical, this);
- m_list = new FbListView(*view.files(), splitter);
+ m_list = new FbListView(view->files(), splitter);
splitter->addWidget(m_list);
- QScrollArea * scroll = new QScrollArea(splitter);
+ QScrollArea *scroll = new QScrollArea(splitter);
scroll->setWidget(m_list->label());
splitter->addWidget(scroll);
diff --git a/source/fb2temp.hpp b/source/fb2temp.hpp
index 650e550..71aaae3 100644
--- a/source/fb2temp.hpp
+++ b/source/fb2temp.hpp
@@ -136,7 +136,7 @@ class FbListView : public QTreeView
Q_OBJECT
public:
- explicit FbListView(FbNetworkAccessManager &files, QWidget *parent = 0);
+ explicit FbListView(FbNetworkAccessManager *files, QWidget *parent = 0);
QLabel *label() { return m_label; }
FbListModel *model() const;
@@ -153,7 +153,7 @@ class FbListWidget : public QWidget
Q_OBJECT
public:
- explicit FbListWidget(FbTextEdit &view, QWidget* parent = 0);
+ explicit FbListWidget(FbTextEdit *view, QWidget* parent = 0);
private slots:
void loadFinished(bool ok);
diff --git a/source/fb2text.cpp b/source/fb2text.cpp
index 4b3c657..802be59 100644
--- a/source/fb2text.cpp
+++ b/source/fb2text.cpp
@@ -653,8 +653,8 @@ void FbTextEdit::execCommand(const QString &cmd, const QString &arg)
FbTextFrame::FbTextFrame(QWidget* parent)
: QFrame(parent)
- , view(this)
- , dock(0)
+ , m_view(this)
+ , m_dock(0)
{
setFrameShape(QFrame::StyledPanel);
setFrameShadow(QFrame::Sunken);
@@ -662,34 +662,42 @@ FbTextFrame::FbTextFrame(QWidget* parent)
QLayout * layout = new QBoxLayout(QBoxLayout::LeftToRight, this);
layout->setSpacing(0);
layout->setMargin(0);
- layout->addWidget(&view);
+ layout->addWidget(&m_view);
}
FbTextFrame::~FbTextFrame()
{
- if (dock) dock->deleteLater();
+ if (m_dock) m_dock->deleteLater();
}
void FbTextFrame::showInspector()
{
- if (dock) {
- dock->show();
+ if (m_dock) {
+ m_dock->setVisible(m_dock->isHidden());
return;
}
- QMainWindow * main = qobject_cast<QMainWindow*>(parent());
+ QMainWindow *main = qobject_cast<QMainWindow*>(parent());
if (!main) return;
- dock = new QDockWidget(tr("Web inspector"), this);
- dock->setFeatures(QDockWidget::AllDockWidgetFeatures);
- main->addDockWidget(Qt::BottomDockWidgetArea, dock);
+ m_dock = new QDockWidget(tr("Web inspector"), this);
+ m_dock->setFeatures(QDockWidget::AllDockWidgetFeatures);
+ main->addDockWidget(Qt::BottomDockWidgetArea, m_dock);
- QWebInspector * inspector = new QWebInspector(this);
- inspector->setPage(view.page());
- dock->setWidget(inspector);
+ QWebInspector *inspector = new QWebInspector(this);
+ inspector->setPage(m_view.page());
+ m_dock->setWidget(inspector);
+
+ connect(m_dock, SIGNAL(destroyed()), SLOT(dockDestroyed()));
}
void FbTextFrame::hideInspector()
{
- if (dock) dock->hide();
+ if (m_dock) m_dock->hide();
}
+
+void FbTextFrame::dockDestroyed()
+{
+ m_dock = 0;
+}
+
diff --git a/source/fb2text.hpp b/source/fb2text.hpp
index 1cdc2b8..553c6a0 100644
--- a/source/fb2text.hpp
+++ b/source/fb2text.hpp
@@ -166,14 +166,20 @@ class FbTextFrame : public QFrame
public:
explicit FbTextFrame(QWidget* parent = 0);
~FbTextFrame();
- void hideInspector();
- FbTextEdit view;
+
+public:
+ FbTextEdit *view() { return &m_view; }
public slots:
void showInspector();
+ void hideInspector();
+
+private slots:
+ void dockDestroyed();
private:
- QDockWidget * dock;
+ FbTextEdit m_view;
+ QDockWidget *m_dock;
};
#endif // FB2TEXT_H
diff --git a/source/fb2tree.cpp b/source/fb2tree.cpp
index 879fcbc..3586f06 100644
--- a/source/fb2tree.cpp
+++ b/source/fb2tree.cpp
@@ -754,14 +754,14 @@ void FbTreeView::moveRight()
// FbTreeWidget
//---------------------------------------------------------------------------
-FbTreeWidget::FbTreeWidget(FbTextEdit &view, QWidget* parent)
+FbTreeWidget::FbTreeWidget(FbTextEdit *view, QWidget* parent)
: QWidget(parent)
{
QVBoxLayout * layout = new QVBoxLayout(this);
layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0);
- m_tree = new FbTreeView(view, this);
+ m_tree = new FbTreeView(*view, this);
layout->addWidget(m_tree);
m_tool = new QToolBar(this);
diff --git a/source/fb2tree.hpp b/source/fb2tree.hpp
index 7eb69ea..3ba639c 100644
--- a/source/fb2tree.hpp
+++ b/source/fb2tree.hpp
@@ -197,7 +197,7 @@ class FbTreeWidget : public QWidget
Q_OBJECT
public:
- explicit FbTreeWidget(FbTextEdit &view, QWidget* parent = 0);
+ explicit FbTreeWidget(FbTextEdit *view, QWidget* parent = 0);
protected:
QToolBar * m_tool;
diff --git a/source/ts/ru.ts b/source/ts/ru.ts
index e9c0bfe..dad719f 100644
--- a/source/ts/ru.ts
+++ b/source/ts/ru.ts
@@ -188,6 +188,17 @@
</message>
</context>
<context>
+ <name>FbListModel</name>
+ <message>
+ <source>File name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Size</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>FbMainWindow</name>
<message>
<source>&amp;New</source>