Skip to content

Commit

Permalink
Add about tab in configuration dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
KrissN committed Apr 30, 2016
1 parent 985f33f commit 3955bf3
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -49,6 +49,8 @@ option(HAVE_SEPARATE_MTA_RESOURCE "Build a separate resource for sending e-mail.
option(HAVE_INBOX_FILTERING_WORKAROUND "Include inbox filtering workaround." TRUE)
option(ENABLE_TESTS "Build the test suite." FALSE)

set(AKONADI_EWS_VERSION "0.8.0")

add_subdirectory(ewsclient)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
Expand Down
2 changes: 2 additions & 0 deletions config.h.cmake
Expand Up @@ -5,4 +5,6 @@

#cmakedefine HAVE_INBOX_FILTERING_WORKAROUND

#cmakedefine AKONADI_EWS_VERSION "@AKONADI_EWS_VERSION@"

#endif
9 changes: 9 additions & 0 deletions configdialog.cpp
Expand Up @@ -91,6 +91,15 @@ ConfigDialog::ConfigDialog(EwsResource *parentResource, EwsClient &client, WId w
mParentResource->requestPassword(password, false);
mUi->passwordEdit->setText(password);

QIcon ewsIcon = QIcon::fromTheme(QStringLiteral("akonadi-ews"));
qDebug() << ewsIcon.availableSizes();
mUi->aboutIconLabel->setPixmap(ewsIcon.pixmap(96, 96, QIcon::Normal, QIcon::On));
mUi->aboutTextLabel->setText(i18nc("@info", "Akonadi Resource for Microsoft Exchange Web Services (EWS)"));
mUi->aboutCopyrightLabel->setText(i18nc("@info", "Copyright (c) Krzysztof Nowicki 2015-2016"));
mUi->aboutVersionLabel->setText(i18nc("@info", "Version %1").arg(AKONADI_EWS_VERSION));
mUi->aboutLicenseLabel->setText(i18nc("@info", "Distributed under the GNU Library General Public License version 2.0 or later."));
mUi->aboutUrlLabel->setText(QStringLiteral("<a href=\"https://github.com/KrissN/akonadi-ews\">https://github.com/KrissN/akonadi-ews</a>"));

connect(okButton, &QPushButton::clicked, this, &ConfigDialog::save);
connect(mUi->autodiscoverButton, &QPushButton::clicked, this, &ConfigDialog::performAutoDiscovery);
connect(mUi->kcfg_Username, SIGNAL(textChanged(const QString&)), this, SLOT(setAutoDiscoveryNeeded()));
Expand Down
100 changes: 100 additions & 0 deletions configdialog.ui
Expand Up @@ -388,6 +388,106 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="aboutTab">
<attribute name="title">
<string>About</string>
</attribute>
<layout class="QHBoxLayout" name="aboutTabLayout">
<item>
<widget class="QWidget" name="aboutIconWidget" native="true">
<layout class="QVBoxLayout" name="aboutIconWidgetLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="aboutIconLabel">
<property name="pixmap">
<pixmap>../../../../../usr/share/icons/hicolor/128x128/apps/akonadi-ews.png</pixmap>
</property>
</widget>
</item>
<item>
<spacer name="aboutIconSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="aboutTextWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="aboutTextWidgetLayout">
<item>
<widget class="QLabel" name="aboutTextLabel">
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="aboutVersionLabel"/>
</item>
<item>
<widget class="QLabel" name="aboutCopyrightLabel"/>
</item>
<item>
<widget class="QLabel" name="aboutLicenseLabel">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="aboutUrlLabel">
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="aboutTextSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
Expand Down

0 comments on commit 3955bf3

Please sign in to comment.