예제 #1
0
void KEdReplace::textSearchChanged ( const QString &text )
{
    bool state=text.isEmpty();
    enableButton( KDialogBase::User1, !state );
    enableButton( KDialogBase::User2, !state );
    enableButton( KDialogBase::User3, !state );
}
예제 #2
0
void CfsclientwDlg::OnBnClickedButconn()
{
	//m_logoWin.setImage(icon_doing);
	//m_logoWin.refresh();
	m_gifWin.setText("...");
	m_gifWin.refresh();
	//Sleep(100000);
	CComboBox * pcb = (CComboBox*)GetDlgItem(IDC_COMBOSRV);
	CString cstr;
	pcb->GetWindowText(cstr);
	if (cstr == "")
	{
		MessageBox("please select or input a server", "error");
		return;
	}
	if (m_dwM->connectServer(cstr.GetBuffer()) < 0)
	{
		MessageBox("failed to connect this server", "error");
		return;
	}

	dir("/home");
	enableButton("server",   false);
	enableButton("download", true);
	enableButton("connect",  false);
	//Sleep(3000);
	//m_logoWin.setImage(icon_ok);
	m_gifWin.setText("ok");
}
// new list
void KNGroupDialog::slotUser1()
{
  leftLabel->setText(i18n("Downloading groups..."));
  enableButton(User1,false);
  enableButton(User2,false);
  emit(fetchList(a_ccount));
}
예제 #4
0
void KonqProfileDlg::slotTextChanged( const QString & text )
{
  enableButton( BTN_SAVE, !text.isEmpty() );

  // If we type the name of a profile, select it in the list

  QList<QListWidgetItem*> items = d->m_pListView->findItems(text, Qt::MatchCaseSensitive);
  QListWidgetItem * item = !items.isEmpty() ? items.first() : 0;
  d->m_pListView->setCurrentItem(item);

  bool itemSelected = item;
  if ( itemSelected )
  {
    KConfig config( d->m_mapEntries[text], KConfig::SimpleConfig );
    KConfigGroup profile( &config, "Profile" );

    QFileInfo fi( d->m_mapEntries[ item->text() ] );
    itemSelected = itemSelected && fi.isWritable();
    if ( itemSelected )
      item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable );
  }

  enableButton( BTN_RENAME, itemSelected );
  enableButton( BTN_DELETE, itemSelected );
}
예제 #5
0
void EXIFEditDialog::slotItemChanged()
{
    KExiv2Iface::KExiv2 exiv2Iface;
    exiv2Iface.load((*d->currItem).path());
    d->exifData = exiv2Iface.getExif();
    d->iptcData = exiv2Iface.getIptc();
    d->xmpData  = exiv2Iface.getXmp();
    d->captionPage->readMetadata(d->exifData);
    d->datetimePage->readMetadata(d->exifData);
    d->lensPage->readMetadata(d->exifData);
    d->devicePage->readMetadata(d->exifData);
    d->lightPage->readMetadata(d->exifData);
    d->adjustPage->readMetadata(d->exifData);

    d->isReadOnly = !KExiv2Iface::KExiv2::canWriteExif((*d->currItem).path());
    d->page_caption->setEnabled(!d->isReadOnly);
    d->page_datetime->setEnabled(!d->isReadOnly);
    d->page_lens->setEnabled(!d->isReadOnly);
    d->page_device->setEnabled(!d->isReadOnly);
    d->page_light->setEnabled(!d->isReadOnly);
    d->page_adjust->setEnabled(!d->isReadOnly);
    enableButton(Apply, !d->isReadOnly);

    setCaption(QString("%1 (%2/%3) - %4")
               .arg((*d->currItem).fileName())
               .arg(d->urls.indexOf(*(d->currItem))+1)
               .arg(d->urls.count())
               .arg(i18n("Edit EXIF Metadata")) +
               (d->isReadOnly ? QString(" - ") + i18n("(read only)") : QString::null));
    enableButton(User1, *(d->currItem) != d->urls.last());
    enableButton(User2, *(d->currItem) != d->urls.first());
    enableButton(Apply, false);
}
예제 #6
0
void KonviConfigDialog::updateButtons()
{
    static bool only_once = false;
    if (only_once) return;
    only_once = true;

    QMap<QWidget *, KConfigDialogManager *>::iterator it;

    bool has_changed = d->manager->hasChanged() || hasChanged();
    for (it = d->managerForPage.begin();
        it != d->managerForPage.end() && !has_changed;
        ++it)
    {
        has_changed |= (*it)->hasChanged();
    }

    enableButton(Apply, has_changed);

    bool is_default = d->manager->isDefault() && isDefault();
    for (it = d->managerForPage.begin();
        it != d->managerForPage.end() && is_default;
        ++it)
    {
        is_default &= (*it)->isDefault();
    }

    enableButton(Default, !is_default);

    emit widgetModified();
    only_once = false;
}
예제 #7
0
void ConfigChecker::finished(bool ok)
{
	setCursor(KCursor::arrowCursor());
	enableButton(Cancel, false);

	if (ok)
	{
		label()->setText(i18n("Finished testing your system..."));

		QStringList tools = m_tester->testedTools();
		QStringList critical, failure;
		for ( uint i = 0; i < tools.count(); ++i )
		{
			int status = m_tester->statusForTool(tools[i]);
			if ( status == ConfigTest::Critical ) critical.append(tools[i]);
			else if ( status == ConfigTest::Failure ) failure.append(tools[i]);
			new ResultItem(listBox(), tools[i], status, m_tester->resultForTool(tools[i]));
		}

		listBox()->sort();

		QString cap = i18n("Test Results");
		if ( critical.count() > 0 )
			KMessageBox::error(this, i18n("<qt>The following tools did not pass all <b>critical</b> tests:<br>%1<br>Your system is not ready to use. Please consult the results to find out what to fix.</qt>").arg(critical.join(", ")), cap);
		else if ( failure.count() > 0 )
			KMessageBox::information(this, i18n("The following tools did not pass all tests:\n %1\nYou will still be able to use Kile; however, not all features are guaranteed to work.").arg(failure.join(", ")), cap);
		else
			KMessageBox::information(this, i18n("No problems detected, your system is ready to use."), cap);
	}
	else
		label()->setText(i18n("Tests finished abruptly..."));

	enableButton(Ok, true);
	enableButton(User1, true);
}
예제 #8
0
void NamedAreaDialog::slotRemove()
{
    const QString question = i18n("Do you really want to remove this named area?");
    int result = KMessageBox::warningContinueCancel(this, question, i18n("Remove Named Area"),
                 KStandardGuiItem::del());
    if (result == KMessageBox::Cancel)
        return;

    QListWidgetItem* item = m_list->currentItem();

    KCNamedAreaCommand* command = new KCNamedAreaCommand();
    command->setAreaName(item->text());
    command->setReverse(true);
    command->setSheet(m_selection->activeSheet());
    if (!command->execute(m_selection->canvas())) {
        delete command;
        return;
    }
    m_list->takeItem(m_list->row(item));

    if (m_list->count() == 0) {
        enableButtonOk(false);
        enableButton(KDialog::User1, false);
        enableButton(KDialog::User2, false);
        displayAreaValues(QString());
    } else
        displayAreaValues(m_list->currentItem()->text());
}
예제 #9
0
void KonviConfigDialog::show()
{
    QMap<QWidget *, KConfigDialogManager *>::iterator it;

    updateWidgets();
    d->manager->updateWidgets();
    for (it = d->managerForPage.begin(); it != d->managerForPage.end(); ++it)
        (*it)->updateWidgets();

    bool has_changed = d->manager->hasChanged() || hasChanged();
    for (it = d->managerForPage.begin();
        it != d->managerForPage.end() && !has_changed;
        ++it)
    {
        has_changed |= (*it)->hasChanged();
    }

    enableButton(Apply, has_changed);

    bool is_default = d->manager->isDefault() && isDefault();
    for (it = d->managerForPage.begin();
        it != d->managerForPage.end() && is_default;
        ++it)
    {
        is_default &= (*it)->isDefault();
    }

    enableButton(Default, !is_default);
    d->shown = true;
    KDialogBase::show();
}
예제 #10
0
void MatrixFunctionDialog::checkValues() {
	if (!ui.teEquation->isValid()) {
		enableButton(KDialog::Ok, false);
		return;
	}

	enableButton(KDialog::Ok, true);
}
예제 #11
0
void UploadDialog::startTransfer()
{
    if( !m_itdb || !m_uploadList->model()->hasChildren() )
        return;

    QTreeWidgetItem* selected = m_ipodAlbumList->currentItem();
    IpodAlbumItem* ipodAlbum  = dynamic_cast<IpodAlbumItem*>( selected );

    if( !selected || !ipodAlbum )
        return;

    m_transferring         = true;
    Itdb_PhotoAlbum* album = ipodAlbum->photoAlbum();

    enableButton(User1, false);
    enableButton(Close, false);

    GError* err = 0;

    while( QTreeWidgetItem* item = m_uploadList->takeTopLevelItem(0) )
    {
#define item static_cast<ImageListItem*>(item)
        kDebug() << "Uploading "      << item->pathSrc()
                 << " to ipod album " << album->name ;

        Itdb_Artwork* art = itdb_photodb_add_photo( m_itdb, QFile::encodeName( item->pathSrc() ), 0, 0, &err );

        if( !art )
        {
            if( err )
            {
                kDebug() << "Error adding photo " << item->pathSrc() << " to database:"
                              << err->message ;
                err = 0;
            }
        }
        else
        {
            itdb_photodb_photoalbum_add_photo( m_itdb, album, art, 0 );
        }

        delete item;
#undef item
    }

    itdb_photodb_write( m_itdb, &err );
    if( err ) kDebug() << "Failed with error: " << err->message ;

    reloadIpodAlbum( ipodAlbum, album );

    IpodAlbumItem* library = static_cast<IpodAlbumItem*>( m_ipodAlbumList->topLevelItem(0) );
    reloadIpodAlbum( library, library->photoAlbum() );

    m_transferring = false;

    enableButtons();
}
예제 #12
0
void KOCRBase::stopOCR()
{
    enableFields(true);

    enableButton( User1, true );   /* start ocr */
    enableButton( User2, false );  /* Cancel    */
    enableButton( Close, true );

    stopAnimation();

}
예제 #13
0
NamedAreaDialog::NamedAreaDialog(QWidget* parent, Selection* selection)
        : KDialog(parent)
        , m_selection(selection)
{
    setButtons(KDialog::Ok | KDialog::Close | KDialog::User1 | KDialog::User2 | KDialog::User3);
    setButtonsOrientation(Qt::Vertical);
    setButtonText(KDialog::Ok, i18n("&Select"));
    setButtonText(KDialog::User1, i18n("&Remove"));
    setButtonText(KDialog::User2, i18n("&Edit..."));
    setButtonText(KDialog::User3, i18n("&New..."));
    setCaption(i18n("Named Areas"));
    setModal(true);
    setObjectName("NamedAreaDialog");

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

    QVBoxLayout *vboxLayout = new QVBoxLayout(widget);
    vboxLayout->setMargin(0);
    vboxLayout->setSpacing(KDialog::spacingHint());

    m_list = new KListWidget(this);
    m_list->setSortingEnabled(true);
    vboxLayout->addWidget(m_list);

    m_rangeName = new QLabel(this);
    m_rangeName->setText(i18n("Area: %1", QString()));
    vboxLayout->addWidget(m_rangeName);

    const QList<QString> namedAreas = m_selection->activeSheet()->map()->namedAreaManager()->areaNames();
    for (int i = 0; i < namedAreas.count(); ++i)
        m_list->addItem(namedAreas[i]);

    if (m_list->count() == 0) {
        enableButtonOk(false);
        enableButton(KDialog::User1, false);
        enableButton(KDialog::User2, false);
        m_list->setCurrentRow(0);
    }

    connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
    connect(this, SIGNAL(cancelClicked()), this, SLOT(slotClose()));
    connect(this, SIGNAL(user1Clicked()), this, SLOT(slotRemove()));
    connect(this, SIGNAL(user2Clicked()), this, SLOT(slotEdit()));
    connect(this, SIGNAL(user3Clicked()), this, SLOT(slotNew()));
    connect(m_list, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(slotOk()));
    connect(m_list, SIGNAL(currentTextChanged(const QString&)),
            this, SLOT(displayAreaValues(const QString&)));

    if (m_list->count() > 0)
        m_list->setCurrentItem(m_list->item(0));

    m_list->setFocus();
}
예제 #14
0
void MirrorAddDlg::updateButton(const QString &text)
{
    bool enabled = false;
    KUrl url(text);
    if (url.isValid() && !url.protocol().isEmpty() && url.hasPath())
    {
        enabled = true;
    }
    enableButton(KDialog::Yes, enabled);
    enableButton(KDialog::User1, enabled);
}
예제 #15
0
void KonqProfileDlg::slotDeleteProfile()
{
    if(!d->m_pListView->currentItem())
        return;
  KonqProfileMap::Iterator it = d->m_mapEntries.find( d->m_pListView->currentItem()->text() );

  if ( it != d->m_mapEntries.end() && QFile::remove( it.value() ) )
      loadAllProfiles();

  enableButton( BTN_RENAME, d->m_pListView->currentItem() != 0 );
  enableButton( BTN_DELETE, d->m_pListView->currentItem() != 0 );
}
예제 #16
0
void KOCRBase::startOCR()
{
    /* en- and disable the buttons */
    kdDebug(28000) << "Base: Starting OCR" << endl;

    enableFields(false);
    enableButton( User1, false );   /* Start OCR */
    enableButton( User2, true );    /* Stop OCR */
    enableButton( Close, true );

    startAnimation();
}
예제 #17
0
void KNGroupBrowser::slotReceiveList(KNGroupListData* d)
{
  enableButton(User1,true);
  enableButton(User2,true);

  if (d) {  // d==0 if something has gone wrong...
    delete allList;
    allList = d->extractList();
    incrementalFilter=false;
    slotRefilter();
  }
}
void RemoveRedEyesWindow::locatorChanged()
{
    if (d->hasLocator)
    {
        enableButton(User1, true); // correction button
        enableButton(User2, true); // testrun button
    }
    else
    {
        enableButton(User1, false); // correction button
        enableButton(User2, false); // testrun button
    }
}
예제 #19
0
ConfigChecker::ConfigChecker(QWidget* parent) :
	KDialogBase( Plain, i18n("System Check"), Ok|Cancel|User1, Ok, parent, 0, true, true, KGuiItem("&Save Results...")),
	m_tester(0L)
{
	QGridLayout *layout = new QGridLayout(plainPage(), 1, 1);
	m_widget = new ConfigCheckerWidget(plainPage());
	layout->addWidget(m_widget, 1, 1);

	enableButton(Ok, false);
	enableButton(User1, false);

	run();
}
// new groups
void KNGroupDialog::slotUser2()
{
  QDate lastDate = a_ccount->lastNewFetch();
  KDialog *dlg = new KDialog( this );
  dlg->setCaption( i18n("New Groups") );
  dlg->setButtons( Ok | Cancel );

  QGroupBox *btnGrp = new QGroupBox( i18n("Check for New Groups"), dlg );
  dlg->setMainWidget(btnGrp);
  QGridLayout *topL = new QGridLayout( btnGrp );

  QRadioButton *takeLast = new QRadioButton( i18n("Created since last check:"), btnGrp );
  topL->addWidget(takeLast, 0, 0, 1, 2 );

  QLabel *l = new QLabel(KGlobal::locale()->formatDate(lastDate, KLocale::LongDate),btnGrp);
  topL->addWidget(l, 1, 1, Qt::AlignLeft);

  connect(takeLast, SIGNAL(toggled(bool)), l, SLOT(setEnabled(bool)));

  QRadioButton *takeCustom = new QRadioButton( i18n("Created since this date:"), btnGrp );
  topL->addWidget(takeCustom, 2, 0, 1, 2 );

  dateSel = new KDatePicker( lastDate, btnGrp );
  dateSel->setMinimumSize(dateSel->sizeHint());
  topL->addWidget(dateSel, 3, 1, Qt::AlignLeft);

  connect(takeCustom, SIGNAL(toggled(bool)), this, SLOT(slotDatePickerEnabled(bool)));

  takeLast->setChecked(true);
  dateSel->setEnabled(false);

  topL->addItem( new QSpacerItem(30, 0 ), 0, 0 );

  if (dlg->exec()) {
    if (takeCustom->isChecked())
      lastDate = dateSel->date();
    a_ccount->setLastNewFetch(QDate::currentDate());
    leftLabel->setText(i18n("Checking for new groups..."));
    enableButton(User1,false);
    enableButton(User2,false);
    filterEdit->clear();
    subCB->setChecked(false);
    newCB->setChecked(true);
    emit(checkNew(a_ccount,lastDate));
    incrementalFilter=false;
    slotRefilter();
  }

  delete dlg;
}
예제 #21
0
ErrorMessage::ErrorMessage (QWidget *parent)
	: KDialogBase (parent, "errorDialog", false, 0, KDialogBase::Close | KDialogBase::Help | KDialogBase::User1, KDialogBase::Close, true, i18n("Help on &Error") )
{
	connect( this, SIGNAL( user1Clicked() ), this, SLOT( showHelpOnError() ) );
	connect( this, SIGNAL( helpClicked() ), this, SLOT( errorMessageHelp() ) );
	setCaption( i18n("Error Dialog") );
	setButtonWhatsThis( KDialogBase::Close, i18n("Closes this error dialog") );
	setButtonWhatsThis( KDialogBase::Help, i18n("Click here to read more on this error dialog in KTurtle's Handbook.") );
	setButtonTip( KDialogBase::Help, i18n("Click here for help using this error dialog") );
	setButtonWhatsThis( KDialogBase::User1, i18n("Click here for help regarding the error you selected in the list. This button will not work when no error is selected.") );
	setButtonTip( KDialogBase::User1, i18n("Click here for help regarding the error you selected.") );
	
	QWidget *baseWidget = new QWidget(this);
	setMainWidget(baseWidget);
	baseLayout = new QVBoxLayout(baseWidget); 
	
	label = new QLabel(baseWidget);
	label->setText( i18n("In this list you find the error(s) that resulted from running your Logo code. \nGood luck!") );
	// \nYou can select an error and click the 'Help on Error' button for help.
	label->setScaledContents(true);
	baseLayout->addWidget(label);
	
	spacer = new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Fixed );
	baseLayout->addItem(spacer);
	
	errTable = new QTable(0, 3, baseWidget);
	errTable->setSelectionMode(QTable::SingleRow);
	errTable->setReadOnly(true);
	errTable->setShowGrid(false);
	errTable->setFocusStyle(QTable::FollowStyle);
	errTable->setLeftMargin(0);
	
	errTable->horizontalHeader()->setLabel( 0, i18n("number") );
	errTable->hideColumn(0); // needed to link with the errorData which stores the tokens, codes, etc.
	
	errTable->horizontalHeader()->setLabel( 1, i18n("line") );
	errTable->setColumnWidth(1, baseWidget->fontMetrics().width("88888") );
	
	errTable->horizontalHeader()->setLabel( 2, i18n("description") );
	errTable->setColumnStretchable(2, true);

	baseLayout->addWidget(errTable);
	
	// Since both help buttons are not working yet. Doc need a section on the Error Dialog!
	enableButton(KDialogBase::Help, false);
	enableButton(KDialogBase::User1, false);
	
	errCount = 1;
}
예제 #22
0
void CommitDialog::showDiffDialog(const QString& fileName)
{
    DiffDialog *l = new DiffDialog(partConfig, this, "diffdialog");

    // disable diff button so user doesn't open the same diff several times (#83018)
    enableButton(User1, false);

    if (l->parseCvsDiff(cvsService, fileName, "", ""))
        l->show();
    else
        delete l;

    // re-enable diff button
    enableButton(User1, true);
}
예제 #23
0
void KSaneDeviceDialog::updateDevicesList()
{
    while (!m_btnGroup->buttons().isEmpty()) {
        delete m_btnGroup->buttons().takeFirst();
    }

    const QList<KSaneWidget::DeviceInfo> list = m_findDevThread->devicesList();
    if (list.isEmpty()) {
        m_btnBox->setTitle(i18n("Sorry. No devices found."));
        m_btnBox->layout()->itemAt(0)->widget()->show();  // explanation
        m_btnBox->layout()->itemAt(1)->widget()->hide();  // scroll area
        enableButton(KDialog::User1, true);
        return;
    }

    delete m_btnLayout;
    m_btnLayout = new QVBoxLayout;
    m_btnContainer->setLayout(m_btnLayout);
    m_btnBox->setTitle(i18n("Found devices:"));
    m_btnBox->layout()->itemAt(0)->widget()->hide();  // explanation
    m_btnBox->layout()->itemAt(1)->widget()->show();  // scroll area

    for (int i=0; i< list.size(); i++) {
        QRadioButton *b = new QRadioButton(this);
        b->setObjectName(list[i].name);
        b->setToolTip(list[i].name);
        b->setText(QString("%1 : %2\n%3")
                    .arg(list[i].vendor)
                    .arg(list[i].model)
                    .arg(list[i].name));

        m_btnLayout->addWidget(b);
        m_btnGroup->addButton(b);
        connect(b, SIGNAL(clicked(bool)), this, SLOT(setAvailable(bool)));
        if((i==0) || (list[i].name == m_selectedDevice)) {
            b->setChecked(true);
            setAvailable(true);
        }
    }

    m_btnLayout->addStretch();

    if(list.size() == 1) {
        button(KDialog::Ok)->animateClick();
    }

    enableButton(KDialog::User1, true);
}
예제 #24
0
파일: photos.cpp 프로젝트: AchillesL/ARM
//???
void Photos::openFiles()
{


    QString path = QFileDialog::getOpenFileName(this,"","/","*.*");
    if( "" != path)
    {
        position = 0;
        imageList.clear();
        imagePath = path;
        //"/"??????stringList
        QStringList stringList = imagePath.split("/");
        //?????и
        stringList.removeLast();
        dirPath = stringList.join("/");
        setPixmap(imagePath);    //??
        enableButton();          //­?
        scanFile(dirPath);       //?

        ui->label->setVisible(false);
    }



}
예제 #25
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);
}
예제 #26
0
void OptionsDialog::slotApply()
{
  global->server = w_server->text();
  global->port = w_port->text().toInt();
  global->timeout = w_timeout->value();
  global->idleHold = w_idleHold->value();
  global->pipeSize = w_pipesize->value();
  global->encoding = KGlobal::charsets()->encodingForName(w_encoding->currentText());
  global->authEnabled = w_auth->isChecked();
  global->user = w_user->text();
  global->secret = w_secret->text();
  global->useCustomColors=c_olorCB->isChecked();
  for(int i=0; i<global->colorCount(); i++)
    global->c_olors[i] = (static_cast<ColorListItem*>(c_List->item(i)))->color();

  global->useCustomFonts=f_ontCB->isChecked();
  for(int i=0; i<global->fontCount(); i++)
    global->f_onts[i] = (static_cast<FontListItem*>(f_List->item(i)))->font();
  if (w_layout[0]->isChecked())
    global->headLayout = 0;
  else
    if (w_layout[1]->isChecked())
      global->headLayout = 1;
    else
      global->headLayout = 2;
  global->maxDefinitions = w_MaxDefinitions->value();
  global->maxBrowseListEntrys = w_Maxbrowse->value();
  global->maxHistEntrys = w_Maxhist->value();
  global->defineClipboard = w_Clipboard->isChecked();
  global->saveHistory = w_Savehist->isChecked();
  emit(optionsChanged());
  enableButton( Apply, false );
  configChanged = false;
}
예제 #27
0
AddViewDialog::AddViewDialog( QHash<QString, ViewFactory*> *viewFactoryDict,
                              QWidget *parent )
  : KDialog( parent),
    mViewFactoryDict( viewFactoryDict )
{
  setCaption( i18n( "Add View" ) );
  setButtons( KDialog::Ok | KDialog::Cancel );
  setDefaultButton( KDialog::Ok );

  mTypeId = 0;

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

  QGridLayout *layout = new QGridLayout( page );
  layout->setMargin( 0 );
  layout->setSpacing( spacingHint() );
  layout->setRowStretch( 1, 1 );
  layout->setColumnStretch( 1, 1 );

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

  mViewNameEdit = new KLineEdit( page );
  connect( mViewNameEdit, SIGNAL( textChanged( const QString& ) ),
           SLOT( textChanged( const QString& ) ) );
  layout->addWidget( mViewNameEdit, 0, 1 );

  QGroupBox *group = new QGroupBox( i18n( "View Type" ), page );
  mTypeGroup = new QButtonGroup;
  mTypeGroup->setExclusive( true );
  connect( mTypeGroup, SIGNAL( buttonClicked( int ) ), 
           this, SLOT( clicked( int ) ) );
  layout->addWidget( group, 1, 0, 1, 2 );
  QGridLayout *groupLayout = new QGridLayout();
  groupLayout->setMargin( KDialog::marginHint() );
  groupLayout->setSpacing( KDialog::spacingHint() );
  group->setLayout( groupLayout );

  int row = 0;
  QHashIterator<QString, ViewFactory*> iter( *mViewFactoryDict );
  while ( iter.hasNext() ) {
    iter.next();
    QRadioButton *button = new QRadioButton( i18n( iter.value()->type().toUtf8() ),
                                             group );
    button->setObjectName( iter.value()->type().toLatin1() );
    mTypeGroup->addButton( button, row );
    label = new QLabel( iter.value()->description(), group );
    label->setWordWrap( true );

    groupLayout->addWidget( button, row, 0, Qt::AlignTop );
    groupLayout->addWidget( label, row, 1, Qt::AlignTop );

    row++;
  }

  mTypeGroup->button( 0 )->setChecked( true );
  mViewNameEdit->setFocus();
  enableButton( KDialog::Ok, false );
}
예제 #28
0
KonqNewSessionDlg::KonqNewSessionDlg( QWidget *parent, QString sessionName )
    : KDialog( parent )
    , d( new KonqNewSessionDlgPrivate( this ) )
{
    d->layout()->setMargin( 0 );
    setMainWidget( d );
    
    setObjectName( QLatin1String( "konq_new_session_dialog" ) );
    setModal( true );
    setCaption( i18nc( "@title:window", "Save Session" ) );
    setButtons( Ok | Cancel );
    setDefaultButton( Ok );
    enableButton( Ok, false );
    
    if(!sessionName.isEmpty())
        d->m_pSessionName->setText(sessionName);
    
    d->m_pSessionName->setFocus();

    connect(this, SIGNAL(okClicked()), SLOT(slotAddSession()));
    connect(d->m_pSessionName, SIGNAL(textChanged(QString)), this,
        SLOT(slotTextChanged(QString)));
    
    resize( sizeHint() );
}
예제 #29
0
KLineEditDlg::KLineEditDlg( const QString&_text, const QString& _value,
                            QWidget *parent )
    : KDialogBase( Plain, QString::null, Ok|Cancel|User1, Ok, parent, 0L, true,
                   true, KStdGuiItem::clear() )
{
    QVBoxLayout *topLayout = new QVBoxLayout( plainPage(), 0, spacingHint() );
    QLabel *label = new QLabel(_text, plainPage() );
    topLayout->addWidget( label, 1 );

    edit = new KLineEdit( plainPage(), 0L );
    edit->setMinimumWidth(edit->sizeHint().width() * 3);
    label->setBuddy(edit);  // please "scheck" style
    //  connect( edit, SIGNAL(returnPressed()), SLOT(accept()) );
    connect( edit, SIGNAL(textChanged(const QString&)),
             SLOT(slotTextChanged(const QString&)) );
    topLayout->addWidget( edit, 1 );

    connect( this, SIGNAL(user1Clicked()), this, SLOT(slotClear()) );
    edit->setText( _value );
    if ( _value.isEmpty() )
    {
        enableButtonOK( false );
        enableButton(KDialogBase::User1, false);
    }
    edit->setSelection(0, edit->text().length());
    edit->setFocus();
}
예제 #30
0
void SwWindow::buttonStateChange(bool state)
{
    m_widget->m_newAlbumBtn->setEnabled(state);
    m_widget->m_reloadAlbumsBtn->setEnabled(state);
    m_widget->m_albumsCoB->setEnabled(state);
    enableButton(User1, state);
}