Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package upsm for openSUSE:Factory checked in at 2022-10-28 19:31:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/upsm (Old) and /work/SRC/openSUSE:Factory/.upsm.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "upsm" Fri Oct 28 19:31:25 2022 rev:4 rq:1031832 version:3.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/upsm/upsm.changes 2019-04-26 22:54:31.845312018 +0200 +++ /work/SRC/openSUSE:Factory/.upsm.new.2275/upsm.changes 2022-10-28 19:32:06.223405633 +0200 @@ -1,0 +2,7 @@ +Sat Oct 15 11:02:34 UTC 2022 - Martin Hauke <mar...@gmx.de> + +- Update to version 3.0.0 + * upsm ported to Qt6 (Qt5 still ok) + * misc. fixes + +------------------------------------------------------------------- Old: ---- upsm-2.2.0.tar.gz New: ---- upsm-3.0.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ upsm.spec ++++++ --- /var/tmp/diff_new_pack.DjgFjJ/_old 2022-10-28 19:32:06.711408081 +0200 +++ /var/tmp/diff_new_pack.DjgFjJ/_new 2022-10-28 19:32:06.719408121 +0200 @@ -1,7 +1,7 @@ # # spec file for package upsm # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: upsm -Version: 2.2.0 +Version: 3.0.0 Release: 0 Summary: Qt-based ups monitor (front-end for upsc from Network UPS Tools) License: SUSE-Public-Domain ++++++ upsm-2.2.0.tar.gz -> upsm-3.0.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upsm-2.2.0/CMakeLists.txt new/upsm-3.0.0/CMakeLists.txt --- old/upsm-2.2.0/CMakeLists.txt 2019-04-24 12:28:31.000000000 +0200 +++ new/upsm-3.0.0/CMakeLists.txt 2022-10-15 11:22:20.000000000 +0200 @@ -1,39 +1,37 @@ cmake_minimum_required(VERSION 3.0) set (QT_MIN_VERSION "5.4.0") -include_directories(${Qt5Widgets_INCLUDE_DIRS}) -add_definitions(${Qt5Widgets_DEFINITIONS}) - -set(PROJECT "upsm") -project ($PROJECT VERSION 2.2.0) - - set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) +enable_language(CXX) +enable_language(C) -find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Widgets) +find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED) -if(BUILD_TESTING) - find_package(Qt5Test ${QT_MIN_VERSION} CONFIG REQUIRED) + +if(Qt${QT_VERSION_MAJOR} STREQUAL "Qt6") +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Core5Compat REQUIRED) endif() -qt5_add_resources(QT_RESOURCES upsm.qrc) +if(Qt${QT_VERSION_MAJOR} STREQUAL "Qt5") +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) +endif() -#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS} -fuse-ld=gold") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") +message(Qt${QT_VERSION_MAJOR} " found") +include_directories(${Qt${QT_VERSION_MAJOR}Widgets_INCLUDE_DIRS}) +add_definitions(${Qt${QT_VERSION_MAJOR}Widgets_DEFINITIONS}) +add_definitions(${Qt${QT_VERSION_MAJOR}Widgets_COMPILE_DEFINITIONS}) + + +set(PROJECT "upsm") +project ($PROJECT VERSION 3.0.0) +add_definitions(-DVERSION_NUMBER="\\"${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}\\"") -if (UNIX AND NOT APPLE) - execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE ld_version) - if ("${ld_version}" MATCHES "GNU gold") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags") - endif() -endif() # Populate a CMake variable with the sources set(upsm_SRCS @@ -55,16 +53,44 @@ ) + add_custom_target(dist -COMMAND git archive --prefix=${PROJECT}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}/ master | bzip2 >${PROJECT}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.tar.bz2 +COMMAND git archive --format=tar --prefix=${PROJECT}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}/ HEAD | gzip >${PROJECT}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.tar.gz WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} ) +find_package(Qt${QT_VERSION_MAJOR} CONFIG REQUIRED Core Widgets) + + +if(BUILD_TESTING) + find_package(Qt${Test}${QT_VERSION_MAJOR} CONFIG REQUIRED) +endif() + + +if(Qt${QT_VERSION_MAJOR} STREQUAL "Qt6") +qt6_add_resources(QT_RESOURCES upsm.qrc) +endif() + +if (Qt${QT_VERSION_MAJOR} MATCHES "Qt5") +qt5_add_resources(QT_RESOURCES upsm.qrc) +endif() + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt${QT_VERSION_MAJOR}Widgets_EXECUTABLE_COMPILE_FLAGS}") + add_executable(${PROJECT} ${upsm_SRCS} ${QT_RESOURCES}) -target_link_libraries(${PROJECT} Qt5::Widgets Qt5::Core) + +if(Qt${QT_VERSION_MAJOR} STREQUAL "Qt6") + target_link_libraries(upsm Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Core Qt6::Core5Compat) +endif() + + +if(Qt${QT_VERSION_MAJOR} STREQUAL "Qt5") +target_link_libraries(upsm Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Core) +endif() + install (TARGETS ${PROJECT} DESTINATION bin) install (FILES ${upsm_ICONSVG} DESTINATION share/icons/hicolor/scalable/apps) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upsm-2.2.0/ChangeLog new/upsm-3.0.0/ChangeLog --- old/upsm-2.2.0/ChangeLog 2019-04-24 12:28:31.000000000 +0200 +++ new/upsm-3.0.0/ChangeLog 2022-10-15 11:22:20.000000000 +0200 @@ -1,3 +1,8 @@ +3.0.0 + ++Qt6 port +* fixes + 2.2.0 * Window hides form taskbar when minimized (was: optional) * Documentation updated diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upsm-2.2.0/README new/upsm-3.0.0/README --- old/upsm-2.2.0/README 2019-04-24 12:28:31.000000000 +0200 +++ new/upsm-3.0.0/README 2022-10-15 11:22:20.000000000 +0200 @@ -1,17 +1,15 @@ #upsm -Home: https://github.com/psemiletov/upsm -Deps: Qt5 +Home > https://github.com/psemiletov/upsm +Donate > +PayPal: peter.semile...@gmail.com +BTC: 1PCo2zznEGMFJey4qFKGQ8CoFK2nzNnJJf +Patreon: https://www.patreon.com/semiletov + EN: upsm upsm is public domain, Qt-based ups monitor (front-end for upsc from Network UPS Tools). It sits at the tray and polls nut server using upsc, so you need to set up NUT first (ups.conf and other stuff). From the Settings of upsm you can define the command line for upsc (i.e. "upsc serverups@localhost" for example) and polling time period, in millisecond. - To compile and install upsm, do as root: - -qmake -make -make install - -or: + To compile and install upsm with Qt5 or Qt6, do as root: mkdir b cd b @@ -27,6 +25,12 @@ ninja ninja install +The old ways, with Qt5 only: + +qmake +make +make install + or mkdir b @@ -43,13 +47,7 @@ ????: upsm ?????? ???????????????????? ???? Qt ?????????????? ?????? (??????????-?????? ?? ?????????????? upsc ???? ?????????????? Network UPS Tools). ???? ?????????? ?? ?????????????? ?????????????????????? ?? ?????????????????????? ?????????????????? ???????????????????? ???? nut-?????????????? ?????????????????? upsc, ?????????????? ?????? ?????????? ?????????????? ?????????????????? NUT (ups.conf ?? ????????????). ?? ???????????????????? upsm ?????????? ???????????? ?????????????? ???????????? upsc, ???????????????? "upsc serverups@localhost", ?? ?????????????????????????? ???????????? ??????????????, ?? ??????????????????????????. - ?????? ???????????? ?? ?????????????????? upsm ?????????????????? ?????? ??????????: - -qmake -make -make install - -????????: + ?????? ???????????? ?? ?????????????????? upsm (???????????? ?? Qt5 ?????? Qt6) ?????????????????? ?????? ??????????: mkdir b cd b @@ -57,7 +55,7 @@ make make install -??????: +??????: mkdir b cd b @@ -65,7 +63,13 @@ ninja ninja install -?????? ????: +???????????????????? ????????????, ???????????? ?????? Qt5: + +qmake +make +make install + +????????: makdir b meson b diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upsm-2.2.0/mainwindow.cpp new/upsm-3.0.0/mainwindow.cpp --- old/upsm-2.2.0/mainwindow.cpp 2019-04-24 12:28:31.000000000 +0200 +++ new/upsm-3.0.0/mainwindow.cpp 2022-10-15 11:22:20.000000000 +0200 @@ -4,7 +4,11 @@ #include <QProcess> #include <QDebug> -#include <QDesktopWidget> +//#if QT_VERSION < 0x060000 +//#include <QDesktopWidget> +//#endif + +#include <QScreen> #include <QApplication> #include <QPixmap> #include <QDir> @@ -65,7 +69,7 @@ } -QString qstring_load (const QString &fileName, const char *enc) +QString qstring_load (const QString &fileName) { QFile file (fileName); @@ -73,7 +77,6 @@ return QString(); QTextStream in (&file); - in.setCodec (enc); return in.readAll(); } @@ -81,12 +84,22 @@ void MainWindow::show_at_center() { - QDesktopWidget *desktop = QApplication::desktop(); + /*QDesktopWidget *desktop = QApplication::desktop(); int x = (desktop->width() - size().width()) / 2; int y = (desktop->height() - size().height()) / 2; y -= 50; + move (x, y);*/ + +// /*QDesktopWidget *desktop = QApplication::desktop(); + + QScreen *screen = qApp->screens()[0]; + + int x = (screen->size().width() - size().width()) / 2; + int y = (screen->size().height() - size().height()) / 2; + y -= 50; + move (x, y); } @@ -101,14 +114,23 @@ MainWindow::MainWindow (QWidget *parent): QMainWindow (parent) { - qtTranslator.load (QString ("qt_%1").arg (QLocale::system().name()), - QLibraryInfo::location (QLibraryInfo::TranslationsPath)); - - qApp->installTranslator (&qtTranslator); + QString lng = QLocale::system().name().left(2).toLower(); + + if (! file_exists (":/translations/upsm_" + lng + ".qm")) + lng = "en"; + + #if QT_VERSION >= 0x060000 + if (transl_system.load (QString ("qt_%1").arg (lng), QLibraryInfo::path (QLibraryInfo::TranslationsPath))) + qApp->installTranslator (&transl_app); +#else + if (transl_system.load (QString ("qt_%1").arg (lng), QLibraryInfo::location (QLibraryInfo::TranslationsPath))) + qApp->installTranslator (&transl_system); +#endif + + if (transl_app.load (":/translations/upsm_" + lng)) + qApp->installTranslator (&transl_app); + - myappTranslator.load (":/translations/upsm_" + QLocale::system().name()); - qApp->installTranslator (&myappTranslator); - QDir dr; s_config_fname = dr.homePath() + "/.config/upsm.conf"; settings = new QSettings (s_config_fname, QSettings::IniFormat); @@ -141,9 +163,9 @@ - QWidget *settings_widget = new QWidget; + QWidget *settings_widget = new QWidget; - QVBoxLayout *la_settings = new QVBoxLayout; + QVBoxLayout *la_settings = new QVBoxLayout; settings_widget->setLayout (la_settings); QHBoxLayout *la_command = new QHBoxLayout; @@ -207,7 +229,7 @@ if (! file_exists (filename)) filename = ":/manuals/en"; - help_widget->setPlainText (qstring_load (filename, "UTF-8")); + help_widget->setPlainText (qstring_load (filename)); main_widget.addTab (help_widget, tr ("Help")); @@ -232,7 +254,7 @@ logsize = settings->value ("logsize", "1024").toInt(); settings->setValue ("run_minimized", cb_run_minimized->isChecked()); - settings->setValue ("hide_from_taskbar", cb_hide_from_taskbar->isChecked()); + //settings->setValue ("hide_from_taskbar", cb_hide_from_taskbar->isChecked()); timer->stop(); timer->start (polltime); @@ -245,8 +267,13 @@ return; QProcess procmon; + +#if QT_VERSION >= 0x060000 + procmon.startCommand (command); +#else procmon.start (command); - +#endif + if (! procmon.waitForStarted()) return; @@ -336,7 +363,7 @@ } -void MainWindow::iconActivated(QSystemTrayIcon::ActivationReason reason) +void MainWindow::iconActivated (QSystemTrayIcon::ActivationReason reason) { switch (reason) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upsm-2.2.0/mainwindow.h new/upsm-3.0.0/mainwindow.h --- old/upsm-2.2.0/mainwindow.h 2019-04-24 12:28:31.000000000 +0200 +++ new/upsm-3.0.0/mainwindow.h 2022-10-15 11:22:20.000000000 +0200 @@ -37,8 +37,8 @@ QTimer *timer; - QTranslator myappTranslator; - QTranslator qtTranslator; + QTranslator transl_system; + QTranslator transl_app; QTabWidget main_widget; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upsm-2.2.0/manuals/en new/upsm-3.0.0/manuals/en --- old/upsm-2.2.0/manuals/en 2019-04-24 12:28:31.000000000 +0200 +++ new/upsm-3.0.0/manuals/en 2022-10-15 11:22:20.000000000 +0200 @@ -4,7 +4,7 @@ MANUAL upsm is public domain, Qt-based ups monitor (front-end for upsc from Network UPS Tools). It sits at the tray and polls nut server using upsc, so you need to set up NUT first (ups.conf and other stuff). From the Settings of upsm you can define the command line for upsc (i.e. "upsc myups" for example) and polling time period, in millisecond. - Use "minimize" button to minimize upsm to the tray. "Close" button just closes the program, if the option "Hide from taskbar" is turned off. + Use "minimize" button to minimize upsm to the tray. "Close" button just closes the program. And now how to set up NUT server. 1. Execute "lsusb" command to see the vendor id of your UPS, for example: @@ -33,7 +33,25 @@ Restart=on-failure RestartSec=360s - 5. Run + 5. + +Create (if not exists) +/etc/udev/rules.d/50-ups.rules +with following content: + +SUBSYSTEM=="usb", ATTR{idVendor}=="0d9f", ATTR{idProduct}=="0004", SYMLINK+="ups0", GROUP="nut" + +Where attributes for idVendor and idProduct lsusb are taken from lsubs output. This creates a persistent /dev/ups0 simlink (devices are initialized in random order, so we need a "static" name. + + 6. Open nut-server.service file (at /etc/systemd/<....>), at [Unit section] edit: + +[Unit] +After=local-fs.target network-online.target nut-driver.service ups0.device + + Thus, we ensure that nut-server.service will be started after ups0 is initialized on USB bus. + + + 7. Run systemctl enable nut-server @@ -63,5 +81,18 @@ 8. Put this command to the "Command" parameter at upsm "Settings" panel. +9. If upsc show "Driver not connected", try to start driver manually: + +upsdrvctl start + +Also: + +upsdrvsvcctl resync +And then "upsdrvsvcctl start" to start and +"upsdrvsvcctl stop" to stop. + + +/////////////////// + Peter Semiletov <peter.semile...@gmail.com> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upsm-2.2.0/manuals/ru new/upsm-3.0.0/manuals/ru --- old/upsm-2.2.0/manuals/ru 2019-04-24 12:28:31.000000000 +0200 +++ new/upsm-3.0.0/manuals/ru 2022-10-15 11:22:20.000000000 +0200 @@ -5,7 +5,7 @@ upsm ?????? ???????????????????? ???? Qt ?????????????? ?????? (??????????-?????? ?? ?????????????? upsc ???? ?????????????? Network UPS Tools). ???? ?????????? ?? ?????????????? ?????????????????????? ?? ?????????????????????? ?????????????????? ???????????????????? ???? nut-?????????????? ?????????????????? upsc, ?????????????? ?????? ?????????? ?????????????? ?????????????????? NUT, ?? ?????? ?? ?????????????? ???????? ????????. ?? ???????????????????? upsm ?????????? ???????????? ?????????????? ???????????? upsc, ???????????????? "upsc myups", ?? ?????????????????????????? ???????????? ??????????????, ?? ??????????????????????????. - ???????????? "??????????????" ?????????????????? ?????????????????? ???????????? ?????????????????? (???????? ?? ???????????????????? ???? ?????????????? "???????????????? ?? ???????????? ??????????"), ?? ???????????? "????????????????" - ?????????????????????? ?? ?????????????? ??????????????????????. + ???????????? "??????????????" ?????????????????? ?????????????????? ???????????? ??????????????????, ?? ???????????? "????????????????" - ?????????????????????? ?? ?????????????? ??????????????????????. ???????????????? ???????????? ?? ?????????????????? ??????????????. ?????? ?????????????????? NUT-????????????? @@ -28,7 +28,7 @@ ?? vendorid ?????????????????????? ???????????????????? ???? lsusb ???????????? ????. pollfreq = ?????????????? ???????????? ????????????????????, ?? ????????????????. ?????????? ???????????????? ?????? bus, ?????? ?????????????? ???????????????????? ?????????? ????????, ???????????? ?? Linux ???????????? ???????? ???????????? ???????????????? ?????????? ????????????????????????. -4. ???? ???????????????? ?????????????????? ???????? ???????? ?? ???????? ?????????? ?????? ?????????????????? systemd, ???????????? NUT-?????????????? ???????????????????????? ?? ??????????-???? ???????????? ??????????????????????, ?? ????????????, ?????????????? ?????????????????? ??????????????: +4. ???? ???????????????? ?????????????????? ?????????? ?????? ?????????????????? systemd, ???????????? NUT-?????????????? ???????????????????????? ?? ??????????-???? ???????????? ??????????????????????, ?? ????????????, ?????????????? ?????????????????? ??????????????: upsdrvctl start ?????????? ?????? ????????????: upsd @@ -60,6 +60,16 @@ 7. ?????????????????????? ?????? ???????????? ?? ???????????????? ?????????????? ???????????? ?? ???????????????????? upsm. +8. ???????? upsc ???????????? "Driver not connected", ???????? ?????? ???? ?????????????????? ?????????????? ??????????????: + +upsdrvctl start + +?????????? ??????????: + +upsdrvsvcctl resync +?? ?????????? ?????????????????? upsdrvsvcctl start +?? ?????????????????????????? upsdrvsvcctl stop + ???????? ?????????????????? <peter.semile...@gmail.com> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upsm-2.2.0/meson.build new/upsm-3.0.0/meson.build --- old/upsm-2.2.0/meson.build 2019-04-24 12:28:31.000000000 +0200 +++ new/upsm-3.0.0/meson.build 2022-10-15 11:22:20.000000000 +0200 @@ -1,6 +1,6 @@ project('upsm', 'cpp', default_options : ['cpp_std=c++11'], - version : '2.2.0', + version : '3.0.0', license : 'GPLv3') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/upsm-2.2.0/upsm.pro new/upsm-3.0.0/upsm.pro --- old/upsm-2.2.0/upsm.pro 2019-04-24 12:28:31.000000000 +0200 +++ new/upsm-3.0.0/upsm.pro 2022-10-15 11:22:20.000000000 +0200 @@ -1,4 +1,4 @@ -VERSION=2.2.0 +VERSION=3.0.0 QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets