[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdeexamples] desktop-files: adding files
From: Thorsten Staerk <thorsten () staerk ! de>
Date: 2011-09-19 8:59:10
Message-ID: 20110919085910.173D3A607A () git ! kde ! org
[Download RAW message or body]
Git commit 14ec881f085cf95e8404e36cb5603d0ad3191461 by Thorsten Staerk.
Committed on 19/09/2011 at 11:15.
Pushed by tstaerk into branch 'master'.
adding files
A +19 -0 desktop-files/CMakeLists.txt
A +20 -0 desktop-files/main.cpp [License: UNKNOWN] *
A +34 -0 desktop-files/mainwindow.cpp [License: UNKNOWN] *
A +17 -0 desktop-files/mainwindow.h [License: UNKNOWN] *
A +20 -0 desktop-files/tutorial-kiconui.rc
A +7 -0 desktop-files/world.svg
The files marked with a * at the end have a non valid license. Please read: \
http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are \
listed at that page.
http://commits.kde.org/kdeexamples/14ec881f085cf95e8404e36cb5603d0ad3191461
diff --git a/desktop-files/CMakeLists.txt b/desktop-files/CMakeLists.txt
new file mode 100644
index 0000000..57eceba
--- /dev/null
+++ b/desktop-files/CMakeLists.txt
@@ -0,0 +1,19 @@
+project(tutorial-kicon)
+
+find_package(KDE4 REQUIRED)
+include_directories(${KDE4_INCLUDES})
+
+set(tutorial-source
+ main.cpp
+ mainwindow.cpp
+)
+
+kde4_add_executable(tutorial-kicon ${tutorial-source})
+
+target_link_libraries(tutorial-kicon ${KDE4_KDEUI_LIBS})
+
+install(TARGETS tutorial-kicon DESTINATION ${BIN_INSTALL_DIR})
+install(FILES tutorial-kiconui.rc
+ DESTINATION ${DATA_INSTALL_DIR}/tutorial-kicon)
+kde4_install_icons(${ICON_INSTALL_DIR})
+kde4_update_iconcache()
diff --git a/desktop-files/main.cpp b/desktop-files/main.cpp
new file mode 100644
index 0000000..d0f188f
--- /dev/null
+++ b/desktop-files/main.cpp
@@ -0,0 +1,20 @@
+#include <KApplication>
+#include <KAboutData>
+#include <KCmdLineArgs>
+
+#include "mainwindow.h"
+
+int main (int argc, char *argv[])
+{
+ KAboutData aboutData( "tutorial-kicon", "tutorial-kicon",
+ ki18n("Tutorial KIcon"), "1.0",
+ ki18n("A simple text area using KIcons, KAction etc."),
+ KAboutData::License_GPL,
+ ki18n("Copyright (c) 2011 Developer") );
+ KCmdLineArgs::init( argc, argv, &aboutData );
+ KApplication app;
+
+ MainWindow* window = new MainWindow();
+ window->show();
+ return app.exec();
+}
diff --git a/desktop-files/mainwindow.cpp b/desktop-files/mainwindow.cpp
new file mode 100644
index 0000000..928c4c2
--- /dev/null
+++ b/desktop-files/mainwindow.cpp
@@ -0,0 +1,34 @@
+#include "mainwindow.h"
+
+#include <KApplication>
+#include <KAction>
+#include <KLocale>
+#include <KActionCollection>
+#include <KStandardAction>
+
+MainWindow::MainWindow(QWidget *parent)
+ : KXmlGuiWindow(parent)
+{
+ textArea = new KTextEdit;
+ setCentralWidget(textArea);
+
+ setupActions();
+}
+
+void MainWindow::setupActions()
+{
+ KAction* clearAction = new KAction(this);
+ clearAction->setText(i18n("&Clear"));
+ clearAction->setIcon(KIcon("tutorial-kicon"));
+ clearAction->setShortcut(Qt::CTRL + Qt::Key_W);
+ actionCollection()->addAction("clear", clearAction);
+ connect(clearAction, SIGNAL(triggered(bool)),
+ textArea, SLOT(clear()));
+
+ KStandardAction::quit(kapp, SLOT(quit()),
+ actionCollection());
+
+ setupGUI();
+}
+
+
diff --git a/desktop-files/mainwindow.h b/desktop-files/mainwindow.h
new file mode 100644
index 0000000..d787505
--- /dev/null
+++ b/desktop-files/mainwindow.h
@@ -0,0 +1,17 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <KXmlGuiWindow>
+#include <KTextEdit>
+
+class MainWindow : public KXmlGuiWindow
+{
+ public:
+ MainWindow(QWidget *parent=0);
+
+ private:
+ KTextEdit* textArea;
+ void setupActions();
+};
+
+#endif
diff --git a/desktop-files/tutorial-kiconui.rc b/desktop-files/tutorial-kiconui.rc
new file mode 100644
index 0000000..42a8d20
--- /dev/null
+++ b/desktop-files/tutorial-kiconui.rc
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gui name="tutorial-kicon"
+ version="1"
+ xmlns="http://www.kde.org/standards/kxmlgui/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0
+ http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd" >
+
+ <MenuBar>
+ <Menu name="file" >
+ <Action name="clear" />
+ </Menu>
+ </MenuBar>
+
+ <ToolBar name="mainToolBar" >
+ <text>Main Toolbar</text>
+ <Action name="clear" />
+ </ToolBar>
+
+</gui>
diff --git a/desktop-files/world.svg b/desktop-files/world.svg
new file mode 100644
index 0000000..3468661
--- /dev/null
+++ b/desktop-files/world.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
+ width="300" height="300">
+ <circle r="100" cx="150" cy="150" fill="blue" stroke-width="2px" stroke="black"/>
+</svg>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic