KOEventPopupMenu::KOEventPopupMenu()
  : mCopyToCalendarMenu( 0 ), mMoveToCalendarMenu( 0 )
{
  mCalendar = 0;
  mCurrentIncidence = 0;
  mCurrentDate = QDate();
  mHasAdditionalItems = false;

  addAction( KOGlobals::self()->smallIcon( "document-preview" ), i18n( "&Show" ),
             this, SLOT( popupShow() ) );
  mEditOnlyItems.append(
    addAction( KOGlobals::self()->smallIcon( "document-edit" ), i18n( "&Edit..." ),
               this, SLOT( popupEdit() ) ) );
#ifndef KORG_NOPRINTER
  mEditOnlyItems.append( addSeparator() );
  addAction( KOGlobals::self()->smallIcon( "document-print" ), i18n( "&Print..." ),
             this, SLOT( print() ) );
  QAction *preview = addAction( KOGlobals::self()->smallIcon( "document-print-preview" ), i18n( "Print Previe&w..." ),
             this, SLOT( printPreview() ) );
  preview->setEnabled( !KMimeTypeTrader::self()->query("application/pdf", "KParts/ReadOnlyPart").isEmpty() );

#endif
  //------------------------------------------------------------------------
  mEditOnlyItems.append( addSeparator() );
  mEditOnlyItems.append( addAction( KOGlobals::self()->smallIcon( "edit-cut" ),
                                    i18nc( "cut this event", "C&ut" ),
                                    this, SLOT(popupCut()) ) );
  mEditOnlyItems.append( addAction( KOGlobals::self()->smallIcon( "edit-copy" ),
                                    i18nc( "copy this event", "&Copy" ),
                                    this, SLOT(popupCopy()) ) );
  // paste is always possible
  mEditOnlyItems.append( addAction( KOGlobals::self()->smallIcon( "edit-paste" ),
                                    i18n( "&Paste" ),
                                    this, SLOT(popupPaste()) ) );
  mEditOnlyItems.append( addAction( KOGlobals::self()->smallIcon( "edit-delete" ),
                                    i18nc( "delete this incidence", "&Delete" ),
                                    this, SLOT(popupDelete()) ) );
  //------------------------------------------------------------------------
  mEditOnlyItems.append( addSeparator() );
  mTodoOnlyItems.append( addAction( KOGlobals::self()->smallIcon( "task-complete" ),
                                    i18n( "Togg&le To-do Completed" ),
                                    this, SLOT(toggleTodoCompleted()) ) );
  mToggleReminder = addAction( QIcon( KOGlobals::self()->smallIcon( "appointment-reminder" ) ),
                                    i18n( "&Toggle Reminder" ), this, SLOT(toggleAlarm()));
  mEditOnlyItems.append( mToggleReminder );
  //------------------------------------------------------------------------
  mRecurrenceItems.append( addSeparator() );
  mDissociateOccurrences = addAction( i18n( "&Dissociate From Recurrence..." ),
                                      this, SLOT(dissociateOccurrences()) );
  mRecurrenceItems.append( mDissociateOccurrences );

  addSeparator();
  addAction( KOGlobals::self()->smallIcon( "mail-forward" ),
             i18n( "Send as iCalendar..." ),
             this, SLOT(forward()) );
}
Exemplo n.º 2
0
KOEventPopupMenu::KOEventPopupMenu()
{
    mCurrentIncidence = 0;
    mCurrentDate = QDate();
    mHasAdditionalItems = false;

    insertItem(i18n("&Show"), this, SLOT(popupShow()));
    mEditOnlyItems.append(
        insertItem(i18n("&Edit..."), this, SLOT(popupEdit())));
#ifndef KORG_NOPRINTER
    insertItem(KOGlobals::self()->smallIcon("printer1"), i18n("&Print..."),
               this, SLOT(print()));
#endif
    //------------------------------------------------------------------------
    mEditOnlyItems.append(insertSeparator());
    mEditOnlyItems.append(
        insertItem(KOGlobals::self()->smallIcon("editcut"), i18n("&Cut"),
                   this, SLOT(popupCut())));
    mEditOnlyItems.append(
        insertItem(KOGlobals::self()->smallIcon("editcopy"), i18n("&Copy"),
                   this, SLOT(popupCopy())));
    // paste is always possible
    insertItem(KOGlobals::self()->smallIcon("editpaste"), i18n("&Paste"),
               this, SLOT(popupPaste()));
    mEditOnlyItems.append(
        insertItem(KOGlobals::self()->smallIcon("editdelete"), i18n("&Delete"),
                   this, SLOT(popupDelete())));
    //------------------------------------------------------------------------
    mEditOnlyItems.append(insertSeparator());
    mEditOnlyItems.append(
        insertItem(KOGlobals::self()->smallIcon("bell"), i18n("&Toggle Reminder"),
                   this, SLOT(popupAlarm())));
    //------------------------------------------------------------------------
    mRecurrenceItems.append(insertSeparator());
    mRecurrenceItems.append(
        insertItem(i18n("&Dissociate This Occurrence"),
                   this, SLOT(dissociateOccurrence())));
    mRecurrenceItems.append(
        insertItem(i18n("&Dissociate Future Occurrences"),
                   this, SLOT(dissociateFutureOccurrence())));

    insertSeparator();
    insertItem(KOGlobals::self()->smallIcon("mail_forward"), i18n("Send as iCalendar..."),
               this, SLOT(forward()));
}