mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Removed The button box from mainwindow, buttons are now on the message.
The button box on the bottom of the window made it a bit cluttered on small screens, this patch uses the window of the MessageWidget to show the butons - this way less space is used and things are better spaced on screen. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d26f109fba
commit
7ce12f1e8b
2 changed files with 29 additions and 47 deletions
|
@ -34,11 +34,19 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
|
||||||
ui.weights->setModel(weightModel);
|
ui.weights->setModel(weightModel);
|
||||||
ui.diveNotesMessage->hide();
|
ui.diveNotesMessage->hide();
|
||||||
ui.diveEquipmentMessage->hide();
|
ui.diveEquipmentMessage->hide();
|
||||||
ui.notesButtonBox->hide();
|
|
||||||
ui.equipmentButtonBox->hide();
|
|
||||||
ui.diveNotesMessage->setCloseButtonVisible(false);
|
ui.diveNotesMessage->setCloseButtonVisible(false);
|
||||||
ui.diveEquipmentMessage->setCloseButtonVisible(false);
|
ui.diveEquipmentMessage->setCloseButtonVisible(false);
|
||||||
|
|
||||||
|
QAction *action = new QAction(tr("Save"), this);
|
||||||
|
connect(action, SIGNAL(triggered(bool)), this, SLOT(acceptChanges()));
|
||||||
|
ui.diveEquipmentMessage->addAction(action);
|
||||||
|
ui.diveNotesMessage->addAction(action);
|
||||||
|
|
||||||
|
action = new QAction(tr("Cancel"), this);
|
||||||
|
connect(action, SIGNAL(triggered(bool)), this, SLOT(rejectChanges()));
|
||||||
|
ui.diveEquipmentMessage->addAction(action);
|
||||||
|
ui.diveNotesMessage->addAction(action);
|
||||||
|
|
||||||
if (qApp->style()->objectName() == "oxygen")
|
if (qApp->style()->objectName() == "oxygen")
|
||||||
setDocumentMode(true);
|
setDocumentMode(true);
|
||||||
else
|
else
|
||||||
|
@ -77,10 +85,6 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
|
||||||
|
|
||||||
connect(ui.cylinders->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editCylinderWidget(QModelIndex)));
|
connect(ui.cylinders->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editCylinderWidget(QModelIndex)));
|
||||||
connect(ui.weights->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editWeightWidget(QModelIndex)));
|
connect(ui.weights->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editWeightWidget(QModelIndex)));
|
||||||
connect(ui.notesButtonBox, SIGNAL(accepted()), this, SLOT(acceptChanges()));
|
|
||||||
connect(ui.notesButtonBox, SIGNAL(rejected()), this, SLOT(rejectChanges()));
|
|
||||||
connect(ui.equipmentButtonBox, SIGNAL(accepted()), this, SLOT(acceptChanges()));
|
|
||||||
connect(ui.equipmentButtonBox, SIGNAL(rejected()), this, SLOT(rejectChanges()));
|
|
||||||
|
|
||||||
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate());
|
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate());
|
||||||
ui.weights->view()->setItemDelegateForColumn(WeightModel::TYPE, new WSInfoDelegate());
|
ui.weights->view()->setItemDelegateForColumn(WeightModel::TYPE, new WSInfoDelegate());
|
||||||
|
@ -169,8 +173,6 @@ void MainTab::enableEdition(EditMode newEditMode)
|
||||||
mainWindow()->globe()->prepareForGetDiveCoordinates();
|
mainWindow()->globe()->prepareForGetDiveCoordinates();
|
||||||
// We may be editing one or more dives here. backup everything.
|
// We may be editing one or more dives here. backup everything.
|
||||||
notesBackup.clear();
|
notesBackup.clear();
|
||||||
ui.notesButtonBox->show();
|
|
||||||
ui.equipmentButtonBox->show();
|
|
||||||
if (mainWindow() && mainWindow()->dive_list()->selectedTrips().count() == 1) {
|
if (mainWindow() && mainWindow()->dive_list()->selectedTrips().count() == 1) {
|
||||||
// we are editing trip location and notes
|
// we are editing trip location and notes
|
||||||
ui.diveNotesMessage->setText(tr("This trip is being edited. Select Save or Cancel when done."));
|
ui.diveNotesMessage->setText(tr("This trip is being edited. Select Save or Cancel when done."));
|
||||||
|
@ -513,8 +515,6 @@ void MainTab::acceptChanges()
|
||||||
tabBar()->setTabIcon(1, QIcon()); // Equipment
|
tabBar()->setTabIcon(1, QIcon()); // Equipment
|
||||||
ui.diveNotesMessage->animatedHide();
|
ui.diveNotesMessage->animatedHide();
|
||||||
ui.diveEquipmentMessage->animatedHide();
|
ui.diveEquipmentMessage->animatedHide();
|
||||||
ui.notesButtonBox->hide();
|
|
||||||
ui.equipmentButtonBox->hide();
|
|
||||||
/* now figure out if things have changed */
|
/* now figure out if things have changed */
|
||||||
if (mainWindow() && mainWindow()->dive_list()->selectedTrips().count() == 1) {
|
if (mainWindow() && mainWindow()->dive_list()->selectedTrips().count() == 1) {
|
||||||
if (notesBackup[NULL].notes != ui.notes->toPlainText() ||
|
if (notesBackup[NULL].notes != ui.notes->toPlainText() ||
|
||||||
|
@ -715,8 +715,6 @@ void MainTab::rejectChanges()
|
||||||
ui.diveNotesMessage->animatedHide();
|
ui.diveNotesMessage->animatedHide();
|
||||||
ui.diveEquipmentMessage->animatedHide();
|
ui.diveEquipmentMessage->animatedHide();
|
||||||
mainWindow()->dive_list()->setEnabled(true);
|
mainWindow()->dive_list()->setEnabled(true);
|
||||||
ui.notesButtonBox->hide();
|
|
||||||
ui.equipmentButtonBox->hide();
|
|
||||||
notesBackup.clear();
|
notesBackup.clear();
|
||||||
resetPallete();
|
resetPallete();
|
||||||
editMode = NONE;
|
editMode = NONE;
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>501</width>
|
<width>493</width>
|
||||||
<height>535</height>
|
<height>586</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
@ -170,6 +170,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="14" column="0" colspan="2">
|
||||||
|
<widget class="QTextEdit" name="notes">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="10" column="1">
|
<item row="10" column="1">
|
||||||
<widget class="QLineEdit" name="suit">
|
<widget class="QLineEdit" name="suit">
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
|
@ -195,10 +202,10 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="14" column="0" colspan="2">
|
<item row="13" column="0">
|
||||||
<widget class="QTextEdit" name="notes">
|
<widget class="QLabel" name="NotesLabel">
|
||||||
<property name="readOnly">
|
<property name="text">
|
||||||
<bool>false</bool>
|
<string>Notes</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -219,20 +226,6 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="13" column="0">
|
|
||||||
<widget class="QLabel" name="NotesLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Notes</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="15" column="0" colspan="2">
|
|
||||||
<widget class="QDialogButtonBox" name="notesButtonBox">
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Save</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="12" column="0" colspan="2">
|
<item row="12" column="0" colspan="2">
|
||||||
<widget class="TagWidget" name="tagWidget">
|
<widget class="TagWidget" name="tagWidget">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -285,8 +278,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>515</width>
|
<width>507</width>
|
||||||
<height>473</height>
|
<height>459</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_5">
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
|
@ -338,13 +331,6 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QDialogButtonBox" name="equipmentButtonBox">
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Save</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -372,8 +358,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>515</width>
|
<width>492</width>
|
||||||
<height>473</height>
|
<height>375</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_6">
|
<layout class="QGridLayout" name="gridLayout_6">
|
||||||
|
@ -679,8 +665,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>515</width>
|
<width>323</width>
|
||||||
<height>473</height>
|
<height>130</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_7">
|
<layout class="QGridLayout" name="gridLayout_7">
|
||||||
|
@ -857,9 +843,7 @@
|
||||||
<tabstop>suit</tabstop>
|
<tabstop>suit</tabstop>
|
||||||
<tabstop>tagWidget</tabstop>
|
<tabstop>tagWidget</tabstop>
|
||||||
<tabstop>notes</tabstop>
|
<tabstop>notes</tabstop>
|
||||||
<tabstop>notesButtonBox</tabstop>
|
|
||||||
<tabstop>scrollArea_2</tabstop>
|
<tabstop>scrollArea_2</tabstop>
|
||||||
<tabstop>equipmentButtonBox</tabstop>
|
|
||||||
<tabstop>scrollArea_3</tabstop>
|
<tabstop>scrollArea_3</tabstop>
|
||||||
<tabstop>scrollArea_4</tabstop>
|
<tabstop>scrollArea_4</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue