void EditorTool::setToolSettings(EditorToolSettings* const settings) { d->settings = settings; d->settings->setToolIcon(toolIcon()); d->settings->setToolName(toolName()); connect(d->settings, SIGNAL(signalOkClicked()), this, SLOT(slotOk())); connect(d->settings, SIGNAL(signalCancelClicked()), this, SLOT(slotCancel())); connect(d->settings, SIGNAL(signalDefaultClicked()), this, SLOT(slotResetSettings())); connect(d->settings, SIGNAL(signalSaveAsClicked()), this, SLOT(slotSaveAsSettings())); connect(d->settings, SIGNAL(signalLoadClicked()), this, SLOT(slotLoadSettings())); connect(d->settings, SIGNAL(signalTryClicked()), this, SLOT(slotPreview())); connect(d->settings, SIGNAL(signalChannelChanged()), this, SLOT(slotChannelChanged())); connect(d->settings, SIGNAL(signalScaleChanged()), this, SLOT(slotScaleChanged())); // Will be unblocked in slotInit() // This will prevent signals emit during tool init. d->settings->blockSignals(true); }
void RatioCropTool::slotRatioChanged(int a) { applyRatioChanges(a); // Reset selection area. slotResetSettings(); }
void RatioCropTool::slotOrientChanged(int o) { d->imageSelectionWidget->setSelectionOrientation(o); // Reset selection area. slotResetSettings(); }
void RatioCropTool::slotCustomRatioChanged() { d->imageSelectionWidget->setSelectionAspectRatioValue(d->customRatioNInput->value(), d->customRatioDInput->value()); // Reset selection area. slotResetSettings(); }
void RestorationTool::slotResetValues(int i) { if (i == Private::Custom) { d->settingsWidget->setEnabled(true); } else { d->settingsWidget->setEnabled(false); } slotResetSettings(); }
KASettings::KASettings(QWidget *parent, const char *name, bool modal, WFlags f ) // :QTabDialog( parent, name, modal, f ) :QDialog( parent, name, modal, f ) { // const int frameoffset = 10; // debug( "setup settingswidget" ); setCaption( i18n("KArchie Settings") ); setMinimumSize( 440, 300 ); frameLayout = new QBoxLayout( this, QBoxLayout::Down, FRAME_OFFSET ); settingsFrame = new QFrame(this); settingsFrame->setFrameStyle( QFrame::WinPanel | QFrame::Raised ); widgetLayout = new QBoxLayout( settingsFrame, QBoxLayout::Down, FRAME_OFFSET ); // debug( "setup archiehost frame" ); // archiedialog = new QDialog(this, "archiehost" ); // archiebox = new QBoxLayout( archiedialog, QBoxLayout::Down, frameoffset ); archiehost = new KAArchieSettings(i18n("Archie server settings"), settingsFrame, "archiehost"); widgetLayout->addWidget( archiehost ); // archiehost->show(); // debug( "setup searchterms frame" ); // searchdialog = new QDialog(this, "searchterms" ); // searchbox = new QBoxLayout( searchdialog, QBoxLayout::Down, frameoffset ); searchterms = new KASearchSettings(i18n("Search init"), settingsFrame, "searchterms"); widgetLayout->addWidget( searchterms ); frameLayout->addWidget(settingsFrame, 1); // debug( "setup user frame" ); // userdialog = new QDialog(this, "user" ); // userbox = new QBoxLayout( userdialog, QBoxLayout::Down, frameoffset ); // user = new KAUserSettings( "User settings", userdialog, "user" ); // userbox->addWidget( user ); // debug( "adding tabs" ); // addTab( archiedialog, "&Archie server" ); // addTab( searchdialog, "&Search" ); // addTab( userdialog, "local / &User" ); // addTab( archiedialog, "" ); // addTab( searchdialog, "" ); buttonFrame = new QFrame(this); // setCancelButton(); cancelButton = new QPushButton(i18n("Cancel"), buttonFrame); cancelButton->setFixedSize(cancelButton->sizeHint()); connect ( cancelButton, SIGNAL(clicked()), SLOT(reject()) ); // setDefaultButton(i18n("Reset")); restoreButton = new QPushButton(i18n("Reset"), buttonFrame); restoreButton->setFixedSize(restoreButton->sizeHint()); connect (restoreButton, SIGNAL(clicked()), archiehost, SLOT( slotResetSettings() )); connect (restoreButton, SIGNAL(clicked()), searchterms, SLOT( slotResetSettings() )); acceptButton = new QPushButton(i18n("OK"), buttonFrame); acceptButton->setFixedSize(acceptButton->sizeHint()); // connect ( acceptButton, SIGNAL(clicked()), // archiehost, SLOT( slotApplySettings() )); // connect ( acceptButton, SIGNAL(clicked()), // searchterms, SLOT( slotApplySettings() )); connect ( acceptButton, SIGNAL(clicked()), SLOT(slotReturnPressed()) ); // connect( archiehost, SIGNAL(returnPressed()), // archiehost, SLOT(slotApplySettings()) ); // connect( archiehost, SIGNAL(returnPressed()), // searchterms, SLOT(slotApplySettings()) ); // connect( searchterms, SIGNAL(returnPressed()), // archiehost, SLOT(slotApplySettings()) ); // connect( searchterms, SIGNAL(returnPressed()), // searchterms, SLOT(slotApplySettings()) ); connect( archiehost, SIGNAL(returnPressed()), SLOT(slotReturnPressed()) ); connect( searchterms, SIGNAL(returnPressed()), SLOT(slotReturnPressed()) ); buttonLayout = new QBoxLayout(buttonFrame, QBoxLayout::RightToLeft /*, FRAME_OFFSET*/ ); // widgetLayout->addStretch(); // widgetLayout->addLayout(buttonLayout); buttonLayout->addWidget(cancelButton, 0, AlignTop); buttonLayout->addSpacing(10); buttonLayout->addWidget(restoreButton, 0, AlignTop); buttonLayout->addSpacing(10); buttonLayout->addWidget(acceptButton, 0, AlignTop); buttonLayout->addStretch(); buttonFrame->setFixedHeight(acceptButton->height() /*+ 2*FRAME_OFFSET*/); // buttonFrame->setFrameStyle(QFrame::Box | QFrame::Raised); // frameLayout->addSpacing(1); frameLayout->addWidget(buttonFrame); // frameLayout->addSpacing(1); // debug( "connecting tabs" ); // connect(this , SIGNAL( applyButtonPressed() ), // archiehost, SLOT( slotApplySettings() )); // connect(this , SIGNAL( applyButtonPressed() ), // searchterms, SLOT( slotApplySettings() )); // connect(this , SIGNAL( defaultButtonPressed() ), // archiehost, SLOT( slotResetSettings() )); // connect(this , SIGNAL( defaultButtonPressed() ), // searchterms, SLOT( slotResetSettings() )); // connect(archiehost, SIGNAL(returnPressed()), // this, SLOT(slotReturnPressed()) ); // connect(searchterms, SIGNAL(returnPressed()), // this, SLOT(slotReturnPressed()) ); // debug( "setup ready" ); // QWidget *tmpwidget = qApp->focusWidget(); // debug ("current keyboard focus: %s", tmpwidget?tmpwidget->name():"0"); }