CRLView::CRLView( QWidget* parent, const char* name, bool modal ) : QDialog( parent, name, modal ), _process(0) { QVBoxLayout* topLayout = new QVBoxLayout( this, 10, 4 ); topLayout->addWidget( new QLabel( i18n("CRL cache dump:"), this ) ); _textView = new QTextEdit( this ); _textView->setFont( KGlobalSettings::fixedFont() ); _textView->setTextFormat( QTextEdit::LogText ); topLayout->addWidget( _textView ); QHBoxLayout* hbLayout = new QHBoxLayout( topLayout ); _updateButton = new KPushButton( i18n("&Update"), this ); _closeButton = new KPushButton( KStdGuiItem::close(), this ); hbLayout->addWidget( _updateButton ); hbLayout->addStretch(); hbLayout->addWidget( _closeButton ); // connections: connect( _updateButton, SIGNAL( clicked() ), this, SLOT( slotUpdateView() ) ); connect( _closeButton, SIGNAL( clicked() ), this, SLOT( close() ) ); resize( _textView->fontMetrics().width( 'M' ) * 80, _textView->fontMetrics().lineSpacing() * 25 ); _timer = new QTimer( this ); connect( _timer, SIGNAL(timeout()), SLOT(slotAppendBuffer()) ); }
void RandRConfig::load() { kDebug() << "LOAD"; if (!m_display->isValid()) return; qDeleteAll(m_outputList); m_outputList.clear(); QList<QGraphicsItem*> items = m_scene->items(); foreach(QGraphicsItem *i, items) m_scene->removeItem(i); OutputMap outputs = m_display->currentScreen()->outputs(); OutputMap::iterator it; // FIXME: adjust it to run on a multi screen system CollapsibleWidget *w; OutputGraphicsItem *o; foreach(RandROutput *output, outputs) { o = new OutputGraphicsItem(output); m_scene->addItem(o); connect(o, SIGNAL(itemChanged(OutputGraphicsItem*)), this, SLOT(slotAdjustOutput(OutputGraphicsItem*))); OutputConfig *c = new OutputConfig(0, output, o); w = m_container->insertWidget(c, output->name()); m_outputList.append(w); kDebug() << "Rect: " << output->rect(); connect(c, SIGNAL(updateView()), this, SLOT(slotUpdateView())); }
CRLView::CRLView( QWidget* parent ) : QDialog( parent ), _process(0) { QVBoxLayout* topLayout = new QVBoxLayout( this ); topLayout->setSpacing( 4 ); topLayout->setMargin( 10 ); topLayout->addWidget( new QLabel( i18n("CRL cache dump:"), this ) ); _textView = new QTextEdit( this ); _textView->setFont( KGlobalSettings::fixedFont() ); _textView->setReadOnly(true); topLayout->addWidget( _textView ); QHBoxLayout* hbLayout = new QHBoxLayout(); topLayout->addItem( hbLayout ); _updateButton = new KPushButton( i18n("&Update"), this ); _closeButton = new KPushButton( KStandardGuiItem::close(), this ); hbLayout->addWidget( _updateButton ); hbLayout->addStretch(); hbLayout->addWidget( _closeButton ); // connections: connect( _updateButton, SIGNAL(clicked()), this, SLOT(slotUpdateView()) ); connect( _closeButton, SIGNAL(clicked()), this, SLOT(close()) ); resize( _textView->fontMetrics().width( 'M' ) * 80, _textView->fontMetrics().lineSpacing() * 25 ); _timer = new QTimer( this ); connect( _timer, SIGNAL(timeout()), SLOT(slotAppendBuffer()) ); }
void RandRConfig::load(void) { if (!m_display->isValid()) { kDebug() << "Invalid display! Aborting config load."; return; } m_scene->clear(); qDeleteAll(m_outputList); m_outputList.clear(); m_configs.clear(); // objects deleted above OutputMap outputs = m_display->currentScreen()->outputs(); #ifdef HAS_RANDR_1_3 RandROutput *primary = m_display->currentScreen()->primaryOutput(); if (RandR::has_1_3) { // disconnect while we repopulate the combo box disconnect(primaryDisplayBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed())); disconnect(primaryDisplayBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePrimaryDisplay())); primaryDisplayBox->clear(); primaryDisplayBox->addItem(i18nc("No display selected", "None")); } #endif //HAS_RANDR_1_3 // FIXME: adjust it to run on a multi screen system CollapsibleWidget *w; OutputGraphicsItem *o; OutputConfigList preceding; foreach(RandROutput *output, outputs) { OutputConfig *config = new OutputConfig(this, output, preceding, unifyOutputs->isChecked()); m_configs.append( config ); preceding.append( config ); QString description = output->isConnected() ? i18n("%1 (Connected)", output->name()) : output->name(); w = m_container->insertWidget(config, description); if(output->isConnected()) { w->setExpanded(true); kDebug() << "Output rect:" << output->rect(); } connect(config, SIGNAL(connectedChanged(bool)), this, SLOT(outputConnectedChanged(bool))); m_outputList.append(w); o = new OutputGraphicsItem(config); m_scene->addItem(o); connect(o, SIGNAL(itemChanged(OutputGraphicsItem*)), this, SLOT(slotAdjustOutput(OutputGraphicsItem*))); connect(config, SIGNAL(updateView()), this, SLOT(slotUpdateView())); connect(config, SIGNAL(optionChanged()), this, SIGNAL(changed())); #ifdef HAS_RANDR_1_3 if (RandR::has_1_3 && output->isConnected()) { primaryDisplayBox->addItem(output->name(), QVariant::fromValue(output->id())); if (primary == output) { primaryDisplayBox->setCurrentIndex(primaryDisplayBox->count()-1); } } #endif //HAS_RANDR_1_3 }