From: Norbert Bizet Date: Fri, 20 Oct 2017 08:29:16 +0000 (+0200) Subject: Make qt-console compatible to Qt5 (Qt4 still work) X-Git-Tag: Release-9.0.6~46 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=062e29dc023579721c77b9f4429f57ec0d8ee30d;p=bacula%2Fbacula Make qt-console compatible to Qt5 (Qt4 still work) Replace #include with #include Replace toAscii with toLatin1 (deprecated) Obsolete Plastic theme and SetCodecForCString --- diff --git a/bacula/src/qt-console/RegistrationWizard/RegistrationWizard.pro.in b/bacula/src/qt-console/RegistrationWizard/RegistrationWizard.pro.in new file mode 100644 index 0000000000..046815493f --- /dev/null +++ b/bacula/src/qt-console/RegistrationWizard/RegistrationWizard.pro.in @@ -0,0 +1,36 @@ +###################################################################### +# +# !!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# +# Edit only RegistrationWizard.pro.in -- RegistrationWizard.pro is built by the ./configure program +# +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# +QT += core gui network widgets +lessThan(QT_MAJOR_VERSION, 5): error("requires Qt 5") + +TARGET = RegistrationWizard +TEMPLATE = app + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which has been marked as deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if you use deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + + +SOURCES += \ + main.cpp \ + mainwindow.cpp + +HEADERS += \ + mainwindow.h + +FORMS += \ + mainwindow.ui \ + authenticationdialog.ui diff --git a/bacula/src/qt-console/bat.h b/bacula/src/qt-console/bat.h index ad26ed0a45..65ed2ad2a4 100644 --- a/bacula/src/qt-console/bat.h +++ b/bacula/src/qt-console/bat.h @@ -41,7 +41,11 @@ #endif #define __CONFIG_H +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include #include "bacula.h" diff --git a/bacula/src/qt-console/bat.pro.in b/bacula/src/qt-console/bat.pro.in index d1bbdb8629..9728ecc78a 100644 --- a/bacula/src/qt-console/bat.pro.in +++ b/bacula/src/qt-console/bat.pro.in @@ -8,7 +8,7 @@ # CONFIG += qt debug @QWT@ -datarootdir = @datarootdir@ +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets bins.path = /$(DESTDIR)@sbindir@ bins.files = bat diff --git a/bacula/src/qt-console/bcomm/dircomm.h b/bacula/src/qt-console/bcomm/dircomm.h index 11ba9706b1..aca39d2fd1 100644 --- a/bacula/src/qt-console/bcomm/dircomm.h +++ b/bacula/src/qt-console/bcomm/dircomm.h @@ -22,7 +22,11 @@ * Kern Sibbald, January 2007 */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "pages.h" #include "ui_console.h" #include diff --git a/bacula/src/qt-console/clients/clients.h b/bacula/src/qt-console/clients/clients.h index 4ecdc00260..8852fa9db3 100644 --- a/bacula/src/qt-console/clients/clients.h +++ b/bacula/src/qt-console/clients/clients.h @@ -22,7 +22,11 @@ * Dirk Bartley, March 2007 */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_clients.h" #include "console.h" #include "pages.h" diff --git a/bacula/src/qt-console/console/console.h b/bacula/src/qt-console/console/console.h index 0468676dad..4f3179c7b1 100644 --- a/bacula/src/qt-console/console/console.h +++ b/bacula/src/qt-console/console/console.h @@ -22,7 +22,11 @@ * Kern Sibbald, January 2007 */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "pages.h" #include "ui_console.h" #include "bcomm/dircomm.h" diff --git a/bacula/src/qt-console/fileset/fileset.h b/bacula/src/qt-console/fileset/fileset.h index c6f431af07..03220feff8 100644 --- a/bacula/src/qt-console/fileset/fileset.h +++ b/bacula/src/qt-console/fileset/fileset.h @@ -22,7 +22,11 @@ * Dirk Bartley, March 2007 */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_fileset.h" #include "console.h" #include "pages.h" diff --git a/bacula/src/qt-console/job/job.cpp b/bacula/src/qt-console/job/job.cpp index 67ad1b4cd2..fce650035f 100644 --- a/bacula/src/qt-console/job/job.cpp +++ b/bacula/src/qt-console/job/job.cpp @@ -407,7 +407,7 @@ void Job::populateForm() label_JobId->setText(fld.next()); label_Name->setText(fld.next()); - label_Level->setText(job_level_to_str(fld.next()[0].toAscii())); + label_Level->setText(job_level_to_str(fld.next()[0].toLatin1())); m_client = fld.next(); label_Client->setText(m_client); @@ -457,7 +457,7 @@ void Job::populateForm() } } label_JobStatus->setPixmap(QPixmap(":/images/" + stat + ".png")); - jobstatus_to_ascii_gui(stat[0].toAscii(), buf, sizeof(buf)); + jobstatus_to_ascii_gui(stat[0].toLatin1(), buf, sizeof(buf)); stat = buf; label_JobStatus->setToolTip(stat); diff --git a/bacula/src/qt-console/job/job.h b/bacula/src/qt-console/job/job.h index 7f14463f69..a1c6ab239e 100644 --- a/bacula/src/qt-console/job/job.h +++ b/bacula/src/qt-console/job/job.h @@ -19,7 +19,11 @@ Bacula(R) is a registered trademark of Kern Sibbald. */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_job.h" #include "console.h" diff --git a/bacula/src/qt-console/jobgraphs/jobplot.cpp b/bacula/src/qt-console/jobgraphs/jobplot.cpp index abb0b4608d..f3a938f74c 100644 --- a/bacula/src/qt-console/jobgraphs/jobplot.cpp +++ b/bacula/src/qt-console/jobgraphs/jobplot.cpp @@ -25,7 +25,11 @@ */ #include "bat.h" +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "util/comboutil.h" #include "jobgraphs/jobplot.h" diff --git a/bacula/src/qt-console/jobgraphs/jobplot.h b/bacula/src/qt-console/jobgraphs/jobplot.h index 86a6048903..b6bea40d78 100644 --- a/bacula/src/qt-console/jobgraphs/jobplot.h +++ b/bacula/src/qt-console/jobgraphs/jobplot.h @@ -22,7 +22,11 @@ * Dirk Bartley, March 2007 */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "pages.h" #include "ui_jobplotcontrols.h" #include diff --git a/bacula/src/qt-console/joblist/joblist.h b/bacula/src/qt-console/joblist/joblist.h index bc417626eb..d1033554c4 100644 --- a/bacula/src/qt-console/joblist/joblist.h +++ b/bacula/src/qt-console/joblist/joblist.h @@ -22,7 +22,11 @@ * Dirk Bartley, March 2007 */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_joblist.h" #include "console.h" #include "pages.h" diff --git a/bacula/src/qt-console/joblog/joblog.h b/bacula/src/qt-console/joblog/joblog.h index 255276e428..3011ea80be 100644 --- a/bacula/src/qt-console/joblog/joblog.h +++ b/bacula/src/qt-console/joblog/joblog.h @@ -22,7 +22,11 @@ * Dirk Bartley, March 2007 */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_joblog.h" #include "console.h" diff --git a/bacula/src/qt-console/jobs/jobs.h b/bacula/src/qt-console/jobs/jobs.h index 8622c95e11..96bb5eab22 100644 --- a/bacula/src/qt-console/jobs/jobs.h +++ b/bacula/src/qt-console/jobs/jobs.h @@ -22,7 +22,11 @@ * Dirk Bartley, March 2007 */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_jobs.h" #include "console.h" #include "pages.h" diff --git a/bacula/src/qt-console/label/label.h b/bacula/src/qt-console/label/label.h index 1fa7415256..094f6a438c 100644 --- a/bacula/src/qt-console/label/label.h +++ b/bacula/src/qt-console/label/label.h @@ -23,7 +23,11 @@ #ifndef _LABEL_H_ #define _LABEL_H_ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_label.h" #include "console.h" #include "pages.h" diff --git a/bacula/src/qt-console/main.cpp b/bacula/src/qt-console/main.cpp index 4c94f5128f..cb6dc1c612 100644 --- a/bacula/src/qt-console/main.cpp +++ b/bacula/src/qt-console/main.cpp @@ -63,9 +63,11 @@ int main(int argc, char *argv[]) app = new QApplication(argc, argv); - app->setStyle(new QPlastiqueStyle()); app->setQuitOnLastWindowClosed(true); +#if QT_VERSION < 0x050000 + app->setStyle(new QPlastiqueStyle()); QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); +#endif QTranslator qtTranslator; qtTranslator.load(QString("qt_") + QLocale::system().name(),QLibraryInfo::location(QLibraryInfo::TranslationsPath)); diff --git a/bacula/src/qt-console/mainwin.h b/bacula/src/qt-console/mainwin.h index a88c79deb2..5fd76c0fdc 100644 --- a/bacula/src/qt-console/mainwin.h +++ b/bacula/src/qt-console/mainwin.h @@ -25,7 +25,11 @@ #ifndef _MAINWIN_H_ #define _MAINWIN_H_ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include #include "ui_main.h" diff --git a/bacula/src/qt-console/mediaedit/mediaedit.h b/bacula/src/qt-console/mediaedit/mediaedit.h index 5856f30801..89ed3dba61 100644 --- a/bacula/src/qt-console/mediaedit/mediaedit.h +++ b/bacula/src/qt-console/mediaedit/mediaedit.h @@ -22,7 +22,11 @@ * Dirk Bartley, March 2007 */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_mediaedit.h" #include "console.h" #include "pages.h" diff --git a/bacula/src/qt-console/mediainfo/mediainfo.cpp b/bacula/src/qt-console/mediainfo/mediainfo.cpp index e6cb853573..2a45bdbcb0 100644 --- a/bacula/src/qt-console/mediainfo/mediainfo.cpp +++ b/bacula/src/qt-console/mediainfo/mediainfo.cpp @@ -181,7 +181,7 @@ void MediaInfo::populateForm() label_VolRetention->setText(QString(buf)); if (LastWritten != "") { - t = str_to_utime(LastWritten.toAscii().data()); + t = str_to_utime(LastWritten.toLatin1().data()); t = t + stat.toULongLong(); ttime = t; localtime_r(&ttime, &tm); @@ -194,7 +194,7 @@ void MediaInfo::populateForm() // stat=fld.next(); -// jobstatus_to_ascii_gui(stat[0].toAscii(), buf, sizeof(buf)); +// jobstatus_to_ascii_gui(stat[0].toLatin1(), buf, sizeof(buf)); // stat = buf; // } diff --git a/bacula/src/qt-console/mediainfo/mediainfo.h b/bacula/src/qt-console/mediainfo/mediainfo.h index af5d5b8124..7f3c732b08 100644 --- a/bacula/src/qt-console/mediainfo/mediainfo.h +++ b/bacula/src/qt-console/mediainfo/mediainfo.h @@ -22,7 +22,11 @@ * */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_mediainfo.h" #include "console.h" #include "pages.h" diff --git a/bacula/src/qt-console/medialist/medialist.h b/bacula/src/qt-console/medialist/medialist.h index 0c3f674352..487742ff2f 100644 --- a/bacula/src/qt-console/medialist/medialist.h +++ b/bacula/src/qt-console/medialist/medialist.h @@ -22,7 +22,11 @@ * Dirk Bartley, March 2007 */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_medialist.h" #include "console.h" #include diff --git a/bacula/src/qt-console/medialist/mediaview.cpp b/bacula/src/qt-console/medialist/mediaview.cpp index 9aa1db348f..acc7fd60c5 100644 --- a/bacula/src/qt-console/medialist/mediaview.cpp +++ b/bacula/src/qt-console/medialist/mediaview.cpp @@ -207,7 +207,7 @@ void MediaView::filterExipired(QStringList &list) } else { stat = fieldlist.at(8); - t = str_to_utime(LastWritten.toAscii().data()); + t = str_to_utime(LastWritten.toLatin1().data()); t = t + stat.toULongLong(); if (t > now) { list.removeAt(i); @@ -366,7 +366,7 @@ void MediaView::populateTable() buf[0] = 0; if (LastWritten != "") { stat = fld.next(); // VolUseDuration - t = str_to_utime(LastWritten.toAscii().data()); + t = str_to_utime(LastWritten.toLatin1().data()); t = t + stat.toULongLong(); ttime = t; localtime_r(&ttime, &tm); diff --git a/bacula/src/qt-console/medialist/mediaview.h b/bacula/src/qt-console/medialist/mediaview.h index e2808c0519..8b46c7e616 100644 --- a/bacula/src/qt-console/medialist/mediaview.h +++ b/bacula/src/qt-console/medialist/mediaview.h @@ -19,7 +19,11 @@ Bacula(R) is a registered trademark of Kern Sibbald. */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_mediaview.h" #include "console.h" #include diff --git a/bacula/src/qt-console/mount/mount.h b/bacula/src/qt-console/mount/mount.h index 4703c981f8..d2886909fc 100644 --- a/bacula/src/qt-console/mount/mount.h +++ b/bacula/src/qt-console/mount/mount.h @@ -23,7 +23,11 @@ #ifndef _MOUNT_H_ #define _MOUNT_H_ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_mount.h" #include "console.h" diff --git a/bacula/src/qt-console/pages.cpp b/bacula/src/qt-console/pages.cpp index 05713da4ba..0866817fea 100644 --- a/bacula/src/qt-console/pages.cpp +++ b/bacula/src/qt-console/pages.cpp @@ -30,7 +30,7 @@ bool isWin32Path(QString &fullPath) return false; } - bool toret = fullPath[1].toAscii() == ':' && fullPath[0].isLetter(); + bool toret = fullPath[1].toLatin1() == ':' && fullPath[0].isLetter(); if (mainWin->m_miscDebug) { if (toret) Pmsg1(000, "returning from isWin32Path true %s\n", fullPath.toUtf8().data()); diff --git a/bacula/src/qt-console/pages.h b/bacula/src/qt-console/pages.h index 5467797c23..a7eacf7422 100644 --- a/bacula/src/qt-console/pages.h +++ b/bacula/src/qt-console/pages.h @@ -22,7 +22,11 @@ * Dirk Bartley, March 2007 */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include /* diff --git a/bacula/src/qt-console/relabel/relabel.h b/bacula/src/qt-console/relabel/relabel.h index 105d627570..c1aeb260d3 100644 --- a/bacula/src/qt-console/relabel/relabel.h +++ b/bacula/src/qt-console/relabel/relabel.h @@ -23,7 +23,11 @@ #ifndef _RELABEL_H_ #define _RELABEL_H_ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_relabel.h" #include "console.h" diff --git a/bacula/src/qt-console/restore/restore.h b/bacula/src/qt-console/restore/restore.h index 7ece0af400..542c953a70 100644 --- a/bacula/src/qt-console/restore/restore.h +++ b/bacula/src/qt-console/restore/restore.h @@ -26,7 +26,11 @@ #include #include /* Needed for some systems */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "pages.h" #include "ui_runrestore.h" diff --git a/bacula/src/qt-console/restore/restoretree.cpp b/bacula/src/qt-console/restore/restoretree.cpp index d32270cf58..143f3c53bf 100644 --- a/bacula/src/qt-console/restore/restoretree.cpp +++ b/bacula/src/qt-console/restore/restoretree.cpp @@ -555,7 +555,7 @@ void restoreTree::fileCurrentItemChanged(QTableWidgetItem *currentFileTableItem, foreach (field, fieldlist) { field = field.trimmed(); /* strip leading & trailing spaces */ if (column == 5 ) { - QByteArray jtype(field.trimmed().toAscii()); + QByteArray jtype(field.trimmed().toLatin1()); if (jtype.size()) { field = job_type_to_str(jtype[0]); } @@ -705,7 +705,7 @@ void restoreTree::populateJobTable() field = field.trimmed(); /* strip leading & trailing spaces */ if (field != "") { if (column == typeIndex) { - QByteArray jtype(field.trimmed().toAscii()); + QByteArray jtype(field.trimmed().toLatin1()); if (jtype.size()) { field = job_type_to_str(jtype[0]); } diff --git a/bacula/src/qt-console/restore/restoretree.h b/bacula/src/qt-console/restore/restoretree.h index 74b9f2fe4e..3bbef58947 100644 --- a/bacula/src/qt-console/restore/restoretree.h +++ b/bacula/src/qt-console/restore/restoretree.h @@ -23,7 +23,11 @@ * Kern Sibbald, February 2007 */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "pages.h" #include "ui_restoretree.h" diff --git a/bacula/src/qt-console/run/run.h b/bacula/src/qt-console/run/run.h index ad9329c524..edbbcd9012 100644 --- a/bacula/src/qt-console/run/run.h +++ b/bacula/src/qt-console/run/run.h @@ -20,7 +20,11 @@ #ifndef _RUN_H_ #define _RUN_H_ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_run.h" #include "ui_runcmd.h" #include "ui_estimate.h" diff --git a/bacula/src/qt-console/select/select.h b/bacula/src/qt-console/select/select.h index 4589cc013a..057fa87442 100644 --- a/bacula/src/qt-console/select/select.h +++ b/bacula/src/qt-console/select/select.h @@ -20,7 +20,11 @@ #ifndef _SELECT_H_ #define _SELECT_H_ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_select.h" #include "console.h" diff --git a/bacula/src/qt-console/select/textinput.h b/bacula/src/qt-console/select/textinput.h index 5165de9c26..68c97c4dec 100644 --- a/bacula/src/qt-console/select/textinput.h +++ b/bacula/src/qt-console/select/textinput.h @@ -20,7 +20,11 @@ #ifndef _TEXTENTRY_H_ #define _TEXTENTRY_H_ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_textinput.h" #include "console.h" diff --git a/bacula/src/qt-console/status/clientstat.h b/bacula/src/qt-console/status/clientstat.h index eb44b38e9b..895f05900f 100644 --- a/bacula/src/qt-console/status/clientstat.h +++ b/bacula/src/qt-console/status/clientstat.h @@ -22,7 +22,11 @@ * Dirk Bartley, March 2007 */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_clientstat.h" #include "console.h" #include "pages.h" diff --git a/bacula/src/qt-console/status/dirstat.h b/bacula/src/qt-console/status/dirstat.h index f99634c3bd..d07b5dfcd8 100644 --- a/bacula/src/qt-console/status/dirstat.h +++ b/bacula/src/qt-console/status/dirstat.h @@ -22,7 +22,11 @@ * Dirk Bartley, March 2007 */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_dirstat.h" #include "console.h" #include "pages.h" diff --git a/bacula/src/qt-console/status/storstat.h b/bacula/src/qt-console/status/storstat.h index 86516c645a..ab0dbb4eb4 100644 --- a/bacula/src/qt-console/status/storstat.h +++ b/bacula/src/qt-console/status/storstat.h @@ -22,7 +22,11 @@ * Dirk Bartley, March 2007 */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_storstat.h" #include "console.h" #include "pages.h" diff --git a/bacula/src/qt-console/storage/content.h b/bacula/src/qt-console/storage/content.h index 7877095e27..36fa7b4eea 100644 --- a/bacula/src/qt-console/storage/content.h +++ b/bacula/src/qt-console/storage/content.h @@ -19,7 +19,11 @@ Bacula(R) is a registered trademark of Kern Sibbald. */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_content.h" #include "console.h" #include "pages.h" diff --git a/bacula/src/qt-console/storage/storage.h b/bacula/src/qt-console/storage/storage.h index a747f2aed4..5352c48b3c 100644 --- a/bacula/src/qt-console/storage/storage.h +++ b/bacula/src/qt-console/storage/storage.h @@ -22,7 +22,11 @@ * Dirk Bartley, March 2007 */ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_storage.h" #include "console.h" #include "pages.h" diff --git a/bacula/src/qt-console/testprogs/putz/putz.h b/bacula/src/qt-console/testprogs/putz/putz.h index 97e6ba88cc..48675bf6e3 100644 --- a/bacula/src/qt-console/testprogs/putz/putz.h +++ b/bacula/src/qt-console/testprogs/putz/putz.h @@ -1,7 +1,11 @@ #ifndef _PUTZ_H_ #define _PUTZ_H_ +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include "ui_putz.h" class Putz : public QMainWindow, public Ui::MainWindow diff --git a/bacula/src/qt-console/tray-monitor/common.h b/bacula/src/qt-console/tray-monitor/common.h index ee555330cb..9b09abaa15 100644 --- a/bacula/src/qt-console/tray-monitor/common.h +++ b/bacula/src/qt-console/tray-monitor/common.h @@ -41,7 +41,11 @@ #define __CONFIG_H +#if QT_VERSION >= 0x050000 +#include +#else #include +#endif #include #include "bacula.h" diff --git a/bacula/src/qt-console/tray-monitor/runjob.h b/bacula/src/qt-console/tray-monitor/runjob.h index 6333865bdf..f1ab60fa00 100644 --- a/bacula/src/qt-console/tray-monitor/runjob.h +++ b/bacula/src/qt-console/tray-monitor/runjob.h @@ -24,6 +24,7 @@ #include "ui_run.h" #include "tray_conf.h" #include "task.h" +#include class RunJob: public QDialog { diff --git a/bacula/src/qt-console/tray-monitor/tray-monitor.pro.in b/bacula/src/qt-console/tray-monitor/tray-monitor.pro.in index 265d7e2182..71da7a09d8 100644 --- a/bacula/src/qt-console/tray-monitor/tray-monitor.pro.in +++ b/bacula/src/qt-console/tray-monitor/tray-monitor.pro.in @@ -13,6 +13,8 @@ CONFIG += qt #CONFIG += qt debug +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + cross-win32 { LIBS += -mwindows -L../../win32/release32 -lbacula INCLUDEPATH += ../../win32/compat diff --git a/bacula/src/qt-console/tray-monitor/tray-monitor.pro.mingw32.in b/bacula/src/qt-console/tray-monitor/tray-monitor.pro.mingw32.in index 4ac57c2a9d..30cacd53d1 100644 --- a/bacula/src/qt-console/tray-monitor/tray-monitor.pro.mingw32.in +++ b/bacula/src/qt-console/tray-monitor/tray-monitor.pro.mingw32.in @@ -15,6 +15,8 @@ CONFIG += qt cross-win32 #CONFIG += qt debug +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + cross-win32 { LIBS += -mwindows -L../../win32/release32 -lbacula -lpthread INCLUDEPATH += ../../win32/compat diff --git a/bacula/src/qt-console/tray-monitor/tray-monitor.pro.mingw64.in b/bacula/src/qt-console/tray-monitor/tray-monitor.pro.mingw64.in index 792c697265..38c8811a33 100644 --- a/bacula/src/qt-console/tray-monitor/tray-monitor.pro.mingw64.in +++ b/bacula/src/qt-console/tray-monitor/tray-monitor.pro.mingw64.in @@ -15,6 +15,8 @@ CONFIG += qt cross-win32 #CONFIG += qt debug +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + cross-win32 { LIBS += -mwindows -L../../win32/release64 -lbacula -lpthread INCLUDEPATH += ../../win32/compat diff --git a/bacula/src/qt-console/tray-monitor/tray-ui.h b/bacula/src/qt-console/tray-monitor/tray-ui.h index 1efe2ec30f..57346bdc17 100644 --- a/bacula/src/qt-console/tray-monitor/tray-ui.h +++ b/bacula/src/qt-console/tray-monitor/tray-ui.h @@ -198,6 +198,21 @@ public: tray = new QSystemTrayIcon(TrayMonitor); QMenu* stmenu = new QMenu(TrayMonitor); +#if QT_VERSION >= 0x050000 + QAction *actShow = new QAction(QApplication::translate("TrayMonitor", + "Display", 0),TrayMonitor); + QAction* actQuit = new QAction(QApplication::translate("TrayMonitor", + "Quit", 0),TrayMonitor); + QAction* actAbout = new QAction(QApplication::translate("TrayMonitor", + "About", 0),TrayMonitor); + QAction* actRun = new QAction(QApplication::translate("TrayMonitor", + "Run...", 0),TrayMonitor); + QAction* actRes = new QAction(QApplication::translate("TrayMonitor", + "Restore...", 0),TrayMonitor); + + QAction* actConf = new QAction(QApplication::translate("TrayMonitor", + "Configure...", 0),TrayMonitor); +#else QAction *actShow = new QAction(QApplication::translate("TrayMonitor", "Display", 0, QApplication::UnicodeUTF8),TrayMonitor); @@ -217,6 +232,7 @@ public: QAction* actConf = new QAction(QApplication::translate("TrayMonitor", "Configure...", 0, QApplication::UnicodeUTF8),TrayMonitor); +#endif stmenu->addAction(actShow); stmenu->addAction(actRun); stmenu->addAction(actRes); @@ -256,7 +272,12 @@ public: void retranslateUi(QMainWindow *TrayMonitor) { - TrayMonitor->setWindowTitle(QApplication::translate("TrayMonitor", "Bacula Tray Monitor", 0, QApplication::UnicodeUTF8)); +#if QT_VERSION >= 0x050000 + TrayMonitor->setWindowTitle(QApplication::translate("TrayMonitor", "Bacula Tray Monitor", 0)); +#else + TrayMonitor->setWindowTitle(QApplication::translate("TrayMonitor", "Bacula Tray Monitor", 0, QApplication::UnicodeUTF8)); +#endif + } // retranslateUi private slots: diff --git a/bacula/src/qt-console/util/fmtwidgetitem.cpp b/bacula/src/qt-console/util/fmtwidgetitem.cpp index 4426760b70..2642ee382d 100644 --- a/bacula/src/qt-console/util/fmtwidgetitem.cpp +++ b/bacula/src/qt-console/util/fmtwidgetitem.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include "fmtwidgetitem.h" @@ -49,7 +50,7 @@ QString convertJobStatus(const QString &sts) } char buf[256]; - jobstatus_to_ascii_gui( code[0].toAscii(), buf, sizeof(buf)); + jobstatus_to_ascii_gui( code[0].toLatin1(), buf, sizeof(buf)); return QString(buf); } @@ -386,7 +387,7 @@ void ItemFormatterBase::setJobStatusFld(int index, const QString &status, bool c void ItemFormatterBase::setJobTypeFld(int index, const QString &fld, bool center) { - QByteArray jtype(fld.trimmed().toAscii()); + QByteArray jtype(fld.trimmed().toLatin1()); if (jtype.size()) { setTextFld(index, job_type_to_str(jtype[0]), center); } else { @@ -396,7 +397,7 @@ void ItemFormatterBase::setJobTypeFld(int index, const QString &fld, bool center void ItemFormatterBase::setJobLevelFld(int index, const QString &fld, bool center) { - QByteArray lvl(fld.trimmed().toAscii()); + QByteArray lvl(fld.trimmed().toLatin1()); if (lvl.size()) { setTextFld(index, job_level_to_str(lvl[0]), center); } else {