Пример #1
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();
    }
Пример #2
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 );
}
Пример #3
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 );
}
Пример #4
0
  NewFileChooser::NewFileChooser(QWidget * parent) :
    KDialogBase(KDialogBase::Plain, i18n("New file dialog (title)", "New File"), KDialogBase::Ok|KDialogBase::Cancel,
                KDialogBase::Ok, parent, "New file", true)
  {
      QVBoxLayout* lay = new QVBoxLayout( plainPage(), 5, 5 );

      lay->addWidget( new QLabel( i18n("<b>New File Creation</b>"), plainPage() ) );

      QGridLayout* grid = new QGridLayout(lay, 2, 2, 5 );
      QLabel * l = new QLabel(i18n("&Directory:"), plainPage() );
      grid->addWidget(l, 0, 0);
      m_urlreq = new KURLRequester( plainPage(), "url request" );
      grid->addWidget(m_urlreq, 0, 1);
      l->setBuddy(m_urlreq);
      l = new QLabel(i18n("&File name:"), plainPage() );
      grid->addWidget(l, 1, 0);
      m_filename = new KLineEdit( plainPage() );
      grid->addWidget(m_filename, 1, 1);
      l->setBuddy(m_filename);
//      lay->addWidget( grid );

      QHBoxLayout* hbox = new QHBoxLayout( lay, 5 );
      m_filetypes = new KComboBox( plainPage(), "combo" );
      hbox->addWidget(m_filetypes);
      m_addToProject = new QCheckBox( i18n("Add to project (on checkbox)", "&Add to project"), plainPage(), "addproject" );
      hbox->addWidget(m_addToProject);

      lay->addStretch(20);

      m_filename->setFocus();
      m_addToProject->setChecked( true );

      m_urlreq->setMode((int) KFile::Directory);
      connect( m_filename,  SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotFileNameChanged(const QString & ) ) );
      slotFileNameChanged( m_filename->text() );
  }
SiteSettingsDialog::SiteSettingsDialog(QWidget *parent, const char *name)
    : KDialogBase(KDialogBase::Plain, WStyle_DialogBorder, parent, name, true, i18n("Site settings"), KDialogBase::Ok|KDialogBase::Cancel)
{
  QFrame *frame = plainPage();

  QVBoxLayout* mainLayout = new QVBoxLayout(frame, 0, 0);

  QTabWidget* tab = new QTabWidget(frame);

  QWidget* sitewidget = new QWidget(tab);
  
  QVBoxLayout* siteLayout = new QVBoxLayout(sitewidget, 10, 0);
  
  QGridLayout* grid = new QGridLayout(0, 5, 2, 3, 5);

  QLabel* label = new QLabel(sitewidget);
  label->setText(i18n("Site name:"));
  grid->addWidget(label, 0, 0);

  m_edName = new KLineEdit(sitewidget);
  grid->addWidget(m_edName, 0, 1);

  label = new QLabel(sitewidget);
  label->setText(i18n("URL:"));
  grid->addWidget(label, 1, 0);

  m_edUrl = new KLineEdit(sitewidget);
  m_edUrl->setText(i18n("http://"));
  grid->addWidget(m_edUrl, 1, 1);

  label = new QLabel(sitewidget);
  label->setText(i18n("Remote base dir:"));
  grid->addWidget(label, 2, 0);

  m_edRemoteBaseDir = new KLineEdit(sitewidget);
  grid->addWidget(m_edRemoteBaseDir, 2, 1);

  label = new QLabel(sitewidget);
  label->setText(i18n("Local base dir:"));
  grid->addWidget(label, 3, 0);

  m_edLocalBaseDir = new KURLRequester(sitewidget);
  m_edLocalBaseDir->setMode(KFile::Directory);
  grid->addWidget(m_edLocalBaseDir, 3, 1);
  
  //
  label = new QLabel(sitewidget);
  label->setText(i18n("Default file:"));
  grid->addWidget(label, 4, 0);

  m_edDefaultFile = new KURLRequester(sitewidget);
  grid->addWidget(m_edDefaultFile, 4, 1);

  label = new QLabel(sitewidget);
  label->setText(i18n("Debugger:"));
  grid->addWidget(label, 5, 0);

  m_cbDebuggerName = new QComboBox(sitewidget);
  QValueList<LanguageSettings*> llist = Protoeditor::self()->settings()->languageSettingsList();
  
  QString dlabel;
  QValueList<DebuggerSettingsInterface*> dlist;
  for(QValueList<LanguageSettings*>::iterator it = llist.begin(); it != llist.end(); it++) {
    dlist = (*it)->debuggerSettingsList();
    for(QValueList<DebuggerSettingsInterface*>::iterator dit = dlist.begin(); dit != dlist.end(); dit++)
    {
      dlabel = (*it)->languageName() + " " + (*dit)->debuggerLabel();
      m_debuggerMap[dlabel] = (*dit)->debuggerName();
      m_cbDebuggerName->insertItem(dlabel);
    }    
  }
  
  grid->addWidget(m_cbDebuggerName, 5, 1);
    
  siteLayout->addLayout(grid);
  siteLayout->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding));

  tab->addTab(sitewidget, i18n("Site"));



  m_mappingWidget = new DirMappingWidget(tab);
  tab->addTab(m_mappingWidget, i18n("Mappings"));

  mainLayout->addWidget(tab);  

  enableButtonSeparator(true);

  resize(600, 400);  

  connect(m_edDefaultFile, SIGNAL(openFileDialog(KURLRequester*)),
    this, SLOT(slotOpenFileDialog(KURLRequester*)));  
}
Пример #6
0
AddressEditDialog::AddressEditDialog( const KABC::Address::List &list,
                                      int selected, QWidget *parent,
                                      const char *name )
  : KDialogBase( Plain, i18n( "street/postal", "Edit Address" ), Ok | Cancel, Ok,
                 parent, name, true, true ),
    mPreviousAddress( 0 )
{
  mAddressList = list;

  QWidget *page = plainPage();

  QGridLayout *topLayout = new QGridLayout( page, 8, 2 );
  topLayout->setSpacing( spacingHint() );

  mTypeCombo = new AddressTypeCombo( mAddressList, page );
  topLayout->addMultiCellWidget( mTypeCombo, 0, 0, 0, 1 );

  QLabel *label = new QLabel( i18n( "<streetLabel>:", "%1:" ).arg( KABC::Address::streetLabel() ), page );
  label->setAlignment( Qt::AlignTop | Qt::AlignLeft );
  topLayout->addWidget( label, 1, 0 );
  mStreetTextEdit = new QTextEdit( page );
  mStreetTextEdit->setTextFormat( Qt::PlainText );
  label->setBuddy( mStreetTextEdit );
  topLayout->addWidget( mStreetTextEdit, 1, 1 );

  TabPressEater *eater = new TabPressEater( this );
  mStreetTextEdit->installEventFilter( eater );

  label = new QLabel( i18n( "<postOfficeBoxLabel>:", "%1:" ).arg( KABC::Address::postOfficeBoxLabel() ), page );
  topLayout->addWidget( label, 2 , 0 );
  mPOBoxEdit = new KLineEdit( page );
  label->setBuddy( mPOBoxEdit );
  topLayout->addWidget( mPOBoxEdit, 2, 1 );

  label = new QLabel( i18n( "<localityLabel>:", "%1:" ).arg( KABC::Address::localityLabel() ), page );
  topLayout->addWidget( label, 3, 0 );
  mLocalityEdit = new KLineEdit( page );
  label->setBuddy( mLocalityEdit );
  topLayout->addWidget( mLocalityEdit, 3, 1 );

  label = new QLabel( i18n( "<regionLabel>:", "%1:" ).arg( KABC::Address::regionLabel() ), page );
  topLayout->addWidget( label, 4, 0 );
  mRegionEdit = new KLineEdit( page );
  label->setBuddy( mRegionEdit );
  topLayout->addWidget( mRegionEdit, 4, 1 );

  label = new QLabel( i18n( "<postalCodeLabel>:", "%1:" ).arg( KABC::Address::postalCodeLabel() ), page );
  topLayout->addWidget( label, 5, 0 );
  mPostalCodeEdit = new KLineEdit( page );
  label->setBuddy( mPostalCodeEdit );
  topLayout->addWidget( mPostalCodeEdit, 5, 1 );

  label = new QLabel( i18n( "<countryLabel>:", "%1:" ).arg( KABC::Address::countryLabel() ), page );
  topLayout->addWidget( label, 6, 0 );
  mCountryCombo = new KComboBox( page );
  mCountryCombo->setEditable( true );
  mCountryCombo->setDuplicatesEnabled( false );

#if KDE_IS_VERSION(3,3,0)
  QPushButton *labelButton = new QPushButton( i18n( "Edit Label..." ), page );
  topLayout->addMultiCellWidget( labelButton, 7, 7, 0, 1 );
  connect( labelButton, SIGNAL( clicked() ), SLOT( editLabel() ) );
#endif

  fillCountryCombo();
  label->setBuddy( mCountryCombo );
  topLayout->addWidget( mCountryCombo, 6, 1 );

  mPreferredCheckBox = new QCheckBox( i18n( "street/postal", "This is the preferred address" ), page );
  topLayout->addMultiCellWidget( mPreferredCheckBox, 8, 8, 0, 1 );

  KSeparator *sep = new KSeparator( KSeparator::HLine, page );
  topLayout->addMultiCellWidget( sep, 9, 9, 0, 1 );

  QHBox *buttonBox = new QHBox( page );
  buttonBox->setSpacing( spacingHint() );
  topLayout->addMultiCellWidget( buttonBox, 10, 10, 0, 1 );

  QPushButton *addButton = new QPushButton( i18n( "New..." ), buttonBox );
  connect( addButton, SIGNAL( clicked() ), SLOT( addAddress() ) );

  mRemoveButton = new QPushButton( i18n( "Remove" ), buttonBox );
  connect( mRemoveButton, SIGNAL( clicked() ), SLOT( removeAddress() ) );

  mChangeTypeButton = new QPushButton( i18n( "Change Type..." ), buttonBox );
  connect( mChangeTypeButton, SIGNAL( clicked() ), SLOT( changeType() ) );

  mTypeCombo->updateTypes();
  mTypeCombo->setCurrentItem( selected );

  updateAddressEdits();

  connect( mTypeCombo, SIGNAL( activated( int ) ),
           SLOT( updateAddressEdits() ) );
  connect( mStreetTextEdit, SIGNAL( textChanged() ), SLOT( modified() ) );
  connect( mPOBoxEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
  connect( mLocalityEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
  connect( mRegionEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
  connect( mPostalCodeEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
  connect( mCountryCombo, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
  connect( mPreferredCheckBox, SIGNAL( toggled( bool ) ), SLOT( modified() ) );

  KAcceleratorManager::manage( this );

  mChanged = false;

  bool state = (mAddressList.count() > 0);
  mRemoveButton->setEnabled( state );
  mChangeTypeButton->setEnabled( state );
}
Пример #7
0
  IdentityDialog::IdentityDialog( QWidget * parent, const char * name )
    : KDialogBase( Plain, i18n("Edit Identity"), Ok|Cancel|Help, Ok,
                   parent, name )
  {
    // tmp. vars:
    QWidget * tab;
    QLabel  * label;
    int row;
    QGridLayout * glay;
    QString msg;

    //
    // Tab Widget: General
    //
    row = -1;
    QVBoxLayout * vlay = new QVBoxLayout( plainPage(), 0, spacingHint() );
    QTabWidget *tabWidget = new QTabWidget( plainPage(), "config-identity-tab" );
    vlay->addWidget( tabWidget );

    tab = new QWidget( tabWidget );
    tabWidget->addTab( tab, i18n("&General") );
    glay = new QGridLayout( tab, 4, 2, marginHint(), spacingHint() );
    glay->setRowStretch( 3, 1 );
    glay->setColStretch( 1, 1 );

    // "Name" line edit and label:
    ++row;
    mNameEdit = new KLineEdit( tab );
    glay->addWidget( mNameEdit, row, 1 );
    label = new QLabel( mNameEdit, i18n("&Your name:"), tab );
    glay->addWidget( label, row, 0 );
    msg = i18n("<qt><h3>Your name</h3>"
               "<p>This field should contain your name as you would like "
               "it to appear in the email header that is sent out;</p>"
               "<p>if you leave this blank your real name will not "
               "appear, only the email address.</p></qt>");
    QWhatsThis::add( label, msg );
    QWhatsThis::add( mNameEdit, msg );

    // "Organization" line edit and label:
    ++row;
    mOrganizationEdit = new KLineEdit( tab );
    glay->addWidget( mOrganizationEdit, row, 1 );
    label =  new QLabel( mOrganizationEdit, i18n("Organi&zation:"), tab );
    glay->addWidget( label, row, 0 );
    msg = i18n("<qt><h3>Organization</h3>"
               "<p>This field should have the name of your organization "
               "if you'd like it to be shown in the email header that "
               "is sent out.</p>"
               "<p>It is safe (and normal) to leave this blank.</p></qt>");
    QWhatsThis::add( label, msg );
    QWhatsThis::add( mOrganizationEdit, msg );

    // "Email Address" line edit and label:
    // (row 3: spacer)
    ++row;
    mEmailEdit = new KLineEdit( tab );
    glay->addWidget( mEmailEdit, row, 1 );
    label = new QLabel( mEmailEdit, i18n("&Email address:"), tab );
    glay->addWidget( label, row, 0 );
    msg = i18n("<qt><h3>Email address</h3>"
               "<p>This field should have your full email address.</p>"
               "<p>If you leave this blank, or get it wrong, people "
               "will have trouble replying to you.</p></qt>");
    QWhatsThis::add( label, msg );
    QWhatsThis::add( mEmailEdit, msg );

    //
    // Tab Widget: Cryptography
    //
    row = -1;
    mCryptographyTab = tab = new QWidget( tabWidget );
    tabWidget->addTab( tab, i18n("Cryptograph&y") );
    glay = new QGridLayout( tab, 6, 2, marginHint(), spacingHint() );
    glay->setColStretch( 1, 1 );

    // "OpenPGP Signature Key" requester and label:
    ++row;
    mPGPSigningKeyRequester = new Kleo::SigningKeyRequester( false, Kleo::SigningKeyRequester::OpenPGP, tab );
    mPGPSigningKeyRequester->dialogButton()->setText( i18n("Chang&e...") );
    mPGPSigningKeyRequester->setDialogCaption( i18n("Your OpenPGP Signature Key") );
    msg = i18n("Select the OpenPGP key which should be used to "
	       "digitally sign your messages.");
    mPGPSigningKeyRequester->setDialogMessage( msg );

    msg = i18n("<qt><p>The OpenPGP key you choose here will be used "
               "to digitally sign messages. You can also use GnuPG keys.</p>"
               "<p>You can leave this blank, but KMail will not be able "
               "to digitally sign emails using OpenPGP; "
	       "normal mail functions will not be affected.</p>"
               "<p>You can find out more about keys at <a>http://www.gnupg.org</a></p></qt>");

    label = new QLabel( mPGPSigningKeyRequester, i18n("OpenPGP signing key:"), tab );
    QWhatsThis::add( mPGPSigningKeyRequester, msg );
    QWhatsThis::add( label, msg );

    glay->addWidget( label, row, 0 );
    glay->addWidget( mPGPSigningKeyRequester, row, 1 );


    // "OpenPGP Encryption Key" requester and label:
    ++row;
    mPGPEncryptionKeyRequester = new Kleo::EncryptionKeyRequester( false, Kleo::EncryptionKeyRequester::OpenPGP, tab );
    mPGPEncryptionKeyRequester->dialogButton()->setText( i18n("Chang&e...") );
    mPGPEncryptionKeyRequester->setDialogCaption( i18n("Your OpenPGP Encryption Key") );
    msg = i18n("Select the OpenPGP key which should be used when encrypting "
	       "to yourself and for the \"Attach My Public Key\" "
	       "feature in the composer.");
    mPGPEncryptionKeyRequester->setDialogMessage( msg );

    msg = i18n("<qt><p>The OpenPGP key you choose here will be used "
               "to encrypt messages to yourself and for the \"Attach My Public Key\" "
	       "feature in the composer. You can also use GnuPG keys.</p>"
               "<p>You can leave this blank, but KMail will not be able "
               "to encrypt copies of outgoing messages to you using OpenPGP; "
	       "normal mail functions will not be affected.</p>"
               "<p>You can find out more about keys at <a>http://www.gnupg.org</a></qt>");
    label = new QLabel( mPGPEncryptionKeyRequester, i18n("OpenPGP encryption key:"), tab );
    QWhatsThis::add( mPGPEncryptionKeyRequester, msg );
    QWhatsThis::add( label, msg );

    glay->addWidget( label, row, 0 );
    glay->addWidget( mPGPEncryptionKeyRequester, row, 1 );


    // "S/MIME Signature Key" requester and label:
    ++row;
    mSMIMESigningKeyRequester = new Kleo::SigningKeyRequester( false, Kleo::SigningKeyRequester::SMIME, tab );
    mSMIMESigningKeyRequester->dialogButton()->setText( i18n("Chang&e...") );
    mSMIMESigningKeyRequester->setDialogCaption( i18n("Your S/MIME Signature Certificate") );
    msg = i18n("Select the S/MIME certificate which should be used to "
	       "digitally sign your messages.");
    mSMIMESigningKeyRequester->setDialogMessage( msg );

    msg = i18n("<qt><p>The S/MIME (X.509) certificate you choose here will be used "
               "to digitally sign messages.</p>"
               "<p>You can leave this blank, but KMail will not be able "
               "to digitally sign emails using S/MIME; "
	       "normal mail functions will not be affected.</p></qt>");
    label = new QLabel( mSMIMESigningKeyRequester, i18n("S/MIME signing certificate:"), tab );
    QWhatsThis::add( mSMIMESigningKeyRequester, msg );
    QWhatsThis::add( label, msg );
    glay->addWidget( label, row, 0 );
    glay->addWidget( mSMIMESigningKeyRequester, row, 1 );

    const Kleo::CryptoBackend::Protocol * smimeProtocol
      = Kleo::CryptoBackendFactory::instance()->smime();

    label->setEnabled( smimeProtocol );
    mSMIMESigningKeyRequester->setEnabled( smimeProtocol );

    // "S/MIME Encryption Key" requester and label:
    ++row;
    mSMIMEEncryptionKeyRequester = new Kleo::EncryptionKeyRequester( false, Kleo::EncryptionKeyRequester::SMIME, tab );
    mSMIMEEncryptionKeyRequester->dialogButton()->setText( i18n("Chang&e...") );
    mSMIMEEncryptionKeyRequester->setDialogCaption( i18n("Your S/MIME Encryption Certificate") );
    msg = i18n("Select the S/MIME certificate which should be used when encrypting "
	       "to yourself and for the \"Attach My Certificate\" "
	       "feature in the composer.");
    mSMIMEEncryptionKeyRequester->setDialogMessage( msg );

    msg = i18n("<qt><p>The S/MIME certificate you choose here will be used "
               "to encrypt messages to yourself and for the \"Attach My Certificate\" "
	       "feature in the composer.</p>"
               "<p>You can leave this blank, but KMail will not be able "
               "to encrypt copies of outgoing messages to you using S/MIME; "
	       "normal mail functions will not be affected.</p></qt>");
    label = new QLabel( mSMIMEEncryptionKeyRequester, i18n("S/MIME encryption certificate:"), tab );
    QWhatsThis::add( mSMIMEEncryptionKeyRequester, msg );
    QWhatsThis::add( label, msg );

    glay->addWidget( label, row, 0 );
    glay->addWidget( mSMIMEEncryptionKeyRequester, row, 1 );

    label->setEnabled( smimeProtocol );
    mSMIMEEncryptionKeyRequester->setEnabled( smimeProtocol );

    // "Preferred Crypto Message Format" combobox and label:
    ++row;
    mPreferredCryptoMessageFormat = new QComboBox( false, tab );
    QStringList l;
    l << Kleo::cryptoMessageFormatToLabel( Kleo::AutoFormat )
      << Kleo::cryptoMessageFormatToLabel( Kleo::InlineOpenPGPFormat )
      << Kleo::cryptoMessageFormatToLabel( Kleo::OpenPGPMIMEFormat )
      << Kleo::cryptoMessageFormatToLabel( Kleo::SMIMEFormat )
      << Kleo::cryptoMessageFormatToLabel( Kleo::SMIMEOpaqueFormat );
    mPreferredCryptoMessageFormat->insertStringList( l );
    label = new QLabel( mPreferredCryptoMessageFormat,
			i18n("Preferred crypto message format:"), tab );

    glay->addWidget( label, row, 0 );
    glay->addWidget( mPreferredCryptoMessageFormat, row, 1 );

    ++row;
    glay->setRowStretch( row, 1 );

    //
    // Tab Widget: Advanced
    //
    row = -1;
    tab = new QWidget( tabWidget );
    tabWidget->addTab( tab, i18n("&Advanced") );
    glay = new QGridLayout( tab, 8, 2, marginHint(), spacingHint() );
    // the last (empty) row takes all the remaining space
    glay->setRowStretch( 8-1, 1 );
    glay->setColStretch( 1, 1 );

    // "Reply-To Address" line edit and label:
    ++row;
    mReplyToEdit = new KPIM::AddresseeLineEdit( tab, true, "mReplyToEdit" );
    glay->addWidget( mReplyToEdit, row, 1 );
    label = new QLabel ( mReplyToEdit, i18n("&Reply-To address:"), tab);
    glay->addWidget( label , row, 0 );
    msg = i18n("<qt><h3>Reply-To addresses</h3>"
               "<p>This sets the <tt>Reply-to:</tt> header to contain a "
               "different email address to the normal <tt>From:</tt> "
               "address.</p>"
               "<p>This can be useful when you have a group of people "
               "working together in similar roles. For example, you "
               "might want any emails sent to have your email in the "
               "<tt>From:</tt> field, but any responses to go to "
               "a group address.</p>"
               "<p>If in doubt, leave this field blank.</p></qt>");
    QWhatsThis::add( label, msg );
    QWhatsThis::add( mReplyToEdit, msg );

    // "BCC addresses" line edit and label:
    ++row;
    mBccEdit = new KPIM::AddresseeLineEdit( tab, true, "mBccEdit" );
    glay->addWidget( mBccEdit, row, 1 );
    label = new QLabel( mBccEdit, i18n("&BCC addresses:"), tab );
    glay->addWidget( label, row, 0 );
    msg = i18n("<qt><h3>BCC (Blind Carbon Copy) addresses</h3>"
               "<p>The addresses that you enter here will be added to each "
               "outgoing mail that is sent with this identity. They will not "
               "be visible to other recipients.</p>"
               "<p>This is commonly used to send a copy of each sent message to "
               "another account of yours.</p>"
               "<p>To specify more than one address, use commas to separate "
               "the list of BCC recipients.</p>"
               "<p>If in doubt, leave this field blank.</p></qt>");
    QWhatsThis::add( label, msg );
    QWhatsThis::add( mBccEdit, msg );

    // "Dictionary" combo box and label:
    ++row;
    mDictionaryCombo = new DictionaryComboBox( tab );
    glay->addWidget( mDictionaryCombo, row, 1 );
    glay->addWidget( new QLabel( mDictionaryCombo, i18n("D&ictionary:"), tab ),
                     row, 0 );

    // "Sent-mail Folder" combo box and label:
    ++row;
    mFccCombo = new FolderRequester( tab, 
        kmkernel->getKMMainWidget()->folderTree() );
    mFccCombo->setShowOutbox( false );
    glay->addWidget( mFccCombo, row, 1 );
    glay->addWidget( new QLabel( mFccCombo, i18n("Sent-mail &folder:"), tab ),
                     row, 0 );

    // "Drafts Folder" combo box and label:
    ++row;
    mDraftsCombo = new FolderRequester( tab,
        kmkernel->getKMMainWidget()->folderTree() );
    mDraftsCombo->setShowOutbox( false );
    glay->addWidget( mDraftsCombo, row, 1 );
    glay->addWidget( new QLabel( mDraftsCombo, i18n("&Drafts folder:"), tab ),
                     row, 0 );

    // "Templates Folder" combo box and label:
    ++row;
    mTemplatesCombo = new FolderRequester( tab,
        kmkernel->getKMMainWidget()->folderTree() );
    mTemplatesCombo->setShowOutbox( false );
    glay->addWidget( mTemplatesCombo, row, 1 );
    glay->addWidget( new QLabel( mTemplatesCombo, i18n("&Templates folder:"), tab ),
                     row, 0 );

    // "Special transport" combobox and label:
    ++row;
    mTransportCheck = new QCheckBox( i18n("Special &transport:"), tab );
    glay->addWidget( mTransportCheck, row, 0 );
    mTransportCombo = new QComboBox( true, tab );
    mTransportCombo->setEnabled( false ); // since !mTransportCheck->isChecked()
    mTransportCombo->insertStringList( KMail::TransportManager::transportNames() );
    glay->addWidget( mTransportCombo, row, 1 );
    connect( mTransportCheck, SIGNAL(toggled(bool)),
             mTransportCombo, SLOT(setEnabled(bool)) );

    // the last row is a spacer
    
    // 
    // Tab Widget: Templates
    // 
		tab = new QWidget( tabWidget );
    tabWidget->addTab( tab, i18n("&Templates") );
    vlay = new QVBoxLayout( tab, marginHint(), spacingHint() );
		mCustom = new QCheckBox( i18n("&Use custom message templates"), tab );
		vlay->addWidget( mCustom );
		mWidget = new TemplatesConfiguration( tab , "identity-templates" );
		mWidget->setEnabled( false );
		vlay->addWidget( mWidget );
		QHBoxLayout *btns = new QHBoxLayout( vlay, spacingHint() );
		mCopyGlobal = new KPushButton( i18n("&Copy global templates"), tab );
		mCopyGlobal->setEnabled( false );
		btns->addWidget( mCopyGlobal );
		connect( mCustom, SIGNAL( toggled( bool ) ),
					mWidget, SLOT( setEnabled( bool ) ) );
		connect( mCustom, SIGNAL( toggled( bool ) ),
					mCopyGlobal, SLOT( setEnabled( bool ) ) );
		connect( mCopyGlobal, SIGNAL(clicked()),
					this, SLOT(slotCopyGlobal()) );
		
    //
    // Tab Widget: Signature
    //
    mSignatureConfigurator = new SignatureConfigurator( tabWidget );
    mSignatureConfigurator->layout()->setMargin( KDialog::marginHint() );
    tabWidget->addTab( mSignatureConfigurator, i18n("&Signature") );

    mXFaceConfigurator = new XFaceConfigurator( tabWidget );
    mXFaceConfigurator->layout()->setMargin( KDialog::marginHint() );
    tabWidget->addTab( mXFaceConfigurator, i18n("&Picture") );

    KConfigGroup geometry( KMKernel::config(), "Geometry" );
    if ( geometry.hasKey( "Identity Dialog size" ) )
      resize( geometry.readSizeEntry( "Identity Dialog size" ) );
    mNameEdit->setFocus();

    connect( tabWidget, SIGNAL(currentChanged(QWidget*)),
	     SLOT(slotAboutToShow(QWidget*)) );
  }
Пример #8
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()));
}
Пример #9
0
bool KXSConfigDialog::create()
{
    TQVBoxLayout *topLayout = new TQVBoxLayout(plainPage(), spacingHint());
    TQHBoxLayout *tqlayout = new TQHBoxLayout(topLayout, spacingHint());
    TQVBox *controlLayout = new TQVBox(plainPage());
    controlLayout->setSpacing(spacingHint());
    tqlayout->addWidget(controlLayout);
    ((TQBoxLayout*)controlLayout->tqlayout())->addStrut(120);

    KConfig config(mConfigFile);

    TQString xmlFile = "/doesntexist";
#ifdef XSCREENSAVER_CONFIG_DIR
    xmlFile = XSCREENSAVER_CONFIG_DIR;
#endif

    xmlFile += "/" + mExeName + ".xml";
    if ( TQFile::exists( xmlFile ) ) {
	// We can use the xscreensaver xml config files.
	KXSXml xmlParser(controlLayout);
	xmlParser.parse( xmlFile );
	mConfigItemList = *xmlParser.items();
	TQWidget *spacer = new TQWidget(controlLayout);
	controlLayout->setStretchFactor(spacer, 1 );
	TQString descr = xmlParser.description();
	if ( !descr.isEmpty() ) {
	    descr.replace('\n',' ');
	    descr = descr.simplifyWhiteSpace();
	    TQLabel *l = new TQLabel( i18n( descr.utf8() ), plainPage() );
	    l->tqsetAlignment ( WordBreak );
 	    topLayout->addWidget( l );
 	}
    } else {
        // fall back to KDE's old config files.
	int idx = 0;
	while (true) {
	    TQString group = TQString("Arg%1").tqarg(idx);
	    if (config.hasGroup(group)) {
		config.setGroup(group);
		TQString type = config.readEntry("Type");
		if (type == "Range") {
		    KXSRangeControl *rc = new KXSRangeControl(controlLayout, group, config);
		    mConfigItemList.append(rc);
		} else if (type == "DoubleRange") {
		    KXSDoubleRangeControl *rc =
			new KXSDoubleRangeControl(controlLayout, group, config);
		    mConfigItemList.append(rc);
		} else if (type == "Check") {
		    KXSCheckBoxControl *cc = new KXSCheckBoxControl(controlLayout, group,
			    config);
		    mConfigItemList.append(cc);
		} else if (type == "DropList") {
		    KXSDropListControl *dl = new KXSDropListControl(controlLayout, group,
			    config);
		    mConfigItemList.append(dl);
		}
	    } else {
		break;
	    }
	    idx++;
	}
	if ( idx == 0 )
	    return false;
    }

    TQPtrListIterator<KXSConfigItem> it( mConfigItemList );
    KXSConfigItem *item;
    while ( (item = it.current()) != 0 ) {
	++it;
	item->read( config );
        TQWidget *i = dynamic_cast<TQWidget*>(item);
        if (i) {
            connect( i, TQT_SIGNAL(changed()), TQT_SLOT(slotChanged()) );
        }
    }

    mPreviewProc = new KProcess;
    connect(mPreviewProc, TQT_SIGNAL(processExited(KProcess *)),
	    TQT_SLOT(slotPreviewExited(KProcess *)));

    mPreviewTimer = new TQTimer(this);
    connect(mPreviewTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotNewPreview()));

    mPreview = new TQWidget(plainPage());
    mPreview->setFixedSize(250, 200);
    //  mPreview->setBackgroundMode(TQWidget::NoBackground);
    mPreview->setBackgroundColor(TQt::black);

    tqlayout->add(mPreview);
    show();

    // So that hacks can XSelectInput ButtonPressMask
    XSelectInput(qt_xdisplay(), mPreview->winId(), widgetEventMask );

    slotPreviewExited(0);
    return true;
}
Пример #10
0
popupPublic::popupPublic(QWidget *parent, const char *name,QString sfile,bool filemode,KShortcut goDefaultKey):
KDialogBase( Plain, i18n("Select Public Key"), Details | Ok | Cancel, Ok, parent, name,true)
{

	QWidget *page = plainPage();
	QVBoxLayout *vbox=new QVBoxLayout(page,0,spacingHint());
	vbox->setAutoAdd(true);

	setButtonText(KDialogBase::Details,i18n("Options"));

        if (KGpgSettings::allowCustomEncryptionOptions())
                customOptions=KGpgSettings::customEncryptionOptions();

        KIconLoader *loader = KGlobal::iconLoader();

        keyPair=loader->loadIcon("kgpg_key2",KIcon::Small,20);
        keySingle=loader->loadIcon("kgpg_key1",KIcon::Small,20);
	keyGroup=loader->loadIcon("kgpg_key3",KIcon::Small,20);

        if (filemode) setCaption(i18n("Select Public Key for %1").arg(sfile));
        fmode=filemode;

	QHButtonGroup *hBar=new QHButtonGroup(page);
	//hBar->setFrameStyle(QFrame::NoFrame);
	hBar->setMargin(0);

#if KDE_IS_VERSION( 3, 2, 90 )
	QToolButton *clearSearch = new QToolButton(hBar);
	clearSearch->setTextLabel(i18n("Clear Search"), true);
	clearSearch->setIconSet(SmallIconSet(QApplication::reverseLayout() ? "clear_left"
                                            : "locationbar_erase"));
	(void) new QLabel(i18n("Search: "),hBar);
	KListViewSearchLine* listViewSearch = new KListViewSearchLine(hBar);
	connect(clearSearch, SIGNAL(pressed()), listViewSearch, SLOT(clear()));
#endif

        keysList = new KListView( page );
	 keysList->addColumn(i18n("Name"));
	 keysList->addColumn(i18n("Email"));
	 keysList->addColumn(i18n("ID"));

#if KDE_IS_VERSION( 3, 2, 90 )
	 listViewSearch->setListView(keysList);
#endif

        keysList->setRootIsDecorated(false);
        page->setMinimumSize(540,200);
        keysList->setShowSortIndicator(true);
        keysList->setFullWidth(true);
	keysList->setAllColumnsShowFocus(true);
        keysList->setSelectionModeExt(KListView::Extended);
	keysList->setColumnWidthMode(0,QListView::Manual);
	keysList->setColumnWidthMode(1,QListView::Manual);
	keysList->setColumnWidth(0,210);
	keysList->setColumnWidth(1,210);

        boutonboxoptions=new QButtonGroup(5,Qt::Vertical ,page,0);

	KActionCollection *actcol=new KActionCollection(this);
	(void) new KAction(i18n("&Go to Default Key"),goDefaultKey, this, SLOT(slotGotoDefaultKey()),actcol,"go_default_key");


        CBarmor=new QCheckBox(i18n("ASCII armored encryption"),boutonboxoptions);
        CBuntrusted=new QCheckBox(i18n("Allow encryption with untrusted keys"),boutonboxoptions);
        CBhideid=new QCheckBox(i18n("Hide user id"),boutonboxoptions);
        setDetailsWidget(boutonboxoptions);
        QWhatsThis::add
                (keysList,i18n("<b>Public keys list</b>: select the key that will be used for encryption."));
        QWhatsThis::add
                (CBarmor,i18n("<b>ASCII encryption</b>: makes it possible to open the encrypted file/message in a text editor"));
        QWhatsThis::add
                (CBhideid,i18n("<b>Hide user ID</b>: Do not put the keyid into encrypted packets. This option hides the receiver "
                                "of the message and is a countermeasure against traffic analysis. It may slow down the decryption process because "
                                "all available secret keys are tried."));
        QWhatsThis::add
                (CBuntrusted,i18n("<b>Allow encryption with untrusted keys</b>: when you import a public key, it is usually "
                                  "marked as untrusted and you cannot use it unless you sign it in order to make it 'trusted'. Checking this "
                                  "box enables you to use any key, even if it has not be signed."));

        if (filemode) {
		QWidget *parentBox=new QWidget(boutonboxoptions);
		QHBoxLayout *shredBox=new QHBoxLayout(parentBox,0);
		//shredBox->setFrameStyle(QFrame::NoFrame);
		//shredBox->setMargin(0);
	       CBshred=new QCheckBox(i18n("Shred source file"),parentBox);
                QWhatsThis::add
                        (CBshred,i18n("<b>Shred source file</b>: permanently remove source file. No recovery will be possible"));

		QString shredWhatsThis = i18n( "<qt><b>Shred source file:</b><br /><p>Checking this option will shred (overwrite several times before erasing) the files you have encrypted. This way, it is almost impossible that the source file is recovered.</p><p><b>But you must be aware that this is not secure</b> on all file systems, and that parts of the file may have been saved in a temporary file or in the spooler of your printer if you previously opened it in an editor or tried to print it. Only works on files (not on folders).</p></qt>");
		  KActiveLabel *warn= new KActiveLabel( i18n("<a href=\"whatsthis:%1\">Read this before using shredding</a>").arg(shredWhatsThis),parentBox );
		  shredBox->addWidget(CBshred);
		  shredBox->addWidget(warn);
        }

	        CBsymmetric=new QCheckBox(i18n("Symmetrical encryption"),boutonboxoptions);
                QWhatsThis::add
                        (CBsymmetric,i18n("<b>Symmetrical encryption</b>: encryption does not use keys. You just need to give a password "
                                          "to encrypt/decrypt the file"));
                QObject::connect(CBsymmetric,SIGNAL(toggled(bool)),this,SLOT(isSymetric(bool)));

	CBarmor->setChecked( KGpgSettings::asciiArmor() );
	CBuntrusted->setChecked( KGpgSettings::allowUntrustedKeys() );
	CBhideid->setChecked( KGpgSettings::hideUserID() );
	if (filemode) CBshred->setChecked( KGpgSettings::shredSource() );

        if (KGpgSettings::allowCustomEncryptionOptions()) {
                QHButtonGroup *bGroup = new QHButtonGroup(page);
                //bGroup->setFrameStyle(QFrame::NoFrame);
                (void) new QLabel(i18n("Custom option:"),bGroup);
                KLineEdit *optiontxt=new KLineEdit(bGroup);
                optiontxt->setText(customOptions);
                QWhatsThis::add
                        (optiontxt,i18n("<b>Custom option</b>: for experienced users only, allows you to enter a gpg command line option, like: '--armor'"));
                QObject::connect(optiontxt,SIGNAL(textChanged ( const QString & )),this,SLOT(customOpts(const QString & )));
        }
        QObject::connect(keysList,SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)),this,SLOT(slotOk()));
//	QObject::connect(this,SIGNAL(okClicked()),this,SLOT(crypte()));
        QObject::connect(CBuntrusted,SIGNAL(toggled(bool)),this,SLOT(refresh(bool)));

        char line[200]="\0";
        FILE *fp2;
        seclist=QString::null;

        fp2 = popen("gpg --no-secmem-warning --no-tty --with-colon --list-secret-keys ", "r");
        while ( fgets( line, sizeof(line), fp2))
        {
            QString readLine=QString::fromUtf8(line);
            if (readLine.startsWith("sec")) seclist+=", 0x"+readLine.section(":",4,4).right(8);
        }
        pclose(fp2);

        trusted=CBuntrusted->isChecked();

        refreshkeys();
	setMinimumSize(550,200);
	updateGeometry();
	keysList->setFocus();
	show();
}
Пример #11
0
FindDialog::FindDialog( QWidget* parent ) :
		KDialogBase( KDialogBase::Plain, i18n( "Find Object" ), Ok|Cancel, Ok, parent ),
		vlay(0), hlay(0), SearchList(0), SearchBox(0), filterTypeLabel(0), filterType(0),
		currentitem(0)
{
	QFrame *page = plainPage();

//Create Layout managers
	vlay = new QVBoxLayout( page, 2, 2 );
	hlay = new QHBoxLayout( 2 ); //this mgr will be added to vlay

//Create Widgets
	SearchBox = new QLineEdit( page, "SearchBox" );

	filterTypeLabel = new QLabel( page, "filterTypeLabel" );
	filterTypeLabel->setAlignment( AlignRight );
	filterTypeLabel->setText( i18n( "Filter by type: " ) );

	filterType = new QComboBox( page, "filterType" );
	filterType->setEditable( false );
	filterType->insertItem( i18n ("Any") );
	filterType->insertItem( i18n ("Stars") );
	//	filterType->insertItem( i18n ("Double Stars") );
	filterType->insertItem( i18n ("Solar System") );
	filterType->insertItem( i18n ("Open Clusters") );
	filterType->insertItem( i18n ("Glob. Clusters") );
	filterType->insertItem( i18n ("Gas. Nebulae") );
	filterType->insertItem( i18n ("Plan. Nebulae") );
	//	filterType->insertItem( i18n ("SN Remnants") );
	filterType->insertItem( i18n ("Galaxies") );
	filterType->insertItem( i18n ("Comets") );
	filterType->insertItem( i18n ("Asteroids") );
	filterType->insertItem( i18n ("Constellations") );

	SearchList = new QListBox( page, "SearchList" );
	SearchList->setMinimumWidth( 256 );
	SearchList->setMinimumHeight( 320 );
	SearchList->setVScrollBarMode( QListBox::AlwaysOn );
	SearchList->setHScrollBarMode( QListBox::AlwaysOff );

//Pack Widgets into layout manager
	hlay->addWidget( filterTypeLabel, 0, 0 );
	hlay->addWidget( filterType, 0, 0 );

	vlay->addWidget( SearchBox, 0, 0 );
	vlay->addSpacing( 12 );
	vlay->addWidget( SearchList, 0, 0 );
	vlay->addLayout( hlay, 0 );

	vlay->activate();

// no item currently set
	currentitem = 0;

// no filters set
	Filter = 0;

//Connect signals to slots
//	connect( this, SIGNAL( okClicked() ), this, SLOT( accept() ) ) ;
	connect( this, SIGNAL( cancelClicked() ), this, SLOT( reject() ) );
	connect( SearchBox, SIGNAL( textChanged( const QString & ) ), SLOT( filter() ) );
	connect( SearchBox, SIGNAL( returnPressed() ), SLOT( slotOk() ) );
	connect( filterType, SIGNAL( activated( int ) ), this, SLOT( setFilter( int ) ) );
	connect( SearchList, SIGNAL (selectionChanged  (QListBoxItem *)), SLOT (updateSelection (QListBoxItem *)));
	connect( SearchList, SIGNAL( doubleClicked ( QListBoxItem *  ) ), SLOT( slotOk() ) );

	// first create and paint dialog and then load list
	QTimer::singleShot(0, this, SLOT( init() ));
}
Пример #12
0
void KCardDialog::setupDialog(bool showResizeBox)
{
  QHBoxLayout* topLayout = new QHBoxLayout(plainPage(), spacingHint());
  QVBoxLayout* cardLayout = new QVBoxLayout(topLayout);
  QString path, file;
  QWMatrix m;
  m.scale(0.8,0.8);

  setInitialSize(QSize(600,400));

  if (! (flags() & NoDeck))
  {
    QHBoxLayout* layout = new QHBoxLayout(cardLayout);

    // Deck iconview
    QGroupBox* grp1 = new QGroupBox(1, Horizontal, i18n("Choose Backside"), plainPage());
    layout->addWidget(grp1);

    d->deckIconView = new KIconView(grp1,"decks");
    d->deckIconView->setSpacing(8);
    /*
    deckIconView->setGridX(-1);
    deckIconView->setGridY(50);
    */
    d->deckIconView->setGridX(82);
    d->deckIconView->setGridY(106);
    d->deckIconView->setSelectionMode(QIconView::Single);
    d->deckIconView->setResizeMode(QIconView::Adjust);
    d->deckIconView->setMinimumWidth(360);
    d->deckIconView->setMinimumHeight(170);
    d->deckIconView->setWordWrapIconText(false);
    d->deckIconView->showToolTips();

    // deck select
    QVBoxLayout* l = new QVBoxLayout(layout);
    QGroupBox* grp3 = new QGroupBox(i18n("Backside"), plainPage());
    grp3->setFixedSize(100, 130);
    l->addWidget(grp3, 0, AlignTop|AlignHCenter);
    d->deckLabel = new QLabel(grp3);
    d->deckLabel->setText(i18n("empty"));
    d->deckLabel->setAlignment(AlignHCenter|AlignVCenter);
    d->deckLabel->setGeometry(10, 20, 80, 90);

    d->randomDeck = new QCheckBox(plainPage());
    d->randomDeck->setChecked(false);
    connect(d->randomDeck, SIGNAL(toggled(bool)), this,
            SLOT(slotRandomDeckToggled(bool)));
    d->randomDeck->setText(i18n("Random backside"));
    l->addWidget(d->randomDeck, 0, AlignTop|AlignHCenter);

    d->globalDeck = new QCheckBox(plainPage());
    d->globalDeck->setChecked(false);
    d->globalDeck->setText(i18n("Use global backside"));
    l->addWidget(d->globalDeck, 0, AlignTop|AlignHCenter);

    QPushButton* b = new QPushButton(i18n("Make Backside Global"), plainPage());
    connect(b, SIGNAL(pressed()), this, SLOT(slotSetGlobalDeck()));
    l->addWidget(b, 0, AlignTop|AlignHCenter);

    connect(d->deckIconView,SIGNAL(clicked(QIconViewItem *)),
            this,SLOT(slotDeckClicked(QIconViewItem *)));
  }
Пример #13
0
    _widgets.resize(internal->nbGameTypes(), 0);

    if ( internal->nbGameTypes()>1 ) {
        for (uint i=0; i<internal->nbGameTypes(); i++) {
            QString title = internal->manager.gameTypeLabel(i, Manager::I18N);
            QString icon = internal->manager.gameTypeLabel(i, Manager::Icon);
            QWidget *w = addVBoxPage(title, QString::null,
                                     BarIcon(icon, KIcon::SizeLarge));
            if ( i==internal->gameType() ) createPage(w);
        }

        connect(this, SIGNAL(aboutToShowPage(QWidget *)),
                SLOT(createPage(QWidget *)));
        showPage(internal->gameType());
    } else {
        QVBoxLayout *vbox = new QVBoxLayout(plainPage());
        createPage(plainPage());
        vbox->addWidget(_widgets[0]);
        setMainWidget(_widgets[0]);
    }
}

void HighscoresDialog::createPage(QWidget *page)
{
    internal->hsConfig().readCurrentConfig();
    _current = page;
    bool several = ( internal->nbGameTypes()>1 );
    int i = (several ? pageIndex(page) : 0);
    if ( _widgets[i]==0 ) {
        _widgets[i] = new HighscoresWidget(page);
        connect(_widgets[i], SIGNAL(tabChanged(int)), SLOT(tabChanged(int)));
Пример #14
0
K3bDataPropertiesDialog::K3bDataPropertiesDialog( K3bDataItem* dataItem, QWidget* parent, const char* name )
  : KDialogBase( Plain, i18n("File Properties"), Ok|Cancel, Ok, parent, name, true, false )
{
  m_dataItem = dataItem;

  QLabel* labelMimeType = new QLabel( plainPage() );
  QLabel* extraInfoLabel = new QLabel( plainPage() );
  m_editName = new KLineEdit( plainPage() );
  m_labelType = new QLabel( plainPage() );
  m_labelLocation = new KCutLabel( plainPage() );
  m_labelSize = new QLabel( plainPage() );
  m_labelBlocks = new QLabel( plainPage() );
  m_labelLocalName = new KCutLabel( plainPage() );
  m_labelLocalLocation = new KCutLabel( plainPage() );


  QGridLayout* grid = new QGridLayout( plainPage() );
  grid->setSpacing( spacingHint() );
  grid->setMargin( marginHint() );

  grid->addWidget( labelMimeType, 0, 0 );
  grid->addWidget( m_editName, 0, 2 );
  QFrame* line = new QFrame( plainPage() );
  line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
  grid->addMultiCellWidget( line, 1, 1, 0, 2 );
  grid->addWidget( new QLabel( i18n("Type:"), plainPage() ), 2, 0 );
  grid->addWidget( new QLabel( i18n("Location:"), plainPage() ), 4, 0 );
  grid->addWidget( new QLabel( i18n("Size:"), plainPage() ), 5, 0 );
  grid->addWidget( new QLabel( i18n("Used blocks:"), plainPage() ), 6, 0 );
  grid->addWidget( m_labelType, 2, 2 );
  grid->addWidget( extraInfoLabel, 3, 2 );
  grid->addWidget( m_labelLocation, 4, 2 );
  grid->addWidget( m_labelSize, 5, 2 );
  grid->addWidget( m_labelBlocks, 6, 2 );
  line = new QFrame( plainPage() );
  line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
  grid->addMultiCellWidget( line, 7, 7, 0, 2 );
  QLabel* label1 = new QLabel( i18n("Local name:"), plainPage() );
  grid->addWidget(  label1, 8, 0 );
  QLabel* label2 = new QLabel( i18n("Local location:"), plainPage() );
  grid->addWidget( label2, 9, 0 );
  grid->addWidget( m_labelLocalName, 8, 2 );
  grid->addWidget( m_labelLocalLocation, 9, 2 );

  grid->addColSpacing( 1, 50 );
  grid->setColStretch( 2, 1 );



  if( K3bFileItem* fileItem = dynamic_cast<K3bFileItem*>(dataItem) ) {
    KFileItem kFileItem( KFileItem::Unknown, KFileItem::Unknown, KURL::fromPathOrURL(fileItem->localPath()) );
    labelMimeType->setPixmap( kFileItem.pixmap(KIcon::SizeLarge) );
    if( fileItem->isSymLink() )
      m_labelType->setText( i18n("Link to %1").arg(kFileItem.mimeComment()) );
    else
      m_labelType->setText( kFileItem.mimeComment() );
    m_labelLocalName->setText( kFileItem.name() );
    QString localLocation = kFileItem.url().path(-1);
    localLocation.truncate( localLocation.findRev('/') );
    m_labelLocalLocation->setText( localLocation );
    m_labelSize->setText( KIO::convertSize(dataItem->size()) );
  }
  else if( K3bDirItem* dirItem = dynamic_cast<K3bDirItem*>(dataItem) ) {
    labelMimeType->setPixmap( KMimeType::pixmapForURL( KURL( "/" )) );
    m_labelType->setText( i18n("Directory") );
    label1->hide();
    label2->hide();
    m_labelLocalName->hide();
    m_labelLocalLocation->hide();
    line->hide();
    m_labelSize->setText( KIO::convertSize(dataItem->size()) + "\n(" +
			  i18n("in 1 file", "in %n files", dirItem->numFiles()) + " " +
			  i18n("and 1 directory", "and %n directories", dirItem->numDirs()) + ")" );
  }
  else {
    labelMimeType->setPixmap( DesktopIcon("unknown", KIcon::SizeLarge) );
    m_labelType->setText( i18n("Special file") );
    m_labelLocalName->hide();
    m_labelLocalLocation->hide();
    label1->hide();
    label2->hide();
    line->hide();
    m_labelSize->setText( KIO::convertSize(dataItem->size()) );
  }

  m_editName->setText( dataItem->k3bName() );
  m_labelBlocks->setText( QString::number(dataItem->blocks().lba()) );

  QString location = "/" + dataItem->k3bPath();
  if( location[location.length()-1] == '/' )
    location.truncate( location.length()-1 );
  location.truncate( location.findRev('/') );
  if( location.isEmpty() )
    location = "/";
  m_labelLocation->setText( location );
  extraInfoLabel->setText( QString( "(%1)" ).arg(dataItem->extraInfo()) );
  if( dataItem->extraInfo().isEmpty() )
    extraInfoLabel->hide();

  // OPTIONS
  // /////////////////////////////////////////////////
  QTabWidget* optionTab = new QTabWidget( plainPage() );
  line = new QFrame( plainPage() );
  line->setFrameStyle( QFrame::HLine | QFrame::Sunken );

  grid->addMultiCellWidget( line, 10, 10, 0, 2 );
  grid->addMultiCellWidget( optionTab, 12, 12, 0, 2 );
  grid->setRowStretch( 11, 1 );

  QWidget* hideBox = new QWidget( optionTab );
  QGridLayout* hideBoxGrid = new QGridLayout( hideBox );
  hideBoxGrid->setSpacing( spacingHint() );
  hideBoxGrid->setMargin( marginHint() );
  m_checkHideOnRockRidge = new QCheckBox( i18n("Hide on Rockridge"), hideBox );
  m_checkHideOnJoliet = new QCheckBox( i18n("Hide on Joliet"), hideBox );
  hideBoxGrid->addWidget( m_checkHideOnRockRidge, 0, 0 );
  hideBoxGrid->addWidget( m_checkHideOnJoliet, 1, 0 );
  hideBoxGrid->setRowStretch( 2, 1 );
//   grid->addMultiCellWidget( m_checkHideOnRockRidge, 10, 10, 0, 2 );
//   grid->addMultiCellWidget( m_checkHideOnJoliet, 11, 11, 0, 2 );

  QWidget* sortingBox = new QWidget( optionTab );
  QGridLayout* sortingBoxGrid = new QGridLayout( sortingBox );
  sortingBoxGrid->setSpacing( spacingHint() );
  sortingBoxGrid->setMargin( marginHint() );
  m_editSortWeight = new KLineEdit( sortingBox );
  m_editSortWeight->setValidator( new QIntValidator( -2147483647, 2147483647, m_editSortWeight ) );
  m_editSortWeight->setAlignment( Qt::AlignRight );
  sortingBoxGrid->addWidget( new QLabel( i18n("Sort weight:"), sortingBox ), 0, 0 );
  sortingBoxGrid->addWidget( m_editSortWeight, 0, 1 );
  sortingBoxGrid->setColStretch( 1, 1 );
  sortingBoxGrid->setRowStretch( 1, 1 );

  optionTab->addTab( hideBox, i18n("Settings") );
  optionTab->addTab( sortingBox, i18n("Advanced") );


  m_checkHideOnJoliet->setChecked( dataItem->hideOnJoliet() );
  m_checkHideOnRockRidge->setChecked( dataItem->hideOnRockRidge() );
  m_editSortWeight->setText( QString::number(dataItem->sortWeight()) );

  // if the parent is hidden the value cannot be changed (see K3bDataItem::setHide...)
  if( dataItem->parent() ) {
    m_checkHideOnRockRidge->setDisabled( dataItem->parent()->hideOnRockRidge() );
    m_checkHideOnJoliet->setDisabled( dataItem->parent()->hideOnJoliet() );
  }

  if( !dataItem->isHideable() ) {
    m_checkHideOnJoliet->setDisabled(true);
    m_checkHideOnRockRidge->setDisabled(true);
    //    line->hide();
  }

  QToolTip::add( m_checkHideOnRockRidge, i18n("Hide this file in the RockRidge filesystem") );
  QToolTip::add( m_checkHideOnJoliet, i18n("Hide this file in the Joliet filesystem") );
  QToolTip::add( m_editSortWeight, i18n("Modify the physical sorting") );
  QWhatsThis::add( m_checkHideOnRockRidge, i18n("<p>If this option is checked, the file or directory "
						"(and its entire contents) will be hidden on the "
						"ISO9660 and RockRidge filesystem.</p>"
						"<p>This is useful, for example, for having different README "
						"files for RockRidge and Joliet, which can be managed "
						"by hiding README.joliet on RockRidge and README.rr "
						"on the Joliet filesystem.</p>") );
  QWhatsThis::add( m_checkHideOnJoliet, i18n("<p>If this option is checked, the file or directory "
					     "(and its entire contents) will be hidden on the "
					     "Joliet filesystem.</p>"
					     "<p>This is useful, for example, for having different README "
					     "files for RockRidge and Joliet, which can be managed "
					     "by hiding README.joliet on RockRidge and README.rr "
					     "on the Joliet filesystem.</p>") );
  QWhatsThis::add( m_editSortWeight, i18n("<p>This value modifies the physical sort order of the files "
					  "in the ISO9660 filesystem. A higher weighting means that the "
					  "file will be located closer to the beginning of the image "
					  "(and the disk)."
					  "<p>This option is useful in order to optimize the data layout "
					  "on a CD/DVD."
					  "<p><b>Caution:</b> This does not sort the order of the file "
					  "names that appear in the ISO9660 directory."
					  "It sorts the order in which the file data is "
					  "written to the image.") );

  m_editName->setValidator( K3bValidators::iso9660Validator( false, this ) );
  m_editName->setReadOnly( !dataItem->isRenameable() );
  m_editName->setFocus();
}
Пример #15
0
GeoDialog::GeoDialog( QWidget *parent, const char *name )
    : KDialogBase( Plain, i18n( "Geo Data Input" ), Ok | Cancel, Ok,
                   parent, name, true, true ),
      mUpdateSexagesimalInput( true )
{
    QFrame *page = plainPage();

    QGridLayout *topLayout = new QGridLayout( page, 2, 2, marginHint(),
            spacingHint() );
    topLayout->setRowStretch( 1, 1 );

    mMapWidget = new GeoMapWidget( page );
    topLayout->addMultiCellWidget( mMapWidget, 0, 1, 0, 0 );

    mCityCombo = new KComboBox( page );
    topLayout->addWidget( mCityCombo, 0, 1 );

    QGroupBox *sexagesimalGroup = new QGroupBox( 0, Vertical, i18n( "Sexagesimal" ), page );
    QGridLayout *sexagesimalLayout = new QGridLayout( sexagesimalGroup->layout(),
            2, 5, spacingHint() );

    QLabel *label = new QLabel( i18n( "Latitude:" ), sexagesimalGroup );
    sexagesimalLayout->addWidget( label, 0, 0 );

    mLatDegrees = new QSpinBox( 0, 90, 1, sexagesimalGroup );
    mLatDegrees->setSuffix( "°" );
    mLatDegrees->setWrapping( false );
    label->setBuddy( mLatDegrees );
    sexagesimalLayout->addWidget( mLatDegrees, 0, 1 );

    mLatMinutes = new QSpinBox( 0, 59, 1, sexagesimalGroup );
    mLatMinutes->setSuffix( "'" );
    sexagesimalLayout->addWidget( mLatMinutes, 0, 2 );

    mLatSeconds = new QSpinBox( 0, 59, 1, sexagesimalGroup );
    mLatSeconds->setSuffix( "\"" );
    sexagesimalLayout->addWidget( mLatSeconds, 0, 3 );

    mLatDirection = new KComboBox( sexagesimalGroup );
    mLatDirection->insertItem( i18n( "North" ) );
    mLatDirection->insertItem( i18n( "South" ) );
    sexagesimalLayout->addWidget( mLatDirection, 0, 4 );

    label = new QLabel( i18n( "Longitude:" ), sexagesimalGroup );
    sexagesimalLayout->addWidget( label, 1, 0 );

    mLongDegrees = new QSpinBox( 0, 180, 1, sexagesimalGroup );
    mLongDegrees->setSuffix( "°" );
    label->setBuddy( mLongDegrees );
    sexagesimalLayout->addWidget( mLongDegrees, 1, 1 );

    mLongMinutes = new QSpinBox( 0, 59, 1, sexagesimalGroup );
    mLongMinutes->setSuffix( "'" );
    sexagesimalLayout->addWidget( mLongMinutes, 1, 2 );

    mLongSeconds = new QSpinBox( 0, 59, 1, sexagesimalGroup );
    mLongSeconds->setSuffix( "\"" );
    sexagesimalLayout->addWidget( mLongSeconds, 1, 3 );

    mLongDirection = new KComboBox( sexagesimalGroup );
    mLongDirection->insertItem( i18n( "East" ) );
    mLongDirection->insertItem( i18n( "West" ) );
    sexagesimalLayout->addWidget( mLongDirection, 1, 4 );

    topLayout->addWidget( sexagesimalGroup, 1, 1 );

    loadCityList();

    connect( mMapWidget, SIGNAL( changed() ),
             SLOT( geoMapChanged() ) );
    connect( mCityCombo, SIGNAL( activated( int ) ),
             SLOT( cityInputChanged() ) );
    connect( mLatDegrees, SIGNAL( valueChanged( int ) ),
             SLOT( sexagesimalInputChanged() ) );
    connect( mLatMinutes, SIGNAL( valueChanged( int ) ),
             SLOT( sexagesimalInputChanged() ) );
    connect( mLatSeconds, SIGNAL( valueChanged( int ) ),
             SLOT( sexagesimalInputChanged() ) );
    connect( mLatDirection, SIGNAL( activated( int ) ),
             SLOT( sexagesimalInputChanged() ) );
    connect( mLongDegrees, SIGNAL( valueChanged( int ) ),
             SLOT( sexagesimalInputChanged() ) );
    connect( mLongMinutes, SIGNAL( valueChanged( int ) ),
             SLOT( sexagesimalInputChanged() ) );
    connect( mLongSeconds, SIGNAL( valueChanged( int ) ),
             SLOT( sexagesimalInputChanged() ) );
    connect( mLongDirection, SIGNAL( activated( int ) ),
             SLOT( sexagesimalInputChanged() ) );

    KAcceleratorManager::manage( this );
}
Пример #16
0
    ServerListDialog::ServerListDialog(QWidget *parent, const char *name)
        : KDialogBase(Plain, i18n("Server List"), Ok|Close, Ok, parent, name, false)
    {
        setButtonOK(KGuiItem(i18n("C&onnect"), "connect_creating", i18n("Connect to the server"), i18n("Click here to connect to the selected IRC network and channel.")));

        QFrame* mainWidget = plainPage();

        m_serverList = new ServerListView(mainWidget);
        QWhatsThis::add(m_serverList, i18n("This shows the listof configured IRC networks. An IRC network is a collection of cooperating servers. You need only connect to one of the servers in the network to be connected to the entire IRC network. Once connected, Konversation will automatically join the channels shown. When Konversation is started for the first time, the Freenode network and the <i>#kde</i> channel are already entered for you."));
        m_serverList->setAllColumnsShowFocus(true);
        m_serverList->setRootIsDecorated(true);
        m_serverList->setResizeMode(QListView::AllColumns);
        m_serverList->addColumn(i18n("Network"));
        m_serverList->addColumn(i18n("Identity"));
        m_serverList->addColumn(i18n("Channels"));
        m_serverList->setSelectionModeExt(KListView::Extended);
        m_serverList->setShowSortIndicator(true);
        m_serverList->setSortColumn(0);
        m_serverList->setDragEnabled(true);
        m_serverList->setAcceptDrops(true);
        m_serverList->setDropVisualizer(true);
        m_serverList->header()->setMovingEnabled(false);

        m_addButton = new QPushButton(i18n("&New..."), mainWidget);
        QWhatsThis::add(m_addButton, i18n("Click here to define a new Network, including the server to connect to, and the Channels to automatically join once connected."));
        m_editButton = new QPushButton(i18n("&Edit..."), mainWidget);
        m_delButton = new QPushButton(i18n("&Delete"), mainWidget);

        QCheckBox* showAtStartup = new QCheckBox(i18n("Show at application startup"), mainWidget);
        showAtStartup->setChecked(Preferences::showServerList());
        connect(showAtStartup, SIGNAL(toggled(bool)), this, SLOT(setShowAtStartup(bool)));

        QGridLayout* layout = new QGridLayout(mainWidget, 5, 2, 0, spacingHint());

        layout->addMultiCellWidget(m_serverList, 0, 3, 0, 0);
        layout->addWidget(m_addButton, 0, 1);
        layout->addWidget(m_editButton, 1, 1);
        layout->addWidget(m_delButton, 2, 1);
        layout->addMultiCellWidget(showAtStartup, 4, 4, 0, 1);
        layout->setRowStretch(3, 10);

        m_serverList->setFocus();

        m_selectedItem = false;
        m_selectedServer = ServerSettings("");

        // Load server list
        updateServerList();

        connect(m_serverList, SIGNAL(aboutToMove()), this, SLOT(slotAboutToMove()));
        connect(m_serverList, SIGNAL(moved()), this, SLOT(slotMoved()));
        connect(m_serverList, SIGNAL(doubleClicked(QListViewItem *, const QPoint&, int)), this, SLOT(slotOk()));
        connect(m_serverList, SIGNAL(selectionChanged()), this, SLOT(updateButtons()));
        connect(m_serverList, SIGNAL(expanded(QListViewItem*)), this, SLOT(slotSetGroupExpanded(QListViewItem*)));
        connect(m_serverList, SIGNAL(collapsed(QListViewItem*)), this, SLOT(slotSetGroupCollapsed(QListViewItem*)));
        connect(m_addButton, SIGNAL(clicked()), this, SLOT(slotAdd()));
        connect(m_editButton, SIGNAL(clicked()), this, SLOT(slotEdit()));
        connect(m_delButton, SIGNAL(clicked()), this, SLOT(slotDelete()));

        updateButtons();

        KConfig* config = kapp->config();
        config->setGroup("ServerListDialog");
        QSize newSize = size();
        newSize = config->readSizeEntry("Size", &newSize);
        resize(newSize);

        m_serverList->setSelected(m_serverList->firstChild(), true);
    }
Пример #17
0
SearchDialog::SearchDialog(Calendar *calendar, QWidget *parent)
    : KDialogBase(Plain, i18n("Find Events"), User1 | Close, User1, parent, 0, false, false,
                  KGuiItem(i18n("&Find"), "find"))
{
    mCalendar = calendar;

    QFrame *topFrame = plainPage();
    QVBoxLayout *layout = new QVBoxLayout(topFrame, 0, spacingHint());

    // Search expression
    QHBoxLayout *subLayout = new QHBoxLayout();
    layout->addLayout(subLayout);

    searchEdit = new QLineEdit("*", topFrame);   // Find all events by default
    searchLabel = new QLabel(searchEdit, i18n("&Search for:"), topFrame);
    subLayout->addWidget(searchLabel);
    subLayout->addWidget(searchEdit);
    searchEdit->setFocus();
    connect(searchEdit, SIGNAL(textChanged(const QString &)),
            this, SLOT(searchTextChanged(const QString &)));


    QHButtonGroup *itemsGroup = new QHButtonGroup(i18n("Search For"), topFrame);
    layout->addWidget(itemsGroup);
    mEventsCheck = new QCheckBox(i18n("&Events"), itemsGroup);
    mTodosCheck = new QCheckBox(i18n("To-&dos"), itemsGroup);
    mJournalsCheck = new QCheckBox(i18n("&Journal entries"), itemsGroup);
    mEventsCheck->setChecked(true);
    mTodosCheck->setChecked(true);

    // Date range
    QGroupBox *rangeGroup = new QGroupBox(1, Horizontal, i18n("Date Range"),
                                          topFrame);
    layout->addWidget(rangeGroup);

    QWidget *rangeWidget = new QWidget(rangeGroup);
    QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget, 0, spacingHint());

    mStartDate = new KDateEdit(rangeWidget);
    rangeLayout->addWidget(new QLabel(mStartDate, i18n("Fr&om:"), rangeWidget));
    rangeLayout->addWidget(mStartDate);

    mEndDate = new KDateEdit(rangeWidget);
    rangeLayout->addWidget(new QLabel(mEndDate, i18n("&To:"), rangeWidget));
    mEndDate->setDate(QDate::currentDate().addDays(365));
    rangeLayout->addWidget(mEndDate);

    mInclusiveCheck = new QCheckBox(i18n("E&vents have to be completely included"),
                                    rangeGroup);
    mInclusiveCheck->setChecked(false);
    mIncludeUndatedTodos = new QCheckBox(i18n("Include to-dos &without due date"), rangeGroup);
    mIncludeUndatedTodos->setChecked(true);

    // Subjects to search
    QHButtonGroup *subjectGroup = new QHButtonGroup(i18n("Search In"), topFrame);
    layout->addWidget(subjectGroup);

    mSummaryCheck = new QCheckBox(i18n("Su&mmaries"), subjectGroup);
    mSummaryCheck->setChecked(true);
    mDescriptionCheck = new QCheckBox(i18n("Desc&riptions"), subjectGroup);
    mCategoryCheck = new QCheckBox(i18n("Cate&gories"), subjectGroup);


    // Results list view
    listView = new KOListView(mCalendar, topFrame);
    listView->showDates();
    layout->addWidget(listView);

    if(KOPrefs::instance()->mCompactDialogs)
    {
        KOGlobals::fitDialogToScreen(this, true);
    }

    connect(this, SIGNAL(user1Clicked()), SLOT(doSearch()));

    // Propagate edit and delete event signals from event list view
    connect(listView, SIGNAL(showIncidenceSignal(Incidence *)),
            SIGNAL(showIncidenceSignal(Incidence *)));
    connect(listView, SIGNAL(editIncidenceSignal(Incidence *)),
            SIGNAL(editIncidenceSignal(Incidence *)));
    connect(listView, SIGNAL(deleteIncidenceSignal(Incidence *)),
            SIGNAL(deleteIncidenceSignal(Incidence *)));
}
Пример #18
0
void UMLOperationDialog::setupDialog() {

    int margin = fontMetrics().height();
    QVBoxLayout * topLayout = new QVBoxLayout( plainPage() );

    m_pGenGB = new QGroupBox(i18n("General Properties"), plainPage() );
    QGridLayout * genLayout = new QGridLayout(m_pGenGB, 3, 4 );
    genLayout -> setColStretch(1, 1);
    genLayout -> setColStretch(3, 1);
    genLayout -> addColSpacing(1, 200);
    genLayout -> addColSpacing(3, 200);
    genLayout -> setMargin(margin);
    genLayout -> setSpacing(10);

    Dialog_Utils::makeLabeledEditField( m_pGenGB, genLayout, 0,
                                    m_pNameL, i18n("&Name:"),
                                    m_pNameLE, m_pOperation->getName() );

    m_pRtypeL = new QLabel(i18n("&Type:"), m_pGenGB );
    genLayout -> addWidget(m_pRtypeL, 0, 2);

    m_pRtypeCB = new KComboBox(true, m_pGenGB );
    genLayout -> addWidget(m_pRtypeCB, 0, 3);
    m_pRtypeL->setBuddy(m_pRtypeCB);

    m_pStereoTypeL = new QLabel( i18n("Stereotype name:"), m_pGenGB );
    genLayout -> addWidget(m_pStereoTypeL, 1, 0);
    m_pStereoTypeCB = new KComboBox(true, m_pGenGB );
    genLayout -> addWidget(m_pStereoTypeCB, 1, 1);

    m_pAbstractCB = new QCheckBox( i18n("&Abstract operation"), m_pGenGB );
    m_pAbstractCB -> setChecked( m_pOperation->getAbstract() );
    genLayout -> addWidget( m_pAbstractCB, 2, 0 );
    m_pStaticCB = new QCheckBox( i18n("Classifier &scope (\"static\")"), m_pGenGB );
    m_pStaticCB -> setChecked( m_pOperation->getStatic() );
    genLayout -> addWidget( m_pStaticCB, 2, 1 );
    m_pQueryCB = new QCheckBox( i18n("&Query (\"const\")"), m_pGenGB );
    m_pQueryCB -> setChecked( m_pOperation->getConst() );
    genLayout -> addWidget( m_pQueryCB, 2, 2 );

    topLayout -> addWidget( m_pGenGB );

    m_pScopeBG = new QButtonGroup(i18n("Visibility"), plainPage() );

    QHBoxLayout * scopeLayout = new QHBoxLayout(m_pScopeBG);
    scopeLayout -> setMargin(margin);

    m_pPublicRB = new QRadioButton(i18n("P&ublic"), m_pScopeBG);
    scopeLayout -> addWidget(m_pPublicRB);

    m_pPrivateRB = new QRadioButton(i18n("P&rivate"), m_pScopeBG);
    scopeLayout -> addWidget(m_pPrivateRB);

    m_pProtectedRB = new QRadioButton(i18n("Prot&ected"), m_pScopeBG);
    scopeLayout -> addWidget(m_pProtectedRB);

    m_pImplementationRB = new QRadioButton(i18n("I&mplementation"), m_pScopeBG);
    scopeLayout -> addWidget(m_pImplementationRB);

    topLayout -> addWidget(m_pScopeBG);

    m_pParmsGB = new QGroupBox(i18n("Parameters"), plainPage() );
    QVBoxLayout* parmsLayout = new QVBoxLayout(m_pParmsGB);
    parmsLayout->setMargin(margin);
    parmsLayout->setSpacing(10);

    //horizontal box contains the list box and the move up/down buttons
    QHBoxLayout* parmsHBoxLayout = new QHBoxLayout(parmsLayout);
    m_pParmsLB = new QListBox(m_pParmsGB);
    parmsHBoxLayout->addWidget(m_pParmsLB);

    //the move up/down buttons (another vertical box)
    QVBoxLayout* buttonLayout = new QVBoxLayout( parmsHBoxLayout );
    m_pUpButton = new KArrowButton( m_pParmsGB );
    m_pUpButton->setEnabled( false );
    buttonLayout->addWidget( m_pUpButton );

    m_pDownButton = new KArrowButton( m_pParmsGB, Qt::DownArrow );
    m_pDownButton->setEnabled( false );
    buttonLayout->addWidget( m_pDownButton );

    KButtonBox* buttonBox = new KButtonBox(m_pParmsGB);
    buttonBox->addButton( i18n("Ne&w Parameter..."), this, SLOT(slotNewParameter()) );
    m_pDeleteButton = buttonBox->addButton( i18n("&Delete"), this, SLOT(slotDeleteParameter()) );
    m_pPropertiesButton = buttonBox->addButton( i18n("&Properties"), this,
                          SLOT(slotParameterProperties()) );
    parmsLayout->addWidget(buttonBox);

    topLayout -> addWidget(m_pParmsGB);

    m_pDeleteButton->setEnabled(false);
    m_pPropertiesButton->setEnabled(false);
    m_pUpButton->setEnabled(false);
    m_pDownButton->setEnabled(false);

    // Add "void". We use this for denoting "no return type" independent
    // of the programming language.
    // For example, the Ada generator would interpret the return type
    // "void" as an instruction to generate a procedure instead of a
    // function.
    insertType( "void" );

    m_pRtypeCB->setDuplicatesEnabled(false);//only allow one of each type in box
    m_pRtypeCB->setCompletionMode( KGlobalSettings::CompletionPopup );

    // add template parameters
    UMLClassifier *classifier = dynamic_cast<UMLClassifier*>(m_pOperation->parent());
    if (classifier) {
        UMLClassifierListItemList tmplParams( classifier->getFilteredList(Uml::ot_Template) );
        for (UMLClassifierListItem *li = tmplParams.first(); li; li = tmplParams.next())
            insertType( li->getName() );
    }
    //now add the Classes and Interfaces (both are Concepts)
    UMLClassifierList namesList( m_doc->getConcepts() );
    UMLClassifier* pConcept = 0;
    for(pConcept=namesList.first(); pConcept!=0 ;pConcept=namesList.next()) {
        insertType( pConcept->getFullyQualifiedName() );
    }

    //work out which one to select
    int returnBoxCount = 0;
    bool foundReturnType = false;
    while (returnBoxCount < m_pRtypeCB->count() && foundReturnType == false) {
        QString returnBoxString = m_pRtypeCB->text(returnBoxCount);
        if ( returnBoxString == m_pOperation->getTypeName() ) {
            foundReturnType = true;
            m_pRtypeCB->setCurrentItem(returnBoxCount);
            break;
        }
        returnBoxCount++;
    }

    if (!foundReturnType) {
        insertType( m_pOperation->getTypeName(), 0 );
        m_pRtypeCB->setCurrentItem(0);
    }

    //fill in parm list box
    UMLAttributeList list = m_pOperation->getParmList();
    UMLAttribute * pAtt = 0;
    for (pAtt = list.first(); pAtt; pAtt = list.next())
        m_pParmsLB->insertItem( pAtt->getName() );

    //set scope
    Uml::Visibility scope = m_pOperation -> getVisibility();
    if( scope == Uml::Visibility::Public )
      m_pPublicRB -> setChecked( true );
    else if( scope == Uml::Visibility::Private )
      m_pPrivateRB -> setChecked( true );
    else if( scope == Uml::Visibility::Protected )
      m_pProtectedRB -> setChecked( true );
    else if( scope == Uml::Visibility::Implementation )
      m_pImplementationRB -> setChecked( true );

    // manage stereotypes
    m_pStereoTypeCB -> setDuplicatesEnabled(false);//only allow one of each type in box
    m_pStereoTypeCB->setCompletionMode( KGlobalSettings::CompletionPopup );
    insertStereotype (QString("")); // an empty stereotype is the default
    int defaultStereotype=0;
    bool foundDefaultStereotype = false;
    for (UMLStereotypeListIt it(m_doc->getStereotypes()); it.current(); ++it) {
        if (!foundDefaultStereotype) {
            if ( m_pOperation->getStereotype() == it.current()->getName()) {
                foundDefaultStereotype = true;
            }
            defaultStereotype++;
        }
        insertStereotype (it.current()->getName());
    }
    // lookup for a default stereotype, if the operation doesn't have one
    if (foundDefaultStereotype)
        m_pStereoTypeCB->setCurrentItem(defaultStereotype);
    else
        m_pStereoTypeCB->setCurrentItem(-1);

    //setup parm list box signals
    connect( m_pUpButton, SIGNAL( clicked() ), this, SLOT( slotParameterUp() ) );
    connect( m_pDownButton, SIGNAL( clicked() ), this, SLOT( slotParameterDown() ) );

    connect(m_pParmsLB, SIGNAL(clicked(QListBoxItem*)),
            this, SLOT(slotParamsBoxClicked(QListBoxItem*)));

    connect(m_pParmsLB, SIGNAL(rightButtonPressed(QListBoxItem *, const QPoint &)),
            this, SLOT(slotParmRightButtonPressed(QListBoxItem *, const QPoint &)));

    connect(m_pParmsLB, SIGNAL(rightButtonClicked(QListBoxItem *, const QPoint &)),
            this, SLOT(slotParmRightButtonClicked(QListBoxItem *, const QPoint &)));


    connect(m_pParmsLB, SIGNAL(doubleClicked(QListBoxItem *)),
            this, SLOT(slotParmDoubleClick(QListBoxItem *)));

    m_pNameLE->setFocus();
    connect( m_pNameLE, SIGNAL( textChanged ( const QString & ) ), SLOT( slotNameChanged( const QString & ) ) );
    slotNameChanged(m_pNameLE->text() );

}
Пример #19
0
NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type,
                                bool readOnly, QWidget *parent, const char *name )
  : KDialogBase( Plain, i18n( "Edit Contact Name" ), Help | Ok | Cancel,
                 Ok, parent, name, true ), mAddressee( addr )
{
  QWidget *page = plainPage();
  QGridLayout *layout = new QGridLayout( page );
  layout->setSpacing( spacingHint() );
  layout->addColSpacing( 2, 100 );
  QLabel *label;

  label = new QLabel( i18n( "Honorific prefixes:" ), page );
  layout->addWidget( label, 0, 0 );
  mPrefixCombo = new KComboBox( page );
  mPrefixCombo->setDuplicatesEnabled( false );
  mPrefixCombo->setEditable( true );
  mPrefixCombo->setEnabled( !readOnly );
  label->setBuddy( mPrefixCombo );
  layout->addMultiCellWidget( mPrefixCombo, 0, 0, 1, 2 );

  QWhatsThis::add( mPrefixCombo, i18n( "The predefined honorific prefixes can be extended in the settings dialog." ) );

  label = new QLabel( i18n( "Given name:" ), page );
  layout->addWidget( label, 1, 0 );
  mGivenNameEdit = new KLineEdit( page );
  mGivenNameEdit->setReadOnly( readOnly );
  label->setBuddy( mGivenNameEdit );
  layout->addMultiCellWidget( mGivenNameEdit, 1, 1, 1, 2 );

  label = new QLabel( i18n( "Additional names:" ), page );
  layout->addWidget( label, 2, 0 );
  mAdditionalNameEdit = new KLineEdit( page );
  mAdditionalNameEdit->setReadOnly( readOnly );
  label->setBuddy( mAdditionalNameEdit );
  layout->addMultiCellWidget( mAdditionalNameEdit, 2, 2, 1, 2 );

  label = new QLabel( i18n( "Family names:" ), page );
  layout->addWidget( label, 3, 0 );
  mFamilyNameEdit = new KLineEdit( page );
  mFamilyNameEdit->setReadOnly( readOnly );
  label->setBuddy( mFamilyNameEdit );
  layout->addMultiCellWidget( mFamilyNameEdit, 3, 3, 1, 2 );

  label = new QLabel( i18n( "Honorific suffixes:" ), page );
  layout->addWidget( label, 4, 0 );
  mSuffixCombo = new KComboBox( page );
  mSuffixCombo->setDuplicatesEnabled( false );
  mSuffixCombo->setEditable( true );
  mSuffixCombo->setEnabled( !readOnly );
  label->setBuddy( mSuffixCombo );
  layout->addMultiCellWidget( mSuffixCombo, 4, 4, 1, 2 );

  QWhatsThis::add( mSuffixCombo, i18n( "The predefined honorific suffixes can be extended in the settings dialog." ) );

  label = new QLabel( i18n( "Formatted name:" ), page );
  layout->addWidget( label, 5, 0 );

  mFormattedNameCombo = new KComboBox( page );
  mFormattedNameCombo->setEnabled( !readOnly );
  layout->addWidget( mFormattedNameCombo, 5, 1 );
  connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SLOT( typeChanged( int ) ) );

  mFormattedNameEdit = new KLineEdit( page );
  mFormattedNameEdit->setEnabled( type == CustomName && !readOnly );
  layout->addWidget( mFormattedNameEdit, 5, 2 );

  mParseBox = new QCheckBox( i18n( "Parse name automatically" ), page );
  mParseBox->setEnabled( !readOnly );
  connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( parseBoxChanged(bool) ) );
  connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( modified() ) );
  layout->addMultiCellWidget( mParseBox, 6, 6, 0, 1 );

  // Fill in the values
  mFamilyNameEdit->setText( addr.familyName() );
  mGivenNameEdit->setText( addr.givenName() );
  mAdditionalNameEdit->setText( addr.additionalName() );
  mFormattedNameEdit->setText( addr.formattedName() );

  // Prefix and suffix combos
  KConfig config( "kabcrc" );
  config.setGroup( "General" );

  QStringList sTitle;
  sTitle += "";
  sTitle += i18n( "Dr." );
  sTitle += i18n( "Miss" );
  sTitle += i18n( "Mr." );
  sTitle += i18n( "Mrs." );
  sTitle += i18n( "Ms." );
  sTitle += i18n( "Prof." );
  sTitle += config.readListEntry( "Prefixes" );
  sTitle.sort();

  QStringList sSuffix;
  sSuffix += "";
  sSuffix += i18n( "I" );
  sSuffix += i18n( "II" );
  sSuffix += i18n( "III" );
  sSuffix += i18n( "Jr." );
  sSuffix += i18n( "Sr." );
  sSuffix += config.readListEntry( "Suffixes" );
  sSuffix.sort();

  mPrefixCombo->insertStringList( sTitle );
  mSuffixCombo->insertStringList( sSuffix );

  mPrefixCombo->setCurrentText( addr.prefix() );
  mSuffixCombo->setCurrentText( addr.suffix() );

  mAddresseeConfig.setAddressee( addr );
  mParseBox->setChecked( mAddresseeConfig.automaticNameParsing() );

  KAcceleratorManager::manage( this );

  connect( mPrefixCombo, SIGNAL( textChanged( const QString& ) ),
           this, SLOT( modified() ) );
  connect( mGivenNameEdit, SIGNAL( textChanged( const QString& ) ),
           this, SLOT( modified() ) );
  connect( mAdditionalNameEdit, SIGNAL( textChanged( const QString& ) ),
           this, SLOT( modified() ) );
  connect( mFamilyNameEdit, SIGNAL( textChanged( const QString& ) ),
           this, SLOT( modified() ) );
  connect( mSuffixCombo, SIGNAL( textChanged( const QString& ) ),
           this, SLOT( modified() ) );
  connect( mFormattedNameCombo, SIGNAL( activated( int ) ),
           this, SLOT( modified() ) );
  connect( mFormattedNameCombo, SIGNAL( activated( int ) ),
           this, SLOT( formattedNameTypeChanged() ) );
  connect( mFormattedNameEdit, SIGNAL( textChanged( const QString& ) ),
           this, SLOT( modified() ) );
  connect( mFormattedNameEdit, SIGNAL( textChanged( const QString& ) ),
           this, SLOT( formattedNameChanged( const QString& ) ) );

  initTypeCombo();
  mFormattedNameCombo->setCurrentItem( type );
  mPrefixCombo->lineEdit()->setFocus();
  mChanged = false;
}
Пример #20
0
PlanetViewer::PlanetViewer(QWidget *parent, const char *name)
    : KDialogBase( KDialogBase::Plain, i18n("Solar System Viewer"), Close, Close, parent, name ), PCat( ((KStars*)parent)->data() ), scale(1.0), isClockRunning(false), tmr(this)
{
    QFrame *page = plainPage();
    QVBoxLayout *vlay = new QVBoxLayout( page, 0, spacingHint() );
    pw = new PlanetViewerUI( page );
    pw->map->setLimits( -48.0, 48.0, -48.0, 48.0 );
    pw->map->setXAxisLabel( i18n( "axis label for x-coordinate of solar system viewer.  AU means astronomical unit.", "X-position (AU)" ) );
    pw->map->setYAxisLabel( i18n( "axis label for y-coordinate of solar system viewer.  AU means astronomical unit.", "Y-position (AU)" ) );

    pw->timeStep->setDaysOnly( true );
    pw->timeStep->tsbox()->setValue( 1 ); //start with 1-day timestep

    pw->RunButton->setPixmap( KGlobal::iconLoader()->loadIcon( "1rightarrow", KIcon::Toolbar ) );
    pw->dateBox->setDate( ((KStars*)parent)->data()->lt().date() );

    vlay->addWidget( pw );
    resize( 500, 500 );
    pw->map->QWidget::setFocus(); //give keyboard focus to the plot widget for key and mouse events

    pName[0] = "Mercury";
    pColor[0] = "SlateBlue1";
    pName[1] = "Venus";
    pColor[1] = "LightGreen";
    pName[2] = "Earth";
    pColor[2] = "Blue";
    pName[3] = "Mars";
    pColor[3] = "Red";
    pName[4] = "Jupiter";
    pColor[4] = "Goldenrod";
    pName[5] = "Saturn";
    pColor[5] = "LightYellow2";
    pName[6] = "Uranus";
    pColor[6] = "LightSeaGreen";
    pName[7] = "Neptune";
    pColor[7] = "SkyBlue";
    pName[8] = "Pluto";
    pColor[8] = "gray";

    setCenterPlanet("");

    PCat.initialize();
    ut = ((KStars*)parent)->data()->ut();
    KSNumbers num( ut.djd() );
    PCat.findPosition( &num, 0, 0 ); //NULL args: don't need geocent. coords.

    for ( uint i=0; i<9; ++i )
        LastUpdate[i] = int( ut.date().jd() );

    //The planets' update intervals are 0.25% of one period:
    UpdateInterval[0] = 0;
    UpdateInterval[1] = 0;
    UpdateInterval[2] = 0;
    UpdateInterval[3] = 1;
    UpdateInterval[4] = 5;
    UpdateInterval[5] = 13;
    UpdateInterval[6] = 38;
    UpdateInterval[7] = 75;
    UpdateInterval[8] = 113;

    QTimer::singleShot( 0, this, SLOT( initPlotObjects() ) );

    connect( &tmr, SIGNAL( timeout() ), SLOT( tick() ) );
    connect( pw->timeStep, SIGNAL( scaleChanged(float) ), SLOT( setTimeScale(float) ) );
    connect( pw->RunButton, SIGNAL( clicked() ), SLOT( slotRunClock() ) );
    connect( pw->dateBox, SIGNAL( valueChanged( const ExtDate & ) ), SLOT( slotChangeDate( const ExtDate & ) ) );
    connect( pw->TodayButton, SIGNAL( clicked() ), SLOT( slotToday() ) );
}
Пример #21
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 );
  }
Пример #22
0
GroupEditor::GroupEditor(ConfigEstateGroupList *newList, QWidget *parent)
	: KDialogBase(KDialogBase::Plain, i18n("Group Editor"), Ok|Apply|Cancel, Ok, parent, "Group Editor", false, true), mylist(*newList)
{
	setWFlags(WDestructiveClose);
	list = newList;

	QFrame *page = plainPage();
	QHBoxLayout *hlayout = new QHBoxLayout(page, marginHint(), spacingHint());

	groups = new KListBox(page);
	hlayout->addWidget(groups);
	connect(groups, SIGNAL(highlighted(QListBoxItem *)), this, SLOT(updateSettings(QListBoxItem *)));
	QStringList newgroups;
	for (ConfigEstateGroupList::Iterator it = list->begin(); it != list->end(); ++it)
		newgroups.append((*it).name());
	groups->insertStringList(newgroups);
	connect(groups, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));

	QVBoxLayout *vlayout = new QVBoxLayout(hlayout, spacingHint());
	colorGroupBox = new QVGroupBox(i18n("&Colors"), page);
	vlayout->addWidget(colorGroupBox);

	(void) new QLabel(i18n("Foreground:"), colorGroupBox);
	fgButton = new KColorButton(colorGroupBox, "Foreground Button");
	connect(fgButton, SIGNAL(changed(const QColor &)), this, SLOT(fgChanged(const QColor &)));
	connect(fgButton, SIGNAL(changed(const QColor &)), this, SIGNAL(changed()));

	(void) new QLabel(i18n("Background:"), colorGroupBox);
	bgButton = new KColorButton(colorGroupBox, "Background Button");
	connect(bgButton, SIGNAL(changed(const QColor &)), this, SLOT(bgChanged(const QColor &)));
	connect(bgButton, SIGNAL(changed(const QColor &)), this, SIGNAL(changed()));

	pricesGroupBox = new QVGroupBox(i18n("&Prices"), page);
	vlayout->addWidget(pricesGroupBox);

	pricesWidget = new QWidget(pricesGroupBox);
	QGridLayout *pricesLayout = new QGridLayout(pricesWidget, 2, 2, 0, spacingHint());
	pricesLayout->addWidget(new QLabel(i18n("House price:"), pricesWidget), 0, 0);
	pricesLayout->addWidget(housePrice = new QSpinBox(0, 3000, 25, pricesWidget), 0, 1);
	housePrice->setSpecialValueText(i18n("None"));
	housePrice->setSuffix(i18n("$"));
	connect(housePrice, SIGNAL(valueChanged(int)), this, SLOT(housePriceChanged(int)));

	pricesLayout->addWidget(new QLabel(i18n("Global price:"), pricesWidget), 1, 0);
	pricesLayout->addWidget(globalPrice = new QSpinBox(0, 3000, 25, pricesWidget), 1, 1);
	globalPrice->setSpecialValueText(i18n("None"));
	globalPrice->setSuffix(i18n("$"));
	connect(globalPrice, SIGNAL(valueChanged(int)), this, SLOT(globalPriceChanged(int)));

	dynamicGroupBox = new QVGroupBox(i18n("&Dynamic Rent"), page);
	vlayout->addWidget(dynamicGroupBox);

	mathWidget = new QWidget(dynamicGroupBox);
	QGridLayout *mathLayout = new QGridLayout(mathWidget, 2, 2, 0, spacingHint());
	mathLayout->addWidget(new QLabel(i18n("Add rent variable:"), mathWidget), 0, 0);
	mathLayout->addWidget(new QLabel(i18n("Expression:"), mathWidget), 1, 0);

	QComboBox *rentVarCombo = new QComboBox(mathWidget);
	QStringList vars;
	vars << "DICE";
	vars << "HOUSES";
	vars << "GROUPOWNED";
	rentVarCombo->insertStringList(vars);
	mathLayout->addWidget(rentVarCombo, 0, 1);

	rentMathEdit = new KLineEdit(mathWidget);
	connect(rentMathEdit, SIGNAL(textChanged(const QString &)), this, SLOT(rentMathChanged(const QString &)));
	connect(rentVarCombo, SIGNAL(activated(const QString &)), rentMathEdit, SLOT(insert(const QString &)));
	mathLayout->addWidget(rentMathEdit, 1, 1);

	QHBoxLayout *buttonlayout = new QHBoxLayout(vlayout, spacingHint());
	KPushButton *addB = new KPushButton(i18n("&Add..."), page);
	buttonlayout->addWidget(addB);
	connect(addB, SIGNAL(clicked()), this, SLOT(add()));

	removeB = new KPushButton(i18n("&Remove"), page);
	buttonlayout->addWidget(removeB);
	connect(removeB, SIGNAL(clicked()), this, SLOT(remove()));

	selectionChanged();
}