void controlyPlugin::getCatalog(QList<CatItem>* items) { getApps(items); CatItem tmp = CatItem("Launchy.controly", "Launchy", HASH_controly, getIcon()); tmp.usage = 5000; items->push_back(tmp); }
QPixmap KrView::getIcon(vfile *vf) { if(_previews) { QPixmap icon; if(_previews->getPreview(vf, icon, _focused)) return icon; } return getIcon(vf, _focused, _fileIconSize); }
void customMessageBoxNoModal( int whichIcon , const wxString& message,const wxString& caption, long style , int x, int y ) { wxWindow* parent = 0; wxIcon* icon = 0; getIcon( whichIcon, icon, parent ); s_nonmodbox = new CustomMessageBox (icon,parent,message,caption,style,wxPoint(x,y)); s_nonmodbox->Show(true); }
TypeIconLabel::TypeIconLabel(int type, QWidget *parent) : QLabel(parent) { setMinimumWidth(16); QHBoxLayout *hLayout = new QHBoxLayout; hLayout->setMargin(0); hLayout->setAlignment(Qt::AlignRight); setLayout(hLayout); if (type & UrlSuggestionItem::Search) hLayout->addWidget(getIcon("edit-find")); if (type & UrlSuggestionItem::Browse) hLayout->addWidget(getIcon("applications-internet")); if (type & UrlSuggestionItem::Bookmark) hLayout->addWidget(getIcon("rating")); if (type & UrlSuggestionItem::History) hLayout->addWidget(getIcon("view-history")); }
QString RunnerPlugin::getIcon(QString file) { #ifdef Q_WS_WIN QRegExp rx("\\.(exe|lnk)$", Qt::CaseInsensitive); if (rx.indexIn(file) != -1) return file; #endif return getIcon(); }
QWidget *RoseFileSelectorCreator::createWidget( QWidget *parent ) { QWidget *w( new RoseFileComboBox( parent ) ); w->setWindowTitle( getName() + QString( " [%1]" ).arg(counter ) ); w->setWindowIcon( getIcon() ); return w; }
QWidget *AsmInstructionBarCreator::createWidget( QWidget *parent ) { QWidget *w( new AsmInstructionsBar( parent ) ); w->setWindowTitle( getName() + QString( " [%1]" ).arg(counter ) ); w->setWindowIcon( getIcon() ); return w; }
void TextCommand::loadImage() { if (mImage) { mImage->decRef(); mImage = nullptr; } if (getIcon().empty()) return; ResourceManager *const resman = ResourceManager::getInstance(); const SpriteDisplay display = ItemDB::get(getIcon()).getDisplay(); mImage = resman->getImage(paths.getStringValue("itemIcons") .append(display.image)); if (!mImage) mImage = Theme::getImageFromTheme("unknown-item.png"); }
QIcon getIcon(const QVariant &iconOrIconId) { if (iconOrIconId.canConvert(QVariant::UInt)) return getIcon( QString(), iconOrIconId.value<ushort>() ); if (iconOrIconId.canConvert(QVariant::Icon)) return iconOrIconId.value<QIcon>(); return QIcon(); }
void timedMessageBoxNoModal(int whichIcon , const wxString& message, const wxString& caption, unsigned int delay, // miliseconds long style , const int x , const int y ) { wxWindow* parent = 0; wxIcon* icon = 0; getIcon( whichIcon, icon, parent ); s_timedMessageBox = new TimedMessageBox(icon,parent,message,caption,delay,style,wxPoint(x,y)); s_timedMessageBox->Show( true ); }
void LapsusPanelButton::checkCurVal() { _iconLabel->clear(); if (_dbus && _hasDBus && _curVal == "on") { if (_iconOn >= 0) _iconLabel->setPixmap(getIcon(_iconOn)); else _iconLabel->setText("+"); } else { if (_iconOff >= 0) _iconLabel->setPixmap(getIcon(_iconOff)); else _iconLabel->setText("-"); } }
void BaseFilter::initAction() { if (m_action) return; m_action = new QAction(getIcon(), getEntryName(), this); m_action->setStatusTip(getStatusTip()); //connect this action connect(m_action, SIGNAL(triggered()), this, SLOT(performAction())); }
QString WeatherPlugin::replace(const QString &text) { QString res = text; QString sun_set, sun_raise, updated; #if COMPAT_QT_VERSION >= 0x030000 QTime tmp_time; QDateTime dt; int h,m; parseTime(getSun_set(),h,m); tmp_time.setHMS(h,m,0,0); sun_set = tmp_time.toString(Qt::LocalDate); sun_set = sun_set.left(sun_set.length() - 3); parseTime(getSun_raise(),h,m); tmp_time.setHMS(h,m,0,0); sun_raise = tmp_time.toString(Qt::LocalDate); sun_raise = sun_raise.left(sun_raise.length() - 3); parseDateTime(getUpdated(),dt); updated = dt.toString(Qt::LocalDate); updated = updated.left(updated.length() - 3); #else sun_set = getSun_set(); sun_raise = getSun_raise(); updated = getUpdated(); #endif /* double Expressions *before* single or better RegExp ! */ res = res.replace(QRegExp("\\%mp"), i18n("moonphase", getMoonPhase())); res = res.replace(QRegExp("\\%mi"), number(getMoonIcon())); res = res.replace(QRegExp("\\%pp"), number(getPrecipitation())); res = res.replace(QRegExp("\\%ut"), i18n("weather", getUV_Description())); res = res.replace(QRegExp("\\%ui"), number(getUV_Intensity())); res = res.replace(QRegExp("\\%t"), QString::number((int)getTemperature()) + QChar((unsigned short)176) + getUT()); res = res.replace(QRegExp("\\%f"), QString::number((int)getFeelsLike()) + QChar((unsigned short)176) + getUT()); res = res.replace(QRegExp("\\%d"), QString::number((int)getDewPoint()) + QChar((unsigned short)176) + getUT()); res = res.replace(QRegExp("\\%h"), number(getHumidity()) + "%"); res = res.replace(QRegExp("\\%w"), number(getWind_speed()) + " " + i18n(getUS())); res = res.replace(QRegExp("\\%x"), QString::number(getWind_speed() * 10 / 36) + " " + i18n("m/s")); res = res.replace(QRegExp("\\%g"), getWindGust() ? QString("(") + i18n("gust ") + number(getWindGust()) + i18n(getUS()) + QString(")") : QString("")); res = res.replace(QRegExp("\\%y"), getWindGust() ? QString("(") + i18n("gust ") + number(getWindGust() * 10 / 36) + QString(" ") + i18n("m/s") + QString(")") : QString("")); res = res.replace(QRegExp("\\%p"), number(getPressure()) + " " + i18n(getUP())); res = res.replace(QRegExp("\\%a"), number(getPressure() * 75 / 100)); res = res.replace(QRegExp("\\%q"), i18n("weather", getPressureD())); res = res.replace(QRegExp("\\%l"), getLocation()); res = res.replace(QRegExp("\\%b"), i18n("weather", getWind())); res = res.replace(QRegExp("\\%u"), updated); res = res.replace(QRegExp("\\%r"), sun_raise); res = res.replace(QRegExp("\\%s"), sun_set); res = res.replace(QRegExp("\\%c"), i18n_conditions(getConditions())); res = res.replace(QRegExp("\\%v"), i18n("weather", getVisibility()) + (atol(getVisibility()) ? QString(" ") + i18n(getUD()) : QString(""))); res = res.replace(QRegExp("\\%i"), number(getIcon())); return res; }
void ConfigurationManager::initPluginWidgets(ItemFactory *itemFactory) { ui->itemOrderListPlugins->clearItems(); for ( const auto &loader : itemFactory->loaders() ) { ItemOrderList::ItemPtr pluginItem(new PluginItem(loader)); const QIcon icon = getIcon(loader->icon()); ui->itemOrderListPlugins->appendItem( loader->name(), itemFactory->isLoaderEnabled(loader), icon, pluginItem ); } }
/******************************************************************* * GFXCOLOURISEDIALOG FUNCTIONS *******************************************************************/ GfxColouriseDialog::GfxColouriseDialog(wxWindow* parent, ArchiveEntry* entry, Palette8bit* pal) : wxDialog(parent, -1, "Colourise", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) { // Init variables this->entry = entry; this->palette = pal; // Set dialog icon wxIcon icon; icon.CopyFromBitmap(getIcon("t_colourise")); SetIcon(icon); // Setup main sizer wxBoxSizer* msizer = new wxBoxSizer(wxVERTICAL); SetSizer(msizer); wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL); msizer->Add(sizer, 1, wxEXPAND|wxALL, 6); // Add colour chooser wxBoxSizer* hbox = new wxBoxSizer(wxHORIZONTAL); sizer->Add(hbox, 0, wxEXPAND|wxALL, 4); cp_colour = new wxColourPickerCtrl(this, -1, wxColour(255, 0, 0)); hbox->Add(new wxStaticText(this, -1, "Colour:"), 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); hbox->Add(cp_colour, 0, wxEXPAND); // Add preview gfx_preview = new GfxCanvas(this, -1); sizer->Add(gfx_preview, 1, wxEXPAND|wxALL, 4); // Add buttons sizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxEXPAND|wxBOTTOM, 4); // Setup preview gfx_preview->setViewType(GFXVIEW_CENTERED); gfx_preview->setPalette(pal); gfx_preview->SetInitialSize(wxSize(192, 192)); Misc::loadImageFromEntry(gfx_preview->getImage(), entry); wxColour col = cp_colour->GetColour(); gfx_preview->getImage()->colourise(rgba_t(col.Red(), col.Green(), col.Blue()), pal); gfx_preview->updateImageTexture(); // Init layout Layout(); // Bind events cp_colour->Bind(wxEVT_COLOURPICKER_CHANGED, &GfxColouriseDialog::onColourChanged, this); Bind(wxEVT_SIZE, &GfxColouriseDialog::onResize, this); // Setup dialog size SetInitialSize(wxSize(-1, -1)); SetMinSize(GetSize()); CenterOnParent(); }
void WeatherPlugin::updateButton() { if ((getTime() == 0) || (m_bar == NULL)) return; const char **xpm = xpms[getIcon()]; if (xpm){ IconDef icon; icon.name = "weather"; icon.xpm = xpm; Event eIcon(EventAddIcon, &icon); eIcon.process(); } QString text = unquoteText(getButtonText()); QString tip = getTipText(); QString ftip = getForecastText(); text = replace(text); tip = replace(tip); if (getForecast()) tip = QString("<table><tr><td>") + tip + "</td><td>"; unsigned n = (getForecast() + 1) / 2; if (n < 3) n = getForecast(); for (m_day = 1; m_day <= getForecast(); m_day++){ tip += forecastReplace(ftip); const char **xpm = xpms[atol(getDayIcon(m_day))]; if (xpm){ string url = "weather"; url += number(m_day); IconDef icon; icon.name = url.c_str(); icon.xpm = xpm; Event eIcon(EventAddIcon, &icon); eIcon.process(); } if (--n == 0){ tip += "</td><td>"; n = (getForecast() + 1) / 2; } } if (getForecast()) tip += "</td></tr></table>"; tip += "<br>\nWeather data provided by weather.com"; tip += QChar((unsigned short)176); Command cmd; cmd->id = CmdWeather; cmd->param = m_bar; Event e(EventCommandWidget, cmd); CToolButton *btn = (CToolButton*)e.process(); if (btn == NULL) return; btn->setTextLabel(text); btn->repaint(); QToolTip::add(btn, tip); }
/* SAction::addToToolbar * Adds this action to [toolbar]. If [icon_override] is not "NO", it * will be used instead of the action's icon as the tool icon *******************************************************************/ bool SAction::addToToolbar(wxToolBar* toolbar, string icon_override) { // Can't add to nonexistant toolbar if (!toolbar) return false; // Setup icon string useicon = icon; if (!(S_CMP(icon_override, "NO"))) useicon = icon_override; // Append this action to the toolbar if (type == NORMAL) toolbar->AddTool(wx_id, "", getIcon(useicon), helptext); else if (type == CHECK) toolbar->AddTool(wx_id, "", getIcon(useicon), helptext, wxITEM_CHECK); else if (type == RADIO) toolbar->AddTool(wx_id, "", getIcon(useicon), helptext, wxITEM_RADIO); return true; }
CreditsDialog::CreditsDialog(wxWindow* parent,wxString title,int whichIcon) : wxDialog(parent,-1,title,wxDefaultPosition, wxDefaultSize,wxDEFAULT_DIALOG_STYLE|wxFRAME_FLOAT_ON_PARENT) { wxBoxSizer* container = new wxBoxSizer(wxVERTICAL); text_ctrl = new wxTextCtrl(this,-1,wxEmptyString,wxDefaultPosition,wxDefaultSize,wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH); container->Add(text_ctrl,1,wxEXPAND); container->Add(wxDialog::CreateButtonSizer(wxOK)); SetSizer(container); wxIcon icon = getIcon( whichIcon); SetIcons(icon); }
void serverMessageBox(int whichIcon, const wxString& message, const wxString& caption, long style, int x, int y) { wxWindow* parent = getParent(whichIcon); wxIcon icon = getIcon(whichIcon); if (s_serverMsgBox != 0 && s_serverMsgBox->IsShown()) { s_serverMsgBox->AppendMessage(message); } else { s_serverMsgBox = new ServerMessageBox(&icon, parent, message, caption, style, wxPoint(x, y)); s_serverMsgBox->Show(true); } }
/* Icons::getIcon * Returns the icon matching [name] of [type] as a wxBitmap (for * toolbars etc), or an empty bitmap if no icon was found. If [type] * is less than 0, try all icon types. If [log_missing] is true, log * an error message if the icon was not found *******************************************************************/ wxBitmap Icons::getIcon(int type, string name, bool large, bool log_missing) { // Check all types if [type] is < 0 if (type < 0) { wxBitmap icon = getIcon(GENERAL, name, large, false); if (!icon.IsOk()) icon = getIcon(ENTRY, name, large, false); if (!icon.IsOk()) icon = getIcon(TEXT_EDITOR, name, large, false); if (!icon.IsOk() && log_missing) LOG_MESSAGE(2, "Icon \"%s\" does not exist", name); return icon; } vector<icon_t>& icons = iconList(type); for (size_t a = 0; a < icons.size(); a++) { if (icons[a].name.Cmp(name) == 0) { if (large) { if (icons[a].image_large.IsOk()) return wxBitmap(icons[a].image_large); else return wxBitmap(icons[a].image); } else return wxBitmap(icons[a].image); } } if (log_missing) LOG_MESSAGE(2, "Icon \"%s\" does not exist", name); return wxNullBitmap; }
void ShortcutsWidget::showEvent(QShowEvent *event) { for (auto &action : m_actions) { if ( action.tableItem->icon().isNull() ) action.tableItem->setIcon( getIcon(action.iconName, action.iconId) ); } QWidget::showEvent(event); ui->tableWidget->resizeColumnToContents(Columns::Icon); ui->tableWidget->resizeColumnToContents(Columns::Text); ui->tableWidget->resizeColumnToContents(Columns::Type); m_timerCheckAmbiguous.start(); // Update because shortcuts for commands may have changed. }
void GuiApplicationManager::getIcon(PixmapEnum e, int size, QPixmap* pix) const { if ( !QPixmapCache::find(QString::number(e) + QLatin1Char('@') + QString::number(size), pix) ) { getIcon(e, pix); if (std::max( pix->width(), pix->height() ) != size) { *pix = pix->scaled(size, size, Qt::KeepAspectRatio, Qt::SmoothTransformation); QPixmapCache::insert(QString::number(e), *pix); } } }
/* GfxConvDialog::GfxConvDialog * GfxConvDialog class constructor *******************************************************************/ GfxConvDialog::GfxConvDialog(wxWindow* parent) : SDialog(parent, "Graphic Format Conversion", "gfxconv") { current_item = 0; // Set dialog icon wxIcon icon; icon.CopyFromBitmap(getIcon("t_convert")); SetIcon(icon); setupLayout(); CenterOnParent(); }
QList<QAction *> qCSF::getActions() { if (!m_action) { m_action = new QAction(getName(),this); m_action->setToolTip(getDescription()); m_action->setIcon(getIcon()); //connect appropriate signal connect(m_action, &QAction::triggered, this, &qCSF::doAction); } return QList<QAction *>{ m_action }; }
void ConfigurationManager::initTabIcons() { QTabWidget *tw = ui->tabWidget; if ( !tw->tabIcon(0).isNull() ) return; tw->setTabIcon( tw->indexOf(ui->tabGeneral), getIcon("", IconWrench) ); tw->setTabIcon( tw->indexOf(ui->tabLayout), getIcon("", IconColumns) ); tw->setTabIcon( tw->indexOf(ui->tabHistory), getIcon("", IconListAlt) ); tw->setTabIcon( tw->indexOf(ui->tabItems), getIcon("", IconThList) ); tw->setTabIcon( tw->indexOf(ui->tabTray), getIcon("", IconInbox) ); tw->setTabIcon( tw->indexOf(ui->tabNotifications), getIcon("", IconInfoCircle) ); tw->setTabIcon( tw->indexOf(ui->tabShortcuts), getIcon("", IconKeyboard) ); tw->setTabIcon( tw->indexOf(ui->tabAppearance), getIcon("", IconImage) ); }
void mutelistWindow(const wxString& message, const wxString& caption, long style, const int x, const int y) { wxWindow* parent = getParent(SL_MAIN_ICON); wxIcon icon = getIcon(SL_MAIN_ICON); if (s_mutelistWindow != 0 && s_mutelistWindow->IsShown()) { s_mutelistWindow->AppendMessage(message); } else { s_mutelistWindow = new MutelistWindow(&icon, parent, wxEmptyString, caption, style, wxPoint(x, y)); s_mutelistWindow->AppendMessage(message); s_mutelistWindow->Show(true); } }
void qAnimation::getActions(QActionGroup& group) { //default action (if it has not been already created, it's the moment to do it) if (!m_action) { m_action = new QAction(getName(), this); m_action->setToolTip(getDescription()); m_action->setIcon(getIcon()); connect(m_action, SIGNAL(triggered()), this, SLOT(doAction())); } group.addAction(m_action); }
void qHPR::getActions(QActionGroup& group) { //default action if (!m_action) { m_action = new QAction(getName(),this); m_action->setToolTip(getDescription()); m_action->setIcon(getIcon()); //connect signal connect(m_action, SIGNAL(triggered()), this, SLOT(doAction())); } group.addAction(m_action); }
QList<QAction *> qCork::getActions() { //default action if (!m_action) { m_action = new QAction(getName(),this); m_action->setToolTip(getDescription()); m_action->setIcon(getIcon()); //connect signal connect(m_action, &QAction::triggered, this, &qCork::doAction); } return QList<QAction *>{ m_action }; }
QList<QAction *> qRansacSD::getActions() { //default action if (!m_action) { m_action = new QAction(getName(),this); m_action->setToolTip(getDescription()); m_action->setIcon(getIcon()); //connect signal connect(m_action, SIGNAL(triggered()), this, SLOT(doAction())); } return QList<QAction *>{ m_action }; }