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()) );
}
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()));
}
Exemple #3
0
AColorDialog::AColorDialog (QColor defColor, QWidget *parent, const char *name, QPixmap* icon) :
Q3HBox( parent, name )
{
    myId = static_id;
    static_id++;

    setMargin(0);
    setSpacing(0);

    // defaults
    lastActivatedItem = -1;
    noColorFlag    = false;
    currentColor = defColor;
    myInterfaceObj = NULL;

    // create std color array
    int i;
    for (i=0;i<NUM_STD_COLORS;i++)
    {
        stdColorItems[i] = new ColorMenuItem(this, stdColors[i]);
        Q_ASSERT(stdColorItems[i]!=NULL);
    }

    // create the buttom for color apply
    Q3VBox* vbox = new Q3VBox(this,"color_v_box");
    Q_ASSERT(vbox!=NULL);
    vbox->setMargin(0);
    vbox->setSpacing(0);
    vbox->setMaximumWidth(20);
    vbox->setMaximumHeight(28);
    bt_app = new AToolButton(vbox);
    Q_ASSERT(bt_app!=NULL);
    bt_app->setAutoRaise(true);

    if (icon!=NULL)
    {
        bt_app->setPixmap(*icon);
    }
    acr = new AColorRect(vbox,currentColor);Q_ASSERT(acr!=NULL);
    connect( bt_app, SIGNAL( clicked() ), this, SLOT( colorApply() ) );

    // create the buttom for menu popup
    downIcon = QPixmap( pdown );
    bt_pop = new AToolButton(this);Q_ASSERT(bt_pop!=NULL);
    bt_pop->setMaximumWidth (16);
    bt_pop->setPixmap(downIcon);
    bt_pop->setAutoRaise(true);
    connect(bt_pop,SIGNAL( pressed() ), this, SLOT( popupShow() ) );

    // and the popup menu
    pop = new Q3PopupMenu(parent,"qt_color_menu");Q_ASSERT(pop!=NULL);
    connect(pop,SIGNAL(activated(int)),this, SLOT( popMenuActivated(int) ) );

    // now put in all the "standard" colors
    noColorId = pop->insertItem("No color");

    for (i=0;i<NUM_STD_COLORS;i++)
    {
        pop->addAction((QAction*)stdColorItems[i]);
        pop->connect(stdColorItems[i], SIGNAL(triggered), this, SLOT(stdColorActivated()));
    }

    moreColorsId = pop->insertItem("More colors...");
}