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

knotes

  • sources
  • kde-4.12
  • kdepim
  • knotes
  • apps
knotesapp.cpp
Go to the documentation of this file.
1 /*******************************************************************
2  KNotes -- Notes for the KDE project
3 
4  Copyright (c) 1997-2009, The KNotes Developers
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 *******************************************************************/
20 
21 #include "configdialog/knoteconfigdialog.h"
22 #include "notes/knote.h"
23 #include "knotes/resource/resourcemanager.h"
24 #include "knotesadaptor.h"
25 #include "alarms/knotesalarm.h"
26 #include "knotesapp.h"
27 #include "print/knoteprinter.h"
28 #include "print/knoteprintobject.h"
29 #include "knotesglobalconfig.h"
30 #include "migrations/knoteslegacy.h"
31 #include "network/knotesnetrecv.h"
32 #include "knotestray.h"
33 #include "dialog/knoteskeydialog.h"
34 #include "print/knoteprintselectednotesdialog.h"
35 
36 #include <kaction.h>
37 #include <kactioncollection.h>
38 #include <kconfig.h>
39 #include <kdebug.h>
40 #include <kfind.h>
41 #include <kfinddialog.h>
42 #include <khelpmenu.h>
43 #include <kicon.h>
44 #include <kiconeffect.h>
45 #include <klocale.h>
46 #include <kmenu.h>
47 #include <kshortcutsdialog.h>
48 #include <ksocketfactory.h>
49 #include <kstandardaction.h>
50 #include <kstandarddirs.h>
51 #include <ksystemtrayicon.h>
52 #include <kwindowsystem.h>
53 #include <kxmlguibuilder.h>
54 #include <kxmlguifactory.h>
55 
56 #include <kcal/calendarlocal.h>
57 #include <kcal/journal.h>
58 #include <kiconloader.h>
59 
60 #include <QPixmap>
61 #include <QClipboard>
62 #include <QTcpServer>
63 
64 #include <dnssd/publicservice.h>
65 
66 static bool qActionLessThan( const QAction *a1, const QAction *a2 )
67 {
68  return ( a1->text() < a2->text() );
69 }
70 
71 
72 KNotesApp::KNotesApp()
73  : QWidget(),
74  m_alarm( 0 ),
75  m_listener( 0 ),
76  m_publisher( 0 ),
77  m_find( 0 ),
78  m_findPos( 0 )
79 {
80  new KNotesAdaptor( this );
81  QDBusConnection::sessionBus().registerObject( QLatin1String("/KNotes") , this );
82  kapp->setQuitOnLastWindowClosed( false );
83 
84  // create the dock widget...
85  m_tray = new KNotesTray(0);
86 
87  connect( m_tray, SIGNAL(activateRequested(bool,QPoint)), this, SLOT(slotActivateRequested(bool,QPoint)) );
88  connect( m_tray, SIGNAL(secondaryActivateRequested(QPoint)), this, SLOT(slotSecondaryActivateRequested(QPoint)) );
89 
90  // create the GUI...
91  KAction *action = new KAction( KIcon( QLatin1String("document-new") ),
92  i18n( "New Note" ), this );
93  actionCollection()->addAction( QLatin1String("new_note"), action );
94  action->setGlobalShortcut( KShortcut( Qt::ALT + Qt::SHIFT + Qt::Key_N ));
95  connect( action, SIGNAL(triggered()), SLOT(newNote()) );
96 
97  action = new KAction( KIcon( QLatin1String("edit-paste") ),
98  i18n( "New Note From Clipboard" ), this );
99  actionCollection()->addAction( QLatin1String("new_note_clipboard"), action );
100  action->setGlobalShortcut( KShortcut( Qt::ALT + Qt::SHIFT + Qt::Key_C ));
101  connect( action, SIGNAL(triggered()), SLOT(newNoteFromClipboard()) );
102 
103  action = new KAction( KIcon(QLatin1String( "knotes") ), i18n( "Show All Notes" ), this );
104  actionCollection()->addAction( QLatin1String("show_all_notes"), action );
105  action->setGlobalShortcut( KShortcut( Qt::ALT + Qt::SHIFT + Qt::Key_S ));
106  connect( action, SIGNAL(triggered()), SLOT(showAllNotes()) );
107 
108  action = new KAction( KIcon( QLatin1String("window-close") ),
109  i18n( "Hide All Notes" ), this );
110  actionCollection()->addAction( QLatin1String("hide_all_notes"), action );
111  action->setGlobalShortcut( KShortcut( Qt::ALT + Qt::SHIFT + Qt::Key_H ));
112  connect( action, SIGNAL(triggered()), SLOT(hideAllNotes()) );
113 
114  action = new KAction( KIcon( QLatin1String("document-print") ),
115  i18nc( "@action:inmenu", "Print Selected Notes..." ), this );
116  actionCollection()->addAction( QLatin1String("print_selected_notes"), action );
117  connect( action, SIGNAL(triggered()), SLOT(slotPrintSelectedNotes()) );
118 
119 
120  new KHelpMenu( this, KGlobal::mainComponent().aboutData(), false,
121  actionCollection() );
122 
123  m_findAction = KStandardAction::find( this, SLOT(slotOpenFindDialog()),
124  actionCollection() );
125  KStandardAction::preferences( this, SLOT(slotPreferences()),
126  actionCollection() );
127  KStandardAction::keyBindings( this, SLOT(slotConfigureAccels()),
128  actionCollection() );
129  //FIXME: no shortcut removing!?
130  KStandardAction::quit( this, SLOT(slotQuit()),
131  actionCollection() )->setShortcut( 0 );
132 
133  setXMLFile( componentData().componentName() + QLatin1String("appui.rc") );
134 
135  m_guiBuilder = new KXMLGUIBuilder( this );
136  m_guiFactory = new KXMLGUIFactory( m_guiBuilder, this );
137  m_guiFactory->addClient( this );
138 
139  m_contextMenu = static_cast<KMenu *>( m_guiFactory->container(
140  QLatin1String("knotes_context"),
141  this ) );
142  m_noteMenu = static_cast<KMenu *>( m_guiFactory->container(
143  QLatin1String("notes_menu"), this ) );
144  m_tray->setContextMenu( m_contextMenu );
145  // get the most recent XML UI file
146  QString xmlFileName = componentData().componentName() + QLatin1String("ui.rc");
147  QString filter = componentData().componentName() + QLatin1Char('/') + xmlFileName;
148  const QStringList fileList =
149  componentData().dirs()->findAllResources( "data", filter ) +
150  componentData().dirs()->findAllResources( "data", xmlFileName );
151 
152  QString doc;
153  KXMLGUIClient::findMostRecentXMLFile( fileList, doc );
154  m_noteGUI.setContent( doc );
155  const bool needConvert = (KNotesGlobalConfig::self()->notesVersion()<1);
156  if ( needConvert ) {
157  // clean up old config files
158  KNotesLegacy::cleanUp();
159  }
160 
161  // create the resource manager
162  m_manager = new KNotesResourceManager();
163  connect( m_manager, SIGNAL(sigRegisteredNote(KCal::Journal*)),
164  this, SLOT(createNote(KCal::Journal*)) );
165  connect( m_manager, SIGNAL(sigDeregisteredNote(KCal::Journal*)),
166  this, SLOT(killNote(KCal::Journal*)) );
167 
168  // read the notes
169  m_manager->load();
170 
171  if (needConvert) {
172  // read the old config files, convert and add them
173  KCal::CalendarLocal calendar( QString::fromLatin1( "UTC" ) );
174  if ( KNotesLegacy::convert( &calendar ) ) {
175  KCal::Journal::List notes = calendar.journals();
176  KCal::Journal::List::ConstIterator it;
177  KCal::Journal::List::ConstIterator end(notes.constEnd());
178  for ( it = notes.constBegin(); it != end; ++it ) {
179  m_manager->addNewNote( *it );
180  }
181 
182  m_manager->save();
183  }
184  KNotesGlobalConfig::self()->setNotesVersion(1);
185  }
186 
187 
188  // set up the alarm reminder - do it after loading the notes because this
189  // is used as a check if updateNoteActions has to be called for a new note
190  m_alarm = new KNotesAlarm( m_manager, this );
191 
192  updateNetworkListener();
193 
194  /*
195  if ( m_notes.isEmpty() && !kapp->isSessionRestored() ) {
196  newNote();
197  }
198  */
199 
200  m_tray->updateNumberOfNotes(m_notes.count());
201  updateNoteActions();
202 }
203 
204 KNotesApp::~KNotesApp()
205 {
206  saveNotes();
207 
208  blockSignals( true );
209  qDeleteAll( m_notes );
210  m_notes.clear();
211  qDeleteAll( m_noteActions );
212  m_noteActions.clear();
213  blockSignals( false );
214 
215  delete m_listener;
216  m_listener=0;
217  delete m_publisher;
218  m_publisher=0;
219  delete m_findPos;
220  m_findPos = 0;
221  delete m_manager;
222  delete m_guiBuilder;
223  delete m_tray;
224 }
225 
226 bool KNotesApp::commitData( QSessionManager & )
227 {
228  foreach ( KNote *note, m_notes ) {
229  note->commitData();
230  }
231  saveConfigs();
232  return true;
233 }
234 
235 // -------------------- public D-Bus interface -------------------- //
236 
237 QString KNotesApp::newNote( const QString &name, const QString &text )
238 {
239  // create the new note
240  KCal::Journal *journal = new KCal::Journal();
241 
242  // new notes have the current date/time as title if none was given
243  if ( !name.isEmpty() ) {
244  journal->setSummary( name );
245  } else {
246  journal->setSummary( KGlobal::locale()->formatDateTime(
247  QDateTime::currentDateTime() ) );
248  }
249 
250  // the body of the note
251  journal->setDescription( text );
252 
253  if ( m_manager->addNewNote( journal ) ) {
254  showNote( journal->uid() );
255  }
256 
257  return journal->uid();
258 }
259 
260 QString KNotesApp::newNoteFromClipboard( const QString &name )
261 {
262  const QString &text = KApplication::clipboard()->text();
263  return newNote( name, text );
264 }
265 
266 void KNotesApp::hideAllNotes() const
267 {
268  foreach ( KNote *note, m_notes ) {
269  note->slotClose();
270  }
271 }
272 
273 void KNotesApp::showAllNotes() const
274 {
275  foreach ( KNote *note, m_notes ) {
276  // workaround to BUG 149116
277  note->hide();
278 
279  note->show();
280  }
281 }
282 
283 void KNotesApp::showNote( const QString &id ) const
284 {
285  KNote *note = m_notes.value( id );
286  if ( note ) {
287  showNote( note );
288  } else {
289  kWarning( 5500 ) << "showNote: no note with id:" << id;
290  }
291 }
292 
293 void KNotesApp::hideNote( const QString &id ) const
294 {
295  KNote *note = m_notes.value( id );
296  if ( note ) {
297  note->hide();
298  } else {
299  kWarning( 5500 ) << "hideNote: no note with id:" << id;
300  }
301 }
302 
303 void KNotesApp::killNote( const QString &id, bool force )
304 {
305  KNote *note = m_notes.value( id );
306  if ( note ) {
307  note->slotKill( force );
308  } else {
309  kWarning( 5500 ) << "killNote: no note with id:" << id;
310  }
311 }
312 
313 // "bool force = false" doesn't work with dcop
314 void KNotesApp::killNote( const QString &id )
315 {
316  killNote( id, false );
317 }
318 
319 QVariantMap KNotesApp::notes() const
320 {
321  QVariantMap notes;
322 
323  foreach ( KNote *note, m_notes ) {
324  notes.insert( note->noteId(), note->name() );
325  }
326 
327  return notes;
328 }
329 
330 QString KNotesApp::name( const QString &id ) const
331 {
332  KNote *note = m_notes.value( id );
333  if ( note ) {
334  return note->name();
335  } else {
336  return QString();
337  }
338 }
339 
340 QString KNotesApp::text( const QString &id ) const
341 {
342  KNote *note = m_notes.value( id );
343  if ( note ) {
344  return note->text();
345  } else {
346  return QString();
347  }
348 }
349 
350 void KNotesApp::setName( const QString &id, const QString &newName )
351 {
352  KNote *note = m_notes.value( id );
353  if ( note ) {
354  note->setName( newName );
355  } else {
356  kWarning( 5500 ) << "setName: no note with id:" << id;
357  }
358 }
359 
360 void KNotesApp::setText( const QString &id, const QString &newText )
361 {
362  KNote *note = m_notes.value( id );
363  if ( note ) {
364  note->setText( newText );
365  } else {
366  kWarning( 5500 ) << "setText: no note with id:" << id;
367  }
368 }
369 
370 // -------------------- protected slots -------------------- //
371 
372 void KNotesApp::slotActivateRequested( bool, const QPoint&)
373 {
374  if ( m_notes.size() == 1 ) {
375  showNote( *m_notes.begin() );
376  } else {
377  m_noteMenu->popup( QCursor::pos ());
378  }
379 }
380 
381 void KNotesApp::slotSecondaryActivateRequested( const QPoint & )
382 {
383  newNote();
384 }
385 
386 void KNotesApp::slotShowNote()
387 {
388  // tell the WM to give this note focus
389  showNote( sender()->objectName() );
390 }
391 
392 void KNotesApp::slotWalkThroughNotes()
393 {
394  // show next note
395  QMap<QString, KNote *>::const_iterator it = m_notes.constBegin();
396  QMap<QString, KNote *>::const_iterator end(m_notes.constEnd());
397  for ( ; it != end; ++it ) {
398  if ( ( *it )->hasFocus() ) {
399  if ( ++it != end ) {
400  showNote( *it );
401  } else {
402  showNote( *m_notes.constBegin() );
403  }
404  break;
405  }
406  }
407 }
408 
409 void KNotesApp::slotOpenFindDialog()
410 {
411  KFindDialog findDia( this );
412  findDia.setObjectName( QLatin1String("find_dialog") );
413  findDia.setHasSelection( false );
414  findDia.setHasCursor( false );
415  findDia.setSupportsBackwardsFind( false );
416 
417  if ( (findDia.exec() != QDialog::Accepted) ) {
418  delete m_findPos;
419  m_findPos = 0;
420  delete m_find;
421  m_find = 0;
422  return;
423  }
424 
425  delete m_findPos;
426  m_findPos = new QMap<QString, KNote *>::iterator();
427  *m_findPos = m_notes.begin();
428 
429  // this could be in an own method if searching without a dialog
430  // should be possible
431  delete m_find;
432  m_find = new KFind( findDia.pattern(), findDia.options(), this );
433 
434  slotFindNext();
435 }
436 
437 void KNotesApp::slotFindNext()
438 {
439  if ( *m_findPos != m_notes.end() ) {
440  KNote *note = * ( (*m_findPos)++ );
441  note->find( m_find );
442  } else {
443  m_find->displayFinalDialog();
444  m_find->deleteLater(); //we can't delete m_find now because it is the signal emitter
445  m_find = 0;
446  delete m_findPos;
447  m_findPos = 0;
448  }
449 }
450 
451 void KNotesApp::slotPreferences()
452 {
453  // create a new preferences dialog...
454  KNoteConfigDialog *dialog = new KNoteConfigDialog( i18n( "Settings" ), this);
455  connect( dialog, SIGNAL(configWrote()), this, SLOT(slotConfigUpdated()));
456  dialog->show();
457 }
458 
459 void KNotesApp::slotConfigUpdated()
460 {
461  updateNetworkListener();
462 }
463 
464 void KNotesApp::slotConfigureAccels()
465 {
466  QPointer<KNotesKeyDialog> keys = new KNotesKeyDialog( actionCollection(), this );
467 
468  QMap<QString, KNote *>::const_iterator it = m_notes.constBegin();
469 
470  if ( !m_notes.isEmpty() ) {
471  keys->insert( ( *it )->actionCollection() );
472  }
473 
474  if (keys->exec()) {
475  keys->save();
476 
477  // update GUI doc for new notes
478  m_noteGUI.setContent(
479  KXMLGUIFactory::readConfigFile( componentData().componentName() + QLatin1String("ui.rc"),
480  componentData() )
481  );
482 
483  if ( !m_notes.isEmpty() ) {
484  QMap<QString, KNote *>::const_iterator end = m_notes.constEnd();
485 
486  foreach ( QAction *action, ( *it )->actionCollection()->actions() ) {
487  it = m_notes.constBegin();
488 
489  for ( ++it; it != end; ++it ) {
490  /*
491  // Not sure if this is what this message has in mind but since both
492  // action->objectName() and KAction::action() are QStrings, this
493  // might be fine.
494  // Correct me if I am wrong... ~ gamaral
495 #ifdef __GNUC__
496 #warning Port KAction::action() to QString
497 #endif
498 */
499  QAction *toChange = ( *it )->actionCollection()->action( action->objectName() );
500  if ( toChange ) {
501  toChange->setShortcuts( action->shortcuts() );
502  }
503  }
504  }
505  }
506  }
507  delete keys;
508 }
509 
510 void KNotesApp::slotNoteKilled( KCal::Journal *journal )
511 {
512  m_noteUidModify.clear();
513  m_manager->deleteNote( journal );
514  saveNotes();
515  m_tray->updateNumberOfNotes(m_notes.count());
516 }
517 
518 void KNotesApp::slotQuit()
519 {
520  foreach ( KNote *note, m_notes ) {
521  if ( note->isModified() ) {
522  note->saveData(false);
523  }
524  }
525  saveConfigs();
526  kapp->quit();
527 }
528 
529 // -------------------- private methods -------------------- //
530 
531 void KNotesApp::showNote( KNote *note ) const
532 {
533  note->show();
534 #ifdef Q_WS_X11
535  if ( !note->isDesktopAssigned() ) {
536  note->toDesktop( KWindowSystem::currentDesktop() );
537  } else {
538  KWindowSystem::setCurrentDesktop(
539  KWindowSystem::windowInfo( note->winId(), NET::WMDesktop ).desktop() );
540  }
541  KWindowSystem::forceActiveWindow( note->winId() );
542 #endif
543  note->setFocus();
544 }
545 
546 void KNotesApp::createNote( KCal::Journal *journal )
547 {
548  if( journal->uid() == m_noteUidModify)
549  {
550  KNote *note = m_notes.value( m_noteUidModify );
551  if ( note )
552  note->changeJournal(journal);
553  return;
554  }
555 
556  m_noteUidModify = journal->uid();
557  KNote *newNote = new KNote( m_noteGUI, journal, 0 );
558  m_notes.insert( newNote->noteId(), newNote );
559 
560  connect( newNote, SIGNAL(sigRequestNewNote()),
561  SLOT(newNote()) );
562  connect( newNote, SIGNAL(sigShowNextNote()),
563  SLOT(slotWalkThroughNotes()) ) ;
564  connect( newNote, SIGNAL(sigKillNote(KCal::Journal*)),
565  SLOT(slotNoteKilled(KCal::Journal*)) );
566  connect( newNote, SIGNAL(sigNameChanged(QString)),
567  SLOT(updateNoteActions()) );
568  connect( newNote, SIGNAL(sigDataChanged(QString)),
569  SLOT(saveNotes(QString)) );
570  connect( newNote, SIGNAL(sigColorChanged()),
571  SLOT(updateNoteActions()) );
572  connect( newNote, SIGNAL(sigFindFinished()),
573  SLOT(slotFindNext()) );
574 
575  // don't call this during startup for each and every loaded note
576  if ( m_alarm ) {
577  updateNoteActions();
578  }
579  m_tray->updateNumberOfNotes(m_notes.count());
580  //TODO
581 #if 0
582  if (m_tray->isVisible()) {
583  // we already booted, so this is a new note
584  // sucks, semantically speaking
585  newNote->slotRename();
586  }
587 #endif
588 }
589 
590 void KNotesApp::killNote( KCal::Journal *journal )
591 {
592  if(m_noteUidModify == journal->uid()) {
593  return;
594  }
595  // this kills the KNote object
596  KNote *note = m_notes.take( journal->uid() );
597  if ( note ) {
598  delete note;
599  updateNoteActions();
600  }
601 }
602 
603 void KNotesApp::acceptConnection()
604 {
605  // Accept the connection and make KNotesNetworkReceiver do the job
606  QTcpSocket *s = m_listener->nextPendingConnection();
607 
608  if ( s ) {
609  KNotesNetworkReceiver *recv = new KNotesNetworkReceiver( s );
610  connect( recv,
611  SIGNAL(sigNoteReceived(QString,QString)),
612  SLOT(newNote(QString,QString)) );
613  }
614 }
615 
616 void KNotesApp::saveNotes( const QString & uid )
617 {
618  m_noteUidModify = uid;
619  saveNotes();
620 }
621 
622 void KNotesApp::saveNotes()
623 {
624  KNotesGlobalConfig::self()->writeConfig();
625  m_manager->save();
626 }
627 
628 void KNotesApp::saveConfigs()
629 {
630  foreach ( KNote *note, m_notes ) {
631  note->saveConfig();
632  }
633 }
634 
635 void KNotesApp::updateNoteActions()
636 {
637  unplugActionList( QLatin1String("notes") );
638  m_noteActions.clear();
639 
640  foreach ( KNote *note, m_notes ) {
641  // what does this actually mean? ~gamaral
642 #ifdef __GNUC__
643 #warning utf8: use QString
644 #endif
645  KAction *action = new KAction( note->name().replace( QLatin1String("&"), QLatin1String("&&") ), this );
646  action->setObjectName( note->noteId() );
647  connect( action, SIGNAL(triggered(bool)), SLOT(slotShowNote()) );
648  KIconEffect effect;
649  QPixmap icon =
650  effect.apply( qApp->windowIcon().pixmap( IconSize( KIconLoader::Small ),
651  IconSize( KIconLoader::Small ) ),
652  KIconEffect::Colorize,
653  1,
654  note->palette().color( note->backgroundRole() ),
655  false );
656 
657  action->setIcon( icon );
658  m_noteActions.append( action );
659  }
660 
661  if ( m_noteActions.isEmpty() ) {
662  actionCollection()->action( QLatin1String("hide_all_notes") )->setEnabled( false );
663  actionCollection()->action( QLatin1String("show_all_notes") )->setEnabled( false );
664  actionCollection()->action( QLatin1String("print_selected_notes") )->setEnabled( false );
665  m_findAction->setEnabled( false );
666  KAction *action = new KAction( i18n( "No Notes" ), this );
667  m_noteActions.append( action );
668  } else {
669  qSort( m_noteActions.begin(), m_noteActions.end(), qActionLessThan );
670  actionCollection()->action( QLatin1String("hide_all_notes") )->setEnabled( true );
671  actionCollection()->action( QLatin1String("show_all_notes") )->setEnabled( true );
672  actionCollection()->action( QLatin1String("print_selected_notes") )->setEnabled( true );
673  m_findAction->setEnabled( true );
674  }
675  plugActionList( QLatin1String("notes"), m_noteActions );
676 }
677 
678 void KNotesApp::updateNetworkListener()
679 {
680  delete m_listener;
681  m_listener=0;
682  delete m_publisher;
683  m_publisher=0;
684 
685  if ( KNotesGlobalConfig::receiveNotes() ) {
686  // create the socket and start listening for connections
687  m_listener=KSocketFactory::listen( QLatin1String("knotes") , QHostAddress::Any,
688  KNotesGlobalConfig::port() );
689  connect( m_listener, SIGNAL(newConnection()),
690  SLOT(acceptConnection()) );
691  m_publisher=new DNSSD::PublicService(KNotesGlobalConfig::senderID(), QLatin1String("_knotes._tcp"), KNotesGlobalConfig::port());
692  m_publisher->publishAsync();
693  }
694 }
695 
696 void KNotesApp::slotPrintSelectedNotes()
697 {
698  QPointer<KNotePrintSelectedNotesDialog> dlg = new KNotePrintSelectedNotesDialog(this);
699  dlg->setNotes(m_notes);
700  if (dlg->exec()) {
701  const QList<KNotePrintObject *> lst = dlg->selectedNotes();
702  if (!lst.isEmpty()) {
703  const QString selectedTheme = dlg->selectedTheme();
704  KNotePrinter printer;
705  printer.printNotes( lst, selectedTheme, dlg->preview() );
706  qDeleteAll(lst);
707  }
708  }
709  delete dlg;
710 }
711 
712 #include "knotesapp.moc"
KNote::slotKill
void slotKill(bool force=false)
Definition: knote.cpp:145
KNotesApp::~KNotesApp
~KNotesApp()
Definition: knotesapp.cpp:204
KNotesApp::showAllNotes
void showAllNotes() const
Definition: knotesapp.cpp:273
KNotesNetworkReceiver
Definition: knotesnetrecv.h:43
KNotesApp::slotNoteKilled
void slotNoteKilled(KCal::Journal *journal)
Definition: knotesapp.cpp:510
KNote::commitData
void commitData()
Definition: knote.cpp:356
KNotesApp::notes
QVariantMap notes() const
Definition: knotesapp.cpp:319
KNote::isModified
bool isModified() const
Definition: knote.cpp:301
KNotePrinter::printNotes
void printNotes(const QList< KNotePrintObject * > lst, const QString &themePath, bool preview)
Definition: knoteprinter.cpp:125
KNotesApp::text
QString text(const QString &id) const
Definition: knotesapp.cpp:340
knotesalarm.h
KNotesApp::slotFindNext
void slotFindNext()
Definition: knotesapp.cpp:437
KNote::changeJournal
void changeJournal(KCal::Journal *)
Definition: knote.cpp:133
QWidget
KNote
Definition: knote.h:50
knotesapp.h
KNote::saveConfig
void saveConfig() const
Definition: knote.cpp:183
KNote::isDesktopAssigned
bool isDesktopAssigned() const
Definition: knote.cpp:259
KNote::slotClose
void slotClose()
Definition: knote.cpp:361
KNotesApp::slotSecondaryActivateRequested
void slotSecondaryActivateRequested(const QPoint &)
Definition: knotesapp.cpp:381
KNotesAlarm
Definition: knotesalarm.h:39
KNotesResourceManager::deleteNote
void deleteNote(KCal::Journal *journal)
Definition: resourcemanager.cpp:114
knoteconfigdialog.h
KNotesApp::hideNote
void hideNote(const QString &id) const
Definition: knotesapp.cpp:293
KNotesApp::newNote
QString newNote(const QString &name=QString(), const QString &text=QString())
Definition: knotesapp.cpp:237
KNotesApp::hideAllNotes
void hideAllNotes() const
Definition: knotesapp.cpp:266
KNotesApp::setText
void setText(const QString &id, const QString &newText)
Definition: knotesapp.cpp:360
KNotesApp::slotQuit
void slotQuit()
Definition: knotesapp.cpp:518
knote.h
KNotesLegacy::cleanUp
static void cleanUp()
Definition: knoteslegacy.cpp:48
knoteprintobject.h
KNotesApp::slotShowNote
void slotShowNote()
Definition: knotesapp.cpp:386
KNote::slotRename
void slotRename()
Definition: knote.cpp:308
knoteskeydialog.h
KNotesApp::newNoteFromClipboard
QString newNoteFromClipboard(const QString &name=QString())
Definition: knotesapp.cpp:260
KNotesApp::killNote
void killNote(const QString &id)
Definition: knotesapp.cpp:314
knoteprinter.h
knoteprintselectednotesdialog.h
KNote::text
QString text() const
Definition: knote.cpp:212
KNote::name
QString name() const
Definition: knote.cpp:207
KNotesResourceManager::save
void save()
Definition: resourcemanager.cpp:80
KNotesLegacy::convert
static bool convert(KCal::CalendarLocal *calendar)
Definition: knoteslegacy.cpp:67
knotesnetrecv.h
KNotesApp::slotActivateRequested
void slotActivateRequested(bool, const QPoint &pos)
Definition: knotesapp.cpp:372
KNotesApp::slotConfigureAccels
void slotConfigureAccels()
Definition: knotesapp.cpp:464
KNotesApp::showNote
void showNote(const QString &id) const
Definition: knotesapp.cpp:283
resourcemanager.h
KNote::saveData
void saveData(bool update=true)
Definition: knote.cpp:170
KNotesApp::name
QString name(const QString &id) const
Definition: knotesapp.cpp:330
KNotesApp::setName
void setName(const QString &id, const QString &newName)
Definition: knotesapp.cpp:350
KNote::find
void find(KFind *kfind)
Definition: knote.cpp:247
KNote::noteId
QString noteId() const
Definition: knote.cpp:202
KNotesApp::commitData
bool commitData(QSessionManager &)
Definition: knotesapp.cpp:226
KNotesResourceManager
Definition: resourcemanager.h:49
KNotesTray
Definition: knotestray.h:23
KNotePrinter
Definition: knoteprinter.h:33
KNote::setName
void setName(const QString &name)
Definition: knote.cpp:222
KNotesResourceManager::addNewNote
bool addNewNote(KCal::Journal *journal)
Definition: resourcemanager.cpp:91
KNotesApp::slotWalkThroughNotes
void slotWalkThroughNotes()
Definition: knotesapp.cpp:392
knotestray.h
knoteslegacy.h
KNotesApp::slotPreferences
void slotPreferences()
Definition: knotesapp.cpp:451
KNotesApp::slotOpenFindDialog
void slotOpenFindDialog()
Definition: knotesapp.cpp:409
KNote::toDesktop
void toDesktop(int desktop)
Definition: knote.cpp:902
qActionLessThan
static bool qActionLessThan(const QAction *a1, const QAction *a2)
Definition: knotesapp.cpp:66
KNotesApp::KNotesApp
KNotesApp()
Definition: knotesapp.cpp:72
KNotesTray::updateNumberOfNotes
void updateNumberOfNotes(int value)
Definition: knotestray.cpp:43
KNote::setText
void setText(const QString &text)
Definition: knote.cpp:240
KNotePrintSelectedNotesDialog
Definition: knoteprintselectednotesdialog.h:29
KNotesKeyDialog
Definition: knoteskeydialog.h:24
KNotesResourceManager::load
void load()
Definition: resourcemanager.cpp:54
KNoteConfigDialog
Definition: knoteconfigdialog.h:30
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

knotes

Skip menu "knotes"
  • Main Page
  • Namespace List
  • Namespace Members
  • 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

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