Skip to content
Snippets Groups Projects
Commit c468f182 authored by Matthias's avatar Matthias
Browse files

reduce dependencies to Manhattan style

replace Manhattan::ProgressBar by QProgressBar
parent 7fd55fc2
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "GUI/coregui/Models/JobModel.h" #include "GUI/coregui/Models/JobModel.h"
#include "GUI/coregui/Models/JobQueueData.h" #include "GUI/coregui/Models/JobQueueData.h"
#include "GUI/coregui/mainwindow/mainwindow.h" #include "GUI/coregui/mainwindow/mainwindow.h"
#include <qt-manhattan-style/progressbar.h> #include <QProgressBar>
JobProgressAssistant::JobProgressAssistant(MainWindow* mainWindow) JobProgressAssistant::JobProgressAssistant(MainWindow* mainWindow)
: QObject(mainWindow), m_mainWindow(mainWindow) { : QObject(mainWindow), m_mainWindow(mainWindow) {
...@@ -29,12 +29,10 @@ JobProgressAssistant::JobProgressAssistant(MainWindow* mainWindow) ...@@ -29,12 +29,10 @@ JobProgressAssistant::JobProgressAssistant(MainWindow* mainWindow)
void JobProgressAssistant::onGlobalProgress(int progress) { void JobProgressAssistant::onGlobalProgress(int progress) {
ASSERT(m_mainWindow->progressBar()); ASSERT(m_mainWindow->progressBar());
if (progress < 0 || progress >= 100) { if (progress < 0 || progress >= 100)
m_mainWindow->progressBar()->setFinished(true);
m_mainWindow->progressBar()->hide(); m_mainWindow->progressBar()->hide();
} else { else {
m_mainWindow->progressBar()->show(); m_mainWindow->progressBar()->show();
m_mainWindow->progressBar()->setFinished(false);
m_mainWindow->progressBar()->setValue(progress); m_mainWindow->progressBar()->setValue(progress);
} }
} }
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
#include <QApplication> #include <QApplication>
#include <QCloseEvent> #include <QCloseEvent>
#include <QMessageBox> #include <QMessageBox>
#include <QProgressBar>
#include <QSettings> #include <QSettings>
#include <qt-manhattan-style/fancytabwidget.h> #include <qt-manhattan-style/fancytabwidget.h>
#include <qt-manhattan-style/progressbar.h>
#include <qt-manhattan-style/stylehelper.h> #include <qt-manhattan-style/stylehelper.h>
MainWindow* MainWindow::s_instance = nullptr; MainWindow* MainWindow::s_instance = nullptr;
...@@ -43,7 +43,7 @@ MainWindow* MainWindow::s_instance = nullptr; ...@@ -43,7 +43,7 @@ MainWindow* MainWindow::s_instance = nullptr;
MainWindow::MainWindow() MainWindow::MainWindow()
: Manhattan::FancyMainWindow(nullptr) : Manhattan::FancyMainWindow(nullptr)
, m_tabWidget(new Manhattan::FancyTabWidget(this)) , m_tabWidget(new Manhattan::FancyTabWidget(this))
, m_progressBar(new Manhattan::ProgressBar(this)) , m_progressBar(new QProgressBar)
, m_applicationModels(new ApplicationModels(this)) , m_applicationModels(new ApplicationModels(this))
, m_projectManager(new ProjectManager(this)) , m_projectManager(new ProjectManager(this))
, m_actionManager(new ActionManager(this)) , m_actionManager(new ActionManager(this))
...@@ -100,7 +100,7 @@ ApplicationModels* MainWindow::models() { ...@@ -100,7 +100,7 @@ ApplicationModels* MainWindow::models() {
return m_applicationModels; return m_applicationModels;
} }
Manhattan::ProgressBar* MainWindow::progressBar() { QProgressBar* MainWindow::progressBar() {
return m_progressBar; return m_progressBar;
} }
...@@ -192,8 +192,11 @@ void MainWindow::initApplication() { ...@@ -192,8 +192,11 @@ void MainWindow::initApplication() {
} }
void MainWindow::initProgressBar() { void MainWindow::initProgressBar() {
m_tabWidget->addBottomCornerWidget(m_progressBar);
m_progressBar->hide(); m_progressBar->hide();
m_progressBar->setTextVisible(false);
m_progressBar->setFixedHeight(10);
m_progressBar->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
m_tabWidget->addBottomCornerWidget(m_progressBar);
} }
void MainWindow::initViews() { void MainWindow::initViews() {
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
namespace Manhattan { namespace Manhattan {
class FancyTabWidget; class FancyTabWidget;
class ProgressBar;
} // namespace Manhattan } // namespace Manhattan
class WelcomeView; class WelcomeView;
...@@ -40,6 +39,7 @@ class ProjectManager; ...@@ -40,6 +39,7 @@ class ProjectManager;
class ActionManager; class ActionManager;
class ToolTipDataBase; class ToolTipDataBase;
class UpdateNotifier; class UpdateNotifier;
class QProgressBar;
class MainWindow : public Manhattan::FancyMainWindow { class MainWindow : public Manhattan::FancyMainWindow {
Q_OBJECT Q_OBJECT
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
JobModel* jobModel(); JobModel* jobModel();
ApplicationModels* models(); ApplicationModels* models();
Manhattan::ProgressBar* progressBar(); QProgressBar* progressBar();
QStatusBar* statusBar(); QStatusBar* statusBar();
ProjectManager* projectManager(); ProjectManager* projectManager();
...@@ -85,7 +85,7 @@ private: ...@@ -85,7 +85,7 @@ private:
void initConnections(); void initConnections();
Manhattan::FancyTabWidget* m_tabWidget; Manhattan::FancyTabWidget* m_tabWidget;
Manhattan::ProgressBar* m_progressBar; QProgressBar* m_progressBar;
ApplicationModels* m_applicationModels; ApplicationModels* m_applicationModels;
ProjectManager* m_projectManager; ProjectManager* m_projectManager;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment