diff options
author | Weblate <noreply@weblate.org> | 2018-03-10 15:09:31 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2018-03-10 15:09:31 +0000 |
commit | e823783499a7b2f8c3cbfb24ae428b39311bee5e (patch) | |
tree | 74138f1e34b8f090f62bd5412f38b8e185209302 /src-qt5/core/lumina-open/main.cpp | |
parent | Translated using Weblate (Italian) (diff) | |
parent | Add the beginnings of the new window frame (widgets-based) (diff) | |
download | lumina-e823783499a7b2f8c3cbfb24ae428b39311bee5e.tar.gz lumina-e823783499a7b2f8c3cbfb24ae428b39311bee5e.tar.bz2 lumina-e823783499a7b2f8c3cbfb24ae428b39311bee5e.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/lumina-open/main.cpp')
-rw-r--r-- | src-qt5/core/lumina-open/main.cpp | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/src-qt5/core/lumina-open/main.cpp b/src-qt5/core/lumina-open/main.cpp index 2b9e9184..e53181f9 100644 --- a/src-qt5/core/lumina-open/main.cpp +++ b/src-qt5/core/lumina-open/main.cpp @@ -185,17 +185,33 @@ return; LaunchAutoStart(); return; }else if(QString(argv[i]).simplified() == "-volumeup"){ -int vol = LOS::audioVolume()+5; //increase 5% -if(vol>100){ vol=100; } -LOS::setAudioVolume(vol); -showOSD(argc,argv, QString(QObject::tr("Audio Volume %1%")).arg(QString::number(vol)) ); -return; + bool isInt = false; + int volupVal = 5; + if(argc > i){ + int parse = QString(argv[i+1]).toInt(&isInt,10); + if(isInt && 0 < parse && parse <= 20){ + volupVal = parse; + } + } + int vol = LOS::audioVolume()+volupVal; + if(vol>100){ vol=100; } + LOS::setAudioVolume(vol); + showOSD(argc,argv, QString(QObject::tr("Audio Volume %1%")).arg(QString::number(vol)) ); + return; }else if(QString(argv[i]).simplified() == "-volumedown"){ -int vol = LOS::audioVolume()-5; //decrease 5% -if(vol<0){ vol=0; } -LOS::setAudioVolume(vol); -showOSD(argc,argv, QString(QObject::tr("Audio Volume %1%")).arg(QString::number(vol)) ); -return; + bool isInt = false; + int voldownVal = 5; + if(argc > i){ + int parse = QString(argv[i+1]).toInt(&isInt,10); + if(isInt && 0 < parse && parse <= 20){ + voldownVal = parse; + } + } + int vol = LOS::audioVolume()-voldownVal; //decrease 5% + if(vol<0){ vol=0; } + LOS::setAudioVolume(vol); + showOSD(argc,argv, QString(QObject::tr("Audio Volume %1%")).arg(QString::number(vol)) ); + return; }else if(QString(argv[i]).simplified() == "-brightnessup"){ int bright = LOS::ScreenBrightness(); if(bright > 0){ //brightness control available |