mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
Made possible to choose the edit style on compile time
This is just a for choosing the default edit style in the future. I prefer the new edit style as the user is sure what the hell is going on ( ie - if he chooses to edit, he is editing, there's a message warning him that he is editing and everything else is blocked till he finishes editing. ) and the GTK version is 'edit whenever I feel like', wich I think is more unsafe but dirk asked me to put an option and let the others choose. e Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
parent
ba30d070c9
commit
206a148e07
1 changed files with 16 additions and 0 deletions
|
@ -16,6 +16,10 @@
|
|||
#include <QLabel>
|
||||
#include <QDebug>
|
||||
|
||||
#define GTK_EDIT_STYLE 0
|
||||
#define TEST_EDIT_STYLE 1
|
||||
#define EDIT_STYLE GTK_EDIT_STYLE
|
||||
|
||||
MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
|
||||
ui(new Ui::MainTab()),
|
||||
weightModel(new WeightModel()),
|
||||
|
@ -27,7 +31,19 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
|
|||
ui->weights->setModel(weightModel);
|
||||
ui->diveNotesMessage->hide();
|
||||
ui->diveNotesMessage->setCloseButtonVisible(false);
|
||||
|
||||
#if EDIT_STYLE
|
||||
ui->rating->setReadOnly(true);
|
||||
#else
|
||||
ui->location->setReadOnly(false);
|
||||
ui->divemaster->setReadOnly(false);
|
||||
ui->buddy->setReadOnly(false);
|
||||
ui->suit->setReadOnly(false);
|
||||
ui->notes->setReadOnly(false);
|
||||
ui->rating->setReadOnly(false);
|
||||
ui->editNotes->hide();
|
||||
ui->resetNotes->hide();
|
||||
#endif
|
||||
|
||||
/* example of where code is more concise than Qt designer */
|
||||
QList<QObject *> infoTabWidgets = ui->infoTab->children();
|
||||
|
|
Loading…
Reference in a new issue