Created simple base gui #1
This commit is contained in:
+9
-19
@@ -1,20 +1,18 @@
|
||||
#include<iostream>
|
||||
#include<string>
|
||||
|
||||
#include"Syncers/Download.h"
|
||||
#include"Syncers/Upload.h"
|
||||
#include"Managers/FileManager.h"
|
||||
#include<QApplication>
|
||||
|
||||
#include"UI/MainWindow.h"
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
using std::string;
|
||||
|
||||
using Managers::FileManager;
|
||||
using Syncers::Download;
|
||||
using Syncers::Upload;
|
||||
using UI::MainWindow;
|
||||
|
||||
string songPath;
|
||||
string songPath{};
|
||||
string newSongPath;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
@@ -36,19 +34,11 @@ int main(int argc, char** argv)
|
||||
break;
|
||||
}
|
||||
|
||||
cout<<"Song path: "<<songPath<<endl;
|
||||
/**
|
||||
FileManager fm{songPath};
|
||||
fm.saveFile(newSongPath);
|
||||
QApplication app{argc, argv};
|
||||
|
||||
Upload upS{songPath};
|
||||
upS.uploadSong();
|
||||
*/
|
||||
|
||||
Download df{newSongPath};
|
||||
df.downloadSong(1);
|
||||
MainWindow icarusMgr{};
|
||||
icarusMgr.show();
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef COMMONWINDOW_H_
|
||||
#define COMMONWINDOW_H_
|
||||
|
||||
#include<memory>
|
||||
|
||||
#include<QDialog>
|
||||
#include<QHBoxLayout>
|
||||
#include<QVBoxLayout>
|
||||
#include<QComboBox>
|
||||
#include<QPushButton>
|
||||
|
||||
|
||||
class CommonWindow
|
||||
{
|
||||
public:
|
||||
CommonWindow() = default;
|
||||
~CommonWindow() = default;
|
||||
protected:
|
||||
virtual void connections()=0;
|
||||
std::unique_ptr<QComboBox> selectionBoxQt;
|
||||
std::unique_ptr<QPushButton> actionButtonQt;
|
||||
std::unique_ptr<QVBoxLayout> mainLayoutQt;
|
||||
std::unique_ptr<QHBoxLayout> subLayoutOneQt;
|
||||
std::unique_ptr<QHBoxLayout> subLayoutTwoQt;
|
||||
int windowHeight, windowWidth;
|
||||
};
|
||||
#endif
|
||||
@@ -0,0 +1,84 @@
|
||||
#include"MainWindow.h"
|
||||
|
||||
using std::unique_ptr;
|
||||
|
||||
namespace UI
|
||||
{
|
||||
MainWindow::MainWindow()
|
||||
{
|
||||
|
||||
setupMainWindow();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::configureDownloadSection()
|
||||
{
|
||||
}
|
||||
void MainWindow::configureUploadSection()
|
||||
{
|
||||
}
|
||||
void MainWindow::configureWindowDimensions()
|
||||
{
|
||||
windowWidth = 600;
|
||||
windowHeight = 600;
|
||||
}
|
||||
void MainWindow::configureWindowProperties()
|
||||
{
|
||||
setWindowTitle("IcarusDownloadManager");
|
||||
setFixedHeight(windowHeight);
|
||||
setFixedWidth(windowWidth);
|
||||
}
|
||||
void MainWindow::connections()
|
||||
{
|
||||
|
||||
}
|
||||
void MainWindow::createMenus()
|
||||
{
|
||||
fileMenuQt = unique_ptr<QMenu>{menuBar()->addMenu(tr("File"))};
|
||||
editMenuQt = unique_ptr<QMenu>{menuBar()->addMenu(tr("Edit"))};
|
||||
|
||||
closeApplicationQt = unique_ptr<QAction>{new QAction(new QObject(nullptr))};
|
||||
closeApplicationQt.get()->setText("Exit Application");
|
||||
|
||||
/**
|
||||
keyEdit = unique_ptr<QAction>{new QAction(new QObject(nullptr))};
|
||||
keyEdit.get()->setText("Key Management");
|
||||
passwordManage = unique_ptr<QAction>{new QAction{new QObject{nullptr}}};
|
||||
passwordManage.get()->setText("PasswordManagement");
|
||||
|
||||
fileMenu.get()->addAction(closeApplication.get());
|
||||
editMenu.get()->addAction(keyEdit.get());
|
||||
editMenu.get()->addAction(passwordManage.get());
|
||||
*/
|
||||
|
||||
}
|
||||
void MainWindow::setupMainWindow()
|
||||
{
|
||||
configureWindowDimensions();
|
||||
actionButtonQt = unique_ptr<QPushButton>{new QPushButton(tr("upload"))};
|
||||
selectionBoxQt = unique_ptr<QComboBox>{new QComboBox{}};
|
||||
|
||||
buttonLayoutQt = unique_ptr<QVBoxLayout>{new QVBoxLayout};
|
||||
buttonWidgetQt = unique_ptr<QWidget>{new QWidget};
|
||||
buttonDockWidgetQt = unique_ptr<QDockWidget>{new QDockWidget};
|
||||
buttonDockWidgetQt.get()->setWindowTitle(tr("Music Manager"));
|
||||
buttonLayoutQt.get()->addWidget(selectionBoxQt.get());
|
||||
buttonLayoutQt.get()->addWidget(actionButtonQt.get());
|
||||
buttonWidgetQt.get()->setLayout(buttonLayoutQt.get());
|
||||
buttonDockWidgetQt.get()->setWidget(buttonWidgetQt.get());
|
||||
buttonDockWidgetQt.get()->setFeatures(QDockWidget::NoDockWidgetFeatures);
|
||||
setCentralWidget(buttonDockWidgetQt.get());
|
||||
|
||||
cryptionAreaQt = unique_ptr<QDockWidget>{new QDockWidget(tr("Cryption"))};
|
||||
cryptionAreaQt.get()->setFeatures(QDockWidget::NoDockWidgetFeatures);
|
||||
addDockWidget(Qt::LeftDockWidgetArea, cryptionAreaQt.get());
|
||||
|
||||
createMenus();
|
||||
|
||||
|
||||
configureWindowProperties();
|
||||
actionButtonQt.get()->setEnabled(false);
|
||||
|
||||
connections();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
#ifndef MAINWINDOW_H_
|
||||
#define MAINWINDOW_H_
|
||||
|
||||
#include<iostream>
|
||||
#include<memory>
|
||||
|
||||
#include<QAction>
|
||||
#include<QDialog>
|
||||
#include<QDockWidget>
|
||||
#include<QLabel>
|
||||
#include<QMenu>
|
||||
#include<QMenuBar>
|
||||
#include<QMainWindow>
|
||||
#include<QTextEdit>
|
||||
#include<QWidget>
|
||||
|
||||
#include"UI/CommonWindow.h"
|
||||
|
||||
namespace UI
|
||||
{
|
||||
class MainWindow: public QMainWindow, public CommonWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MainWindow();
|
||||
~MainWindow() = default;
|
||||
private:
|
||||
void configureDownloadSection();
|
||||
void configureUploadSection();
|
||||
void configureWindowDimensions();
|
||||
void configureWindowProperties();
|
||||
void connections();
|
||||
void createMenus();
|
||||
void setupMainWindow();
|
||||
|
||||
std::unique_ptr<QVBoxLayout> buttonLayoutQt;
|
||||
|
||||
std::unique_ptr<QWidget> buttonWidgetQt;
|
||||
|
||||
std::unique_ptr<QDockWidget> buttonDockWidgetQt;
|
||||
std::unique_ptr<QDockWidget> cryptionAreaQt;
|
||||
|
||||
std::unique_ptr<QTextEdit> sourceFilePathQt;
|
||||
|
||||
std::unique_ptr<QMenu> fileMenuQt;
|
||||
std::unique_ptr<QMenu> editMenuQt;
|
||||
std::unique_ptr<QAction> closeApplicationQt;
|
||||
signals:
|
||||
private slots:
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user