Commit 9309055b by Belákovics Ádám

additions

parent 07e818f9
...@@ -11,10 +11,7 @@ struct ComputeData{ ...@@ -11,10 +11,7 @@ struct ComputeData{
int port; int port;
std::string username; std::string username;
std::string password; std::string password;
<<<<<<< HEAD
std::string connString; std::string connString;
=======
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
}; };
#endif // COMPUTEDATA #endif // COMPUTEDATA
......
<<<<<<< HEAD
#include "computewidget.h" #include "computewidget.h"
#include "ui_computewidget.h" #include "ui_computewidget.h"
...@@ -82,59 +81,3 @@ void ComputeWidget::stateChangedHandler(std::string newState, std::string _id){ ...@@ -82,59 +81,3 @@ void ComputeWidget::stateChangedHandler(std::string newState, std::string _id){
} }
=======
#include "computewidget.h"
#include "ui_computewidget.h"
ComputeWidget::ComputeWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::ComputeWidget)
{
ui->setupUi(this);
ui->lComputeIcon->setPixmap(QPixmap(":/new/icons/compute.png").scaled(80, 55, Qt::KeepAspectRatio));
}
void ComputeWidget::setID(std::string _id){
id = _id;
}
void ComputeWidget::setName(std::string _name){
name = _name;
ui->lHostName->setText(_name.c_str());
}
ComputeWidget::~ComputeWidget()
{
delete ui;
}
void ComputeWidget::on_bRenew_clicked()
{
emit renew(id);
}
void ComputeWidget::on_bStart_clicked()
{
emit start(id);
}
void ComputeWidget::on_bWakeUpSleep_clicked()
{
emit wakeupsleep(id);
}
void ComputeWidget::stateChangedHandler(std::string newState, std::string _id){
if(id == _id){ //check if we changed or not
if(newState == "suspended" || newState == "inactive"){
ui->bWakeUpSleep->setText("Wake up");
ui->bWakeUpSleep->setStyleSheet("background-color:green");
}
else if(newState == "active"){
ui->bWakeUpSleep->setText("Sleep");
ui->bWakeUpSleep->setStyleSheet("background-color:yellow");
}
else
throw std::runtime_error("undefined VM state!");
}
}
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
<<<<<<< HEAD
#ifndef COMPUTEWIDGET_H #ifndef COMPUTEWIDGET_H
#define COMPUTEWIDGET_H #define COMPUTEWIDGET_H
...@@ -41,48 +40,3 @@ private: ...@@ -41,48 +40,3 @@ private:
}; };
#endif // COMPUTEWIDGET_H #endif // COMPUTEWIDGET_H
=======
#ifndef COMPUTEWIDGET_H
#define COMPUTEWIDGET_H
#include <QWidget>
#include <QPixmap>
namespace Ui {
class ComputeWidget;
}
class ComputeWidget : public QWidget
{
Q_OBJECT
public:
std::string id;
std::string name;
explicit ComputeWidget(QWidget *parent = 0);
void setID(std::string id);
void setName(std::string name);
~ComputeWidget();
signals:
void start(std::string id);
void wakeupsleep(std::string id);
void renew(std::string id);
public slots:
void stateChangedHandler(std::string newState, std::string id);
private slots:
void on_bRenew_clicked();
void on_bStart_clicked();
void on_bWakeUpSleep_clicked();
private:
Ui::ComputeWidget *ui;
};
#endif // COMPUTEWIDGET_H
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
<<<<<<< HEAD
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>ComputeWidget</class> <class>ComputeWidget</class>
...@@ -89,101 +88,3 @@ ...@@ -89,101 +88,3 @@
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>
=======
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ComputeWidget</class>
<widget class="QWidget" name="ComputeWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>672</width>
<height>196</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>100</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="6" column="2" rowspan="2">
<widget class="QPushButton" name="bRenew">
<property name="text">
<string>Renew</string>
</property>
</widget>
</item>
<item row="4" column="2" rowspan="2">
<widget class="QPushButton" name="bWakeUpSleep">
<property name="text">
<string>Wake up</string>
</property>
</widget>
</item>
<item row="6" column="0" rowspan="2">
<widget class="QLabel" name="lHostName">
<property name="text">
<string>Virtual Machine</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="0" rowspan="4">
<widget class="QLabel" name="lComputeIcon">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Arial</family>
</font>
</property>
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="1" rowspan="6">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2" rowspan="2">
<widget class="QPushButton" name="bStart">
<property name="text">
<string>Start</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
#include "controller.h" #include "controller.h"
<<<<<<< HEAD
///Implementation for class Controller ///Implementation for class Controller
/*! /*!
...@@ -8,22 +7,17 @@ ...@@ -8,22 +7,17 @@
* \param url * \param url
* \return * \return
*/ */
=======
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
bool Controller::connect(std::string url){ bool Controller::connect(std::string url){
session = new OcciClient::OcciSession(url.c_str(), true, true); session = new OcciClient::OcciSession(url.c_str(), true, true);
return true; //TODO validation return true; //TODO validation
} }
<<<<<<< HEAD
/*! /*!
* \brief Logs in to a connected server, loads all data into the Controller * \brief Logs in to a connected server, loads all data into the Controller
* \param username * \param username
* \param password * \param password
* \return * \return
*/ */
=======
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
bool Controller::login(std::string username, std::string password){ bool Controller::login(std::string username, std::string password){
session->circleOcciLogin(username, password); session->circleOcciLogin(username, password);
if(username == "admin" && password == "admin"){ //TODO TODO lib should handle this if(username == "admin" && password == "admin"){ //TODO TODO lib should handle this
...@@ -34,11 +28,7 @@ bool Controller::login(std::string username, std::string password){ ...@@ -34,11 +28,7 @@ bool Controller::login(std::string username, std::string password){
} }
/*! /*!
<<<<<<< HEAD
* \brief Refreshes all data (Computes, Templates), communicates with the server * \brief Refreshes all data (Computes, Templates), communicates with the server
=======
* \brief Refreshes all data, communicates with the server
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
*/ */
void Controller::refresh(){ void Controller::refresh(){
allCompute.clear(); allCompute.clear();
...@@ -49,7 +39,6 @@ void Controller::refresh(){ ...@@ -49,7 +39,6 @@ void Controller::refresh(){
allTemplate.push_back(t); allTemplate.push_back(t);
} }
<<<<<<< HEAD
///Data Access ///Data Access
/// ---------------------------------------------------------------------------------- /// ----------------------------------------------------------------------------------
...@@ -58,8 +47,6 @@ void Controller::refresh(){ ...@@ -58,8 +47,6 @@ void Controller::refresh(){
* \brief Returns with an std::vector of the VM ids * \brief Returns with an std::vector of the VM ids
* \return * \return
*/ */
=======
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
std::vector<std::string> Controller::getVMs(){ std::vector<std::string> Controller::getVMs(){
std::vector<std::string> VMs; std::vector<std::string> VMs;
for(auto c : allCompute){ for(auto c : allCompute){
...@@ -68,13 +55,10 @@ std::vector<std::string> Controller::getVMs(){ ...@@ -68,13 +55,10 @@ std::vector<std::string> Controller::getVMs(){
return VMs; return VMs;
} }
<<<<<<< HEAD
/*! /*!
* \brief Returns with an std::vector of the Template ids * \brief Returns with an std::vector of the Template ids
* \return * \return
*/ */
=======
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
std::vector<std::string> Controller::getTemplates(){ std::vector<std::string> Controller::getTemplates(){
std::vector<std::string> templates; std::vector<std::string> templates;
for(auto t : allTemplate){ for(auto t : allTemplate){
...@@ -83,7 +67,6 @@ std::vector<std::string> Controller::getTemplates(){ ...@@ -83,7 +67,6 @@ std::vector<std::string> Controller::getTemplates(){
return templates; return templates;
} }
<<<<<<< HEAD
/*! /*!
* \brief Returns the state of the VM specified by the id * \brief Returns the state of the VM specified by the id
* \param id * \param id
...@@ -118,26 +101,20 @@ ComputeData Controller::getDataByID(std::string id){ ...@@ -118,26 +101,20 @@ ComputeData Controller::getDataByID(std::string id){
* \brief Renew action * \brief Renew action
* \param id * \param id
*/ */
=======
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
void Controller::renewByID(std::string id){ void Controller::renewByID(std::string id){
allCompute.at(std::stoi(id))->renew(); allCompute.at(std::stoi(id))->renew();
refresh(); refresh();
} }
<<<<<<< HEAD
/*! /*!
* \brief Start action * \brief Start action
* \param id * \param id
*/ */
=======
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
void Controller::startByID(std::string id){ void Controller::startByID(std::string id){
allCompute.at(std::stoi(id))->start(); allCompute.at(std::stoi(id))->start();
refresh(); refresh();
} }
<<<<<<< HEAD
/*! /*!
* \brief Shutdown action * \brief Shutdown action
* \param id * \param id
...@@ -151,48 +128,24 @@ void Controller::shutdownByID(std::string id){ ...@@ -151,48 +128,24 @@ void Controller::shutdownByID(std::string id){
* \brief Wakeup action * \brief Wakeup action
* \param id * \param id
*/ */
=======
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
void Controller::wakeupByID(std::string id){ void Controller::wakeupByID(std::string id){
allCompute.at(std::stoi(id))->wakeup(); allCompute.at(std::stoi(id))->wakeup();
refresh(); refresh();
} }
<<<<<<< HEAD
/*! /*!
* \brief Sleep action * \brief Sleep action
* \param id * \param id
*/ */
=======
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
void Controller::sleepByID(std::string id){ void Controller::sleepByID(std::string id){
allCompute.at(std::stoi(id))->sleep(); allCompute.at(std::stoi(id))->sleep();
refresh(); refresh();
} }
<<<<<<< HEAD
/*! /*!
* \brief Creates a new Compute by the Template * \brief Creates a new Compute by the Template
* \param id * \param id
*/ */
=======
std::string Controller::getState(std::string id){
return allCompute.at(std::stoi(id))->getState();
}
ComputeData Controller::getDataByID(std::string id){
ComputeData data;
data.memory = allCompute.at(std::stoi(id))->getMemory();
data.cpu = allCompute.at(std::stoi(id))->getCpuShare();
data.cores = allCompute.at(std::stoi(id))->getCores();
data.hostname = allCompute.at(std::stoi(id))->getCredentialHost();
data.port = allCompute.at(std::stoi(id))->getCredentialPort();
data.username = allCompute.at(std::stoi(id))->getCredentialUsername();
data.password = allCompute.at(std::stoi(id))->getCredentialPassword();
return data;
}
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
void Controller::newCompute(Template t){ void Controller::newCompute(Template t){
OcciClient::Compute::createComputeInstance(session, t); OcciClient::Compute::createComputeInstance(session, t);
refresh(); refresh();
......
...@@ -24,11 +24,8 @@ public: ...@@ -24,11 +24,8 @@ public:
void startByID(std::string id); void startByID(std::string id);
<<<<<<< HEAD
void shutdownByID(std::string id); void shutdownByID(std::string id);
=======
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
void wakeupByID(std::string id); void wakeupByID(std::string id);
void sleepByID(std::string id); void sleepByID(std::string id);
......
<<<<<<< HEAD
#include "mainwindow.h" #include "mainwindow.h"
#include <QApplication> #include <QApplication>
...@@ -10,16 +9,3 @@ int main(int argc, char *argv[]) ...@@ -10,16 +9,3 @@ int main(int argc, char *argv[])
return a.exec(); return a.exec();
} }
=======
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.showMaximized();
return a.exec();
}
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
<<<<<<< HEAD
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "sshdialog.h" #include "sshdialog.h"
...@@ -226,205 +225,3 @@ void MainWindow::on_bConnect_clicked() ...@@ -226,205 +225,3 @@ void MainWindow::on_bConnect_clicked()
sshdialog->setSSHConsole(console); sshdialog->setSSHConsole(console);
sshdialog->show(); sshdialog->show();
} }
=======
#include "mainwindow.h"
#include "ui_mainwindow.h"
///Implementation for class MainWindow
///
///---------------------------------------------------------------------------------------------------
/// Basic Methods
/*!
* \brief Constructor, sets up ui, disable tabs other than login
* \param parent
*/
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->tabWidget->setTabEnabled(1, false);
ui->tabWidget->setTabEnabled(2, false);
}
/*!
* \brief Destructor
*/
MainWindow::~MainWindow()
{
delete ui;
}
///---------------------------------------------------------------------------------------------------
/// Methods for loading data to the UI
/*!
* \brief Adds a VM to the listWidget, sets its id, connects all Quick Action buttons
* \param id
* \param name
*/
void MainWindow::addVM(std::string id, std::string name){
QListWidgetItem* item = new QListWidgetItem(ui->listWidget);
ComputeWidget* cw = new ComputeWidget();
cw->setID(id);
cw->setName(name);
connect(this, SIGNAL(stateChanged(std::string, std::string)), cw, SLOT(stateChangedHandler(std::string, std::string)));
emit stateChanged(myController.getState(id), id);
connect(cw, SIGNAL(renew(std::string)), this, SLOT(renewClicked(std::string)));
connect(cw, SIGNAL(start(std::string)), this, SLOT(startClicked(std::string)));
connect(cw, SIGNAL(wakeupsleep(std::string)), this, SLOT(wakeupsleepClicked(std::string)));
item->setSizeHint(cw->minimumSize());
ui->listWidget->addItem(item);
ui->listWidget->setItemWidget(item, cw);
}
/*!
* \brief loads all data to the UI, which are stored in Controller, DOES NOT COMMUNICATE WITH THE CLOUD SERVER!!
*/
void MainWindow::loadAllData(){
VM_names = myController.getVMs();
ui->listWidget->clear();
for(size_t i = 0; i < VM_names.size(); i++)
addVM(std::to_string(i), VM_names.at(i));
ui->lwTemplates->clear();
for(auto t : myController.getTemplates())
ui->lwTemplates->addItem(t.c_str());
}
/*!
* \brief Loads all data for a VM specified by the id, does NOT communicate with the cloud server!!
* \param id
*/
void MainWindow::loadVMData(std::string id){
ui->lStatus->setText(myController.getState(id).c_str());
ComputeData data = myController.getDataByID(id.c_str());
ui->lCPU->setText(std::to_string(data.cpu).c_str());
ui->lMemory->setText(std::to_string(data.memory).c_str());
ui->lCores->setText(std::to_string(data.cores).c_str());
ui->lHostname->setText((data.hostname + ":" + std::to_string(data.port)).c_str());
ui->lUsernameVM->setText(data.username.c_str());
ui->lPasswordVM->setText(data.password.c_str());
}
///---------------------------------------------------------------------------------------------------
/// Button handlers
///Tab 0 - Login Screen
/*!
* \brief Login Button handler, connects to server, if authentication is succesful enables all tabs, and loads all data
*/
void MainWindow::on_bLogin_clicked()
{
std::string serverUrl = ui->iCloudServer->text().toStdString();
myController.connect(serverUrl);
std::string username = ui->iUsername->text().toStdString();
std::string password = ui->iPassword->text().toStdString();
if(!myController.login(username, password)){
ui->lInfo->setText("Invalid username or password...");
return;
}
ui->tabWidget->setTabEnabled(1, true);
ui->tabWidget->setTabEnabled(2, true);
loadAllData();
ui->tabWidget->setCurrentIndex(1);
}
/// Tab 1 - Virtual Machines
/*!
* \brief handles Renew button, all static data is refreshed
* \param id
*/
void MainWindow::renewClicked(std::string id){
myController.renewByID(id);
loadVMData(id);
ui->listWidget->item(std::stoi(id))->setSelected(true);
}
/*!
* \brief handles Start button (fetches data from server)
* \param id
*/
void MainWindow::startClicked(std::string id){
myController.startByID(id);
loadVMData(id);
ui->listWidget->item(std::stoi(id))->setSelected(true);
}
void MainWindow::wakeupsleepClicked(std::string id){
std::string state = myController.getState(id);
if(state == "active"){ //sleep
myController.sleepByID(id);
emit stateChanged(myController.getState(id), id);
loadVMData(id);
ui->listWidget->item(std::stoi(id))->setSelected(true);
}
else if(state == "suspended" || state == "inactive"){ //wake up
myController.wakeupByID(id);
emit stateChanged(myController.getState(id), id);
loadVMData(id);
ui->listWidget->item(std::stoi(id))->setSelected(true);
}
else{
throw std::runtime_error("undefined VM STATE!!!");
}
}
/*!
* \brief handles Renew button (fetches data from server)
* \param id
*/
void MainWindow::on_listWidget_clicked(const QModelIndex &index)
{
loadVMData(std::to_string(index.row()));
}
/*!
* \brief handles Refresh button, refreshes Controller's data and loads to the UI (fetches data from server)
*/
void MainWindow::on_bRefresh_clicked()
{
myController.refresh();
loadAllData();
}
/*!
* \brief handles new VM button, Opens a dialog for choosing from templates
*/
void MainWindow::on_bNewVM_clicked()
{
VMChooserDialog* v = new VMChooserDialog(this);
emit send_templates(getTemplates(myController.session));
connect(v, SIGNAL(send_chosen_template(Template)), this, SLOT(receive_chosen_template(Template)));
v->exec();
}
/*!
* \brief Slot for dialog, creates new VM by the chosen template
* \param t
*/
void MainWindow::receive_chosen_template(Template t){
myController.newCompute(t);
loadAllData();
}
/*!
* \brief handler, shows/hides VM password
*/
void MainWindow::on_bShowPassword_clicked()
{
if(ui->lPasswordVM->echoMode() == QLineEdit::Password){
ui->lPasswordVM->setEchoMode(QLineEdit::Normal);
ui->bShowPassword->setText("Hide");
}
else if(ui->lPasswordVM->echoMode() == QLineEdit::Normal){
ui->lPasswordVM->setEchoMode(QLineEdit::Password);
ui->bShowPassword->setText("Show");
}
else
ui->lPasswordVM->setEchoMode(QLineEdit::Password);
}
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
<<<<<<< HEAD
#ifndef MAINWINDOW_H #ifndef MAINWINDOW_H
#define MAINWINDOW_H #define MAINWINDOW_H
...@@ -56,59 +55,3 @@ private: ...@@ -56,59 +55,3 @@ private:
}; };
#endif // MAINWINDOW_H #endif // MAINWINDOW_H
=======
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QLabel>
#include <QPushButton>
#include <QListWidget>
#include <computewidget.h>
#include "libocci/occilib.h"
#include "controller.h"
#include "vmchooserdialog.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void addVM(std::string id, std::string name);
void loadAllData();
void loadVMData(std::string id);
signals:
void send_templates(std::vector<Template>);
void stateChanged(std::string state, std::string id);
private slots:
void on_bLogin_clicked();
void renewClicked(std::string);
void startClicked(std::string);
void wakeupsleepClicked(std::string);
void receive_chosen_template(Template);
void on_listWidget_clicked(const QModelIndex &index);
void on_bRefresh_clicked();
void on_bNewVM_clicked();
void on_bShowPassword_clicked();
private:
Ui::MainWindow *ui;
Controller myController;
std::vector<std::string> VM_names;
};
#endif // MAINWINDOW_H
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
<<<<<<< HEAD
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>MainWindow</class> <class>MainWindow</class>
...@@ -796,795 +795,3 @@ ...@@ -796,795 +795,3 @@
</resources> </resources>
<connections/> <connections/>
</ui> </ui>
=======
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>691</width>
<height>471</height>
</rect>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>108</red>
<green>112</green>
<blue>115</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>108</red>
<green>112</green>
<blue>115</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="windowTitle">
<string>CircleClient</string>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QTabWidget" name="tabWidget">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>64</red>
<green>66</green>
<blue>68</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>64</red>
<green>66</green>
<blue>68</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>20</height>
</size>
</property>
<widget class="QWidget" name="tWelcome">
<attribute name="title">
<string>Welcome</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="10" column="1">
<widget class="QPushButton" name="bLogin">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Log in&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Login</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLineEdit" name="iPassword">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="inputMask">
<string/>
</property>
<property name="text">
<string>admin</string>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="3" column="2" rowspan="10">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>250</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0" rowspan="10">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>250</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="12" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>100</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="1">
<widget class="QLabel" name="lPassword">
<property name="text">
<string>Password</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLineEdit" name="iUsername">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>admin</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="1">
<widget class="QLabel" name="lUsername">
<property name="text">
<string>Username</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="lCloudIcon">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="resource.qrc">:/new/icons/cloud icon.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="lWelcomeMessage">
<property name="text">
<string>Welcome! Please log in with your Circle account!</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QLabel" name="lInfo">
<property name="palette">
<palette>
<active>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>190</red>
<green>190</green>
<blue>190</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="lCloudServer">
<property name="text">
<string>Cloud Server:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="iCloudServer">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>https://vm.ik.bme.hu:9366/occi/</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tVM">
<attribute name="title">
<string>Virtual Machines</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QListWidget" name="listWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>108</red>
<green>112</green>
<blue>115</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>108</red>
<green>112</green>
<blue>115</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="1">
<widget class="QLabel" name="lStatus">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="lMemoryTag">
<property name="text">
<string>Memory:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lStatusTag">
<property name="text">
<string>Status:</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QPushButton" name="bRefresh">
<property name="text">
<string>Refresh</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QPushButton" name="bNewVM">
<property name="text">
<string>New VM</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lResourcesTag">
<property name="text">
<string>Resources:</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="lNetworkTag">
<property name="text">
<string>Network:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="lUsernameTag">
<property name="text">
<string>Username:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="lCoresTag">
<property name="text">
<string>Cores:</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="lMemory">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLabel" name="lCPU">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLabel" name="lCores">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLabel" name="lPasswordTag">
<property name="text">
<string>Password:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="lCPUTag">
<property name="text">
<string>CPU:</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QLabel" name="lHostname">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QLabel" name="lUsernameVM">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="lHastnameTag">
<property name="text">
<string>Hostname:</string>
</property>
</widget>
</item>
<item row="7" column="0" rowspan="3">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0" rowspan="3">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="9" column="2">
<widget class="QLineEdit" name="lPasswordVM">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="3">
<widget class="QPushButton" name="bShowPassword">
<property name="text">
<string>Show</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tTemplate">
<attribute name="title">
<string>Templates</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_6">
<item row="1" column="0">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QListWidget" name="lwTemplates"/>
</item>
<item row="0" column="1">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>691</width>
<height>19</height>
</rect>
</property>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
<include location="resource.qrc"/>
</resources>
<connections/>
</ui>
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
<<<<<<< HEAD
<RCC> <RCC>
<qresource prefix="/new/icons"> <qresource prefix="/new/icons">
<file>compute.png</file> <file>compute.png</file>
...@@ -11,11 +10,3 @@ ...@@ -11,11 +10,3 @@
<file>running.png</file> <file>running.png</file>
</qresource> </qresource>
</RCC> </RCC>
=======
<RCC>
<qresource prefix="/new/icons">
<file>compute.png</file>
<file>cloud icon.png</file>
</qresource>
</RCC>
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
...@@ -3,10 +3,6 @@ ...@@ -3,10 +3,6 @@
VMChooserDialog::VMChooserDialog(QWidget *parent):QDialog(parent), ui(new Ui::VMChooserDialog) VMChooserDialog::VMChooserDialog(QWidget *parent):QDialog(parent), ui(new Ui::VMChooserDialog)
{ {
<<<<<<< HEAD
=======
connect(parent, SIGNAL(send_templates(std::vector<Template>)), this, SLOT(receive_templates(std::vector<Template>)));
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
ui->setupUi(this); ui->setupUi(this);
} }
...@@ -25,11 +21,7 @@ void VMChooserDialog::on_buttonBox_rejected() ...@@ -25,11 +21,7 @@ void VMChooserDialog::on_buttonBox_rejected()
this->done(-1); this->done(-1);
} }
<<<<<<< HEAD
void VMChooserDialog::set_templates(std::vector<Template> _templates){ void VMChooserDialog::set_templates(std::vector<Template> _templates){
=======
void VMChooserDialog::receive_templates(std::vector<Template> _templates){
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
templates = _templates; templates = _templates;
for(auto t : templates){ for(auto t : templates){
ui->lwTemplates->addItem(QString::fromUtf8(t.c_str())); ui->lwTemplates->addItem(QString::fromUtf8(t.c_str()));
......
...@@ -12,20 +12,13 @@ class VMChooserDialog : public QDialog ...@@ -12,20 +12,13 @@ class VMChooserDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit VMChooserDialog(QWidget *parent = 0); explicit VMChooserDialog(QWidget *parent = 0);
<<<<<<< HEAD
void set_templates(std::vector<Template> templates); void set_templates(std::vector<Template> templates);
=======
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
~VMChooserDialog(); ~VMChooserDialog();
signals: signals:
void send_chosen_template(Template); void send_chosen_template(Template);
private slots: private slots:
<<<<<<< HEAD
=======
void receive_templates(std::vector<Template> templates);
>>>>>>> 7a7d24d7d5770ed8dbaa6a1766461251ff6f768c
void on_buttonBox_accepted(); void on_buttonBox_accepted();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment