示例#1
0
void KDatePickerPopup::buildMenu()
{
  if ( isVisible() ) {
    return;
  }
  clear();

  if ( mItems & DatePicker ) {
    addAction( new KDatePickerAction( mDatePicker, this ) );

    if ( ( mItems & NoDate ) || ( mItems & Words ) ) {
      addSeparator();
    }
  }

  if ( mItems & Words ) {
    addAction( i18nc( "@option today", "&Today" ), this, SLOT( slotToday() ) );
    addAction( i18nc( "@option tomorrow", "To&morrow" ), this, SLOT( slotTomorrow() ) );
    addAction( i18nc( "@option next week", "Next &Week" ), this, SLOT( slotNextWeek() ) );
    addAction( i18nc( "@option next month", "Next M&onth" ), this, SLOT( slotNextMonth() ) );

    if ( mItems & NoDate ) {
      addSeparator();
    }
  }

  if ( mItems & NoDate ) {
    addAction( i18nc( "@option do not specify a date", "No Date" ), this, SLOT( slotNoDate() ) );
  }
}
示例#2
0
void KDatePickerPopup::buildMenu()
{
  if ( isVisible() ) return;
  clear();

  if ( mItems & DatePicker ) {
    insertItem( mDatePicker );

    if ( ( mItems & NoDate ) || ( mItems & Words ) )
      insertSeparator();
  }

  if ( mItems & Words ) {
    insertItem( i18n("&Today"), this, SLOT( slotToday() ) );
    insertItem( i18n("To&morrow"), this, SLOT( slotTomorrow() ) );
    insertItem( i18n("&Friday"), this, SLOT( slotFriday() ) );
    insertItem( i18n("&Sunday"), this, SLOT( slotSunday() ) );
    insertItem( i18n("Next &Week"), this, SLOT( slotNextWeek() ) );
    insertItem( i18n("Next M&onth"), this, SLOT( slotNextMonth() ) );

    if ( mItems & NoDate )
      insertSeparator();
  }

  if ( mItems & NoDate )
    insertItem( i18n("No Date"), this, SLOT( slotNoDate() ) );
}