void KstVectorDialogI::configureSource() {
  bool isNew = false;
  KST::dataSourceList.lock().readLock();
  KstDataSourcePtr ds = *KST::dataSourceList.findReusableFileName(_w->FileName->url());
  KST::dataSourceList.lock().unlock();
  if (!ds) {
    isNew = true;
    ds = KstDataSource::loadSource(_w->FileName->url());
    if (!ds || !ds->isValid()) {
      _w->_configure->setEnabled(false);
      return;
    }
  }

  assert(_configWidget);
  KDialogBase *dlg = new KDialogBase(this, "Data Config Dialog", true, i18n("Configure Data Source"));
  if (isNew) {
    connect(dlg, SIGNAL(okClicked()), _configWidget, SLOT(save()));
    connect(dlg, SIGNAL(applyClicked()), _configWidget, SLOT(save()));
  } else {
    connect(dlg, SIGNAL(okClicked()), this, SLOT(markSourceAndSave()));
    connect(dlg, SIGNAL(applyClicked()), this, SLOT(markSourceAndSave()));
  }
  _configWidget->reparent(dlg, QPoint(0, 0));
  dlg->setMainWidget(_configWidget);
  _configWidget->setInstance(ds);
  _configWidget->load();
  dlg->exec();
  _configWidget->reparent(0L, QPoint(0, 0));
  dlg->setMainWidget(0L);
  delete dlg;
  updateCompletion(); // could be smarter by only running if Ok/Apply clicked
}
Esempio n. 2
0
KonviConfigDialog::KonviConfigDialog( QWidget *parent, const char *name,
                                      KConfigSkeleton *config,
                                      DialogType dialogType,
                                      int dialogButtons,
                                      ButtonCode defaultButton,
                                      bool modal ) :
                   KDialogBase( dialogType, Qt::WStyle_DialogBorder,
                                parent, name, modal, i18n("Configure"), dialogButtons, defaultButton ),
                                d(new KConfigDialogPrivate(dialogType))
{
    if ( name )
    {
        openDialogs.insert(name, this);
    }
    else
    {
        QCString genericName;
        genericName.sprintf("SettingsDialog-%p", this);
        openDialogs.insert(genericName, this);
        setName(genericName);
    }

    connect(this, SIGNAL(okClicked()), this, SLOT(updateSettings()));
    connect(this, SIGNAL(applyClicked()), this, SLOT(updateSettings()));
    connect(this, SIGNAL(applyClicked()), this, SLOT(updateButtons()));
    connect(this, SIGNAL(defaultClicked()), this, SLOT(updateWidgetsDefault()));
    connect(this, SIGNAL(defaultClicked()), this, SLOT(updateButtons()));

    d->manager = new KConfigDialogManager(this, config);
    setupManagerConnections(d->manager);

    enableButton(Apply, false);
}
Esempio n. 3
0
DlgImagesplit::DlgImagesplit(KisView2* view,QString suffix,QStringList listMimeFilter)
        : KDialog(view)
        , m_view(view)
{

    m_page = new WdgImagesplit(this);

    setCaption(i18n("Image Split"));
    setButtons(Apply | Close);
    setDefaultButton(Apply);

    connect(this, SIGNAL(applyClicked()),this, SLOT(applyClicked()));

    setMainWidget(m_page);
    m_page->lineEdit->setText(suffix);
    m_page->setMinimumWidth (200);
    m_page->setMinimumHeight(160);
    resize(m_page->sizeHint());
    m_page->cmbFileType->clear();
    m_page->cmbFileType->addItems(listMimeFilter);
    m_page->cmbFileType->setCurrentIndex(0);
    cmbIndex=0;

    connect(m_page->chkAutoSave,SIGNAL(stateChanged(int)),SLOT(lineEditEnable()));
    connect(m_page->cmbFileType, SIGNAL(activated(int)), this, SLOT(setMimeType(int)));
}
Esempio n. 4
0
void preferencesWidget::setPage(QListWidgetItem *argItem, QListWidgetItem *oldItem) {

	disconnect(SIGNAL(applyClicked())) ;
	disconnect(SIGNAL(resetClicked())) ;

	if(((configWidget*)oldItem->data(Qt::UserRole).value<QWidget*>())->wantsHelp()) {
		disconnect(SIGNAL(helpClicked())) ;
	}

	oldItem->data(Qt::UserRole).value<QWidget*>()->hide() ;


	if(((configWidget*)argItem->data(Qt::UserRole).value<QWidget*>())->wantsHelp()) {
		connect(this,SIGNAL(helpClicked()),argItem->data(Qt::UserRole).value<QWidget*>(),SLOT(helpClicked())) ;
		buttonBox->button(QDialogButtonBox::Help)->setDisabled(FALSE) ;
	} else {
		buttonBox->button(QDialogButtonBox::Help)->setDisabled(TRUE) ;
	}

	if(((configWidget*)argItem->data(Qt::UserRole).value<QWidget*>())->wantsApplyDiscard()) {
		connect(this,SIGNAL(applyClicked()),argItem->data(Qt::UserRole).value<QWidget*>(),SLOT(applyClicked())) ;
		connect(this,SIGNAL(resetClicked()),argItem->data(Qt::UserRole).value<QWidget*>(),SLOT(resetClicked())) ;
		buttonBox->button(QDialogButtonBox::Apply)->setDisabled(FALSE) ;
		buttonBox->button(QDialogButtonBox::Discard)->setDisabled(FALSE) ;
	} else {
		buttonBox->button(QDialogButtonBox::Apply)->setDisabled(TRUE) ;
		buttonBox->button(QDialogButtonBox::Discard)->setDisabled(TRUE) ;
	}

	argItem->data(Qt::UserRole).value<QWidget*>()->show() ;

}
StyleManagerDialog::StyleManagerDialog(QWidget *parent)
        : KDialog(parent)
{
    setButtons(Ok | Cancel | Apply);
    m_styleManagerWidget = new StyleManager(this);
    setMainWidget(m_styleManagerWidget);
    setWindowTitle(i18n("Style Manager"));

    connect(this, SIGNAL(applyClicked()), this, SLOT(applyClicked()));
}
Esempio n. 6
0
void Dialog::configureTree()
{
    kdDebug(700) << k_funcinfo << endl;
    ComponentsDialog *subdlg = new ComponentsDialog(d->dlg);
    subdlg->setPluginInfos(d->plugininfomap);
    subdlg->show();
    connect(subdlg, SIGNAL(okClicked()), this, SLOT(updateTreeList()));
    connect(subdlg, SIGNAL(applyClicked()), this, SLOT(updateTreeList()));
    connect(subdlg, SIGNAL(okClicked()), this, SIGNAL(pluginSelectionChanged()));
    connect(subdlg, SIGNAL(applyClicked()), this, SIGNAL(pluginSelectionChanged()));
    connect(subdlg, SIGNAL(finished()), subdlg, SLOT(delayedDestruct()));
}
Esempio n. 7
0
DlgBackgrounds::DlgBackgrounds(KisView2* view)
        : KDialog(view)
        , m_view(view)
{
    setCaption(i18n("Select a Background"));
    setButtons(Apply | Close);
    setDefaultButton(Apply);

    connect(this, SIGNAL(applyClicked()),
            this, SLOT(applyClicked()));

    m_page = new WdgBackgrounds(this);
    setMainWidget(m_page);
}
Esempio n. 8
0
KWConfigureDialog::KWConfigureDialog(KWView* parent)
: KPageDialog(parent)
{
    setFaceType(List);
    setCaption(i18n("Configure"));
    setButtons(KDialog::Ok | KDialog::Apply | KDialog::Cancel | KDialog::Default);
    setDefaultButton(KDialog::Ok);

    m_miscPage = new KoConfigMiscPage(parent->koDocument(), parent->canvasBase()->shapeController()->resourceManager());
    KPageWidgetItem *item = addPage(m_miscPage, i18n("Misc"));
    item->setHeader(i18n("Misc"));
    item->setIcon(koIcon("preferences-other"));

    m_gridPage = new KoConfigGridPage(parent->koDocument());
    item = addPage(m_gridPage, i18n("Grid"));
    item->setHeader(i18n("Grid"));
    item->setIcon(koIcon("grid"));

    connect(m_miscPage, SIGNAL(unitChanged(KoUnit)), m_gridPage, SLOT(slotUnitChanged(KoUnit)));

    m_docPage = new KoConfigDocumentPage(parent->koDocument());
    item = addPage(m_docPage, i18nc("@title:tab Document settings page", "Document"));
    item->setHeader(i18n("Document Settings"));
    item->setIcon(koIcon("document-properties"));

    m_authorPage = new KoConfigAuthorPage();
    item = addPage(m_authorPage, i18nc("@title:tab Author page", "Author"));
    item->setHeader(i18n("Author"));
    item->setIcon(koIcon("user-identity"));

    connect(this, SIGNAL(okClicked()), this, SLOT(slotApply()));
    connect(this, SIGNAL(defaultClicked()), this, SLOT(slotDefault()));
    connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply()) );
    connect(this, SIGNAL(changed()), parent, SLOT(slotUpdateAuthorProfileActions()));
}
Esempio n. 9
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();
}
Esempio n. 10
0
advancedTabDialog::advancedTabDialog(QWidget* parent, KConfig* config, const char* name)
    : KDialogBase(KDialogBase::Plain,
                  i18n("Advanced Options"),
                  KDialogBase::Ok |
                  KDialogBase::Apply |
                  KDialogBase::Cancel,
                  KDialogBase::Ok,
                  parent,
                  name,
                  true, true),
                  m_pConfig(config)
{
    connect(this, SIGNAL(applyClicked()),
            this, SLOT(save()));
    connect(this, SIGNAL(okClicked()),
            this, SLOT(save()));
    actionButton(Apply)->setEnabled(false);
    QFrame* page = plainPage();
    QVBoxLayout* layout = new QVBoxLayout(page);
    m_advancedWidget = new advancedTabOptions(page);
    layout->addWidget(m_advancedWidget);
    layout->addSpacing( 20 );
    layout->addStretch();

    connect(m_advancedWidget->m_pNewTabsInBackground, SIGNAL(clicked()), this, SLOT(changed()));
    connect(m_advancedWidget->m_pOpenAfterCurrentPage, SIGNAL(clicked()), this, SLOT(changed()));
    connect(m_advancedWidget->m_pTabConfirm, SIGNAL(clicked()), this, SLOT(changed()));
    connect(m_advancedWidget->m_pTabCloseActivatePrevious, SIGNAL(clicked()), this, SLOT(changed()));
    connect(m_advancedWidget->m_pPermanentCloseButton, SIGNAL(clicked()), this, SLOT(changed()));
    connect(m_advancedWidget->m_pKonquerorTabforExternalURL, SIGNAL(clicked()), this, SLOT(changed()));
    connect(m_advancedWidget->m_pPopupsWithinTabs, SIGNAL(clicked()), this, SLOT(changed()));

    load();
}
Esempio n. 11
0
void PicItem::buttonStateChanged( const QString &id, bool state )
{
	if ( id == "expandBtn" )
	{
		m_bExpanded = state;
		updateVisibility();
	}
	
	else if ( id == "settings" )
	{
		if (!state)
			return;
		
		// Redraw button
		button("settings")->setState(false);
		update();
	
		MicroSettingsDlg *dlg = new MicroSettingsDlg( microSettings, 0L, "microSettingsDlg" );
		connect( dlg, SIGNAL(okClicked()), this, SLOT(slotMicroSettingsDlgAccepted()) );
		connect( dlg, SIGNAL(applyClicked()), this, SLOT(slotMicroSettingsDlgAccepted()) );
		dlg->show();
		// At this point the PIC is selected but this does not appear to the
		// user so we must deselect it when done.
		p_icnDocument->unselectAll();	
	}
}
bool ListViewEditor::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: applyClicked(); break;
    case 1: columnClickable((bool)static_QUType_bool.get(_o+1)); break;
    case 2: columnDownClicked(); break;
    case 3: columnPixmapChosen(); break;
    case 4: columnPixmapDeleted(); break;
    case 5: columnResizable((bool)static_QUType_bool.get(_o+1)); break;
    case 6: columnTextChanged((const QString&)static_QUType_QString.get(_o+1)); break;
    case 7: columnUpClicked(); break;
    case 8: currentColumnChanged((QListBoxItem*)static_QUType_ptr.get(_o+1)); break;
    case 9: currentItemChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 10: deleteColumnClicked(); break;
    case 11: itemColChanged((int)static_QUType_int.get(_o+1)); break;
    case 12: itemDeleteClicked(); break;
    case 13: itemDownClicked(); break;
    case 14: itemNewClicked(); break;
    case 15: itemNewSubClicked(); break;
    case 16: itemPixmapChoosen(); break;
    case 17: itemPixmapDeleted(); break;
    case 18: itemTextChanged((const QString&)static_QUType_QString.get(_o+1)); break;
    case 19: itemUpClicked(); break;
    case 20: itemLeftClicked(); break;
    case 21: itemRightClicked(); break;
    case 22: newColumnClicked(); break;
    case 23: okClicked(); break;
    case 24: initTabPage((const QString&)static_QUType_QString.get(_o+1)); break;
    case 25: emitItemRenamed((QListViewItem*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2),(const QString&)static_QUType_QString.get(_o+3)); break;
    default:
	return ListViewEditorBase::qt_invoke( _id, _o );
    }
    return TRUE;
}
Esempio n. 13
0
ActionEditorWindow::ActionEditorWindow()
: KviWindow(KviWindow::ScriptEditor,"actioneditor",0)
{
	g_pActionEditorWindow = this;
	setFixedCaption(__tr2qs_ctx("Action Editor","editor"));

	QGridLayout * g = new QGridLayout();

	m_pEditor = new ActionEditor(this);
	g->addWidget(m_pEditor,0,0,1,4);

	QPushButton * btn = new QPushButton(__tr2qs_ctx("OK","editor"),this);
	connect(btn,SIGNAL(clicked()),this,SLOT(okClicked()));
	btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept)));
	g->addWidget(btn,1,1);

	btn = new QPushButton(__tr2qs_ctx("Apply","editor"),this);
	connect(btn,SIGNAL(clicked()),this,SLOT(applyClicked()));
	btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept)));
	g->addWidget(btn,1,2);

	btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),this);
	connect(btn,SIGNAL(clicked()),this,SLOT(cancelClicked()));
	btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)));
	g->addWidget(btn,1,3);

	g->setRowStretch(0,1);
	g->setColumnStretch(0,1);
	setLayout(g);
}
void AddedInfoEvent::activate( uint actionId )
{
	if ( actionId == AddAction )
	{
		if ( d->addDialog )
		{
			d->addDialog->raise();
		}
		else
		{
			UI::ContactAddedNotifyDialog::HideWidgetOptions hideFlags = UI::ContactAddedNotifyDialog::DefaultHide;
			if ( !(d->actions & AuthorizeAction) )
				hideFlags |= UI::ContactAddedNotifyDialog::AuthorizeCheckBox;
			if ( !(d->actions & InfoAction) )
				hideFlags |= UI::ContactAddedNotifyDialog::InfoButton;

			d->addDialog = new UI::ContactAddedNotifyDialog( d->contactId, d->contactNickname, d->account, hideFlags );
			d->addDialog->setAttribute( Qt::WA_DeleteOnClose, false );

			connect( d->addDialog, SIGNAL(finished()), this, SLOT(addDialogFinished()) );
			connect( d->addDialog, SIGNAL(applyClicked(QString)), this, SLOT(addDialogOk()) );
			connect( d->addDialog, SIGNAL(infoClicked(QString)), this, SLOT(addDialogInfo()) );
			d->addDialog->show();
		}
	}
	else
	{
		InfoEvent::activate( actionId );

		if ( !d->suppressClose && actionId != InfoAction && d->account->isConnected() )
			close();
	}
}
void GraphicalTimetableLine::createConfigurationInterface(KConfigDialog* parent)
{
    QWidget *stopConfig = new QWidget( parent );
    QFormLayout *stopLayout = new QFormLayout( stopConfig );

    m_stopWidget = new StopWidget( stopConfig, m_stopSettings );
    CheckCombobox *filterList = new CheckCombobox( stopConfig );
    m_vehicleTypeModel = new VehicleTypeModel( filterList );
    m_vehicleTypeModel->checkVehicleTypes( m_vehicleTypes );
    filterList->setModel( m_vehicleTypeModel );
    filterList->setAllowNoCheckedItem( false );
    m_showTimetableCheckbox = new QCheckBox( i18n("Enable"), stopConfig );
    m_drawTransportLineCheckbox = new QCheckBox( i18n("Enable"), stopConfig );
    m_showTimetableCheckbox->setChecked( m_showTimetable );
    m_drawTransportLineCheckbox->setChecked( m_drawTransportLine );
    m_drawTransportLineCheckbox->setToolTip( i18n("Draws the transport line string into the "
            "vehicle type icon, for icons that are associated with a single departure.") );

    stopLayout->addRow( m_stopWidget );
    stopLayout->addRow( i18n("Shown &Vehicles:"), filterList );
    stopLayout->addRow( i18n("Show &Timetable:"), m_showTimetableCheckbox );
    stopLayout->addRow( i18n("Draw Transport &Line:"), m_drawTransportLineCheckbox );
    parent->addPage( stopConfig, i18n("Stop") );

    connect( parent, SIGNAL(applyClicked()), this, SLOT(configAccepted()) );
    connect( parent, SIGNAL(okClicked()), this, SLOT(configAccepted()) );

    m_stopWidget->setFocus();
    if ( m_stopSettings.stopList().isEmpty() || m_stopSettings.stop(0).name.isEmpty() ) {
        m_stopWidget->editSettings();
    }
}
Esempio n. 16
0
void cTranscript::configure ()
{
  //so first we have to create the dialog...
  tdlg = new dlgTranscript (cActionManager::self()->mainWidget());

  //then we connect() all its signals - this handles everything that the dialog offers...
  connect (tdlg, SIGNAL (okClicked()), this, SLOT (applyTranscript ()));
  connect (tdlg, SIGNAL (applyClicked()), this, SLOT (applyTranscript ()));

  //next we fill in its data
  tdlg->setEnabled (running);

  cProfileSettings *sett = settings ();
  fname = sett ? sett->getString ("transcript-directory") : QDir::homePath();
  
  fname += "/kmuddy_transcript.txt";

  tdlg->setTranscriptType (type);
  tdlg->setFName (fname);
  tdlg->setAFName (fileformat);
  tdlg->setOverwrite (overwrite);
  tdlg->setIncludeDump (includedump);
  tdlg->setAdvTranscript(advrunning);
  tdlg->setRotateDaily (rotatedaily);
  tdlg->setIncludeTimestamp(includetimestamp);  
  tdlg->setAdvTranscriptType (advtype);
  
  //dialog is ready - show it!
  tdlg->exec ();

  //finally, destroy that dialog!
  delete tdlg;
}
Esempio n. 17
0
XineConfig::XineConfig(const xine_t* const xine) :
		KDialogBase(KDialogBase::IconList, i18n("xine Engine Parameters"),
		            KDialogBase::Ok|KDialogBase::Apply|KDialogBase::Cancel, KDialogBase::Cancel)

{
	setInitialSize(QSize(650,500), true);

	m_xine = (xine_t*)xine;

	QStringList cats = getCategories();
	QTabWidget* tabWidget = NULL;
	QFrame* xineFrame = NULL;
	QVBoxLayout* xineLayout = NULL;
	QVBox* xineBeginnerPage = NULL;
	QVBox* xineExpertPage = NULL;
	QString icon;

	QStringList::ConstIterator end ( cats.end());
	for (QStringList::ConstIterator it = cats.begin(); it != end; ++it)
	{
		//  kdDebug() << "XineConfig: add page: " << *it << endl;
		if (*it == "audio")
			icon = "sound";
		else if (*it == "video")
			icon = "video";
		else if (*it == "vcd")
			icon = "cdrom_unmount";
		else if (*it == "input")
			icon = "connect_established";
		else if (*it == "effects")
			icon = "wizard";
		else if (*it == "media")
			icon = "cdrom_unmount";
		else if (*it == "subtitles")
			icon = "font_bitmap";
		else if (*it == "osd")
			icon = "font_bitmap";
		else if (*it == "engine")
			icon = "exec";
		else
			icon = "edit";

		xineFrame = addPage(*it, i18n("%1 Options").arg(*it), KGlobal::iconLoader()->loadIcon(icon, KIcon::Panel,
		                    KIcon::SizeMedium));
		xineLayout = new QVBoxLayout(xineFrame, marginHint(), spacingHint());
		tabWidget = new QTabWidget(xineFrame);
		xineLayout->addWidget(tabWidget);
		xineBeginnerPage = new QVBox(tabWidget);
		xineBeginnerPage->setMargin(5);
		tabWidget->addTab(xineBeginnerPage, i18n("Beginner Options"));
		createPage(*it, false, xineBeginnerPage);
		xineExpertPage = new QVBox(tabWidget);
		xineExpertPage->setMargin(5);
		tabWidget->addTab(xineExpertPage, i18n("Expert Options"));
		createPage(*it, true, xineExpertPage);
	}

	connect(this, SIGNAL(okClicked()), SLOT(slotOkPressed()));
	connect(this, SIGNAL(applyClicked()), SLOT(slotApplyPressed()));
}
Esempio n. 18
0
void
PreferencesDialog::applicationClosing(bool quickly)
{
    if (quickly) {
        reject();
        return;
    }

    if (m_applyButton->isEnabled()) {
        int rv = QMessageBox::warning
            (this, tr("Preferences Changed"),
             tr("Some preferences have been changed but not applied.\n"
                "Apply them before closing?"),
             QMessageBox::Apply | QMessageBox::Discard,
             QMessageBox::Discard);
        if (rv == QMessageBox::Apply) {
            applyClicked();
            accept();
        } else {
            reject();
        }
    } else {
        accept();
    }
}
Esempio n. 19
0
/**
 * Updates the code generation policy tab.
 */
