[Ktutorial-commits] SF.net SVN: ktutorial:[109] trunk/ktutorial
Status: Alpha
Brought to you by:
danxuliu
From: <dan...@us...> - 2010-03-05 23:32:10
|
Revision: 109 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=109&view=rev Author: danxuliu Date: 2010-03-05 23:32:03 +0000 (Fri, 05 Mar 2010) Log Message: ----------- Initial import for KTutorial editor, with a basic directory layout and a dummy main window. Modified Paths: -------------- trunk/ktutorial/CMakeLists.txt Added Paths: ----------- trunk/ktutorial/ktutorial-editor/ trunk/ktutorial/ktutorial-editor/CMakeLists.txt trunk/ktutorial/ktutorial-editor/src/ trunk/ktutorial/ktutorial-editor/src/CMakeLists.txt trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.cpp trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.h trunk/ktutorial/ktutorial-editor/src/ktutorial-editorui.rc trunk/ktutorial/ktutorial-editor/src/main.cpp Modified: trunk/ktutorial/CMakeLists.txt =================================================================== --- trunk/ktutorial/CMakeLists.txt 2010-02-26 18:55:44 UTC (rev 108) +++ trunk/ktutorial/CMakeLists.txt 2010-03-05 23:32:03 UTC (rev 109) @@ -4,5 +4,6 @@ enable_testing() +macro_optional_add_subdirectory(ktutorial-editor) macro_optional_add_subdirectory(ktutorial-library) macro_optional_add_subdirectory(ktutorial-test-app) Added: trunk/ktutorial/ktutorial-editor/CMakeLists.txt =================================================================== --- trunk/ktutorial/ktutorial-editor/CMakeLists.txt (rev 0) +++ trunk/ktutorial/ktutorial-editor/CMakeLists.txt 2010-03-05 23:32:03 UTC (rev 109) @@ -0,0 +1,7 @@ +project(ktutorial-editor) + +find_package(KDE4 REQUIRED) + +include(KDE4Defaults) + +add_subdirectory(src) Property changes on: trunk/ktutorial/ktutorial-editor/CMakeLists.txt ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native Added: trunk/ktutorial/ktutorial-editor/src/CMakeLists.txt =================================================================== --- trunk/ktutorial/ktutorial-editor/src/CMakeLists.txt (rev 0) +++ trunk/ktutorial/ktutorial-editor/src/CMakeLists.txt 2010-03-05 23:32:03 UTC (rev 109) @@ -0,0 +1,24 @@ +# In x86_64, linking fails when a static library is added to a shared library. +# In order to work, they must be compiled using -fPIC +add_definitions("-fPIC") + +include_directories(${KDE4_INCLUDES}) + +set(ktutorial_editor_SRCS + KTutorialEditor.cpp +) + +# Instead of compiling the executable directly from the sources, the sources are +# compiled to a static library that is linked (and, being static, also embedded) +# in the editor executable. +# As everything but a tiny initialization code is in a library, the build system +# for the tests can be easily set up. +kde4_add_library(ktutorial_editor ${ktutorial_editor_SRCS}) + +kde4_add_executable(ktutorial-editor main.cpp) +target_link_libraries(ktutorial-editor ktutorial_editor ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS}) + +####### Install the editor ####### + +install(TARGETS ktutorial-editor DESTINATION ${BIN_INSTALL_DIR}) +install(FILES ktutorial-editorui.rc DESTINATION ${DATA_INSTALL_DIR}/ktutorial-editor) Property changes on: trunk/ktutorial/ktutorial-editor/src/CMakeLists.txt ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native Added: trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.cpp (rev 0) +++ trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.cpp 2010-03-05 23:32:03 UTC (rev 109) @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (C) 2010 by Daniel Calviño Sánchez * + * dan...@gm... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; If not, see <http://www.gnu.org/licenses/>. * + ***************************************************************************/ + +#include "KTutorialEditor.h" + +#include <QTreeView> + +#include <KAction> +#include <KActionCollection> +#include <KApplication> + +//public: + +KTutorialEditor::KTutorialEditor(): KXmlGuiWindow(0) { + QTreeView* treeView = new QTreeView(); + treeView->setObjectName("centralTreeView"); + treeView->setHeaderHidden(true); + + setCentralWidget(treeView); + + setupActions(); + + //Don't use a status bar (which is setupGUI default behavior) + setupGUI(ToolBar | Keys | Save | Create); +} + +//private: + +void KTutorialEditor::setupActions() { + KStandardAction::quit(kapp, SLOT(quit()), actionCollection()); +} Property changes on: trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.cpp ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native Added: trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.h =================================================================== --- trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.h (rev 0) +++ trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.h 2010-03-05 23:32:03 UTC (rev 109) @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (C) 2010 by Daniel Calviño Sánchez * + * dan...@gm... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; If not, see <http://www.gnu.org/licenses/>. * + ***************************************************************************/ + +#ifndef KTUTORIALEDITOR_H +#define KTUTORIALEDITOR_H + +#include <KXmlGuiWindow> + +/** + * KTutorial editor main window. + * It wires up all the components in the application. + */ +class KTutorialEditor: public KXmlGuiWindow { +Q_OBJECT +public: + + /** + * Creates a new KTutorialEditor. + */ + KTutorialEditor(); + +private: + + /** + * Sets up all the actions used in the application. + */ + void setupActions(); + +}; + +#endif Property changes on: trunk/ktutorial/ktutorial-editor/src/KTutorialEditor.h ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native Added: trunk/ktutorial/ktutorial-editor/src/ktutorial-editorui.rc =================================================================== --- trunk/ktutorial/ktutorial-editor/src/ktutorial-editorui.rc (rev 0) +++ trunk/ktutorial/ktutorial-editor/src/ktutorial-editorui.rc 2010-03-05 23:32:03 UTC (rev 109) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"> +<gui name="ktutorial-editor" version="1"> +</gui> Property changes on: trunk/ktutorial/ktutorial-editor/src/ktutorial-editorui.rc ___________________________________________________________________ Added: svn:executable + * Added: trunk/ktutorial/ktutorial-editor/src/main.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/src/main.cpp (rev 0) +++ trunk/ktutorial/ktutorial-editor/src/main.cpp 2010-03-05 23:32:03 UTC (rev 109) @@ -0,0 +1,44 @@ +/*************************************************************************** + * Copyright (C) 2010 by Daniel Calviño Sánchez * + * dan...@gm... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; If not, see <http://www.gnu.org/licenses/>. * + ***************************************************************************/ + +#include <KApplication> +#include <KAboutData> +#include <KCmdLineArgs> + +#include "KTutorialEditor.h" + +int main (int argc, char *argv[]) { + KAboutData aboutData("ktutorial-editor", 0, + ki18nc("@title", "KTutorial"), + "0.1", + ki18nc("@info", "An editor to create tutorials for " + "<application>KTutorial</application>."), + KAboutData::License_GPL_V3, + ki18nc("@info:credit", "Copyright (c) 2010 Daniel Calviño Sánchez")); + aboutData.addAuthor(ki18nc("@info:credit", "Daniel Calviño Sánchez"), + ki18nc("@info:credit", "Main developer"), + "dan...@gm..."); + KCmdLineArgs::init(argc, argv, &aboutData); + + KApplication app; + + KTutorialEditor* window = new KTutorialEditor(); + window->show(); + + return app.exec(); +} Property changes on: trunk/ktutorial/ktutorial-editor/src/main.cpp ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |