コード例 #1
0
EqualizerPresetManager::EqualizerPresetManager( QWidget *parent )
        : KDialog( parent )
{
    setCaption( i18n("Presets") );
    setModal( true );
    setButtons( Ok | Cancel | Default );
    setDefaultButton( Ok );
    showButtonSeparator( true );

    QWidget *mainWidget = new QWidget( this );
    setMainWidget( mainWidget );
    QHBoxLayout *mainLayout = new QHBoxLayout( mainWidget, 0, spacingHint() );

    m_presetsView = new K3ListView( mainWidget );
    m_presetsView->setObjectName( "presetListView" );
    m_presetsView->addColumn( i18n( "Presets" ) );
    m_presetsView->setFullWidth( true );
    connect(m_presetsView, SIGNAL( selectionChanged() ), SLOT( updateButtonState() ));
    connect(m_presetsView, SIGNAL( doubleClicked ( Q3ListViewItem*, const QPoint&, int ) ), SLOT( slotRename() ));
    mainLayout->addWidget( m_presetsView );

    QVBoxLayout* buttonsLayout = new QVBoxLayout( mainLayout );

    m_renameBtn = new QPushButton( i18n("&Rename"), mainWidget, "renameBtn" );
    m_deleteBtn = new QPushButton( i18n("&Delete"), mainWidget, "deleteBtn" );

    buttonsLayout->addWidget( m_renameBtn );
    buttonsLayout->addWidget( m_deleteBtn );

    connect(m_renameBtn, SIGNAL( clicked() ), SLOT( slotRename() ));
    connect(m_deleteBtn, SIGNAL( clicked() ), SLOT( slotDelete() ));
    connect(this, SIGNAL( defaultClicked() ), SLOT( slotDefault() ));

    QSpacerItem* spacer = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding );
    buttonsLayout->addItem( spacer );

    updateButtonState();

    resize( QSize(300, 250).expandedTo(minimumSizeHint()) );
}
コード例 #2
0
KEdFind::KEdFind( QWidget *parent, const char *name, bool modal )
  :KDialogBase( parent, name, modal, i18n("Find"),
		modal ? User1|Cancel : User1|Close, User1, false, KGuiItem( i18n("&Find"), "find") )
{
  setWFlags( WType_TopLevel );

  QWidget *page = new QWidget( this );
  setMainWidget(page);
  QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );

  d = new KEdFindPrivate( page );

  QString text = i18n("Find:");
  QLabel *label = new QLabel( text, page , "find" );
  topLayout->addWidget( label );

  d->combo->setMinimumWidth(fontMetrics().maxWidth()*20);
  d->combo->setFocus();

  connect(d->combo, SIGNAL(textChanged ( const QString & )),
          this,SLOT(textSearchChanged ( const QString & )));

  topLayout->addWidget(d->combo);

  group = new QVButtonGroup( i18n("Options"), page );
  topLayout->addWidget( group );

  QHBox* row1 = new QHBox( group );

  text = i18n("Case &sensitive");
  sensitive = new QCheckBox( text, row1, "case");
  text = i18n("Find &backwards");
  direction = new QCheckBox( text, row1, "direction" );


  enableButton( KDialogBase::User1, !d->combo->currentText().isEmpty() );

  if ( !modal )
    connect( this, SIGNAL( closeClicked() ), this, SLOT( slotCancel() ) );
}
コード例 #3
0
ファイル: kasaboutdlg.cpp プロジェクト: Fat-Zer/tdebase
void KasAboutDialog::addDemoBar()
{
   TQHBox *box = new TQHBox( this );

   box->setLineWidth(2);
   box->setFrameStyle( TQFrame::Panel | TQFrame::Sunken );

   box->setSpacing( spacingHint() );
   box->setMargin( marginHint() );

   KasBar *bar = new KasBar( Qt::Horizontal, box );
   bar->setItemSize( KasBar::Large );
   bar->setMasked( false );

   KasItem *ci = new KasItem( bar );
   ci->setIcon( LargeIcon( "icons" ) );
   bar->append( ci );

   KasPopup *pop = new KasPopup( ci );
   ci->setPopup( pop );
   ci->setCustomPopup( true );
   connect( ci, TQT_SIGNAL(leftButtonClicked(TQMouseEvent *)), ci, TQT_SLOT(togglePopup()) );

   KasBar *groupbar = bar->createChildBar( ( bar->orientation() == Qt::Horizontal ) ? Qt::Vertical : Qt::Horizontal, pop );
   KasItem *i = 0;

   KasClockItem *clk = new KasClockItem( groupbar );
   groupbar->append( clk );

   i = new KasLoadItem( groupbar );
   groupbar->append( i );

   groupbar->addTestItems();

   pop->resize( groupbar->size() );

   bar->setFixedSize( bar->itemExtent(), bar->itemExtent() );
   addWidgetBelowList( box );
}
コード例 #4
0
MultilineEdit::MultilineEdit(QWidget* parent, const QString& text) :
KDialogBase(parent,"multiline_edit_dialog",true,i18n("Edit Multiline Paste"),
KDialogBase::User1 | KDialogBase::Ok | KDialogBase::Cancel,KDialogBase::Ok,true,
KGuiItem(i18n("Add &Quotation Indicators")))
{
    // Create the top level widget
    QWidget* page=new QWidget(this);
    setMainWidget(page);
    // Add the layout to the widget
    QVBoxLayout* dialogLayout=new QVBoxLayout(page);
    dialogLayout->setSpacing(spacingHint());
    // add the text editor
    textEditor=new MultilineTextEdit(page,"multiline_text_editor");
    textEditor->setTextFormat(PlainText);
    textEditor->setText(text);
    returnText=text;

    dialogLayout->addWidget(textEditor);

    setInitialSize(Preferences::multilineEditSize());
    show();
}
コード例 #5
0
CPrintDialog::CPrintDialog(QWidget *parent)
            : KDialogBase(Plain, i18n("Print Font Samples"), Ok|Cancel, Ok, parent, NULL, true, false)
{
    QFrame      *page=plainPage();
    QGridLayout *layout=new QGridLayout(page, 1, 1, 0, spacingHint());

    layout->addWidget(new QLabel(i18n("Output:"), page), 0, 0);
    itsOutput=new QComboBox(page);
    itsOutput->insertItem(i18n("All Fonts"), 0);
    itsOutput->insertItem(i18n("Selected Fonts"), 1);
    layout->addWidget(itsOutput, 0, 1);
    layout->addWidget(new QLabel(i18n("Font size:"), page), 1, 0);
    itsSize=new QComboBox(page);
    itsSize->insertItem(i18n("Waterfall"), 0);
    itsSize->insertItem(i18n("12pt"), 1);
    itsSize->insertItem(i18n("18pt"), 2);
    itsSize->insertItem(i18n("24pt"), 3);
    itsSize->insertItem(i18n("36pt"), 4);
    itsSize->insertItem(i18n("48pt"), 5);
    layout->addWidget(itsSize, 1, 1);
    layout->addItem(new QSpacerItem(2, 2), 2, 1);
}
コード例 #6
0
void KandyPrefsDialog::setupSerialTab()
{
  QFrame *topFrame = addPage(i18n("Serial Interface"),0,
      DesktopIcon("connect_no",KIcon::SizeMedium));

  QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
  topLayout->setSpacing(spacingHint());
  topLayout->setMargin(marginHint());
  
  // Define serial device
  serialDevice = addWidString( KandyPrefs::self()->serialDeviceItem(),
                               topFrame );
  topLayout->addWidget(serialDevice->label(),0,0);
  topLayout->addWidget(serialDevice->lineEdit(),0,1);
  
  // Define baud rate
  baudRate = addWidString( KandyPrefs::self()->baudRateItem(), topFrame );
  topLayout->addWidget( baudRate->label(), 1, 0 );
  topLayout->addWidget( baudRate->lineEdit(), 1, 1 );
  
  // Define location of LOCK file
  lockDir = addWidString( KandyPrefs::self()->lockDirectoryItem(),
                               topFrame );
  topLayout->addWidget(lockDir->label(),2,0);
  topLayout->addWidget(lockDir->lineEdit(),2,1);

  // Define startup modem behavior
  openOnStartup = addWidBool( KandyPrefs::self()->startupModemItem(),
                              topFrame );
  topLayout->addWidget(openOnStartup->checkBox(),3,0);

  // Define clock setting hevahior
  autoSetClock = addWidBool( KandyPrefs::self()->autoSetClockItem(),
                             topFrame );
  topLayout->addWidget(autoSetClock->checkBox(),4,0);
  
  topLayout->setRowStretch(5,1);
}
コード例 #7
0
KListBoxDialog::KListBoxDialog( QString& _selectedString,
                                const QString& caption,
                                const QString& labelText,
                                QWidget* parent,
                                const char* name,
                                bool modal )
    : KDialogBase( parent, name, modal, caption, Ok|Cancel, Ok, true ),
      selectedString( _selectedString )

{
    if ( !name )
      setName( "KListBoxDialog" );
    resize( 400, 180 );

    QFrame *page = makeMainWidget();
    QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );
    labelAboveLA = new QLabel( page, "labelAboveLA" );
    labelAboveLA->setText( labelText );

    topLayout->addWidget( labelAboveLA );

    entriesLB = new QListBox( page, "entriesLB" );

    topLayout->addWidget( entriesLB );

    commentBelowLA = new QLabel( page, "commentBelowLA" );
    commentBelowLA->setText( "" );
    topLayout->addWidget( commentBelowLA );
    commentBelowLA->hide();

    // signals and slots connections
    connect( entriesLB, SIGNAL( highlighted( const QString& ) ),
             this,      SLOT(   highlighted( const QString& ) ) );
    connect( entriesLB, SIGNAL( selected(int) ),
                        SLOT(   slotOk() ) );
    // buddies
    labelAboveLA->setBuddy( entriesLB );
}
コード例 #8
0
SendSMSDialog::SendSMSDialog( const QString &recipientName, QWidget *parent )
  : KDialog( parent )
{
  setCaption( i18n( "Send SMS" ) );
  setButtons( Ok|Cancel );
  setDefaultButton( Ok );
  setModal( true );
  showButtonSeparator( true );
  QWidget *page = new QWidget( this );
  setMainWidget( page );

  QGridLayout *layout = new QGridLayout( page );
  layout->setMargin( marginHint() );
  layout->setSpacing( spacingHint() );

  layout->addWidget( new QLabel( i18n( "Message" ), page ), 0, 0 );

  mMessageLength = new QLabel( "0/160", page );
  mMessageLength->setAlignment( Qt::AlignRight );
  layout->addWidget( mMessageLength, 0, 2 );

  mText = new QTextEdit( page );
  layout->addWidget( mText, 1, 0, 1, 3 );

  layout->addWidget( new QLabel( i18n( "Recipient:" ), page ), 2, 0 );
  layout->addWidget( new QLabel( recipientName, page ), 2, 2 );

  setButtonText( Ok, i18n( "Send" ) );

  connect( mText, SIGNAL(textChanged()),
           this, SLOT(updateMessageLength()) );
  connect( mText, SIGNAL(textChanged()),
           this, SLOT(updateButtons()) );

  updateButtons();

  mText->setFocus();
}
コード例 #9
0
KEuphoriaSetup::KEuphoriaSetup( QWidget* parent, const char* name )
        : KDialogBase( parent, name, true, i18n("Setup Euphoria Screen Saver"),
          Ok|Cancel|Help, Ok, true )
{
    setButtonText( Help, i18n( "A&bout" ) );

    QWidget *main = makeMainWidget();

    QHBoxLayout* top    = new QHBoxLayout(main, 0, spacingHint());
    QVBoxLayout* leftCol = new QVBoxLayout;
    top->addLayout( leftCol );

    QLabel* label = new QLabel( i18n("Mode:"), main );
    leftCol->addWidget( label );

    modeW = new QComboBox( main );
    int i = 0;
    while (defaultText[i])
        modeW->insertItem( i18n(defaultText[i++]) );
    leftCol->addWidget( modeW );

    leftCol->addStretch();

    // Preview
    QWidget* preview;
    preview = new QWidget( main );
    preview->setFixedSize( 220, 170 );
    preview->setBackgroundColor( black );
    preview->show();    // otherwise saver does not get correct size
    _saver = new KEuphoriaScreenSaver( preview->winId() );
    top->addWidget(preview);

    // Now that we have _saver...
    modeW->setCurrentItem( _saver->mode() );    // set before we connect
    connect( modeW, SIGNAL(activated(int)), _saver, SLOT(setMode(int)) );

    setMinimumSize( sizeHint() );
}
コード例 #10
0
    ChannelDialog::ChannelDialog(const QString& title, QWidget *parent, const char *name)
        : KDialogBase(Plain, title, Ok|Cancel, Ok, parent, name)
    {
        QFrame* mainWidget = plainPage();
        QGridLayout* mainLayout = new QGridLayout(mainWidget, 1, 2, 0, spacingHint());

        QLabel* channelLbl = new QLabel(i18n("C&hannel:"), mainWidget);
        m_channelEdit = new QLineEdit(mainWidget);
        m_channelEdit->setMaxLength(50);
        channelLbl->setBuddy(m_channelEdit);

        QLabel* passwordLbl = new QLabel(i18n("Pass&word:"), mainWidget);
        m_passwordEdit = new QLineEdit(mainWidget);
        m_passwordEdit->setEchoMode(QLineEdit::Password);
        passwordLbl->setBuddy(m_passwordEdit);

        mainLayout->addWidget(channelLbl, 0, 0);
        mainLayout->addWidget(m_channelEdit, 0, 1);
        mainLayout->addWidget(passwordLbl, 1, 0);
        mainLayout->addWidget(m_passwordEdit, 1, 1);

        m_channelEdit->setFocus();
    }
コード例 #11
0
TimerSettings::TimerSettings( QWidget *parent, const char *name )
  : KDialog( parent )
{
  setObjectName( name );
  setModal( true );
  setCaption( i18n( "Timer Settings" ) );
  setButtons( Ok | Cancel );

  QFrame *page = new QFrame( this );
  setMainWidget( page );

  QGridLayout *layout = new QGridLayout( page );
  layout->setSpacing( spacingHint() );
  layout->setMargin( 0 );

  mUseGlobalUpdate = new QCheckBox( i18n( "Use update interval of worksheet" ), page );
  layout->addWidget( mUseGlobalUpdate, 0, 0, 1, 2 );

  mLabel = new QLabel( i18n( "Update interval:" ), page );
  layout->addWidget( mLabel, 1, 0 );

  mInterval = new QDoubleSpinBox( page );
  mInterval->setRange( 0.1, 10000 );
  mInterval->setSingleStep( 1 );
  mInterval->setValue( 2 );
  mInterval->setSuffix( i18n( " sec" ) );
  layout->addWidget( mInterval, 1, 1 );
  mLabel->setBuddy( mInterval );
  mInterval->setWhatsThis( i18n( "All displays of the sheet are updated at the rate specified here." ) );

  connect( mUseGlobalUpdate, SIGNAL(toggled(bool)),
           SLOT(globalUpdateChanged(bool)) );

  mUseGlobalUpdate->setChecked( true );

  KAcceleratorManager::manage( this );
}
コード例 #12
0
KWMailMergeChoosePluginDialog::KWMailMergeChoosePluginDialog( KTrader::OfferList offers )
    : KDialogBase( Plain, i18n( "Mail Merge Setup" ), Ok | Cancel, Ok,
      /*parent*/ 0, "", true ), pluginOffers( offers )
{
  QWidget *back = plainPage();
  QVBoxLayout *layout = new QVBoxLayout( back, 0, spacingHint() );

  QLabel *label = new QLabel( i18n( "&Available sources:" ), back );
  chooser = new QComboBox( false, back );
  label->setBuddy( chooser );
  descriptionLabel = new QLabel( back );
  descriptionLabel->hide();
  descriptionLabel->setAlignment( WordBreak );
  descriptionLabel->setFrameShape( QFrame::Box );
  descriptionLabel->setFrameShadow( QFrame::Sunken );

  QSize old_sizeHint;
  for ( KTrader::OfferList::Iterator it = pluginOffers.begin(); *it; ++it )
  {
    chooser->insertItem( (*it)->name() );
    old_sizeHint = descriptionLabel->sizeHint();
    descriptionLabel->setText( (*it)->comment() );
    if (descriptionLabel->sizeHint().width()*descriptionLabel->sizeHint().height() > old_sizeHint.width()*old_sizeHint.height())
        descriptionLabel->setMinimumSize(descriptionLabel->sizeHint() );
  }
  descriptionLabel->show();

  connect( chooser, SIGNAL( activated( int ) ),
           this, SLOT( pluginChanged( int ) ) );

  layout->addWidget( label );
  layout->addWidget( chooser );
  layout->addWidget( descriptionLabel );
  layout->addStretch( 1 );

  pluginChanged( 0 );
}
コード例 #13
0
ProgressConfigDialog::ProgressConfigDialog(QWidget *parent)
    : KDialogBase(KDialogBase::Plain, i18n("Configure Network Operation Window"), KDialogBase::Ok | KDialogBase::Apply | KDialogBase::Cancel,
                  KDialogBase::Ok, parent, "configprog", false)
{
    QVBoxLayout *layout = new QVBoxLayout(plainPage(), spacingHint());
    m_showSystemTrayCb = new QCheckBox(i18n("Show system tray icon"), plainPage());
    m_keepOpenCb = new QCheckBox(i18n("Keep network operation window always open"), plainPage());
    m_headerCb = new QCheckBox(i18n("Show column headers"), plainPage());
    m_toolBarCb = new QCheckBox(i18n("Show toolbar"), plainPage());
    m_statusBarCb = new QCheckBox(i18n("Show statusbar"), plainPage());
    m_fixedWidthCb = new QCheckBox(i18n("Column widths are user adjustable"), plainPage());
    QLabel *label = new QLabel(i18n("Show information:"), plainPage());
    m_columns = new KListView(plainPage());

    m_columns->addColumn("info");
    m_columns->setSorting(-1);
    m_columns->header()->hide();

    m_items[ListProgress::TB_ADDRESS] = new QCheckListItem(m_columns, i18n("URL"), QCheckListItem::CheckBox);
    m_items[ListProgress::TB_REMAINING_TIME] = new QCheckListItem(m_columns, i18n("Remaining Time", "Rem. Time"), QCheckListItem::CheckBox);
    m_items[ListProgress::TB_SPEED] = new QCheckListItem(m_columns, i18n("Speed"), QCheckListItem::CheckBox);
    m_items[ListProgress::TB_TOTAL] = new QCheckListItem(m_columns, i18n("Size"), QCheckListItem::CheckBox);
    m_items[ListProgress::TB_PROGRESS] = new QCheckListItem(m_columns, i18n("%"), QCheckListItem::CheckBox);
    m_items[ListProgress::TB_COUNT] = new QCheckListItem(m_columns, i18n("Count"), QCheckListItem::CheckBox);
    m_items[ListProgress::TB_RESUME] = new QCheckListItem(m_columns, i18n("Resume", "Res."), QCheckListItem::CheckBox);
    m_items[ListProgress::TB_LOCAL_FILENAME] = new QCheckListItem(m_columns, i18n("Local Filename"), QCheckListItem::CheckBox);
    m_items[ListProgress::TB_OPERATION] = new QCheckListItem(m_columns, i18n("Operation"), QCheckListItem::CheckBox);

    layout->addWidget(m_showSystemTrayCb);
    layout->addWidget(m_keepOpenCb);
    layout->addWidget(m_headerCb);
    layout->addWidget(m_toolBarCb);
    layout->addWidget(m_statusBarCb);
    layout->addWidget(m_fixedWidthCb);
    layout->addWidget(label);
    layout->addWidget(m_columns);
}
コード例 #14
0
ファイル: info.cpp プロジェクト: forthyen/SDesk
KInfoWindow::KInfoWindow( intf_thread_t * p_intf,  input_thread_t *p_input ) :
    KDialogBase( Tabbed, _( "Messages" ), Ok, Ok, 0, 0, false)
{
//    clearWFlags(~0);
//    setWFlags(WType_TopLevel);
    setSizeGripEnabled(true);

    int i, j;

    vlc_mutex_lock( &p_input->p_item->lock );
    for ( i = 0; i < p_input->p_item->i_categories; i++ )
    {
        info_category_t *p_category =
           p_input->p_item->pp_categories[i];

        QFrame *page = addPage( QString(p_category->psz_name) );
        QVBoxLayout *toplayout = new QVBoxLayout( page);
        QVBox *category_table = new QVBox(page);
        toplayout->addWidget(category_table);
        toplayout->setResizeMode(QLayout::FreeResize);
        toplayout->addStretch(10);
        category_table->setSpacing(spacingHint());

        for ( j = 0; j < p_category->i_infos; j++ )
        {
            info_t *p_info = p_category->pp_infos[j];

            QHBox *hb = new QHBox( category_table );
            new QLabel( QString(p_info->psz_name) + ":", hb );
            new QLabel( p_info->psz_value, hb );
        }
    }
    vlc_mutex_unlock( &p_input->p_item->lock );
    resize(300,400);
    show();
}
コード例 #15
0
ファイル: kurlrequesterdlg.cpp プロジェクト: Fat-Zer/tdelibs
void KURLRequesterDlg::initDialog(const TQString &text,const TQString &urlName)
{
   TQVBoxLayout * topLayout = new TQVBoxLayout( plainPage(), 0,
            spacingHint() );

    TQLabel * label = new TQLabel( text , plainPage() );
    topLayout->addWidget( label );

    urlRequester_ = new KURLRequester( urlName, plainPage(), "urlRequester" );
    urlRequester_->setMinimumWidth( urlRequester_->sizeHint().width() * 3 );
    topLayout->addWidget( urlRequester_ );
    urlRequester_->setFocus();
    connect( urlRequester_->lineEdit(), TQT_SIGNAL(textChanged(const TQString&)),
             TQT_SLOT(slotTextChanged(const TQString&)) );
    bool state = !urlName.isEmpty();
    enableButtonOK( state );
    enableButton( KDialogBase::User1, state );
    /*
    KFile::Mode mode = static_cast<KFile::Mode>( KFile::File |
            KFile::ExistingOnly );
	urlRequester_->setMode( mode );
    */
    connect( this, TQT_SIGNAL( user1Clicked() ), TQT_SLOT( slotClear() ) );
}
コード例 #16
0
KeyGenerator::KeyGenerator( QWidget * parent )
  : KDialog( parent )
{
  setModal( true );
  setCaption( "KeyGenerationJob test" );
  setButtons( Close|User1 );
  setDefaultButton( User1 );
  showButtonSeparator( true );
  setButtonGuiItem( User1, KGuiItem( "Create" ) );

  QWidget * w = new QWidget( this );
  setMainWidget( w );

  QGridLayout *glay = new QGridLayout( w );
  glay->setMargin( marginHint() );
  glay->setSpacing( spacingHint() );

  int row = -1;

  ++row;
  glay->addWidget( new QLabel( "<GnupgKeyParms format=\"internal\">", w ),
			    row, 0, 1, 2 );
  for ( int i = 0 ; i < numKeyParams ; ++i ) {
    ++row;
    glay->addWidget( new QLabel( keyParams[i], w ), row, 0 );
    glay->addWidget( mLineEdits[i] = new QLineEdit( w ), row, 1 );
  }

  ++row;
  glay->addWidget( new QLabel( "</GnupgKeyParms>", w ), row, 0, 1, 2 );
  ++row;
  glay->setRowStretch( row, 1 );
  glay->setColumnStretch( 1, 1 );

  connect( this, SIGNAL(user1Clicked()), SLOT(slotStartKeyGeneration()) );
}
コード例 #17
0
DistributionListDialog::DistributionListDialog( QWidget *parent )
  : KDialogBase( Plain, i18n("Save Distribution List"), User1 | Cancel,
                 User1, parent, 0, false, false, i18n("Save List") )
{
  QFrame *topFrame = plainPage();
  
  QBoxLayout *topLayout = new QVBoxLayout( topFrame );
  topLayout->setSpacing( spacingHint() );
  
  QBoxLayout *titleLayout = new QHBoxLayout( topLayout );
  
  QLabel *label = new QLabel( i18n("Name:"), topFrame );
  titleLayout->addWidget( label );
  
  mTitleEdit = new QLineEdit( topFrame );
  titleLayout->addWidget( mTitleEdit );
  mTitleEdit->setFocus();
  
  mRecipientsList = new KListView( topFrame );
  mRecipientsList->addColumn( QString::null );
  mRecipientsList->addColumn( i18n("Name") );
  mRecipientsList->addColumn( i18n("Email") );
  topLayout->addWidget( mRecipientsList );
}
コード例 #18
0
ファイル: exportthemedialog.cpp プロジェクト: KDE/qtcurve
CExportThemeDialog::CExportThemeDialog(QWidget *parent)
                  : KDialog(parent)
{
    QWidget     *page = new QWidget(this);
    QGridLayout *layout = new QGridLayout(page);

    setButtons(Ok|Cancel);
    setDefaultButton(Ok);
    setCaption(i18n("Export Theme"));
    layout->setSpacing(spacingHint());
    layout->setMargin(0);
    layout->addWidget(new QLabel(i18n("Name:"), page), 0, 0);
    layout->addWidget(new QLabel(i18n("Comment:"), page), 1, 0);
    layout->addWidget(new QLabel(i18n("Destination folder:"), page), 2, 0);
    layout->addWidget(themeName=new QLineEdit(page), 0, 1);
    layout->addWidget(themeComment=new QLineEdit(i18n("QtCurve based theme"), page), 1, 1);
    layout->addWidget(themeUrl=new KUrlRequester(page), 2, 1);
    layout->addItem(new QSpacerItem(2, 2, QSizePolicy::Minimum, QSizePolicy::Expanding), 3, 1);

    themeUrl->setMode(KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly);
    themeUrl->lineEdit()->setReadOnly(true);
    themeUrl->setUrl(QDir::homePath());
    setMainWidget(page);
}
コード例 #19
0
/**
 * Sets up the general page of the dialog.
 */
void ObjectNodeDialog::setupGeneralPage()
{
    QStringList types;
    types << i18n("Central Buffer") << i18n("Data Store") << i18n("ObjectFlow");
    ObjectNodeWidget::ObjectNodeType type = m_pObjectNodeWidget->objectNodeType();

    KVBox *page = new KVBox();
    pageItemGeneral = new KPageWidgetItem( page, i18n("General") );
    pageItemGeneral->setHeader(i18n("General Properties"));
    pageItemGeneral->setIcon( Icon_Utils::DesktopIcon(Icon_Utils::it_Properties_General) );
    addPage( pageItemGeneral );

    m_GenPageWidgets.generalGB = new QGroupBox( i18nc("properties group title", "Properties"), (QWidget *)page );

    QGridLayout * generalLayout = new QGridLayout( m_GenPageWidgets.generalGB );
    generalLayout->setSpacing( spacingHint() );
    generalLayout->setMargin(  fontMetrics().height()  );

    QString objType;
    if (type < types.count()) {
        objType = types.at((int)type);
    }
    else {
        uWarning() << "type of ObjectNodeWidget is out of range! Value = " << type;
    }
    Dialog_Utils::makeLabeledEditField( m_GenPageWidgets.generalGB, generalLayout, 0,
                                    m_GenPageWidgets.typeL, i18n("Object Node type:"),
                                    m_GenPageWidgets.typeLE, objType );
    m_GenPageWidgets.typeLE->setEnabled( false );

    Dialog_Utils::makeLabeledEditField( m_GenPageWidgets.generalGB, generalLayout, 1,
                                    m_GenPageWidgets.nameL, i18n("Object Node name:"),
                                    m_GenPageWidgets.nameLE );

    Dialog_Utils::makeLabeledEditField( m_GenPageWidgets.generalGB, generalLayout, 2,
                                    m_GenPageWidgets.stateL, i18nc("enter state label", "State :"),
                                    m_GenPageWidgets.stateLE );
    m_GenPageWidgets.stateL->hide();
    m_GenPageWidgets.stateLE->hide();

    m_GenPageWidgets.bufferRB = new QRadioButton( i18n("&Central Buffer"),(QWidget *)page);
    generalLayout->addWidget( m_GenPageWidgets.bufferRB );

    m_GenPageWidgets.dataRB = new QRadioButton( i18n("&Data Store "),(QWidget *)page);
    generalLayout->addWidget( m_GenPageWidgets.dataRB );

    m_GenPageWidgets.flowRB = new QRadioButton( i18n("&Object Flow"),(QWidget *)page);
    generalLayout->addWidget( m_GenPageWidgets.flowRB );

    if (type == ObjectNodeWidget::Flow)
    {
        showState();
    }

    connect(m_GenPageWidgets.bufferRB,SIGNAL(clicked()),this,SLOT(slotHideState()));
    connect(m_GenPageWidgets.dataRB,SIGNAL(clicked()),this,SLOT(slotHideState()));
    connect(m_GenPageWidgets.flowRB,SIGNAL(clicked()),this,SLOT(slotShowState()));

    ObjectNodeWidget::ObjectNodeType newType = m_pObjectNodeWidget->objectNodeType() ;

    m_GenPageWidgets.bufferRB->setChecked(newType == ObjectNodeWidget::Buffer);
    m_GenPageWidgets.dataRB->setChecked (newType == ObjectNodeWidget::Data);
    m_GenPageWidgets.flowRB->setChecked (newType == ObjectNodeWidget::Flow);

    m_GenPageWidgets.docGB = new QGroupBox( i18n( "Documentation"), (QWidget *)page );

    QHBoxLayout * docLayout = new QHBoxLayout( m_GenPageWidgets.docGB );
    docLayout->setSpacing( spacingHint() );
    docLayout->setMargin(  fontMetrics().height()  );

    m_GenPageWidgets.docMLE = new KTextEdit( m_GenPageWidgets.docGB );
    m_GenPageWidgets.docMLE->setText( m_pObjectNodeWidget->documentation() );
    docLayout->addWidget( m_GenPageWidgets.docMLE );

    if (type != ObjectNodeWidget::Buffer && type != ObjectNodeWidget::Data && type != ObjectNodeWidget::Flow) {
        m_GenPageWidgets.nameLE->setEnabled( false );
        m_GenPageWidgets.nameLE->setText( "" );
    } else
        m_GenPageWidgets.nameLE->setText( m_pObjectNodeWidget->name() );
}
コード例 #20
0
void K3bIsoImageWritingDialog::setupGui()
{
  QWidget* frame = mainWidget();

  // image
  // -----------------------------------------------------------------------
  QGroupBox* groupImageUrl = new QGroupBox( 1, Qt::Horizontal, i18n("Image to Burn"), frame );
  m_editImagePath = new KURLRequester( groupImageUrl );
  m_editImagePath->setMode( KFile::File|KFile::ExistingOnly );
  m_editImagePath->setCaption( i18n("Choose Image File") );
  m_editImagePath->setFilter( i18n("*.iso *.ISO|ISO9660 Image Files") + "\n"
			      + i18n("*|All Files") );

  connect( m_editImagePath->lineEdit(), SIGNAL( textChanged ( const QString & ) ), this,  SLOT( slotWriterChanged() ) );

  // image info
  // -----------------------------------------------------------------------
  m_infoView = new K3bListView( frame );
  m_infoView->addColumn( "key" );
  m_infoView->addColumn( "value" );
  m_infoView->header()->hide();
  m_infoView->setNoItemText( i18n("No image file selected") );
  m_infoView->setSorting( -1 );
  m_infoView->setAlternateBackground( QColor() );
  m_infoView->setFullWidth(true);
  m_infoView->setSelectionMode( QListView::NoSelection );

  connect( m_infoView, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)),
	   this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&)) );

  m_writerSelectionWidget = new K3bWriterSelectionWidget( frame );

  // options
  // -----------------------------------------------------------------------
  QTabWidget* optionTabbed = new QTabWidget( frame );

  QWidget* optionTab = new QWidget( optionTabbed );
  QGridLayout* optionTabLayout = new QGridLayout( optionTab );
  optionTabLayout->setAlignment( Qt::AlignTop );
  optionTabLayout->setSpacing( spacingHint() );
  optionTabLayout->setMargin( marginHint() );

  QGroupBox* writingModeGroup = new QGroupBox( 1, Vertical, i18n("Writing Mode"), optionTab );
  writingModeGroup->setInsideMargin( marginHint() );
  m_writingModeWidget = new K3bWritingModeWidget( writingModeGroup );


  // copies --------
  QGroupBox* groupCopies = new QGroupBox( 2, Qt::Horizontal, i18n("Copies"), optionTab );
  groupCopies->setInsideSpacing( spacingHint() );
  groupCopies->setInsideMargin( marginHint() );
  QLabel* pixLabel = new QLabel( groupCopies );
  pixLabel->setPixmap( SmallIcon( "cdcopy", KIcon::SizeMedium ) );
  pixLabel->setScaledContents( false );
  m_spinCopies = new QSpinBox( groupCopies );
  m_spinCopies->setMinValue( 1 );
  m_spinCopies->setMaxValue( 999 );
  // -------- copies

  QGroupBox* optionGroup = new QGroupBox( 3, Vertical, i18n("Settings"), optionTab );
  optionGroup->setInsideMargin( marginHint() );
  optionGroup->setInsideSpacing( spacingHint() );
  m_checkDummy = K3bStdGuiItems::simulateCheckbox( optionGroup );
  m_checkVerify = K3bStdGuiItems::verifyCheckBox( optionGroup );


  optionTabLayout->addWidget( writingModeGroup, 0, 0 );
  optionTabLayout->addWidget( groupCopies, 1, 0 );
  optionTabLayout->addMultiCellWidget( optionGroup, 0, 1, 1, 1 );
  optionTabLayout->setRowStretch( 1, 1 );
  optionTabLayout->setColStretch( 1, 1 );

  optionTabbed->addTab( optionTab, i18n("Settings") );


  QGridLayout* grid = new QGridLayout( frame );
  grid->setSpacing( spacingHint() );
  grid->setMargin( 0 );

  grid->addWidget( groupImageUrl, 0, 0 );
  grid->addWidget( m_infoView, 1, 0 );
  grid->addWidget( m_writerSelectionWidget, 2, 0 );
  grid->addWidget( optionTabbed, 3, 0 );

  grid->setRowStretch( 1, 1 );
}
コード例 #21
0
ファイル: commitdialog.cpp プロジェクト: ShermanHuang/kdesdk
CommitDialog::CommitDialog(KConfig& cfg, OrgKdeCervisiaCvsserviceCvsserviceInterface* service,
                           QWidget *parent)
    : KDialog(parent)
    , partConfig(cfg)
    , cvsService(service)
{
    setCaption(i18n("CVS Commit"));
    setModal(true);
    setButtons(Ok | Cancel | Help | User1);
    setButtonGuiItem(User1, KGuiItem(i18n("&Diff"), "vcs-diff-cvs-cervisia"));
    setDefaultButton(Ok);
    showButtonSeparator(true);

    QFrame* mainWidget = new QFrame(this);
    setMainWidget(mainWidget);

    QBoxLayout *layout = new QVBoxLayout(mainWidget);
    layout->setSpacing(spacingHint());
    layout->setMargin(0);

    QLabel *textlabel = new QLabel( i18n("Commit the following &files:"), mainWidget );
    layout->addWidget(textlabel);

    m_fileList = new KListWidget(mainWidget);
    m_fileList->setEditTriggers(QAbstractItemView::NoEditTriggers);
    textlabel->setBuddy(m_fileList);
    connect( m_fileList, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
             this, SLOT(fileSelected(QListWidgetItem*)));
    connect( m_fileList, SIGNAL(itemSelectionChanged()),
             this, SLOT(fileHighlighted()) );
    layout->addWidget(m_fileList, 5);

    QLabel *archivelabel = new QLabel(i18n("Older &messages:"), mainWidget);
    layout->addWidget(archivelabel);

    combo = new KComboBox(mainWidget);
    archivelabel->setBuddy(combo);
    connect( combo, SIGNAL(activated(int)), this, SLOT(comboActivated(int)) );
    // make sure that combobox is smaller than the screen
    combo->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed));
    layout->addWidget(combo);

    QLabel *messagelabel = new QLabel(i18n("&Log message:"), mainWidget);
    layout->addWidget(messagelabel);

    edit = new Cervisia::LogMessageEdit(mainWidget);
    messagelabel->setBuddy(edit);
    edit->setFocus();
    edit->setMinimumSize(400, 100);
    layout->addWidget(edit, 10);

    m_useTemplateChk = new QCheckBox(i18n("Use log message &template"), mainWidget);
    layout->addWidget(m_useTemplateChk);
    connect( m_useTemplateChk, SIGNAL(clicked()), this, SLOT(useTemplateClicked()) );

    checkForTemplateFile();

    enableButton(User1, false);
    connect( this, SIGNAL(user1Clicked()),
             this, SLOT(diffClicked()) );

    setHelp("commitingfiles");

    KConfigGroup cg(&partConfig, "CommitDialog");
    restoreDialogSize(cg);
}
コード例 #22
0
void SettingsDlg::setupUIPage()
{
    // FIXME: merge with UMLWidgetStylePage
    //setup UI page
    QWidget * page = new QWidget();
    QVBoxLayout* uiPageLayout = new QVBoxLayout(page);
    
    pageUserInterface = new KPageWidgetItem( page,i18n("User Interface"));
    pageUserInterface->setHeader( i18n("User Interface Settings") );
    pageUserInterface->setIcon( Icon_Utils::DesktopIcon(Icon_Utils::it_Properties_UserInterface) );
    addPage( pageUserInterface );

    m_UiWidgets.colorGB = new QGroupBox( i18nc("color group box", "Color"), page );
    QGridLayout * colorLayout = new QGridLayout( m_UiWidgets.colorGB );
    colorLayout->setSpacing( spacingHint() );
    colorLayout->setMargin( fontMetrics().height() );
    uiPageLayout->addWidget(m_UiWidgets.colorGB);
    
    uiPageLayout->addItem(new QSpacerItem(0, 20, QSizePolicy::Minimum, QSizePolicy::Expanding));

    m_UiWidgets.textColorCB = new QCheckBox( i18n("Custom text color:"), m_UiWidgets.colorGB );
    colorLayout->addWidget( m_UiWidgets.textColorCB, 0, 0 );

    m_UiWidgets.textColorB = new KColorButton( m_pOptionState->uiState.textColor ,m_UiWidgets.colorGB);
    //m_UiWidgets.lineColorB->setObjectName( m_UiWidgets.colorGB );
    colorLayout->addWidget( m_UiWidgets.textColorB, 0, 1 );

    m_UiWidgets.lineColorCB = new QCheckBox( i18n("Custom line color:"), m_UiWidgets.colorGB );
    colorLayout->addWidget( m_UiWidgets.lineColorCB, 1, 0 );

    m_UiWidgets.lineColorB = new KColorButton( m_pOptionState->uiState.lineColor ,m_UiWidgets.colorGB);
    //m_UiWidgets.lineColorB->setObjectName( m_UiWidgets.colorGB );
    colorLayout->addWidget( m_UiWidgets.lineColorB, 1, 1 );

//     m_UiWidgets.lineDefaultB = new QPushButton( i18n("D&efault Color"), m_UiWidgets.colorGB );
//     colorLayout->addWidget( m_UiWidgets.lineDefaultB, 0, 2 );

    m_UiWidgets.fillColorCB = new QCheckBox( i18n("Custom fill color:"), m_UiWidgets.colorGB );
    colorLayout->addWidget( m_UiWidgets.fillColorCB, 2, 0 );

    m_UiWidgets.fillColorB = new KColorButton( m_pOptionState->uiState.fillColor,m_UiWidgets.colorGB  );
    colorLayout->addWidget( m_UiWidgets.fillColorB, 2, 1 );

    m_UiWidgets.gridColorCB = new QCheckBox( i18n("Custom grid color:"), m_UiWidgets.colorGB );
    colorLayout->addWidget(m_UiWidgets.gridColorCB , 3, 0 );

    m_UiWidgets.gridColorB = new KColorButton( m_pOptionState->uiState.gridDotColor,m_UiWidgets.colorGB  );
    colorLayout->addWidget(m_UiWidgets.gridColorB , 3, 1 );

    m_UiWidgets.bgColorCB = new QCheckBox( i18n("Custom background color:"), m_UiWidgets.colorGB );
    colorLayout->addWidget(m_UiWidgets.bgColorCB , 4, 0 );

    m_UiWidgets.bgColorB = new KColorButton( m_pOptionState->uiState.backgroundColor,m_UiWidgets.colorGB  );
    colorLayout->addWidget(m_UiWidgets.bgColorB , 4, 1 );

    m_UiWidgets.lineWidthCB = new QCheckBox( i18n("Custom line width:"), m_UiWidgets.colorGB );
    colorLayout->addWidget( m_UiWidgets.lineWidthCB, 5, 0 );

    m_UiWidgets.lineWidthB = new KIntSpinBox( 0, 10, 1, m_pOptionState->uiState.lineWidth, m_UiWidgets.colorGB );
    colorLayout->addWidget( m_UiWidgets.lineWidthB, 5, 1 );
    
    m_UiWidgets.useFillColorCB = new QCheckBox( i18n("&Use fill color"), m_UiWidgets.colorGB );
    //colorLayout->setRowStretch( 3, 2 );
    colorLayout->addWidget( m_UiWidgets.useFillColorCB, 6, 0 );
    m_UiWidgets.useFillColorCB->setChecked( m_pOptionState->uiState.useFillColor );

    //connect button signals up
    connect( m_UiWidgets.textColorCB, SIGNAL(toggled(bool)), this, SLOT(slotTextCBChecked(bool)) );
    connect( m_UiWidgets.lineColorCB, SIGNAL(toggled(bool)), this, SLOT(slotLineCBChecked(bool)) );
    connect( m_UiWidgets.fillColorCB, SIGNAL(toggled(bool)), this, SLOT(slotFillCBChecked(bool)) );
    connect( m_UiWidgets.gridColorCB, SIGNAL(toggled(bool)), this, SLOT(slotGridCBChecked(bool)) );
    connect( m_UiWidgets.bgColorCB, SIGNAL(toggled(bool)), this, SLOT(slotBgCBChecked(bool)) );
    
    //TODO Once the new canvas is complete, so something better, it does not worth it for now
    if (m_UiWidgets.textColorB->color() == TEXT_COLOR) {
        m_UiWidgets.textColorCB->setChecked(false);
        m_UiWidgets.textColorB->setDisabled(true);
    }
    else {
        m_UiWidgets.textColorCB->setChecked(true);
    }

    if (m_UiWidgets.fillColorB->color() == FILL_COLOR) {
        m_UiWidgets.fillColorCB->setChecked(false);
        m_UiWidgets.fillColorB->setDisabled(true);
    }
    else {
        m_UiWidgets.fillColorCB->setChecked(true);
    }
    
    if (m_UiWidgets.lineColorB->color() == LINK_COLOR) {
        m_UiWidgets.lineColorCB->setChecked(false);
        m_UiWidgets.lineColorB->setDisabled(true);
    }
    else {
        m_UiWidgets.lineColorCB->setChecked(true);
    }
}
コード例 #23
0
KScienceSetup::KScienceSetup(  QWidget *parent, const char *name )
	: KDialogBase( parent, name, true, i18n( "Setup Science Screen Saver" ),
	  Ok|Cancel|Help, Ok, true ), saver( 0 )
{
	readSettings();
	initModeInfo();

	QWidget *main = makeMainWidget();

	QHBoxLayout *lt  = new QHBoxLayout( main, 0, spacingHint());
	QVBoxLayout *ltm = new QVBoxLayout;
	lt->addLayout( ltm );
	QVBoxLayout *ltc = new QVBoxLayout;
	lt->addLayout( ltc );

	// mode
	QLabel *label = new QLabel( i18n("Mode:"), main );
	ltm->addWidget( label );

	QListBox *c = new QListBox( main );
	for(int i = 0; i<MAX_MODES; i++)
		c->insertItem( modeInfo[i].name );
	c->setCurrentItem( mode );
	c->setFixedHeight( 5 * c->fontMetrics().height() );
	connect( c, SIGNAL( highlighted( int ) ), SLOT( slotMode( int ) ) );
	ltm->addWidget( c );

	// inverse
	QCheckBox *cbox = checkInverse = new QCheckBox( i18n("Inverse"), main );
	cbox->setEnabled( modeInfo[mode].inverseEnable );
	cbox->setChecked( inverse[mode] );
	connect( cbox, SIGNAL( clicked() ), SLOT( slotInverse() ) );
	ltm->addWidget( cbox );

	// gravity
	cbox = checkGravity = new QCheckBox( i18n("Gravity"), main );
	cbox->setChecked( gravity[mode] );
	connect( cbox, SIGNAL( clicked() ), SLOT( slotGravity() ) );
	ltm->addWidget( cbox );

	// hide background
	cbox = checkHideBG = new QCheckBox( i18n("Hide background"), main );
	cbox->setChecked( hideBG[mode] );
	connect( cbox, SIGNAL( clicked() ), SLOT( slotHideBG() ) );
	ltm->addWidget( cbox );
	ltm->addStretch();

	// size
	label = new QLabel( i18n("Size:"), main );
	ltc->addWidget( label );

	slideSize = new QSlider(9, 50, 5, size[mode], QSlider::Horizontal,
                                main );
	slideSize->setMinimumSize( 90, 20 );
    slideSize->setTickmarks(QSlider::Below);
    slideSize->setTickInterval(5);
	connect( slideSize, SIGNAL( sliderMoved( int ) ),
		SLOT( slotSize( int ) ) );
	connect( slideSize, SIGNAL( sliderPressed() ),
		SLOT( slotSliderPressed() ) );
	connect( slideSize, SIGNAL( sliderReleased() ),
		SLOT( slotSliderReleased() ) );

	ltc->addWidget( slideSize );

	// intensity
	label = new QLabel( i18n("Intensity:"), main );
	ltc->addWidget( label );

	slideIntensity = new QSlider(0, 10, 1, intensity[mode],
                                     QSlider::Horizontal, main );
	slideIntensity->setMinimumSize( 90, 20 );
    slideIntensity->setTickmarks(QSlider::Below);
    slideIntensity->setTickInterval(1);
	connect( slideIntensity, SIGNAL( sliderMoved( int ) ),
		SLOT( slotIntensity( int )) );
	connect( slideIntensity, SIGNAL( sliderPressed() ),
		SLOT( slotSliderPressed() ) );
	connect( slideIntensity, SIGNAL( sliderReleased() ),
		SLOT( slotSliderReleased() ) );
	ltc->addWidget( slideIntensity );

	// speed
	label = new QLabel( i18n("Speed:"), main );
	ltc->addWidget( label );

	slideSpeed = new QSlider(0, SCI_MAX_SPEED, 10, speed[mode],
                             QSlider::Horizontal, main );
	slideSpeed->setMinimumSize( 90, 20 );
    slideSpeed->setTickmarks(QSlider::Below);
    slideSpeed->setTickInterval(10);
	connect( slideSpeed, SIGNAL( sliderMoved( int ) ),
		SLOT( slotSpeed( int ) ) );
	ltc->addWidget( slideSpeed );

	// motion
	label = new QLabel( i18n("Motion:"), main );
	ltc->addWidget( label );

	QHBoxLayout *ltcm = new QHBoxLayout;
	ltc->addLayout( ltcm );

	slideMoveX = new QSlider(0, SCI_MAX_MOVE, 5, moveX[mode],
                                 QSlider::Horizontal, main );
	slideMoveX->setMinimumSize( 40, 20 );
    slideMoveX->setTickmarks(QSlider::Below);
    slideMoveX->setTickInterval(5);
	connect( slideMoveX, SIGNAL( sliderMoved( int ) ),
		SLOT( slotMoveX( int ) ) );
	ltcm->addWidget( slideMoveX );

	slideMoveY = new QSlider(0, SCI_MAX_MOVE, 5, moveY[mode],
                                QSlider::Horizontal, main );
	slideMoveY->setMinimumSize( 40, 20 );
    slideMoveY->setTickmarks(QSlider::Below);
    slideMoveY->setTickInterval(5);
	connect( slideMoveY, SIGNAL( sliderMoved( int ) ),
		SLOT( slotMoveY( int ) ) );
	ltcm->addWidget( slideMoveY );

	ltc->addStretch();

	// preview
	preview = new KPreviewWidget( main );
	preview->setFixedSize( 220, 170 );
	QPixmap p( locate("data", "kscreensaver/pics/kscience.png") );
	if( p.isNull() )
		preview->setBackgroundColor( black );
	else
		preview->setBackgroundPixmap( p );
	preview->show();	// otherwise saver does not get correct size
	lt->addWidget( preview );

	// let the preview window display before creating the saver
	kapp->processEvents();

	saver = new KScienceSaver( preview->winId(), true, !p.isNull() );
	preview->notifySaver( saver );
}
コード例 #24
0
  VacationDialog::VacationDialog( const QString & caption, QWidget * parent,
				  const char * name, bool modal )
    : KDialogBase( Plain, caption, Ok|Cancel|Default, Ok, parent, name, modal )
  {
    KWin::setIcons( winId(), kapp->icon(), kapp->miniIcon() );

    static const int rows = 7;
    int row = -1;

    QGridLayout * glay = new QGridLayout( plainPage(), rows, 2, 0, spacingHint() );
    glay->setColStretch( 1, 1 );

    // explanation label:
    ++row;
    glay->addMultiCellWidget( new QLabel( i18n("Configure vacation "
					       "notifications to be sent:"),
					  plainPage() ), row, row, 0, 1 );

    // Activate checkbox:
    ++row;
    mActiveCheck = new QCheckBox( i18n("&Activate vacation notifications"), plainPage() );
    glay->addMultiCellWidget( mActiveCheck, row, row, 0, 1 );

    // Message text edit:
    ++row;
    glay->setRowStretch( row, 1 );
    mTextEdit = new QTextEdit( plainPage(), "mTextEdit" );
    mTextEdit->setTextFormat( QTextEdit::PlainText );
    glay->addMultiCellWidget( mTextEdit, row, row, 0, 1 );

    // "Resent only after" spinbox and label:
    ++row;
    mIntervalSpin = new KIntSpinBox( 1, 356, 1, 7, 10, plainPage(), "mIntervalSpin" );
    connect(mIntervalSpin, SIGNAL( valueChanged( int )), SLOT( slotIntervalSpinChanged( int ) ) );
    glay->addWidget( new QLabel( mIntervalSpin, i18n("&Resend notification only after:"), plainPage() ), row, 0 );
    glay->addWidget( mIntervalSpin, row, 1 );

    // "Send responses for these addresses" lineedit and label:
    ++row;
    mMailAliasesEdit = new QLineEdit( plainPage(), "mMailAliasesEdit" );
    glay->addWidget( new QLabel( mMailAliasesEdit, i18n("&Send responses for these addresses:"), plainPage() ), row, 0 );
    glay->addWidget( mMailAliasesEdit, row, 1 );

    // "Send responses also to SPAM mail" checkbox:
    ++row;
    mSpamCheck = new QCheckBox( i18n("Do not send vacation replies to spam messages"), plainPage(), "mSpamCheck" );
    mSpamCheck->setChecked( true );
    glay->addMultiCellWidget( mSpamCheck, row, row, 0, 1 );

    //  domain checkbox and linedit:
    ++row;
    mDomainCheck = new QCheckBox( i18n("Only react to mail coming from domain"), plainPage(), "mDomainCheck" );
    mDomainCheck->setChecked( false );
    mDomainEdit = new QLineEdit( plainPage(), "mDomainEdit" );
    mDomainEdit->setEnabled( false );
    mDomainEdit->setValidator( new QRegExpValidator( QRegExp( "[a-zA-Z0-9+-]+(?:\\.[a-zA-Z0-9+-]+)*" ), mDomainEdit ) );
    glay->addWidget( mDomainCheck, row, 0 );
    glay->addWidget( mDomainEdit, row, 1 );
    connect( mDomainCheck, SIGNAL(toggled(bool)),
             mDomainEdit, SLOT(setEnabled(bool)) );

    Q_ASSERT( row == rows - 1 );
  }
コード例 #25
0
ファイル: sounddlg.cpp プロジェクト: serghei/kde3-kdepim
SoundDlg::SoundDlg(const QString &file, float volume, float fadeVolume, int fadeSeconds, bool repeat,
                   const QString &caption, QWidget *parent, const char *name)
    : KDialogBase(parent, name, true, caption, Ok | Cancel, Ok, false),
      mReadOnly(false),
      mArtsDispatcher(0),
      mPlayObject(0),
      mPlayTimer(0)
{
    QWidget *page = new QWidget(this);
    setMainWidget(page);
    QVBoxLayout *layout = new QVBoxLayout(page, 0, spacingHint());

    // File play button
    QHBox *box = new QHBox(page);
    layout->addWidget(box);
    mFilePlay = new QPushButton(box);
    mFilePlay->setPixmap(SmallIcon("player_play"));
    mFilePlay->setFixedSize(mFilePlay->sizeHint());
    connect(mFilePlay, SIGNAL(clicked()), SLOT(playSound()));
    QToolTip::add(mFilePlay, i18n("Test the sound"));
    QWhatsThis::add(mFilePlay, i18n("Play the selected sound file."));

    // File name edit box
    mFileEdit = new LineEdit(LineEdit::Url, box);
    mFileEdit->setAcceptDrops(true);
    QWhatsThis::add(mFileEdit, i18n("Enter the name or URL of a sound file to play."));

    // File browse button
    mFileBrowseButton = new PushButton(box);
    mFileBrowseButton->setPixmap(SmallIcon("fileopen"));
    mFileBrowseButton->setFixedSize(mFileBrowseButton->sizeHint());
    connect(mFileBrowseButton, SIGNAL(clicked()), SLOT(slotPickFile()));
    QToolTip::add(mFileBrowseButton, i18n("Choose a file"));
    QWhatsThis::add(mFileBrowseButton, i18n("Select a sound file to play."));

    // Sound repetition checkbox
    mRepeatCheckbox = new CheckBox(i18n_p_Repeat(), page);
    mRepeatCheckbox->setFixedSize(mRepeatCheckbox->sizeHint());
    QWhatsThis::add(mRepeatCheckbox,
                    i18n("If checked, the sound file will be played repeatedly for as long as the message is displayed."));
    layout->addWidget(mRepeatCheckbox);

    // Volume
    QGroupBox *group = new QGroupBox(i18n("Volume"), page);
    layout->addWidget(group);
    QGridLayout *grid = new QGridLayout(group, 4, 3, marginHint(), spacingHint());
    grid->addRowSpacing(0, fontMetrics().height() - marginHint() + spacingHint());
    grid->setColStretch(2, 1);
    int indentWidth = 3 * KDialog::spacingHint();
    grid->addColSpacing(0, indentWidth);
    grid->addColSpacing(1, indentWidth);
    // Get alignment to use in QGridLayout (AlignAuto doesn't work correctly there)
    int alignment = QApplication::reverseLayout() ? Qt::AlignRight : Qt::AlignLeft;

    // 'Set volume' checkbox
    box = new QHBox(group);
    box->setSpacing(spacingHint());
    grid->addMultiCellWidget(box, 1, 1, 0, 2);
    mVolumeCheckbox = new CheckBox(i18n_v_SetVolume(), box);
    mVolumeCheckbox->setFixedSize(mVolumeCheckbox->sizeHint());
    connect(mVolumeCheckbox, SIGNAL(toggled(bool)), SLOT(slotVolumeToggled(bool)));
    QWhatsThis::add(mVolumeCheckbox,
                    i18n("Select to choose the volume for playing the sound file."));

    // Volume slider
    mVolumeSlider = new Slider(0, 100, 10, 0, Qt::Horizontal, box);
    mVolumeSlider->setTickmarks(QSlider::Below);
    mVolumeSlider->setTickInterval(10);
    mVolumeSlider->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
    QWhatsThis::add(mVolumeSlider, i18n("Choose the volume for playing the sound file."));
    mVolumeCheckbox->setFocusWidget(mVolumeSlider);

    // Fade checkbox
    mFadeCheckbox = new CheckBox(i18n("Fade"), group);
    mFadeCheckbox->setFixedSize(mFadeCheckbox->sizeHint());
    connect(mFadeCheckbox, SIGNAL(toggled(bool)), SLOT(slotFadeToggled(bool)));
    QWhatsThis::add(mFadeCheckbox,
                    i18n("Select to fade the volume when the sound file first starts to play."));
    grid->addMultiCellWidget(mFadeCheckbox, 2, 2, 1, 2, alignment);

    // Fade time
    mFadeBox = new QHBox(group);
    mFadeBox->setSpacing(spacingHint());
    grid->addWidget(mFadeBox, 3, 2, alignment);
    QLabel *label = new QLabel(i18n("Time period over which to fade the sound", "Fade time:"), mFadeBox);
    label->setFixedSize(label->sizeHint());
    mFadeTime = new SpinBox(1, 999, 1, mFadeBox);
    mFadeTime->setLineShiftStep(10);
    mFadeTime->setFixedSize(mFadeTime->sizeHint());
    label->setBuddy(mFadeTime);
    label = new QLabel(i18n("seconds"), mFadeBox);
    label->setFixedSize(label->sizeHint());
    QWhatsThis::add(mFadeBox, i18n("Enter how many seconds to fade the sound before reaching the set volume."));

    // Fade slider
    mFadeVolumeBox = new QHBox(group);
    mFadeVolumeBox->setSpacing(spacingHint());
    grid->addWidget(mFadeVolumeBox, 4, 2);
    label = new QLabel(i18n("Initial volume:"), mFadeVolumeBox);
    label->setFixedSize(label->sizeHint());
    mFadeSlider = new Slider(0, 100, 10, 0, Qt::Horizontal, mFadeVolumeBox);
    mFadeSlider->setTickmarks(QSlider::Below);
    mFadeSlider->setTickInterval(10);
    mFadeSlider->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
    label->setBuddy(mFadeSlider);
    QWhatsThis::add(mFadeVolumeBox, i18n("Choose the initial volume for playing the sound file."));

    // Restore the dialogue size from last time
    QSize s;
    if(KAlarm::readConfigWindowSize(SOUND_DIALOG_NAME, s))
        resize(s);

    // Initialise the control values
    mFileEdit->setText(file);
    mRepeatCheckbox->setChecked(repeat);
    mVolumeCheckbox->setChecked(volume >= 0);
    mVolumeSlider->setValue(volume >= 0 ? static_cast<int>(volume * 100) : 100);
    mFadeCheckbox->setChecked(fadeVolume >= 0);
    mFadeSlider->setValue(fadeVolume >= 0 ? static_cast<int>(fadeVolume * 100) : 100);
    mFadeTime->setValue(fadeSeconds);
    slotVolumeToggled(volume >= 0);
}
コード例 #26
0
KWatchGnuPGConfig::KWatchGnuPGConfig(QWidget *parent, const char *name)
    : KDialogBase(Plain, i18n("Configure KWatchGnuPG"),
                  Ok | Cancel, Ok, parent, name)
{
    // tmp vars:
    QWidget *w;
    QGridLayout *glay;
    QGroupBox *group;

    QWidget *top = plainPage();

    QVBoxLayout *vlay = new QVBoxLayout(top, 0, spacingHint());

    group = new QVGroupBox(i18n("WatchGnuPG"), top);
    group->layout()->setSpacing(spacingHint());

    w = new QWidget(group);

    glay = new QGridLayout(w, 3, 2, 0, spacingHint());
    glay->setColStretch(1, 1);

    int row = -1;

    ++row;
    mExeED = new KURLRequester(w);
    glay->addWidget(new QLabel(mExeED, i18n("&Executable:"), w), row, 0);
    glay->addWidget(mExeED, row, 1);
    connect(mExeED, SIGNAL(textChanged(const QString &)), SLOT(slotChanged()));

    ++row;
    mSocketED = new KURLRequester(w);
    glay->addWidget(new QLabel(mSocketED, i18n("&Socket:"), w), row, 0);
    glay->addWidget(mSocketED, row, 1);
    connect(mSocketED, SIGNAL(textChanged(const QString &)), SLOT(slotChanged()));

    ++row;
    mLogLevelCB = new QComboBox(false, w);
    mLogLevelCB->insertItem(i18n("None"));
    mLogLevelCB->insertItem(i18n("Basic"));
    mLogLevelCB->insertItem(i18n("Advanced"));
    mLogLevelCB->insertItem(i18n("Expert"));
    mLogLevelCB->insertItem(i18n("Guru"));
    glay->addWidget(new QLabel(mLogLevelCB, i18n("Default &log level:"), w), row, 0);
    glay->addWidget(mLogLevelCB, row, 1);
    connect(mLogLevelCB, SIGNAL(activated(int)), SLOT(slotChanged()));

    vlay->addWidget(group);

    /******************* Log Window group *******************/
    group = new QVGroupBox(i18n("Log Window"), top);
    group->layout()->setSpacing(spacingHint());

    w = new QWidget(group);

    glay = new QGridLayout(w, 2, 3, 0, spacingHint());
    glay->setColStretch(1, 1);

    row = -1;

    ++row;
    mLoglenSB = new QSpinBox(0, 1000000, 100, w);
    mLoglenSB->setSuffix(i18n("history size spinbox suffix", " lines"));
    mLoglenSB->setSpecialValueText(i18n("unlimited"));
    glay->addWidget(new QLabel(mLoglenSB, i18n("&History size:"), w), row, 0);
    glay->addWidget(mLoglenSB, row, 1);
    QPushButton *button = new QPushButton(i18n("Set &Unlimited"), w);
    glay->addWidget(button, row, 2);

    connect(mLoglenSB, SIGNAL(valueChanged(int)), SLOT(slotChanged()));
    connect(button, SIGNAL(clicked()), SLOT(slotSetHistorySizeUnlimited()));

    ++row;
    mWordWrapCB = new QCheckBox(i18n("Enable &word wrapping"), w);
    mWordWrapCB->hide(); // QTextEdit doesn't support word wrapping in LogText mode
    glay->addMultiCellWidget(mWordWrapCB, row, row, 0, 2);

    connect(mWordWrapCB, SIGNAL(clicked()), SLOT(slotChanged()));

    vlay->addWidget(group);
    vlay->addStretch(1);

    connect(this, SIGNAL(applyClicked()), SLOT(slotSave()));
    connect(this, SIGNAL(okClicked()), SLOT(slotSave()));
}
コード例 #27
0
AddRepositoryDialog::AddRepositoryDialog(KConfig& cfg, const QString& repo,
                                         QWidget* parent)
    : KDialog(parent)
    , partConfig(cfg)
{
    setCaption(i18n("Add Repository"));
    setModal(true);
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);
    showButtonSeparator(true);

    QFrame* mainWidget = new QFrame(this);
    setMainWidget(mainWidget);

    QBoxLayout* layout = new QVBoxLayout(mainWidget);
    layout->setSpacing(spacingHint());
    layout->setMargin(0);

    QLabel* repo_label = new QLabel(i18n("&Repository:"), mainWidget);
    layout->addWidget(repo_label);

    repo_edit = new KLineEdit(mainWidget);
    repo_edit->setFocus();
    repo_label->setBuddy(repo_edit);
    if( !repo.isNull() )
    {
        repo_edit->setText(repo);
        repo_edit->setEnabled(false);
    }
    layout->addWidget(repo_edit);

    QLabel* rsh_label = new QLabel(i18n("Use remote &shell (only for :ext: repositories):"), mainWidget);
    layout->addWidget(rsh_label);

    rsh_edit = new KLineEdit(mainWidget);
    rsh_label->setBuddy(rsh_edit);
    layout->addWidget(rsh_edit);

    QLabel* server_label = new QLabel(i18n("Invoke this program on the server side:"),
                                      mainWidget);
    layout->addWidget(server_label);

    server_edit = new KLineEdit(mainWidget);
    server_label->setBuddy(server_edit);
    layout->addWidget(server_edit);

    KHBox* compressionBox = new KHBox(mainWidget);
    m_useDifferentCompression = new QCheckBox(i18n("Use different &compression level:"), compressionBox);

    m_compressionLevel = new KIntNumInput(compressionBox);
    m_compressionLevel->setRange(0, 9, 1);
    m_compressionLevel->setSliderEnabled(false);
    layout->addWidget(compressionBox);

    m_retrieveCvsignoreFile = new QCheckBox(i18n("Download cvsignore file from "
                                            "server"), mainWidget);
    layout->addWidget(m_retrieveCvsignoreFile);

    connect( repo_edit, SIGNAL(textChanged(QString)),
             this, SLOT(repoChanged()) );
    connect( m_useDifferentCompression, SIGNAL(toggled(bool)),
             this, SLOT(compressionToggled(bool)) );
    repoChanged();

    KConfigGroup cg(&partConfig, "AddRepositoryDialog");
    restoreDialogSize(cg);
}
コード例 #28
0
WorkSheetSettings::WorkSheetSettings( QWidget* parent, bool locked )
  : KDialog( parent )
{
  setObjectName( "WorkSheetSettings" );
  setModal( true );
  setCaption( i18n( "Tab Properties" ) );
  setButtons( Ok | Cancel );

  QWidget *page = new QWidget( this );
  setMainWidget( page );

  QVBoxLayout *topLayout = new QVBoxLayout( page );
  topLayout->setMargin( 0 );
  topLayout->setSpacing( spacingHint() );

  QGroupBox *group = new QGroupBox( i18n( "Title" ), page );

  QGridLayout *groupLayout = new QGridLayout;
  group->setLayout( groupLayout );
  groupLayout->setAlignment( Qt::AlignTop );

  mSheetTitle = new KLineEdit( group );
  groupLayout->addWidget( mSheetTitle, 0, 0 );

  topLayout->addWidget( group );

  group = new QGroupBox( i18n( "Properties" ), page );

  groupLayout = new QGridLayout;
  group->setLayout( groupLayout );
  groupLayout->setAlignment( Qt::AlignTop );

  int row_num = -1;
  QLabel *label;
  if ( !locked ) {
    label = new QLabel( i18n( "Rows:" ), group );
    groupLayout->addWidget( label, ++row_num, 0 );

    mRows = new KIntNumInput( 3, group );
    mRows->setMaximum( 42 );
    mRows->setMinimum( 1 );
    groupLayout->addWidget( mRows, row_num, 1 );
    label->setBuddy( mRows );

    label = new QLabel( i18n( "Columns:" ), group );
    groupLayout->addWidget( label, ++row_num, 0 );

    mColumns = new KIntNumInput( 1, group );
    mColumns->setMaximum( 42 );
    mColumns->setMinimum( 1 );
    groupLayout->addWidget( mColumns, 1, 1 );
    label->setBuddy( mColumns );
    mRows->setWhatsThis( i18n( "Enter the number of rows the sheet should have." ) );
    mColumns->setWhatsThis( i18n( "Enter the number of columns the sheet should have." ) );
  }
  label = new QLabel( i18n( "Update interval:" ), group );
  groupLayout->addWidget( label, ++row_num, 0 );

  mInterval = new KDoubleNumInput( 0.00/*minimum*/, 1000.0/*maximum*/, 0.5/*default*/, group/*parent*/, 0.5/*stepsize*/, 2/*precision*/ );
  mInterval->setSuffix( i18n( " sec" ) );
  groupLayout->addWidget( mInterval, row_num, 1 );
  label->setBuddy( mInterval );

  topLayout->addWidget( group );

  mInterval->setWhatsThis( i18n( "All displays of the sheet are updated at the rate specified here." ) );
  mSheetTitle->setToolTip( i18n( "Enter the title of the worksheet here." ) );

  KAcceleratorManager::manage( page );

  mSheetTitle->setFocus();

//  resize( QSize( 250, 230 ).expandedTo( minimumSizeHint() ) );
}
コード例 #29
0
ファイル: mergedlg.cpp プロジェクト: serghei/kde-kdesdk
MergeDialog::MergeDialog(CvsService_stub* service,
                         QWidget *parent, const char *name)
    : KDialogBase(parent, name, true, i18n("CVS Merge"),
                  Ok | Cancel, Ok, true),
      cvsService(service)
{
    int const iComboBoxMinWidth(30 * fontMetrics().width('0'));
    int const iWidgetIndent(style().pixelMetric(QStyle::PM_ExclusiveIndicatorWidth, 0) + 6);

    QFrame* mainWidget = makeMainWidget();

    QBoxLayout *layout = new QVBoxLayout(mainWidget, 0, spacingHint());

    bybranch_button = new QRadioButton(i18n("Merge from &branch:"), mainWidget);
    bybranch_button->setChecked(true);
    layout->addWidget(bybranch_button);

    branch_combo = new QComboBox(true, mainWidget);
    branch_combo->setMinimumWidth(iComboBoxMinWidth);

    branch_button = new QPushButton(i18n("Fetch &List"), mainWidget);
    connect( branch_button, SIGNAL(clicked()),
             this, SLOT(branchButtonClicked()) );
            
    QBoxLayout *branchedit_layout = new QHBoxLayout(layout);
    branchedit_layout->addSpacing(iWidgetIndent);
    branchedit_layout->addWidget(branch_combo, 2);
    branchedit_layout->addWidget(branch_button, 0);
    
    bytags_button = new QRadioButton(i18n("Merge &modifications:"), mainWidget);
    layout->addWidget(bytags_button);

    QLabel *tag1_label = new QLabel(i18n("between tag: "), mainWidget);
    tag1_combo = new QComboBox(true, mainWidget);
    tag1_combo->setMinimumWidth(iComboBoxMinWidth);
    
    QLabel *tag2_label = new QLabel(i18n("and tag: "), mainWidget);
    tag2_combo = new QComboBox(true, mainWidget);
    tag2_combo->setMinimumWidth(iComboBoxMinWidth);

    tag_button = new QPushButton(i18n("Fetch L&ist"), mainWidget);
    connect( tag_button, SIGNAL(clicked()),
             this, SLOT(tagButtonClicked()) );

    QGridLayout *tagsedit_layout = new QGridLayout(layout);
    tagsedit_layout->addColSpacing(0, iWidgetIndent);
    tagsedit_layout->setColStretch(0, 0);
    tagsedit_layout->setColStretch(1, 1);
    tagsedit_layout->setColStretch(2, 2);
    tagsedit_layout->setColStretch(3, 0);
    tagsedit_layout->addWidget(tag1_label, 0, 1);
    tagsedit_layout->addWidget(tag1_combo, 0, 2);
    tagsedit_layout->addWidget(tag2_label, 1, 1);
    tagsedit_layout->addWidget(tag2_combo, 1, 2);
    tagsedit_layout->addMultiCellWidget(tag_button, 0, 1, 3, 3);
    
    QButtonGroup* group = new QButtonGroup(mainWidget);
    group->hide();
    group->insert(bybranch_button);
    group->insert(bytags_button);
    connect( group, SIGNAL(clicked(int)),
             this, SLOT(toggled()) );

    // dis-/enable the widgets
    toggled();
}
コード例 #30
0
ファイル: emaileditwidget.cpp プロジェクト: lenggi/kcalcore
EmailEditDialog::EmailEditDialog( const QStringList &list, QWidget *parent )
  : KDialog( parent )
{
  setCaption( i18n( "Edit Email Addresses" ) );
  setButtons( KDialog::Ok | KDialog::Cancel );
  setDefaultButton( KDialog::Cancel );

  QWidget *page = new QWidget( this );
  setMainWidget( page );

  QGridLayout *topLayout = new QGridLayout( page );
  topLayout->setSpacing( spacingHint() );
  topLayout->setMargin( 0 );

  mEmailListBox = new KListWidget( page );
  mEmailListBox->setSelectionMode( QAbstractItemView::SingleSelection );

  // Make sure there is room for the scrollbar
  mEmailListBox->setMinimumHeight( mEmailListBox->sizeHint().height() + 30 );
  connect( mEmailListBox, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
           SLOT(selectionChanged()) );
  connect( mEmailListBox, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
           SLOT(edit()) );
  topLayout->addWidget( mEmailListBox, 0, 0, 5, 2 );

  mAddButton = new QPushButton( i18n( "Add..." ), page );
  connect( mAddButton, SIGNAL(clicked()), SLOT(add()) );
  topLayout->addWidget( mAddButton, 0, 2 );

  mEditButton = new QPushButton( i18n( "Edit..." ), page );
  mEditButton->setEnabled( false );
  connect( mEditButton, SIGNAL(clicked()), SLOT(edit()) );
  topLayout->addWidget( mEditButton, 1, 2 );

  mRemoveButton = new QPushButton( i18n( "Remove" ), page );
  mRemoveButton->setEnabled( false );
  connect( mRemoveButton, SIGNAL(clicked()), SLOT(remove()) );
  topLayout->addWidget( mRemoveButton, 2, 2 );

  mStandardButton = new QPushButton( i18n( "Set as Standard" ), page );
  mStandardButton->setEnabled( false );
  connect( mStandardButton, SIGNAL(clicked()), SLOT(standard()) );
  topLayout->addWidget( mStandardButton, 3, 2 );

  topLayout->setRowStretch( 4, 1 );

  QStringList items = list;
  if ( items.removeAll( QLatin1String( "" ) ) > 0 ) {
    mChanged = true;
  } else {
    mChanged = false;
  }

  QStringList::ConstIterator it;
  bool preferred = true;
  for ( it = items.constBegin(); it != items.constEnd(); ++it ) {
    new EmailItem( *it, mEmailListBox, preferred );
    preferred = false;
  }

  // set default state
  KAcceleratorManager::manage( this );

  setInitialSize( QSize( 400, 200 ) );
}