Skip to content
Browse files

Get the GUI stuff completely done (all tied together and actively ena…

…bled/disabled). Now I just need to fill out the functions that call the backend to actually perform actions.
  • Loading branch information...
1 parent db4b1b6 commit f50ac43f2f0667e2271cd9eabef34a3201760497 @beanpole135 beanpole135 committed Oct 11, 2013
Showing with 147 additions and 6 deletions.
  1. +97 −2 lp-gui/LPMain.cpp
  2. +19 −0 lp-gui/LPMain.h
  3. +31 −4 lp-gui/LPMain.ui
View
99 lp-gui/LPMain.cpp
@@ -24,6 +24,21 @@ LPMain::LPMain(QWidget *parent) : QMainWindow(parent), ui(new Ui::LPMain){
connect(ui->push_prevsnap, SIGNAL(clicked()), this, SLOT(prevSnapshot()) );
connect(ui->push_nextsnap, SIGNAL(clicked()), this, SLOT(nextSnapshot()) );
connect(ui->push_restore, SIGNAL(clicked()), this, SLOT(restoreFiles()) );
+ connect(ui->push_configure, SIGNAL(clicked()), this, SLOT(openConfigGUI()) );
+ connect(ui->push_configBackups, SIGNAL(clicked()), this, SLOT(openBackupGUI()) );
+ //Connect the Menu buttons
+ connect(ui->actionManage_Pool, SIGNAL(triggered()), this, SLOT(menuAddPool()) );
+ connect(ui->actionUnmanage_Pool, SIGNAL(triggered()), this, SLOT(menuRemovePool()) );
+ connect(ui->action_SaveKeyToUSB, SIGNAL(triggered()), this, SLOT(menuSaveSSHKey()) );
+ connect(ui->actionClose_Window, SIGNAL(triggered()), this, SLOT(menuCloseWindow()) );
+ connect(ui->actionCompress_Home_Dir, SIGNAL(triggered()), this, SLOT(menuCompressHomeDir()) );
+ connect(ui->actionExtract_Home_Dir, SIGNAL(triggered()), this, SLOT(menuExtractHomeDir()) );
+ connect(ui->actionAdd_Disk, SIGNAL(triggered()), this, SLOT(menuAddDisk()) );
+ connect(ui->actionRemove_Disk, SIGNAL(triggered()), this, SLOT(menuRemoveDisk()) );
+ connect(ui->actionSet_Disk_Offline, SIGNAL(triggered()), this, SLOT(menuOfflineDisk()) );
+ connect(ui->action_startScrub, SIGNAL(triggered()), this, SLOT(menuStartScrub()) );
+ connect(ui->action_newSnapshot, SIGNAL(triggered()), this, SLOT(menuNewSnapshot()) );
+ connect(ui->action_rmSnapshot, SIGNAL(triggered()), this, SLOT(menuRemoveSnapshot()) );
//Update the interface
updatePoolList();
//Make sure the status tab is shown initially
@@ -81,9 +96,11 @@ void LPMain::viewChanged(){
if(viewBasic->isChecked()){
ui->menubar->addMenu(ui->menuFile);
ui->menubar->addMenu(ui->menuView);
+ ui->menubar->addMenu(ui->menuClassic_Backups);
}else{
ui->menubar->addMenu(ui->menuFile);
ui->menubar->addMenu(ui->menuView);
+ ui->menubar->addMenu(ui->menuClassic_Backups);
ui->menubar->addMenu(ui->menuDisks);
ui->menubar->addMenu(ui->menuSnapshots);
}
@@ -94,6 +111,8 @@ void LPMain::updateTabs(){
viewChanged();
ui->tabWidget->setEnabled(poolSelected);
ui->menuView->setEnabled(poolSelected);
+ ui->menuDisks->setEnabled(poolSelected);
+ ui->menuSnapshots->setEnabled(poolSelected);
ui->push_configure->setVisible(poolSelected);
ui->push_configBackups->setVisible(poolSelected);
ui->actionUnmanage_Pool->setEnabled(poolSelected);
@@ -131,8 +150,8 @@ void LPMain::updateTabs(){
//Automatically calls the "updateDataset()" function
}else{
//No Pool selected
- ui->menuDisks->setEnabled(false); //make sure this is always invisible if nothing selected
- ui->menuSnapshots->setEnabled(false); //make sure this is always invisible if nothing selected
+ ui->menuDisks->setEnabled(false); //make sure this is always disabled if nothing selected
+ ui->menuSnapshots->setEnabled(false); //make sure this is always disabled if nothing selected
ui->label_numdisks->clear();
ui->label_latestsnapshot->clear();
ui->label_status->clear();
@@ -199,3 +218,79 @@ void LPMain::restoreFiles(){
qDebug() << "Restore file(s)";
}
+
+void LPMain::openConfigGUI(){
+ qDebug() << "Open Configuration UI";
+
+}
+
+void LPMain::openBackupGUI(){
+ qDebug() << "Open Backup UI";
+
+}
+
+// -----------------------------------------------
+// MENU SLOTS
+// -----------------------------------------------
+// ==== File Menu ====
+void LPMain::menuAddPool(){
+ qDebug() << "Add Pool";
+
+}
+
+void LPMain::menuRemovePool(){
+ qDebug() << "Remove Pool";
+
+}
+
+void LPMain::menuSaveSSHKey(){
+ qDebug() << "Save SSH Key";
+
+}
+
+void LPMain::menuCloseWindow(){
+ this->close();
+}
+
+// ==== Classic Backups Menu ====
+void LPMain::menuCompressHomeDir(){
+ qDebug() << "Compress Home Dir";
+
+}
+
+void LPMain::menuExtractHomeDir(){
+ qDebug() << "Extract Home Dir";
+
+}
+
+// ==== Disks Menu ====
+void LPMain::menuAddDisk(){
+ qDebug() << "Add Disk";
+
+}
+
+void LPMain::menuRemoveDisk(){
+ qDebug() << "Remove Disk";
+
+}
+
+void LPMain::menuOfflineDisk(){
+ qDebug() << "Set Disk Offline";
+
+}
+
+void LPMain::menuStartScrub(){
+ qDebug() << "Start Scrub";
+
+}
+
+// ==== Snapshots Menu ====
+void LPMain::menuNewSnapshot(){
+ qDebug() << "New Snapshot";
+
+}
+
+void LPMain::menuRemoveSnapshot(){
+ qDebug() << "Remove Snapshot";
+
+}
View
19 lp-gui/LPMain.h
@@ -44,6 +44,25 @@ private slots:
void nextSnapshot();
void prevSnapshot();
void restoreFiles();
+ void openConfigGUI();
+ void openBackupGUI();
+ // -- Menu Actions --
+ //File Menu
+ void menuAddPool();
+ void menuRemovePool();
+ void menuSaveSSHKey();
+ void menuCloseWindow();
+ //Classic Backups
+ void menuCompressHomeDir();
+ void menuExtractHomeDir();
+ //Disk Menu
+ void menuAddDisk();
+ void menuRemoveDisk();
+ void menuOfflineDisk();
+ void menuStartScrub();
+ //Snapshots Menu
+ void menuNewSnapshot();
+ void menuRemoveSnapshot();
protected:
View
35 lp-gui/LPMain.ui
@@ -29,6 +29,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="sizeAdjustPolicy">
+ <enum>QComboBox::AdjustToContentsOnFirstShow</enum>
+ </property>
</widget>
</item>
<item>
@@ -367,11 +370,9 @@
<addaction name="actionManage_Pool"/>
<addaction name="actionUnmanage_Pool"/>
<addaction name="separator"/>
- <addaction name="actionClassic_Backup"/>
- <addaction name="separator"/>
<addaction name="action_SaveKeyToUSB"/>
<addaction name="separator"/>
- <addaction name="actionClose_WIndow"/>
+ <addaction name="actionClose_Window"/>
</widget>
<widget class="QMenu" name="menuView">
<property name="title">
@@ -396,13 +397,21 @@
<addaction name="action_newSnapshot"/>
<addaction name="action_rmSnapshot"/>
</widget>
+ <widget class="QMenu" name="menuClassic_Backups">
+ <property name="title">
+ <string>Classic Backups</string>
+ </property>
+ <addaction name="actionCompress_Home_Dir"/>
+ <addaction name="actionExtract_Home_Dir"/>
+ </widget>
<addaction name="menuFile"/>
<addaction name="menuView"/>
+ <addaction name="menuClassic_Backups"/>
<addaction name="menuDisks"/>
<addaction name="menuSnapshots"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
- <action name="actionClose_WIndow">
+ <action name="actionClose_Window">
<property name="icon">
<iconset resource="lPreserve.qrc">
<normaloff>:/images/application-exit.png</normaloff>:/images/application-exit.png</iconset>
@@ -534,6 +543,24 @@
<string>Classic Backup</string>
</property>
</action>
+ <action name="actionCompress_Home_Dir">
+ <property name="icon">
+ <iconset resource="lPreserve.qrc">
+ <normaloff>:/images/upload.png</normaloff>:/images/upload.png</iconset>
+ </property>
+ <property name="text">
+ <string>Compress Home Dir</string>
+ </property>
+ </action>
+ <action name="actionExtract_Home_Dir">
+ <property name="icon">
+ <iconset resource="lPreserve.qrc">
+ <normaloff>:/images/folder.png</normaloff>:/images/folder.png</iconset>
+ </property>
+ <property name="text">
+ <string>Extract Home Dir</string>
+ </property>
+ </action>
</widget>
<resources>
<include location="lPreserve.qrc"/>

0 comments on commit f50ac43

Please sign in to comment.
Something went wrong with that request. Please try again.