From kde-commits Sat Jan 14 10:16:40 2012 From: Robert Gruber Date: Sat, 14 Jan 2012 10:16:40 +0000 To: kde-commits Subject: playground/pim/akonadi/exchange/mapibrowser Message-Id: <20120114101640.6D12AAC891 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=132653636422452 SVN commit 1273485 by rgruber: Added profile management dialog to the mapibrower. This makes it easier to debug the profile creation/deletion logic. M +17 -6 CMakeLists.txt M +16 -1 mapibrowser.cpp M +1 -0 mapibrowser.h --- trunk/playground/pim/akonadi/exchange/mapibrowser/CMakeLists.txt #1273484:1273485 @@ -2,16 +2,27 @@ #include_directories(${LIBMAPI_INCLUDE_DIRS} ${QT_INCLUDES} ../connector ${CMAKE_CURRENT_BINARY_DIR}) -set(mapibrowser_SRCS mainwindow.cpp mapibrowser.cpp main.cpp ${RESOURCE_EXCHANGE_CONNECTOR_SOURCES}) -set(mapibrowser_UI_SRCS mainwindow.ui) +set(mapibrowser_SRCS + mainwindow.cpp + mapibrowser.cpp + main.cpp + ${RESOURCE_EXCHANGE_CONNECTOR_SOURCES} + ${RESOURCE_EXCHANGE_UI_SOURCES} +) +set(mapibrowser_UI_SRCS mainwindow.ui ${RESOURCE_EXCHANGE_UI_FILES}) -QT4_WRAP_UI(mapibrowser_SRCS ${mapibrowser_UI_SRCS}) +#QT4_WRAP_UI(mapibrowser_SRCS ${mapibrowser_UI_SRCS}) +kde4_add_ui_files( mapibrowser_SRCS ${mapibrowser_UI_SRCS} ) -qt4_automoc(${mapibrowser_SRCS}) -add_executable(mapibrowser ${mapibrowser_SRCS}) +#qt4_automoc(${mapibrowser_SRCS}) +#add_executable(mapibrowser ${mapibrowser_SRCS}) +kde4_add_executable(mapibrowser RUN_UNINSTALLED ${mapibrowser_SRCS}) + target_link_libraries(mapibrowser ${LIBMAPI_LIBRARY} ${KDEPIMLIBS_KPIMUTILS_LIBS} ${LIBDCERPC_LIBRARY} ${QT_QTCORE_LIBRARY} - ${QT_QTGUI_LIBRARY}) + ${KDE4_KDEUI_LIBS} + ${KDE4_KDECORE_LIBS}) + --- trunk/playground/pim/akonadi/exchange/mapibrowser/mapibrowser.cpp #1273484:1273485 @@ -30,6 +30,7 @@ #include #include "mapiconnector2.h" +#include "profiledialog.h" /** * We store all objects in Akonadi using the densest string representation to hand. @@ -57,6 +58,11 @@ fileMenu->addAction( a ); a = new QAction(this); + a->setText( QString::fromLocal8Bit("Manage Profiles") ); + connect(a, SIGNAL(triggered()), SLOT(onManageProfiles()) ); + fileMenu->addAction( a ); + + a = new QAction(this); a->setText( QString::fromLocal8Bit("Quit") ); connect(a, SIGNAL(triggered()), SLOT(close()) ); fileMenu->addAction( a ); @@ -81,7 +87,7 @@ bool ok; profile = QInputDialog::getItem(this, QString::fromAscii("Select Profile"), QString::fromAscii("Profile:"), profiles.list(), 0, false, &ok); if (!ok || profile.isEmpty()) { - this->close(); + return; } this->selectedProfile = profile; } @@ -126,6 +132,15 @@ root->setExpanded(true); } +void mapibrowser::onManageProfiles() +{ + ProfileDialog dlgConfig(selectedProfile); + + if (dlgConfig.exec() == QDialog::Accepted) { + selectedProfile = dlgConfig.getProfileName(); + } +} + void mapibrowser::itemDoubleClicked(QTreeWidgetItem* clickedItem, int ) { QString remoteId = clickedItem->text(1); --- trunk/playground/pim/akonadi/exchange/mapibrowser/mapibrowser.h #1273484:1273485 @@ -34,6 +34,7 @@ public slots: void onRefreshTree(); + void onManageProfiles(); void itemDoubleClicked(QTreeWidgetItem*,int); void itemDoubleClicked(QTableWidgetItem*); void checkForDefaultProfile();