AutoStartPage::AutoStartPage(QWidget* parent) : QWidget(parent), ui(new Ui::AutoStartPage) { ui->setupUi(this); connect(ui->addButton, SIGNAL(clicked()), SLOT(addButton_clicked())); connect(ui->editButton, SIGNAL(clicked()), SLOT(editButton_clicked())); connect(ui->deleteButton, SIGNAL(clicked()), SLOT(deleteButton_clicked())); restoreSettings(); }
EnvironmentPage::EnvironmentPage(LxQt::Settings *settings, QWidget *parent) : QWidget(parent), m_settings(settings), ui(new Ui::EnvironmentPage) { ui->setupUi(this); connect(ui->addButton, SIGNAL(clicked()), SLOT(addButton_clicked())); connect(ui->deleteButton, SIGNAL(clicked()), SLOT(deleteButton_clicked())); connect(ui->treeWidget, SIGNAL(itemChanged(QTreeWidgetItem*,int)), SLOT(itemChanged(QTreeWidgetItem*,int))); /* restoreSettings() is called from SessionConfigWindow after connections with DefaultApps have been set up */ }
CWDialog::CWDialog(QWidget* parent, ScribusDoc* doc, const char* name, bool modal) : QDialog (parent), m_Doc(doc) { setupUi(this); setObjectName(name); setModal(modal); int h, s, v; ScColor color; QString colorName; connectSlots(false); // setup combobox typeCombo->addItem(colorWheel->getTypeDescription(colorWheel->Monochromatic), colorWheel->Monochromatic); typeCombo->addItem(colorWheel->getTypeDescription(colorWheel->Analogous), colorWheel->Analogous); typeCombo->addItem(colorWheel->getTypeDescription(colorWheel->Complementary), colorWheel->Complementary); typeCombo->addItem(colorWheel->getTypeDescription(colorWheel->Split), colorWheel->Split); typeCombo->addItem(colorWheel->getTypeDescription(colorWheel->Triadic), colorWheel->Triadic); typeCombo->addItem(colorWheel->getTypeDescription(colorWheel->Tetradic), colorWheel->Tetradic); // defects defectCombo->addItem(CommonStrings::trVisionNormal); defectCombo->addItem(CommonStrings::trVisionProtanopia); defectCombo->addItem(CommonStrings::trVisionDeuteranopia); defectCombo->addItem(CommonStrings::trVisionTritanopia); defectCombo->addItem(CommonStrings::trVisionFullColorBlind); // document colors documentColorList->updateBox(m_Doc->PageColors, ColorListBox::fancyPixmap); // preferences prefs = PrefsManager::instance()->prefsFile->getPluginContext("colorwheel"); typeCombo->setCurrentIndex(prefs->getInt("cw_type", 0)); angleSpin->setValue(prefs->getInt("cw_angle", 15)); colorWheel->currentDoc = m_Doc; colorWheel->angle = angleSpin->value(); colorWheel->baseAngle = prefs->getInt("cw_baseangle", 0); colorspaceTab->setCurrentIndex(prefs->getInt("cw_space", 0)); color.setNamedColor(prefs->get("cw_color", "#00000000")); // Handle color previously selected in the document tab if (colorspaceTab->currentWidget() == tabDocument) { colorName = prefs->get("cw_colorname", ""); if (!colorName.isEmpty() && m_Doc->PageColors.contains(colorName)) color = m_Doc->PageColors[colorName]; else color.setColorRGB(0, 0, 0); //Trigger use of defaults } // Handle achromatic colors QColor rgb = ScColorEngine::getRGBColor(color, m_Doc); rgb.getHsv(&h, &s, &v); if (h == -1) { // Reset to defaults colorWheel->baseAngle = 0; colorWheel->currentColorSpace = colorModelCMYK; colorWheel->actualColor = colorWheel->colorByAngle(0); colorspaceTab->setCurrentIndex(0); } else if (colorspaceTab->currentWidget() == tabDocument) { colorWheel->actualColor = color; QList<QListWidgetItem*> results = documentColorList->findItems(colorName, Qt::MatchFixedString|Qt::MatchCaseSensitive); if (results.count() > 0) documentColorList->setCurrentItem(results[0]); } else colorWheel->actualColor = color; resize(QSize(prefs->getInt("cw_width", 640), prefs->getInt("cw_height", 480)).expandedTo(minimumSizeHint())); previewLabel->resize(prefs->getInt("cw_samplex", 300), prefs->getInt("cw_sampley", 100)); // setup colorspaceTab_currentChanged(colorspaceTab->currentIndex()); // signals and slots that cannot be in ui file connect(colorWheel, SIGNAL(clicked(int, const QPoint&)), this, SLOT(colorWheel_clicked(int, const QPoint&))); connect(documentColorList, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(documentColorList_currentChanged(QListWidgetItem *))); connect(colorList, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(colorList_currentChanged(QListWidgetItem *))); connect(angleSpin, SIGNAL(valueChanged(int)), this, SLOT(angleSpin_valueChanged(int))); connect(colorspaceTab, SIGNAL(currentChanged(int)), this, SLOT(colorspaceTab_currentChanged(int))); connect(typeCombo, SIGNAL(activated(int)), this, SLOT(typeCombo_activated(int))); connect(defectCombo, SIGNAL(activated(int)), this, SLOT(defectCombo_activated(int))); connect(addButton, SIGNAL(clicked()), this, SLOT(addButton_clicked())); connect(replaceButton, SIGNAL(clicked()), this, SLOT(replaceButton_clicked())); connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelButton_clicked())); connectSlots(true); }