GridFSFileEditorWidgetController.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package MemoryX::gui-plugins::GridFSFileEditorWidgetController
19  * @author Mirko Waechter (waechter at kit dot edu)
20  * @date 2014
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #pragma once
26 
27 #include <MemoryX/gui-plugins/GridFSFileEditor/ui_GridFSFileEditorWidget.h>
28 
30 
33 
34 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
35 #include <MemoryX/interface/components/LongtermMemoryInterface.h>
36 
37 namespace armarx
38 {
57  public ArmarXComponentWidgetControllerTemplate<GridFSFileEditorWidgetController>
58  {
59  Q_OBJECT
60 
61  public:
66 
71 
75  void loadSettings(QSettings* settings) override;
76 
80  void saveSettings(QSettings* settings) override;
81 
86  static QString GetWidgetName()
87  {
88  return "MemoryX.GridFSFileEditor";
89  }
90  static QIcon GetWidgetIcon()
91  {
92  return QIcon {"://icons/server.svg"};
93  }
94 
100  void onInitComponent() override;
101 
108  void onConnectComponent() override;
109 
115  void onDisconnectComponent() override;
116 
117  public slots:
118  /* QT slot declarations */
119 
120  void loadFileNames(QString dbName = "");
121  void loadFileContent(const QString& fileName);
122  void saveContentToFile();
123  void deleteUnreferencedFiles();
124 
125  private slots:
126  signals:
127  /* QT signal declarations */
128  void connected();
129  private:
133  void connectSlots();
134 
135  void replaceFileDocID(QString fileId, const QString& newId);
136 
137  std::string whereQuery(std::string fileId) const;
141  Ui::GridFSFileEditorWidget widget;
142 
146  memoryx::CommonStorageInterfacePrx commonStoragePrx;
147  std::string dbName;
148  QString currentId;
149  };
150 }
151 
armarx::ArmarXComponentWidgetControllerTemplate
Definition: ArmarXComponentWidgetController.h:69
ArmarXGuiPlugin.h
newId
auto newId
Definition: GraspingManager.cpp:90
ArmarXComponentWidgetController.h
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx::GridFSFileEditorWidgetController::GetWidgetIcon
static QIcon GetWidgetIcon()
Definition: GridFSFileEditorWidgetController.h:90
armarx::GridFSFileEditorWidgetController
This widget allows viewing files that are referenced in the prior knowledge database.
Definition: GridFSFileEditorWidgetController.h:55
armarx::GridFSFileEditorWidgetController::GetWidgetName
static QString GetWidgetName()
Returns the Widget name displayed in the ArmarXGui to create an instance of this class.
Definition: GridFSFileEditorWidgetController.h:86
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
ImportExportComponent.h