diff options
author | Ken Moore <ken@pcbsd.org> | 2015-01-28 11:43:31 -0500 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-01-28 11:43:31 -0500 |
commit | 4b93059ecb156cbc4d6fa5955c6ba5b76f205a26 (patch) | |
tree | e9229fa9590d5b7af5fc24eb331efbd6d9e57e30 /lumina-info/MainUI.cpp | |
parent | Add a new function to all LuminaOS files: OSName() (diff) | |
download | lumina-4b93059ecb156cbc4d6fa5955c6ba5b76f205a26.tar.gz lumina-4b93059ecb156cbc4d6fa5955c6ba5b76f205a26.tar.bz2 lumina-4b93059ecb156cbc4d6fa5955c6ba5b76f205a26.zip |
Add a new utility: lumina-info
This utility provides basic information/links for the Lumina desktop project.
Diffstat (limited to 'lumina-info/MainUI.cpp')
-rw-r--r-- | lumina-info/MainUI.cpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/lumina-info/MainUI.cpp b/lumina-info/MainUI.cpp new file mode 100644 index 00000000..a91eac03 --- /dev/null +++ b/lumina-info/MainUI.cpp @@ -0,0 +1,60 @@ +//=========================================== +// Lumina-DE source code +// Copyright (c) 2015, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +#include "MainUI.h" +#include "ui_MainUI.h" + +#include <LuminaOS.h> +#include <LuminaUtils.h> +#include <LuminaXDG.h> + +#include <QPixmap> +#include <QMessageBox> +#include <QProcess> + +MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ + ui->setupUi(this); + updateUI(); + ui->tabWidget->setCurrentWidget(ui->tab); //start on the "General" tab +} + +MainUI::~MainUI(){ + +} + +void MainUI::updateUI(){ + //Load the UI from all the resources / library info + this->setWindowIcon( LXDG::findIcon("lumina","") ); + ui->label_icon->setPixmap( QPixmap(":Images/Lumina-logo.png").scaledToHeight(ui->label_icon->height(), Qt::SmoothTransformation) ); + connect(ui->push_close, SIGNAL(clicked()), this, SLOT(close()) ); + //General Tab + ui->label_version->setText( LUtils::LuminaDesktopVersion() ); + ui->label_OS->setText( LOS::OSName() ); + connect(ui->tool_aboutQt, SIGNAL(clicked()), this, SLOT(showQtInfo()) ); + connect(ui->label_doc, SIGNAL(linkActivated(const QString&)), this, SLOT(LinkClicked(QString)) ); + connect(ui->label_source, SIGNAL(linkActivated(const QString&)), this, SLOT(LinkClicked(QString)) ); + //License Tab + ui->text_license->setPlainText( LUtils::readFile(":LICENSE").join("\n") ); + //Acknowledgements Tab + // Note: contents set within the designer form itself + connect(ui->list_sponsors, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(showSponsor(QListWidgetItem*)) ); + connect(ui->label_proj_lead, SIGNAL(linkActivated(const QString&)), this, SLOT(LinkClicked(QString)) ); + connect(ui->label_proj_contrib, SIGNAL(linkActivated(const QString&)), this, SLOT(LinkClicked(QString)) ); + +} + +void MainUI::showQtInfo(){ + QMessageBox::aboutQt(this); +} + +void MainUI::showSponsor(QListWidgetItem *item){ + if(item->whatsThis().isEmpty()){ return; } + QProcess::startDetached("lumina-open \""+item->whatsThis()+"\""); +} + +void MainUI::LinkClicked(QString url){ + QProcess::startDetached("lumina-open \""+url+"\""); +} |