mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Ajout d'une option permettant d'utiliser ou non les couleurs systeme.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@680 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -101,9 +101,13 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ConfigPage
|
||||
|
||||
// acces a la configuration de QElectroTech
|
||||
QSettings &settings = QETApp::settings();
|
||||
bool use_system_colors = settings.value("usesystemcolors", "true").toBool();
|
||||
bool tabbed = settings.value("diagrameditor/viewmode", "tabbed") == "tabbed";
|
||||
bool integrate_elements = settings.value("diagrameditor/integrate-elements", true).toBool();
|
||||
|
||||
appearance_ = new QGroupBox(tr("Apparence"), this);
|
||||
use_system_colors_ = new QCheckBox(tr("Utiliser les couleurs du syst\350me"), appearance_);
|
||||
|
||||
projects_view_mode_ = new QGroupBox(tr("Projets"), this);
|
||||
windowed_mode_ = new QRadioButton(tr("Utiliser des fen\352tres"), projects_view_mode_);
|
||||
tabbed_mode_ = new QRadioButton(tr("Utiliser des onglets"), projects_view_mode_);
|
||||
@@ -112,6 +116,8 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ConfigPage
|
||||
elements_management_ = new QGroupBox(tr("Gestion des \351l\351ments"), this);
|
||||
integrate_elements_ = new QCheckBox(tr("Int\351grer automatiquement les \351l\351ments dans les projets (recommand\351)"), elements_management_);
|
||||
|
||||
use_system_colors_ -> setChecked(use_system_colors);
|
||||
|
||||
if (tabbed) {
|
||||
tabbed_mode_ -> setChecked(true);
|
||||
} else {
|
||||
@@ -120,6 +126,10 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ConfigPage
|
||||
|
||||
integrate_elements_ -> setChecked(integrate_elements);
|
||||
|
||||
QVBoxLayout *appearance_layout = new QVBoxLayout();
|
||||
appearance_layout -> addWidget(use_system_colors_);
|
||||
appearance_ -> setLayout(appearance_layout);
|
||||
|
||||
QVBoxLayout *projects_view_mode_layout = new QVBoxLayout();
|
||||
projects_view_mode_layout -> addWidget(windowed_mode_);
|
||||
projects_view_mode_layout -> addWidget(tabbed_mode_);
|
||||
@@ -139,6 +149,7 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ConfigPage
|
||||
horiz_line_ -> setFrameShape(QFrame::HLine);
|
||||
vlayout1 -> addWidget(horiz_line_);
|
||||
|
||||
vlayout1 -> addWidget(appearance_);
|
||||
vlayout1 -> addWidget(projects_view_mode_);
|
||||
vlayout1 -> addWidget(elements_management_);
|
||||
vlayout1 -> addStretch();
|
||||
@@ -156,6 +167,13 @@ GeneralConfigurationPage::~GeneralConfigurationPage() {
|
||||
void GeneralConfigurationPage::applyConf() {
|
||||
QSettings &settings = QETApp::settings();
|
||||
|
||||
bool was_using_system_colors = settings.value("usesystemcolors", "true").toBool();
|
||||
bool must_use_system_colors = use_system_colors_ -> isChecked();
|
||||
settings.setValue("usesystemcolors", must_use_system_colors);
|
||||
if (was_using_system_colors != must_use_system_colors) {
|
||||
QETApp::instance() -> useSystemPalette(must_use_system_colors);
|
||||
}
|
||||
|
||||
QString view_mode = tabbed_mode_ -> isChecked() ? "tabbed" : "windowed";
|
||||
settings.setValue("diagrameditor/viewmode", view_mode) ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user