• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

blogilo

  • sources
  • kde-4.14
  • kdepim
  • blogilo
  • src
toolbox.cpp
Go to the documentation of this file.
1 /*
2  This file is part of Blogilo, A KDE Blogging Client
3 
4  Copyright (C) 2008-2010 Mehrdad Momeny <mehrdad.momeny@gmail.com>
5  Copyright (C) 2008-2010 Golnaz Nilieh <g382nilieh@gmail.com>
6  Copyright (C) 2013-2015 Laurent Montel <montel@kde.org>
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2 of
11  the License or (at your option) version 3 or any later version
12  accepted by the membership of KDE e.V. (or its successor approved
13  by the membership of KDE e.V.), which shall act as a proxy
14  defined in Section 14 of version 3 of the license.
15 
16 
17  This program is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with this program; if not, see http://www.gnu.org/licenses/
24 */
25 //krazy:excludeall=qmethods due to use of KStatusBar::showMessage()
26 
27 #include "toolbox.h"
28 #include "dbman.h"
29 #include "entriescountdialog.h"
30 #include "addeditblog.h"
31 #include "backend.h"
32 #include "bilbopost.h"
33 #include "bilboblog.h"
34 #include "catcheckbox.h"
35 #include "settings.h"
36 
37 #include <KMenu>
38 #include <KAction>
39 #include <KToolInvocation>
40 #include <QClipboard>
41 #include <QTimer>
42 #include <kstatusbar.h>
43 #include <kdebug.h>
44 #include <kxmlguiwindow.h>
45 #include <kmessagebox.h>
46 #include <kdatetime.h>
47 #include <kurl.h>
48 
49 class Toolbox::Private
50 {
51 public:
52  QList<CatCheckBox*> listCategoryCheckBoxes;
53  int mCurrentBlogId;
54  KStatusBar *statusbar;
55 };
56 Toolbox::Toolbox( QWidget *parent )
57  : QWidget( parent ), d(new Private)
58 {
59  d->mCurrentBlogId = -1;
60  if ( parent )
61  d->statusbar = qobject_cast<KXmlGuiWindow*>( parent )->statusBar();
62  else
63  d->statusbar = new KStatusBar( this );
64  setupUi( this );
65  setButtonsIcon();
66  frameCat->layout()->setAlignment( Qt::AlignTop );
67  optionsDate->setDate( QDateTime::currentDateTime().date() );
68  optionsTime->setTime( QDateTime::currentDateTime().time() );
69 
70  connect( btnCatReload, SIGNAL(clicked()), this, SLOT(slotReloadCategoryList()) );
71  connect( btnEntriesUpdate, SIGNAL(clicked()), this, SLOT(slotUpdateEntries()) );
72  connect( btnEntriesClear, SIGNAL(clicked(bool)), this, SLOT(clearEntries()) );
73 
74  connect( lstEntriesList, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
75  this, SLOT(slotEntrySelected(QListWidgetItem*)) );
76  connect( btnEntriesRemove, SIGNAL(clicked(bool)), this, SLOT(slotRemoveSelectedEntryFromServer()) );
77 
78  connect( btnOptionsNow, SIGNAL(clicked(bool)), this, SLOT(setDateTimeNow()) );
79  connect( localEntries, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
80  this, SLOT(slotLocalEntrySelected(QTreeWidgetItem*,int)) );
81  connect( btnLocalRemove, SIGNAL(clicked(bool)) , this, SLOT(slotRemoveLocalEntry()) );
82 
83  lblOptionsTrackBack->setVisible( false );
84  txtOptionsTrackback->setVisible( false );
85  btnCatAdd->setVisible( false );
86 
87  lstEntriesList->setContextMenuPolicy( Qt::CustomContextMenu );
88  connect( lstEntriesList, SIGNAL(customContextMenuRequested(QPoint)),
89  this, SLOT(requestEntriesListContextMenu(QPoint)) );
90 
91  QTimer::singleShot(1000, this, SLOT(reloadLocalPosts()));
92 }
93 
94 Toolbox::~Toolbox()
95 {
96  delete d;
97 }
98 
99 
100 void Toolbox::setCurrentBlogId( int blog_id )
101 {
102  if ( d->mCurrentBlogId == blog_id )
103  return;
104  d->mCurrentBlogId = blog_id;
105  if ( blog_id <= 0 )
106  return;
107  slotLoadCategoryListFromDB( blog_id );
108  slotLoadEntriesFromDB( blog_id );
109  Qt::LayoutDirection ll = DBMan::self()->blogList().value( blog_id )->direction();
110  frameCat->setLayoutDirection( ll );
111  lstEntriesList->setLayoutDirection( ll );
112 }
113 
114 void Toolbox::slotReloadCategoryList()
115 {
116  if ( d->mCurrentBlogId == -1 ) {
117  KMessageBox::sorry( this, i18n( "No blog has been selected: you have to select a blog from the Blogs page before asking for the list of categories." ) );
118  return;
119  }
120 
121  Backend *b = new Backend( d->mCurrentBlogId );
122  connect( b, SIGNAL(sigCategoryListFetched(int)), this, SLOT(slotLoadCategoryListFromDB(int)) );
123  connect( b, SIGNAL(sigError(QString)), this, SIGNAL(sigError(QString)) );
124  emit sigBusy( true );
125  d->statusbar->showMessage( i18n( "Requesting list of categories..." ) );
126  b->getCategoryListFromServer();
127 }
128 
129 void Toolbox::slotUpdateEntries(int count)
130 {
131  if ( d->mCurrentBlogId == -1 ) {
132  KMessageBox::sorry( this, i18n( "No blog has been selected: you have to select a blog from the Blogs page before asking for the list of entries." ) );
133  return;
134  }
135  if (count == 0) {
136  count = Settings::updateEntriesCount();
137  if ( Settings::showUpdateEntriesDialog() ) {
138  QPointer<EntriesCountDialog> dia = new EntriesCountDialog( this );
139  if ( !dia->exec() ) {
140  delete dia;
141  return;
142  }
143  count = dia->count();
144  dia->deleteLater();
145  }
146  }
147  Backend *entryB = new Backend( d->mCurrentBlogId, this);
148  entryB->getEntriesListFromServer( count );
149  connect( entryB, SIGNAL(sigEntriesListFetched(int)), this, SLOT(slotLoadEntriesFromDB(int)) );
150  connect( entryB, SIGNAL(sigError(QString)), this, SIGNAL(sigError(QString)) );
151  d->statusbar->showMessage( i18n( "Requesting list of entries..." ) );
152  setCursor( Qt::BusyCursor );
153  emit sigBusy( true );
154 }
155 
156 void Toolbox::slotLoadEntriesFromDB( int blog_id )
157 {
158  if ( blog_id == -1 ) {
159  kDebug() << "Blog Id doesn't set correctly";
160  return;
161  }
162  lstEntriesList->clear();
163  const QList<QVariantMap> listEntries = DBMan::self()->listPostsInfo( blog_id );
164  const int count = listEntries.count();
165  for ( int i=0; i < count; ++i ) {
166  QListWidgetItem *lstItem = new QListWidgetItem( listEntries[i].value(QLatin1String("title")).toString() );
167  lstItem->setToolTip(listEntries.at(i).value(QLatin1String("c_time")).toDateTime().toString());
168  if (listEntries.at(i).value(QLatin1String("is_private")).toBool()) {
169  lstItem->setForeground(QBrush(Qt::blue));
170  lstItem->setToolTip(i18n("%1 (Draft)",lstItem->toolTip()));
171  }
172  lstItem->setData( BlogEntryID, listEntries.at(i).value(QLatin1String("id")).toInt() );
173  lstEntriesList->addItem( lstItem );
174  }
175  d->statusbar->showMessage( i18n( "List of entries received." ), STATUSTIMEOUT );
176  unsetCursor();
177  emit sigBusy( false );
178 }
179 
180 void Toolbox::slotLoadCategoryListFromDB( int blog_id )
181 {
182  if ( blog_id == -1 ) {
183  kDebug() << "Blog Id do not sets correctly";
184  return;
185  }
186  clearCatList();
187  QList<Category> listCategories;
188  listCategories = DBMan::self()->listCategories( blog_id );
189 
190  QList<Category>::const_iterator i;
191  QList<Category>::const_iterator endIt = listCategories.constEnd();
192  for ( i = listCategories.constBegin(); i != endIt; ++i ) {
193  CatCheckBox *cb = new CatCheckBox( i->name, this );
194  cb->setCategory( *i );
195  d->listCategoryCheckBoxes.append( cb );
196  frameCat->layout()->addWidget( cb );
197  }
198  d->statusbar->showMessage( i18n( "List of categories received." ), STATUSTIMEOUT );
199  unsetCursor();
200  emit sigBusy( false );
201 }
202 
203 void Toolbox::slotRemoveSelectedEntryFromServer()
204 {
205  if (lstEntriesList->selectedItems().count() < 1)
206  return;
207  if ( KMessageBox::warningYesNoCancel(this, i18n( "Removing a post from your blog cannot be undone.\nAre you sure you want to remove the post with title \"%1\" from your blog?", lstEntriesList->currentItem()->text() ))
208  == KMessageBox::Yes) {
209  BilboPost *post = new BilboPost( DBMan::self()->getPostInfo( lstEntriesList->currentItem()->
210  data(BlogEntryID).toInt() ) );
211  Backend *b = new Backend( d->mCurrentBlogId, this);
212  connect(b, SIGNAL(sigPostRemoved(int,BilboPost)), this, SLOT(slotPostRemoved(int,BilboPost)) );
213  connect(b, SIGNAL(sigError(QString)), this, SLOT(slotError(QString)));
214  b->removePost(post);
215  d->statusbar->showMessage( i18n( "Removing post..." ) );
216  }
217 }
218 
219 void Toolbox::slotPostRemoved( int blog_id, const BilboPost &post )
220 {
221  KMessageBox::information( this, i18nc( "Post removed from Blog", "Post with title \"%1\" removed from \"%2\".",
222  post.title(), DBMan::self()->blogList().value(blog_id)->title() ) );
223  slotLoadEntriesFromDB( blog_id );
224  d->statusbar->showMessage( i18n( "Post removed" ), STATUSTIMEOUT );
225  sender()->deleteLater();
226 }
227 
228 void Toolbox::slotError(const QString& errorMessage)
229 {
230  KMessageBox::detailedError( this, i18n( "An error occurred in the latest transaction." ), errorMessage );
231  d->statusbar->showMessage( i18nc( "Operation failed", "Failed" ), STATUSTIMEOUT );
232  sender()->deleteLater();
233 }
234 
235 void Toolbox::clearFields()
236 {
237  clearCatList();
238  lstEntriesList->clear();
239  txtCatTags->clear();
240  chkOptionsTime->setChecked( false );
241  optionsDate->setDate( QDateTime::currentDateTime().date() );
242  optionsTime->setTime( QDateTime::currentDateTime().time() );
243  txtOptionsTrackback->clear();
244  txtSlug->clear();
245  txtSummary->clear();
246  chkOptionsComments->setChecked( true );
247  chkOptionsTrackback->setChecked( true );
248  comboOptionsStatus->setCurrentIndex( 0 );
249 }
250 
251 void Toolbox::resetFields()
252 {
253  unCheckCatList();
254  txtCatTags->clear();
255  chkOptionsTime->setChecked( false );
256  optionsDate->setDate( QDateTime::currentDateTime().date() );
257  optionsTime->setTime( QDateTime::currentDateTime().time() );
258  txtOptionsTrackback->clear();
259  txtSlug->clear();
260  txtSummary->clear();
261  chkOptionsComments->setChecked( true );
262  chkOptionsTrackback->setChecked( true );
263  comboOptionsStatus->setCurrentIndex( 0 );
264 }
265 
266 void Toolbox::clearCatList()
267 {
268  foreach( CatCheckBox* cat, d->listCategoryCheckBoxes ){
269  cat->deleteLater();
270  }
271  d->listCategoryCheckBoxes.clear();
272 }
273 
274 void Toolbox::getFieldsValue( BilboPost* currentPost )
275 {
276  currentPost->setCategoryList( selectedCategories() );
277  currentPost->setTags( currentTags() );
278  currentPost->setModifyTimeStamp( chkOptionsTime->isChecked() );
279  if ( currentPost->status() == KBlog::BlogPost::New ) {
280  if ( chkOptionsTime->isChecked() ) {
281  currentPost->setModificationDateTime( KDateTime( optionsDate->date(), optionsTime->time() ) );
282  currentPost->setCreationDateTime( KDateTime( optionsDate->date(), optionsTime->time() ) );
283  } else {
284  currentPost->setCreationDateTime( KDateTime::currentLocalDateTime() );
285  currentPost->setModificationDateTime( KDateTime::currentLocalDateTime() );
286  }
287  } else {
288  currentPost->setCreationDateTime( KDateTime( optionsDate->date(), optionsTime->time() ) );
289  currentPost->setModificationDateTime( KDateTime( optionsDate->date(), optionsTime->time() ) );
290  }
291  if ( currentPost->creationDateTime().isUtc() || currentPost->modificationDateTime().isUtc() ){
292  kDebug()<<"creationDateTime was UTC!";
293  currentPost->setCreationDateTime( KDateTime( currentPost->creationDateTime().dateTime(),
294  KDateTime::LocalZone ) );
295  currentPost->setModificationDateTime( KDateTime( currentPost->modificationDateTime().dateTime(),
296  KDateTime::LocalZone ) );
297  }
298  currentPost->setSlug( txtSlug->text() );
299  currentPost->setPrivate(( comboOptionsStatus->currentIndex() == 1 ) ? true : false );
300  currentPost->setCommentAllowed( chkOptionsComments->isChecked() );
301  currentPost->setTrackBackAllowed( chkOptionsTrackback->isChecked() );
302  currentPost->setSummary( txtSummary->toPlainText() );
303 }
304 
305 void Toolbox::setFieldsValue( BilboPost* post )
306 {
307  if ( post == 0 ) {
308  resetFields();
309  kDebug()<<"post is NULL";
310  return;
311  }
312 
313  setSelectedCategories( post->categories() );
314  txtCatTags->setText( post->tags().join( QLatin1String(", ") ) );
315 // kDebug() << "Post status is: " << post->status();
316  if ( post->status() == KBlog::BlogPost::New )
317  comboOptionsStatus->setCurrentIndex( 2 );
318  else if ( post->isPrivate() )
319  comboOptionsStatus->setCurrentIndex( 1 );
320  else
321  comboOptionsStatus->setCurrentIndex( 0 );
322  chkOptionsComments->setChecked( post->isCommentAllowed() );
323  chkOptionsTrackback->setChecked( post->isTrackBackAllowed() );
324  chkOptionsTime->setChecked( post->isModifyTimeStamp() );
325  if ( post->creationDateTime().isUtc() || post->modificationDateTime().isUtc() ){
326  kDebug()<<"creationDateTime was UTC!";
327  post->setCreationDateTime(KDateTime(post->creationDateTime().dateTime(), KDateTime::LocalZone));
328  post->setModificationDateTime(KDateTime(post->modificationDateTime().dateTime(), KDateTime::LocalZone));
329  }
330  optionsTime->setTime( post->creationDateTime().time() );
331  optionsDate->setDate( post->creationDateTime().date() );
332  txtSlug->setText( KUrl::fromPercentEncoding( post->slug().toLatin1() ) );
333  txtSummary->setPlainText( post->summary() );
334 }
335 
336 QList< Category > Toolbox::selectedCategories() const
337 {
338  QList<Category> list;
339  const int count = d->listCategoryCheckBoxes.count();
340  for ( int i = 0; i < count; ++i ) {
341  if ( d->listCategoryCheckBoxes.at(i)->isChecked() )
342  list.append( d->listCategoryCheckBoxes.at(i)->category() );
343  }
344  return list;
345 }
346 
347 QStringList Toolbox::selectedCategoriesTitle() const
348 {
349  QStringList list;
350  const int count = d->listCategoryCheckBoxes.count();
351  for ( int i = 0; i < count; ++i ) {
352  if ( d->listCategoryCheckBoxes.at(i)->isChecked() )
353  list.append( d->listCategoryCheckBoxes.at(i)->category().name );
354  }
355  return list;
356 }
357 
358 void Toolbox::setSelectedCategories( const QStringList &list )
359 {
360  unCheckCatList();
361  int count = d->listCategoryCheckBoxes.count();
362  for ( int i = 0; i < count; ++i ) {
363  if ( list.contains( d->listCategoryCheckBoxes.at(i)->category().name, Qt::CaseInsensitive ) )
364  d->listCategoryCheckBoxes.at(i)->setChecked( true );
365  }
366 }
367 
368 QStringList Toolbox::currentTags()
369 {
370  QStringList t = txtCatTags->text().split( QRegExp( QString::fromUtf8(",|ØŒ") ), QString::SkipEmptyParts );
371  for ( int i = 0; i < t.count() ; ++i ) {
372  t[i] = t[i].trimmed();
373  }
374  return t;
375 }
376 
377 void Toolbox::slotEntrySelected( QListWidgetItem * item )
378 {
379  BilboPost post = DBMan::self()->getPostInfo( item->data( BlogEntryID ).toInt() );
380  kDebug() << "Emiting sigEntrySelected...";
381  Q_EMIT sigEntrySelected( post, d->mCurrentBlogId );
382 }
383 
384 void Toolbox::setCurrentPage( int index )
385 {
386  box->setCurrentIndex( index );
387 }
388 
389 void Toolbox::slotEntriesCopyUrl()
390 {
391  if ( lstEntriesList->currentItem() == 0 ) {
392  return;
393  }
394  BilboPost post = DBMan::self()->getPostInfo( lstEntriesList->currentItem()->data( BlogEntryID ).toInt() );
395  if ( !post.permaLink().isEmpty() )
396  QApplication::clipboard()->setText( post.permaLink().prettyUrl() );
397  else if ( !post.link().isEmpty() )
398  QApplication::clipboard()->setText( post.link().prettyUrl() );
399  else
400  KMessageBox::sorry(this, i18n( "No link field is available in the database for this entry." ) );
401 }
402 
403 void Toolbox::unCheckCatList()
404 {
405  const int count = d->listCategoryCheckBoxes.count();
406  for ( int j = 0; j < count; ++j ) {
407  d->listCategoryCheckBoxes.at(j)->setChecked( false );
408  }
409 }
410 
411 void Toolbox::setButtonsIcon()
412 {
413  btnEntriesUpdate->setIcon( KIcon( QLatin1String("view-refresh") ) );
414  btnEntriesRemove->setIcon( KIcon( QLatin1String("list-remove") ) );
415  btnEntriesClear->setIcon( KIcon( QLatin1String("edit-clear") ) );
416  btnCatReload->setIcon( KIcon( QLatin1String("view-refresh") ) );
417  btnCatAdd->setIcon( KIcon( QLatin1String("list-add") ) );
418  btnLocalRemove->setIcon( KIcon( QLatin1String("list-remove") ) );
420 }
421 
422 void Toolbox::reloadLocalPosts()
423 {
424  kDebug();
425 
426  localEntries->clear();
427 
428  QList<QVariantMap> localList = DBMan::self()->listLocalPosts();
429  const int count = localList.count();
430 
431  for (int i=0; i < count; ++i){
432  const QString postTitle = localList.at(i).value( QLatin1String("post_title") ).toString();
433  const QString blogTitle = localList.at(i).value( QLatin1String("blog_title") ).toString();
434 
435  QTreeWidgetItem *item = new QTreeWidgetItem( localEntries, QStringList()<<postTitle<<blogTitle );
436  item->setData(0, LocalEntryID, localList.at(i).value( QLatin1String("local_id") ).toInt());
437  item->setData(1, LocalEntryID, localList.at(i).value( QLatin1String("blog_id") ).toInt());
438  }
439 }
440 
441 void Toolbox::slotLocalEntrySelected( QTreeWidgetItem* item,int column )
442 {
443  kDebug()<<"Emitting sigEntrySelected...";
444  Q_UNUSED(column);
445  BilboPost post = DBMan::self()->localPost(item->data(0, LocalEntryID).toInt());
446  emit sigEntrySelected( post, item->data(1, LocalEntryID).toInt() );
447 }
448 
449 void Toolbox::slotRemoveLocalEntry()
450 {
451  if (localEntries->currentItem()) {
452  if ( KMessageBox::warningYesNo(this, i18n("Are you sure you want to remove the selected local entry?"))
453  == KMessageBox::No )
454  return;
455  const int local_id = localEntries->currentItem()->data(0,LocalEntryID).toInt();
456  if ( DBMan::self()->removeLocalEntry(local_id) ) {
457  delete localEntries->currentItem();
458  } else {
459  KMessageBox::detailedError(this, i18n("Cannot remove selected local entry."),
460  DBMan::self()->lastErrorText());
461  }
462  } else {
463  KMessageBox::sorry(this, i18n("You have to select at least one entry from list."));
464  }
465 }
466 
467 void Toolbox::clearEntries()
468 {
469  if ( d->mCurrentBlogId == -1 )
470  return;
471  if ( KMessageBox::warningContinueCancel(this, i18n("Are you sure you want to clear the list of entries?")) ==
472  KMessageBox::Cancel )
473  return;
474  if ( DBMan::self()->clearPosts( d->mCurrentBlogId ) )
475  lstEntriesList->clear();
476  else
477  KMessageBox::detailedSorry(this, i18n( "Cannot clear the list of entries." ) , DBMan::self()->lastErrorText());
478 }
479 
480 void Toolbox::setDateTimeNow()
481 {
482  optionsDate->setDate( QDate::currentDate() );
483  optionsTime->setTime( QTime::currentTime() );
484 }
485 
486 void Toolbox::requestEntriesListContextMenu( const QPoint & pos )
487 {
488  if ( lstEntriesList->selectedItems().isEmpty() )
489  return;
490  Q_UNUSED(pos);
491  KMenu *entriesContextMenu = new KMenu;
492  KAction *actEntriesOpenInBrowser = new KAction( KIcon(QLatin1String("applications-internet")),
493  i18n("Open in browser"), entriesContextMenu );
494  connect( actEntriesOpenInBrowser, SIGNAL(triggered()), this, SLOT(openPostInBrowser()) );
495  KAction *actEntriesCopyUrl = new KAction( KIcon(QLatin1String("edit-copy")),
496  i18n("Copy URL"), entriesContextMenu );
497  connect( actEntriesCopyUrl, SIGNAL(triggered(bool)), this, SLOT(slotEntriesCopyUrl()) );
498  KAction *actEntriesCopyTitle = new KAction( KIcon(QLatin1String("edit-copy")),
499  i18n("Copy title"), entriesContextMenu );
500  connect( actEntriesCopyTitle, SIGNAL(triggered(bool)), this, SLOT(copyPostTitle()) );
501  entriesContextMenu->addAction( actEntriesOpenInBrowser );
502  entriesContextMenu->addAction( actEntriesCopyUrl );
503  entriesContextMenu->addAction( actEntriesCopyTitle );
504  entriesContextMenu->exec( QCursor::pos() );
505  delete entriesContextMenu;
506 }
507 
508 void Toolbox::openPostInBrowser()
509 {
510  if ( lstEntriesList->selectedItems().isEmpty() )
511  return;
512  BilboPost post = DBMan::self()->getPostInfo( lstEntriesList->currentItem()->data( BlogEntryID ).toInt() );
513  QString url;
514  if ( !post.permaLink().isEmpty() )
515  url = post.permaLink().pathOrUrl();
516  else if ( !post.link().isEmpty() )
517  url = post.link().pathOrUrl();
518  else
519  url = DBMan::self()->blogList().value( d->mCurrentBlogId )->blogUrl();
520  KToolInvocation::invokeBrowser ( url );
521 }
522 
523 void Toolbox::copyPostTitle()
524 {
525  if ( !lstEntriesList->selectedItems().isEmpty() )
526  QApplication::clipboard()->setText( lstEntriesList->currentItem()->text() );
527 }
528 
QWidget::customContextMenuRequested
void customContextMenuRequested(const QPoint &pos)
Toolbox::clearFields
void clearFields()
Definition: toolbox.cpp:235
Toolbox::setFieldsValue
void setFieldsValue(BilboPost *post=0)
Definition: toolbox.cpp:305
QWidget
QWidget::setupUi
void setupUi(QWidget *widget)
Toolbox::reloadLocalPosts
void reloadLocalPosts()
Definition: toolbox.cpp:422
Toolbox::sigError
void sigError(const QString &)
Toolbox::slotRemoveLocalEntry
void slotRemoveLocalEntry()
Definition: toolbox.cpp:449
QWidget::setCursor
void setCursor(const QCursor &)
Toolbox::slotLoadEntriesFromDB
void slotLoadEntriesFromDB(int blog_id)
Definition: toolbox.cpp:156
Toolbox::slotEntriesCopyUrl
void slotEntriesCopyUrl()
Definition: toolbox.cpp:389
QObject::sender
QObject * sender() const
QList::at
const T & at(int i) const
QPointer
QStringList::contains
bool contains(const QString &str, Qt::CaseSensitivity cs) const
QListWidgetItem
QTreeWidgetItem::setData
virtual void setData(int column, int role, const QVariant &value)
QBrush
Toolbox::slotUpdateEntries
void slotUpdateEntries(int count=0)
Definition: toolbox.cpp:129
DBMan::self
static DBMan * self()
Retrieve the instance of DataBase Manager.
Definition: dbman.cpp:117
QPoint
Toolbox::sigEntrySelected
void sigEntrySelected(BilboPost &post, int blog_id)
BilboPost
Definition of a blog post! it's implemented to decrease dependency to KBlog :)
Definition: bilbopost.h:41
QTreeWidgetItem::data
virtual QVariant data(int column, int role) const
Toolbox::copyPostTitle
void copyPostTitle()
Definition: toolbox.cpp:523
DBMan::listLocalPosts
QList< QVariantMap > listLocalPosts()
Returns list of locally saved posts.
Definition: dbman.cpp:1363
bilbopost.h
QListWidgetItem::toolTip
QString toolTip() const
QRegExp
QList::count
int count(const T &value) const
entriescountdialog.h
QList::append
void append(const T &value)
QString::fromUtf8
QString fromUtf8(const char *str, int size)
Toolbox::clearEntries
void clearEntries()
Definition: toolbox.cpp:467
KXmlGuiWindow
BilboPost::setModifyTimeStamp
void setModifyTimeStamp(bool willModify)
Definition: bilbopost.cpp:131
QVariant::toInt
int toInt(bool *ok) const
QApplication::clipboard
QClipboard * clipboard()
Backend::removePost
void removePost(BilboPost *post)
Remove an existing post from server.
Definition: backend.cpp:311
QListWidgetItem::setToolTip
void setToolTip(const QString &toolTip)
Toolbox::openPostInBrowser
void openPostInBrowser()
Definition: toolbox.cpp:508
Toolbox::setCurrentBlogId
void setCurrentBlogId(int blog_id)
Definition: toolbox.cpp:100
STATUSTIMEOUT
static const int STATUSTIMEOUT
Definition: constants.h:40
addeditblog.h
Toolbox::slotPostRemoved
void slotPostRemoved(int blog_id, const BilboPost &post)
Definition: toolbox.cpp:219
Toolbox::slotReloadCategoryList
void slotReloadCategoryList()
Definition: toolbox.cpp:114
Toolbox::setCurrentPage
void setCurrentPage(int index)
Definition: toolbox.cpp:384
QListWidgetItem::data
virtual QVariant data(int role) const
DBMan::listCategories
QList< Category > listCategories(int blog_id)
Definition: dbman.cpp:1254
CatCheckBox
Extend QCheckBox to add property needed for Category checkboxes.
Definition: catcheckbox.h:37
QObject::deleteLater
void deleteLater()
DBMan::localPost
BilboPost localPost(int local_id)
Definition: dbman.cpp:1386
QString
Toolbox::slotRemoveSelectedEntryFromServer
void slotRemoveSelectedEntryFromServer()
Definition: toolbox.cpp:203
QList< CatCheckBox * >
Toolbox::setDateTimeNow
void setDateTimeNow()
Definition: toolbox.cpp:480
QListWidgetItem::setForeground
void setForeground(const QBrush &brush)
EntriesCountDialog
Definition: entriescountdialog.h:36
QStringList
bilboblog.h
Toolbox::requestEntriesListContextMenu
void requestEntriesListContextMenu(const QPoint &pos)
Definition: toolbox.cpp:486
Toolbox::slotLocalEntrySelected
void slotLocalEntrySelected(QTreeWidgetItem *, int column)
Definition: toolbox.cpp:441
Backend::getEntriesListFromServer
void getEntriesListFromServer(int count)
retrieve latest posts from server
Definition: backend.cpp:133
toolbox.h
QListWidgetItem::setData
virtual void setData(int role, const QVariant &value)
DBMan::blogList
const QMap< int, BilboBlog * > & blogList() const
Definition: dbman.cpp:124
Backend
Engine of application.
Definition: backend.h:45
dbman.h
QTime::currentTime
QTime currentTime()
QDateTime::currentDateTime
QDateTime currentDateTime()
QCursor::pos
QPoint pos()
QTreeWidgetItem
QLatin1String
CatCheckBox::setCategory
void setCategory(const Category &category)
Definition: catcheckbox.cpp:55
Toolbox::getFieldsValue
void getFieldsValue(BilboPost *currentPost)
Will set current state of toolbox (Current post) properties on input pointer!
Definition: toolbox.cpp:274
Toolbox::~Toolbox
~Toolbox()
Definition: toolbox.cpp:94
QDate::currentDate
QDate currentDate()
DBMan::listPostsInfo
QList< QVariantMap > listPostsInfo(int blog_id)
QString as Title, and int as post_id.
Definition: dbman.cpp:1215
QStringList::split
QStringList split(const QString &sep, const QString &str, bool allowEmptyEntries)
Toolbox::Toolbox
Toolbox(QWidget *parent)
Definition: toolbox.cpp:56
Backend::getCategoryListFromServer
void getCategoryListFromServer()
Request to Fetch categories list from server.
Definition: backend.cpp:92
Toolbox::slotLoadCategoryListFromDB
void slotLoadCategoryListFromDB(int blog_id)
Definition: toolbox.cpp:180
QClipboard::setText
void setText(const QString &text, Mode mode)
catcheckbox.h
DBMan::getPostInfo
BilboPost getPostInfo(int post_id)
Definition: dbman.cpp:1128
BilboPost::isModifyTimeStamp
bool isModifyTimeStamp() const
Definition: bilbopost.cpp:126
QList::constEnd
const_iterator constEnd() const
Toolbox::resetFields
void resetFields()
Definition: toolbox.cpp:251
QList::constBegin
const_iterator constBegin() const
backend.h
Toolbox::slotError
void slotError(const QString &errorMessage)
Definition: toolbox.cpp:228
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject::parent
QObject * parent() const
Toolbox::sigBusy
void sigBusy(bool isBusy)
Toolbox::slotEntrySelected
void slotEntrySelected(QListWidgetItem *item)
Definition: toolbox.cpp:377
QMap::value
const T value(const Key &key) const
QTimer::singleShot
singleShot
BilboPost::setCategoryList
void setCategoryList(const QList< Category > &list)
Definition: bilbopost.cpp:141
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:16 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

blogilo

Skip menu "blogilo"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal