diff options
Diffstat (limited to 'src-qt5/core/lumina-desktop')
12 files changed, 117 insertions, 31 deletions
diff --git a/src-qt5/core/lumina-desktop/defaults/desktop-background-TrueOS.jpg b/src-qt5/core/lumina-desktop/defaults/desktop-background-TrueOS.jpg Binary files differindex de11074e..3fd8cc49 100644 --- a/src-qt5/core/lumina-desktop/defaults/desktop-background-TrueOS.jpg +++ b/src-qt5/core/lumina-desktop/defaults/desktop-background-TrueOS.jpg diff --git a/src-qt5/core/lumina-desktop/defaults/luminaDesktop-TrueOS.conf b/src-qt5/core/lumina-desktop/defaults/luminaDesktop-TrueOS.conf index e9520a3c..543f9eaa 100644 --- a/src-qt5/core/lumina-desktop/defaults/luminaDesktop-TrueOS.conf +++ b/src-qt5/core/lumina-desktop/defaults/luminaDesktop-TrueOS.conf @@ -53,6 +53,7 @@ mime_default_application/x-tar_ifexists=lumina-archiver.desktop #THEME SETTINGS theme_themefile=DarkGlass #Name of the theme to use (disable for Lumina-Default) +theme_styles=scrollbar-simple, tooltip-simple, sliders-simple, traynotification-simple theme_colorfile=darker #Name of the color spec file to use for theming theme_iconset=material-design-dark #Name of the icon theme to use theme_font=Noto Sans #Name of the font family to use @@ -60,14 +61,14 @@ theme_fontsize=10pt #Default size of the fonts to use on the desktop (can also u #DESKTOP SETTINGS (used for the primary screen in multi-screen setups) desktop_visiblepanels=1 #[0 - 12] The number of panels visible by default -desktop_backgroundfiles=/usr/local/share/wallpapers/TrueOS/trueos-1-4k.png #list of absolute file paths for image files (disable for Lumina default) +desktop_backgroundfiles=/usr/local/share/lumina-desktop/desktop-background.jpg #list of absolute file paths for image files (disable for Lumina default) desktop_backgroundrotateminutes=5 #[positive integer] number of minutes between background rotations (if multiple files) #desktop_plugins= #list of plugins to be shown on the desktop by default desktop_generate_icons=true #[true/false] Auto-generate launchers for ~/Desktop items #PANEL SETTINGS (preface with panel1.<setting> or panel2.<setting>, depending on the number of panels you have visible by default) panel1_location=bottom #[top/bottom/left/right] Screen edge the panel should be on -panel1_pixelsize=3.5%H #number of pixels wide/high the panel should be (or <number>%[W/H] for a percentage of the screen width/height) +panel1_pixelsize=5%H #number of pixels wide/high the panel should be (or <number>%[W/H] for a percentage of the screen width/height) panel1_autohide=false #[true/false] Have the panel become visible on mouse-over panel1_plugins=systemstart, taskmanager-nogroups, spacer, systemtray, clock, battery #list of plugins for the panel panel1_pinlocation=center #[left/center/right] Note:[left/right] corresponds to [top/bottom] for vertical panels diff --git a/src-qt5/core/lumina-desktop/defaults/luminaDesktop.conf b/src-qt5/core/lumina-desktop/defaults/luminaDesktop.conf index e4229038..0e6101c1 100644 --- a/src-qt5/core/lumina-desktop/defaults/luminaDesktop.conf +++ b/src-qt5/core/lumina-desktop/defaults/luminaDesktop.conf @@ -50,7 +50,8 @@ mime_default_unknown/*=lumina-textedit.desktop mime_default_application/x-shellscript=lumina-textedit.desktop #THEME SETTINGS -theme_themefile=DarkGlass #Name of the theme to use (disable for Lumina-Default) +theme_themefile=DarkGlass #Name of the theme to use +theme_styles=scrollbar-simple, tooltip-simple, sliders-simple, traynotification-simple theme_colorfile=darker #Name of the color spec file to use for theming theme_iconset=material-design-dark #Name of the icon theme to use theme_font=Arial #Name of the font family to use diff --git a/src-qt5/core/lumina-desktop/desktop-plugins/rssreader/RSSFeedPlugin.cpp b/src-qt5/core/lumina-desktop/desktop-plugins/rssreader/RSSFeedPlugin.cpp index c330d6c0..e8e5adb4 100644 --- a/src-qt5/core/lumina-desktop/desktop-plugins/rssreader/RSSFeedPlugin.cpp +++ b/src-qt5/core/lumina-desktop/desktop-plugins/rssreader/RSSFeedPlugin.cpp @@ -119,11 +119,13 @@ void RSSFeedPlugin::updateFeed(QString ID){ if(!data.items[i].author_email.isEmpty()){ html.append("<a href=\"mailto:"+data.items[i].author_email+"\" style=\"color: "+color+";\">"+data.items[i].author+"</a>"); } else{ html.append(data.items[i].author); } } - html.append(")</i><br>"); + html.append(")</i>"); + if(data.rss) + html.append("<br>"); } html.append(data.items[i].description); //html.append("</li>\n"); - if(i+1 < data.items.length()){ html.append("<br>"); } + if(i+1 < data.items.length() && data.rss){ html.append("<br>"); } } //html.append("</ul>\n"); // - load that html into the viewer diff --git a/src-qt5/core/lumina-desktop/desktop-plugins/rssreader/RSSObjects.cpp b/src-qt5/core/lumina-desktop/desktop-plugins/rssreader/RSSObjects.cpp index cd29d5f0..5f62f99f 100644 --- a/src-qt5/core/lumina-desktop/desktop-plugins/rssreader/RSSObjects.cpp +++ b/src-qt5/core/lumina-desktop/desktop-plugins/rssreader/RSSObjects.cpp @@ -10,6 +10,8 @@ #include "LSession.h" +#define DEBUG 0 + //============ // PUBLIC //============ @@ -116,18 +118,51 @@ RSSchannel RSSReader::readRSS(QByteArray bytes){ RSSchannel rssinfo; //qDebug() << "Can Read XML Stream:" << !xml.hasError(); if(xml.readNextStartElement()){ - //qDebug() << " - RSS Element:" << xml.name(); - if(xml.name() == "rss" && (xml.attributes().value("version") =="2.0" || xml.attributes().value("version") =="0.91") ){ + if(DEBUG) qDebug() << " - RSS Element:" << xml.name(); + if(xml.name() == "rss" && (xml.attributes().value("version") =="2.0" || xml.attributes().value("version") =="0.91")) { + rssinfo.rss = true; while(xml.readNextStartElement()){ //qDebug() << " - RSS Element:" << xml.name(); if(xml.name()=="channel"){ rssinfo = readRSSChannel(&xml); } else{ xml.skipCurrentElement(); } } + }else if(xml.name() == "feed") { + rssinfo.timetolive = -1; + rssinfo.rss = false; + while(xml.readNextStartElement()){ + if(DEBUG) qDebug() << " - ATOM Element (channel):" << xml.name(); + if(xml.name()=="entry") { + rssinfo.items << readRSSItemAtom(&xml); + }else if(xml.name()=="title"){ + rssinfo.title = xml.readElementText(); + if(DEBUG) qDebug() << "title" << rssinfo.link; + }else if(xml.name()=="link"){ + QXmlStreamAttributes att = xml.attributes(); + for(int i = 0; i < att.size(); i++) { + if(att[i].name() == "href") { + rssinfo.link = att[i].value().toString(); + } + } + xml.readElementText(); + if(DEBUG) qDebug() << "link" << rssinfo.link; + }else if(xml.name()=="subtitle"){ + rssinfo.description = xml.readElementText(); + }else if(xml.name()=="updated"){ + rssinfo.lastBuildDate = ATOMDateTime(xml.readElementText()); + }else if(xml.name()=="icon"){ + rssinfo.icon_url = xml.readElementText(); + if(DEBUG) qDebug() << "icon" << rssinfo.icon_url; + requestRSS(rssinfo.icon_url); + }else{ + xml.skipCurrentElement(); + } + } } } - if(xml.hasError()){ qDebug() << " - XML Read Error:" << xml.errorString() << "\n" << bytes; } + //if(xml.hasError()){ qDebug() << " - XML Read Error:" << xml.errorString() << "\n" << bytes; } return rssinfo; } + RSSchannel RSSReader::readRSSChannel(QXmlStreamReader *rss){ RSSchannel info; info.timetolive = -1; @@ -151,6 +186,40 @@ RSSchannel RSSReader::readRSSChannel(QXmlStreamReader *rss){ return info; } +RSSitem RSSReader::readRSSItemAtom(QXmlStreamReader *rss){ + RSSitem item; + while(rss->readNextStartElement()){ + if(rss->name()=="title"){ + item.title = rss->readElementText(); + if(DEBUG) qDebug() << rss->name() << item.title; + }else if(rss->name()=="link"){ + QXmlStreamAttributes att = rss->attributes(); + for(int i = 0; i < att.size(); i++) { + if(att[i].name() == "href") { + item.link = att[i].value().toString(); + } + } + rss->readElementText(); + if(DEBUG) qDebug() << rss->name() << item.link; + }else if(rss->name()=="summary"){ + item.description = rss->readElementText(); + if(DEBUG) qDebug() << rss->name() << item.description; + } else if(rss->name()=="comments"){ + item.comments_url = rss->readElementText(); + if(DEBUG) qDebug() << rss->name() << item.comments_url; + } else if(rss->name()=="author"){ + rss->readNextStartElement(); + item.author = rss->readElementText(); + if(DEBUG) qDebug() << "author" << item.author; + rss->skipCurrentElement(); + }else if(rss->name()=="updated"){ + item.pubdate = ATOMDateTime(rss->readElementText()); + if(DEBUG) qDebug() << rss->name() << item.pubdate; + } else{ rss->skipCurrentElement(); } + } + return item; +} + RSSitem RSSReader::readRSSItem(QXmlStreamReader *rss){ RSSitem item; while(rss->readNextStartElement()){ @@ -192,17 +261,21 @@ QDateTime RSSReader::RSSDateTime(QString datetime){ return QDateTime::fromString(datetime, Qt::RFC2822Date); } +QDateTime RSSReader::ATOMDateTime(QString datetime){ + return QDateTime::fromString(datetime, Qt::ISODate); +} + //================= // PRIVATE SLOTS //================= void RSSReader::replyFinished(QNetworkReply *reply){ QString url = reply->request().url().toString(); - //qDebug() << "Got Reply:" << url; + qDebug() << "Got Reply:" << url; QString key = keyForUrl(url); //current hash key for this URL QByteArray data = reply->readAll(); outstandingURLS.removeAll(url); if(data.isEmpty()){ - //qDebug() << "No data returned:" << url; + qDebug() << "No data returned:" << url; //see if the URL can be adjusted for known issues bool handled = false; QUrl redirecturl = reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl(); @@ -229,13 +302,13 @@ void RSSReader::replyFinished(QNetworkReply *reply){ //Could also be an icon fetch response QStringList keys = hash.keys(); for(int i=0; i<keys.length(); i++){ - //qDebug() << " - Check for icon URL:" << hash[keys[i]].icon_url; + qDebug() << " - Check for icon URL:" << hash[keys[i]].icon_url; if(hash[keys[i]].icon_url.toLower() == url.toLower()){ //needs to be case-insensitive //Icon fetch response RSSchannel info = hash[keys[i]]; QImage img = QImage::fromData(data); info.icon = QIcon( QPixmap::fromImage(img) ); - //qDebug() << "Got Icon response:" << url << info.icon; + qDebug() << "Got Icon response:" << url << info.icon; hash.insert(keys[i], info); //insert back into the hash emit rssChanged( hash[keys[i]].originalURL ); break; diff --git a/src-qt5/core/lumina-desktop/desktop-plugins/rssreader/RSSObjects.h b/src-qt5/core/lumina-desktop/desktop-plugins/rssreader/RSSObjects.h index 3069bf8d..9d65ee57 100644 --- a/src-qt5/core/lumina-desktop/desktop-plugins/rssreader/RSSObjects.h +++ b/src-qt5/core/lumina-desktop/desktop-plugins/rssreader/RSSObjects.h @@ -51,6 +51,7 @@ struct RSSchannel{ //Internal data for bookkeeping QDateTime lastsync, nextsync; QString originalURL; //in case it was redirected to some "fixed" url later + bool rss; }; class RSSReader : public QObject{ @@ -88,9 +89,12 @@ private: //RSS parsing functions RSSchannel readRSS(QByteArray bytes); RSSchannel readRSSChannel(QXmlStreamReader *rss); + RSSchannel readRSSChannelAtom(QXmlStreamReader *rss); RSSitem readRSSItem(QXmlStreamReader *rss); - void readRSSImage(RSSchannel *item, QXmlStreamReader *rss); + RSSitem readRSSItemAtom(QXmlStreamReader *rss); + void readRSSImage(RSSchannel *item, QXmlStreamReader *rss); QDateTime RSSDateTime(QString datetime); + QDateTime ATOMDateTime(QString datetime); private slots: void replyFinished(QNetworkReply *reply); diff --git a/src-qt5/core/lumina-desktop/lumina-desktop.pro b/src-qt5/core/lumina-desktop/lumina-desktop.pro index 9c8272c8..e36d11a2 100644 --- a/src-qt5/core/lumina-desktop/lumina-desktop.pro +++ b/src-qt5/core/lumina-desktop/lumina-desktop.pro @@ -170,10 +170,10 @@ TRANSLATIONS = i18n/lumina-desktop_af.ts \ i18n/lumina-desktop_zu.ts dotrans.path=$${L_SHAREDIR}/lumina-desktop/i18n/ -dotrans.extra=cd i18n && $${LRELEASE} -nounfinished *.ts && cp *.qm $(INSTALL_ROOT)$${L_SHAREDIR}/lumina-desktop/i18n/ +dotrans.extra=cd $$PWD/i18n && $${LRELEASE} -nounfinished *.ts && cp *.qm $(INSTALL_ROOT)$${L_SHAREDIR}/lumina-desktop/i18n/ manpage.path=$${L_MANDIR}/man1/ -manpage.extra="$${MAN_ZIP} lumina-desktop.1 > $(INSTALL_ROOT)$${L_MANDIR}/man1/lumina-desktop.1.gz" +manpage.extra="$${MAN_ZIP} $$PWD/lumina-desktop.1 > $(INSTALL_ROOT)$${L_MANDIR}/man1/lumina-desktop.1.gz" INSTALLS += target desktop icons defaults conf fluxconf manpage diff --git a/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp b/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp index 7a6b0e7c..69ea5faa 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp @@ -77,6 +77,7 @@ void LBattery::updateBattery(bool force){ label->setPixmap( LXDG::findIcon("battery-unknown", "battery-missing").pixmap(label->size()) ); break; } + } if(icon<iconOld && icon==0){ //Play some audio warning chime when bool playaudio = sessionsettings->value("PlayBatteryLowAudio",true).toBool(); @@ -97,7 +98,6 @@ void LBattery::updateBattery(bool force){ else{ tt = QString( tr("%1 % (%2 Remaining)") ).arg(QString::number(charge), getRemainingTime() ); } label->setToolTip(tt); } -} QString LBattery::getRemainingTime(){ int secs = LOS::batterySecondsLeft(); diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/ItemWidget.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/ItemWidget.cpp index f4382ffc..545000f4 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/ItemWidget.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/ItemWidget.cpp @@ -70,12 +70,12 @@ ItemWidget::ItemWidget(QWidget *parent, QString itemPath, QString type, bool gob iconPath = itemPath; //icon->setPixmap( QIcon(itemPath).pixmap(64,64) ); }else{ - if( LUtils::isValidBinary(itemPath) ){ + if( LUtils::isValidBinary(itemPath) ){ if(ICONS->exists(type)){ iconPath = type; } else{ iconPath = "application-x-executable"; } }else{ iconPath = LXDG::findAppMimeForFile(itemPath.section("/",-1)).replace("/","-"); } } - name->setText( itemPath.section("/",-1) ); //this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, TEXTCUTOFF) ); + name->setText( itemPath.section("/",-1) ); //this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, TEXTCUTOFF) ); text = itemPath.section("/",-1) ; } ICONS->loadIcon(icon, iconPath); @@ -133,11 +133,11 @@ ItemWidget::~ItemWidget(){ //actButton->deleteLater(); contextMenu->clear(); //contextMenu->deleteLater(); - if(actButton->menu()!=0){ + if(actButton->menu()!=0){ for(int i=0; i<actButton->menu()->actions().length(); i++){ actButton->menu()->actions().at(i)->deleteLater(); } - actButton->menu()->deleteLater(); + actButton->menu()->deleteLater(); } //actButton->deleteLater(); //icon->deleteLater(); @@ -156,7 +156,7 @@ void ItemWidget::createWidget(){ menuopen = false; menureset = new QTimer(this); menureset->setSingleShot(true); - menureset->setInterval(1000); //1 second + menureset->setInterval(1000); //1 second this->setContentsMargins(0,0,0,0); contextMenu = new QMenu(this); connect(contextMenu, SIGNAL(aboutToShow()), this, SLOT(actionMenuOpen()) ); @@ -220,7 +220,7 @@ void ItemWidget::setupActions(XDGDesktop *app){ else{ ICONS->loadIcon(act, app->icon); } act->setToolTip(app->actions[i].ID); act->setWhatsThis(app->actions[i].ID); - actButton->menu()->addAction(act); + actButton->menu()->addAction(act); } connect(actButton->menu(), SIGNAL(triggered(QAction*)), this, SLOT(actionClicked(QAction*)) ); connect(actButton->menu(), SIGNAL(aboutToShow()), this, SLOT(actionMenuOpen()) ); @@ -230,9 +230,11 @@ void ItemWidget::setupActions(XDGDesktop *app){ void ItemWidget::updateItems(){ //update the text/icon to match sizes - int H = (2.5*name->fontMetrics().height() ) -4; //make sure the height is large enough for two lines + int H = (2.2*name->fontMetrics().height() ) -4; //make sure the height is large enough for two lines icon->setFixedSize(QSize(H, H)); + icon->setAlignment(Qt::AlignCenter); actButton->setFixedSize( QSize( H/2, H) ); + H = (1.8*name->fontMetrics().height() ) -4; QStringList newname = text.split("<br>"); for(int i=0; i<newname.length(); i++){ newname[i] = name->fontMetrics().elidedText(newname[i], Qt::ElideRight, name->width()); } name->setText( newname.join("<br>") ); @@ -271,9 +273,9 @@ void ItemWidget::RemoveFavorite(){ void ItemWidget::AddFavorite(){ if( LDesktopUtils::addFavorite(icon->whatsThis()) ){ linkPath = icon->whatsThis(); - emit NewShortcut(); + emit NewShortcut(); } - + } void ItemWidget::RemoveQL(){ qDebug() << "Remove QuickLaunch Button:" << icon->whatsThis(); @@ -282,7 +284,7 @@ void ItemWidget::RemoveQL(){ void ItemWidget::AddQL(){ qDebug() << "Add QuickLaunch Button:" << icon->whatsThis(); - emit toggleQuickLaunch(icon->whatsThis(), true); + emit toggleQuickLaunch(icon->whatsThis(), true); } diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp index 562122ae..d8014f4c 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp @@ -25,9 +25,11 @@ LStartButtonPlugin::LStartButtonPlugin(QWidget *parent, QString id, bool horizon startmenu = new StartMenu(this); connect(startmenu, SIGNAL(CloseMenu()), this, SLOT(closeMenu()) ); connect(startmenu, SIGNAL(UpdateQuickLaunch(QStringList)), this, SLOT(updateQuickLaunch(QStringList))); - //QRect screenSize = QApplication::desktop()->availableGeometry(this); - QSize saved = LSession::handle()->DesktopPluginSettings()->value("panelPlugs/"+this->type()+"/MenuSize", QSize(0, 0)).toSize(); - if(!saved.isNull()){ startmenu->setFixedSize(saved); } //re-load the previously saved value + + QRect screenSize = QApplication::desktop()->availableGeometry(this); + QSize saved = LSession::handle()->DesktopPluginSettings()->value("panelPlugs/"+this->type()+"/MenuSize",QSize(this->fontMetrics().width("x")*30 ,screenSize.height()/1.8)).toSize(); + //qDebug() << "Got Start Menu Saved Size:" << saved; + if(!saved.isNull() && saved.isValid()){ startmenu->setFixedSize(saved); } //re-load the previously saved value menu->setContents(startmenu); button->setMenu(menu); @@ -122,6 +124,7 @@ void LStartButtonPlugin::openMenu(){ menu->setContents(startmenu); if(old!=0){ old->deleteLater(); }*/ //-------- + //qDebug() << "Menu Size:" << startmenu->size(); startmenu->UpdateMenu(); button->showMenu(); } diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp index 272bf0fa..ee3e0f80 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp @@ -597,7 +597,7 @@ void StartMenu::on_tool_restart_clicked(){ LSession::handle()->StartReboot(true); } -void StartMenu::on_tool_restart_update_clicked(){ +void StartMenu::on_tool_restart_updates_clicked(){ emit CloseMenu(); QCoreApplication::processEvents(); //bool skipupdates = false; diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h index 41bc3ec4..0a90311d 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h @@ -73,7 +73,7 @@ private slots: void on_tool_lock_clicked(); void on_tool_logout_clicked(); void on_tool_restart_clicked(); - void on_tool_restart_update_clicked(); + void on_tool_restart_updates_clicked(); void on_tool_shutdown_clicked(); void on_tool_suspend_clicked(); |