Commit cc7aa3a2 authored by Jasem Mutlaq's avatar Jasem Mutlaq

Improve space usage in observation plannner

parent f1c93b07
......@@ -101,6 +101,7 @@ ObservingList::ObservingList()
ui = new ObservingListUI(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(ui);
mainLayout->setMargin(3);
setWindowTitle(i18n("Observation Planner"));
// Close button seems redundant since one can close the window -- occupies space
......@@ -198,8 +199,7 @@ ObservingList::ObservingList()
ui->WizardButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
ui->MiniButton->setIcon(QIcon::fromTheme("view-restore", QIcon(":/icons/breeze/default/view-restore.svg")));
noSelection = true;
showScope = false;
ui->NotesLabel->setEnabled(false);
showScope = false;
ui->NotesEdit->setEnabled(false);
ui->SetTime->setEnabled(false);
ui->TimeEdit->setEnabled(false);
......@@ -584,10 +584,8 @@ void ObservingList::slotNewSelection()
//First, save the last object's user log to disk, if necessary
saveCurrentUserLog(); //uses LogObject, which is still the previous obj.
//set LogObject to the new selected object
LogObject = currentObject();
ui->NotesLabel->setEnabled(true);
ui->NotesEdit->setEnabled(true);
ui->NotesLabel->setText(i18n("observing notes for %1:", getObjectName(LogObject)));
LogObject = currentObject();
ui->NotesEdit->setEnabled(true);
if (LogObject->userLog().isEmpty())
{
ui->NotesEdit->setPlainText(
......@@ -607,9 +605,7 @@ void ObservingList::slotNewSelection()
else //selected object is named "star"
{
//clear the log text box
saveCurrentUserLog();
ui->NotesLabel->setText(i18n("observing notes (disabled for unnamed star)"));
ui->NotesLabel->setEnabled(false);
saveCurrentUserLog();
ui->NotesEdit->clear();
ui->NotesEdit->setEnabled(false);
ui->SearchImage->setEnabled(false);
......@@ -674,9 +670,7 @@ void ObservingList::slotNewSelection()
if (selectedItems.size() == 0) //Nothing selected
{
//Disable buttons
noSelection = true;
ui->NotesLabel->setText(i18n("Select an object to record notes on it here:"));
ui->NotesLabel->setEnabled(false);
noSelection = true;
ui->NotesEdit->setEnabled(false);
m_CurrentObject = 0;
ui->TimeEdit->setEnabled(false);
......@@ -689,9 +683,7 @@ void ObservingList::slotNewSelection()
ui->avt->removeAllPlotObjects();
}
else //more than one object selected.
{
ui->NotesLabel->setText(i18n("Select a single object to record notes on it here:"));
ui->NotesLabel->setEnabled(false);
{
ui->NotesEdit->setEnabled(false);
ui->TimeEdit->setEnabled(false);
ui->SetTime->setEnabled(false);
......@@ -866,7 +858,6 @@ void ObservingList::saveCurrentUserLog()
{
LogObject->saveUserLog(ui->NotesEdit->toPlainText());
ui->NotesEdit->clear();
ui->NotesLabel->setText(i18n("Observing notes for object:"));
LogObject = nullptr;
}
}
......@@ -1220,8 +1211,7 @@ void ObservingList::slotToggleSize()
//Hide the headers
ui->WishListView->horizontalHeader()->hide();
ui->WishListView->verticalHeader()->hide();
//Hide Observing notes
ui->NotesLabel->hide();
//Hide Observing notes
ui->NotesEdit->hide();
//ui->kseparator->hide();
ui->avt->hide();
......@@ -1268,7 +1258,6 @@ void ObservingList::slotToggleSize()
ui->refLabel->setText(i18nc("Abbreviation for Reference Images:", "Reference Images:"));
ui->addLabel->setText(i18nc("Add objects to a list", "Adding Objects:"));
//Show Observing notes
ui->NotesLabel->show();
ui->NotesEdit->show();
//ui->kseparator->show();
ui->setMinimumSize(837, 650);
......@@ -1284,8 +1273,6 @@ void ObservingList::slotChangeTab(int index)
{
noSelection = true;
saveCurrentUserLog();
ui->NotesLabel->setText(i18n("Select an object to record notes on it here:"));
ui->NotesLabel->setEnabled(false);
ui->NotesEdit->setEnabled(false);
ui->TimeEdit->setEnabled(false);
ui->SetTime->setEnabled(false);
......
......@@ -6,27 +6,30 @@
<rect>
<x>0</x>
<y>0</y>
<width>776</width>
<height>650</height>
<width>654</width>
<height>576</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<height>650</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_1">
<layout class="QHBoxLayout" name="toolLayout">
<property name="spacing">
<number>6</number>
<number>3</number>
</property>
<property name="leftMargin">
<number>0</number>
......@@ -190,7 +193,10 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QHBoxLayout" name="LocationTimeLayout">
<property name="spacing">
<number>3</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
......@@ -281,7 +287,10 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QHBoxLayout" name="addingObjectsLayout">
<property name="spacing">
<number>3</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
......@@ -384,7 +393,10 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<layout class="QHBoxLayout" name="WishSessionLayout" stretch="2,1">
<property name="spacing">
<number>3</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
......@@ -410,6 +422,21 @@
<string>Wish List</string>
</attribute>
<layout class="QVBoxLayout">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QTableView" name="WishListView">
<property name="sizePolicy">
......@@ -442,6 +469,21 @@
<string>Session Plan</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QTableView" name="SessionView">
<property name="sizePolicy">
......@@ -469,6 +511,9 @@
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="spacing">
<number>3</number>
</property>
<item>
<widget class="QLabel" name="scheduledTimeLabel">
<property name="text">
......@@ -506,7 +551,10 @@
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QVBoxLayout" name="objectInfoLayout">
<property name="spacing">
<number>3</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
......@@ -547,6 +595,9 @@
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing">
<number>3</number>
</property>
<item>
<widget class="QLabel" name="ImagePreview">
<property name="minimumSize">
......@@ -568,6 +619,9 @@
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="dssMetadataLabel">
<property name="sizePolicy">
......@@ -595,6 +649,9 @@
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>3</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
......@@ -634,52 +691,10 @@
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="NotesLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Sans Serif</family>
<pointsize>9</pointsize>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font>
</property>
<property name="text">
<string>Select an object to record notes on it here:</string>
</property>
<property name="alignment">
<set>Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="NotesEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>120</height>
</size>
<property name="placeholderText">
<string>Record object notes here.</string>
</property>
</widget>
</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment