Пример #1
0
//BEGIN class PinMapEditor
PinMapEditor::PinMapEditor( PinMapping * pinMapping, MicroInfo * picInfo, QWidget * parent, const char * name )
	: //KDialog( parent, name, true, i18n("Pin Map Editor"), Ok|Apply|Cancel, KDialog::Ok, true )
	  KDialog( parent ) //, name, true, i18n("Pin Map Editor"), Ok|Apply|Cancel, KDialog::Ok, true )
{
    setName(name);
    setModal(true);
    setCaption(i18n("Pin Map Editor"));
    setButtons(KDialog::Ok | KDialog::Apply | KDialog::Cancel);
    setDefaultButton(KDialog::Ok);
    showButtonSeparator(true);

	m_pPinMapping = pinMapping;
	
	m_pPinMapDocument = new PinMapDocument();
	
	Q3Accel * accel = new Q3Accel( this );
	accel->connectItem( accel->insertItem( Qt::Key_Delete ),
						m_pPinMapDocument,
						SLOT(deleteSelection()) );
	
	accel->connectItem( accel->insertItem( KStandardShortcut::selectAll().primary() ),
						m_pPinMapDocument,
						SLOT(selectAll()) );
	
	accel->connectItem( accel->insertItem( KStandardShortcut::undo().primary() ),
						m_pPinMapDocument,
						SLOT(undo()) );
	
	accel->connectItem( accel->insertItem( KStandardShortcut::redo().primary() ),
						m_pPinMapDocument,
						SLOT(redo()) );
	
	
	QFrame * f = new QFrame(this);
	f->setMinimumWidth( 480 );
	f->setMinimumHeight( 480 );
	
	f->setFrameShape( QFrame::Box );
	f->setFrameShadow( QFrame::Plain );
	QVBoxLayout * fLayout = new QVBoxLayout( f, 1, 0, "fLayout" );

	ViewContainer * vc = new ViewContainer( 0, f );
	fLayout->addWidget( vc );
	
	m_pPinMapView = static_cast<PinMapView*>(m_pPinMapDocument->createView( vc, 0 ));
	
	//qApp->processEvents(); // 2015.07.07 - do not process events, if it is not urgently needed; might generate crashes?
	
	m_pPinMapDocument->init( *m_pPinMapping, picInfo );
	
    showButtonSeparator( false );
	// enableButtonSeparator( false );

	setMainWidget(f);
}
Пример #2
0
TransferSettingsDialog::TransferSettingsDialog(QWidget *parent, TransferHandler *transfer)
  : KDialog(parent),
    m_transfer(transfer)
{
    setCaption(i18n("Transfer Settings for %1", m_transfer->source().fileName()));
    showButtonSeparator(true);
    QWidget *widget = new QWidget(this);
    Ui::TransferSettingsDialog ui;
    ui.setupUi(widget);
    setMainWidget(widget);
    m_downloadSpin = ui.downloadSpin;
    m_downloadSpin->setValue(m_transfer->downloadLimit(Transfer::VisibleSpeedLimit));
    m_uploadSpin = ui.uploadSpin;
    m_uploadSpin->setValue(m_transfer->uploadLimit(Transfer::VisibleSpeedLimit));
    m_ratioSpin = ui.ratioSpin;
    m_ratioSpin->setValue(m_transfer->maximumShareRatio());
    m_downloadCheck = ui.downloadCheck;
    m_downloadCheck->setChecked(m_downloadSpin->value() != 0);
    m_uploadCheck = ui.uploadCheck;
    m_uploadCheck->setChecked(m_uploadSpin->value() != 0);
    m_ratioCheck = ui.ratioCheck;
    m_ratioCheck->setChecked(m_ratioSpin->value() != 0);

    if (!transfer->supportsSpeedLimits())
    {
        m_downloadCheck->setDisabled(true);
        m_downloadSpin->setDisabled(true);
        m_uploadCheck->setDisabled(true);
        m_uploadSpin->setDisabled(true);
        m_ratioCheck->setDisabled(true);
        m_ratioSpin->setDisabled(true);
    }
    connect(this, SIGNAL(accepted()), SLOT(save()));
}
Пример #3
0
TagGuesserConfigDlg::TagGuesserConfigDlg(QWidget *parent, const char *name)
    : KDialog(parent)
{
    setObjectName( QLatin1String( name ) );
    setModal(true);
    setCaption(i18n("Tag Guesser Configuration"));
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);
    showButtonSeparator(true);

    m_child = new TagGuesserConfigDlgWidget(this);
    setMainWidget(m_child);

    m_child->bMoveUp->setIcon(KIcon( QLatin1String( "arrow-up" )));
    m_child->bMoveDown->setIcon(KIcon( QLatin1String( "arrow-down" )));

    m_tagSchemeModel = new QStringListModel(m_child->lvSchemes);
    m_child->lvSchemes->setModel(m_tagSchemeModel);
    m_child->lvSchemes->setHeaderHidden(true);
    m_tagSchemeModel->setStringList(TagGuesser::schemeStrings());

    connect(m_child->lvSchemes, SIGNAL(clicked(QModelIndex)), this, SLOT(slotCurrentChanged(QModelIndex)));
    connect(m_child->bMoveUp, SIGNAL(clicked()), this, SLOT(slotMoveUpClicked()));
    connect(m_child->bMoveDown, SIGNAL(clicked()), this, SLOT(slotMoveDownClicked()));
    connect(m_child->bAdd, SIGNAL(clicked()), this, SLOT(slotAddClicked()));
    connect(m_child->bModify, SIGNAL(clicked()), this, SLOT(slotModifyClicked()));
    connect(m_child->bRemove, SIGNAL(clicked()), this, SLOT(slotRemoveClicked()));

    resize( 400, 300 );
}
Пример #4
0
void SmsDialog::initUI()
{
  setCaption( i18n( "SMS text" ) );
  setButtons( Ok | Cancel );
  setDefaultButton( Ok );
  showButtonSeparator( true );

  QWidget *page = new QWidget( this );
  setMainWidget( page );
  page->setFixedWidth( 300 );

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


  QLabel *label = new QLabel( i18n( "Please insert SMS text for an SMS to the following number: %1", mNumber ), page );
  topLayout->addWidget( label );
  label->setWordWrap( true );

  mSmsTextEdit = new KTextEdit( page );
  mSmsTextEdit->setAcceptRichText( false );
  label->setBuddy( mSmsTextEdit );
  topLayout->addWidget( mSmsTextEdit );

  connect( mSmsTextEdit, SIGNAL(textChanged()), SLOT(updateCounter()) );

  mLengthLabel = new QLabel( QLatin1String( "-" ) , page );
  topLayout->addWidget( mLengthLabel );

  mSmsTextEdit->setFocus();
  updateCounter();
}
Пример #5
0
DeleteDialog::DeleteDialog( QWidget *parent, const char *name )
    : KDialog( parent ),
    m_trashGuiItem(i18n("&Send to Trash"), "user-trash-full")
{
//Swallow, Qt::WStyle_DialogBorder, parent, name,
        //true /* modal */, i18n("About to delete selected files"),
       // Ok | Cancel, Cancel /* Default */, true /* separator */
    setObjectName( name );
    setCaption( i18n("About to delete selected files") );
    setModal( true );
    setButtons( Ok | Cancel );
    setDefaultButton( Cancel );
    showButtonSeparator( true );

    m_widget = new DeleteWidget(this);
    m_widget->setObjectName("delete_dialog_widget");
    setMainWidget(m_widget);

    m_widget->setMinimumSize(400, 300);
    setMinimumSize(410, 326);
    adjustSize();

    slotShouldDelete(shouldDelete());
    connect(m_widget->ddShouldDelete, SIGNAL(toggled(bool)), SLOT(slotShouldDelete(bool)));

}
Пример #6
0
GroupSettingsDialog::GroupSettingsDialog(QWidget *parent, TransferGroupHandler *group)
  : KGetSaveSizeDialog("GroupSettingsDialog", parent),
    m_group(group)
{
    setCaption(i18n("Group Settings for %1", group->name()));
    showButtonSeparator(true);

    QWidget *widget = new QWidget(this);
    ui.setupUi(widget);

    setMainWidget(widget);

    ui.downloadBox->setValue(group->downloadLimit(Transfer::VisibleSpeedLimit));
    ui.uploadBox->setValue(group->uploadLimit(Transfer::VisibleSpeedLimit));

    ui.defaultFolderRequester->setMode(KFile::Directory);
    QString path = group->defaultFolder();
    ui.defaultFolderRequester->setUrl(path);
    ui.defaultFolderRequester->setStartDir(KUrl(KGet::generalDestDir(true)));

    ui.regExpEdit->setText(group->regExp().pattern());

#ifdef HAVE_NEPOMUK
    m_tagWidget = new Nepomuk2::TagWidget(this);
    m_tagWidget->setSelectedTags(group->tags());
    m_tagWidget->setModeFlags(Nepomuk2::TagWidget::MiniMode);
    ui.nepomukWidget->layout()->addWidget(m_tagWidget);
#else
    ui.nepomukWidget->hide();
#endif

    connect(this, SIGNAL(accepted()), SLOT(save()));
}
Пример #7
0
TreeImportDialog::TreeImportDialog(QWidget *parent)
        : KDialog(parent)
{
    QWidget *page = new QWidget(this);
    QVBoxLayout *topLayout = new QVBoxLayout(page);

    // KDialog options
    setCaption(i18n("Import Hierarchy"));
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);
    setObjectName("ImportHeirachy");
    setModal(true);
    showButtonSeparator(false);

    m_choices = new QGroupBox(i18n("How to Import the Notes?"), page);
    m_choiceLayout = new QVBoxLayout();
    m_choices->setLayout(m_choiceLayout);

    m_hierarchy_choice = new QRadioButton(i18n("&Keep original hierarchy (all notes in separate baskets)"), m_choices);
    m_separate_baskets_choice = new QRadioButton(i18n("&First level notes in separate baskets"),            m_choices);
    m_one_basket_choice = new QRadioButton(i18n("&All notes in one basket"),                                m_choices);

    m_hierarchy_choice->setChecked(true);
    m_choiceLayout->addWidget(m_hierarchy_choice);
    m_choiceLayout->addWidget(m_separate_baskets_choice);
    m_choiceLayout->addWidget(m_one_basket_choice);

    topLayout->addWidget(m_choices);
    topLayout->addStretch(10);

    setMainWidget(page);
}
Пример #8
0
ValidatorsDialog::ValidatorsDialog(QWidget *parent )
  : KPageDialog( parent)
{
  setButtons(Ok|Cancel);
  setDefaultButton(Ok);
  setModal(false);
  showButtonSeparator(true);
  setCaption(i18nc("@title:window", "Configure Validator Plugin"));
  setMinimumWidth(400);

#ifdef HAVE_TIDY
  QWidget* internalConfiguration = new QWidget();
  m_internalUi.setupUi(internalConfiguration);
  internalConfiguration->layout()->setMargin(0);
  KPageWidgetItem *internalConfigurationItem = addPage(internalConfiguration, i18n("Internal Validation"));
  internalConfigurationItem->setIcon(KIcon("validators"));
#endif

  QWidget* remoteConfiguration = new QWidget();
  m_remoteUi.setupUi(remoteConfiguration);
  remoteConfiguration->layout()->setMargin(0);
  KPageWidgetItem *remoteConfigurationItem = addPage(remoteConfiguration, i18n("Remote Validation"));
  remoteConfigurationItem->setIcon(KIcon("validators"));

  connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
  connect(this,SIGNAL(cancelClicked()),this,SLOT(slotCancel()));
  load();
}
Пример #9
0
TrackPickerDialog::TrackPickerDialog(const QString &name,
                                     const KTRMResultList &results,
                                     QWidget *parent) :
    KDialog(parent)
{
    setObjectName(name.toAscii());
    setModal(true);
    setCaption(i18n("Internet Tag Guesser"));
    setButtons(Ok | Cancel);
    showButtonSeparator(true);

    m_base = new TrackPickerDialogBase(this);
    setMainWidget(m_base);

    m_base->fileLabel->setText(name);
    m_base->trackList->setSorting(-1);

    for(KTRMResultList::ConstIterator it = results.begin(); it != results.end(); ++it)
        new TrackPickerItem(m_base->trackList, *it);

    m_base->trackList->setSelected(m_base->trackList->firstChild(), true);

    connect(m_base->trackList, SIGNAL(doubleClicked(Q3ListViewItem*,QPoint,int)),
            this, SLOT(accept()));

    setMinimumWidth(qMax(400, width()));
}
Пример #10
0
KomparePrefDlg::KomparePrefDlg( ViewSettings* viewSets, DiffSettings* diffSets ) : KPageDialog( 0 )
{
	setFaceType( KPageDialog::List );
	setWindowTitle( i18n( "Preferences" ) );
	setButtons( Help|Default|Ok|Apply|Cancel );
	setDefaultButton( Ok );
	setModal( true );
	showButtonSeparator( true );

	// ok i need some stuff in that pref dlg...
	//setIconListAllVisible(true);

	m_viewPage = new ViewPage();
	KPageWidgetItem *item = addPage( m_viewPage, i18n( "View" ) );
	item->setIcon( KIcon( "preferences-desktop-theme" ) );
	item->setHeader( i18n( "View Settings" ) );
	m_viewPage->setSettings( viewSets );

	m_diffPage = new DiffPage();
	item = addPage( m_diffPage, i18n( "Diff" ) );
	item->setIcon( KIcon( "text-x-patch" ) );
	item->setHeader( i18n( "Diff Settings" ) );
	m_diffPage->setSettings( diffSets );

//	frame = addVBoxPage( i18n( "" ), i18n( "" ), UserIcon( "" ) );

	connect( this, SIGNAL(defaultClicked()), SLOT(slotDefault()) );
	connect( this, SIGNAL(helpClicked()), SLOT(slotHelp()) );
	connect( this, SIGNAL(applyClicked()), SLOT(slotApply()) );
	connect( this, SIGNAL(okClicked()), SLOT(slotOk()) );
	connect( this, SIGNAL(cancelClicked()), SLOT(slotCancel()) );

	adjustSize();
}
Пример #11
0
AccountseditorConfigDialog::AccountseditorConfigDialog( ViewBase *view, AccountTreeView *treeview, QWidget *p)
    : KPageDialog(p),
      m_view( view ),
      m_treeview( treeview )
{
    setCaption( i18n("Settings") );
    setButtons( Ok|Cancel );
    setDefaultButton( Ok );
    showButtonSeparator( true );

    QTabWidget *tab = new QTabWidget();

    QWidget *w = ViewBase::createPageLayoutWidget( view );
    tab->addTab( w, w->windowTitle() );
    m_pagelayout = w->findChild<KoPageLayoutWidget*>();
    Q_ASSERT( m_pagelayout );

    m_headerfooter = ViewBase::createHeaderFooterWidget( view );
    m_headerfooter->setOptions( view->printingOptions() );
    tab->addTab( m_headerfooter, m_headerfooter->windowTitle() );

    KPageWidgetItem *page = addPage( tab, i18n( "Printing" ) );
    page->setHeader( i18n( "Printing Options" ) );

    connect( this, SIGNAL(okClicked()), this, SLOT(slotOk()));
}
AddFieldDialog::AddFieldDialog( QWidget *parent )
  : KDialog( parent )
{
  setCaption( i18n( "Add Field" ) );
  setButtons( Ok | Cancel );
  setDefaultButton( Ok );
  setModal( true );
  showButtonSeparator( true );

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

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

  QLabel *label = new QLabel( i18nc( "@label:textbox Name of a custom field", "Name:" ), page );
  layout->addWidget( label, 0, 0 );

  mTitle = new KLineEdit( page );
  mTitle->setValidator( new QRegExpValidator( QRegExp( "[a-zA-Z\\d-]+" ), mTitle ) );
  label->setBuddy( mTitle );
  layout->addWidget( mTitle, 0, 1 );

  label = new QLabel( i18n( "Type:" ), page );
  layout->addWidget( label, 1, 0 );

  mType = new KComboBox( page );
  label->setBuddy( mType );
  layout->addWidget( mType, 1, 1 );

  mGlobal = new QCheckBox( i18n( "Is available for all contacts" ), page );
  mGlobal->setChecked( true );
  layout->addWidget( mGlobal, 2, 0, 1, 2 );

  connect( mTitle, SIGNAL( textChanged( const QString& ) ),
           this, SLOT( nameChanged( const QString& ) ) );

  KAcceleratorManager::manage( this );

  mTypeList.append( "text" );
  mTypeName.append( i18n( "Text" ) );
  mTypeList.append( "integer" );
  mTypeName.append( i18n( "Numeric Value" ) );
  mTypeList.append( "boolean" );
  mTypeName.append( i18n( "Boolean" ) );
  mTypeList.append( "date" );
  mTypeName.append( i18n( "Date" ) );
  mTypeList.append( "time" );
  mTypeName.append( i18n( "Time" ) );
  mTypeList.append( "datetime" );
  mTypeName.append( i18n( "Date & Time" ) );

  for ( int i = 0; i < mTypeName.count(); ++i )
    mType->addItem( mTypeName[ i ] );

  nameChanged( "" );

  mTitle->setFocus();
}
Пример #13
0
CoverBrowserDialog::CoverBrowserDialog(QWidget *parent) : KDialog(parent) {

  Q_UNUSED(parent);

  setup();
  showButtonSeparator(TRUE);

}
Пример #14
0
CrossReferenceEditDialog::CrossReferenceEditDialog(CrossReferenceContent *contentNote, QWidget *parent/*, QKeyEvent *ke*/)
        : KDialog(parent)
        , m_noteContent(contentNote)
{

    // KDialog options
    setCaption(i18n("Edit Cross Reference"));
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);
    setObjectName("EditCrossReference");
    setModal(true);
    showButtonSeparator(true);
    connect(this, SIGNAL(okClicked()), SLOT(slotOk()));

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

    QGridLayout *layout = new QGridLayout(page);

    m_targetBasket = new KComboBox(wid);
    this->generateBasketList(m_targetBasket);

    if(m_noteContent->url().isEmpty()){
        BasketListViewItem *item = Global::bnpView->topLevelItem(0);
        m_noteContent->setCrossReference(KUrl(item->data(0, Qt::UserRole).toString()), m_targetBasket->currentText(), "edit-copy");
        this->urlChanged(0);
    } else {
        QString url = m_noteContent->url().url();
        //cannot use findData because I'm using a StringList and I don't have the second
        // piece of data to make find work.
        for(int i = 0; i < m_targetBasket->count(); ++i) {
            if(url == m_targetBasket->itemData(i, Qt::UserRole).toStringList().first()) {
                m_targetBasket->setCurrentIndex(i);
                break;
            }
        }
    }

    QLabel *label1 = new QLabel(page);
    label1->setText(i18n("Ta&rget:"));
    label1->setBuddy(m_targetBasket);

    layout->addWidget(label1,  0, 0, Qt::AlignVCenter);
    layout->addWidget(m_targetBasket,   0, 1, Qt::AlignVCenter);

    connect(m_targetBasket,   SIGNAL(activated(int)), this, SLOT(urlChanged(int)));

    QWidget *stretchWidget = new QWidget(page);
    QSizePolicy policy(QSizePolicy::Fixed, QSizePolicy::Expanding);
    policy.setHorizontalStretch(1);
    policy.setVerticalStretch(255);
    stretchWidget->setSizePolicy(policy); // Make it fill ALL vertical space
    layout->addWidget(stretchWidget, 3, 1, Qt::AlignVCenter);
}
Пример #15
0
WorkPackageSendDialog::WorkPackageSendDialog( const QList<Node*> &tasks,  ScheduleManager *sm, QWidget *p)
    : KoDialog(p)
{
    setCaption( xi18nc( "@title:window", "Send Work Packages") );
    setButtons( Close );
    setDefaultButton( Close );
    showButtonSeparator( true );

    m_wp = new WorkPackageSendPanel( tasks, sm, this);
    setMainWidget( m_wp );
}
Пример #16
0
ConfigDialog::ConfigDialog(QWidget* parent)
: KConfigDialog(parent, "Settings", GwenviewConfig::self())
, d(new ConfigDialogPrivate)
{
    setFaceType(KPageDialog::List);
    setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Apply | KDialog::Default);
    showButtonSeparator(true);

    QWidget* widget;
    KPageWidgetItem* pageItem;

    // General
    widget = setupPage(d->mGeneralConfigPage);
    pageItem = addPage(widget, i18n("General"));
    pageItem->setIcon(KIcon("gwenview"));
    connect(d->mGeneralConfigPage.kcfg_ViewBackgroundValue, SIGNAL(valueChanged(int)), SLOT(updateViewBackgroundFrame()));

    // Image View
    widget = setupPage(d->mImageViewConfigPage);

    d->mAlphaBackgroundModeGroup = new InvisibleButtonGroup(widget);
    d->mAlphaBackgroundModeGroup->setObjectName(QLatin1String("kcfg_AlphaBackgroundMode"));
    d->mAlphaBackgroundModeGroup->addButton(d->mImageViewConfigPage.checkBoardRadioButton, int(RasterImageView::AlphaBackgroundCheckBoard));
    d->mAlphaBackgroundModeGroup->addButton(d->mImageViewConfigPage.solidColorRadioButton, int(RasterImageView::AlphaBackgroundSolid));

    d->mWheelBehaviorGroup = new InvisibleButtonGroup(widget);
    d->mWheelBehaviorGroup->setObjectName(QLatin1String("kcfg_MouseWheelBehavior"));
    d->mWheelBehaviorGroup->addButton(d->mImageViewConfigPage.mouseWheelScrollRadioButton, int(MouseWheelBehavior::Scroll));
    d->mWheelBehaviorGroup->addButton(d->mImageViewConfigPage.mouseWheelBrowseRadioButton, int(MouseWheelBehavior::Browse));

    d->mAnimationMethodGroup = new InvisibleButtonGroup(widget);
    d->mAnimationMethodGroup->setObjectName(QLatin1String("kcfg_AnimationMethod"));
    d->mAnimationMethodGroup->addButton(d->mImageViewConfigPage.glAnimationRadioButton, int(DocumentView::GLAnimation));
    d->mAnimationMethodGroup->addButton(d->mImageViewConfigPage.softwareAnimationRadioButton, int(DocumentView::SoftwareAnimation));
    d->mAnimationMethodGroup->addButton(d->mImageViewConfigPage.noAnimationRadioButton, int(DocumentView::NoAnimation));

    d->mThumbnailBarOrientationGroup = new InvisibleButtonGroup(widget);
    d->mThumbnailBarOrientationGroup->setObjectName(QLatin1String("kcfg_ThumbnailBarOrientation"));
    d->mThumbnailBarOrientationGroup->addButton(d->mImageViewConfigPage.horizontalRadioButton, int(Qt::Horizontal));
    d->mThumbnailBarOrientationGroup->addButton(d->mImageViewConfigPage.verticalRadioButton, int(Qt::Vertical));

    pageItem = addPage(widget, i18n("Image View"));
    pageItem->setIcon(KIcon("view-preview"));

    // Advanced
    widget = setupPage(d->mAdvancedConfigPage);
    pageItem = addPage(widget, i18n("Advanced"));
    pageItem->setIcon(KIcon("preferences-other"));
    d->mAdvancedConfigPage.cacheHelpLabel->setFont(KGlobalSettings::smallestReadableFont());

    updateViewBackgroundFrame();
}
Пример #17
0
UMLTemplateDialog::UMLTemplateDialog(QWidget* pParent, UMLTemplate* pTemplate)
        : KDialog( pParent)
{
    m_pTemplate = pTemplate;
    setCaption( i18n("Template Properties") );
    setButtons( Help | Ok | Cancel );
    setDefaultButton( Ok );
    setModal( true );
    showButtonSeparator( true );
    setupDialog();
    connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
    connect(this,SIGNAL(applyClicked()),this,SLOT(slotApply()));
}
Пример #18
0
KJotsConfigDlg::KJotsConfigDlg( const QString & title, QWidget *parent )
  : KCMultiDialog( parent )
{
    setCaption( title );
    setFaceType( KPageDialog::List );
    setButtons( Default | Ok | Cancel );
    setDefaultButton( Ok );

    showButtonSeparator( true );

    addModule( "kjots_config_misc" );
    connect( this, SIGNAL(okClicked()), SLOT(slotOk()) );
}
ViewConfigureDialog::ViewConfigureDialog( ViewConfigureWidget *wdg, const QString &viewName,
        QWidget *parent )
    : KDialog( parent ), mConfigWidget( wdg )
{
    setCaption( i18n( "Modify View: " ) + viewName );
    setButtons( Help | Ok | Cancel );
    setDefaultButton( Ok );
    showButtonSeparator( true );

    setMainWidget( mConfigWidget );
    connect(this,SIGNAL(helpClicked()),this,SLOT(slotHelp()));
    resize( 600, 300 );
}
Пример #20
0
AkonadiAddressSelectorDialog::AkonadiAddressSelectorDialog( QWidget *parent )
    :KDialog(parent)
{
    m_addressSelector = new AkonadiAddressSelector(this, false);
    connect(m_addressSelector, SIGNAL(addressSelected(Addressee)),SLOT(slotAddresseeSelected(Addressee)));

    setMainWidget( m_addressSelector );

    setModal( true );
    setButtons(KDialog::Ok | KDialog::Cancel);
    setDefaultButton(KDialog::Ok);
    showButtonSeparator( true);

}
Пример #21
0
WBSDefinitionDialog::WBSDefinitionDialog(Project &project, WBSDefinition &def, QWidget *p)
    : KoDialog(p)
{
    setCaption( i18n("WBS Definition") );
    setButtons( Ok|Cancel );
    setDefaultButton( Ok );
    showButtonSeparator( true );

    m_panel = new WBSDefinitionPanel(project, def, this);
    setMainWidget(m_panel);
    enableButtonOk(false);
    connect(m_panel, SIGNAL(changed(bool)), SLOT(enableButtonOk(bool)));
    connect(this, SIGNAL(okClicked()), SLOT(slotOk()));
}
LocaleConfigMoneyDialog::LocaleConfigMoneyDialog( KLocale *locale, QWidget *p)
    : KDialog( p)
{
    setCaption( i18n("Currency Settings") );
    setButtons( Ok|Cancel );
    showButtonSeparator( true );
    m_panel = new LocaleConfigMoney( locale, this);

    setMainWidget(m_panel);

    enableButtonOk(false);

    connect(m_panel, SIGNAL(localeChanged()), SLOT(slotChanged()));
}
Пример #23
0
TextFileImportDialog::TextFileImportDialog(QWidget *parent)
        : KDialog(parent)
{
    QWidget *page = new QWidget(this);
    QVBoxLayout *topLayout = new QVBoxLayout(page);

    // KDialog options
    setCaption(i18n("Import Text File"));
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);
    setObjectName("ImportTextFile");
    setModal(true);
    showButtonSeparator(false);


    m_choices = new QGroupBox(i18n("Format of the Text File"), page);
    m_choiceLayout = new QVBoxLayout;
    m_choices->setLayout(m_choiceLayout);

    m_emptyline_choice = new QRadioButton(i18n("Notes separated by an &empty line"), m_choices);
    m_newline_choice = new QRadioButton(i18n("One &note per line"),                  m_choices);
    m_dash_choice = new QRadioButton(i18n("Notes begin with a &dash (-)"),           m_choices);
    m_star_choice = new QRadioButton(i18n("Notes begin with a &star (*)"),           m_choices);
    m_anotherSeparator = new QRadioButton(i18n("&Use another separator:"),           m_choices);

    m_choiceLayout->addWidget(m_emptyline_choice);
    m_choiceLayout->addWidget(m_newline_choice);
    m_choiceLayout->addWidget(m_dash_choice);
    m_choiceLayout->addWidget(m_star_choice);
    m_choiceLayout->addWidget(m_anotherSeparator);

    QWidget *indentedTextEdit = new QWidget(m_choices);
    m_choiceLayout->addWidget(indentedTextEdit);

    QHBoxLayout *hLayout = new QHBoxLayout(indentedTextEdit);
    hLayout->addSpacing(20);
    m_customSeparator = new KTextEdit(indentedTextEdit);
    hLayout->addWidget(m_customSeparator);

    m_all_in_one_choice = new QRadioButton(i18n("&All in one note"),                  m_choices);
    m_choiceLayout->addWidget(m_all_in_one_choice);

    m_emptyline_choice->setChecked(true);
    topLayout->addWidget(m_choices);

    connect(m_customSeparator, SIGNAL(textChanged()), this, SLOT(customSeparatorChanged()));

    setMainWidget(page);
}
Пример #24
0
KileListSelectorBase::KileListSelectorBase(const QStringList &list, const QString &caption, const QString &select, bool sort,
                                           QWidget *parent, const char *name)
: KDialog(parent)
{
	setObjectName(name);
	setCaption(caption);
	setModal(true);
	setButtons(Ok | Cancel);
	setDefaultButton(Ok);
	showButtonSeparator(true);

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

	QVBoxLayout *layout = new QVBoxLayout();
	layout->setMargin(0);
	layout->setSpacing(KDialog::spacingHint());
	page->setLayout(layout);

	layout->addWidget(new QLabel(select, page));

	m_listView = new QTreeWidget(page);
	m_listView->setHeaderLabel(i18n("Files"));
	m_listView->setSortingEnabled(false);
	m_listView->setAllColumnsShowFocus(true);
	m_listView->setRootIsDecorated(false);

	layout->addWidget(m_listView);

	layout->addWidget(new QLabel(i18np("1 item found.", "%1 items found.", list.size())));

	m_listView->setSortingEnabled(sort);
	if(sort) {
		m_listView->sortByColumn(0, Qt::AscendingOrder);
	}

	insertStringList(list);

	m_listView->clearSelection();
	connect(m_listView, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(accept()));
	QItemSelectionModel *selectionModel = m_listView->selectionModel();
	if(selectionModel) { // checking just to be safe
		connect(selectionModel, SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)),
		        this, SLOT(handleSelectionChanged(const QItemSelection&,const QItemSelection&)));
	}

	enableButtonOk(false);
}
Пример #25
0
PackageSettingsDialog::PackageSettingsDialog(WorkPackage &p, QWidget *parent)
    : KDialog(parent)
{
    setCaption( i18n("Work Package Settings") );
    setButtons( Ok|Cancel );
    setDefaultButton( Ok );
    showButtonSeparator( true );
    //kDebug(planworkDbg())<<&p;

    dia = new PackageSettingsPanel(p, this);

    setMainWidget(dia);
    enableButtonOk(false);

    connect(dia, SIGNAL(changed(bool)), SLOT(enableButtonOk(bool)));
}
Пример #26
0
ObjectNodeDialog::ObjectNodeDialog( UMLView * pView, ObjectNodeWidget * pWidget )
        : KPageDialog(pView)
{
    setCaption( i18n("Properties") );
    setButtons( Ok | Apply | Cancel | Help );
    setDefaultButton( Ok );
    setModal( true );
    setFaceType( KPageDialog::List );
    showButtonSeparator( true );
    m_pView = pView;
    m_pObjectNodeWidget = pWidget;
    m_bChangesMade = false;
    setupPages();
    connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
    connect(this,SIGNAL(applyClicked()),this,SLOT(slotApply()));
}
Пример #27
0
InsertFileDialog::InsertFileDialog( Project &project, Node *currentNode, QWidget *parent )
    : KDialog(parent)
{
    setCaption( i18n("Insert File") );
    setButtons( KDialog::Ok | KDialog::Cancel );
    setDefaultButton( Ok );
    showButtonSeparator( true );
    
    m_panel = new InsertFilePanel( project, currentNode, this );

    setMainWidget( m_panel );
    
    enableButtonOk(false);

    connect( m_panel, SIGNAL( enableButtonOk( bool ) ), SLOT( enableButtonOk( bool ) ) );
}
Пример #28
0
PasswordDlg::PasswordDlg(QWidget *parent)
        : KDialog(parent)
        , w(0)
{
    // KDialog options
    setWindowTitle(i18n("Password Protection"));
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);
    setModal(true);
    showButtonSeparator(true);

    setMainWidget(new QWidget(this));
    QHBoxLayout* toplayout = new QHBoxLayout(mainWidget());
    w = new Password;
    toplayout->addWidget(w, 1);
}
Пример #29
0
KTimerDialog::KTimerDialog( int msec, TimerStyle style, QWidget *parent,
                 const char *name, bool modal,
                 const QString &caption,
                 int buttonMask, ButtonCode defaultButton,
                 bool separator,
                 const KGuiItem &user1,
                 const KGuiItem &user2,
                 const KGuiItem &user3 )
    : KDialog( parent )
{
    setObjectName( name );
    setModal( modal );
    setCaption( caption );
    setButtons( (ButtonCodes)buttonMask );
    setDefaultButton( defaultButton );
    showButtonSeparator( separator );
    setButtonGuiItem( User1, user1 );
    setButtonGuiItem( User2, user2 );
    setButtonGuiItem( User3, user3 );

    totalTimer = new QTimer( this );
    totalTimer->setSingleShot( true );
    updateTimer = new QTimer( this );
    updateTimer->setSingleShot( false );
    msecTotal = msecRemaining = msec;
    updateInterval = 1000;
    tStyle = style;
	KWindowSystem::setIcons( winId(), DesktopIcon("randr"), SmallIcon("randr") );
    // default to canceling the dialog on timeout
    if ( buttonMask & Cancel )
        buttonOnTimeout = Cancel;

    connect( totalTimer, SIGNAL( timeout() ), SLOT( slotInternalTimeout() ) );
    connect( updateTimer, SIGNAL( timeout() ), SLOT( slotUpdateTime() ) );

    // create the widgets
    mainWidget = new KVBox( this );
    timerWidget = new KHBox( mainWidget );
    timerLabel = new QLabel( timerWidget );
    timerProgress = new QProgressBar( timerWidget );
    timerProgress->setRange( 0, msecTotal );
    timerProgress->setTextVisible( false );

    KDialog::setMainWidget( mainWidget );

    slotUpdateTime( false );
}
Пример #30
0
void ConquirereSettingsDialog::setupPages()
{
    setFaceType( List );
    setWindowTitle(i18n("Preferences"));
    setButtons(Reset | Ok | Apply | Cancel);
    setDefaultButton(Ok);
    enableButtonApply(false);
    setModal(true);
    showButtonSeparator(true);

    m_appearanceSettings = new AppearanceSettings();
    connect(this, SIGNAL(applyClicked()), m_appearanceSettings, SLOT(applySettings()));
    connect(this, SIGNAL(resetClicked()), m_appearanceSettings, SLOT(resetSettings()));
    connect(this, SIGNAL(okClicked()), m_appearanceSettings, SLOT(applySettings()));
    connect(m_appearanceSettings, SIGNAL(contentChanged()), this, SLOT(contentChanged()));

    KPageWidgetItem *asitem = addPage( m_appearanceSettings, i18n( "Appearance" ) );
    asitem->setIcon( KIcon( "view-choose" ) );

    m_librarySettings = new LibrarySettings();
    connect(this, SIGNAL(applyClicked()), m_librarySettings, SLOT(applySettings()));
    connect(this, SIGNAL(resetClicked()), m_librarySettings, SLOT(resetSettings()));
    connect(this, SIGNAL(okClicked()), m_librarySettings, SLOT(applySettings()));
    connect(m_librarySettings, SIGNAL(contentChanged()), this, SLOT(contentChanged()));

    KPageWidgetItem *libsitem = addPage( m_librarySettings, i18n( "Library" ) );
    libsitem->setIcon( KIcon( "folder-database" ) );

    m_exportSettings = new ExportSettings();
    connect(this, SIGNAL(applyClicked()), m_exportSettings, SLOT(applySettings()));
    connect(this, SIGNAL(resetClicked()), m_exportSettings, SLOT(resetSettings()));
    connect(this, SIGNAL(okClicked()), m_exportSettings, SLOT(applySettings()));
    connect(m_exportSettings, SIGNAL(contentChanged()), this, SLOT(contentChanged()));

    KPageWidgetItem *esitem = addPage( m_exportSettings, i18n( "Export" ) );
    esitem->setIcon( KIcon( "document-export" ) );

    m_systemSyncSettings = new SystemSyncSettings();
    connect(this, SIGNAL(applyClicked()), m_systemSyncSettings, SLOT(applySettings()));
    connect(this, SIGNAL(resetClicked()), m_systemSyncSettings, SLOT(resetSettings()));
    connect(this, SIGNAL(okClicked()), m_systemSyncSettings, SLOT(applySettings()));
    connect(m_systemSyncSettings, SIGNAL(contentChanged()), this, SLOT(contentChanged()));

    KPageWidgetItem *sssitem = addPage( m_systemSyncSettings, i18n( "Synchronize" ) );
    sssitem->setIcon( KIcon( "view-refresh" ) );

}