void CodeGenOptionsPage::updateCodeGenerationPolicyTab()
{
    if (m_pCodePolicyPage)
    {
        ui_tabWidgetMain->removeTab(2);
        m_pCodePolicyPage->disconnect();

        delete m_pCodePolicyPage;
        m_pCodePolicyPage = 0;
    }

    Uml::ProgrammingLanguage::Enum pl = Uml::ProgrammingLanguage::fromInt(ui_SelectLanguageBox->currentIndex());
    CodeGenPolicyExt *policyExt = CodeGenFactory::newCodeGenPolicyExt(pl);

    if (policyExt) {
        m_pCodePolicyPage = policyExt->createPage(0, "codelangpolicypage");
    }
    else {
        m_pCodePolicyPage = new DefaultCodeGenPolicyPage(0, "codelangpolicypage");
    }

    ui_tabWidgetMain->insertTab(2, m_pCodePolicyPage, i18n("Language Options"));

    connect(this, SIGNAL(applyClicked()), m_pCodePolicyPage, SLOT(apply()));
}
Esempio n. 20
0
ConquirereSettingsDialog::ConquirereSettingsDialog(QWidget *parent)
    : KPageDialog(parent)
{
    setupPages();

    connect(this, SIGNAL(applyClicked()), this, SLOT(applyChanges()));
}
Esempio n. 21
0
void Paste::createConfigurationInterface(KConfigDialog *parent)
{
    m_snippetConfig = new SnippetConfig;
    connect(&cfg, SIGNAL(changed(ConfigData)),
            m_snippetConfig, SLOT(setData(ConfigData)));
    m_snippetConfig->setData(cfg);
    m_autoPasteConfig = new AutoPasteConfig;
    connect(&cfg, SIGNAL(changed(ConfigData)),
            m_autoPasteConfig, SLOT(setData(ConfigData)));
    m_autoPasteConfig->setData(cfg);

    parent->addPage(m_snippetConfig, i18n("Texts"), "accessories-text-editor");
    parent->addPage(m_autoPasteConfig, i18n("Automatic Paste"), "edit-paste");
    connect(parent, SIGNAL(applyClicked()), this, SLOT(configAccepted()));
    connect(parent, SIGNAL(okClicked()), this, SLOT(configAccepted()));
    connect(m_snippetConfig->textEdit, SIGNAL(textChanged()), parent, SLOT(settingsModified()));
    connect(m_snippetConfig->nameEdit, SIGNAL(userTextChanged(QString)), parent, SLOT(settingsModified()));
    connect(m_snippetConfig->list, SIGNAL(itemSelectionChanged()), parent, SLOT(settingsModified()));
    connect(m_snippetConfig->addMacroButton, SIGNAL(toggled(bool)), parent, SLOT(settingsModified()));
    connect(m_snippetConfig->addButton, SIGNAL(toggled(bool)), parent, SLOT(settingsModified()));
    connect(m_snippetConfig->removeButton, SIGNAL(toggled(bool)), parent, SLOT(settingsModified()));
    connect(m_autoPasteConfig->autoPasteCheckBox, SIGNAL(toggled(bool)), parent, SLOT(settingsModified())); 
    connect(m_autoPasteConfig->addButton, SIGNAL(clicked()), parent, SLOT(settingsModified())); 
    connect(m_autoPasteConfig->editButton, SIGNAL(clicked()), parent, SLOT(settingsModified())); 
    connect(m_autoPasteConfig->removeButton, SIGNAL(clicked(bool)), parent, SLOT(settingsModified()));
    connect(m_autoPasteConfig->pasteKeyButton, SIGNAL(keySequenceChanged(QKeySequence)), parent, SLOT(settingsModified()));
    connect(m_autoPasteConfig->appsTreeView, SIGNAL(clicked(bool)), parent, SLOT(settingsModified()));
}
Esempio n. 22
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" ) );

}
Esempio n. 23
0
void SettingsDialog::okClicked()
{
    applyClicked();

    if (!applyButton->isEnabled()) {
        close();
    }
}
Esempio n. 24
0
void KstMatrixDialog::configureSource() {
  KstDataSourcePtr ds;
  bool isNew = false;

  KST::dataSourceList.lock().readLock();
// xxx  ds = *KST::dataSourceList.findReusableFileName(_w->_fileName->url());
  KST::dataSourceList.lock().unlock();

  if (!ds) {
    isNew = true;
// xxx    ds = KstDataSource::loadSource(_w->_fileName->url());
    if (!ds || !ds->isValid()) {
      _w->_configure->setEnabled(false);

      return;
    }
  }

  if (_configWidget) {
    QDialog *dlg;
  
    dlg = new QDialog(this);
    dlg->setWindowTitle(QObject::tr("Configure Data Source"));

    if (isNew) {
      connect(dlg, SIGNAL(okClicked()), _configWidget, SLOT(save()));
      connect(dlg, SIGNAL(applyClicked()), _configWidget, SLOT(save()));
    } else {
      connect(dlg, SIGNAL(okClicked()), this, SLOT(markSourceAndSave()));
      connect(dlg, SIGNAL(applyClicked()), this, SLOT(markSourceAndSave()));
    }

    _configWidget->setParent(dlg);
// xxx    dlg->setMainWidget(_configWidget);
    _configWidget->setInstance(ds);
    _configWidget->load();
    dlg->exec();
// xxx    _configWidget->reparent(0L, QPoint(0, 0));
// xxx    dlg->setMainWidget(0L);

    delete dlg;
  }

  updateCompletion(); // could be smarter by only running if Ok/Apply clicked
}
Esempio n. 25
0
void KonviConfigDialog::setupManagerConnections(KConfigDialogManager *manager)
{
    connect(manager, SIGNAL(settingsChanged()), this, SLOT(settingsChangedSlot()));
    connect(manager, SIGNAL(widgetModified()), this, SLOT(updateButtons()));

    connect(this, SIGNAL(okClicked()), manager, SLOT(updateSettings()));
    connect(this, SIGNAL(applyClicked()), manager, SLOT(updateSettings()));
    connect(this, SIGNAL(defaultClicked()), manager, SLOT(updateWidgetsDefault()));
}
bool FilterDialog::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: applyClicked(); break;
    case 1: cancelClicked(); break;
    default:
	return FilterDialogBase::qt_invoke( _id, _o );
    }
    return TRUE;
}
Esempio n. 27
0
void preferencesWidget::buttonClicked(QAbstractButton *button) {

	if(buttonBox->buttonRole(button) == QDialogButtonBox::ApplyRole) {
		emit applyClicked() ;
	} else if(buttonBox->buttonRole(button) == QDialogButtonBox::DestructiveRole) {
		emit resetClicked() ;
	} else if(buttonBox->buttonRole(button) == QDialogButtonBox::HelpRole) {
		emit helpClicked() ;
	}
}
Esempio n. 28
0
DatepickerDlg::DatepickerDlg(KTagebuch *ktagebuch):

KDialog((QWidget*)ktagebuch),m_ktagebuch(ktagebuch) {  
  setButtons( KDialog::Ok | KDialog::Cancel | KDialog::Apply );
  dateW= new KDatePicker(this);  

  setMainWidget (dateW);
  connect( this, SIGNAL( applyClicked() ), this, SLOT( slotApply() ) );
  connect( this, SIGNAL( okClicked() ), this, SLOT( slotOk() ) );
}
Esempio n. 29
0
/**
 * Constructor.
 */
ObjectNodeDialog::ObjectNodeDialog(QWidget *parent, ObjectNodeWidget * pWidget)
  : MultiPageDialogBase(parent),
    m_pObjectNodeWidget(pWidget),
    m_bChangesMade(false)
{
    setCaption(i18n("Properties"));
    setupPages();
    connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
    connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply()));
}
/**
 *  Sets up an Association Properties Dialog.
 *  @param  parent  The parent of the AssociationPropertiesDialog
 *  @param  assocWidget  The Association Widget to display properties of.
 *  @param  pageNum The page to show first.
 */
AssociationPropertiesDialog::AssociationPropertiesDialog (QWidget *parent, AssociationWidget * assocWidget, int pageNum)
  : MultiPageDialogBase(parent),
    m_pAssoc(assocWidget)
{
    Q_UNUSED(pageNum)
    setCaption(i18n("Association Properties"));
    setupPages();

    connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
    connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply()));
}