From c1f1b884ff743b64a0b18b3b4d8eb3339190524d Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Mon, 17 Sep 2018 19:43:21 +0200 Subject: [PATCH] Imported existing sources --- images/profile.png | Bin 0 -> 5577 bytes profiledialog.cpp | 32 +++ profiledialog.h | 18 ++ profiledialog.ui | 356 +++++++++++++++++++++++++++++++ profileplugin.cpp | 39 ++++ profileplugin.h | 24 +++ profileplugin.json | 0 profileplugin.pro | 22 ++ profileplugin_resources.qrc | 5 + translations/profileplugin_de.ts | 111 ++++++++++ translations/profileplugin_en.ts | 111 ++++++++++ 11 files changed, 718 insertions(+) create mode 100644 images/profile.png create mode 100644 profiledialog.cpp create mode 100644 profiledialog.h create mode 100644 profiledialog.ui create mode 100644 profileplugin.cpp create mode 100644 profileplugin.h create mode 100644 profileplugin.json create mode 100644 profileplugin.pro create mode 100644 profileplugin_resources.qrc create mode 100644 translations/profileplugin_de.ts create mode 100644 translations/profileplugin_en.ts diff --git a/images/profile.png b/images/profile.png new file mode 100644 index 0000000000000000000000000000000000000000..e6e955fcc9165f5bc8b6b7ce89bc2263dcd199e8 GIT binary patch literal 5577 zcmeAS@N?(olHy`uVBq!ia0y~yU~m9o4mJh`hELqiJ#!!HH~hK3gm45bDP46hOx7_4S6Fo+k- z*%fHRz`($k4nJNUsNB#yF{oG9baS0>^ZaBf$98=N}0S z48l#GE{-7;x9-l)?3w$#^nU&M&+oq1zBjr(S5ohAs)zR#zsSDW@W7O#8-#bPy!_2M z$Gjkly>a5&Oy29cJjXv=TlDvWTHj;_!$}9+#N2)Fx;SQC$(!u4?ZJ(ysk&QM1T4}B zTGD3xgeQIH>D@Nb_It|PoPP+fRCFzGU^gy){^(rszw?&=i|2i|U;m)=$Emz(e+C%_ zH3oJa=H_m%j~}Q0P&5e13wURM<&yaiZ}6#h_qAZ@P7;Hf<8^eo;cgB87rC6B&sdUz~jOOQrr z;1r?80}<{^ZI%c`Jil;jLU`A~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KY@_;T=@nYT|j9{zmhepLr^JO76A`+3j4ohvB# zuk-tR*~g_%cHg(WR{cp|{$K31bGAxrZMW~*u;ASHb$OG%&DwHM-nQxr_oE%ktrkhm zUlulh-~V~}yXp^(%GKrNtzT?@9iDS_t6jD&Y)WR+ zgh{Jb$+t;7Q>~1fBrY1d^y0CElGsaJiWBCkaMUa^Q1EoRv_#DRumXe3-+vP>FFzNm zKELwS($DAr+)aLxec!1g`P|OSwb|x!|F3Od_j2Ry>r43dKR%oPjY(5FtV5H%n29fP zkMqfOKX>nD=aZdr)85{CcmBGoFHJlj-TG_p9cSHDp8k5*(q%1y{sEGo7NwMy9@d># znVS6ajQ8{D{`*T-?W*_{`S6V=yS}Hz3& z_4||JG`+Dps>-m?i37i)8QQ{4z=XV~wbgZrJ(az^_mp8Xq8_9ogQ`q%A?q*MN zJeQ#5b194KA{U%G%q}p^a$r+&@R-|Z=6QobYDI&h0YlXRwsUKhkFYs?5lDKmMz`JT z<$C*%NBV4Bc0Ohn`hNZ_XMI)FvcwmbiZye%*A_2a(aYE9(C|L%vAK4j_5lk;lXIGL zR?nFtdM-4m!;5PnduZx3aq+hs!{csVv|RX~{d>}_9+g6$0}KodswJ)wCCNppi6yDJ zDTyVi3`Pb9mb!+9x`w79hUQiVMpnkgx(4P}1_s3r8|J_?fK*yRbTJqi7#ipr80s1t zh8S2{85>y{SwJ)_nY>ybMMG|WN@iLmZVgw@2~TEVU`Pi!$tN>8HLp08A)}s~N0FsLJ><3oddV7@3XFW1WltJci~sRn!Fz4@xsppjHhS3j3^P6setupUi(this); + + ui->spinBoxUserId->setValue(userInfo.userId); + ui->lineEditEmail->setText(userInfo.email); + ui->lineEditLongUsername->setText(userInfo.longUsername); + ui->lineEditText->setText(userInfo.text); + ui->lineEditUsername->setText(userInfo.username); + ui->lineEditStreet->setText(userInfo.street); + ui->lineEditCity->setText(userInfo.city); + ui->dateEditEmployedSince->setDate(userInfo.employedSince); + ui->dateEditEmployedTill->setDate(userInfo.employedTill); + ui->lineEditPlaceOfBirth->setText(userInfo.placeOfBirth); + ui->lineEditZipcode->setText(userInfo.zipcode); + ui->lineEditReligion->setText(userInfo.religion); + ui->lineEditDepartment->setText(userInfo.department); + ui->lineEditVerwendgr->setText(userInfo.verwendgr); + ui->lineEditTaetig->setText(userInfo.taetig); + ui->lineEditArbverh->setText(userInfo.arbverh); + ui->lineEditBetriebsnr->setText(userInfo.betriebsnr); +} + +ProfileDialog::~ProfileDialog() +{ + delete ui; +} diff --git a/profiledialog.h b/profiledialog.h new file mode 100644 index 0000000..3725fd7 --- /dev/null +++ b/profiledialog.h @@ -0,0 +1,18 @@ +#pragma once + +#include "zeiterfassungdialog.h" +#include "replies/getuserinforeply.h" + +namespace Ui { class ProfileDialog; } + +class ProfileDialog : public ZeiterfassungDialog +{ + Q_OBJECT + +public: + explicit ProfileDialog(const GetUserInfoReply::UserInfo &userInfo, QWidget *parent = Q_NULLPTR); + ~ProfileDialog(); + +private: + Ui::ProfileDialog *ui; +}; diff --git a/profiledialog.ui b/profiledialog.ui new file mode 100644 index 0000000..252749c --- /dev/null +++ b/profiledialog.ui @@ -0,0 +1,356 @@ + + + ProfileDialog + + + + 0 + 0 + 454 + 281 + + + + Profile + + + + + + true + + + + + 0 + 0 + 420 + 610 + + + + + + + User-ID: + + + spinBoxUserId + + + + + + + E-Mail: + + + lineEditEmail + + + + + + + Long username: + + + lineEditLongUsername + + + + + + + Text: + + + lineEditText + + + + + + + Username: + + + lineEditUsername + + + + + + + true + + + 16777215 + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + Street: + + + lineEditStreet + + + + + + + City: + + + lineEditCity + + + + + + + Employed since: + + + dateEditEmployedSince + + + + + + + Employed till: + + + dateEditEmployedTill + + + + + + + Place of birth: + + + lineEditPlaceOfBirth + + + + + + + Zipcode: + + + lineEditZipcode + + + + + + + Religion: + + + lineEditReligion + + + + + + + Department: + + + lineEditDepartment + + + + + + + Verwendgr: + + + lineEditVerwendgr + + + + + + + Taetig: + + + lineEditTaetig + + + + + + + Arbverh: + + + lineEditArbverh + + + + + + + Betriebsnr: + + + lineEditBetriebsnr + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + + + + + QDialogButtonBox::Close + + + + + + + + + buttonBox + rejected() + ProfileDialog + close() + + + 226 + 5 + + + 226 + 0 + + + + + diff --git a/profileplugin.cpp b/profileplugin.cpp new file mode 100644 index 0000000..1dc949d --- /dev/null +++ b/profileplugin.cpp @@ -0,0 +1,39 @@ +#include "profileplugin.h" + +#include +#include +#include +#include +#include +#include + +#include "mainwindow.h" + +#include "profiledialog.h" + +ProfilePlugin::ProfilePlugin(QObject *parent) : + ZeiterfassungPlugin(parent) +{ + qDebug() << "called"; + + static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations")); + + if(m_translator.load(QLocale(), QStringLiteral("profileplugin"), QStringLiteral("_"), dir)) + { + if(!QCoreApplication::installTranslator(&m_translator)) + { + qWarning() << "could not install translation profileplugin"; + } + } + else + { + qWarning() << "could not load translation profileplugin"; + } +} + +void ProfilePlugin::attachTo(MainWindow &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/profileplugin.h b/profileplugin.h new file mode 100644 index 0000000..ee1f67e --- /dev/null +++ b/profileplugin.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include + +#include "zeiterfassungplugin.h" + +class MainWindow; + +class Q_DECL_EXPORT ProfilePlugin : public ZeiterfassungPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "dbsoftware.zeiterfassung.plugin/1.0" FILE "profileplugin.json") + Q_INTERFACES(ZeiterfassungPlugin) + +public: + explicit ProfilePlugin(QObject *parent = Q_NULLPTR); + + // ZeiterfassungPlugin interface + void attachTo(MainWindow &mainWindow) Q_DECL_OVERRIDE; + +private: + QTranslator m_translator; +}; diff --git a/profileplugin.json b/profileplugin.json new file mode 100644 index 0000000..e69de29 diff --git a/profileplugin.pro b/profileplugin.pro new file mode 100644 index 0000000..7864b95 --- /dev/null +++ b/profileplugin.pro @@ -0,0 +1,22 @@ +QT += core network gui widgets + +DBLIBS += zeiterfassungcore zeiterfassunggui + +TARGET = profileplugin + +HEADERS += profiledialog.h \ + profileplugin.h + +SOURCES += profiledialog.cpp \ + profileplugin.cpp + +FORMS += profiledialog.ui + +RESOURCES += profileplugin_resources.qrc + +TRANSLATIONS += translations/profileplugin_en.ts \ + translations/profileplugin_de.ts + +OTHER_FILES += profileplugin.json + +include(../plugin.pri) diff --git a/profileplugin_resources.qrc b/profileplugin_resources.qrc new file mode 100644 index 0000000..d1346b0 --- /dev/null +++ b/profileplugin_resources.qrc @@ -0,0 +1,5 @@ + + + images/profile.png + + diff --git a/translations/profileplugin_de.ts b/translations/profileplugin_de.ts new file mode 100644 index 0000000..e8cb231 --- /dev/null +++ b/translations/profileplugin_de.ts @@ -0,0 +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/translations/profileplugin_en.ts b/translations/profileplugin_en.ts new file mode 100644 index 0000000..d6f19e1 --- /dev/null +++ b/translations/profileplugin_en.ts @@ -0,0 +1,111 @@ + + + + + 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 + + + +