From 2998d9d3d5dfc825904b53393e9ae12e7cd5b72b Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 21 Apr 2015 15:44:54 +0200 Subject: Moved Console to client. It's part of the demo application. --- common/CMakeLists.txt | 3 +- common/console.cpp | 80 --------------------------------------------------- common/console.h | 49 ------------------------------- 3 files changed, 1 insertion(+), 131 deletions(-) delete mode 100644 common/console.cpp delete mode 100644 common/console.h (limited to 'common') diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index c18d98a..f6847a7 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -28,7 +28,6 @@ set(command_SRCS entitybuffer.cpp clientapi.cpp commands.cpp - console.cpp facade.cpp pipeline.cpp domainadaptor.cpp @@ -44,6 +43,6 @@ set(command_SRCS add_library(${PROJECT_NAME} SHARED ${command_SRCS}) generate_export_header(${PROJECT_NAME} BASE_NAME Akonadi2Common EXPORT_FILE_NAME akonadi2common_export.h) SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) -qt5_use_modules(${PROJECT_NAME} Widgets Network) +qt5_use_modules(${PROJECT_NAME} Network) target_link_libraries(${PROJECT_NAME} ${storage_LIBS} akonadi2async) install(TARGETS ${PROJECT_NAME} ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/common/console.cpp b/common/console.cpp deleted file mode 100644 index 97a6e88..0000000 --- a/common/console.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2014 Aaron Seigo - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#include "console.h" - -#include -#include -#include -#include - -namespace Akonadi2 -{ - -static Console *s_console = 0; - -Console *Console::main() -{ - if (!s_console) { - s_console = new Console(QString()); - } - return s_console; -} - -Console::Console(const QString &title) - : QWidget(0) -{ - if (!s_console) { - s_console = this; - } - - resize(1000, 1500); - - QVBoxLayout *topLayout = new QVBoxLayout(this); - - QLabel *titleLabel = new QLabel(this); - titleLabel->setText(title); - QFont font = titleLabel->font(); - font.setWeight(QFont::Bold); - titleLabel->setFont(font); - titleLabel->setAlignment(Qt::AlignCenter); - - QFont consoleFont = QFontDatabase::systemFont(QFontDatabase::FixedFont); - consoleFont.setPointSize(7); - m_textDisplay = new QTextBrowser(this); - m_textDisplay->document()->setDefaultFont(consoleFont); - topLayout->addWidget(titleLabel); - topLayout->addWidget(m_textDisplay, 10); - - show(); - m_timestamper.start(); -} - -Console::~Console() -{ - -} - -void Console::log(const QString &message) -{ - m_textDisplay->append(QString::number(m_timestamper.elapsed()).rightJustified(6) + ": " + message); -} - -} // namespace Akonadi2 diff --git a/common/console.h b/common/console.h deleted file mode 100644 index edfc8e5..0000000 --- a/common/console.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2014 Aaron Seigo - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#pragma once - -#include - -#include -#include - -class QTextBrowser; - -namespace Akonadi2 -{ - -class AKONADI2COMMON_EXPORT Console : public QWidget -{ - Q_OBJECT -public: - static Console *main(); - Console(const QString &title); - ~Console(); - - void log(const QString &message); - -private: - QTextBrowser *m_textDisplay; - QTime m_timestamper; - static Console *s_output; -}; - -} // namespace Akonadi2 -- cgit v1.2.3