Beispiel #1
0
ConnectorTool::ConnectorTool( KivioView* parent ) : Kivio::MouseTool(parent, "Connector Mouse Tool")
{
  m_connectorAction = new Kivio::MouseToolAction(i18n("Straight Connector"), "kivio_connector", 0,
    actionCollection(), "connector");
  connect(m_connectorAction, SIGNAL(toggled(bool)), this, SLOT(setActivated(bool)));
  connect(m_connectorAction, SIGNAL(activated()), this, SLOT(activateStraight()));
  connect(m_connectorAction, SIGNAL(doubleClicked()), this, SLOT(makePermanent()));
  m_connectorAction->setExclusiveGroup("ConnectorTool");

  m_polyLineAction = new Kivio::MouseToolAction(i18n("Polyline Connector"), "kivio_connector", 0,
    actionCollection(), "polyLineConnector");
  connect(m_polyLineAction, SIGNAL(toggled(bool)), this, SLOT(setActivated(bool)));
  connect(m_polyLineAction, SIGNAL(activated()), this, SLOT(activatePolyline()));
  connect(m_connectorAction, SIGNAL(doubleClicked()), this, SLOT(makePermanent()));
  m_polyLineAction->setExclusiveGroup("ConnectorTool");

  m_permanent = false;

  m_type = StraightConnector;
  m_mode = stmNone;
  m_pDragData = 0;

  m_pConnectorCursor1 = new QCursor(BarIcon("kivio_connector_cursor1",KivioFactory::global()),2,2);
  m_pConnectorCursor2 = new QCursor(BarIcon("kivio_connector_cursor2",KivioFactory::global()),2,2);
}
Beispiel #2
0
void KSSLInfoDlg::setSecurityInQuestion(bool isIt)
{
    d->inQuestion = isIt;
    if(KSSL::doesSSLWork())
    {
        if(isIt)
        {
            d->pixmap->setPixmap(BarIcon("halfencrypted"));
            if(d->m_secCon)
            {
                d->info->setText(i18n("The main part of this document is secured with SSL, but some parts are not."));
            }
            else
            {
                d->info->setText(i18n("Some of this document is secured with SSL, but the main part is not."));
            }
        }
        else
        {
            if(d->m_secCon)
            {
                d->pixmap->setPixmap(BarIcon("encrypted"));
                d->info->setText(i18n("Current connection is secured with SSL."));
            }
            else
            {
                d->pixmap->setPixmap(BarIcon("decrypted"));
                d->info->setText(i18n("Current connection is not secured with SSL."));
            }
        }
    }
}
KMyMoneyBriefSchedule::KMyMoneyBriefSchedule(QWidget *parent, const char *name )
  : kScheduleBriefWidget(parent,name, WStyle_Customize | WStyle_NoBorder)
{
  KIconLoader *ic = KGlobal::iconLoader();
  m_nextButton->setPixmap(BarIcon(QString::fromLatin1("1rightarrow")));
  m_prevButton->setPixmap(BarIcon(QString::fromLatin1("1leftarrow")));

  connect(m_prevButton, SIGNAL(clicked()), this, SLOT(slotPrevClicked()));
  connect(m_nextButton, SIGNAL(clicked()), this, SLOT(slotNextClicked()));
  connect(m_closeButton, SIGNAL(clicked()), this, SLOT(hide()));
  connect(m_skipButton, SIGNAL(clicked()), this, SLOT(slotSkipClicked()));
  connect(m_buttonEnter, SIGNAL(clicked()), this, SLOT(slotEnterClicked()));

  KGuiItem skipGuiItem(  i18n("&Skip"),
                          QIconSet(ic->loadIcon("player_fwd", KIcon::Small, KIcon::SizeSmall)),
                          i18n("Skip this transaction"),
                          i18n("Use this button to skip this transaction"));
  m_skipButton->setGuiItem(skipGuiItem);

  KGuiItem enterGuiItem(  i18n("&Enter"),
                          QIconSet(ic->loadIcon("key_enter", KIcon::Small, KIcon::SizeSmall)),
                          i18n("Record this transaction into the register"),
                          i18n("Use this button to record this transaction"));
  m_buttonEnter->setGuiItem(enterGuiItem);
}
Beispiel #4
0
  void
NaughtyApplet::slotLoad(uint l)
{
  if (l > monitor_->triggerLevel())
    button_->setPixmap(BarIcon("naughty-sad"));
  else
    button_->setPixmap(BarIcon("naughty-happy"));
}
Beispiel #5
0
KSSLInfoDlg::KSSLInfoDlg(bool secureConnection, QWidget *parent, const char *name, bool modal)
    : KDialog(parent, name, modal, Qt::WDestructiveClose), d(new KSSLInfoDlgPrivate)
{
    QVBoxLayout *topLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    d->m_secCon = secureConnection;
    d->m_layout = new QGridLayout(topLayout, 3, 3, KDialog::spacingHint());
    d->m_layout->setColStretch(1, 1);
    d->m_layout->setColStretch(2, 1);

    d->pixmap = new QLabel(this);
    d->m_layout->addWidget(d->pixmap, 0, 0);

    d->info = new QLabel(this);
    d->m_layout->addWidget(d->info, 0, 1);

    if(KSSL::doesSSLWork())
    {
        if(d->m_secCon)
        {
            d->pixmap->setPixmap(BarIcon("encrypted"));
            d->info->setText(i18n("Current connection is secured with SSL."));
        }
        else
        {
            d->pixmap->setPixmap(BarIcon("decrypted"));
            d->info->setText(i18n("Current connection is not secured with SSL."));
        }
    }
    else
    {
        d->pixmap->setPixmap(BarIcon("decrypted"));
        d->info->setText(i18n("SSL support is not available in this build of KDE."));
    }
    d->m_layout->addRowSpacing(0, 50); // give minimum height to look better

    QHBoxLayout *buttonLayout = new QHBoxLayout(topLayout, KDialog::spacingHint());
    buttonLayout->addStretch(1);

    KPushButton *button;

    if(KSSL::doesSSLWork())
    {
        button = new KPushButton(KGuiItem(i18n("C&ryptography Configuration..."), "configure"), this);
        connect(button, SIGNAL(clicked()), SLOT(launchConfig()));
        buttonLayout->addWidget(button);
    }

    button = new KPushButton(KStdGuiItem::close(), this);
    connect(button, SIGNAL(clicked()), SLOT(close()));
    buttonLayout->addWidget(button);

    button->setFocus();

    setCaption(i18n("KDE SSL Information"));
    d->inQuestion = false;
}
Beispiel #6
0
SMLConnector::SMLConnector( KivioView* view )
 : Kivio::MouseTool(view, "SMLConnector")
{
  m_connectorAction = new KToggleAction(i18n("Polyline Connector"), "", 0,
    actionCollection(), "sml_connector");
  connect(m_connectorAction, SIGNAL(toggled(bool)), this, SLOT(setActivated(bool)));

  m_mode = stmNone;

  m_pConnectorCursor1 = new QCursor(BarIcon("kivio_connector_cursor1",KivioFactory::global()),2,2);
  m_pConnectorCursor2 = new QCursor(BarIcon("kivio_connector_cursor2",KivioFactory::global()),2,2);
}
Beispiel #7
0
void kMyMoneyCalendar::init(const QDate &dt)
{
  styleControl = new QPushButton(i18n("Select Style"), this);
  yearForward = new QToolButton(this);
  yearBackward = new QToolButton(this);
  monthForward = new QToolButton(this);
  monthBackward = new QToolButton(this);
  selectMonth = new QToolButton(this);
  selectYear = new QToolButton(this);
  line = new KLineEdit(this);
  val = new KDateValidator(this);
  fontsize = 10;

  d->selectWeek = new QToolButton(this);

  KMenu* kpopupmenuNew = new KMenu(this);
  kpopupmenuNew->addAction(i18n("Week"), this, SLOT(slotSetStyleWeekly()));
  kpopupmenuNew->addAction(i18n("Month"), this, SLOT(slotSetStyleMonthly()));
  styleControl->setMenu(kpopupmenuNew);

  styleControl->setToolTip(i18n("Choose Style"));
  yearForward->setToolTip(i18n("Next year"));
  yearBackward->setToolTip(i18n("Previous year"));
  monthForward->setToolTip(i18n("Next month"));
  monthBackward->setToolTip(i18n("Previous month"));
  d->selectWeek->setToolTip(i18n("Select a week"));
  selectMonth->setToolTip(i18n("Select a month"));
  selectYear->setToolTip(i18n("Select a year"));

  // -----
  setFontSize(10);
  line->setValidator(val);
  line->installEventFilter(this);
  yearForward->setIcon(QIcon(BarIcon("arrow-right-double")));
  yearBackward->setIcon(QIcon(BarIcon("arrow-left-double")));
  monthForward->setIcon(QIcon(BarIcon("arrow-right")));
  monthBackward->setIcon(QIcon(BarIcon("arrow-left")));
  setDate(dt); // set button texts
  connect(table, SIGNAL(dateChanged(QDate)), SLOT(dateChangedSlot(QDate)));
  connect(table, SIGNAL(tableClicked()), SLOT(tableClickedSlot()));
  connect(monthForward, SIGNAL(clicked()), SLOT(monthForwardClicked()));
  connect(monthBackward, SIGNAL(clicked()), SLOT(monthBackwardClicked()));
  connect(yearForward, SIGNAL(clicked()), SLOT(yearForwardClicked()));
  connect(yearBackward, SIGNAL(clicked()), SLOT(yearBackwardClicked()));
  connect(d->selectWeek, SIGNAL(clicked()), SLOT(selectWeekClicked()));
  connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked()));
  connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked()));
  connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed()));
  if (table)
    table->setFocus();
}
void KDevIDEExtension::createGlobalSettingsPage(KDialogBase *dlg)
{
    KConfig* config = kapp->config();
    QVBox *vbox = dlg->addVBoxPage(i18n("General"), i18n("General"), BarIcon("kdevelop", KIcon::SizeMedium) );
    gsw = new SettingsWidget(vbox, "general settings widget");

    gsw->projectsURL->setMode((int)KFile::Directory);

    config->setGroup("General Options");
    gsw->lastProjectCheckbox->setChecked(config->readBoolEntry("Read Last Project On Startup",true));
    gsw->outputFont->setFont( config->readFontEntry( "OutputViewFont" ) );
    config->setGroup("MakeOutputView");
    gsw->lineWrappingCheckBox->setChecked(config->readBoolEntry("LineWrapping",true));
    gsw->dirNavigMsgCheckBox->setChecked(config->readBoolEntry("ShowDirNavigMsg",false));
    gsw->compileOutputCombo->setCurrentItem(config->readNumEntry("CompilerOutputLevel",2));
    gsw->forceCLocaleRadio->setChecked( config->readBoolEntry( "ForceCLocale", true ) );
    gsw->userLocaleRadio->setChecked( !config->readBoolEntry( "ForceCLocale", true ) );

    config->setGroup("General Options");
    gsw->projectsURL->setURL(config->readPathEntry("DefaultProjectsDir", QDir::homeDirPath()+"/"));
    gsw->designerButtonGroup->setButton( config->readNumEntry( "DesignerApp", 0 ) );

    QString DesignerSetting = config->readEntry( "DesignerSetting", "ExternalDesigner" );
    gsw->qtDesignerRadioButton->setChecked( DesignerSetting == "ExternalDesigner" );
    gsw->seperateAppRadioButton->setChecked( DesignerSetting == "ExternalKDevDesigner" );
    gsw->embeddedDesignerRadioButton->setChecked( DesignerSetting == "EmbeddedKDevDesigner" );

    config->setGroup("TerminalEmulator");
    gsw->terminalEdit->setText( config->readEntry( "TerminalApplication", QString::fromLatin1("konsole") ) );
    bool useKDESetting = config->readBoolEntry( "UseKDESetting", true );
    gsw->useKDETerminal->setChecked( useKDESetting );
    gsw->useOtherTerminal->setChecked( !useKDESetting );
}
Beispiel #9
0
ChatViewSearchBar::ChatViewSearchBar(QWidget *parent)
    : QWidget(parent)
{
    ui.setupUi(this);
    ui.hideButton->setIcon(BarIcon("dialog-close"));
    ui.searchUpButton->setIcon(SmallIcon("go-up"));
    ui.searchDownButton->setIcon(SmallIcon("go-down"));
    _searchDelayTimer.setSingleShot(true);

    layout()->setContentsMargins(0, 0, 0, 0);

    hide();

    ActionCollection *coll = QtUi::actionCollection("General");

    QAction *toggleSearchBar = coll->action("ToggleSearchBar");
    connect(toggleSearchBar, SIGNAL(toggled(bool)), SLOT(setVisible(bool)));

    Action *hideSearchBar = coll->add<Action>("HideSearchBar", toggleSearchBar, SLOT(setChecked(bool)));
    hideSearchBar->setShortcutConfigurable(false);
    hideSearchBar->setShortcut(Qt::Key_Escape);

    connect(ui.hideButton, SIGNAL(clicked()), toggleSearchBar, SLOT(toggle()));
    connect(ui.searchEditLine, SIGNAL(textChanged(const QString &)), this, SLOT(delaySearch()));
    connect(&_searchDelayTimer, SIGNAL(timeout()), this, SLOT(search()));
}
Beispiel #10
0
KstChangeFileDialog::KstChangeFileDialog(QWidget* parent,
                                           const char* name,
                                           bool modal,
                                           Qt::WindowFlags fl)
: QDialog(parent, fl) {
  setupUi(this);

  connect(_clearFilter, SIGNAL(clicked()), _filter, SLOT(clear()));
  connect(_clearFilter, SIGNAL(clicked()), ChangeFileCurveList, SLOT(clearSelection()));
  connect(_filter, SIGNAL(textChanged(const QString&)), this, SLOT(updateSelection(const QString&)));
  connect(ChangeFileClear, SIGNAL(clicked()), _filter, SLOT(clear()));
  connect(ChangeFileClear, SIGNAL(clicked()), ChangeFileCurveList, SLOT(clearSelection()));
  connect(ChangeFileSelectAll, SIGNAL(clicked()), _filter, SLOT(clear()));
  connect(ChangeFileSelectAll, SIGNAL(clicked()), this, SLOT(selectAll()));
  connect(ChangeFileApply, SIGNAL(clicked()), this, SLOT(applyFileChange()));
  connect(ChangeFileOK, SIGNAL(clicked()), this, SLOT(OKFileChange()));
  connect(_allFromFile, SIGNAL(clicked()), _filter, SLOT(clear()));
  connect(_allFromFile, SIGNAL(clicked()), this, SLOT(allFromFile()));
  connect(_duplicateSelected, SIGNAL(toggled(bool)), _duplicateDependents, SLOT(setEnabled(bool)));
  connect(_dataFile, SIGNAL(textChanged(const QString&)), this, SLOT(sourceChanged(const QString&)));
  connect(_configureSource, SIGNAL(clicked()), this, SLOT(configureSource()));

  _dataFile->completionObject()->setDir(QDir::currentPath());
  _dataFile->setMode(KFile::File | KFile::Directory | KFile::ExistingOnly);

  _clearFilter->setPixmap(BarIcon("locationbar_erase"));
  _duplicateDependents->setEnabled(_duplicateSelected->isChecked());
  _configWidget = 0L;
  _first = true;
}
Beispiel #11
0
KstChangeFileDialogI::KstChangeFileDialogI(QWidget* parent,
                                           Qt::WindowFlags fl)
: QDialog(parent, fl) {

  setupUi(this);

  connect(_clearFilter, SIGNAL(clicked()), _filter, SLOT(clear()));
  connect(_clearFilter, SIGNAL(clicked()), ChangeFileCurveList, SLOT(clearSelection()));
  connect(_filter, SIGNAL(textChanged(const QString&)), this, SLOT(updateSelection(const QString&)));
  connect(ChangeFileCancel, SIGNAL(clicked()), this, SLOT(reject()));
  connect(ChangeFileClear, SIGNAL(clicked()), _filter, SLOT(clear()));
  connect(ChangeFileClear, SIGNAL(clicked()), ChangeFileCurveList, SLOT(clearSelection()));
  connect(ChangeFileSelectAll, SIGNAL(clicked()), _filter, SLOT(clear()));
  connect(ChangeFileSelectAll, SIGNAL(clicked()), this, SLOT(selectAll()));
  connect(ChangeFileApply, SIGNAL(clicked()), this, SLOT(applyFileChange()));
  connect(ChangeFileOK, SIGNAL(clicked()), this, SLOT(OKFileChange()));
  connect(_allFromFile, SIGNAL(clicked()), _filter, SLOT(clear()));
  connect(_allFromFile, SIGNAL(clicked()), this, SLOT(allFromFile()));
  connect(_duplicateSelected, SIGNAL(toggled(bool)), _duplicateDependents, SLOT(setEnabled(bool)));
  
  _dataFile->completionObject()->setDir(QDir::currentPath());
  _clearFilter->setIcon(BarIcon("locationbar_erase"));
  _duplicateDependents->setEnabled(_duplicateSelected->isChecked());
  _first = true;
}
void FileSelectorPart::slotConfigWidget( KDialogBase * dlg )
{
	QVBox* vbox = dlg->addVBoxPage( i18n("File Selector"), i18n("File Selector"), BarIcon( info()->icon(), KIcon::SizeMedium) );
    KFSConfigPage* page = new KFSConfigPage( vbox, 0, m_filetree );
    connect( dlg, SIGNAL( okClicked( ) ), page, SLOT( apply( ) ) );
    // ### implement reload
}
//-----------------------------------------------------------------------------
HighscoresDialog::HighscoresDialog(int rank, QWidget *parent)
    : KPageDialog(parent), _rank(rank), _tab(0)
{
//     kDebug(11001) << ": HighscoresDialog";

    setWindowTitle( i18n("Highscores") );
// TODO    setButtons( Close|User1|User2 );
// TODO    setDefaultButton( Close );
    if ( internal->nbGameTypes()>1 )
        setFaceType( KPageDialog::Tree );
    else
        setFaceType( KPageDialog::Plain );
// TODO    setButtonGuiItem( User1, KGuiItem(i18n("Configure..."), QLatin1String( "configure" )) );
// TODO    setButtonGuiItem( User2, KGuiItem(i18n("Export...")) );
    connect( this, SIGNAL(user1Clicked()), SLOT(slotUser1()) );
    connect( this, SIGNAL(user2Clicked()), SLOT(slotUser2()) );

    for (uint i=0; i<internal->nbGameTypes(); i++) {
        QString title = internal->manager.gameTypeLabel(i, Manager::I18N);
        QString icon = internal->manager.gameTypeLabel(i, Manager::Icon);
        HighscoresWidget *hsw = new HighscoresWidget(0);
        KPageWidgetItem *pageItem = new KPageWidgetItem( hsw, title);
        pageItem->setIcon( KIcon( BarIcon(icon, KIconLoader::SizeLarge) ) );
        addPage( pageItem );
        _pages.append(pageItem);
        connect(hsw, SIGNAL(tabChanged(int)), SLOT(tabChanged(int)));
    }

    connect(this, SIGNAL(currentPageChanged(KPageWidgetItem*,KPageWidgetItem*)),
            SLOT(highscorePageChanged(KPageWidgetItem*,KPageWidgetItem*)));
    setCurrentPage(_pages[internal->gameType()]);
}
Beispiel #14
0
void TKAction::updateLayout(QWidget* base)
{
  QLabel* textLabel = (QLabel*)base->child("text");
  QLabel* pixLabel = (QLabel*)base->child("pixmap");
  QWidget* w = (QWidget*)base->child("widget");

  if (!textLabel || !pixLabel || !w)
    return;

  if (!text().isEmpty() && m_imode != TK::IconOnly ) {
    textLabel->setText(text());
    textLabel->show();
  } else
    textLabel->hide();

  QPixmap pix;
  if (hasIcon())
    pix = iconSet(KIcon::Small).pixmap();

  if (!icon().isEmpty())
    pix = BarIcon(icon());

  if (!pix.isNull() && m_imode != TK::TextOnly) {
    pixLabel->setPixmap(pix);
    pixLabel->show();
  } else
    pixLabel->hide();

  base->setFixedWidth( w->sizeHint().width() +
                       (textLabel->isVisible() ? textLabel->sizeHint().width():0) +
                       (pixLabel->isVisible() ? pixLabel->sizeHint().width():0) );
}
Beispiel #15
0
ConfigDlg::ConfigDlg(QWidget *parent, const char *name)
 : KDialogBase(KDialogBase::TreeList, WStyle_DialogBorder, parent, name, true, "Settings", KDialogBase::Ok|KDialogBase::Cancel)
{
  setShowIconsInTreeList(true);
  setMinimumSize(600,400);

  enableButtonSeparator(true);
  unfoldTreeList();
  
  QVBox *frame;

  QStringList path;

  path << i18n("Languages");
  setFolderIcon(path, BarIcon("protoeditor", KIcon::SizeSmall));

  QValueList<LanguageSettings*> llist = Protoeditor::self()->settings()->languageSettingsList();
  QValueList<LanguageSettings*>::iterator it;
  for(it = llist.begin(); it != llist.end(); ++it)
  {
    path.clear();
    path << i18n("Languages") << (*it)->languageName();
    frame = addVBoxPage(path, (*it)->languageName(), BarIcon((*it)->iconName(), KIcon::SizeSmall));
    frame->setSpacing(0);
    frame->setMargin(0);
    m_langSettingsWidgets.append((*it)->createSettingsWidget(frame));
  }

  path.clear();
  path << i18n("Sites");
  frame= addVBoxPage(path, i18n("Sites"), BarIcon("package_network", KIcon::SizeSmall));
  frame->setSpacing(0);
  frame->setMargin(0);
  m_siteSettingsWidget = new SiteSettingsWidget(frame);//->reparent(((QWidget*)frame), 0, QPoint());

  path.clear();
  path << i18n("External Applications");
  frame = addVBoxPage(path, i18n("External Applications"), BarIcon("gear", KIcon::SizeSmall));
  frame->setSpacing(0);
  frame->setMargin(0);
  m_extAppSettingsWidget = new ExtAppSettingsWidget(frame, i18n("External Applications"));//->reparent(((QWidget*)frame), 0, QPoint());

  resize(QSize(590, 300).expandedTo(minimumSizeHint()));
}
void ConfigWidgetProxy::slotProjectConfigWidget( KDialogBase * dlg )
{
	TitleMap::Iterator it = _projectTitleMap.begin();
	while ( it != _projectTitleMap.end() )
	{
		_pageMap.insert( dlg->addVBoxPage( it.data().first, it.data().first, BarIcon( it.data().second, KIcon::SizeMedium ) ), it.key() );
		++it;
	}
	
	connect( dlg, SIGNAL(aboutToShowPage(QWidget*)), this, SLOT( slotAboutToShowPage(QWidget*)) );	
	connect( dlg, SIGNAL(destroyed()), this, SLOT(slotConfigWidgetDestroyed()) );
}
Beispiel #17
0
CMapToolEraser::CMapToolEraser(KActionCollection *actionCollection,CMapManager *manager,QObject *parent)
	: CMapToolBase(actionCollection,
                   i18n("Eraser"),
                   BarIcon("kmud_eraser.png"),
                   manager,"toolsEraser",0,parent)
{

	QBitmap delete_cb( 32, 32, delete_cb_bits, TRUE );
	QBitmap delete_cm( 32, 32, delete_cm_bits, TRUE );

	deleteCursor = new QCursor( delete_cb, delete_cm, 1,1);
}
Beispiel #18
0
KoContextHelpAction::KoContextHelpAction( KActionCollection* parent, QWidget* /*popupParent*/ )
    : KToggleAction( KIcon(BarIcon("help-contents")), i18n("Context Help"), parent)
{
    Q_ASSERT(parent);
    setShortcut(KShortcut("CTRL+Qt::SHIFT+F1"));

	m_popup = new KoContextHelpPopup( 0L );
	connect( m_popup, SIGNAL( wantsToBeClosed() ), this, SLOT( closePopup() ) );
	connect( this, SIGNAL( toggled( bool ) ), m_popup, SLOT( setShown( bool ) ) );
	connect( m_popup, SIGNAL( linkClicked( const QString& ) ), this, SIGNAL( linkClicked( const QString& ) ) );
    parent->addAction("help_context", this );
}
Beispiel #19
0
KManualProxyDlg::KManualProxyDlg( QWidget* parent, const char* name )
                :KProxyDialogBase( parent, name, true,
                                   i18n("Manual Proxy Configuration") )
{
    mDlg = new ManualProxyDlgUI (this);
    setMainWidget( mDlg );

    mDlg->pbCopyDown->setPixmap( BarIcon("down", KIcon::SizeSmall) );
    QSizePolicy sizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed,
                            mDlg->pbCopyDown->sizePolicy().hasHeightForWidth() );
    mDlg->pbCopyDown->setSizePolicy( sizePolicy );

    init();
}
YahooChatSession::YahooChatSession( Kopete::Protocol *protocol, const Kopete::Contact *user,
	Kopete::ContactPtrList others, const char *name )
: Kopete::ChatSession( user, others, protocol,  name )
{
	kdDebug(YAHOO_GEN_DEBUG) << k_funcinfo << endl;
	Kopete::ChatSessionManager::self()->registerChatSession( this );
	setInstance(protocol->instance());

	// Add Actions
	new KAction( i18n( "Buzz Contact" ), QIconSet(BarIcon("bell")), "Ctrl+G", this, SLOT( slotBuzzContact() ), actionCollection(), "yahooBuzz" ) ;
	new KAction( i18n( "Show User Info" ), QIconSet(BarIcon("idea")), 0, this, SLOT( slotUserInfo() ), actionCollection(), "yahooShowInfo" ) ;
	new KAction( i18n( "Request Webcam" ), QIconSet(BarIcon("webcamreceive")), 0, this, SLOT( slotRequestWebcam() ), actionCollection(), "yahooRequestWebcam" ) ;
	new KAction( i18n( "Invite to view your Webcam" ), QIconSet(BarIcon("webcamsend")), 0, this, SLOT( slotInviteWebcam() ), actionCollection(), "yahooSendWebcam" ) ;
	new KAction( i18n( "Send File" ), QIconSet(BarIcon("attach")), 0, this, SLOT( slotSendFile() ), actionCollection(), "yahooSendFile" );

	YahooContact *c = static_cast<YahooContact*>( others.first() );
	connect( c, SIGNAL( displayPictureChanged() ), this, SLOT( slotDisplayPictureChanged() ) );
	m_image = new QLabel( 0L, "kde toolbar widget" );
	new KWidgetAction( m_image, i18n( "Yahoo Display Picture" ), 0, this, SLOT( slotDisplayPictureChanged() ), actionCollection(), "yahooDisplayPicture" );
	if(c->hasProperty(Kopete::Global::Properties::self()->photo().key())  )
	{
		connect( Kopete::ChatSessionManager::self() , SIGNAL(viewActivated(KopeteView* )) , this, SLOT(slotDisplayPictureChanged()) );
	}
VoiceBox::VoiceBox
	(QHBox *parent, VoiceDialog *voiceDialog, staffPropFrm *staffPropForm, unsigned int VoiceNumber, NVoice *voice) :
	QVBox(parent), parent_(parent), theVoice_(voice), voiceDialog_(voiceDialog), staffPropForm_(staffPropForm)  {

	this->setSpacing(KDialog::spacingHint());

	//  Stem direction selection
	stemDirection_ = new QButtonGroup(1, Horizontal, this);
	stemDirection_->setSizePolicy
		(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));

	up_ = new QRadioButton(stemDirection_);
	QToolTip::add(up_, i18n("Stems up"));

	individual_ = new QRadioButton(stemDirection_);
	QToolTip::add(individual_, i18n("Stems individual"));

	down_ = new QRadioButton(stemDirection_);
	QToolTip::add(down_, i18n("Stems down"));

	stemDirection_->setButton(voice->stemPolicy_);


	//  Rest position slider
	restPosition_ = new QSlider(-8, 8, 1, voice->yRestOffs_, QSlider::Vertical, this);
	restPosition_->setMinimumHeight(0x80);
	restPosition_->setTickmarks(QSlider::Both);
	restPosition_->setTickInterval(4);
	QToolTip::add(restPosition_, i18n("Rest position"));


	//  Delete button
	remove_ = new QPushButton(this);
	remove_->setPixmap(BarIcon("editdelete", KIcon::SizeSmall));
	remove_->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
        QToolTip::add(remove_, i18n("Delete"));
	connect(remove_, SIGNAL(clicked()), this, SLOT(destroy()));


	//  Voice number label
	voiceNumber_ = new QLabel(this);
	voiceNumber_->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
	QWhatsThis::add
		(voiceNumber_,
		 i18n("The number of the voice to which the settings above apply.")
		);

	renumber(VoiceNumber);

}
Beispiel #22
0
KMFilterActionWithAddressWidget::KMFilterActionWithAddressWidget( QWidget* parent, const char* name )
  : QWidget( parent, name )
{
  QHBoxLayout *hbl = new QHBoxLayout(this);
  hbl->setSpacing(4);
  mLineEdit = new KLineEdit(this);
  hbl->addWidget( mLineEdit, 1 /*stretch*/ );
  mBtn = new QPushButton( QString::null ,this );
  mBtn->setPixmap( BarIcon( "contents", KIcon::SizeSmall ) );
  mBtn->setFixedHeight( mLineEdit->sizeHint().height() );
  hbl->addWidget( mBtn );

  connect( mBtn, SIGNAL(clicked()),
	   this, SLOT(slotAddrBook()) );
}
Beispiel #23
0
DlgPerformance::DlgPerformance( QWidget * parent )
    : QWidget( parent )
{
    m_dlg = new Ui_DlgPerformanceBase();
    m_dlg->setupUi( this );

    QFont labelFont = m_dlg->descLabel->font();
    labelFont.setBold( true );
    m_dlg->descLabel->setFont( labelFont );

    m_dlg->cpuLabel->setPixmap( BarIcon( "cpu", 32 ) );
//     m_dlg->memoryLabel->setPixmap( BarIcon( "kcmmemory", 32 ) ); // TODO: enable again when proper icon is available

    connect( m_dlg->kcfg_MemoryLevel, SIGNAL(changed(int)), this, SLOT(radioGroup_changed(int)) );
}
Beispiel #24
0
ConfFilters::ConfFilters(TQWidget *parent, const char *name)
: TQWidget(parent, name)
{
	m_filters = new TDEListView(this);
	m_filters->addColumn(i18n("Mime Type"));
	m_filters->addColumn(i18n("Command"));
	m_filters->setFrameStyle(TQFrame::WinPanel|TQFrame::Sunken);
	m_filters->setLineWidth(1);
	m_filters->setSorting(-1);
	m_filters->header()->setStretchEnabled(true, 1);
	connect(m_filters, TQT_SIGNAL(doubleClicked(TQListViewItem*)), TQT_SLOT(slotChange()));

	m_add = new TQPushButton(this);
	m_add->setPixmap(BarIcon("document-new"));
	m_remove = new TQPushButton(this);
	m_remove->setIconSet(BarIconSet("remove"));
	m_change = new TQPushButton(this);
	m_change->setIconSet(BarIconSet("filter"));
	m_up = new TQPushButton(this);
	m_up->setIconSet(BarIconSet("go-up"));
	m_down = new TQPushButton(this);
	m_down->setIconSet(BarIconSet("go-down"));
	connect(m_add, TQT_SIGNAL(clicked()), TQT_SLOT(slotAdd()));
	connect(m_change, TQT_SIGNAL(clicked()), TQT_SLOT(slotChange()));
	connect(m_remove, TQT_SIGNAL(clicked()), TQT_SLOT(slotRemove()));
	connect(m_up, TQT_SIGNAL(clicked()), TQT_SLOT(slotUp()));
	connect(m_down, TQT_SIGNAL(clicked()), TQT_SLOT(slotDown()));
	TQToolTip::add(m_add, i18n("Add filter"));
	TQToolTip::add(m_change, i18n("Modify filter"));
	TQToolTip::add(m_remove, i18n("Remove filter"));
	TQToolTip::add(m_up, i18n("Move filter up"));
	TQToolTip::add(m_down, i18n("Move filter down"));

	TQHBoxLayout	*l0 = new TQHBoxLayout(this, 10, 10);
	TQVBoxLayout	*l1 = new TQVBoxLayout(0, 0, 0);
	l0->addWidget(m_filters, 1);
	l0->addLayout(l1, 0);
	l1->addWidget(m_add);
	l1->addWidget(m_change);
	l1->addWidget(m_remove);
	l1->addSpacing(10);
	l1->addWidget(m_up);
	l1->addWidget(m_down);
	l1->addStretch(1);
	updateButton();
	connect(m_filters, TQT_SIGNAL(selectionChanged ()),TQT_SLOT(updateButton()));
}
QIconSet WidgetDatabase::iconSet( int id )
{
    setupDataBase( id );
    WidgetDatabaseRecord *r = at( id );
    if ( !r )
	return QIconSet();
#if !defined(UIC) && !defined(RESOURCE)
    if ( !r->icon ) {
	if ( r->iconSet.isEmpty() )
	    return QIconSet();
	QPixmap pix = BarIcon( r->iconSet, KDevDesignerPartFactory::instance() );
	if ( pix.isNull() )
	    pix = QPixmap( r->iconSet );
	r->icon = new QIconSet( pix );
    }
    return *r->icon;
#else
    return QIconSet();
#endif
}
Beispiel #26
0
//-----------------------------------------------------------------------------
HighscoresDialog::HighscoresDialog(int rank, QWidget *parent)
    : KDialogBase(internal->nbGameTypes()>1 ? TreeList : Plain,
                  i18n("Highscores"), Close|User1|User2, Close,
                  parent, "show_highscores", true, true,
                  KGuiItem(i18n("Configure..."), "configure"),
                  KGuiItem(i18n("Export..."))), _rank(rank), _tab(0)
{
    _widgets.resize(internal->nbGameTypes(), 0);

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

        connect(this, SIGNAL(aboutToShowPage(QWidget *)),
                SLOT(createPage(QWidget *)));
        showPage(internal->gameType());
    } else {
KateConfigDialog::KateConfigDialog(KateMainWindow *parent, Kate::View *view)
    : KDialogBase(KDialogBase::TreeList, i18n("Configure"), KDialogBase::Ok | KDialogBase::Apply | KDialogBase::Cancel | KDialogBase::Help,
                  KDialogBase::Ok, parent, "configdialog")
{
    KConfig *config = KateApp::self()->config();

    KWin::setIcons(winId(), KateApp::self()->icon(), KateApp::self()->miniIcon());

    actionButton(KDialogBase::Apply)->setEnabled(false);

    mainWindow = parent;

    setMinimumSize(600, 400);

    v = view;

    pluginPages.setAutoDelete(false);
    editorPages.setAutoDelete(false);

    QStringList path;

    setShowIconsInTreeList(true);

    path.clear();
    path << i18n("Application");
    setFolderIcon(path, SmallIcon("kate", KIcon::SizeSmall));

    path.clear();

    // BEGIN General page
    path << i18n("Application") << i18n("General");
    QFrame *frGeneral = addPage(path, i18n("General Options"), BarIcon("gohome", KIcon::SizeSmall));

    QVBoxLayout *lo = new QVBoxLayout(frGeneral);
    lo->setSpacing(KDialog::spacingHint());
    config->setGroup("General");

    // GROUP with the one below: "Appearance"
    QButtonGroup *bgStartup = new QButtonGroup(1, Qt::Horizontal, i18n("&Appearance"), frGeneral);
    lo->addWidget(bgStartup);

    // show full path in title
    config->setGroup("General");
    cb_fullPath = new QCheckBox(i18n("&Show full path in title"), bgStartup);
    cb_fullPath->setChecked(mainWindow->viewManager()->getShowFullPath());
    QWhatsThis::add(cb_fullPath, i18n("If this option is checked, the full document path will be shown in the window caption."));
    connect(cb_fullPath, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));


    // GROUP with the one below: "Behavior"
    bgStartup = new QButtonGroup(1, Qt::Horizontal, i18n("&Behavior"), frGeneral);
    lo->addWidget(bgStartup);

    // sync the konsole ?
    cb_syncKonsole = new QCheckBox(bgStartup);
    cb_syncKonsole->setText(i18n("Sync &terminal emulator with active document"));
    cb_syncKonsole->setChecked(parent->syncKonsole);
    QWhatsThis::add(cb_syncKonsole, i18n("If this is checked, the built in Konsole will <code>cd</code> to the directory "
                                         "of the active document when started and whenever the active document changes, "
                                         "if the document is a local file."));
    connect(cb_syncKonsole, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));

    // modified files notification
    cb_modNotifications = new QCheckBox(i18n("Wa&rn about files modified by foreign processes"), bgStartup);
    cb_modNotifications->setChecked(parent->modNotification);
    QWhatsThis::add(cb_modNotifications, i18n("If enabled, when Kate receives focus you will be asked what to do with "
                                              "files that have been modified on the hard disk. If not enabled, you will "
                                              "be asked what to do with a file that has been modified on the hard disk only "
                                              "when that file gains focus inside Kate."));
    connect(cb_modNotifications, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));

    // GROUP with the one below: "Meta-informations"
    bgStartup = new QButtonGroup(1, Qt::Horizontal, i18n("Meta-Information"), frGeneral);
    lo->addWidget(bgStartup);

    // save meta infos
    cb_saveMetaInfos = new QCheckBox(bgStartup);
    cb_saveMetaInfos->setText(i18n("Keep &meta-information past sessions"));
    cb_saveMetaInfos->setChecked(KateDocManager::self()->getSaveMetaInfos());
    QWhatsThis::add(cb_saveMetaInfos, i18n("Check this if you want document configuration like for example "
                                           "bookmarks to be saved past editor sessions. The configuration will be "
                                           "restored if the document has not changed when reopened."));
    connect(cb_saveMetaInfos, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));

    // meta infos days
    QHBox *hbDmf = new QHBox(bgStartup);
    hbDmf->setEnabled(KateDocManager::self()->getSaveMetaInfos());
    QLabel *lDmf = new QLabel(i18n("&Delete unused meta-information after:"), hbDmf);
    sb_daysMetaInfos = new QSpinBox(0, 180, 1, hbDmf);
    sb_daysMetaInfos->setSpecialValueText(i18n("(never)"));
    sb_daysMetaInfos->setSuffix(i18n(" day(s)"));
    sb_daysMetaInfos->setValue(KateDocManager::self()->getDaysMetaInfos());
    lDmf->setBuddy(sb_daysMetaInfos);
    connect(cb_saveMetaInfos, SIGNAL(toggled(bool)), hbDmf, SLOT(setEnabled(bool)));
    connect(sb_daysMetaInfos, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));

    lo->addStretch(1); // :-] works correct without autoadd
    // END General page

    path.clear();

    // BEGIN Session page
    path << i18n("Application") << i18n("Sessions");
    QFrame *frSessions = addPage(path, i18n("Session Management"), BarIcon("history", KIcon::SizeSmall));

    lo = new QVBoxLayout(frSessions);
    lo->setSpacing(KDialog::spacingHint());

    // GROUP with the one below: "Startup"
    bgStartup = new QButtonGroup(1, Qt::Horizontal, i18n("Elements of Sessions"), frSessions);
    lo->addWidget(bgStartup);

    // restore view  config
    cb_restoreVC = new QCheckBox(bgStartup);
    cb_restoreVC->setText(i18n("Include &window configuration"));
    config->setGroup("General");
    cb_restoreVC->setChecked(config->readBoolEntry("Restore Window Configuration", true));
    QWhatsThis::add(cb_restoreVC, i18n("Check this if you want all your views and frames restored each time you open Kate"));
    connect(cb_restoreVC, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));

    QRadioButton *rb1, *rb2, *rb3;

    sessions_start = new QButtonGroup(1, Qt::Horizontal, i18n("Behavior on Application Startup"), frSessions);
    lo->add(sessions_start);

    sessions_start->setRadioButtonExclusive(true);
    sessions_start->insert(rb1 = new QRadioButton(i18n("&Start new session"), sessions_start), 0);
    sessions_start->insert(rb2 = new QRadioButton(i18n("&Load last-used session"), sessions_start), 1);
    sessions_start->insert(rb3 = new QRadioButton(i18n("&Manually choose a session"), sessions_start), 2);

    config->setGroup("General");
    QString sesStart(config->readEntry("Startup Session", "manual"));
    if(sesStart == "new")
        sessions_start->setButton(0);
    else if(sesStart == "last")
        sessions_start->setButton(1);
    else
        sessions_start->setButton(2);

    connect(rb1, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
    connect(rb2, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
    connect(rb3, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));

    sessions_exit = new QButtonGroup(1, Qt::Horizontal, i18n("Behavior on Application Exit or Session Switch"), frSessions);
    lo->add(sessions_exit);

    sessions_exit->setRadioButtonExclusive(true);
    sessions_exit->insert(rb1 = new QRadioButton(i18n("&Do not save session"), sessions_exit), 0);
    sessions_exit->insert(rb2 = new QRadioButton(i18n("&Save session"), sessions_exit), 1);
    sessions_exit->insert(rb3 = new QRadioButton(i18n("&Ask user"), sessions_exit), 2);

    config->setGroup("General");
    QString sesExit(config->readEntry("Session Exit", "save"));
    if(sesExit == "discard")
        sessions_exit->setButton(0);
    else if(sesExit == "save")
        sessions_exit->setButton(1);
    else
        sessions_exit->setButton(2);

    connect(rb1, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
    connect(rb2, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
    connect(rb3, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));

    lo->addStretch(1); // :-] works correct without autoadd
    // END Session page

    path.clear();

    // file selector page
    path << i18n("Application") << i18n("File Selector");

    QVBox *page = addVBoxPage(path, i18n("File Selector Settings"), BarIcon("fileopen", KIcon::SizeSmall));
    fileSelConfigPage = new KFSConfigPage(page, "file selector config page", mainWindow->fileselector);
    connect(fileSelConfigPage, SIGNAL(changed()), this, SLOT(slotChanged()));
    path.clear();

    path << i18n("Application") << i18n("Document List");
    page = addVBoxPage(path, i18n("Document List Settings"), BarIcon("view_text", KIcon::SizeSmall));
    filelistConfigPage = new KFLConfigPage(page, "file list config page", mainWindow->filelist);
    connect(filelistConfigPage, SIGNAL(changed()), this, SLOT(slotChanged()));
    path.clear();

    path << i18n("Application") << i18n("Plugins");
    /*QVBox **/ page = addVBoxPage(path, i18n("Plugin Manager"), BarIcon("connect_established", KIcon::SizeSmall));
    KateConfigPluginPage *configPluginPage = new KateConfigPluginPage(page, this);
    connect(configPluginPage, SIGNAL(changed()), this, SLOT(slotChanged()));

    // Tools->External Tools menu
    path.clear();
    path << i18n("Application") << i18n("External Tools");
    page = addVBoxPage(path, i18n("External Tools"), BarIcon("configure", KIcon::SizeSmall));
    configExternalToolsPage = new KateExternalToolsConfigWidget(page, "external tools config page");
    connect(configExternalToolsPage, SIGNAL(changed()), this, SLOT(slotChanged()));

    // editor widgets from kwrite/kwdialog
    path.clear();
    path << i18n("Editor");
    setFolderIcon(path, SmallIcon("edit", KIcon::SizeSmall));

    for(uint i = 0; i < KTextEditor::configInterfaceExtension(v->document())->configPages(); i++)
    {
        path.clear();
        path << i18n("Editor") << KTextEditor::configInterfaceExtension(v->document())->configPageName(i);
        /*QVBox **/ page = addVBoxPage(path, KTextEditor::configInterfaceExtension(v->document())->configPageFullName(i),
                                       KTextEditor::configInterfaceExtension(v->document())->configPagePixmap(i, KIcon::SizeSmall));

        KTextEditor::ConfigPage *cPage = KTextEditor::configInterfaceExtension(v->document())->configPage(i, page);
        connect(cPage, SIGNAL(changed()), this, SLOT(slotChanged()));
        editorPages.append(cPage);
    }

    KatePluginList &pluginList(KatePluginManager::self()->pluginList());
    for(unsigned int i = 0; i < pluginList.size(); ++i)
    {
        if(pluginList[i].load && Kate::pluginConfigInterfaceExtension(pluginList[i].plugin))
            addPluginPage(pluginList[i].plugin);
    }

    enableButtonSeparator(true);
    dataChanged = false;
    unfoldTreeList();
}
void RubySupportPart::projectConfigWidget(KDialogBase *dlg)
{
    QVBox *vbox = dlg->addVBoxPage(i18n("Ruby"), i18n("Ruby"), BarIcon("ruby_config.png", KIcon::SizeMedium, KIcon::DefaultState, RubySupportPart::instance()));
    RubyConfigWidget *w = new RubyConfigWidget(*projectDom(), (QWidget *)vbox, "ruby config widget");
    connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
}
void KIGPDialog::setupLookPage(const QString& path) {
    QFrame *page = new QFrame();
	KPageWidgetItem *pageItem = new KPageWidgetItem( page, i18n("Look") );
	pageItem->setHeader(i18n("Page Look"));
	pageItem->setIcon(KIcon(BarIcon("fill-color", KIconLoader::SizeMedium )) );
	addPage(pageItem);

        KConfigGroup look = m_config->group("Look");
    QVBoxLayout *vlay = new QVBoxLayout( page );
    vlay->setMargin( 0 );

    QLabel *label;

    label = new QLabel( i18n("&Page title:"), page);
    vlay->addWidget(label);

    m_title = new QLineEdit(i18n("Image Gallery for %1", path), page);
    vlay->addWidget( m_title );
    label->setBuddy(m_title);

    m_imagesPerRow = new KIntNumInput(look.readEntry("ImagesPerRow", 4), page);
    m_imagesPerRow->setRange( 1, 8, 1 );
    m_imagesPerRow->setSliderEnabled( true );
    m_imagesPerRow->setLabel( i18n("I&mages per row:") );
    vlay->addWidget( m_imagesPerRow );

    QGridLayout *grid = new QGridLayout();
    grid->setMargin( 2 );
    grid->setSpacing( 2 );
    vlay->addLayout( grid );

    m_imageName = new QCheckBox( i18n("Show image file &name"), page);
    m_imageName->setChecked( look.readEntry("ImageName", true) );
    grid->addWidget( m_imageName, 0, 0 );

    m_imageSize = new QCheckBox( i18n("Show image file &size"), page);
    m_imageSize->setChecked( look.readEntry("ImageSize", false) );
    grid->addWidget( m_imageSize, 0, 1 );

    m_imageProperty = new QCheckBox( i18n("Show image &dimensions"), page);
    m_imageProperty->setChecked( look.readEntry("ImageProperty", false) );
    grid->addWidget( m_imageProperty, 1, 0 );

    QHBoxLayout *hlay11  = new QHBoxLayout( );
    vlay->addLayout( hlay11 );

    m_fontName = new QComboBox( page );
    QStringList standardFonts;
    KFontChooser::getFontList(standardFonts, 0);
    m_fontName->addItems( standardFonts );
    m_fontName->setItemText( m_fontName->currentIndex(), look.readEntry("FontName", KGlobalSettings::generalFont().family() ) );

    label = new QLabel( i18n("Fon&t name:"), page );
    label->setBuddy( m_fontName );
    hlay11->addWidget( label );
    hlay11->addStretch( 1 );
    hlay11->addWidget( m_fontName );

    QHBoxLayout *hlay12  = new QHBoxLayout( );
    vlay->addLayout( hlay12 );

    m_fontSize = new QSpinBox( page );
    m_fontSize->setMinimum(6);
    m_fontSize->setMaximum(15);
    m_fontSize->setSingleStep(1);
    m_fontSize->setValue( look.readEntry("FontSize", 14) );

    label = new QLabel( i18n("Font si&ze:"), page );
    label->setBuddy( m_fontSize );
    hlay12->addWidget( label );
    hlay12->addStretch( 1 );
    hlay12->addWidget( m_fontSize );

    QHBoxLayout *hlay1  = new QHBoxLayout();
    vlay->addLayout( hlay1 );

    m_foregroundColor = new KColorButton(page);
    m_foregroundColor->setColor( QColor( look.readEntry("ForegroundColor", "#d0ffd0") ) );

    label = new QLabel( i18n("&Foreground color:"), page);
    label->setBuddy( m_foregroundColor );
    hlay1->addWidget( label );
    hlay1->addStretch( 1 );
    hlay1->addWidget(m_foregroundColor);

    QHBoxLayout *hlay2 = new QHBoxLayout();
    vlay->addLayout( hlay2 );

    m_backgroundColor = new KColorButton(page);
    m_backgroundColor->setColor( QColor(look.readEntry("BackgroundColor", "#333333") ) );

    label = new QLabel( i18n("&Background color:"), page);
    hlay2->addWidget( label );
    label->setBuddy( m_backgroundColor );
    hlay2->addStretch( 1 );
    hlay2->addWidget(m_backgroundColor);

    vlay->addStretch(1);
}
void KIGPDialog::setupThumbnailPage(const QString& path) {
    Q_UNUSED (path);

    QFrame *page = new QFrame();
    KPageWidgetItem *pageItem = new KPageWidgetItem( page, i18n("Thumbnails") );
    pageItem->setHeader(i18n("Thumbnails"));
    pageItem->setIcon(KIcon(BarIcon("view-preview", KIconLoader::SizeMedium )) );
    addPage(pageItem);

    KConfigGroup group =  m_config->group("Thumbnails");
    QLabel *label;

    QVBoxLayout *vlay = new QVBoxLayout( page );
    vlay->setMargin( 0 );

    QHBoxLayout *hlay3 = new QHBoxLayout();
    vlay->addLayout( hlay3 );

    m_imageFormat = new QComboBox(page);
    QStringList lstImgageFormat;
    lstImgageFormat<<"JPEG"<<"PNG";
    m_imageFormat->addItems(lstImgageFormat);
    m_imageFormat->setItemText( m_imageFormat->currentIndex(), group.readEntry("ImageFormat", "JPEG") );

    label = new QLabel( i18n("Image format f&or the thumbnails:"), page);
    hlay3->addWidget( label );
    label->setBuddy( m_imageFormat );
    hlay3->addStretch( 1 );
    hlay3->addWidget(m_imageFormat);

    m_thumbnailSize = new KIntNumInput(group.readEntry("ThumbnailSize", 140), page);
    m_thumbnailSize->setRange(10, 1000, 1 );
    m_thumbnailSize->setLabel( i18n("Thumbnail size:") );
    m_thumbnailSize->setSliderEnabled(true);
    vlay->addWidget( m_thumbnailSize );

    QGridLayout *grid = new QGridLayout();
    grid->setMargin( 2 );
    grid->setSpacing( 2 );
    vlay->addLayout( grid );

    QHBoxLayout *hlay4 = new QHBoxLayout();
    vlay->addLayout( hlay4 );
    const bool colorDepthSet = group.readEntry("ColorDepthSet", false);
    m_colorDepthSet = new QCheckBox(i18n("&Set different color depth:"), page);
    m_colorDepthSet->setChecked(colorDepthSet);
    hlay4->addWidget( m_colorDepthSet );

    m_colorDepth = new QComboBox(page);
    QStringList lst;
    lst<<"1"<<"8"<<"16"<<"32";
    m_colorDepth->addItems( lst );
    m_colorDepth->setItemText(m_colorDepth->currentIndex(), group.readEntry("ColorDepth", "8"));
    m_colorDepth->setEnabled(colorDepthSet);
    hlay4->addWidget( m_colorDepth );

    connect(m_colorDepthSet, SIGNAL( toggled(bool) ),
            m_colorDepth, SLOT( setEnabled(bool) ) );

    vlay->addStretch(1);

}