Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KDE Pim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Unmaintained
KDE Pim
Commits
06a04b15
Commit
06a04b15
authored
Nov 03, 2010
by
Mehrdad Momeny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanup (function name change)
svn path=/trunk/KDE/kdepim/blogilo/; revision=1192592
parent
0572ef60
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
225 additions
and
230 deletions
+225
-230
blogilo/src/addeditblog.cpp
blogilo/src/addeditblog.cpp
+5
-5
blogilo/src/addeditblog.h
blogilo/src/addeditblog.h
+1
-1
blogilo/src/backend.cpp
blogilo/src/backend.cpp
+3
-2
blogilo/src/backend.h
blogilo/src/backend.h
+1
-1
blogilo/src/composer/bilbobrowser.cpp
blogilo/src/composer/bilbobrowser.cpp
+15
-15
blogilo/src/composer/bilbobrowser.h
blogilo/src/composer/bilbobrowser.h
+7
-7
blogilo/src/composer/bilbobrowser_win.cpp
blogilo/src/composer/bilbobrowser_win.cpp
+10
-10
blogilo/src/composer/bilbobrowser_win.h
blogilo/src/composer/bilbobrowser_win.h
+7
-7
blogilo/src/composer/bilboeditor.cpp
blogilo/src/composer/bilboeditor.cpp
+47
-49
blogilo/src/composer/bilboeditor.h
blogilo/src/composer/bilboeditor.h
+9
-9
blogilo/src/composer/dialogs/addmediadialog.cpp
blogilo/src/composer/dialogs/addmediadialog.cpp
+2
-2
blogilo/src/composer/dialogs/addmediadialog.h
blogilo/src/composer/dialogs/addmediadialog.h
+1
-1
blogilo/src/composer/medialistwidget.cpp
blogilo/src/composer/medialistwidget.cpp
+8
-8
blogilo/src/composer/medialistwidget.h
blogilo/src/composer/medialistwidget.h
+4
-4
blogilo/src/composer/multilinetextedit.cpp
blogilo/src/composer/multilinetextedit.cpp
+2
-2
blogilo/src/composer/multilinetextedit.h
blogilo/src/composer/multilinetextedit.h
+1
-1
blogilo/src/composer/stylegetter.cpp
blogilo/src/composer/stylegetter.cpp
+8
-8
blogilo/src/composer/stylegetter.h
blogilo/src/composer/stylegetter.h
+4
-4
blogilo/src/composer/texteditor/texteditor.cpp
blogilo/src/composer/texteditor/texteditor.cpp
+1
-5
blogilo/src/composer/texteditor/texteditor.h
blogilo/src/composer/texteditor/texteditor.h
+1
-0
blogilo/src/mainwindow.cpp
blogilo/src/mainwindow.cpp
+29
-29
blogilo/src/mainwindow.h
blogilo/src/mainwindow.h
+12
-12
blogilo/src/postentry.cpp
blogilo/src/postentry.cpp
+8
-7
blogilo/src/postentry.h
blogilo/src/postentry.h
+3
-5
blogilo/src/toolbox.cpp
blogilo/src/toolbox.cpp
+27
-27
blogilo/src/toolbox.h
blogilo/src/toolbox.h
+9
-9
No files found.
blogilo/src/addeditblog.cpp
View file @
06a04b15
...
...
@@ -80,10 +80,10 @@ AddEditBlog::AddEditBlog( int blog_id, QWidget *parent, Qt::WFlags flags )
connect
(
d
->
ui
.
btnAutoConf
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
autoConfigure
()
)
);
connect
(
d
->
ui
.
btnFetch
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
fetchBlogId
()
)
);
connect
(
d
->
ui
.
comboApi
,
SIGNAL
(
currentIndexChanged
(
int
)
),
this
,
SLOT
(
slotComboApiChanged
(
int
)
)
);
connect
(
d
->
ui
.
txtUrl
,
SIGNAL
(
returnPressed
()
),
this
,
SLOT
(
sltReturnPressed
()
)
);
connect
(
d
->
ui
.
txtUser
,
SIGNAL
(
returnPressed
()
),
this
,
SLOT
(
sltReturnPressed
()
)
);
connect
(
d
->
ui
.
txtPass
,
SIGNAL
(
returnPressed
()
),
this
,
SLOT
(
sltReturnPressed
()
)
);
connect
(
d
->
ui
.
txtId
,
SIGNAL
(
returnPressed
()
),
this
,
SLOT
(
sltReturnPressed
()
)
);
connect
(
d
->
ui
.
txtUrl
,
SIGNAL
(
returnPressed
()
),
this
,
SLOT
(
sl
o
tReturnPressed
()
)
);
connect
(
d
->
ui
.
txtUser
,
SIGNAL
(
returnPressed
()
),
this
,
SLOT
(
sl
o
tReturnPressed
()
)
);
connect
(
d
->
ui
.
txtPass
,
SIGNAL
(
returnPressed
()
),
this
,
SLOT
(
sl
o
tReturnPressed
()
)
);
connect
(
d
->
ui
.
txtId
,
SIGNAL
(
returnPressed
()
),
this
,
SLOT
(
sl
o
tReturnPressed
()
)
);
if
(
blog_id
>
-
1
)
{
this
->
setWindowTitle
(
i18n
(
"Edit blog settings"
)
);
...
...
@@ -447,7 +447,7 @@ void AddEditBlog::enableOkButton( const QString & txt )
d
->
ui
.
txtTitle
->
setEnabled
(
check
);
}
void
AddEditBlog
::
sltReturnPressed
()
void
AddEditBlog
::
sl
o
tReturnPressed
()
{
///FIXME This function commented temporarilly! check its functionality! and uncomment it!
if
(
this
->
isButtonEnabled
(
KDialog
::
Ok
)){
...
...
blogilo/src/addeditblog.h
View file @
06a04b15
...
...
@@ -65,7 +65,7 @@ protected Q_SLOTS:
void
handleFetchAPITimeout
();
void
handleFetchError
(
KBlog
::
Blog
::
ErrorType
type
,
const
QString
&
errorMsg
);
void
sltReturnPressed
();
void
sl
o
tReturnPressed
();
void
setSupportedFeatures
(
BilboBlog
::
ApiType
api
);
void
slotComboApiChanged
(
int
index
);
...
...
blogilo/src/backend.cpp
View file @
06a04b15
...
...
@@ -246,7 +246,7 @@ void Backend::uploadMedia( BilboMedia * media )
d
->
mPublishMediaMap
[
m
]
=
media
;
connect
(
MWBlog
,
SIGNAL
(
createdMedia
(
KBlog
::
BlogMedia
*
)
),
this
,
SLOT
(
mediaUploaded
(
KBlog
::
BlogMedia
*
)
)
);
connect
(
MWBlog
,
SIGNAL
(
errorMedia
(
KBlog
::
Blog
::
ErrorType
,
const
QString
&
,
KBlog
::
BlogMedia
*
)
),
this
,
SLOT
(
sltMediaError
(
KBlog
::
Blog
::
ErrorType
,
const
QString
&
,
KBlog
::
BlogMedia
*
)
)
);
this
,
SLOT
(
sl
o
tMediaError
(
KBlog
::
Blog
::
ErrorType
,
const
QString
&
,
KBlog
::
BlogMedia
*
)
)
);
MWBlog
->
createMedia
(
m
);
return
;
break
;
...
...
@@ -349,7 +349,8 @@ void Backend::error( KBlog::Blog::ErrorType type, const QString & errorMessage )
Q_EMIT
sigError
(
errType
);
}
void
Backend
::
sltMediaError
(
KBlog
::
Blog
::
ErrorType
type
,
const
QString
&
errorMessage
,
KBlog
::
BlogMedia
*
media
)
void
Backend
::
slotMediaError
(
KBlog
::
Blog
::
ErrorType
type
,
const
QString
&
errorMessage
,
KBlog
::
BlogMedia
*
media
)
{
kDebug
();
QString
errType
=
errorTypeToString
(
type
);
...
...
blogilo/src/backend.h
View file @
06a04b15
...
...
@@ -107,7 +107,7 @@ protected Q_SLOTS:
void
postPublished
(
KBlog
::
BlogPost
*
post
);
void
mediaUploaded
(
KBlog
::
BlogMedia
*
media
);
void
error
(
KBlog
::
Blog
::
ErrorType
type
,
const
QString
&
errorMessage
);
void
sltMediaError
(
KBlog
::
Blog
::
ErrorType
type
,
const
QString
&
errorMessage
,
KBlog
::
BlogMedia
*
media
);
void
sl
o
tMediaError
(
KBlog
::
Blog
::
ErrorType
type
,
const
QString
&
errorMessage
,
KBlog
::
BlogMedia
*
media
);
// void postCategoriesSetted( const QString &postId );
void
slotPostRemoved
(
KBlog
::
BlogPost
*
post
);
void
slotPostFetched
(
KBlog
::
BlogPost
*
post
);
...
...
blogilo/src/composer/bilbobrowser.cpp
View file @
06a04b15
...
...
@@ -61,14 +61,14 @@ BilboBrowser::BilboBrowser( QWidget *parent ) : QWidget( parent )
connect
(
browserExtension
,
SIGNAL
(
openUrlRequestDelayed
(
const
KUrl
&
,
const
KParts
::
OpenUrlArguments
&
,
const
KParts
::
BrowserArguments
&
)
),
this
,
SLOT
(
sltOpenRequested
(
const
KUrl
&
)
)
);
this
,
SLOT
(
sl
o
tOpenRequested
(
const
KUrl
&
)
)
);
}
connect
(
browserPart
,
SIGNAL
(
completed
()
),
this
,
SLOT
(
sltCompleted
()
)
);
connect
(
browserPart
,
SIGNAL
(
completed
()
),
this
,
SLOT
(
sl
o
tCompleted
()
)
);
connect
(
browserPart
,
SIGNAL
(
canceled
(
const
QString
&
)
),
this
,
SLOT
(
sltCanceled
(
const
QString
&
)
)
);
sl
o
tCanceled
(
const
QString
&
)
)
);
connect
(
browserPart
,
SIGNAL
(
setStatusBarText
(
const
QString
&
)
),
this
,
SLOT
(
sltSetStatusBarText
(
const
QString
&
)
)
);
SLOT
(
sl
o
tSetStatusBarText
(
const
QString
&
)
)
);
}
BilboBrowser
::~
BilboBrowser
()
...
...
@@ -80,12 +80,12 @@ void BilboBrowser::createUi( QWidget *parent )
{
btnGetStyle
=
new
KPushButton
(
this
);
btnGetStyle
->
setText
(
i18n
(
"Get blog style"
)
);
connect
(
btnGetStyle
,
SIGNAL
(
clicked
(
bool
)
),
this
,
SLOT
(
sltGetBlogStyle
()
)
);
connect
(
btnGetStyle
,
SIGNAL
(
clicked
(
bool
)
),
this
,
SLOT
(
sl
o
tGetBlogStyle
()
)
);
viewInBlogStyle
=
new
QCheckBox
(
i18n
(
"View post in the blog style"
),
this
);
viewInBlogStyle
->
setChecked
(
Settings
::
previewInBlogStyle
()
);
connect
(
viewInBlogStyle
,
SIGNAL
(
toggled
(
bool
)
),
this
,
SLOT
(
sltViewModeChanged
()
)
);
sl
o
tViewModeChanged
()
)
);
QSpacerItem
*
horizontalSpacer
=
new
QSpacerItem
(
40
,
20
,
QSizePolicy
::
Expanding
,
QSizePolicy
::
Minimum
);
...
...
@@ -135,7 +135,7 @@ void BilboBrowser::setHtml( const QString& title, const QString& content )
void
BilboBrowser
::
stop
()
{
browserPart
->
closeUrl
();
sltCanceled
(
QString
()
);
sl
o
tCanceled
(
QString
()
);
}
/*
void BilboBrowser::setBrowserDirection( Qt::LayoutDirection direction )
...
...
@@ -143,7 +143,7 @@ void BilboBrowser::setBrowserDirection( Qt::LayoutDirection direction )
browserPart->view()->setLayoutDirection( direction );
}*/
void
BilboBrowser
::
sltGetBlogStyle
()
void
BilboBrowser
::
sl
o
tGetBlogStyle
()
{
int
blogid
=
__currentBlogId
;
if
(
blogid
<
0
)
{
...
...
@@ -163,10 +163,10 @@ void BilboBrowser::sltGetBlogStyle()
StyleGetter
*
styleGetter
=
new
StyleGetter
(
__currentBlogId
,
this
);
connect
(
styleGetter
,
SIGNAL
(
sigGetStyleProgress
(
int
)
),
browserProgress
,
SLOT
(
setValue
(
int
)
)
);
connect
(
styleGetter
,
SIGNAL
(
sigStyleFetched
()
),
this
,
SLOT
(
sltSetBlogStyle
()
)
);
connect
(
styleGetter
,
SIGNAL
(
sigStyleFetched
()
),
this
,
SLOT
(
sl
o
tSetBlogStyle
()
)
);
}
void
BilboBrowser
::
sltSetBlogStyle
()
void
BilboBrowser
::
sl
o
tSetBlogStyle
()
{
browserStatus
->
showMessage
(
i18n
(
"Blog style fetched."
),
2000
);
browserPart
->
setStatusMessagesEnabled
(
true
);
...
...
@@ -177,12 +177,12 @@ void BilboBrowser::sltSetBlogStyle()
}
}
void
BilboBrowser
::
sltCompleted
()
void
BilboBrowser
::
sl
o
tCompleted
()
{
QTimer
::
singleShot
(
1500
,
browserProgress
,
SLOT
(
hide
()
)
);
}
void
BilboBrowser
::
sltCanceled
(
const
QString
&
errMsg
)
void
BilboBrowser
::
sl
o
tCanceled
(
const
QString
&
errMsg
)
{
if
(
!
errMsg
.
isEmpty
()
)
{
KMessageBox
::
detailedError
(
this
,
...
...
@@ -192,20 +192,20 @@ void BilboBrowser::sltCanceled( const QString& errMsg )
QTimer
::
singleShot
(
2000
,
browserProgress
,
SLOT
(
hide
()
)
);
}
void
BilboBrowser
::
sltSetStatusBarText
(
const
QString
&
text
)
void
BilboBrowser
::
sl
o
tSetStatusBarText
(
const
QString
&
text
)
{
QString
statusText
=
text
;
statusText
.
remove
(
"<qt>"
);
browserStatus
->
showMessage
(
statusText
);
}
void
BilboBrowser
::
sltViewModeChanged
()
void
BilboBrowser
::
sl
o
tViewModeChanged
()
{
browserPart
->
closeUrl
();
setHtml
(
currentTitle
,
currentContent
);
}
void
BilboBrowser
::
sltOpenRequested
(
const
KUrl
&
url
)
void
BilboBrowser
::
sl
o
tOpenRequested
(
const
KUrl
&
url
)
{
browserPart
->
openUrl
(
url
);
}
...
...
blogilo/src/composer/bilbobrowser.h
View file @
06a04b15
...
...
@@ -79,19 +79,19 @@ Q_SIGNALS:
void
sigSetBlogStyle
();
protected
Q_SLOTS
:
void
sltGetBlogStyle
();
void
sl
o
tGetBlogStyle
();
void
sltSetBlogStyle
();
void
sl
o
tSetBlogStyle
();
void
sltCompleted
();
void
sl
o
tCompleted
();
void
sltCanceled
(
const
QString
&
errMsg
);
void
sl
o
tCanceled
(
const
QString
&
errMsg
);
void
sltSetStatusBarText
(
const
QString
&
text
);
void
sl
o
tSetStatusBarText
(
const
QString
&
text
);
void
sltViewModeChanged
();
void
sl
o
tViewModeChanged
();
void
sltOpenRequested
(
const
KUrl
&
url
);
void
sl
o
tOpenRequested
(
const
KUrl
&
url
);
private:
void
createUi
(
QWidget
*
parent
=
0
);
...
...
blogilo/src/composer/bilbobrowser_win.cpp
View file @
06a04b15
...
...
@@ -50,9 +50,9 @@ BilboBrowser::BilboBrowser( QWidget *parent ) : QWidget( parent )
connect
(
mWebView
,
SIGNAL
(
loadProgress
(
int
)
),
browserProgress
,
SLOT
(
setValue
(
int
)
)
);
connect
(
mWebView
,
SIGNAL
(
loadFinished
(
bool
)
)
,
this
,
SLOT
(
sltCompleted
(
bool
)
)
);
connect
(
mWebView
,
SIGNAL
(
loadFinished
(
bool
)
)
,
this
,
SLOT
(
sl
o
tCompleted
(
bool
)
)
);
connect
(
mWebView
,
SIGNAL
(
statusBarMessage
(
QString
)),
this
,
SLOT
(
sltSetStatusBarText
(
const
QString
&
)
)
);
SLOT
(
sl
o
tSetStatusBarText
(
const
QString
&
)
)
);
}
BilboBrowser
::~
BilboBrowser
()
...
...
@@ -64,12 +64,12 @@ void BilboBrowser::createUi( QWidget *parent )
{
btnGetStyle
=
new
KPushButton
(
this
);
btnGetStyle
->
setText
(
i18n
(
"Get blog style"
)
);
connect
(
btnGetStyle
,
SIGNAL
(
clicked
(
bool
)
),
this
,
SLOT
(
sltGetBlogStyle
()
)
);
connect
(
btnGetStyle
,
SIGNAL
(
clicked
(
bool
)
),
this
,
SLOT
(
sl
o
tGetBlogStyle
()
)
);
viewInBlogStyle
=
new
QCheckBox
(
i18n
(
"View post in the blog style"
),
this
);
viewInBlogStyle
->
setChecked
(
Settings
::
previewInBlogStyle
()
);
connect
(
viewInBlogStyle
,
SIGNAL
(
toggled
(
bool
)
),
this
,
SLOT
(
sltViewModeChanged
()
)
);
sl
o
tViewModeChanged
()
)
);
QSpacerItem
*
horizontalSpacer
=
new
QSpacerItem
(
40
,
20
,
QSizePolicy
::
Expanding
,
QSizePolicy
::
Minimum
);
...
...
@@ -118,7 +118,7 @@ void BilboBrowser::stop()
{
mWebView
->
stop
();
}
void
BilboBrowser
::
sltGetBlogStyle
()
void
BilboBrowser
::
sl
o
tGetBlogStyle
()
{
stop
();
int
blogid
=
__currentBlogId
;
...
...
@@ -138,10 +138,10 @@ void BilboBrowser::sltGetBlogStyle()
StyleGetter
*
styleGetter
=
new
StyleGetter
(
__currentBlogId
,
this
);
connect
(
styleGetter
,
SIGNAL
(
sigGetStyleProgress
(
int
)
),
browserProgress
,
SLOT
(
setValue
(
int
)
)
);
connect
(
styleGetter
,
SIGNAL
(
sigStyleFetched
()
),
this
,
SLOT
(
sltSetBlogStyle
()
)
);
connect
(
styleGetter
,
SIGNAL
(
sigStyleFetched
()
),
this
,
SLOT
(
sl
o
tSetBlogStyle
()
)
);
}
void
BilboBrowser
::
sltSetBlogStyle
()
void
BilboBrowser
::
sl
o
tSetBlogStyle
()
{
browserStatus
->
showMessage
(
i18n
(
"Blog style fetched."
),
2000
);
Q_EMIT
sigSetBlogStyle
();
...
...
@@ -151,7 +151,7 @@ void BilboBrowser::sltSetBlogStyle()
}
}
void
BilboBrowser
::
sltCompleted
(
bool
ok
)
void
BilboBrowser
::
sl
o
tCompleted
(
bool
ok
)
{
QTimer
::
singleShot
(
1500
,
browserProgress
,
SLOT
(
hide
()
)
);
if
(
!
ok
){
...
...
@@ -159,14 +159,14 @@ void BilboBrowser::sltCompleted(bool ok)
}
}
void
BilboBrowser
::
sltSetStatusBarText
(
const
QString
&
text
)
void
BilboBrowser
::
sl
o
tSetStatusBarText
(
const
QString
&
text
)
{
QString
statusText
=
text
;
statusText
.
remove
(
"<qt>"
);
browserStatus
->
showMessage
(
statusText
);
}
void
BilboBrowser
::
sltViewModeChanged
()
void
BilboBrowser
::
sl
o
tViewModeChanged
()
{
stop
();
setHtml
(
currentTitle
,
currentContent
);
...
...
blogilo/src/composer/bilbobrowser_win.h
View file @
06a04b15
...
...
@@ -81,19 +81,19 @@ Q_SIGNALS:
void
sigSetBlogStyle
();
protected
Q_SLOTS
:
void
sltGetBlogStyle
();
void
sl
o
tGetBlogStyle
();
void
sltSetBlogStyle
();
void
sl
o
tSetBlogStyle
();
void
sltCompleted
(
bool
);
void
sl
o
tCompleted
(
bool
);
// void sltCanceled( const QString& errMsg );
// void sl
o
tCanceled( const QString& errMsg );
void
sltSetStatusBarText
(
const
QString
&
text
);
void
sl
o
tSetStatusBarText
(
const
QString
&
text
);
void
sltViewModeChanged
();
void
sl
o
tViewModeChanged
();
// void sltOpenRequested( const KUrl& url );
// void sl
o
tOpenRequested( const KUrl& url );
private:
void
createUi
(
QWidget
*
parent
=
0
);
...
...
blogilo/src/composer/bilboeditor.cpp
View file @
06a04b15
...
...
@@ -61,8 +61,8 @@
#include <settings.h>
#define FORWARD_ACTION(action1, action2) \
connect(action1, SIGNAL(triggered()), d->
e
ditor->getAction(action2), SLOT(trigger()));\
connect(d->
e
ditor->getAction(action2), SIGNAL(changed()), SLOT(adjustActions()));
connect(action1, SIGNAL(triggered()), d->
wysiwygE
ditor->getAction(action2), SLOT(trigger()));\
connect(d->
wysiwygE
ditor->getAction(action2), SIGNAL(changed()), SLOT(adjustActions()));
class
BilboEditor
::
Private
{
...
...
@@ -71,10 +71,10 @@ public:
QWidget
*
tabHtml
;
QWidget
*
tabPreview
;
TextEditor
*
e
ditor
;
TextEditor
*
wysiwygE
ditor
;
KTextEditor
::
View
*
htmlEditor
;
BilboBrowser
*
preview
;
BilboBrowser
*
preview
er
;
KToolBar
*
barVisual
;
...
...
@@ -87,13 +87,13 @@ BilboEditor::BilboEditor( QWidget *parent )
:
KTabWidget
(
parent
),
d
(
new
Private
)
{
createUi
();
connect
(
d
->
e
ditor
,
SIGNAL
(
textChanged
()
),
this
,
SIGNAL
(
textChanged
()
)
);
connect
(
d
->
wysiwygE
ditor
,
SIGNAL
(
textChanged
()
),
this
,
SIGNAL
(
textChanged
()
)
);
connect
(
d
->
htmlEditor
->
document
(),
SIGNAL
(
textChanged
(
KTextEditor
::
Document
*
)
),
this
,
SIGNAL
(
textChanged
()
)
);
connect
(
Settings
::
self
(),
SIGNAL
(
configChanged
()),
this
,
SLOT
(
slotSettingsChanged
())
);
// d->
e
ditor->setCheckSpellingEnabled( Settings::enableCheckSpelling() );
d
->
e
ditor
->
setFocus
();
// d->
wysiwygE
ditor->setCheckSpellingEnabled( Settings::enableCheckSpelling() );
d
->
wysiwygE
ditor
->
setFocus
();
}
BilboEditor
::~
BilboEditor
()
...
...
@@ -110,30 +110,27 @@ void BilboEditor::createUi()
d
->
tabPreview
=
new
QWidget
(
this
);
this
->
addTab
(
d
->
tabVisual
,
i18nc
(
"Software"
,
"Visual Editor"
)
);
this
->
addTab
(
d
->
tabHtml
,
i18nc
(
"Software"
,
"Html Editor"
)
);
this
->
addTab
(
d
->
tabPreview
,
i18nc
(
"
d->
preview of the edited post"
,
"Post Preview"
)
);
connect
(
this
,
SIGNAL
(
currentChanged
(
int
)
),
this
,
SLOT
(
sltSyncEditors
(
int
)
)
);
this
->
addTab
(
d
->
tabPreview
,
i18nc
(
"preview of the edited post"
,
"Post Preview"
)
);
connect
(
this
,
SIGNAL
(
currentChanged
(
int
)
),
this
,
SLOT
(
sl
o
tSyncEditors
(
int
)
)
);
d
->
prev_index
=
0
;
///
Visual d->e
ditor:
d
->
e
ditor
=
new
TextEditor
(
d
->
tabVisual
);
///
WYSIWYG E
ditor:
d
->
wysiwygE
ditor
=
new
TextEditor
(
d
->
tabVisual
);
QVBoxLayout
*
vLayout
=
new
QVBoxLayout
(
d
->
tabVisual
);
vLayout
->
addWidget
(
d
->
e
ditor
);
vLayout
->
addWidget
(
d
->
wysiwygE
ditor
);
connect
(
d
->
editor
,
SIGNAL
(
checkSpellingChanged
(
bool
)
),
this
,
SLOT
(
sltSyncSpellCheckingButton
(
bool
)
)
);
///d->htmlEditor:
///htmlEditor:
d
->
htmlEditor
=
HtmlEditor
::
self
()
->
createView
(
d
->
tabHtml
);
QGridLayout
*
hLayout
=
new
QGridLayout
(
d
->
tabHtml
);
hLayout
->
addWidget
(
d
->
htmlEditor
);
///
d->preview
:
d
->
preview
=
new
BilboBrowser
(
d
->
tabPreview
);
///
previewer
:
d
->
preview
er
=
new
BilboBrowser
(
d
->
tabPreview
);
QGridLayout
*
gLayout
=
new
QGridLayout
(
d
->
tabPreview
);
gLayout
->
addWidget
(
d
->
preview
);
gLayout
->
addWidget
(
d
->
preview
er
);
connect
(
d
->
preview
,
SIGNAL
(
sigSetBlogStyle
()
),
this
,
SLOT
(
sltSetPostPreview
()
)
);
connect
(
d
->
preview
er
,
SIGNAL
(
sigSetBlogStyle
()
),
this
,
SLOT
(
sl
o
tSetPostPreview
()
)
);
this
->
setCurrentIndex
(
0
);
...
...
@@ -142,21 +139,22 @@ void BilboEditor::createUi()
}
void
BilboEditor
::
sltAddImage
()
void
BilboEditor
::
sl
o
tAddImage
()
{
QPointer
<
AddImageDialog
>
imageDialog
=
new
AddImageDialog
(
this
);
imageDialog
->
setWindowModality
(
Qt
::
WindowModal
);
connect
(
imageDialog
,
SIGNAL
(
sigAddImage
(
BilboMedia
*
,
const
int
,
const
int
,
const
QString
,
const
QString
,
const
QString
)
),
this
,
SLOT
(
sltSetImage
(
BilboMedia
*
,
const
int
,
const
int
,
const
QString
,
const
QString
,
const
QString
)
)
);
connect
(
imageDialog
,
SIGNAL
(
sigMediaTypeFound
(
BilboMedia
*
)
),
this
,
SLOT
(
sltMediaTypeFound
(
BilboMedia
*
)
)
);
connect
(
imageDialog
,
SIGNAL
(
sigAddImage
(
BilboMedia
*
,
const
int
,
const
int
,
const
QString
,
const
QString
,
const
QString
)
),
this
,
SLOT
(
slotSetImage
(
BilboMedia
*
,
const
int
,
const
int
,
const
QString
,
const
QString
,
const
QString
)
)
);
imageDialog
->
exec
();
imageDialog
->
deleteLater
();
}
void
BilboEditor
::
sltSetImage
(
BilboMedia
*
media
,
const
int
width
,
const
int
height
,
void
BilboEditor
::
sl
o
tSetImage
(
BilboMedia
*
media
,
const
int
width
,
const
int
height
,
const
QString
title
,
const
QString
link
,
const
QString
Alt_text
)
{
QTextImageFormat
imageFormat
;
...
...
@@ -178,37 +176,37 @@ void BilboEditor::sltSetImage( BilboMedia *media, const int width, const int hei
imageFormat
.
setAnchor
(
true
);
imageFormat
.
setAnchorHref
(
link
);
}
// d->
e
ditor->textCursor().insertImage( imageFormat );
// d->
wysiwygE
ditor->textCursor().insertImage( imageFormat );
d
->
e
ditor
->
setFocus
(
Qt
::
OtherFocusReason
);
d
->
wysiwygE
ditor
->
setFocus
(
Qt
::
OtherFocusReason
);
}
void
BilboEditor
::
sltSyncEditors
(
int
index
)
void
BilboEditor
::
sl
o
tSyncEditors
(
int
index
)
{
kDebug
();
if
(
index
==
0
)
{
if
(
d
->
prev_index
==
2
)
{
d
->
preview
->
stop
();
d
->
preview
er
->
stop
();
goto
SyncEnd
;
}
//An else clause can do the job of goto, No? -Mehrdad :D
d
->
e
ditor
->
setHtmlContent
(
d
->
htmlEditor
->
document
()
->
text
());
d
->
e
ditor
->
setFocus
();
d
->
e
ditor
->
startEditing
();
d
->
wysiwygE
ditor
->
setHtmlContent
(
d
->
htmlEditor
->
document
()
->
text
());
d
->
wysiwygE
ditor
->
setFocus
();
d
->
wysiwygE
ditor
->
startEditing
();
}
else
if
(
index
==
1
)
{
if
(
d
->
prev_index
==
2
)
{
d
->
preview
->
stop
();
d
->
preview
er
->
stop
();
goto
SyncEnd
;
}
d
->
htmlEditor
->
document
()
->
setText
(
d
->
e
ditor
->
htmlContent
()
);
d
->
htmlEditor
->
document
()
->
setText
(
d
->
wysiwygE
ditor
->
htmlContent
()
);
d
->
htmlEditor
->
setFocus
();
}
else
{
if
(
d
->
prev_index
==
1
)
{
d
->
e
ditor
->
setHtmlContent
(
d
->
htmlEditor
->
document
()
->
text
());
d
->
wysiwygE
ditor
->
setHtmlContent
(
d
->
htmlEditor
->
document
()
->
text
());
}
else
{
d
->
htmlEditor
->
document
()
->
setText
(
d
->
e
ditor
->
htmlContent
()
);
d
->
htmlEditor
->
document
()
->
setText
(
d
->
wysiwygE
ditor
->
htmlContent
()
);
}
d
->
preview
->
setHtml
(
d
->
currentPostTitle
,
d
->
htmlEditor
->
document
()
->
text
()
);
d
->
preview
er
->
setHtml
(
d
->
currentPostTitle
,
d
->
htmlEditor
->
document
()
->
text
()
);
}
SyncEnd:
d
->
prev_index
=
index
;
...
...
@@ -217,14 +215,14 @@ SyncEnd:
QString
BilboEditor
::
htmlContent
()
{
if
(
this
->
currentIndex
()
==
0
)
{
d
->
htmlEditor
->
document
()
->
setText
(
d
->
e
ditor
->
htmlContent
()
);
d
->
htmlEditor
->
document
()
->
setText
(
d
->
wysiwygE
ditor
->
htmlContent
()
);
}
return
d
->
e
ditor
->
htmlContent
();
return
d
->
wysiwygE
ditor
->
htmlContent
();
}
void
BilboEditor
::
setHtmlContent
(
const
QString
&
content
)
{
this
->
d
->
e
ditor
->
setHtmlContent
(
content
);
this
->
d
->
wysiwygE
ditor
->
setHtmlContent
(
content
);
this
->
d
->
htmlEditor
->
document
()
->
setText
(
content
);
}
...
...
@@ -239,24 +237,24 @@ void BilboEditor::setCurrentTitle( const QString& title)
QList
<
BilboMedia
*
>
BilboEditor
::
localImages
()
{
return
d
->
e
ditor
->
getLocalImages
();
return
d
->
wysiwygE
ditor
->
getLocalImages
();
}
TextEditor
*
BilboEditor
::
editor
(
)
void
BilboEditor
::
replaceImageSrc
(
const
QString
&
src
,
const
QString
&
dest
)
{
return
d
->
editor
;
d
->
wysiwygEditor
->
replaceImageSrc
(
src
,
dest
)
;
}
void
BilboEditor
::
sltSetPostPreview
()
void
BilboEditor
::
sl
o
tSetPostPreview
()
{
if
(
this
->
currentIndex
()
==
2
)
{
d
->
preview
->
setHtml
(
d
->
currentPostTitle
,
d
->
htmlEditor
->
document
()
->
text
()
);
d
->
preview
er
->
setHtml
(
d
->
currentPostTitle
,
d
->
htmlEditor
->
document
()
->
text
()
);
}
}
void
BilboEditor
::
slotSettingsChanged
()
{
// d->
e
ditor->setCheckSpellingEnabled( Settings::enableCheckSpelling() );
// d->
wysiwygE
ditor->setCheckSpellingEnabled( Settings::enableCheckSpelling() );
}
#include "composer/bilboeditor.moc"
blogilo/src/composer/bilboeditor.h
View file @
06a04b15
...
...
@@ -98,7 +98,7 @@ public:
*/
void
setCurrentTitle
(
const
QString
&
title
);
TextEditor
*
editor
(
);
void
replaceImageSrc
(
const
QString
&
src
,
const
QString
&
dest
);
Q_SIGNALS:
/**
...
...
@@ -125,27 +125,27 @@ Q_SIGNALS:
protected
Q_SLOTS
:
void
slotSettingsChanged
();
// void sltToggleSpellChecking();
// void sl
o
tToggleSpellChecking();
// void sltSyncSpellCheckingButton( bool check );
// void sl
o
tSyncSpellCheckingButton( bool check );
/**
* Creates an instance of AddImageDialog class,and opens it, to select an image.
*/
void
sltAddImage
();
void
sl
o
tAddImage
();
void
sltSetImage
(
BilboMedia
*
media
,
const
int
width
,
const
int
height
,
void
sl
o
tSetImage
(
BilboMedia
*
media
,
const
int
width
,
const
int
height
,
const
QString
title
,
const
QString
link
,
const
QString
Alt_text
);
/*!
Sets the content of the current tab as other tabs' contents, to apply recent
* changes. this function executes each time the user switches between tabs.
*/
void
sltSyncEditors
(
int
index
);
void
sl
o
tSyncEditors
(
int
index
);
// void sltGetBlogStyle();
// void sl
o
tGetBlogStyle();
//
void
sltSetPostPreview
();
void
sl
o
tSetPostPreview
();
private:
...
...
@@ -154,7 +154,7 @@ private:
then assigns default charachter format of the editor tab to defaultCharFormat
* variable, to be used in remove formatting operation. then calls createActions
* function.
\sa sltRemoveFormatting(), createActions()
\sa sl
o
tRemoveFormatting(), createActions()
*/
void
createUi
();
...
...
blogilo/src/composer/dialogs/addmediadialog.cpp
View file @
06a04b15
...
...
@@ -93,7 +93,7 @@ void AddMediaDialog::slotButtonClicked(int button)
KIO
::
MimetypeJob
*
typeJob
=
KIO
::
mimetype
(
mediaUrl
,
KIO
::
HideProgressInfo
);
connect
(
typeJob
,
SIGNAL
(
mimetype
(
KIO
::
Job
*
,
const
QString
&
)
),
this
,
SLOT
(
sltRemoteFileTypeFound
(
KIO
::
Job
*
,
const
QString
&
)
)
);
this
,
SLOT
(
sl
o
tRemoteFileTypeFound
(
KIO
::
Job
*
,
const
QString
&
)
)
);
// addOtherMediaAttributes();
...
...
@@ -131,7 +131,7 @@ BilboMedia* AddMediaDialog::selectedMedia() const
return
media
;
}
void
AddMediaDialog
::
sltRemoteFileTypeFound
(
KIO
::
Job
*
job
,
const
QString
&
type
)
void
AddMediaDialog
::
sl
o
tRemoteFileTypeFound
(
KIO
::
Job
*
job
,
const
QString
&
type
)
{
kDebug
()
<<
type
;
Q_UNUSED
(
job
);
...
...
blogilo/src/composer/dialogs/addmediadialog.h
View file @
06a04b15
...
...
@@ -83,7 +83,7 @@ protected Q_SLOTS:
virtual
void
slotButtonClicked
(
int
button
);
virtual
void
slotSelectLocalFile
();
// virtual void sltOkClicked();
virtual
void
sltRemoteFileTypeFound
(
KIO
::
Job
*
job
,
const
QString
&
type
);
virtual
void
sl
o
tRemoteFileTypeFound
(
KIO
::
Job
*
job
,
const
QString
&
type
);
// void sltMediaSourceChanged();
};
...
...
blogilo/src/composer/medialistwidget.cpp
View file @
06a04b15
...
...
@@ -36,11 +36,11 @@
MediaListWidget
::
MediaListWidget
(
QWidget
*
parent
)
:
KListWidget
(
parent
)
{
actEdit
=
new
KAction
(
i18n
(
"Edit properties"
),
this
);
connect
(
actEdit
,
SIGNAL
(
triggered
(
bool
)
),
this
,
SLOT
(
sltEditProperties
()
)
);
connect
(
actEdit
,
SIGNAL
(
triggered
(
bool
)
),
this
,
SLOT
(
sl
o
tEditProperties
()
)
);
actCopyUrl
=
new
KAction
(
i18n
(
"Copy URL"
),
this
);
connect
(
actCopyUrl
,
SIGNAL
(
triggered
(
bool
)
),
this
,
SLOT
(
sltCopyUrl
()
)
);
connect
(
actCopyUrl
,
SIGNAL
(
triggered
(
bool
)
),
this
,
SLOT
(
sl
o
tCopyUrl
()
)
);
actRemove
=
new
KAction
(
i18n
(
"Remove media"
),
this
);
connect
(
actRemove
,
SIGNAL
(
triggered
(
bool
)
),
this
,
SLOT
(
sltRemoveMedia
()
)
);
connect
(
actRemove
,
SIGNAL
(
triggered
(
bool
)
),
this
,
SLOT
(
sl
o
tRemoveMedia
()
)
);
}
MediaListWidget
::~
MediaListWidget
()
...
...
@@ -60,7 +60,7 @@ void MediaListWidget::contextMenuEvent( QContextMenuEvent *event )
}
}
void
MediaListWidget
::
sltEditProperties
()
void
MediaListWidget
::
sl
o
tEditProperties
()
{
// QWidget *temp = new QWidget( this );
QPointer
<
KDialog
>
dialog
=
new
KDialog
(
this
);
...
...
@@ -72,25 +72,25 @@ void MediaListWidget::sltEditProperties()
dialog
->
resize
(
temp
->
width
(),
temp
->
height
()
);
dialog
->
setWindowModality
(
Qt
::
WindowModal
);
// dialog->setAttribute( Qt::WA_DeleteOnClose );
connect
(
dialog