From 85e208b69bc0453cc7bbb8a2d8b962513ad718c0 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Fri, 22 Dec 2017 17:25:22 +0100 Subject: [PATCH] Moved AboutMeDialog into profileplugin --- .../profileplugin/profiledialog.cpp | 10 +- plugins/profileplugin/profiledialog.h | 20 +++ .../profileplugin/profiledialog.ui | 20 +-- plugins/profileplugin/profileplugin.cpp | 5 +- plugins/profileplugin/profileplugin.pro | 8 +- .../translations/profileplugin_de.ts | 103 +++++++++++- .../translations/profileplugin_en.ts | 101 +++++++++++- zeiterfassungguilib/dialogs/aboutmedialog.h | 20 --- zeiterfassungguilib/mainwindow.cpp | 2 - zeiterfassungguilib/mainwindow.ui | 1 - .../translations/zeiterfassungguilib_de.ts | 154 +++--------------- .../translations/zeiterfassungguilib_en.ts | 154 +++--------------- zeiterfassungguilib/zeiterfassungguilib.pro | 5 +- 13 files changed, 293 insertions(+), 310 deletions(-) rename zeiterfassungguilib/dialogs/aboutmedialog.cpp => plugins/profileplugin/profiledialog.cpp (85%) create mode 100644 plugins/profileplugin/profiledialog.h rename zeiterfassungguilib/dialogs/aboutmedialog.ui => plugins/profileplugin/profiledialog.ui (95%) delete mode 100644 zeiterfassungguilib/dialogs/aboutmedialog.h diff --git a/zeiterfassungguilib/dialogs/aboutmedialog.cpp b/plugins/profileplugin/profiledialog.cpp similarity index 85% rename from zeiterfassungguilib/dialogs/aboutmedialog.cpp rename to plugins/profileplugin/profiledialog.cpp index 473c1ac..1a52589 100644 --- a/zeiterfassungguilib/dialogs/aboutmedialog.cpp +++ b/plugins/profileplugin/profiledialog.cpp @@ -1,9 +1,9 @@ -#include "aboutmedialog.h" -#include "ui_aboutmedialog.h" +#include "profiledialog.h" +#include "ui_profiledialog.h" -AboutMeDialog::AboutMeDialog(const GetUserInfoReply::UserInfo &userInfo, QWidget *parent) : +ProfileDialog::ProfileDialog(const GetUserInfoReply::UserInfo &userInfo, QWidget *parent) : QDialog(parent), - ui(new Ui::AboutMeDialog) + ui(new Ui::ProfileDialog) { ui->setupUi(this); @@ -26,7 +26,7 @@ AboutMeDialog::AboutMeDialog(const GetUserInfoReply::UserInfo &userInfo, QWidget ui->lineEditBetriebsnr->setText(userInfo.betriebsnr); } -AboutMeDialog::~AboutMeDialog() +ProfileDialog::~ProfileDialog() { delete ui; } diff --git a/plugins/profileplugin/profiledialog.h b/plugins/profileplugin/profiledialog.h new file mode 100644 index 0000000..b2abd1c --- /dev/null +++ b/plugins/profileplugin/profiledialog.h @@ -0,0 +1,20 @@ +#pragma once + +#include + +#include "zeiterfassungguilib_global.h" +#include "replies/getuserinforeply.h" + +namespace Ui { class ProfileDialog; } + +class ZEITERFASSUNGGUILIBSHARED_EXPORT ProfileDialog : public QDialog +{ + Q_OBJECT + +public: + explicit ProfileDialog(const GetUserInfoReply::UserInfo &userInfo, QWidget *parent = Q_NULLPTR); + ~ProfileDialog(); + +private: + Ui::ProfileDialog *ui; +}; diff --git a/zeiterfassungguilib/dialogs/aboutmedialog.ui b/plugins/profileplugin/profiledialog.ui similarity index 95% rename from zeiterfassungguilib/dialogs/aboutmedialog.ui rename to plugins/profileplugin/profiledialog.ui index d6f99d9..3ce9181 100644 --- a/zeiterfassungguilib/dialogs/aboutmedialog.ui +++ b/plugins/profileplugin/profiledialog.ui @@ -1,7 +1,7 @@ - AboutMeDialog - + ProfileDialog + 0 @@ -11,21 +11,9 @@ - About me + Profile - - - - - 20 - - - - About me - - - @@ -315,7 +303,7 @@ buttonBox rejected() - AboutMeDialog + ProfileDialog close() diff --git a/plugins/profileplugin/profileplugin.cpp b/plugins/profileplugin/profileplugin.cpp index d3719fe..1dc949d 100644 --- a/plugins/profileplugin/profileplugin.cpp +++ b/plugins/profileplugin/profileplugin.cpp @@ -4,12 +4,13 @@ #include #include #include -#include #include #include #include "mainwindow.h" +#include "profiledialog.h" + ProfilePlugin::ProfilePlugin(QObject *parent) : ZeiterfassungPlugin(parent) { @@ -32,7 +33,7 @@ ProfilePlugin::ProfilePlugin(QObject *parent) : void ProfilePlugin::attachTo(MainWindow &mainWindow) { - auto dialog = new QDialog(&mainWindow); + auto dialog = new ProfileDialog(mainWindow.userInfo(), &mainWindow); mainWindow.menuTools()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/profileplugin/images/profile.png")), tr("My profile"), dialog, &QDialog::open); } diff --git a/plugins/profileplugin/profileplugin.pro b/plugins/profileplugin/profileplugin.pro index 215c70b..d299e48 100644 --- a/plugins/profileplugin/profileplugin.pro +++ b/plugins/profileplugin/profileplugin.pro @@ -14,11 +14,13 @@ DEPENDPATH += $$PWD/../../zeiterfassungcorelib $$PWD/../../zeiterfassungguilib DEFINES += QT_DEPRECATED_WARNINGS QT_DISABLE_DEPRECATED_BEFORE=0x060000 QT_MESSAGELOGCONTEXT -HEADERS += profileplugin.h +HEADERS += profiledialog.h \ + profileplugin.h -SOURCES += profileplugin.cpp +SOURCES += profiledialog.cpp \ + profileplugin.cpp -FORMS += +FORMS += profiledialog.ui RESOURCES += profileplugin_resources.qrc diff --git a/plugins/profileplugin/translations/profileplugin_de.ts b/plugins/profileplugin/translations/profileplugin_de.ts index 0d7005a..e8cb231 100644 --- a/plugins/profileplugin/translations/profileplugin_de.ts +++ b/plugins/profileplugin/translations/profileplugin_de.ts @@ -1,12 +1,111 @@ + + ProfileDialog + + + Profile + Profil + + + + User-ID: + Benutzer-ID: + + + + E-Mail: + E-Mail: + + + + Long username: + Langer Benutzername: + + + + Text: + Text: + + + + Username: + Benutzername: + + + + Street: + Straße: + + + + City: + Stadt: + + + + Employed since: + Angestellt seit: + + + + Employed till: + Angestellt bis: + + + + Place of birth: + Geburtsort: + + + + Zipcode: + Postleitzahl: + + + + Religion: + Religion: + + + + Department: + Abteilung: + + + + Verwendgr: + Verwendgr: + + + + Taetig: + Taetig: + + + + Arbverh: + Arbverh: + + + + Betriebsnr: + Betriebsnr: + + + + + dd.MM.yyyy + dd.MM.yyyy + + ProfilePlugin - + My profile - + Mein Profil diff --git a/plugins/profileplugin/translations/profileplugin_en.ts b/plugins/profileplugin/translations/profileplugin_en.ts index d73e0c8..d6f19e1 100644 --- a/plugins/profileplugin/translations/profileplugin_en.ts +++ b/plugins/profileplugin/translations/profileplugin_en.ts @@ -1,10 +1,109 @@ + + ProfileDialog + + + Profile + + + + + User-ID: + + + + + E-Mail: + + + + + Long username: + + + + + Text: + + + + + Username: + + + + + Street: + + + + + City: + + + + + Employed since: + + + + + Employed till: + + + + + Place of birth: + + + + + Zipcode: + + + + + Religion: + + + + + Department: + + + + + Verwendgr: + + + + + Taetig: + + + + + Arbverh: + + + + + Betriebsnr: + + + + + + dd.MM.yyyy + + + ProfilePlugin - + My profile diff --git a/zeiterfassungguilib/dialogs/aboutmedialog.h b/zeiterfassungguilib/dialogs/aboutmedialog.h deleted file mode 100644 index 769226b..0000000 --- a/zeiterfassungguilib/dialogs/aboutmedialog.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include - -#include "zeiterfassungguilib_global.h" -#include "replies/getuserinforeply.h" - -namespace Ui { class AboutMeDialog; } - -class ZEITERFASSUNGGUILIBSHARED_EXPORT AboutMeDialog : public QDialog -{ - Q_OBJECT - -public: - explicit AboutMeDialog(const GetUserInfoReply::UserInfo &userInfo, QWidget *parent = Q_NULLPTR); - ~AboutMeDialog(); - -private: - Ui::AboutMeDialog *ui; -}; diff --git a/zeiterfassungguilib/mainwindow.cpp b/zeiterfassungguilib/mainwindow.cpp index 2a35266..845ea44 100644 --- a/zeiterfassungguilib/mainwindow.cpp +++ b/zeiterfassungguilib/mainwindow.cpp @@ -19,7 +19,6 @@ #include "zeiterfassungsettings.h" #include "stripfactory.h" #include "stripswidget.h" -#include "dialogs/aboutmedialog.h" #include "dialogs/settingsdialog.h" #include "replies/getprojectsreply.h" #include "replies/createbookingreply.h" @@ -47,7 +46,6 @@ MainWindow::MainWindow(ZeiterfassungSettings &settings, ZeiterfassungApi &erfass ui->actionRefresh->setShortcut(QKeySequence::Refresh); connect(ui->actionRefresh, &QAction::triggered, this, &MainWindow::refreshEverything); - connect(ui->actionAboutMe, &QAction::triggered, [=](){ AboutMeDialog(userInfo, this).exec(); }); connect(ui->actionSettings, &QAction::triggered, [=](){ SettingsDialog(m_settings, this).exec(); }); ui->actionHelp->setShortcut(QKeySequence::HelpContents); diff --git a/zeiterfassungguilib/mainwindow.ui b/zeiterfassungguilib/mainwindow.ui index 5735f18..c96c07d 100644 --- a/zeiterfassungguilib/mainwindow.ui +++ b/zeiterfassungguilib/mainwindow.ui @@ -211,7 +211,6 @@ &About - diff --git a/zeiterfassungguilib/translations/zeiterfassungguilib_de.ts b/zeiterfassungguilib/translations/zeiterfassungguilib_de.ts index d66d22a..626b154 100644 --- a/zeiterfassungguilib/translations/zeiterfassungguilib_de.ts +++ b/zeiterfassungguilib/translations/zeiterfassungguilib_de.ts @@ -1,106 +1,6 @@ - - AboutMeDialog - - - - About me - Über mich - - - - User-ID: - Benutzer-ID: - - - - E-Mail: - E-Mail: - - - - Long username: - Langer Benutzername: - - - - Text: - Text: - - - - Username: - Benutzername: - - - - Street: - Straße: - - - - City: - Stadt: - - - - Employed since: - Angestellt seit: - - - - Employed till: - Angestellt bis: - - - - Place of birth: - Geburtsort: - - - - Zipcode: - Postleitzahl: - - - - Religion: - Religion: - - - - Department: - Abteilung: - - - - Verwendgr: - Verwendgr: - - - - Taetig: - Taetig: - - - - Arbverh: - Arbverh: - - - - Betriebsnr: - Betriebsnr: - - - - - dd.MM.yyyy - dd.MM.yyyy - - AuthenticationDialog @@ -168,8 +68,8 @@ - - + + Start Kommen @@ -189,107 +89,107 @@ &Über - + &View &Ansicht - + &Tools &Werkzeuge - + &Quit &Beenden - + About &Me Über &mich - + About &zeiterfassung Über &zeiterfassung - + About &Qt Über &Qt - + &Today &Heute - + &Refresh everything Alles &neu laden - + &Settings &Einstellungen - + Help Hilfe - + Zeiterfassung - %0 (%1) Zeiterfassung - %0 (%1) - + Subproject Subprojekt - + Workpackage Arbeitspaket - + Text Text - - + + Could not load bookings! Konnte Buchungen nicht laden! - - + + Could not create booking! Konnte Buchung nicht erstellen! - - + + Could not edit time assignment! Konnte Kontierung nicht bearbeiten! - - + + %0 (%1) %0 (%1) - + Could not create time assignment! Konnte Kontierung nicht erstellen! - - + + Switch Wechseln diff --git a/zeiterfassungguilib/translations/zeiterfassungguilib_en.ts b/zeiterfassungguilib/translations/zeiterfassungguilib_en.ts index 8c38655..b96835a 100644 --- a/zeiterfassungguilib/translations/zeiterfassungguilib_en.ts +++ b/zeiterfassungguilib/translations/zeiterfassungguilib_en.ts @@ -1,106 +1,6 @@ - - AboutMeDialog - - - - About me - - - - - User-ID: - - - - - E-Mail: - - - - - Long username: - - - - - Text: - - - - - Username: - - - - - Street: - - - - - City: - - - - - Employed since: - - - - - Employed till: - - - - - Place of birth: - - - - - Zipcode: - - - - - Religion: - - - - - Department: - - - - - Verwendgr: - - - - - Taetig: - - - - - Arbverh: - - - - - Betriebsnr: - - - - - - dd.MM.yyyy - - - AuthenticationDialog @@ -168,8 +68,8 @@ - - + + Start @@ -189,107 +89,107 @@ - + &View - + &Tools - + &Quit - + About &Me - + About &zeiterfassung - + About &Qt - + &Today - + &Refresh everything - + &Settings - + Help - + Zeiterfassung - %0 (%1) - + Subproject - + Workpackage - + Text - - + + Could not load bookings! - - + + Could not create booking! - + Could not create time assignment! - - + + Could not edit time assignment! - - + + Switch - - + + %0 (%1) diff --git a/zeiterfassungguilib/zeiterfassungguilib.pro b/zeiterfassungguilib/zeiterfassungguilib.pro index 0f252db..2936ed3 100644 --- a/zeiterfassungguilib/zeiterfassungguilib.pro +++ b/zeiterfassungguilib/zeiterfassungguilib.pro @@ -19,7 +19,6 @@ SOURCES += mainwindow.cpp \ stripfactory.cpp \ stripswidget.cpp \ zeiterfassungplugin.cpp \ - dialogs/aboutmedialog.cpp \ dialogs/authenticationdialog.cpp \ dialogs/languageselectiondialog.cpp \ dialogs/settingsdialog.cpp @@ -29,7 +28,6 @@ HEADERS += mainwindow.h \ stripswidget.h \ zeiterfassungguilib_global.h \ zeiterfassungplugin.h \ - dialogs/aboutmedialog.h \ dialogs/authenticationdialog.h \ dialogs/languageselectiondialog.h \ dialogs/settingsdialog.h @@ -37,8 +35,7 @@ HEADERS += mainwindow.h \ FORMS += mainwindow.ui \ dialogs/settingsdialog.ui \ dialogs/languageselectiondialog.ui \ - dialogs/authenticationdialog.ui \ - dialogs/aboutmedialog.ui + dialogs/authenticationdialog.ui RESOURCES += zeiterfassungguilib_resources.qrc