diff options
author | Weblate <noreply@weblate.org> | 2017-08-17 16:02:53 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2017-08-17 16:02:53 +0000 |
commit | e22937e90e6be7820e11cc9eba47bd0fb1b394e9 (patch) | |
tree | bb65904fd9aeee5e6325d12675e10f58cee25b80 /src-qt5/core/lumina-desktop/panel-plugins | |
parent | Translated using Weblate (Spanish) (diff) | |
parent | Merge remote-tracking branch 'origin/master' (diff) | |
download | lumina-e22937e90e6be7820e11cc9eba47bd0fb1b394e9.tar.gz lumina-e22937e90e6be7820e11cc9eba47bd0fb1b394e9.tar.bz2 lumina-e22937e90e6be7820e11cc9eba47bd0fb1b394e9.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/lumina-desktop/panel-plugins')
3 files changed, 18 insertions, 13 deletions
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 5e9d7a7f..be5b8488 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp @@ -78,8 +78,10 @@ void LBattery::updateBattery(bool force){ } if(icon<iconOld && icon==0){ //Play some audio warning chime when - LSession::handle()->playAudioFile(LOS::LuminaShare()+"low-battery.ogg"); - } + QString sfile = LSession::handle()->sessionSettings()->value("audiofiles/batterylow", LOS::LuminaShare()+"low-battery.ogg").toString(); + LSession::handle()->playAudioFile(sfile); + } + if(icon==0){ label->setStyleSheet("QLabel{ background: red;}"); } else if(icon==14 && charge>98){ label->setStyleSheet("QLabel{ background: green;}"); } else{ label->setStyleSheet("QLabel{ background: transparent;}"); } diff --git a/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp b/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp index bdf9b27e..2972ea86 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/clock/LClock.cpp @@ -25,14 +25,14 @@ LClock::LClock(QWidget *parent, QString id, bool horizontal) : LPPlugin(parent, calAct->setDefaultWidget(calendar); TZMenu = new QMenu(this); connect(TZMenu, SIGNAL(triggered(QAction*)), this, SLOT(ChangeTZ(QAction*)) ); - + //Now assemble the menu button->menu()->addAction(calAct); button->menu()->addMenu(TZMenu); - + this->layout()->setContentsMargins(0,0,0,0); //reserve some space on left/right this->layout()->addWidget(button); - + //Setup the timer timer = new QTimer(); //Load all the initial settings @@ -71,10 +71,11 @@ void LClock::updateTime(bool adjustformat){ }else if(datetimeorder == "datetime"){ label = datelabel + "\n" + timelabel; button->setToolTip(""); - }else{ + }else{ label = timelabel; button->setToolTip(datelabel); } + QStringList lines = label.split("\n"); if( this->layout()->direction() == QBoxLayout::TopToBottom ){ //different routine for vertical text (need newlines instead of spaces) for(int i=0; i<label.count("\n")+1; i++){ @@ -84,7 +85,7 @@ void LClock::updateTime(bool adjustformat){ } } //label.replace(" ","\n"); - }else if( this->size().height() < 2*this->fontMetrics().height() ){ + }else if( this->size().height() < lines.length()*this->fontMetrics().height() ){ label.replace("\n",", "); } if(adjustformat){ @@ -92,17 +93,18 @@ void LClock::updateTime(bool adjustformat){ font.setBold(true); button->setFont(font); //Check the font/spacing for the display and adjust as necessary - QStringList lines = label.split("/n"); + QStringList lines = label.split("\n"); QFontMetrics metrics(font); if(this->layout()->direction()==QBoxLayout::LeftToRight){ //horizontal layout int wid = 0; - int lwid; + int lwid = 0; for(int i=0; i<lines.length(); i++){ lwid = metrics.width(lines[i]); if(lwid>wid){ wid = lwid; } } - this->setMinimumWidth( wid - (4*metrics.width("O")) ); + qDebug() << "Verify Clock width:" << lines.length() << wid << lines; + this->setMinimumWidth(wid); this->setMaximumWidth(wid + (4*metrics.width("O"))); }else{ //vertical layout 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 6557dbee..1992db0f 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp @@ -1,8 +1,6 @@ //=========================================== // Lumina-DE source code -// Copyright (c) 2015, Ken Moore -// Available under the 3-clause BSD license -// See the LICENSE file for full details +// Copyright (c) 2015, Ken Moore // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== #include "StartMenu.h" #include "ui_StartMenu.h" @@ -290,6 +288,9 @@ bool StartMenu::promptAboutUpdates(bool &skip){ if(pending.isEmpty()){ skip = false; } //continue without skip else{ QMessageBox dlg(QMessageBox::Question, tr("Apply Updates?"), tr("You have system updates waiting to be applied! Do you wish to install them now?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, this); + dlg.setButtonText(QMessageBox::Yes, tr("Yes")); + dlg.setButtonText(QMessageBox::No, tr("No")); + dlg.setButtonText(QMessageBox::Cancel, tr("Cancel")); dlg.setDetailedText(pending); dlg.setDefaultButton(QMessageBox::Yes); dlg.show(); |