##// END OF EJS Templates
Better proxy support Wip....
Better proxy support Wip. Started centralised settings engine with GUI. Added QLopGUI engine to interact with QLop main window.

File last commit:

r15:b90d69939be9 default
r15:b90d69939be9 default
Show More
qlopsettingsdialog.cpp
70 lines | 1.9 KiB | text/x-c | CppLexer
/ src / Core / Widgets / qlopsettingsdialog.cpp
#include "qlopsettingsdialog.h"
#include "ui_qlopsettingsdialog.h"
QLopSettingsDialog::QLopSettingsDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::QLopSettingsDialog)
{
ui->setupUi(this);
connect(ui->contentsWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),this, SLOT(changePage(QListWidgetItem*,QListWidgetItem*)));
ui->contentsWidget->setViewMode(QListView::IconMode);
ui->contentsWidget->setIconSize(QSize(96, 84));
ui->contentsWidget->setMovement(QListView::Static);
ui->contentsWidget->setSpacing(12);
}
QLopSettingsDialog::~QLopSettingsDialog()
{
delete ui;
}
void QLopSettingsDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
void QLopSettingsDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous)
{
if (!current)
current = previous;
ui->pagesWidget->setCurrentIndex(ui->contentsWidget->row(current));
}
bool QLopSettingsDialog::registerConfigEntry(QWidget *configEntry, QIcon icon, QString text)
{
if(configEntry!=NULL)
{
ui->pagesWidget->addWidget(configEntry);
QListWidgetItem *configButton = new QListWidgetItem(ui->contentsWidget);
configButton->setIcon(icon);
configButton->setText(text);
configButton->setTextAlignment(Qt::AlignHCenter);
configButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
return true;
}
return false;
}
void QLopSettingsDialog::popConfigDialog(QWidget *selectedConfigEntry)
{
if(selectedConfigEntry!=NULL)
{
for(int i=0;i<ui->pagesWidget->count();i++)
{
if(ui->pagesWidget->widget(i)==selectedConfigEntry)
{
ui->pagesWidget->setCurrentIndex(i);
}
}
}
this->show();
}