void KConfigDialogManager::initMaps() { if (s_propertyMap()->isEmpty()) { s_propertyMap()->insert(QStringLiteral("KButtonGroup"), "current"); s_propertyMap()->insert(QStringLiteral("KColorButton"), "color"); s_propertyMap()->insert(QStringLiteral("KColorCombo"), "color"); //s_propertyMap()->insert( "KUrlRequester", "url" ); //s_propertyMap()->insert( "KUrlComboRequester", "url" ); } if (s_changedMap()->isEmpty()) { // QT s_changedMap()->insert(QStringLiteral("QCheckBox"), SIGNAL(stateChanged(int))); s_changedMap()->insert(QStringLiteral("QPushButton"), SIGNAL(clicked(bool))); s_changedMap()->insert(QStringLiteral("QRadioButton"), SIGNAL(toggled(bool))); // We can only store one thing, so you can't have // a ButtonGroup that is checkable. // s_changedMap()->insert("QButtonGroup", SIGNAL(buttonClicked(int))); s_changedMap()->insert(QStringLiteral("QGroupBox"), SIGNAL(toggled(bool))); s_changedMap()->insert(QStringLiteral("QComboBox"), SIGNAL(activated(int))); //qsqlproperty map doesn't store the text, but the value! //s_changedMap()->insert("QComboBox", SIGNAL(textChanged(QString))); s_changedMap()->insert(QStringLiteral("QDateEdit"), SIGNAL(dateChanged(QDate))); s_changedMap()->insert(QStringLiteral("QTimeEdit"), SIGNAL(timeChanged(QTime))); s_changedMap()->insert(QStringLiteral("QDateTimeEdit"), SIGNAL(dateTimeChanged(QDateTime))); s_changedMap()->insert(QStringLiteral("QDial"), SIGNAL(valueChanged(int))); s_changedMap()->insert(QStringLiteral("QDoubleSpinBox"), SIGNAL(valueChanged(double))); s_changedMap()->insert(QStringLiteral("QLineEdit"), SIGNAL(textChanged(QString))); s_changedMap()->insert(QStringLiteral("QSlider"), SIGNAL(valueChanged(int))); s_changedMap()->insert(QStringLiteral("QSpinBox"), SIGNAL(valueChanged(int))); s_changedMap()->insert(QStringLiteral("QTextEdit"), SIGNAL(textChanged())); s_changedMap()->insert(QStringLiteral("QTextBrowser"), SIGNAL(sourceChanged(QString))); s_changedMap()->insert(QStringLiteral("QPlainTextEdit"), SIGNAL(textChanged())); s_changedMap()->insert(QStringLiteral("QTabWidget"), SIGNAL(currentChanged(int))); // KDE s_changedMap()->insert(QStringLiteral("KComboBox"), SIGNAL(activated(int))); s_changedMap()->insert(QStringLiteral("KFontComboBox"), SIGNAL(activated(int))); s_changedMap()->insert(QStringLiteral("KFontRequester"), SIGNAL(fontSelected(QFont))); s_changedMap()->insert(QStringLiteral("KFontChooser"), SIGNAL(fontSelected(QFont))); s_changedMap()->insert(QStringLiteral("KHistoryCombo"), SIGNAL(activated(int))); s_changedMap()->insert(QStringLiteral("KColorCombo"), SIGNAL(activated(QColor))); s_changedMap()->insert(QStringLiteral("KColorButton"), SIGNAL(changed(QColor))); s_changedMap()->insert(QStringLiteral("KDatePicker"), SIGNAL(dateSelected(QDate))); s_changedMap()->insert(QStringLiteral("KDateWidget"), SIGNAL(changed(QDate))); s_changedMap()->insert(QStringLiteral("KDateTimeWidget"), SIGNAL(valueChanged(QDateTime))); s_changedMap()->insert(QStringLiteral("KEditListWidget"), SIGNAL(changed())); s_changedMap()->insert(QStringLiteral("KListWidget"), SIGNAL(itemSelectionChanged())); s_changedMap()->insert(QStringLiteral("KLineEdit"), SIGNAL(textChanged(QString))); s_changedMap()->insert(QStringLiteral("KPasswordEdit"), SIGNAL(textChanged(QString))); s_changedMap()->insert(QStringLiteral("KRestrictedLine"), SIGNAL(textChanged(QString))); s_changedMap()->insert(QStringLiteral("KTextEdit"), SIGNAL(textChanged())); s_changedMap()->insert(QStringLiteral("KUrlRequester"), SIGNAL(textChanged(QString))); s_changedMap()->insert(QStringLiteral("KUrlComboRequester"), SIGNAL(textChanged(QString))); s_changedMap()->insert(QStringLiteral("KUrlComboBox"), SIGNAL(urlActivated(QUrl))); s_changedMap()->insert(QStringLiteral("KButtonGroup"), SIGNAL(changed(int))); }
HistoryManager::HistoryManager(BrowserWindow* window, QWidget* parent) : QWidget(parent) , ui(new Ui::HistoryManager) , m_window(window) { ui->setupUi(this); ui->historyTree->setViewType(HistoryTreeView::HistoryManagerViewType); connect(ui->historyTree, SIGNAL(urlActivated(QUrl)), this, SLOT(urlActivated(QUrl))); connect(ui->historyTree, SIGNAL(urlCtrlActivated(QUrl)), this, SLOT(urlCtrlActivated(QUrl))); connect(ui->historyTree, SIGNAL(urlShiftActivated(QUrl)), this, SLOT(urlShiftActivated(QUrl))); connect(ui->historyTree, SIGNAL(contextMenuRequested(QPoint)), this, SLOT(createContextMenu(QPoint))); connect(ui->deleteB, SIGNAL(clicked()), ui->historyTree, SLOT(removeSelectedItems())); connect(ui->clearAll, SIGNAL(clicked()), this, SLOT(clearHistory())); ui->historyTree->setFocus(); }
KFileMetaDataWidget::Private::Private(KFileMetaDataWidget* parent) : m_rows(), #ifndef KIO_NO_NEPOMUK m_provider(0), #endif m_gridLayout(0), q(parent) { initMetaInfoSettings(); #ifndef KIO_NO_NEPOMUK // TODO: If KFileMetaDataProvider might get a public class in future KDE releases, // the following code should be moved into KFileMetaDataWidget::setModel(): m_provider = new KFileMetaDataProvider(q); connect(m_provider, SIGNAL(loadingFinished()), q, SLOT(slotLoadingFinished())); connect(m_provider, SIGNAL(urlActivated(KUrl)), q, SIGNAL(urlActivated(KUrl))); #endif }
HomeView::HomeView(QWidget *parent) : QWidget(parent) , m_addressBar(0) { m_addressBar = new AddressBar(parent); connect(m_addressBar, SIGNAL(addressEntered(QString)), SLOT(gotoAddress(QString))); m_bookmarks = new BookmarksView(parent); connect(m_bookmarks, SIGNAL(urlSelected(QUrl)), SIGNAL(urlActivated(QUrl))); QVBoxLayout *layout = new QVBoxLayout(this); layout->setMargin(4); layout->setSpacing(4); layout->addWidget(m_addressBar); layout->addWidget(m_bookmarks); }
TermWidgetImpl::TermWidgetImpl(const QString & wdir, const QString & shell, QWidget * parent) : QTermWidget(0, parent) { TermWidgetCount++; QString name("TermWidget_%1"); setObjectName(name.arg(TermWidgetCount)); setFlowControlEnabled(FLOW_CONTROL_ENABLED); setFlowControlWarningEnabled(FLOW_CONTROL_WARNING_ENABLED); propertiesChanged(); setHistorySize(5000); if (!wdir.isNull()) setWorkingDirectory(wdir); if (shell.isNull()) { if (!Properties::Instance()->shell.isNull()) setShellProgram(Properties::Instance()->shell); } else { qDebug() << "Settings custom shell program:" << shell; QStringList parts = shell.split(QRegExp("\\s+"), QString::SkipEmptyParts); qDebug() << parts; setShellProgram(parts.at(0)); parts.removeAt(0); if (parts.count()) setArgs(parts); } setMotionAfterPasting(Properties::Instance()->m_motionAfterPaste); setContextMenuPolicy(Qt::CustomContextMenu); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuCall(const QPoint &))); connect(this, SIGNAL(urlActivated(QUrl)), this, SLOT(activateUrl(const QUrl&))); startShellProgram(); }
BrowserWindow::BrowserWindow() : m_slidingSurface(new QWidget(this)) , m_homeView(new HomeView(m_slidingSurface)) , m_browserView(new BrowserView(m_slidingSurface)) , m_animation(new QPropertyAnimation(this, "slideValue")) { m_slidingSurface->setAutoFillBackground(true); m_homeView->resize(size()); m_browserView->resize(size()); connect(m_homeView, SIGNAL(addressEntered(QString)), SLOT(gotoAddress(QString))); connect(m_homeView, SIGNAL(urlActivated(QUrl)), SLOT(navigate(QUrl))); connect(m_browserView, SIGNAL(menuButtonClicked()), SLOT(showHomeView())); m_animation->setDuration(200); connect(m_animation, SIGNAL(finished()), SLOT(animationFinished())); setSlideValue(0.0f); }
void BrowserWindow::initialize() { m_homeView = new HomeView(this); m_browserView = new BrowserView(this); m_homeView->hide(); m_homeView->resize(size()); m_homeView->move(0, 0); m_browserView->hide(); m_browserView->resize(size()); m_browserView->move(0, 0); connect(m_homeView, SIGNAL(addressEntered(QString)), SLOT(gotoAddress(QString))); connect(m_homeView, SIGNAL(urlActivated(QUrl)), SLOT(navigate(QUrl))); connect(m_browserView, SIGNAL(menuButtonClicked()), SLOT(showHomeView())); m_homeView->setVisible(false); m_browserView->setVisible(false); slide(0); connect(m_timeLine, SIGNAL(frameChanged(int)), SLOT(slide(int))); }
TermWidgetImpl::TermWidgetImpl(const QString & wdir, const QString & shell, QWidget * parent) : QTermWidget(0, parent) { TermWidgetCount++; QString name("TermWidget_%1"); setObjectName(name.arg(TermWidgetCount)); setFlowControlEnabled(FLOW_CONTROL_ENABLED); setFlowControlWarningEnabled(FLOW_CONTROL_WARNING_ENABLED); propertiesChanged(); setHistorySize(5000); if (!wdir.isNull()) setWorkingDirectory(wdir); if (shell.isNull()) { if (!Properties::Instance()->shell.isNull()) setShellProgram(Properties::Instance()->shell); } else { qDebug() << "Settings custom shell program:" << shell; QStringList parts = shell.split(QRegExp("\\s+"), QString::SkipEmptyParts); qDebug() << parts; setShellProgram(parts.at(0)); parts.removeAt(0); if (parts.count()) setArgs(parts); } setMotionAfterPasting(Properties::Instance()->m_motionAfterPaste); actionMap[COPY_SELECTION] = new QAction(QIcon(":/icons/edit-copy.png"), tr(COPY_SELECTION), this); connect(actionMap[COPY_SELECTION], SIGNAL(triggered()), this, SLOT(copyClipboard())); addAction(actionMap[COPY_SELECTION]); actionMap[PASTE_CLIPBOARD] = new QAction(QIcon(":/icons/edit-paste.png"), tr(PASTE_CLIPBOARD), this); connect(actionMap[PASTE_CLIPBOARD], SIGNAL(triggered()), this, SLOT(pasteClipboard())); addAction(actionMap[PASTE_CLIPBOARD]); actionMap[PASTE_SELECTION] = new QAction(QIcon(":/icons/edit-paste.png"), tr(PASTE_SELECTION), this); connect(actionMap[PASTE_SELECTION], SIGNAL(triggered()), this, SLOT(pasteSelection())); addAction(actionMap[PASTE_SELECTION]); actionMap[ZOOM_IN] = new QAction(QIcon(":/icons/zoom-in.png"), tr(ZOOM_IN), this); connect(actionMap[ZOOM_IN], SIGNAL(triggered()), this, SLOT(zoomIn())); addAction(actionMap[ZOOM_IN]); actionMap[ZOOM_OUT] = new QAction(QIcon(":/icons/zoom-out.png"), tr(ZOOM_OUT), this); connect(actionMap[ZOOM_OUT], SIGNAL(triggered()), this, SLOT(zoomOut())); addAction(actionMap[ZOOM_OUT]); actionMap[ZOOM_RESET] = new QAction(QIcon(":/icons/zoom-out.png"), tr(ZOOM_RESET), this); connect(actionMap[ZOOM_RESET], SIGNAL(triggered()), this, SLOT(zoomReset())); addAction(actionMap[ZOOM_RESET]); QAction *act = new QAction(this); act->setSeparator(true); addAction(act); actionMap[CLEAR_TERMINAL] = new QAction(tr(CLEAR_TERMINAL), this); connect(actionMap[CLEAR_TERMINAL], SIGNAL(triggered()), this, SLOT(clear())); addAction(actionMap[CLEAR_TERMINAL]); actionMap[SPLIT_HORIZONTAL] = new QAction(tr(SPLIT_HORIZONTAL), this); connect(actionMap[SPLIT_HORIZONTAL], SIGNAL(triggered()), this, SLOT(act_splitHorizontal())); addAction(actionMap[SPLIT_HORIZONTAL]); actionMap[SPLIT_VERTICAL] = new QAction(tr(SPLIT_VERTICAL), this); connect(actionMap[SPLIT_VERTICAL], SIGNAL(triggered()), this, SLOT(act_splitVertical())); addAction(actionMap[SPLIT_VERTICAL]); actionMap[SUB_COLLAPSE] = new QAction(tr(SUB_COLLAPSE), this); connect(actionMap[SUB_COLLAPSE], SIGNAL(triggered()), this, SLOT(act_splitCollapse())); addAction(actionMap[SUB_COLLAPSE]); //act = new QAction(this); //act->setSeparator(true); //addAction(act); // //act = new QAction(tr("&Rename session..."), this); //act->setShortcut(Properties::Instance()->shortcuts[RENAME_SESSION]); //connect(act, SIGNAL(triggered()), this, SIGNAL(renameSession())); //addAction(act); setContextMenuPolicy(Qt::CustomContextMenu); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuCall(const QPoint &))); updateShortcuts(); connect(this, SIGNAL(urlActivated(QUrl)), this, SLOT(activateUrl(const QUrl&))); //setKeyBindings("linux"); startShellProgram(); }
InformationPanelContent::InformationPanelContent(QWidget* parent) : QWidget(parent), m_item(), m_pendingPreview(false), m_outdatedPreviewTimer(0), m_preview(0), m_phononWidget(0), m_nameLabel(0), m_metaDataWidget(0), m_metaDataArea(0), m_placesItemModel(0) { parent->installEventFilter(this); // Initialize timer for disabling an outdated preview with a small // delay. This prevents flickering if the new preview can be generated // within a very small timeframe. m_outdatedPreviewTimer = new QTimer(this); m_outdatedPreviewTimer->setInterval(300); m_outdatedPreviewTimer->setSingleShot(true); connect(m_outdatedPreviewTimer, SIGNAL(timeout()), this, SLOT(markOutdatedPreview())); QVBoxLayout* layout = new QVBoxLayout(this); layout->setSpacing(KDialog::spacingHint()); // preview const int minPreviewWidth = KIconLoader::SizeEnormous + KIconLoader::SizeMedium; m_preview = new PixmapViewer(parent); m_preview->setMinimumWidth(minPreviewWidth); m_preview->setMinimumHeight(KIconLoader::SizeEnormous); m_phononWidget = new PhononWidget(parent); m_phononWidget->hide(); m_phononWidget->setMinimumWidth(minPreviewWidth); connect(m_phononWidget, SIGNAL(hasVideoChanged(bool)), this, SLOT(slotHasVideoChanged(bool))); // name m_nameLabel = new QLabel(parent); QFont font = m_nameLabel->font(); font.setBold(true); m_nameLabel->setFont(font); m_nameLabel->setTextFormat(Qt::PlainText); m_nameLabel->setAlignment(Qt::AlignHCenter); m_nameLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); const bool previewsShown = InformationPanelSettings::previewsShown(); m_preview->setVisible(previewsShown); #ifndef HAVE_NEPOMUK m_metaDataWidget = new KFileMetaDataWidget(parent); #else m_metaDataWidget = new Nepomuk2::FileMetaDataWidget(parent); #endif m_metaDataWidget->setFont(KGlobalSettings::smallestReadableFont()); m_metaDataWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); connect(m_metaDataWidget, SIGNAL(urlActivated(KUrl)), this, SIGNAL(urlActivated(KUrl))); // Encapsulate the MetaDataWidget inside a container that has a dummy widget // at the bottom. This prevents that the meta data widget gets vertically stretched // in the case where the height of m_metaDataArea > m_metaDataWidget. QWidget* metaDataWidgetContainer = new QWidget(parent); QVBoxLayout* containerLayout = new QVBoxLayout(metaDataWidgetContainer); containerLayout->setContentsMargins(0, 0, 0, 0); containerLayout->setSpacing(0); containerLayout->addWidget(m_metaDataWidget); containerLayout->addStretch(); m_metaDataArea = new QScrollArea(parent); m_metaDataArea->setWidget(metaDataWidgetContainer); m_metaDataArea->setWidgetResizable(true); m_metaDataArea->setFrameShape(QFrame::NoFrame); QWidget* viewport = m_metaDataArea->viewport(); viewport->installEventFilter(this); QPalette palette = viewport->palette(); palette.setColor(viewport->backgroundRole(), QColor(Qt::transparent)); viewport->setPalette(palette); layout->addWidget(m_preview); layout->addWidget(m_phononWidget); layout->addWidget(m_nameLabel); layout->addWidget(new KSeparator()); layout->addWidget(m_metaDataArea); m_placesItemModel = new PlacesItemModel(this); }