diff --git a/CMakeLists.txt b/CMakeLists.txt index 2fdf380c9..248f86730 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,6 @@ option(ICINGA2_WITH_COMPAT "Build the compat module" ON) option(ICINGA2_WITH_LIVESTATUS "Build the Livestatus module" ON) option(ICINGA2_WITH_NOTIFICATION "Build the notification module" ON) option(ICINGA2_WITH_PERFDATA "Build the perfdata module" ON) -option(ICINGA2_WITH_STUDIO "Build the Icinga Studio application" OFF) option(ICINGA2_WITH_TESTS "Run unit tests" ON) option (USE_SYSTEMD @@ -364,10 +363,6 @@ if(MSVC) add_subdirectory(icinga-installer) endif() -if(ICINGA2_WITH_STUDIO) - add_subdirectory(icinga-studio) -endif() - if(ICINGA2_WITH_TESTS) add_subdirectory(test) endif() @@ -379,7 +374,7 @@ set(CPACK_PACKAGE_INSTALL_DIRECTORY "ICINGA2") set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icinga-app\\\\icinga.ico") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt") -set(CPACK_PACKAGE_EXECUTABLES "Icinga2SetupAgent;Icinga 2 Agent Wizard;icinga-studio;Icinga Studio") +set(CPACK_PACKAGE_EXECUTABLES "Icinga2SetupAgent;Icinga 2 Agent Wizard") set(CPACK_WIX_PRODUCT_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icinga-app\\\\icinga.ico") set(CPACK_WIX_UPGRADE_GUID "52F2BEAA-4DF0-4C3E-ABDC-C0F61DE4DF8A") set(CPACK_WIX_EXTENSIONS "WixUtilExtension") diff --git a/INSTALL.md b/INSTALL.md index 79e3a7aa8..98251784c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -66,9 +66,6 @@ application using a dist tarball (including notes for distributions): * Termcap (only required if libedit doesn't already link against termcap/ncurses) - RHEL/Fedora: libtermcap-devel - Debian/Ubuntu: (not necessary) -* wxWidgets (only required when building the Icinga 2 Studio) - - Fedora: wxGTK-devel and wxBase - - Debian/Ubuntu: libwxgtk2.8-dev ## Special requirements @@ -160,7 +157,6 @@ In addition to `CMAKE_INSTALL_PREFIX` here are most of the supported Icinga-spec - `ICINGA2_WITH_LIVESTATUS`: Determines whether the Livestatus module is built; defaults to `ON` - `ICINGA2_WITH_NOTIFICATION`: Determines whether the notification module is built; defaults to `ON` - `ICINGA2_WITH_PERFDATA`: Determines whether the perfdata module is built; defaults to `ON` -- `ICINGA2_WITH_STUDIO`: Determines whether the Icinga Studio application is built; defaults to `OFF` - `ICINGA2_WITH_TESTS`: Determines whether the unit tests are built; defaults to `ON` **MySQL or MariaDB:** diff --git a/doc/12-icinga2-api.md b/doc/12-icinga2-api.md index 7fd000c62..47cabf0f3 100644 --- a/doc/12-icinga2-api.md +++ b/doc/12-icinga2-api.md @@ -1846,7 +1846,6 @@ There are a couple of existing clients which can be used with the Icinga 2 API: * [curl](https://curl.haxx.se/) or any other HTTP client really * [Icinga 2 console (CLI command)](12-icinga2-api.md#icinga2-api-clients-cli-console) -* [Icinga Studio](12-icinga2-api.md#icinga2-api-clients-icinga-studio) * [Icinga Web 2 Director](https://www.icinga.com/products/icinga-web-2-modules/) Demo cases: @@ -1857,23 +1856,6 @@ Demo cases: Additional [programmatic examples](12-icinga2-api.md#icinga2-api-clients-programmatic-examples) will help you getting started using the Icinga 2 API in your environment. -### Icinga Studio - -Icinga Studio is a graphical application to query configuration objects provided by the API. - -![Icinga Studio Connection](images/icinga2-api/icinga2_api_icinga_studio_connect.png) - -![Icinga Studio Overview](images/icinga2-api/icinga2_api_icinga_studio_overview.png) - -Please check the package repository of your distribution for available -packages. - -> **Note** -> Icinga Studio does not currently support SSL certificate verification. - -The Windows installer already includes Icinga Studio. On Debian and Ubuntu the package -`icinga2-studio` can be used to install Icinga Studio. - ### Icinga 2 Console By default the [console CLI command](11-cli-commands.md#cli-command-console) evaluates diff --git a/icinga-studio/CMakeLists.txt b/icinga-studio/CMakeLists.txt deleted file mode 100644 index 2925ce95f..000000000 --- a/icinga-studio/CMakeLists.txt +++ /dev/null @@ -1,74 +0,0 @@ -# Icinga 2 -# Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) -# -# 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 2 -# 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, write to the Free Software Foundation -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - -set(wxWidgets_CONFIGURATION mswu) -find_package(wxWidgets COMPONENTS core base propgrid adv REQUIRED) -include(${wxWidgets_USE_FILE}) - -if(MSVC) - set(WindowsSources icinga.rc) -else() - set(WindowsSources "") -endif() - -set(icinga_studio_SOURCES - icinga-studio.cpp - forms.cpp - aboutform.cpp aboutform.hpp - connectform.cpp connectform.hpp - mainform.cpp mainform.hpp - icinga.icns ${WindowsSources} - ${base_OBJS} - $ - $ -) - -add_executable(icinga-studio MACOSX_BUNDLE WIN32 ${icinga_studio_SOURCES}) - -target_link_libraries(icinga-studio ${base_DEPS} ${wxWidgets_LIBRARIES}) - -if(APPLE) - set_source_files_properties(icinga.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) -endif() - -set_target_properties ( - icinga-studio PROPERTIES - INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2 - FOLDER Bin - OUTPUT_NAME icinga-studio - MACOSX_BUNDLE_INFO_STRING "Icinga Studio" - MACOSX_BUNDLE_BUNDLE_NAME "Icinga Studio" - MACOSX_BUNDLE_GUI_IDENTIFIER "Icinga Studio" - MACOSX_BUNDLE_ICON_FILE icinga.icns - MACOSX_BUNDLE_SHORT_VERSION_STRING "${GIT_VERSION}" - MACOSX_BUNDLE_LONG_VERSION_STRING "${GIT_VERSION}" - MACOSX_BUNDLE_COPYRIGHT "(c) Icinga Development Team" - MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/MacOSXBundleInfo.plist.in" -) - -if(WIN32) - set(InstallPath "${CMAKE_INSTALL_SBINDIR}") -else() - set(InstallPath "${CMAKE_INSTALL_BINDIR}") -endif() - -install( - TARGETS icinga-studio - RUNTIME DESTINATION ${InstallPath} - BUNDLE DESTINATION ${InstallPath} -) - diff --git a/icinga-studio/IcingaStudio.fbp b/icinga-studio/IcingaStudio.fbp deleted file mode 100644 index 09adf7e3e..000000000 --- a/icinga-studio/IcingaStudio.fbp +++ /dev/null @@ -1,2128 +0,0 @@ - - - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - forms - 1000 - none - 0 - IcingaStudio - - . - - 1 - 1 - 1 - 1 - UI - 1 - 0 - - 0 - wxAUI_MGR_DEFAULT - - wxBOTH - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - 800,569 - MainFormBase - - 800,569 - wxDEFAULT_FRAME_STYLE - - Icinga Studio - - - - wxTAB_TRAVERSAL - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 1 - - - 0 - wxID_ANY - MyMenuBar - - - m_MenuBar - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - &File - m_FileMenu - none - - - 0 - 1 - - wxID_EXIT - wxITEM_NORMAL - &Quit - m_QuitMenuItem - none - - - OnQuitClicked - - - - - &Help - m_HelpMenu - none - - - 0 - 1 - - wxID_ABOUT - wxITEM_NORMAL - &About Icinga Studio... - m_AboutMenuItem - none - - - OnAboutClicked - - - - - - - m_DialogSizer - wxVERTICAL - none - - 5 - wxEXPAND - 1 - - - m_ConnectionDetailsSizer - wxHORIZONTAL - none - - 2 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_TypesTree - 1 - - - protected - 1 - - Resizable - 1 - 315,-1 - wxTR_DEFAULT_STYLE|wxTR_HIDE_ROOT - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnTypeSelected - - - - - - - - 5 - wxEXPAND - 1 - - - m_ObjectDetailsSizer - wxVERTICAL - none - - 2 - wxALL|wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_ObjectsList - 1 - - - protected - 1 - - Resizable - 1 - - wxLC_REPORT - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnObjectSelected - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - - 1 - - 0 - 0 - wxID_ANY - 1 - - 0 - - - 0 - - 1 - m_PropertyGrid - 1 - - - protected - 1 - - Resizable - 1 - - wxPG_DEFAULT_STYLE - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 1 - - 1 - - 0 - wxID_ANY - - - m_StatusBar - protected - - - wxST_SIZEGRIP - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - wxAUI_MGR_DEFAULT - - wxBOTH - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - - ConnectFormBase - - -1,-1 - wxDEFAULT_DIALOG_STYLE - - Icinga Studio - Connect - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - m_DialogSizer - wxVERTICAL - none - - 5 - wxEXPAND | wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_ConnectionDetailsPanel - 1 - - - none - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - wxID_ANY - Connection Details - - m_DetailsSizer - wxVERTICAL - none - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Host: - - 0 - - - 0 - - 1 - m_HostLabel - 1 - - - none - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_OK - - 0 - - - - 0 - - 1 - m_HostText - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Port: - - 0 - - - 0 - - 1 - m_PortLabel - 1 - - - none - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_PortText - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - API User: - - 0 - - - 0 - - 1 - m_UserLabel - 1 - - - none - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_UserText - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - API Password: - - 0 - - - 0 - - 1 - m_PasswordLabel - 1 - - - none - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_PasswordText - 1 - - - protected - 1 - - Resizable - 1 - - wxTE_PASSWORD - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - You can find the username and password for the default user in /etc/icinga2/conf.d/api-users.conf. - - 0 - - - 0 - - 1 - m_InfoLabel - 1 - - - none - 1 - - Resizable - 1 - - - - 0 - - - - - 270 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND | wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_ButtonsPanel - 1 - - - none - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - m_ButtonsSizer - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_Buttons - protected - - - - - - - - - - - - - - - - - 0 - wxAUI_MGR_DEFAULT - - wxBOTH - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - - AboutFormBase - - -1,-1 - wxDEFAULT_DIALOG_STYLE - - About Icinga Studio - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - m_DialogSizer - wxVERTICAL - none - - 5 - wxEXPAND - 1 - - - m_InfoSizer - wxHORIZONTAL - none - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - Load From Embedded File; icinga.xpm - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_ProductIcon - 1 - - - none - 1 - - Resizable - 1 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - - m_AboutInfoSizer - wxVERTICAL - none - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Icinga Studio - - 0 - - - 0 - - 1 - m_ProductNameLabel - 1 - - - none - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Version - - 0 - - - 0 - - 1 - m_VersionLabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Copyright (c) 2015 Icinga Development Team - - 0 - - - 0 - - 1 - m_CopyrightLabel - 1 - - - none - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND | wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_ButtonsPanel - 1 - - - none - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - m_ButtonsSizer - wxVERTICAL - none - - 5 - wxEXPAND - 0 - - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - - m_Buttons - none - - - - - - - - - - - - - - - - - diff --git a/icinga-studio/MacOSXBundleInfo.plist.in b/icinga-studio/MacOSXBundleInfo.plist.in deleted file mode 100644 index 681035201..000000000 --- a/icinga-studio/MacOSXBundleInfo.plist.in +++ /dev/null @@ -1,38 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleGetInfoString - ${MACOSX_BUNDLE_INFO_STRING} - CFBundleIconFile - ${MACOSX_BUNDLE_ICON_FILE} - CFBundleIdentifier - ${MACOSX_BUNDLE_GUI_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - ${MACOSX_BUNDLE_LONG_VERSION_STRING} - CFBundleName - ${MACOSX_BUNDLE_BUNDLE_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${MACOSX_BUNDLE_SHORT_VERSION_STRING} - CFBundleSignature - ???? - CFBundleVersion - ${MACOSX_BUNDLE_BUNDLE_VERSION} - CSResourcesFileMapped - - LSRequiresCarbon - - NSHumanReadableCopyright - ${MACOSX_BUNDLE_COPYRIGHT} - NSHighResolutionCapable - - - diff --git a/icinga-studio/aboutform.cpp b/icinga-studio/aboutform.cpp deleted file mode 100644 index 8315c10db..000000000 --- a/icinga-studio/aboutform.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) * - * * - * 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 2 * - * 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, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#include "base/application.hpp" -#include "icinga-studio/aboutform.hpp" - -using namespace icinga; - -AboutForm::AboutForm(wxWindow *parent) - : AboutFormBase(parent) -{ - std::string version = "Version " + Application::GetAppVersion(); - m_VersionLabel->SetLabelText(version); -} diff --git a/icinga-studio/aboutform.hpp b/icinga-studio/aboutform.hpp deleted file mode 100644 index 1614acd24..000000000 --- a/icinga-studio/aboutform.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) * - * * - * 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 2 * - * 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, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#ifndef ABOUTFORM_H -#define ABOUTFORM_H - -#include "icinga-studio/forms.h" - -namespace icinga -{ - -class AboutForm final : public AboutFormBase -{ -public: - AboutForm(wxWindow *parent); -}; - -} - -#endif /* ABOUTFORM_H */ diff --git a/icinga-studio/connectform.cpp b/icinga-studio/connectform.cpp deleted file mode 100644 index b3d20d5fb..000000000 --- a/icinga-studio/connectform.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) * - * * - * 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 2 * - * 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, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#include "icinga-studio/connectform.hpp" -#include -#include - -using namespace icinga; - -ConnectForm::ConnectForm(wxWindow *parent, const Url::Ptr& url) - : ConnectFormBase(parent) -{ -#ifdef _WIN32 - SetIcon(wxICON(icinga)); -#endif /* _WIN32 */ - - std::string authority = url->GetAuthority(); - - std::vector tokens; - boost::algorithm::split(tokens, authority, boost::is_any_of("@")); - - if (tokens.size() > 1) { - std::vector userinfo; - boost::algorithm::split(userinfo, tokens[0], boost::is_any_of(":")); - - m_UserText->SetValue(userinfo[0]); - m_PasswordText->SetValue(userinfo[1]); - } - - std::vector hostport; - boost::algorithm::split(hostport, tokens.size() > 1 ? tokens[1] : tokens[0], boost::is_any_of(":")); - - m_HostText->SetValue(hostport[0]); - - if (hostport.size() > 1) - m_PortText->SetValue(hostport[1]); - else - m_PortText->SetValue("5665"); - - SetDefaultItem(m_ButtonsOK); -} - -Url::Ptr ConnectForm::GetUrl() const -{ - wxString url = "https://" + m_UserText->GetValue() + ":" + m_PasswordText->GetValue() - + "@" + m_HostText->GetValue() + ":" + m_PortText->GetValue() + "/"; - - return new Url(url.ToStdString()); -} diff --git a/icinga-studio/connectform.hpp b/icinga-studio/connectform.hpp deleted file mode 100644 index ca54502fa..000000000 --- a/icinga-studio/connectform.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) * - * * - * 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 2 * - * 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, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#ifndef CONNECTFORM_H -#define CONNECTFORM_H - -#include "remote/url.hpp" -#include "icinga-studio/forms.h" - -namespace icinga -{ - -class ConnectForm final : public ConnectFormBase -{ -public: - ConnectForm(wxWindow *parent, const Url::Ptr& url); - - Url::Ptr GetUrl() const; -}; - -} - -#endif /* CONNECTFORM_H */ diff --git a/icinga-studio/forms.cpp b/icinga-studio/forms.cpp deleted file mode 100644 index afe31d6d0..000000000 --- a/icinga-studio/forms.cpp +++ /dev/null @@ -1,239 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 17 2015) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "forms.h" - -#include "icinga.xpm" - -/////////////////////////////////////////////////////////////////////////// - -MainFormBase::MainFormBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxSize( 800,569 ), wxDefaultSize ); - - m_MenuBar = new wxMenuBar( 0 ); - wxMenu* m_FileMenu; - m_FileMenu = new wxMenu(); - wxMenuItem* m_QuitMenuItem; - m_QuitMenuItem = new wxMenuItem( m_FileMenu, wxID_EXIT, wxString( wxT("&Quit") ) , wxEmptyString, wxITEM_NORMAL ); - m_FileMenu->Append( m_QuitMenuItem ); - - m_MenuBar->Append( m_FileMenu, wxT("&File") ); - - wxMenu* m_HelpMenu; - m_HelpMenu = new wxMenu(); - wxMenuItem* m_AboutMenuItem; - m_AboutMenuItem = new wxMenuItem( m_HelpMenu, wxID_ABOUT, wxString( wxT("&About Icinga Studio...") ) , wxEmptyString, wxITEM_NORMAL ); - m_HelpMenu->Append( m_AboutMenuItem ); - - m_MenuBar->Append( m_HelpMenu, wxT("&Help") ); - - this->SetMenuBar( m_MenuBar ); - - wxBoxSizer* m_DialogSizer; - m_DialogSizer = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* m_ConnectionDetailsSizer; - m_ConnectionDetailsSizer = new wxBoxSizer( wxHORIZONTAL ); - - m_TypesTree = new wxTreeCtrl( this, wxID_ANY, wxDefaultPosition, wxSize( 315,-1 ), wxTR_DEFAULT_STYLE|wxTR_HIDE_ROOT ); - m_ConnectionDetailsSizer->Add( m_TypesTree, 0, wxALL|wxEXPAND, 2 ); - - wxBoxSizer* m_ObjectDetailsSizer; - m_ObjectDetailsSizer = new wxBoxSizer( wxVERTICAL ); - - m_ObjectsList = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT ); - m_ObjectDetailsSizer->Add( m_ObjectsList, 1, wxALL|wxEXPAND, 2 ); - - m_PropertyGrid = new wxPropertyGrid(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxPG_DEFAULT_STYLE); - m_ObjectDetailsSizer->Add( m_PropertyGrid, 1, wxALL|wxEXPAND, 5 ); - - - m_ConnectionDetailsSizer->Add( m_ObjectDetailsSizer, 1, wxEXPAND, 5 ); - - - m_DialogSizer->Add( m_ConnectionDetailsSizer, 1, wxEXPAND, 5 ); - - - this->SetSizer( m_DialogSizer ); - this->Layout(); - m_StatusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( m_QuitMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFormBase::OnQuitClicked ) ); - this->Connect( m_AboutMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFormBase::OnAboutClicked ) ); - m_TypesTree->Connect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( MainFormBase::OnTypeSelected ), nullptr, this ); - m_ObjectsList->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( MainFormBase::OnObjectSelected ), nullptr, this ); -} - -MainFormBase::~MainFormBase() -{ - // Disconnect Events - this->Disconnect( wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFormBase::OnQuitClicked ) ); - this->Disconnect( wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFormBase::OnAboutClicked ) ); - m_TypesTree->Disconnect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( MainFormBase::OnTypeSelected ), nullptr, this ); - m_ObjectsList->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( MainFormBase::OnObjectSelected ), nullptr, this ); - -} - -ConnectFormBase::ConnectFormBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* m_DialogSizer; - m_DialogSizer = new wxBoxSizer( wxVERTICAL ); - - wxPanel* m_ConnectionDetailsPanel; - m_ConnectionDetailsPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxStaticBoxSizer* m_DetailsSizer; - m_DetailsSizer = new wxStaticBoxSizer( new wxStaticBox( m_ConnectionDetailsPanel, wxID_ANY, wxT("Connection Details") ), wxVERTICAL ); - - wxStaticText* m_HostLabel; - m_HostLabel = new wxStaticText( m_DetailsSizer->GetStaticBox(), wxID_ANY, wxT("Host:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_HostLabel->Wrap( -1 ); - m_DetailsSizer->Add( m_HostLabel, 0, wxALL, 5 ); - - m_HostText = new wxTextCtrl( m_DetailsSizer->GetStaticBox(), wxID_OK, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_DetailsSizer->Add( m_HostText, 0, wxALL|wxEXPAND, 5 ); - - wxStaticText* m_PortLabel; - m_PortLabel = new wxStaticText( m_DetailsSizer->GetStaticBox(), wxID_ANY, wxT("Port:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_PortLabel->Wrap( -1 ); - m_DetailsSizer->Add( m_PortLabel, 0, wxALL, 5 ); - - m_PortText = new wxTextCtrl( m_DetailsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_DetailsSizer->Add( m_PortText, 0, wxALL, 5 ); - - wxStaticText* m_UserLabel; - m_UserLabel = new wxStaticText( m_DetailsSizer->GetStaticBox(), wxID_ANY, wxT("API User:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_UserLabel->Wrap( -1 ); - m_DetailsSizer->Add( m_UserLabel, 0, wxALL, 5 ); - - m_UserText = new wxTextCtrl( m_DetailsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_DetailsSizer->Add( m_UserText, 0, wxALL|wxEXPAND, 5 ); - - wxStaticText* m_PasswordLabel; - m_PasswordLabel = new wxStaticText( m_DetailsSizer->GetStaticBox(), wxID_ANY, wxT("API Password:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_PasswordLabel->Wrap( -1 ); - m_DetailsSizer->Add( m_PasswordLabel, 0, wxALL, 5 ); - - m_PasswordText = new wxTextCtrl( m_DetailsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD ); - m_DetailsSizer->Add( m_PasswordText, 0, wxALL|wxEXPAND, 5 ); - - wxStaticText* m_InfoLabel; - m_InfoLabel = new wxStaticText( m_DetailsSizer->GetStaticBox(), wxID_ANY, wxT("You can find the username and password for the default user in /etc/icinga2/conf.d/api-users.conf."), wxDefaultPosition, wxDefaultSize, 0 ); - m_InfoLabel->Wrap( 270 ); - m_DetailsSizer->Add( m_InfoLabel, 0, wxALL, 5 ); - - - m_ConnectionDetailsPanel->SetSizer( m_DetailsSizer ); - m_ConnectionDetailsPanel->Layout(); - m_DetailsSizer->Fit( m_ConnectionDetailsPanel ); - m_DialogSizer->Add( m_ConnectionDetailsPanel, 1, wxEXPAND | wxALL, 5 ); - - wxPanel* m_ButtonsPanel; - m_ButtonsPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* m_ButtonsSizer; - m_ButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); - - m_Buttons = new wxStdDialogButtonSizer(); - m_ButtonsOK = new wxButton( m_ButtonsPanel, wxID_OK ); - m_Buttons->AddButton( m_ButtonsOK ); - m_ButtonsCancel = new wxButton( m_ButtonsPanel, wxID_CANCEL ); - m_Buttons->AddButton( m_ButtonsCancel ); - m_Buttons->Realize(); - - m_ButtonsSizer->Add( m_Buttons, 1, wxEXPAND, 5 ); - - - m_ButtonsPanel->SetSizer( m_ButtonsSizer ); - m_ButtonsPanel->Layout(); - m_ButtonsSizer->Fit( m_ButtonsPanel ); - m_DialogSizer->Add( m_ButtonsPanel, 0, wxEXPAND | wxALL, 5 ); - - - this->SetSizer( m_DialogSizer ); - this->Layout(); - m_DialogSizer->Fit( this ); - - this->Centre( wxBOTH ); -} - -ConnectFormBase::~ConnectFormBase() -{ -} - -AboutFormBase::AboutFormBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* m_DialogSizer; - m_DialogSizer = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* m_InfoSizer; - m_InfoSizer = new wxBoxSizer( wxHORIZONTAL ); - - wxStaticBitmap* m_ProductIcon; - m_ProductIcon = new wxStaticBitmap( this, wxID_ANY, wxBitmap( icinga_xpm ), wxDefaultPosition, wxDefaultSize, 0 ); - m_InfoSizer->Add( m_ProductIcon, 0, wxALL, 5 ); - - wxBoxSizer* m_AboutInfoSizer; - m_AboutInfoSizer = new wxBoxSizer( wxVERTICAL ); - - wxStaticText* m_ProductNameLabel; - m_ProductNameLabel = new wxStaticText( this, wxID_ANY, wxT("Icinga Studio"), wxDefaultPosition, wxDefaultSize, 0 ); - m_ProductNameLabel->Wrap( -1 ); - m_AboutInfoSizer->Add( m_ProductNameLabel, 0, wxALL, 5 ); - - m_VersionLabel = new wxStaticText( this, wxID_ANY, wxT("Version"), wxDefaultPosition, wxDefaultSize, 0 ); - m_VersionLabel->Wrap( -1 ); - m_AboutInfoSizer->Add( m_VersionLabel, 0, wxALL, 5 ); - - wxStaticText* m_CopyrightLabel; - m_CopyrightLabel = new wxStaticText( this, wxID_ANY, wxT("Copyright (c) 2015 Icinga Development Team"), wxDefaultPosition, wxDefaultSize, 0 ); - m_CopyrightLabel->Wrap( -1 ); - m_AboutInfoSizer->Add( m_CopyrightLabel, 0, wxALL, 5 ); - - - m_InfoSizer->Add( m_AboutInfoSizer, 1, wxEXPAND, 5 ); - - - m_DialogSizer->Add( m_InfoSizer, 1, wxEXPAND, 5 ); - - wxPanel* m_ButtonsPanel; - m_ButtonsPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* m_ButtonsSizer; - m_ButtonsSizer = new wxBoxSizer( wxVERTICAL ); - - wxStdDialogButtonSizer* m_Buttons; - wxButton* m_ButtonsOK; - m_Buttons = new wxStdDialogButtonSizer(); - m_ButtonsOK = new wxButton( m_ButtonsPanel, wxID_OK ); - m_Buttons->AddButton( m_ButtonsOK ); - m_Buttons->Realize(); - - m_ButtonsSizer->Add( m_Buttons, 0, wxEXPAND, 5 ); - - - m_ButtonsPanel->SetSizer( m_ButtonsSizer ); - m_ButtonsPanel->Layout(); - m_ButtonsSizer->Fit( m_ButtonsPanel ); - m_DialogSizer->Add( m_ButtonsPanel, 0, wxEXPAND | wxALL, 5 ); - - - this->SetSizer( m_DialogSizer ); - this->Layout(); - m_DialogSizer->Fit( this ); - - this->Centre( wxBOTH ); -} - -AboutFormBase::~AboutFormBase() -{ -} diff --git a/icinga-studio/forms.h b/icinga-studio/forms.h deleted file mode 100644 index f01f5b904..000000000 --- a/icinga-studio/forms.h +++ /dev/null @@ -1,108 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 17 2015) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __FORMS_H__ -#define __FORMS_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -/// Class MainFormBase -/////////////////////////////////////////////////////////////////////////////// -class MainFormBase : public wxFrame -{ - private: - - protected: - wxMenuBar* m_MenuBar; - wxTreeCtrl* m_TypesTree; - wxListCtrl* m_ObjectsList; - wxPropertyGrid* m_PropertyGrid; - wxStatusBar* m_StatusBar; - - // Virtual event handlers, overide them in your derived class - virtual void OnQuitClicked( wxCommandEvent& event ) { event.Skip(); } - virtual void OnAboutClicked( wxCommandEvent& event ) { event.Skip(); } - virtual void OnTypeSelected( wxTreeEvent& event ) { event.Skip(); } - virtual void OnObjectSelected( wxListEvent& event ) { event.Skip(); } - - - public: - - MainFormBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Icinga Studio"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800,569 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); - - ~MainFormBase() override; - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class ConnectFormBase -/////////////////////////////////////////////////////////////////////////////// -class ConnectFormBase : public wxDialog -{ - private: - - protected: - wxTextCtrl* m_HostText; - wxTextCtrl* m_PortText; - wxTextCtrl* m_UserText; - wxTextCtrl* m_PasswordText; - wxStdDialogButtonSizer* m_Buttons; - wxButton* m_ButtonsOK; - wxButton* m_ButtonsCancel; - - public: - - ConnectFormBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Icinga Studio - Connect"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); - ~ConnectFormBase() override; - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class AboutFormBase -/////////////////////////////////////////////////////////////////////////////// -class AboutFormBase : public wxDialog -{ - private: - - protected: - wxStaticText* m_VersionLabel; - - public: - - AboutFormBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("About Icinga Studio"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); - ~AboutFormBase() override; - -}; - -#endif //__FORMS_H__ diff --git a/icinga-studio/icinga-studio.cpp b/icinga-studio/icinga-studio.cpp deleted file mode 100644 index d6e85662f..000000000 --- a/icinga-studio/icinga-studio.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) * - * * - * 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 2 * - * 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, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#include "icinga-studio/connectform.hpp" -#include "icinga-studio/mainform.hpp" -#include "base/application.hpp" -#include -#include -#include - -using namespace icinga; - -class IcingaStudio final : public wxApp -{ -public: - bool OnInit() override - { - Application::InitializeBase(); - - Url::Ptr pUrl; - - if (argc < 2) { - wxConfig config("IcingaStudio"); - wxString wUrl; - - if (!config.Read("url", &wUrl)) - wUrl = "https://localhost:5665/"; - - std::string url = wUrl.ToStdString(); - - ConnectForm f(nullptr, new Url(url)); - if (f.ShowModal() != wxID_OK) - return false; - - pUrl = f.GetUrl(); - url = pUrl->Format(false, true); - wUrl = url; - config.Write("url", wUrl); - } else { - pUrl = new Url(argv[1].ToStdString()); - } - - auto *m = new MainForm(nullptr, pUrl); - m->Show(); - - return true; - } -}; - -wxIMPLEMENT_APP(IcingaStudio); diff --git a/icinga-studio/icinga.icns b/icinga-studio/icinga.icns deleted file mode 100644 index d0968703b..000000000 Binary files a/icinga-studio/icinga.icns and /dev/null differ diff --git a/icinga-studio/icinga.ico b/icinga-studio/icinga.ico deleted file mode 100644 index 6ff7e9029..000000000 Binary files a/icinga-studio/icinga.ico and /dev/null differ diff --git a/icinga-studio/icinga.rc b/icinga-studio/icinga.rc deleted file mode 100644 index 554dd6e42..000000000 --- a/icinga-studio/icinga.rc +++ /dev/null @@ -1,34 +0,0 @@ -#include -#include "icinga-version.h" - -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -icinga ICON "icinga.ico" - -VS_VERSION_INFO VERSIONINFO -FILEVERSION 1,0,0,0 -PRODUCTVERSION 1,0,0,0 -FILEOS VOS__WINDOWS32 -FILETYPE VFT_APP -FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904E4" - BEGIN - VALUE "CompanyName", "Icinga Development Team" - VALUE "FileDescription", "Icinga Studio" - VALUE "FileVersion", VERSION - VALUE "InternalName", "icinga-studio.exe" - VALUE "LegalCopyright", "© Icinga Development Team" - VALUE "OriginalFilename", "icinga-studio.exe" - VALUE "ProductName", "Icinga 2" - VALUE "ProductVersion", VERSION - END - END - - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 0x04E4 - END -END \ No newline at end of file diff --git a/icinga-studio/icinga.xpm b/icinga-studio/icinga.xpm deleted file mode 100644 index 271363db7..000000000 --- a/icinga-studio/icinga.xpm +++ /dev/null @@ -1,40 +0,0 @@ -/* XPM */ -static const char *icinga_xpm[] = { -"32 32 5 1", -" c None", -". c #808080", -"+ c #000000", -"@ c #C0C0C0", -"# c #FFFFFF", -" ", -" .++++++++++++++++++++++++. ", -" .+++++++++++++++..+++++++++. ", -" .+++++++++++++++@##@+++++++++. ", -" +++++++++++++++.####.+++++++++ ", -" +++++++++++++++.####.+++++++++ ", -" ++++++++++++++++####++++++++++ ", -" ++++++++++++++++@@..++++++++++ ", -" +++++..+++++++++#.++++++++++++ ", -" ++++.##@+++++++@#+++++++++++++ ", -" ++++.###+++++++#.+++++++++.+++ ", -" ++++.###@++.@@@#+++++++++@##.+ ", -" +++++++.@#######.+++++++.###@+ ", -" +++++++++########++++..@####.+ ", -" ++++++++.########@@###@...@.++ ", -" ++++++++.#########@..+++++++++ ", -" ++++++++.########@++++++++++++ ", -" ++++++++.########.++++++++++++ ", -" +++++++++########+++++++++++++ ", -" +++++++++.######.+++++++++++++ ", -" +++++++++.#....#.+++++++++++++ ", -" ++++++++.#.++++.#.++++++++++++ ", -" ++++++++@@++++++##.+++++++++++ ", -" ++++@##@#+++++++##@+++++++++++ ", -" +++@####@+++++++..++++++++++++ ", -" +++######.++++++++++++++++++++ ", -" +++######.++++++++++++++++++++ ", -" +++######+++++++++++++++++++++ ", -" .++.####.++++++++++++++++++++. ", -" .+++..+++++++++++++++++++++. ", -" .++++++++++++++++++++++++. ", -" "}; diff --git a/icinga-studio/mainform.cpp b/icinga-studio/mainform.cpp deleted file mode 100644 index 64ec975db..000000000 --- a/icinga-studio/mainform.cpp +++ /dev/null @@ -1,316 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) * - * * - * 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 2 * - * 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, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#include "icinga-studio/mainform.hpp" -#include "icinga-studio/aboutform.hpp" -#include -#include -#include - -using namespace icinga; - -MainForm::MainForm(wxWindow *parent, const Url::Ptr& url) - : MainFormBase(parent) -{ -#ifdef _WIN32 - SetIcon(wxICON(icinga)); - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); -#endif /* _WIN32 */ - - String port = url->GetPort(); - - if (port.IsEmpty()) - port = "5665"; - - m_ApiClient = new ApiClient(url->GetHost(), port, url->GetUsername(), url->GetPassword()); - m_ApiClient->GetTypes(std::bind(&MainForm::TypesCompletionHandler, this, _1, _2, true)); - - std::string title = url->Format() + " - Icinga Studio"; - SetTitle(title); - - m_ObjectsList->InsertColumn(0, "Name", 0, 300); - - m_PropertyGrid->SetColumnCount(3); -} - -void MainForm::TypesCompletionHandler(boost::exception_ptr eptr, const std::vector& types, bool forward) -{ - if (forward) { - CallAfter(std::bind(&MainForm::TypesCompletionHandler, this, eptr, types, false)); - return; - } - - m_TypesTree->DeleteAllItems(); - - if (eptr) { - try { - boost::rethrow_exception(eptr); - } catch (const std::exception& ex) { - std::string message = "HTTP query failed: " + std::string(ex.what()); - wxMessageBox(message, "Icinga Studio", wxOK | wxCENTRE | wxICON_ERROR, this); - Close(); - return; - } - } - - wxTreeItemId rootNode = m_TypesTree->AddRoot("root"); - - for (const ApiType::Ptr& type : types) { - m_Types[type->Name] = type; - } - - for (const ApiType::Ptr& type : types) { - if (type->Abstract) - continue; - - bool configObject = false; - ApiType::Ptr currentType = type; - - for (;;) { - if (currentType->BaseName.IsEmpty()) - break; - - currentType = m_Types[currentType->BaseName]; - - if (!currentType) - break; - - if (currentType->Name == "ConfigObject") { - configObject = true; - break; - } - } - - if (configObject) { - std::string name = type->Name; - m_TypesTree->AppendItem(rootNode, name, 0); - } - } -} - -void MainForm::OnTypeSelected(wxTreeEvent& event) -{ - wxTreeItemId selectedId = m_TypesTree->GetSelection(); - wxString typeName = m_TypesTree->GetItemText(selectedId); - ApiType::Ptr type = m_Types[typeName.ToStdString()]; - - std::vector attrs; - attrs.emplace_back("__name"); - - m_ApiClient->GetObjects(type->PluralName, std::bind(&MainForm::ObjectsCompletionHandler, this, _1, _2, true), - std::vector(), attrs); -} - -static bool ApiObjectLessComparer(const ApiObject::Ptr& o1, const ApiObject::Ptr& o2) -{ - return o1->Name < o2->Name; -} - -void MainForm::ObjectsCompletionHandler(boost::exception_ptr eptr, const std::vector& objects, bool forward) -{ - if (forward) { - CallAfter(std::bind(&MainForm::ObjectsCompletionHandler, this, eptr, objects, false)); - return; - } - - m_ObjectsList->DeleteAllItems(); - m_PropertyGrid->Clear(); - - if (eptr) { - try { - boost::rethrow_exception(eptr); - } catch (const std::exception& ex) { - std::string message = "HTTP query failed: " + std::string(ex.what()); - wxMessageBox(message, "Icinga Studio", wxOK | wxCENTRE | wxICON_ERROR, this); - return; - } - } - - std::vector sortedObjects = objects; - std::sort(sortedObjects.begin(), sortedObjects.end(), ApiObjectLessComparer); - - for (const ApiObject::Ptr& object : sortedObjects) { - std::string name = object->Name; - m_ObjectsList->InsertItem(0, name); - } -} - -void MainForm::OnObjectSelected(wxListEvent& event) -{ - wxTreeItemId selectedId = m_TypesTree->GetSelection(); - wxString typeName = m_TypesTree->GetItemText(selectedId); - ApiType::Ptr type = m_Types[typeName.ToStdString()]; - - long itemIndex = -1; - std::string objectName; - - while ((itemIndex = m_ObjectsList->GetNextItem(itemIndex, - wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED)) != wxNOT_FOUND) { - objectName = m_ObjectsList->GetItemText(itemIndex); - break; - } - - if (objectName.empty()) - return; - - std::vector names; - names.emplace_back(objectName); - - m_ApiClient->GetObjects(type->PluralName, std::bind(&MainForm::ObjectDetailsCompletionHandler, this, _1, _2, true), - names, std::vector(), std::vector(), true); -} - -wxPGProperty *MainForm::ValueToProperty(const String& name, const Value& value) -{ - wxPGProperty *prop; - - if (value.IsNumber()) { - prop = new wxFloatProperty(name.GetData(), wxPG_LABEL, value); - prop->SetAttribute(wxPG_ATTR_UNITS, "Number"); - return prop; - } else if (value.IsBoolean()) { - prop = new wxBoolProperty(name.GetData(), wxPG_LABEL, value); - prop->SetAttribute(wxPG_ATTR_UNITS, "Boolean"); - return prop; - } else if (value.IsObjectType()) { - wxArrayString val; - Array::Ptr arr = value; - - { - ObjectLock olock(arr); - for (const Value& aitem : arr) { - String val1 = aitem; - val.Add(val1.GetData()); - } - } - - prop = new wxArrayStringProperty(name.GetData(), wxPG_LABEL, val); - prop->SetAttribute(wxPG_ATTR_UNITS, "Array"); - return prop; - } else if (value.IsObjectType()) { - wxStringProperty *prop = new wxStringProperty(name.GetData(), wxPG_LABEL); - - Dictionary::Ptr dict = value; - - { - ObjectLock olock(dict); - for (const Dictionary::Pair& kv : dict) { - if (kv.first != "type") - prop->AppendChild(ValueToProperty(kv.first, kv.second)); - } - } - - String type = "Dictionary"; - - if (dict->Contains("type")) - type = dict->Get("type"); - - prop->SetAttribute(wxPG_ATTR_UNITS, type.GetData()); - - return prop; - } else if (value.IsEmpty() && !value.IsString()) { - prop = new wxStringProperty(name.GetData(), wxPG_LABEL, ""); - prop->SetAttribute(wxPG_ATTR_UNITS, "Empty"); - return prop; - } else { - String val = value; - prop = new wxStringProperty(name.GetData(), wxPG_LABEL, val.GetData()); - prop->SetAttribute(wxPG_ATTR_UNITS, "String"); - return prop; - } -} - -void MainForm::ObjectDetailsCompletionHandler(boost::exception_ptr eptr, const std::vector& objects, bool forward) -{ - if (forward) { - CallAfter(std::bind(&MainForm::ObjectDetailsCompletionHandler, this, eptr, objects, false)); - return; - } - - m_PropertyGrid->Clear(); - - if (eptr) { - try { - boost::rethrow_exception(eptr); - } catch (const std::exception& ex) { - std::string message = "HTTP query failed: " + std::string(ex.what()); - wxMessageBox(message, "Icinga Studio", wxOK | wxCENTRE | wxICON_ERROR, this); - } - } - - wxTreeItemId selectedId = m_TypesTree->GetSelection(); - wxString typeName = m_TypesTree->GetItemText(selectedId); - ApiType::Ptr type = m_Types[typeName.ToStdString()]; - - String nameAttr = type->Name.ToLower() + ".__name"; - - if (objects.empty()) - return; - - ApiObject::Ptr object = objects[0]; - - std::map parents; - - for (const auto& kv : object->Attrs) { - std::vector tokens; - boost::algorithm::split(tokens, kv.first, boost::is_any_of(".")); - - std::map::const_iterator it = parents.find(tokens[0]); - - wxStringProperty *parent; - - if (it == parents.end()) { - parent = new wxStringProperty(tokens[0].GetData(), wxPG_LABEL); - parent->SetAttribute(wxPG_ATTR_UNITS, "Object"); - parents[tokens[0]] = parent; - } else - parent = it->second; - - wxPGProperty *prop = ValueToProperty(tokens[1], kv.second); - parent->AppendChild(prop); - } - - /* Make sure the property node for the real object (as opposed to joined objects) is the first one */ - String propName = type->Name.ToLower(); - wxStringProperty *objProp = parents[propName]; - - if (objProp) { - m_PropertyGrid->Append(objProp); - m_PropertyGrid->SetPropertyReadOnly(objProp); - parents.erase(propName); - } - - for (const auto& kv : parents) { - m_PropertyGrid->Append(kv.second); - m_PropertyGrid->SetPropertyReadOnly(kv.second); - } - - m_PropertyGrid->FitColumns(); -} - -void MainForm::OnQuitClicked(wxCommandEvent& event) -{ - Close(); -} - -void MainForm::OnAboutClicked(wxCommandEvent& event) -{ - AboutForm form(this); - form.ShowModal(); -} diff --git a/icinga-studio/mainform.hpp b/icinga-studio/mainform.hpp deleted file mode 100644 index 0e8363206..000000000 --- a/icinga-studio/mainform.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** - * Icinga 2 * - * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) * - * * - * 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 2 * - * 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, write to the Free Software Foundation * - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * - ******************************************************************************/ - -#ifndef MAINFORM_H -#define MAINFORM_H - -#include "remote/apiclient.hpp" -#include "remote/url.hpp" -#include "base/exception.hpp" -#include "icinga-studio/forms.h" - -namespace icinga -{ - -class MainForm final : public MainFormBase -{ -public: - MainForm(wxWindow *parent, const Url::Ptr& url); - - void OnQuitClicked(wxCommandEvent& event) override; - void OnAboutClicked(wxCommandEvent& event) override; - void OnTypeSelected(wxTreeEvent& event) override; - void OnObjectSelected(wxListEvent& event) override; - -private: - ApiClient::Ptr m_ApiClient; - std::map m_Types; - - void TypesCompletionHandler(boost::exception_ptr eptr, const std::vector& types, bool forward); - void ObjectsCompletionHandler(boost::exception_ptr eptr, const std::vector& objects, bool forward); - void ObjectDetailsCompletionHandler(boost::exception_ptr eptr, const std::vector& objects, bool forward); - - wxPGProperty *ValueToProperty(const String& name, const Value& value); -}; - -} - -#endif /* MAINFORM_H */