void HWMapContainer::setRandomTheme() { if(!m_themeModel->rowCount()) return; quint32 themeNum = rand() % m_themeModel->rowCount(); updateTheme(m_themeModel->index(themeNum)); emit themeChanged(m_theme); }
RazorPanel::RazorPanel(const QString &configGroup, QWidget *parent) : QFrame(parent), mConfigGroup(configGroup), mLineSize(22), mLineCount(1) { setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); setAttribute(Qt::WA_X11NetWmWindowTypeDock); setAttribute(Qt::WA_AlwaysShowToolTips); setWindowTitle("Razor Panel"); setObjectName(QString("RazorPanel %1").arg(configGroup)); mLayout = new RazorPanelLayout(this); connect(mLayout, SIGNAL(pluginMoved()), this, SLOT(pluginMoved())); setLayout(mLayout); mLayout->setLineCount(mLineCount); mDelaySave.setSingleShot(true); mDelaySave.setInterval(SETTINGS_SAVE_DELAY); connect(&mDelaySave, SIGNAL(timeout()), this, SLOT(saveSettings())); connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(screensChangeds())); connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(realign())); connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(screensChangeds())); connect(RazorSettings::globalSettings(), SIGNAL(settingsChanged()), this, SLOT(update())); connect(razorApp, SIGNAL(themeChanged()), this, SLOT(realign())); mSettings = new RazorSettings("panel", this); readSettings(); loadPlugins(); show(); }
RazorPanelPrivate::RazorPanelPrivate(RazorPanel* parent): QObject(parent), q_ptr(parent), mScreenNum(0) { // Read command line arguments .............. // The first argument is config file name. mConfigFile = "panel"; if (qApp->arguments().count() > 1) { mConfigFile = qApp->arguments().at(1); if (mConfigFile.endsWith(".conf")) mConfigFile.chop(5); } mSettings = new RazorSettings("razor-panel/" + mConfigFile, this); mLayout = new RazorPanelLayout(QBoxLayout::LeftToRight, parent); connect(mLayout, SIGNAL(widgetMoved(QWidget*)), this, SLOT(pluginMoved(QWidget*))); connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(screensChangeds())); connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(screensChangeds())); //connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), this, SLOT(screensChangeds())); connect(RazorSettings::globalSettings(), SIGNAL(settingsChanged()), q_ptr, SLOT(update())); connect(razorApp, SIGNAL(themeChanged()), this, SLOT(realign())); }
void GameCFGWidget::fullNetConfig() { ammoChanged(WeaponsName->currentIndex()); seedChanged(pMapContainer->getCurrentSeed()); templateFilterChanged(pMapContainer->getTemplateFilter()); QString t = pMapContainer->getCurrentTheme(); if(!t.isEmpty()) themeChanged(t); schemeChanged(GameSchemes->currentIndex()); scriptChanged(Scripts->currentIndex()); mapgenChanged(pMapContainer->get_mapgen()); maze_sizeChanged(pMapContainer->getMazeSize()); slMapFeatureSizeChanged(pMapContainer->getFeatureSize()); if(pMapContainer->get_mapgen() == 2) onDrawnMapChanged(pMapContainer->getDrawnMapData()); // map must be the last QString map = pMapContainer->getCurrentMap(); if (map.size()) mapChanged(map); }
void AuroraeTheme::loadTheme(const QString &name, const KConfig &config) { d->themeName = name; QString file(QLatin1String("aurorae/themes/") + d->themeName + QLatin1String("/decoration.svg")); QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, file); if (path.isEmpty()) { file += QLatin1String("z"); path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, file); } if (path.isEmpty()) { qCDebug(AURORAE) << "Could not find decoration svg: aborting"; d->themeName.clear(); return; } d->decorationPath = path; // load the buttons d->initButtonFrame(MinimizeButton); d->initButtonFrame(MaximizeButton); d->initButtonFrame(RestoreButton); d->initButtonFrame(CloseButton); d->initButtonFrame(AllDesktopsButton); d->initButtonFrame(KeepAboveButton); d->initButtonFrame(KeepBelowButton); d->initButtonFrame(ShadeButton); d->initButtonFrame(HelpButton); d->themeConfig.load(config); emit themeChanged(); }
/************************************************ * AuroraeTheme ************************************************/ AuroraeTheme::AuroraeTheme(QObject* parent) : QObject(parent) , d(new AuroraeThemePrivate) { connect(this, SIGNAL(themeChanged()), SIGNAL(borderSizesChanged())); connect(this, SIGNAL(buttonSizesChanged()), SIGNAL(borderSizesChanged())); }
ThemeDialog::ThemeDialog(QWidget *parent, LPlugins *plugs, QString themeFilePath) : QDialog(parent), ui(new Ui::ThemeDialog){ ui->setupUi(this); //load the designer file filepath = themeFilePath; this->setWindowIcon( LXDG::findIcon("preferences-desktop-theme","") ); ui->line_name->setText( themeFilePath.section("/",-1).section(".qss",0,0) ); //Load the icons for the window ui->push_cancel->setIcon( LXDG::findIcon("dialog-cancel","") ); ui->push_save->setIcon( LXDG::findIcon("document-save","") ); ui->push_apply->setIcon( LXDG::findIcon("dialog-ok","") ); ui->tool_color->setIcon( LXDG::findIcon("color-picker","") ); //Now create entries for the available colors in the database QStringList colors = plugs->colorItems(); colors.sort(); colormenu = new QMenu(this); for(int i=0; i<colors.length(); i++){ LPI info = plugs->colorInfo(colors[i]); QAction *act = new QAction(info.name, this); act->setWhatsThis("%%"+info.ID+"%%"); act->setToolTip(info.description); colormenu->addAction(act); } ui->tool_color->setMenu(colormenu); //Now load the given file loadTheme(); connect(colormenu, SIGNAL(triggered(QAction*)),this, SLOT(menuTriggered(QAction*)) ); connect(ui->text_file, SIGNAL(textChanged()), this, SLOT(themeChanged()) ); //Now center the window on the parent QPoint cen = parent->geometry().center(); this->move( cen.x() - (this->width()/2) , cen.y() - (this->height()/2) ); }
HandZone::HandZone(Player *_p, bool _contentsKnown, int _zoneHeight, QGraphicsItem *parent) : SelectZone(_p, "hand", false, false, _contentsKnown, parent), zoneHeight(_zoneHeight) { connect(themeManager, SIGNAL(themeChanged()), this, SLOT(updateBg())); updateBg(); setCacheMode(DeviceCoordinateCache); }
void Settings::setTheme(int value) { if (getTheme() != value) { settings.setValue("apptheme", value); emit themeChanged(); } }
SimpleListViewPrivate(SimpleListView *button) : m_content(0) , m_layout(0) , m_twoColumns(false) , q_ptr(button) , m_listItemCaching(false) { Q_Q(SimpleListView); m_layout = new QGraphicsGridLayout(); m_layout->setContentsMargins(0, 0, 0, 0); m_layout->setSpacing(0); m_layout->setColumnSpacing(0,0); m_layout->setColumnSpacing(1,0); m_layout->setRowSpacing(0,0); m_layout->setRowSpacing(1,0); m_content = new QGraphicsWidget; m_content->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); m_content->setParentItem(q->viewport()); m_content->setLayout(m_layout); q->horizontalScrollBar()->setSliderSize(0.0); QObject::connect(Theme::p(), SIGNAL(themeChanged()), q, SLOT(themeChange())); }
void Bubble::init() { m_svg->resize(geometry().width(), geometry().height()); m_sensorModel = new QStandardItemModel(this); connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(reloadTheme())); m_animator = new QTimer(this); m_animator->setInterval(75); connect(m_animator, SIGNAL(timeout()), this, SLOT(moveBubbles())); m_interpolator = new QTimeLine(m_speed, this); connect(m_interpolator, SIGNAL(frameChanged(int)), this, SLOT(interpolateValue())); m_engine = dataEngine("systemmonitor"); if (!m_engine->isValid()) { setFailedToLaunch(true, i18nc("@info:status The system monitor data engine could not be found or loaded", "Could not load the System Monitor data engine.")); } else { connect(m_engine, SIGNAL(sourceAdded(QString)), this, SLOT(connectSensor())); } configChanged(); m_bubbleRect = m_svg->elementSize("bubble"); }
void SessionManager::setCurrent(const QString& session, const QStringList& files, const QStringList& datafiles) { // Close open documents if (!closeCurrent()) { return; } // Open session m_session = new Session(!session.isEmpty() ? session : Session::tr("Default")); emit themeChanged(m_session->theme()); if (files.isEmpty()) { m_window->addDocuments(m_session->files(), m_session->files(), m_session->positions(), m_session->active(), true); } else { m_window->addDocuments(files, datafiles, m_session->positions(), m_session->active(), true); } // Save session name if (!session.isEmpty()) { QSettings().setValue("SessionManager/Session", m_session->name()); } else { QSettings().remove("SessionManager/Session"); } updateList(session); }
void PreviewBridge::setTheme(const QString &theme) { if (m_theme == theme) { return; } m_theme = theme; emit themeChanged(); }
void Setting::setTheme(QString theme) { if (theme == m_theme) return; m_theme = theme; set("theme", theme); emit themeChanged(); }
void OptionsDialog::setTheme(int arg) { if (m_theme == arg) return; m_theme = arg; emit themeChanged(arg); }
Flags::~Flags() { if( svg != NULL ) { disconnect(svg, SIGNAL(repaintNeeded()), this, SLOT(themeChanged())); delete svg; } delete transparentPixmap; }
BackgroundItem::BackgroundItem(const QString &filename, QGraphicsWidget *parent) : GvbWidget(parent), m_background(), m_fileName(filename) { setContentsMargins(0,0,0,0); connect(Theme::p(), SIGNAL(themeChanged()), this, SLOT(themeChange())); }
void Theme::setTheme(const Themes theme) { if (m_currentTheme == theme) return; switch (theme) { case Theme::Blue: setBlueTheme(); emit themeChanged(); break; case Theme::Lime: setLimeTheme(); emit themeChanged(); break; } }
void Clock::init() { ClockApplet::init(); dataEngine("time")->connectSource(currentTimezone(), this, updateInterval(), intervalAlignment()); connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(updateColors())); connect(KGlobalSettings::self(), SIGNAL(appearanceChanged()), SLOT(resetSize())); connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)), SLOT(updateClock(int))); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), canvasWidget(new CanvasWidget(this)), gameIsPaused(true), thereIsAnotherDialog(false) { Item::setCanvas(canvasWidget); new Background; // the background put's itself into the canvasWidget gameEngine = new GameEngine(this); // must be called after Item::setCanvas() #if defined ANDROID setAttribute(Qt::WA_AcceptTouchEvents); #endif connect(canvasWidget, SIGNAL(mouseMoved(int)), gameEngine, SLOT(moveBar(int))); connect(canvasWidget, SIGNAL(barMovedLeft()), gameEngine, SLOT(moveBarLeft())); connect(canvasWidget, SIGNAL(barMovedRight()), gameEngine, SLOT(moveBarRight())); connect(canvasWidget, SIGNAL(focusLost()), this, SLOT(pauseGame())); connect(gameEngine, SIGNAL(gamePaused()), canvasWidget, SLOT(handleGamePaused())); connect(gameEngine, SIGNAL(gameResumed()), canvasWidget, SLOT(handleGameResumed())); connect(gameEngine, SIGNAL(gameResumed()), this, SLOT(handleGameResumed())); connect(gameEngine, SIGNAL(resetMousePosition()), canvasWidget, SLOT(handleResetMousePosition())); connect(gameEngine, SIGNAL(gameEnded(int,int,int)), SLOT(handleEndedGame(int,int,int))); // cheating keys, debugging and testing only TODO: REMOVE connect(canvasWidget, SIGNAL(cheatSkipLevel()), gameEngine, SLOT(cheatSkipLevel())); connect(canvasWidget, SIGNAL(cheatAddLife()), gameEngine, SLOT(cheatAddLife())); connect(gameEngine, SIGNAL(levelChanged()), this, SLOT(handleLevelChanged())); connect(Settings::self(), SIGNAL(themeChanged()), canvasWidget, SLOT(reloadSprites())); setCentralWidget(canvasWidget); setupActions(); setFocusProxy(canvasWidget); QSize defaultSize(DEFAULT_WIDTH, DEFAULT_HEIGHT); // show here (instead of in main) else the mouse can't be grabbed show(); gameEngine->start(Settings::self()->getLevelset()); }
void HWMapContainer::showThemePrompt() { ThemePrompt prompt(m_themeID, this); int theme = prompt.exec() - 1; // Since 0 means canceled, so all indexes are +1'd if (theme < 0) return; QModelIndex current = m_themeModel->index(theme, 0); updateTheme(current); emit themeChanged(m_theme); }
/** * If you consider to call this function multiple times * (for example because you want to update the theme list), * pay attention to freeing ThemeDescriptor objects and * m_ThemeListModel. * * Apparently multiple calls of setItemModel() with the same * model doesn't update MList. * * You also have to deal with disconnection and reconnection of * itemClicked() signal because MList::selectItem() emits that! */ void ThemeWidget::readLocalThemes () { /* * Creating the model and connecting it to the businesslogic so we can show * the spinner while the theme change is in progress. */ m_ThemeListModel = new ThemeListModel (m_ThemeBusinessLogic); m_ThemeListModel->setObjectName ("ThemeListModel"); SYS_DEBUG ("*** m_ThemeListModel = %p", m_ThemeListModel); m_List->setItemModel (m_ThemeListModel); if (m_ThemeBusinessLogic) { connect (m_ThemeBusinessLogic, SIGNAL(themeChangeStarted(QString)), m_ThemeListModel, SLOT(themeChangeStarted(QString))); connect (m_ThemeBusinessLogic, SIGNAL(themeChanged(QString)), m_ThemeListModel, SLOT(themeChanged(QString))); } /* * Enabling the live filter feature for the list. From this moment on the * list will use a QSortFilterProxyModel object as model. */ m_List->filtering()->setEnabled (true); m_List->filtering()->setFilterRole (ThemeListModel::SearchRole); m_Proxy = m_List->filtering()->proxy(); m_Proxy->setSortRole (ThemeListModel::SearchRole); m_Proxy->setSortCaseSensitivity(Qt::CaseInsensitive); // Seems that the sort() method simply will not sort when the // ThemeListModel::SearchRole is used. m_Proxy->sort(Qt::DisplayRole); m_Proxy->setFilterKeyColumn(0); m_LiveFilterEditor = m_List->filtering()->editor(); connect(m_List, SIGNAL(itemClicked(QModelIndex)), this, SLOT(themeActivated(QModelIndex))); SYS_DEBUG ("*** calling selectCurrentTheme()"); selectCurrentTheme (); }
Plasma::Svg* Flags::getSvg() { if( svg == NULL ) { svg = new Plasma::Svg; svg->setImagePath("widgets/labeltexture"); svg->setContainsMultipleImages(true); connect(svg, SIGNAL(repaintNeeded()), this, SLOT(themeChanged())); } return svg; }
void DownloadRegionDialog::showEvent( QShowEvent * event ) { connect( d->m_widget, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), this, SLOT(setVisibleLatLonAltBox(GeoDataLatLonAltBox)) ); connect( d->m_widget, SIGNAL(themeChanged(QString)), this, SLOT(updateTextureLayer()) ); emit shown(); event->accept(); }
void Action::init() { if (!Description->icon().isNull()) { connect(m_iconsManager, SIGNAL(themeChanged()), this, SLOT(updateIcon())); setIcon(Description->icon()); } checkState(); }
EmergingPlasmoid::EmergingPlasmoid(QObject * parent, const QVariantList & args) : Plasma::Applet(parent, args) , gentooLogoLabel(this) , currentJobMeter(this) , totalJobMeter(this) , layout(NULL) , currentJobName("Nothing being emerged") , targetJobCount(0) , currentJobCount(0) , secondsUntilGiveUp(0) , configDialog(NULL) { setBackgroundHints(DefaultBackground); gentooLogoLabel.setImage(KStandardDirs::locate("data", "emerging-plasmoid/glogo-small.png")); setHasConfigurationInterface(true); connect(&updateTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); updateTimer.start(1000); // every 1sec connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(themeChanged())); setAspectRatioMode(Plasma::IgnoreAspectRatio); }
MarbleDBusInterface::MarbleDBusInterface( MarbleWidget* widget ) : QDBusAbstractAdaptor( widget ), d( new Private( widget ) ) { connect( widget, SIGNAL(themeChanged(QString)), this, SIGNAL(mapThemeChanged(QString)) ); connect( widget, SIGNAL(tileLevelChanged(int)), this, SIGNAL(tileLevelChanged(int)) ); connect( widget, SIGNAL(zoomChanged(int)), this, SIGNAL(zoomChanged(int)) ); connect( widget, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), this, SLOT(handleVisibleLatLonAltBoxChange()) ); }
void Cutegram::setTheme(const QString &theme) { if(p->theme == theme) return; p->theme = theme; AsemanApplication::settings()->setValue("General/theme",p->theme); init_theme(); emit themeChanged(); }
TopBar::TopBar(QGraphicsView* mainView, QGraphicsWidget* parent) : GvbWidget(parent), m_mainView(mainView), m_isLimeTheme(false), m_orientation(TopBar::None), m_topBarPixmap(), m_sizesBlue(), m_sizesLime() { setDefaultSizes(); m_titleFont = Theme::p()->font(Theme::TitleBar); m_statusFont = Theme::p()->font(Theme::StatusBar); connect(Theme::p(), SIGNAL(themeChanged()), this, SLOT(themeChange())); }
K3b::ThemedLabel::ThemedLabel( K3b::Theme::PixmapType pix, QWidget* parent ) : KSqueezedTextLabel( parent ) { setThemePixmap( pix ); setTextElideMode( Qt::ElideRight ); connect( k3bappcore->themeManager(), SIGNAL(themeChanged()), this, SLOT(slotThemeChanged()) ); connect( KGlobalSettings::self(), SIGNAL(appearanceChanged()), this, SLOT(slotThemeChanged()) ); }