QString ZFonts::getViewText() { if ( sViewText.length() == 0 ) { QString curLng; ZConfig cfg( "/ezxlocal/download/appwrite/setup/ezx_system.cfg" ); curLng = cfg.readEntry("SYS_SYSTEM_SET", "LanguageType", ""); if ( curLng.length() > 1 ) curLng = QString(curLng[0]) + QString(curLng[1]); ZConfig cfg2( LNG_PATH+"/zFonts.lng" ); sViewText = QString::fromUtf8(cfg2.readEntry("ViewString", curLng, "").utf8()).replace("/n","\n"); if ( sViewText.length() == 0 ) sViewText = QString::fromUtf8(cfg2.readEntry("ViewString", "en", "").utf8()).replace("/n","\n"); } return sViewText; }
KisSplashScreen::KisSplashScreen(const QString &version, const QPixmap &pixmap, bool themed, QWidget *parent, Qt::WindowFlags f) : QWidget(parent, Qt::SplashScreen | Qt::FramelessWindowHint | f) { setupUi(this); setWindowIcon(KisIconUtils::loadIcon("calligrakrita")); QString color = "#FFFFFF"; if (themed && qApp->palette().background().color().value() >100) { color = "#000000"; } lblSplash->setPixmap(pixmap); bnClose->hide(); connect(bnClose, SIGNAL(clicked()), this, SLOT(close())); chkShowAtStartup->hide(); connect(chkShowAtStartup, SIGNAL(toggled(bool)), this, SLOT(toggleShowAtStartup(bool))); KConfigGroup cfg( KSharedConfig::openConfig(), "SplashScreen"); bool hideSplash = cfg.readEntry("HideSplashAfterStartup", false); chkShowAtStartup->setChecked(hideSplash); lblLinks->setTextFormat(Qt::RichText); lblLinks->setText(i18n("<html>" "<head/>" "<body>" "<p align=\"center\"><span style=\" color:%1;\"><b>Links</b></span></p>" "<p><a href=\"https://krita.org/support-us/donations/\"><span style=\" text-decoration: underline; color:%1;\">Support Krita</span></a></p>" "<p><a href=\"http://krita.org/resources\"><span style=\" text-decoration: underline; color:%1;\">Getting Started</span></a></p>" "<p><a href=\"http://userbase.kde.org/Krita/Manual\"><span style=\" text-decoration: underline; color:%1;\">Manual</span></a></p>" "<p><a href=\"http://krita.org\"><span style=\" text-decoration: underline; color:%1;\">Krita Website</span></a></p>" "<p><a href=\"http://forum.kde.org/viewforum.php?f=136\"><span style=\" text-decoration: underline; color:%1;\">User Community</span></a></p>" "<p><a href=\"https://projects.kde.org/projects/calligra\"><span style=\" text-decoration: underline; color:%1;\">Source Code</span></a></p>" "<p><a href=\"http://store.steampowered.com/app/280680/\"><span style=\" text-decoration: underline; color:%1;\">Krita on Steam</span></a></p>" "</body>" "</html>", color)); lblVersion->setText(i18n("Version: %1", version)); lblVersion->setStyleSheet("color:" + color); KConfigGroup cfg2( KSharedConfig::openConfig(), "RecentFiles"); int i = 1; QString recent = i18n("<html>" "<head/>" "<body>" "<p align=\"center\"><b><span style=\" color:%1;\">Recent Files</span></b></p>", color); QString path; QStringList recentfiles; do { path = cfg2.readPathEntry(QString("File%1").arg(i), QString()); if (!path.isEmpty()) { QString name = cfg2.readPathEntry(QString("Name%1").arg(i), QString()); QUrl url(path); if (name.isEmpty()) name = url.fileName(); if (!url.isLocalFile() || QFile::exists(url.toLocalFile())) { recentfiles.insert(0, QString("<p><a href=\"%1\"><span style=\"color:%3;\">%2</span></a></p>").arg(path).arg(name).arg(color)); } } i++; } while (!path.isEmpty() || i <= 8); recent += recentfiles.join("\n"); recent += "</body>" "</html>"; lblRecent->setText(recent); connect(lblRecent, SIGNAL(linkActivated(QString)), SLOT(linkClicked(QString))); }
void TabsSettings::accept ( ) { Config cfg ( "Launcher" ); Config cfg2 ( "Launchersettings" ); // Launcher Tab QString grp ( "Tab %1" ); // No tr for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { TabConfig &tc = m_tabs [*it]; if ( !tc. m_changed ) continue; cfg. setGroup ( grp. arg ( *it )); cfg2. setGroup ( grp. arg ( *it )); switch ( tc. m_view ) { case TabConfig::Icon: cfg.writeEntry ( "View", "Icon" ); break; case TabConfig::List: cfg.writeEntry ( "View", "List" ); break; } QCopEnvelope e ( "QPE/Launcher", "setTabView(QString,int)" ); e << *it << tc. m_view; cfg. writeEntry ( "BackgroundImage", tc. m_bg_image ); cfg. writeEntry ( "BackgroundColor", tc. m_bg_color ); cfg. writeEntry ( "Columns", tc. m_iconcolumns ); cfg. writeEntry ( "TextColor", tc. m_text_color ); cfg2. writeEntry ( "DefaultDir", tc.m_last_directory ); if ( tc. m_font_use ) { QString f = tc. m_font_family + "," + QString::number ( tc. m_font_size ) + "," + QString::number ( tc. m_font_weight ) + "," + ( tc. m_font_italic ? "1" : "0" ); cfg. writeEntry ( "Font", f ); } else cfg. removeEntry ( "Font" ); QCopEnvelope be ( "QPE/Launcher", "setTabBackground(QString,int,QString)" ); switch ( tc. m_bg_type ) { case TabConfig::Ruled: cfg.writeEntry( "BackgroundType", "Ruled" ); be << *it << tc. m_bg_type << QString(""); break; case TabConfig::SolidColor: cfg.writeEntry( "BackgroundType", "SolidColor" ); be << *it << tc. m_bg_type << tc. m_bg_color; break; case TabConfig::Image: cfg.writeEntry( "BackgroundType", "Image" ); be << *it << tc. m_bg_type << tc. m_bg_image; break; } QCopEnvelope te( "QPE/Launcher", "setTextColor(QString,QString)" ); te << *it << tc. m_text_color; QCopEnvelope ic( "QPE/Launcher", "setIconColumns(QString,int)" ); ic << *it << tc. m_iconcolumns; QCopEnvelope fe ( "QPE/Launcher", "setFont(QString,QString,int,int,int)" ); fe << *it; fe << ( tc. m_font_use ? tc. m_font_family : QString::null ); fe << tc. m_font_size; fe << tc. m_font_weight; fe << ( tc. m_font_italic ? 1 : 0 ); tc. m_changed = false; } cfg. setGroup ( "GUI" ); QString busytype = QString ( m_busyani-> isChecked ( ) ? "Animated" : "" ); cfg. writeEntry ( "BusyType", busytype ); cfg. writeEntry ( "BigBusy", m_bigbusy->isChecked( ) ); cfg. writeEntry ( "StaticBackground", m_staticbackground->isChecked( ) ); { QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" ); e << busytype; } { QCopEnvelope e ( "QPE/Launcher", "setStaticBackground(bool)" ); e << m_staticbackground->isChecked(); } }