[Kstars-devel] KDE/kdeedu/kstars/kstars/tools

Jason Harris kstars at 30doradus.org
Sat Nov 17 15:44:01 CET 2007


SVN commit 737972 by harris:

Disable the MiniButton until I can figure out how to resize the window
in response to its content.  This has been really frustrating, and I
am no closer to a solution.

Better usability when selecting zero or >1 objects.  Don't show an
object name in the "NotesLabel", and clear the "NotesEdit" box.

CCMAIL: kstars-devel at kde.org



 M  +21 -9     observinglist.cpp  
 M  +3 -28     observinglist.ui  


--- trunk/KDE/kdeedu/kstars/kstars/tools/observinglist.cpp #737971:737972
@@ -84,6 +84,8 @@
     m_SortModel->setSourceModel( m_Model );
     m_SortModel->setDynamicSortFilter( true );
     ui->TableView->setModel( m_SortModel );
+    ui->TableView->horizontalHeader()->setStretchLastSection( true );
+    ui->TableView->horizontalHeader()->setResizeMode( QHeaderView::ResizeToContents );
 
     //Connections
     connect( this, SIGNAL( closeClicked() ), this, SLOT( slotClose() ) );
@@ -128,6 +130,9 @@
     ui->RemoveButton->setEnabled( false );
     ui->NotesLabel->setEnabled( false );
     ui->NotesEdit->setEnabled( false );
+
+    //Hide the MiniButton until I can figure out how to resize the Dialog!
+    ui->MiniButton->hide();
 }
 
 bool ObservingList::contains( const SkyObject *q ) {
@@ -305,12 +310,15 @@
         ui->DetailsButton->setEnabled( false );
         ui->AVTButton->setEnabled( false );
         ui->RemoveButton->setEnabled( false );
+        //FIXME: after 4.0, set this label to "Select one object to record notes on it here"
+        ui->NotesLabel->setText( i18n( "observing notes for object:" ) );
         ui->NotesLabel->setEnabled( false );
         ui->NotesEdit->setEnabled( false );
         m_CurrentObject = 0;
 
         //Clear the user log text box.
         saveCurrentUserLog();
+        ui->NotesEdit->setPlainText("");
 
     } else { //more than one object selected.
         ui->CenterButton->setEnabled( false );
@@ -318,12 +326,15 @@
         ui->DetailsButton->setEnabled( false );
         ui->AVTButton->setEnabled( true );
         ui->RemoveButton->setEnabled( true );
+        //FIXME: after 4.0, set this label to "Select one object to record notes on it here"
+        ui->NotesLabel->setText( i18n( "observing notes for object:" ) );
         ui->NotesLabel->setEnabled( false );
         ui->NotesEdit->setEnabled( false );
         m_CurrentObject = 0;
 
         //Clear the user log text box.
         saveCurrentUserLog();
+        ui->NotesEdit->setPlainText("");
     }
 
 }
@@ -643,7 +654,14 @@
 void ObservingList::slotToggleSize() {
     if ( isLarge() ) {
         ui->MiniButton->setIcon( KIcon("view-fullscreen") );
+        //Abbreviate text on each button
 
+        ui->CenterButton->setText( i18nc( "First letter in 'Center'", "C" ) );
+        ui->ScopeButton->setText( i18nc( "First letter in 'Scope'", "S" ) );
+        ui->DetailsButton->setText( i18nc( "First letter in 'Details'", "D" ) );
+        ui->AVTButton->setText( i18nc( "First letter in 'Alt vs Time'", "A" ) );
+        ui->RemoveButton->setText( i18nc( "First letter in 'Remove'", "R" ) );
+
         //Hide columns 1-5
         ui->TableView->hideColumn(1);
         ui->TableView->hideColumn(2);
@@ -651,16 +669,10 @@
         ui->TableView->hideColumn(4);
         ui->TableView->hideColumn(5);
 
-        //Hide the horizontal header
+        //Hide the headers
         ui->TableView->horizontalHeader()->hide();
+        ui->TableView->verticalHeader()->hide();
 
-        //Abbreviate text on each button
-        ui->CenterButton->setText( i18nc( "First letter in 'Center'", "C" ) );
-        ui->ScopeButton->setText( i18nc( "First letter in 'Scope'", "S" ) );
-        ui->DetailsButton->setText( i18nc( "First letter in 'Details'", "D" ) );
-        ui->AVTButton->setText( i18nc( "First letter in 'Alt vs Time'", "A" ) );
-        ui->RemoveButton->setText( i18nc( "First letter in 'Remove'", "R" ) );
-
         //Hide Observing notes
         ui->NotesLabel->hide();
         ui->NotesEdit->hide();
@@ -677,7 +689,7 @@
         int left, right, top, bottom;
         ui->layout()->getContentsMargins( &left, &top, &right, &bottom );
 
-        ui->TableView->resize( w + left + right, height() );
+        resize( w + left + right, height() );
 
         bIsLarge = false;
 
--- trunk/KDE/kdeedu/kstars/kstars/tools/observinglist.ui #737971:737972
@@ -5,7 +5,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>560</width>
+    <width>415</width>
     <height>491</height>
    </rect>
   </property>
@@ -176,7 +176,7 @@
        </property>
        <property name="sizeHint" >
         <size>
-         <width>350</width>
+         <width>40</width>
          <height>20</height>
         </size>
        </property>
@@ -356,9 +356,6 @@
      <property name="editTriggers" >
       <set>QAbstractItemView::NoEditTriggers</set>
      </property>
-     <property name="alternatingRowColors" >
-      <bool>true</bool>
-     </property>
      <property name="selectionBehavior" >
       <enum>QAbstractItemView::SelectRows</enum>
      </property>
@@ -398,29 +395,7 @@
     </widget>
    </item>
    <item>
-    <widget class="KTextEdit" name="NotesEdit" >
-     <property name="sizePolicy" >
-      <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
-       <horstretch>0</horstretch>
-       <verstretch>1</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize" >
-      <size>
-       <width>0</width>
-       <height>100</height>
-      </size>
-     </property>
-     <property name="maximumSize" >
-      <size>
-       <width>32767</width>
-       <height>160</height>
-      </size>
-     </property>
-     <property name="whatsThis" >
-      <string>Your observing notes for the highlighted object</string>
-     </property>
-    </widget>
+    <widget class="KTextEdit" name="NotesEditt" />
    </item>
   </layout>
  </widget>


More information about the Kstars-devel mailing list