void RunnerInfoProvider::setRunnerId(const QString &runnerId) { if (runnerId == m_runnerId) { return; } m_info = KPluginInfo(); KPluginInfo::List lst = Plasma::RunnerManager::listRunnerInfo(); Q_FOREACH(const KPluginInfo &info, lst) { if (info.pluginName() == runnerId) { m_info = info; break; } } runnerIdChanged(); nameChanged(); iconChanged(); }
void TabBarWidget::addTab(int index, Window *window) { insertTab(index, window->getTitle()); setTabData(index, QVariant::fromValue(window)); connect(window, SIGNAL(iconChanged(QIcon)), this, SLOT(updateTabs())); connect(window, SIGNAL(loadingStateChanged(WindowLoadingState)), this, SLOT(updateTabs())); connect(window, SIGNAL(isPinnedChanged(bool)), this, SLOT(updatePinnedTabsAmount())); connect(tabButton(index, QTabBar::LeftSide), SIGNAL(destroyed()), window, SLOT(deleteLater())); if (window->isPinned()) { updatePinnedTabsAmount(); } updateTabs(index); }
void tab::createConnects() { connect(urlAddress, SIGNAL(returnPressed()), this, SLOT(newUrl())); connect(addressCompleter, SIGNAL(itemChoosed(QString)), this, SLOT(newUrl(QString))); connect(webView, SIGNAL(urlChanged(QUrl)), this, SLOT(urlChanged(QUrl))); connect(webView, SIGNAL(titleChanged(QString)), this, SLOT(chTitle(QString))); connect(webView, SIGNAL(iconChanged()), this, SLOT(chIcon())); connect(webView, SIGNAL(statusBarMessage(QString)), this, SLOT(statusBarMessage(QString))); connect(webView, SIGNAL(selectionChanged()), this, SLOT(selectionChange())); connect(webView, SIGNAL(loadStarted()), this, SLOT(loadStart())); connect(webView, SIGNAL(loadProgress(int)), this, SLOT(loadProgress(int))); connect(webView, SIGNAL(loadFinished(bool)), this, SLOT(loadFinish(bool))); connect(webView, SIGNAL(linkClicked(QUrl)), this, SLOT(linkClick(QUrl))); connect(webView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequest(QPoint))); connect(webView->page(), SIGNAL(unsupportedContent(QNetworkReply*)), this, SLOT(downloadRequest(QNetworkReply*))); connect(webView->page(), SIGNAL(downloadRequested(QNetworkRequest)), this, SLOT(downloadRequset(QNetworkRequest))); connect(webView->page(), SIGNAL(printRequested(QWebFrame*)), this, SLOT(printPage(QWebFrame*))); }
PopupWindow::PopupWindow(PopupWebView* view) : QWidget() , m_view(view) , m_page(view->webPage()) { m_layout = new QVBoxLayout(this); m_layout->setContentsMargins(0, 0, 0, 0); m_layout->setSpacing(0); m_locationBar = new PopupLocationBar(this); m_locationBar->setView(m_view); m_statusBar = new QStatusBar(this); m_statusBar->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); m_layout->addWidget(m_locationBar); m_layout->addWidget(m_view); m_layout->addWidget(m_statusBar); setLayout(m_layout); connect(m_view, SIGNAL(showNotification(QWidget*)), this, SLOT(showNotification(QWidget*))); connect(m_view, SIGNAL(titleChanged(QString)), this, SLOT(titleChanged())); connect(m_view, SIGNAL(urlChanged(QUrl)), m_locationBar, SLOT(showUrl(QUrl))); connect(m_view, SIGNAL(iconChanged()), m_locationBar, SLOT(showIcon())); connect(m_view, SIGNAL(statusBarMessage(QString)), m_statusBar, SLOT(showMessage(QString))); connect(m_page, SIGNAL(linkHovered(QString, QString, QString)), m_statusBar, SLOT(showMessage(QString))); connect(m_page, SIGNAL(geometryChangeRequested(QRect)), this, SLOT(setWindowGeometry(QRect))); connect(m_page, SIGNAL(statusBarVisibilityChangeRequested(bool)), this, SLOT(setStatusBarVisibility(bool))); connect(m_page, SIGNAL(menuBarVisibilityChangeRequested(bool)), this, SLOT(setMenuBarVisibility(bool))); connect(m_page, SIGNAL(toolBarVisibilityChangeRequested(bool)), this, SLOT(setToolBarVisibility(bool))); connect(m_page, SIGNAL(windowCloseRequested()), this, SLOT(close())); m_view->setFocus(); titleChanged(); QUrl urlToShow = m_view->url(); if (urlToShow.isEmpty()) { urlToShow = m_view->page()->mainFrame()->requestedUrl(); } m_locationBar->showUrl(urlToShow); }
void QOfonoVoiceCall::propertyChanged(const QString& property, const QDBusVariant& dbusvalue) { QVariant value = dbusvalue.variant(); d_ptr->properties.insert(property,value); if (property == QLatin1String("LineIdentification")) { Q_EMIT lineIdentificationChanged(value.value<QString>()); } else if (property == QLatin1String("DisconnectReason")) { Q_EMIT disconnectReason(value.value<QString>()); } else if (property == QLatin1String("Name")) { Q_EMIT nameChanged(value.value<QString>()); } else if (property == QLatin1String("State")) { Q_EMIT stateChanged(value.value<QString>()); } else if (property == QLatin1String("StartTime")) { Q_EMIT startTimeChanged(value.value<QString>()); } else if (property == QLatin1String("Information")) { Q_EMIT informationChanged(value.value<QString>()); } else if (property == QLatin1String("IncomingLine")) { Q_EMIT incomingLineChanged(value.value<QString>()); } else if (property == QLatin1String("Multiparty")) { Q_EMIT multipartyChanged(value.value<bool>()); } else if (property == QLatin1String("Icon")) { Q_EMIT iconChanged(value.value<quint8>()); } else if (property == QLatin1String("Emergency")) { Q_EMIT emergencyChanged(value.value<bool>()); } else if (property == QLatin1String("RemoteHeld")) { Q_EMIT remoteHeldChanged(value.value<bool>()); } else if (property == QLatin1String("RemoteMultiparty")) { Q_EMIT remoteMultipartyChanged(value.value<bool>()); } }
/*! \qmlproperty QPlaceCategory Category::category \target Category::category For details on how to use this property to interface between C++ and QML see "\l {location-cpp-qml.html#category} {Interfaces between C++ and QML Code}". */ void QDeclarativeCategory::setCategory(const QPlaceCategory &category) { QPlaceCategory previous = m_category; m_category = category; if (category.name() != previous.name()) emit nameChanged(); if (category.categoryId() != previous.categoryId()) emit categoryIdChanged(); if (m_icon && m_icon->parent() == this) { m_icon->setPlugin(m_plugin); m_icon->setIcon(m_category.icon()); } else if (!m_icon || m_icon->parent() != this) { m_icon = new QDeclarativePlaceIcon(m_category.icon(), m_plugin, this); emit iconChanged(); } }
HintsSettings::HintsSettings(Hawaii::QGSettings *settings, QObject *parent) : QObject(parent) , m_settings(settings) { // Change only the few hints involved, for some of these settings // we need to take actions to refresh applications connect(m_settings, &Hawaii::QGSettings::settingChanged, this, [this](const QString &key) { if (key == QStringLiteral("cursorBlinkTime")) qtSettingsChanged(); else if (key == QStringLiteral("toolButtonStyle")) toolButtonStyleChanged(); else if (key == QStringLiteral("iconTheme") || key == QStringLiteral("toolbarIconsSize")) iconChanged(); else if (key == QStringLiteral("widgetsStyle")) styleChanged(); }); }
TrayIcon::TrayIcon(MainWindow *window, QObject *parent) : QObject(parent), trayico(parent), eventtimer(parent) { hostwindow = window; traymenu.addAction( "Show Window", this, SLOT(MenuShowWindow()) ); traymenu.addAction( "E&xit", this, SLOT(MenuQuit()) ); trayico.setToolTip("If ... Then Do ..."); trayico.setIcon(hostwindow->windowIcon()); trayico.setContextMenu(&traymenu); trayico.show(); eventtimer.start( 1000 ); connect( &trayico, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(IconActivated(QSystemTrayIcon::ActivationReason)) ); connect( hostwindow, SIGNAL(iconChanged()), this, SLOT(IconUpdated()) ); connect( &eventtimer, SIGNAL(timeout()), this, SLOT(TimerTimeOut()) ); }
WebView::WebView(QWidget* parent) : QWebView(parent) , m_currentZoom(100) , m_isLoading(false) , m_progress(0) , m_clickedFrame(0) , m_actionsHaveImages(false) { connect(this, SIGNAL(loadStarted()), this, SLOT(slotLoadStarted())); connect(this, SIGNAL(loadProgress(int)), this, SLOT(slotLoadProgress(int))); connect(this, SIGNAL(loadFinished(bool)), this, SLOT(slotLoadFinished())); connect(this, SIGNAL(iconChanged()), this, SLOT(slotIconChanged())); // Zoom levels same as in firefox m_zoomLevels << 30 << 50 << 67 << 80 << 90 << 100 << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300; qApp->installEventFilter(this); }
Tab::Tab(const QUrl& url, QWidget* parent) : QWidget(parent) { _webView = new WebView(url, this); _toolBar = new ToolBar(_webView->history(), url, this); _searchBar = new SearchBar(this); _statusBar = new StatusBar(this); _layout = new QVBoxLayout(this); _layout->setMargin(0); _layout->setSpacing(0); _layout->addWidget(_toolBar, 0); _layout->addWidget(_webView, 1); _layout->addWidget(_searchBar, 0); _layout->addWidget(_statusBar, 0); _showSearchShortcut = new QShortcut(QKeySequence::Find, this); _focusAddressShortcut = new QShortcut(Qt::Key_F6, this); _searchBar->hide(); connect(_toolBar, SIGNAL(goBackRequested()), _webView, SLOT(back())); connect(_toolBar, SIGNAL(goForwardRequested()), _webView, SLOT(forward())); connect(_toolBar, SIGNAL(reloadRequested()), _webView, SLOT(reload())); connect(_toolBar, SIGNAL(stopRequested()), _webView, SLOT(stop())); connect(_toolBar, SIGNAL(loadRequested(const QUrl&)), _webView, SLOT(setFocus())); connect(_toolBar, SIGNAL(loadRequested(const QUrl&)), _webView, SLOT(load(const QUrl&))); connect(_webView, SIGNAL(urlChanged(const QUrl&)), _toolBar, SLOT(setUrl(const QUrl&))); connect(_webView, SIGNAL(urlChanged(const QUrl&)), _toolBar, SLOT(updateActions())); connect(_webView, SIGNAL(loadStarted()), _toolBar, SLOT(enableStopAction())); connect(_webView, SIGNAL(loadFinished(bool)), _toolBar, SLOT(disableStopAction())); connect(_webView, SIGNAL(titleChanged(const QString&)), this, SLOT(updateTitle())); connect(_webView, SIGNAL(iconChanged()), this, SLOT(updateIcon())); connect(_searchBar, SIGNAL(searchDataChanged(const QString&, bool, bool)), _webView, SLOT(find(const QString&, bool, bool))); connect(_searchBar, SIGNAL(closeRequested()), _searchBar, SLOT(hide())); connect(_searchBar, SIGNAL(closeRequested()), _webView, SLOT(setFocus())); connect(_webView->page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)), _statusBar, SLOT(showMessage(const QString&))); connect(_webView, SIGNAL(loadProgress(int)), _statusBar->progressBar(), SLOT(setValue(int))); connect(_statusBar->slider(), SIGNAL(valueChanged(int)), _webView, SLOT(setZoom(int))); connect(_showSearchShortcut, SIGNAL(activated()), _searchBar, SLOT(show())); connect(_focusAddressShortcut, SIGNAL(activated()), _toolBar->addressBar(), SLOT(setFocus())); }
void LauncherApplication::setSnStartupSequence(SnStartupSequence* sequence) { if (sequence != NULL) { if (!sn_startup_sequence_get_completed(sequence)) { /* 'launching' property becomes true for a few seconds */ m_launching_timer.start(); } else { m_launching_timer.stop(); } sn_startup_sequence_ref(sequence); } m_snStartupSequence.reset(sequence); nameChanged(name()); iconChanged(icon()); executableChanged(executable()); launchingChanged(launching()); }
void PixmapPreviewSelector::iconComboChanged( const QString& icon ) { int id = m_comboItems->findText( icon, Qt::MatchFixedString ); if ( id >= 0 ) { m_icon = m_comboItems->itemData( id ).toString(); } else { m_icon = icon; } QPixmap pixmap = GuiUtils::loadStamp( m_icon, QSize(), m_previewSize ); const QRect cr = m_iconLabel->contentsRect(); if ( pixmap.width() > cr.width() || pixmap.height() > cr.height() ) pixmap = pixmap.scaled( cr.size(), Qt::KeepAspectRatio, Qt::SmoothTransformation ); m_iconLabel->setPixmap( pixmap ); emit iconChanged( m_icon ); }
void WebBrowser::createConnections() { connect(m_webView, &WebViewer::messageStatusChangeRequested, this, &WebBrowser::receiveMessageStatusChangeRequest); connect(m_txtLocation,SIGNAL(submitted(QString)), this, SLOT(loadUrl(QString))); connect(m_webView, SIGNAL(urlChanged(QUrl)), this, SLOT(updateUrl(QUrl))); // Connect this WebBrowser to global TabWidget. //TabWidget *tab_widget = qApp->mainForm()->tabWidget(); //connect(m_webView, SIGNAL(newTabRequested()), tab_widget, SLOT(addEmptyBrowser())); //connect(m_webView, SIGNAL(linkMiddleClicked(QUrl)), tab_widget, SLOT(addLinkedBrowser(QUrl))); // Change location textbox status according to webpage status. connect(m_webView, SIGNAL(loadStarted()), this, SLOT(onLoadingStarted())); connect(m_webView, SIGNAL(loadProgress(int)), this, SLOT(onLoadingProgress(int))); connect(m_webView, SIGNAL(loadFinished(bool)), this, SLOT(onLoadingFinished(bool))); // Forward title/icon changes. connect(m_webView, SIGNAL(titleChanged(QString)), this, SLOT(onTitleChanged(QString))); connect(m_webView, SIGNAL(iconChanged(QIcon)), this, SLOT(onIconChanged(QIcon))); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); progress = 0; view = new QWebView(this); setCentralWidget(view); resize(800, 600); // 关联信号和槽 connect(view, SIGNAL(loadProgress(int)), this, SLOT(setProgress(int))); connect(view, SIGNAL(titleChanged(QString)), this, SLOT(adjustTitle())); connect(view, SIGNAL(loadFinished(bool)), this, SLOT(finishLoading(bool))); locationEdit = new QLineEdit(this); connect(locationEdit, SIGNAL(returnPressed()), this, SLOT(changeLocation())); // 向工具栏添加动作和部件 ui->mainToolBar->addAction(view->pageAction(QWebPage::Back)); ui->mainToolBar->addAction(view->pageAction(QWebPage::Forward)); ui->mainToolBar->addAction(view->pageAction(QWebPage::Reload)); ui->mainToolBar->addAction(view->pageAction(QWebPage::Stop)); // 添加历史动作 ui->mainToolBar->addAction(tr("历史"), this, SLOT(showHistory())); ui->mainToolBar->addWidget(locationEdit); // 设置并加载初始网页地址 locationEdit->setText("http://www.baidu.com"); view->load(QUrl("http://www.baidu.com")); // 必须先设置图标数据库路径 view->settings()->setIconDatabasePath("./"); connect(view, SIGNAL(iconChanged()), this, SLOT(changeIcon())); historyList = new QListWidget; historyList->setWindowTitle(tr("历史记录")); historyList->setMinimumWidth(300); connect(historyList, SIGNAL(clicked(QModelIndex)), this, SLOT(gotoHistory(QModelIndex))); }
void FileInfo::readFile() { m_errorMessage = ""; m_fileInfo = QFileInfo(m_file); if (!m_fileInfo.exists()) m_errorMessage = tr("File does not exist"); emit fileChanged(); emit kindChanged(); emit iconChanged(); emit permissionsChanged(); emit sizeChanged(); emit modifiedChanged(); emit createdChanged(); emit absolutePathChanged(); emit nameChanged(); emit suffixChanged(); emit symLinkTargetChanged(); emit errorMessageChanged(); }
QStandardItem* TabSwitcherWidget::createRow(Window *window, const QVariant &index) const { QColor color(palette().color(QPalette::Text)); if (window->getLoadingState() == WebWidget::DelayedLoadingState) { color.setAlpha(150); } QStandardItem* item(new QStandardItem(window->getIcon(), window->getTitle())); item->setData(color, Qt::TextColorRole); item->setData(window->getIdentifier(), IdentifierRole); item->setData(index, OrderRole); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); connect(window, SIGNAL(titleChanged(QString)), this, SLOT(setTitle(QString))); connect(window, SIGNAL(iconChanged(QIcon)), this, SLOT(setIcon(QIcon))); connect(window, SIGNAL(loadingStateChanged(WebWidget::LoadingState)), this, SLOT(setLoadingState(WebWidget::LoadingState))); return item; }
QWidget * TextAnnotationWidget::createStyleWidget() { QWidget * widget = new QWidget(); QVBoxLayout * lay = new QVBoxLayout( widget ); lay->setMargin( 0 ); if ( m_textAnn->textType() == Okular::TextAnnotation::Linked ) { QGroupBox * gb = new QGroupBox( widget ); lay->addWidget( gb ); gb->setTitle( i18n( "Icon" ) ); QHBoxLayout * gblay = new QHBoxLayout( gb ); m_pixmapSelector = new PixmapPreviewSelector( gb ); gblay->addWidget( m_pixmapSelector ); m_pixmapSelector->addItem( i18n( "Comment" ), "Comment" ); m_pixmapSelector->addItem( i18n( "Help" ), "Help" ); m_pixmapSelector->addItem( i18n( "Insert" ), "Insert" ); m_pixmapSelector->addItem( i18n( "Key" ), "Key" ); m_pixmapSelector->addItem( i18n( "New Paragraph" ), "NewParagraph" ); m_pixmapSelector->addItem( i18n( "Note" ), "Note" ); m_pixmapSelector->addItem( i18n( "Paragraph" ), "Paragraph" ); m_pixmapSelector->setIcon( m_textAnn->textIcon() ); connect( m_pixmapSelector, SIGNAL(iconChanged(QString)), this, SIGNAL(dataChanged()) ); } QHBoxLayout * fontlay = new QHBoxLayout(); QLabel * tmplabel = new QLabel( i18n( "Font:" ), widget ); fontlay->addWidget( tmplabel ); m_fontReq = new KFontRequester( widget ); fontlay->addWidget( m_fontReq ); lay->addLayout( fontlay ); m_fontReq->setFont( m_textAnn->textFont() ); connect( m_fontReq, SIGNAL(fontSelected(QFont)), this, SIGNAL(dataChanged()) ); return widget; }
void BasicTab::initConnections() { // general tab's components connect(_nameEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged())); connect(_descriptionEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged())); connect(_commentEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged())); connect(_execEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged())); connect(_execEdit, SIGNAL(urlSelected(KUrl)), SLOT(slotExecSelected())); connect(_launchCB, SIGNAL(clicked()), SLOT(launchcb_clicked())); connect(_systrayCB, SIGNAL(clicked()), SLOT(systraycb_clicked())); connect(_onlyShowInKdeCB, SIGNAL(clicked()), SLOT(onlyshowcb_clicked())); connect(_hiddenEntryCB, SIGNAL(clicked()), SLOT(hiddenentrycb_clicked())); connect(_iconButton, SIGNAL(iconChanged(QString)), SLOT(slotChanged())); // advanced tab's components connect(_pathEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged())); connect(_terminalCB, SIGNAL(clicked()), SLOT(termcb_clicked())); connect(_terminalOptionsEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged())); connect(_userCB, SIGNAL(clicked()), SLOT(uidcb_clicked())); connect(_userNameEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged())); connect(_keyBindingEdit, SIGNAL(keySequenceChanged(QKeySequence)), this, SLOT(slotCapturedKeySequence(QKeySequence))); }
void Task::refresh(bool icon) { _info = KWin::info(_win); if (icon) { // try to load icon via net_wm _pixmap = KWin::icon(_win, 16, 16, true); // try to guess the icon from the classhint if(_pixmap.isNull()) KGlobal::instance()->iconLoader()->loadIcon(className().lower(), KIcon::Small, KIcon::Small, KIcon::DefaultState, 0, true); // load xapp icon if (_pixmap.isNull()) _pixmap = SmallIcon("kcmx"); _lastIcon.resize(0,0); emit iconChanged(); } emit changed(); }
/*! \qmlproperty QPlaceSupplier Supplier::supplier For details on how to use this property to interface between C++ and QML see "\l {location-cpp-qml.html#placesupplier} {Interfaces between C++ and QML Code}". */ void QDeclarativeSupplier::setSupplier(const QPlaceSupplier &src, QDeclarativeGeoServiceProvider *plugin) { QPlaceSupplier previous = m_src; m_src = src; if (previous.name() != m_src.name()) emit nameChanged(); if (previous.supplierId() != m_src.supplierId()) emit supplierIdChanged(); if (previous.url() != m_src.url()) emit urlChanged(); if (m_icon && m_icon->parent() == this) { m_icon->setPlugin(plugin); m_icon->setIcon(m_src.icon()); } else if (!m_icon || m_icon->parent() != this) { m_icon = new QDeclarativePlaceIcon(m_src.icon(), plugin, this); emit iconChanged(); } }
QWidget * StampAnnotationWidget::createStyleWidget() { QWidget * widget = new QWidget(); QVBoxLayout * lay = new QVBoxLayout( widget ); lay->setMargin( 0 ); QGroupBox * gb = new QGroupBox( widget ); lay->addWidget( gb ); gb->setTitle( i18n( "Stamp Symbol" ) ); QHBoxLayout * gblay = new QHBoxLayout( gb ); m_pixmapSelector = new PixmapPreviewSelector( gb ); gblay->addWidget( m_pixmapSelector ); m_pixmapSelector->setEditable( true ); m_pixmapSelector->addItem( i18n( "Okular" ), "okular" ); m_pixmapSelector->addItem( i18n( "Bookmark" ), "bookmarks" ); m_pixmapSelector->addItem( i18n( "KDE" ), "kde" ); m_pixmapSelector->addItem( i18n( "Information" ), "help-about" ); m_pixmapSelector->addItem( i18n( "Approved" ), "Approved" ); m_pixmapSelector->addItem( i18n( "As Is" ), "AsIs" ); m_pixmapSelector->addItem( i18n( "Confidential" ), "Confidential" ); m_pixmapSelector->addItem( i18n( "Departmental" ), "Departmental" ); m_pixmapSelector->addItem( i18n( "Draft" ), "Draft" ); m_pixmapSelector->addItem( i18n( "Experimental" ), "Experimental" ); m_pixmapSelector->addItem( i18n( "Expired" ), "Expired" ); m_pixmapSelector->addItem( i18n( "Final" ), "Final" ); m_pixmapSelector->addItem( i18n( "For Comment" ), "ForComment" ); m_pixmapSelector->addItem( i18n( "For Public Release" ), "ForPublicRelease" ); m_pixmapSelector->addItem( i18n( "Not Approved" ), "NotApproved" ); m_pixmapSelector->addItem( i18n( "Not For Public Release" ), "NotForPublicRelease" ); m_pixmapSelector->addItem( i18n( "Sold" ), "Sold" ); m_pixmapSelector->addItem( i18n( "Top Secret" ), "TopSecret" ); m_pixmapSelector->setIcon( m_stampAnn->stampIconName() ); m_pixmapSelector->setPreviewSize( 64 ); connect( m_pixmapSelector, SIGNAL(iconChanged(QString)), this, SIGNAL(dataChanged()) ); return widget; }
WebView::WebView(QWidget* parent) : QWebView(parent) , m_currentZoom(100) , m_isLoading(false) , m_progress(0) , m_clickedFrame(0) , m_page(0) , m_actionReload(0) , m_actionStop(0) , m_actionsInitialized(false) , m_disableTouchMocking(false) { connect(this, SIGNAL(loadStarted()), this, SLOT(slotLoadStarted())); connect(this, SIGNAL(loadProgress(int)), this, SLOT(slotLoadProgress(int))); connect(this, SIGNAL(loadFinished(bool)), this, SLOT(slotLoadFinished())); connect(this, SIGNAL(iconChanged()), this, SLOT(slotIconChanged())); connect(this, SIGNAL(urlChanged(QUrl)), this, SLOT(slotUrlChanged(QUrl))); // Zoom levels same as in firefox m_zoomLevels << 30 << 50 << 67 << 80 << 90 << 100 << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300; installEventFilter(this); }
//// A dialog to load a KDE icon by its name LoadIconDialog::LoadIconDialog(QWidget *parent) : KDialog(parent, "loadicon_dialog", true, i18n("Load KDE Icon by Name"), Ok | Cancel, Ok, false) { QFrame *frame = makeMainWidget(); QGridLayout *l = new QGridLayout(frame); // Name input QLabel *name = new QLabel(i18n("&Name:"), frame); l->addWidget(name, 0, 0); name->setAlignment(Qt::AlignRight | Qt::AlignVCenter); m_nameInput = new KLineEdit("kexi", frame); l->addWidget(m_nameInput, 0, 1); name->setBuddy(m_nameInput); // Choose size QLabel *size = new QLabel(i18n("&Size:"), frame); l->addWidget(size, 1, 0); size->setAlignment(Qt::AlignRight | Qt::AlignVCenter); KComboBox *combo = new KComboBox(frame); l->addWidget(combo, 1, 1); size->setBuddy(combo); QStringList list; list << i18n("Small") << i18n("Medium") << i18n("Large") << i18n("Huge"); combo->insertStringList(list); combo->setCurrentItem(2); connect(combo, SIGNAL(activated(int)), this, SLOT(changeIconSize(int))); // Icon chooser button m_button = new KIconButton(frame); m_button->setIcon(koIconName("calligrakexi")); m_button->setIconSize(KIconLoader::SizeMedium); l->addWidget(m_button, 0, 2, 2, 1); connect(m_button, SIGNAL(iconChanged(QString)), this, SLOT(updateIconName(QString))); connect(m_nameInput, SIGNAL(textChanged(QString)), this, SLOT(setIcon(QString))); }
Window::Window(const QVariantMap ¶meters, ContentsWidget *widget, MainWindow *mainWindow) : QWidget(mainWindow->centralWidget()), m_mainWindow(mainWindow), m_addressBar(nullptr), m_contentsWidget(nullptr), m_parameters(parameters), m_identifier(++m_identifierCounter), m_suspendTimer(0), m_isAboutToClose(false), m_isPinned(false) { QBoxLayout *layout(new QBoxLayout(QBoxLayout::TopToBottom, this)); layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); setLayout(layout); if (widget) { setContentsWidget(widget); } connect(this, SIGNAL(titleChanged(QString)), this, SLOT(setWindowTitle(QString))); connect(this, SIGNAL(iconChanged(QIcon)), this, SLOT(handleIconChanged(QIcon))); }
void Blinkink::seticon(QPixmap arg) { m_icon = arg; _icon.setPixmap(arg); emit iconChanged(arg); }
QPalette p = emptyWidget->palette(); p.setColor(QPalette::Window, palette().color(QPalette::Base)); emptyWidget->setPalette(p); emptyWidget->setAutoFillBackground(true); disconnect(this, SIGNAL(currentChanged(int)), this, SLOT(currentChanged(int))); addTab(emptyWidget, tr("(Untitled)")); connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentChanged(int))); return 0; } // webview WBWebView *webView = new WBWebView; urlLineEdit->setWebView(webView); connect(webView, SIGNAL(loadStarted()), this, SLOT(webViewLoadStarted())); connect(webView, SIGNAL(loadFinished(bool)), this, SLOT(webViewIconChanged())); connect(webView, SIGNAL(iconChanged()), this, SLOT(webViewIconChanged())); connect(webView, SIGNAL(titleChanged(const QString &)), this, SLOT(webViewTitleChanged(const QString &))); connect(webView, SIGNAL(urlChanged(const QUrl &)), this, SLOT(webViewUrlChanged(const QUrl &))); connect(webView->page(), SIGNAL(windowCloseRequested()), this, SLOT(windowCloseRequested())); connect(webView->page(), SIGNAL(geometryChangeRequested(const QRect &)), this, SIGNAL(geometryChangeRequested(const QRect &))); connect(webView->page(), SIGNAL(printRequested(QWebFrame *)), this, SIGNAL(printRequested(QWebFrame *))); connect(webView->page(), SIGNAL(menuBarVisibilityChangeRequested(bool)), this, SIGNAL(menuBarVisibilityChangeRequested(bool))); connect(webView->page(), SIGNAL(statusBarVisibilityChangeRequested(bool)), this, SIGNAL(statusBarVisibilityChangeRequested(bool))); connect(webView->page(), SIGNAL(toolBarVisibilityChangeRequested(bool)), this, SIGNAL(toolBarVisibilityChangeRequested(bool))); connect(webView, SIGNAL(pixmapCaptured(const QPixmap&, bool)), UBApplication::applicationController, SLOT(addCapturedPixmap(const QPixmap &, bool))); connect(webView, SIGNAL(embedCodeCaptured(const QString&)), UBApplication::applicationController, SLOT(addCapturedEmbedCode(const QString&))); addTab(webView, tr("(Untitled)")); if (makeCurrent)
BasicTab::BasicTab( QWidget *parent ) : KTabWidget(parent) { _menuFolderInfo = 0; _menuEntryInfo = 0; // general group QWidget *general_group = new QWidget(); QGridLayout *grid = new QGridLayout(general_group); grid->setMargin( KDialog::marginHint() ); grid->setSpacing( KDialog::spacingHint() ); general_group->setAcceptDrops(false); // setup line inputs _nameEdit = new KLineEdit(general_group); _nameEdit->setAcceptDrops(false); _descriptionEdit = new KLineSpellChecking(general_group); _descriptionEdit->setAcceptDrops(false); _commentEdit = new KLineSpellChecking(general_group); _commentEdit->setAcceptDrops(false); _execEdit = new KUrlRequester(general_group); _execEdit->lineEdit()->setAcceptDrops(false); _execEdit->setWhatsThis(i18n( "Following the command, you can have several place holders which will be replaced " "with the actual values when the actual program is run:\n" "%f - a single file name\n" "%F - a list of files; use for applications that can open several local files at once\n" "%u - a single URL\n" "%U - a list of URLs\n" "%d - the folder of the file to open\n" "%D - a list of folders\n" "%i - the icon\n" "%m - the mini-icon\n" "%c - the caption")); _launchCB = new QCheckBox(i18n("Enable &launch feedback"), general_group); _systrayCB = new QCheckBox(i18n("&Place in system tray"), general_group); _onlyShowInKdeCB = new QCheckBox( i18n( "Only show in KDE" ), general_group ); _hiddenEntryCB = new QCheckBox( i18n( "Hidden entry" ), general_group ); _hiddenEntryCB->hide(); // setup labels _nameLabel = new QLabel(i18n("&Name:"),general_group); _nameLabel->setBuddy(_nameEdit); _descriptionLabel = new QLabel(i18n("&Description:"),general_group); _descriptionLabel->setBuddy(_descriptionEdit); _commentLabel = new QLabel(i18n("&Comment:"),general_group); _commentLabel->setBuddy(_commentEdit); _execLabel = new QLabel(i18n("Co&mmand:"),general_group); _execLabel->setBuddy(_execEdit); grid->addWidget(_nameLabel, 0, 0); grid->addWidget(_descriptionLabel, 1, 0); grid->addWidget(_commentLabel, 2, 0); grid->addWidget(_execLabel, 3, 0); // connect line inputs connect(_nameEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged())); connect(_descriptionEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged())); connect(_commentEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged())); connect(_execEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged())); connect(_execEdit, SIGNAL(urlSelected(KUrl)), SLOT(slotExecSelected())); connect(_launchCB, SIGNAL(clicked()), SLOT(launchcb_clicked())); connect(_systrayCB, SIGNAL(clicked()), SLOT(systraycb_clicked())); connect(_onlyShowInKdeCB, SIGNAL(clicked()), SLOT(onlyshowcb_clicked()) ); connect( _hiddenEntryCB, SIGNAL(clicked()), SLOT(hiddenentrycb_clicked()) ); // add line inputs to the grid grid->addWidget(_nameEdit, 0, 1, 1, 1); grid->addWidget(_descriptionEdit, 1, 1, 1, 1); grid->addWidget(_commentEdit, 2, 1, 1, 2); grid->addWidget(_execEdit, 3, 1, 1, 2); grid->addWidget(_launchCB, 4, 0, 1, 3 ); grid->addWidget(_systrayCB, 5, 0, 1, 3 ); grid->addWidget(_onlyShowInKdeCB, 6, 0, 1, 3 ); grid->addWidget(_hiddenEntryCB, 7, 0, 1, 3 ); // setup icon button _iconButton = new KIconButton(general_group); _iconButton->setFixedSize(56,56); _iconButton->setIconSize(32); connect(_iconButton, SIGNAL(iconChanged(QString)), SLOT(slotChanged())); grid->addWidget(_iconButton, 0, 2, 2, 1); grid->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding), 8, 0, 1, 3); // add the general group to the main layout addTab(general_group, i18n("General")); QWidget *advanced = new QWidget(); QVBoxLayout *advancedLayout = new QVBoxLayout(advanced); // path group _path_group = new QGroupBox(this); QHBoxLayout *hboxLayout1 = new QHBoxLayout(_path_group); hboxLayout1->setSpacing(KDialog::spacingHint()); hboxLayout1->setMargin(KDialog::marginHint()); _pathLabel = new QLabel(i18n("&Work path:"), _path_group); hboxLayout1->addWidget(_pathLabel); _pathEdit = new KUrlRequester(_path_group); hboxLayout1->addWidget(_pathEdit); _pathEdit->setMode(KFile::Directory | KFile::LocalOnly); _pathEdit->lineEdit()->setAcceptDrops(false); _pathLabel->setBuddy(_pathEdit); connect(_pathEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged())); advancedLayout->addWidget(_path_group); // terminal group _term_group = new QGroupBox(this); QVBoxLayout *vbox = new QVBoxLayout(_term_group); vbox->setMargin(KDialog::marginHint()); vbox->setSpacing(KDialog::spacingHint()); _terminalCB = new QCheckBox(i18n("Run in term&inal"), _term_group); connect(_terminalCB, SIGNAL(clicked()), SLOT(termcb_clicked())); vbox->addWidget(_terminalCB); QWidget *hbox = new QWidget(_term_group); QHBoxLayout *hboxLayout2 = new QHBoxLayout(hbox); hbox->setLayout(hboxLayout2); hboxLayout2->setSpacing(KDialog::spacingHint()); _termOptLabel = new QLabel(i18n("Terminal &options:"), hbox); hboxLayout2->addWidget(_termOptLabel); _termOptEdit = new KLineEdit(hbox); hboxLayout2->addWidget(_termOptEdit); _termOptEdit->setAcceptDrops(false); _termOptLabel->setBuddy(_termOptEdit); connect(_termOptEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged())); vbox->addWidget(hbox); advancedLayout->addWidget(_term_group); _termOptEdit->setEnabled(false); // uid group _uid_group = new QGroupBox(this); vbox = new QVBoxLayout(_uid_group); vbox->setMargin(KDialog::marginHint()); vbox->setSpacing(KDialog::spacingHint()); _uidCB = new QCheckBox(i18n("&Run as a different user"), _uid_group); connect(_uidCB, SIGNAL(clicked()), SLOT(uidcb_clicked())); vbox->addWidget(_uidCB); hbox = new QWidget(_uid_group); QHBoxLayout *hboxLayout3 = new QHBoxLayout(hbox); hbox->setLayout(hboxLayout3); hboxLayout3->setSpacing(KDialog::spacingHint()); _uidLabel = new QLabel(i18n("&Username:"******"Current shortcut &key:"), general_group_keybind); l->setBuddy( _keyEdit ); keybindLayout->addWidget(l); connect( _keyEdit, SIGNAL(keySequenceChanged(QKeySequence)), this, SLOT(slotCapturedKeySequence(QKeySequence))); keybindLayout->addWidget(_keyEdit); advancedLayout->addWidget( general_group_keybind ); advancedLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding)); addTab(advanced, i18n("Advanced")); if (!KHotKeys::present()) general_group_keybind->hide(); slotDisableAction(); }
disconnect(this, SIGNAL(currentChanged(int)), this, SLOT(currentChanged(int))); addTab(emptyWidget, tr("(Untitled)")); connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentChanged(int))); return 0; } // webview WebView *webView = new WebView; urlLineEdit->setWebView(webView); connect(webView, SIGNAL(loadStarted()), this, SLOT(webViewLoadStarted())); connect(webView, SIGNAL(loadFinished(bool)), this, SLOT(webViewIconChanged())); connect(webView, SIGNAL(iconChanged()), this, SLOT(webViewIconChanged())); connect(webView, SIGNAL(titleChanged(const QString &)), this, SLOT(webViewTitleChanged(const QString &))); connect(webView, SIGNAL(urlChanged(const QUrl &)), this, SLOT(webViewUrlChanged(const QUrl &))); connect(webView->page(), SIGNAL(windowCloseRequested()), this, SLOT(windowCloseRequested())); connect(webView->page(), SIGNAL(geometryChangeRequested(const QRect &)), this, SIGNAL(geometryChangeRequested(const QRect &))); connect(webView->page(), SIGNAL(printRequested(QWebFrame *)), this, SIGNAL(printRequested(QWebFrame *))); connect(webView->page(), SIGNAL(menuBarVisibilityChangeRequested(bool)), this, SIGNAL(menuBarVisibilityChangeRequested(bool))); connect(webView->page(), SIGNAL(statusBarVisibilityChangeRequested(bool)), this, SIGNAL(statusBarVisibilityChangeRequested(bool)));
WebTab::WebTab(QWidget *parent, bool isPrivateBrowsing) : QWidget(parent) , m_webView(0) , m_progress(0) , m_part(0) , m_zoomFactor(ReKonfig::defaultZoom()) , m_isPrivateBrowsing(isPrivateBrowsing) , m_isWebApp(false) , m_splitter(new QSplitter(this)) #ifdef HAVE_KACTIVITIES , m_activityResourceInstance(0) #endif { setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); QVBoxLayout *l = new QVBoxLayout(this); l->setMargin(0); l->setSpacing(0); m_splitter->addWidget(view()); view()->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); // NOTE: setting web inspector vertical/horizontal m_splitter->setOrientation(Qt::Vertical); l->addWidget(m_splitter); // fix focus handling setFocusProxy(view()); KWebWallet *wallet = page()->wallet(); if (wallet) { connect(wallet, SIGNAL(saveFormDataRequested(QString,QUrl)), this, SLOT(createWalletBar(QString,QUrl))); } // Connect webview signals with related webtab ones connect(view(), SIGNAL(loadFinished(bool)), this, SIGNAL(loadFinished(bool))); connect(view(), SIGNAL(loadProgress(int)), this, SIGNAL(loadProgress(int))); connect(view(), SIGNAL(loadStarted()), this, SIGNAL(loadStarted())); connect(view(), SIGNAL(urlChanged(QUrl)), this, SIGNAL(urlChanged(QUrl))); connect(view(), SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString))); connect(view(), SIGNAL(iconChanged()), this, SIGNAL(iconChanged())); connect(page(), SIGNAL(initialUrl(QUrl)), this, SIGNAL(urlChanged(QUrl))); if (!parent) { m_isWebApp = true; connect(this, SIGNAL(titleChanged(QString)), this, SLOT(webAppTitleChanged(QString))); connect(this, SIGNAL(iconChanged()), this, SLOT(webAppIconChanged())); } connect(view(), SIGNAL(loadProgress(int)), this, SLOT(updateProgress(int))); connect(view(), SIGNAL(loadStarted()), this, SLOT(resetProgress())); connect(view(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished())); connect(view(), SIGNAL(zoomChanged(int)), this, SLOT(setZoom(int))); // Session Manager connect(view(), SIGNAL(loadFinished(bool)), SessionManager::self(), SLOT(saveSession())); #ifdef HAVE_KACTIVITIES if (m_isPrivateBrowsing) return; m_activityResourceInstance = new KActivities::ResourceInstance(window()->winId(), this); connect(this, SIGNAL(urlChanged(QUrl)), m_activityResourceInstance, SLOT(setUri(QUrl))); connect(this, SIGNAL(titleChanged(QString)), m_activityResourceInstance, SLOT(setTitle(QString))); #endif }
void ActivityInfo::setIcon(const QString &icon) { m_icon = icon; emit iconChanged(); }