Permalink
Browse files

Several changes

  • Loading branch information...
bmcdorman committed Aug 13, 2012
1 parent f8397cd commit a86ffde0913fc8c45a77722c486cd6008130553e
@@ -1,47 +0,0 @@
-#ifndef _COMMUNICATIONQUEUE_H_
-#define _COMMUNICATIONQUEUE_H_
-
-#include <QQueue>
-#include <QString>
-#include <QByteArray>
-#include <QSharedPointer>
-
-class TinyArchive;
-
-class CommunicationEntry
-{
-public:
- enum Type {
- Unknown = 0,
- Download,
- Compile,
- Run,
- Authenticate,
- Disconnect,
- Custom
- };
-
- CommunicationEntry(const Type& type);
- CommunicationEntry(const Type& type, const QString& name, TinyArchive *archive = 0);
- CommunicationEntry(const QString& custom, const QByteArray& payload = QByteArray());
-
- const CommunicationEntry::Type& type() const;
- const QString& custom() const;
- const QByteArray& payload() const;
- const QString& name() const;
- TinyArchive *archive() const;
-private:
- CommunicationEntry(const CommunicationEntry& rhs);
- CommunicationEntry& operator=(const CommunicationEntry& rhs);
-
- Type m_type;
- QString m_name;
- QString m_custom;
- QByteArray m_payload;
- TinyArchive *m_archive;
-};
-
-typedef QSharedPointer<CommunicationEntry> CommunicationEntryPtr;
-typedef QQueue<CommunicationEntryPtr> CommunicationQueue;
-
-#endif
View
@@ -1,77 +0,0 @@
-/**************************************************************************
- * Copyright 2007-2012 KISS Institute for Practical Robotics *
- * *
- * This file is part of KISS (Kipr's Instructional Software System). *
- * *
- * KISS 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. *
- * *
- * KISS 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 KISS. Check the LICENSE file in the project root. *
- * If not, see <http://www.gnu.org/licenses/>. *
- **************************************************************************/
-
-#ifndef __KISSARCHIVE_H__
-#define __KISSARCHIVE_H__
-
-#include <QStringList>
-#include <QIODevice>
-
-#define KISS_ARCHIVE_VERSION 1
-#define KISS_ARCHIVE_FILE "installed"
-
-/*! \struct KissReturn
- * \brief Holds a KissArchive command return value
- */
-struct KissReturn
-{
- KissReturn(const bool& error, const QString& message = "") : error(error), message(message) {}
-
- /*! True if error occurred */
- bool error;
- /*! Holds message of error if an error occurred */
- QString message;
-};
-
-/*! \class KissArchive
- * \brief Holds methods to manipulate Kiss Archives
- */
-class KissArchive
-{
-public:
- /*!
- * Creates a kiss archive
- * \param name Name of Package
- * \param version Version of Package, for upgrades
- * \param platforms 3 character code for platform(s) "osx", "win", "nix"
- * \param files files, relatived
- * \param out Output IODevice
- * \return see KissReturn
- *//*!
- * Installs a kiss archive. Stores information in file called "installed"
- * \param in kiss archive pointer
- * \return see KissReturn
- */
- static KissReturn create(const QString& name, unsigned version,
- const QStringList& platforms, const QStringList& files,
- QIODevice* out);
- /*!
- * Installs a kiss archive. Stores information in file called "installed"
- * \param in kiss archive pointer
- * \return see KissReturn
- */
- static KissReturn install(QIODevice* in);
- static KissReturn uninstall(const QString& name);
- static QStringList list(QIODevice* in);
- static const unsigned version(const QString& name);
- static QStringList installed();
-};
-
-#endif
View
@@ -173,8 +173,11 @@ public slots:
bool closeNode(const TinyNode* node);
void about();
void settings();
- void managePackages();
- void installLocalPackage();
+
+ void projectAddNew();
+ void projectAddExisting();
+ void projectRemoveExisting();
+ void projectExtractTo();
void showProjectDock(bool show = true);
void hideProjectDock();
View
@@ -1,15 +0,0 @@
-#ifndef _QUSERINFO_H_
-#define _QUSERINFO_H_
-
-#include <QString>
-
-class QUserInfo
-{
-public:
- static QString username();
-
-private:
-
-};
-
-#endif
View
@@ -1,81 +0,0 @@
-/**************************************************************************
- * Copyright 2007-2012 KISS Institute for Practical Robotics *
- * *
- * This file is part of KISS (Kipr's Instructional Software System). *
- * *
- * KISS 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. *
- * *
- * KISS 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 KISS. Check the LICENSE file in the project root. *
- * If not, see <http://www.gnu.org/licenses/>. *
- **************************************************************************/
-
-#ifndef __REPOSITORY_H__
-#define __REPOSITORY_H__
-
-#include "BuildOptions.h"
-
-#include <QObject>
-
-class Repository;
-
-#ifdef BUILD_REPOSITORY_TAB
-
-#include "ui_Repository.h"
-#include "Tab.h"
-
-#include <QWidget>
-#include <QMenu>
-#include <QMenuBar>
-#include <QToolBar>
-#include <QNetworkReply>
-#include <QNetworkAccessManager>
-
-class MainWindow;
-
-class Repository : public QWidget, public TabbedWidget, private Ui::Repository
-{
- Q_OBJECT
-public:
- Repository(MainWindow* parent = 0);
-
- void activate();
-
- bool beginSetup();
- void completeSetup();
-
- bool close();
-
-public slots:
- void refreshSettings();
-
-private slots:
- void on_ui_mark_clicked();
- void on_ui_unmark_clicked();
- void on_ui_uninstall_clicked();
- void on_ui_begin_clicked();
- void on_ui_source_clicked();
-
- void downloadProgress(qint64, qint64);
-
- void finished(QNetworkReply* reply);
- void downloadFinished(QNetworkReply* reply);
-private:
- void next();
-
- QNetworkAccessManager m_network;
- QMap<QString, QString> m_locations;
- QString m_source;
-};
-
-#endif
-
-#endif
@@ -36,11 +36,14 @@ class TemplateManager : public Singleton<TemplateManager>
QStringList templates(const QString& type, const QString& _template);
QIcon templateIcon(const QString& type, const QString& _template);
- QStringList userTemplates(const QString& type);
+
bool addUserTemplate(const QString& type, const QString& name, const QString& content);
bool deleteUserTemplate(const QString& type, const QString& name);
+ QStringList userTemplateTypes() const;
+ QStringList userTemplates(const QString& type);
QString pathForUserTemplate(const QString& type, const QString& _template);
+
QString pathForTemplate(const QString& type, const QString& _template);
bool isTemplateDirectory(const QString& type, const QString& _template);
@@ -11,6 +11,9 @@ Q_OBJECT
virtual void compileResponse(Target *target, CompileResult results);
virtual void downloadResponse(Target *target, bool success);
virtual void runResponse(Target *target, bool success);
+ virtual void listResponse(Target *target, const QStringList& programs);
+ virtual void deleteResponse(Target *target, bool success);
+ virtual void interactionResponse(Target *target, const QString& ret);
virtual void unknownResponse(Target *target, const QByteArray& payload);
virtual void customResponse(Target *target, const QString& type, const QByteArray& payload);
virtual void communicationError(Target *target);
@@ -23,6 +26,9 @@ Q_OBJECT
void compileFinished(CompileResult results);
void downloadFinished(bool success);
void runFinished(bool success);
+ void listFinished(const QStringList& programs);
+ void deleteFinished(bool success);
+ void interactionFinished(const QString& ret);
void customFinished(const QString& type, const QByteArray& payload);
void unknownFinished(const QByteArray& payload);
void communicationError();
@@ -3,7 +3,7 @@
#include "Named.h"
#include "CommunicationQueue.h"
-#include <TinyArchive.h>
+#include <tinyarchive.hpp>
#include <kiss-compiler/Compiler.h>
#include <QObject>
@@ -54,6 +54,11 @@ class Target
virtual const bool compile(const QString& name) = 0;
virtual const bool download(const QString& name, TinyArchive* archive) = 0;
virtual const bool run(const QString& name) = 0;
+
+ virtual const bool list() = 0;
+ virtual const bool deleteProgram(const QString& name) = 0;
+ virtual const bool interaction(const QString& command) = 0;
+
virtual const bool authenticate(const QByteArray& hash) = 0;
virtual const bool sendCustom(const QString& custom, const QByteArray& payload = QByteArray()) = 0;
@@ -19,6 +19,9 @@ class TargetResponder
virtual void compileResponse(Target *target, CompileResult results) = 0;
virtual void downloadResponse(Target *target, bool success) = 0;
virtual void runResponse(Target *target, bool success) = 0;
+ virtual void listResponse(Target *target, const QStringList& programs) = 0;
+ virtual void deleteResponse(Target *target, bool success) = 0;
+ virtual void interactionResponse(Target *target, const QString& ret) = 0;
virtual void unknownResponse(Target *target, const QByteArray& payload) = 0;
virtual void customResponse(Target *target, const QString& type, const QByteArray& payload) = 0;
virtual void communicationError(Target *target) = 0;
@@ -48,10 +48,10 @@ public slots:
void update();
private:
- MenuNode* addFile;
- MenuNode* deleteFile;
- MenuNode* extractFile;
- MenuNode* extractProject;
+ MenuNode* addExistingFile;
+ MenuNode* addNewFile;
+ MenuNode* removeExistingFile;
+ MenuNode* extractTo;
};
#endif
@@ -3,7 +3,7 @@
#include <QStandardItemModel>
#include <QMap>
-#include <TinyArchive.h>
+#include <tinyarchive.hpp>
class ProjectManager;
class Project;
@@ -5,6 +5,9 @@
#define COMPILE_KEY "compile"
#define DOWNLOAD_KEY "download"
#define RUN_KEY "run"
+#define LIST_KEY "list"
+#define DELETE_KEY "delete"
+#define INTERACTION_KEY "interaction"
#define LOCKED_KEY "locked"
#define AUTHENTICATE_KEY "authenticate"
Oops, something went wrong.

0 comments on commit a86ffde

Please sign in to comment.