From 0b8657008bf89226d24259dcbe5730aa76a483e2 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 13 Sep 2016 14:11:39 -0400 Subject: Add the beginnings of git integration within lumina-fm. Currently it can detect whether the user is looking at a git repo or not, and can probe/show the status of the repo if within one. --- src-qt5/desktop-utils/lumina-fm/MainUI.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src-qt5/desktop-utils/lumina-fm/MainUI.cpp') diff --git a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp index ea176846..0300438a 100644 --- a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp @@ -8,6 +8,7 @@ #include "ui_MainUI.h" #include +#include "gitCompat.h" #define DEBUG 0 @@ -21,6 +22,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ ui->setupUi(this); + ui->menuGit->setVisible( GIT::isAvailable() ); if(DEBUG){ qDebug() << "Initilization:"; } settings = new QSettings( QSettings::UserScope, "lumina-desktop", "lumina-fm", this); @@ -230,6 +232,10 @@ void MainUI::setupIcons(){ ui->actionManage_Bookmarks->setIcon( LXDG::findIcon("bookmarks-organize","") ); ui->actionAdd_Bookmark->setIcon( LXDG::findIcon("bookmark-new","") ); + //GIT menu + ui->actionRepo_Status->setIcon( LXDG::findIcon("git","document-edit-verify") ); + ui->actionClone_Repository->setIcon( LXDG::findIcon("git","download") ); + // External Devices menu ui->actionScan->setIcon( LXDG::findIcon("system-search","") ); } @@ -606,6 +612,24 @@ void MainUI::CreateBookMark(){ RebuildBookmarksMenu(); } +//Git Menu options +void MainUI::on_menuGit_aboutToShow(){ + QString dir = FindActiveBrowser()->currentDir(); + bool inrepo = GIT::isRepo(dir); + ui->actionRepo_Status->setEnabled( inrepo ); + ui->actionClone_Repository->setEnabled( !inrepo ); +} + +void MainUI::on_actionRepo_Status_triggered(){ + QString status = GIT::status( FindActiveBrowser()->currentDir() ); + QMessageBox::information(this, tr("Git Repository Status"), status); +} + +void MainUI::on_actionClone_Repository_triggered(){ + +} + + void MainUI::tabChanged(int tab){ if(tab<0){ tab = tabBar->currentIndex(); } if(tab < 0){ return; } -- cgit From 188efd21b0255be16813438ad593d098526a6745 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 15 Sep 2016 07:44:58 -0400 Subject: Add in the new Git Cloning Wizard. Now fully finished yet, but almost there. --- src-qt5/desktop-utils/lumina-fm/MainUI.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src-qt5/desktop-utils/lumina-fm/MainUI.cpp') diff --git a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp index 0300438a..abe14c0d 100644 --- a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp @@ -9,6 +9,7 @@ #include #include "gitCompat.h" +#include "gitWizard.h" #define DEBUG 0 @@ -626,7 +627,9 @@ void MainUI::on_actionRepo_Status_triggered(){ } void MainUI::on_actionClone_Repository_triggered(){ - + GitWizard *dlg = new GitWizard(this); + dlg->setWorkingDir( FindActiveBrowser()->currentDir() ); + dlg->show(); } -- cgit