[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/akonadi/clients/akonadiconsole
From:       Volker Krause <vkrause () kde ! org>
Date:       2008-03-21 16:38:59
Message-ID: 1206117539.449956.4295.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 788479 by vkrause:

Show some more information about the current item.


 M  +28 -3     browserwidget.cpp  
 M  +1 -0      browserwidget.h  
 M  +217 -27   browserwidget_contentview.ui  


--- trunk/KDE/kdepim/akonadi/clients/akonadiconsole/browserwidget.cpp #788478:788479
@@ -39,6 +39,7 @@
 
 #include <kdebug.h>
 #include <kconfig.h>
+#include <kmessagebox.h>
 #include <kxmlguiwindow.h>
 
 #include <QSplitter>
@@ -97,6 +98,7 @@
   contentUi.setupUi( contentViewParent );
   connect( contentUi.saveButton, SIGNAL(clicked()), SLOT(save()) );
   splitter2->addWidget( contentViewParent );
+  contentUi.partCombo->addItem( "Body" );
 
   CollectionPropertiesDialog::registerPage( new CollectionAttributePageFactory() );
   CollectionPropertiesDialog::registerPage( new CollectionInternalsPageFactory() );
@@ -137,10 +139,20 @@
       contentUi.addresseeView->setAddressee( addr );
       contentUi.stack->setCurrentWidget( contentUi.addresseeViewPage );
     } else {
-      QByteArray data = item.part( Item::PartBody );
-      contentUi.dataView->setPlainText( data );
-      contentUi.stack->setCurrentWidget( contentUi.dataViewPage );
+      contentUi.stack->setCurrentWidget( contentUi.unsupportedTypePage );
     }
+
+    QByteArray data = item.part( Item::PartBody );
+    contentUi.dataView->setPlainText( data );
+
+    contentUi.id->setText( QString::number( item.reference().id() ) );
+    contentUi.remoteId->setText( item.reference().remoteId() );
+    contentUi.mimeType->setText( item.mimeType() );
+    contentUi.revision->setText( QString::number( item.rev() ) );
+    QStringList flags;
+    foreach ( const Item::Flag &f, item.flags() )
+      flags << QString::fromUtf8( f );
+    contentUi.flags->setItems( flags );
   }
 }
 
@@ -169,9 +181,15 @@
 {
   const QByteArray data = contentUi.dataView->toPlainText().toUtf8();
   Item item = mCurrentItem;
+  item.setRemoteId( contentUi.remoteId->text() );
+  foreach ( const Item::Flag f, mCurrentItem.flags() )
+    item.unsetFlag( f );
+  foreach ( const QString s, contentUi.flags->items() )
+    item.setFlag( s.toUtf8() );
   item.addPart( Item::PartBody, data );
   ItemStoreJob *store = new ItemStoreJob( item, this );
   store->storePayload();
+  connect( store, SIGNAL(result(KJob*)), SLOT(saveResult(KJob*)) );
 }
 
 QItemSelectionModel * BrowserWidget::collectionSelectionModel() const
@@ -184,4 +202,11 @@
   return itemUi.itemView->selectionModel();
 }
 
+void BrowserWidget::saveResult(KJob * job)
+{
+  if ( job->error() ) {
+    KMessageBox::error( this, i18n( "Failed to save changes: %1", job->errorString() ) );
+  }
+}
+
 #include "browserwidget.moc"
--- trunk/KDE/kdepim/akonadi/clients/akonadiconsole/browserwidget.h #788478:788479
@@ -56,6 +56,7 @@
     void itemFetchDone( KJob *job );
     void modelChanged();
     void save();
+    void saveResult( KJob* job );
 
   private:
     Akonadi::CollectionModel *mCollectionModel;
--- trunk/KDE/kdepim/akonadi/clients/akonadiconsole/browserwidget_contentview.ui #788478:788479
@@ -5,72 +5,262 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>400</width>
-    <height>300</height>
+    <width>507</width>
+    <height>438</height>
    </rect>
   </property>
-  <layout class="QVBoxLayout" >
-   <item>
-    <widget class="QStackedWidget" name="stack" >
-     <property name="frameShadow" >
-      <enum>QFrame::Sunken</enum>
-     </property>
+  <layout class="QGridLayout" name="gridLayout_2" >
+   <item row="0" column="0" colspan="2" >
+    <widget class="KTabWidget" name="ktabwidget" >
      <property name="currentIndex" >
       <number>0</number>
      </property>
-     <widget class="QWidget" name="dataViewPage" >
-      <layout class="QGridLayout" >
-       <item row="0" column="0" colspan="2" >
-        <widget class="QTextEdit" name="dataView" >
-         <property name="lineWrapMode" >
-          <enum>QTextEdit::NoWrap</enum>
+     <widget class="QWidget" name="tab" >
+      <property name="geometry" >
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>487</width>
+        <height>352</height>
+       </rect>
+      </property>
+      <attribute name="title" >
+       <string>Payload</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout" >
+       <item>
+        <widget class="QStackedWidget" name="stack" >
+         <property name="frameShadow" >
+          <enum>QFrame::Sunken</enum>
          </property>
-         <property name="acceptRichText" >
-          <bool>false</bool>
+         <property name="currentIndex" >
+          <number>0</number>
          </property>
+         <widget class="QWidget" name="unsupportedTypePage" >
+          <property name="geometry" >
+           <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>479</width>
+            <height>344</height>
+           </rect>
+          </property>
+          <layout class="QVBoxLayout" name="verticalLayout_2" >
+           <item>
+            <widget class="QLabel" name="unsupportedType" >
+             <property name="text" >
+              <string>Unsupported Type</string>
+             </property>
+             <property name="alignment" >
+              <set>Qt::AlignCenter</set>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="addresseeViewPage" >
+          <property name="geometry" >
+           <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>479</width>
+            <height>344</height>
+           </rect>
+          </property>
+          <layout class="QVBoxLayout" >
+           <item>
+            <widget class="KPIM::AddresseeView" name="addresseeView" />
+           </item>
+          </layout>
+         </widget>
         </widget>
        </item>
-       <item row="1" column="0" >
-        <spacer>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_2" >
+      <property name="geometry" >
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>487</width>
+        <height>352</height>
+       </rect>
+      </property>
+      <attribute name="title" >
+       <string>Parts</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout" >
+       <item row="0" column="0" >
+        <spacer name="horizontalSpacer" >
          <property name="orientation" >
           <enum>Qt::Horizontal</enum>
          </property>
-         <property name="sizeHint" >
+         <property name="sizeHint" stdset="0" >
           <size>
-           <width>40</width>
+           <width>345</width>
            <height>20</height>
           </size>
          </property>
         </spacer>
        </item>
-       <item row="1" column="1" >
-        <widget class="KPushButton" name="saveButton" >
+       <item row="0" column="1" >
+        <widget class="QLabel" name="label" >
          <property name="text" >
-          <string>&amp;Save</string>
+          <string>&amp;Part:</string>
          </property>
+         <property name="buddy" >
+          <cstring>partCombo</cstring>
+         </property>
         </widget>
        </item>
+       <item row="0" column="2" >
+        <widget class="KComboBox" name="partCombo" />
+       </item>
+       <item row="1" column="0" colspan="3" >
+        <widget class="QTextEdit" name="dataView" >
+         <property name="lineWrapMode" >
+          <enum>QTextEdit::NoWrap</enum>
+         </property>
+         <property name="acceptRichText" >
+          <bool>false</bool>
+         </property>
+        </widget>
+       </item>
       </layout>
      </widget>
-     <widget class="QWidget" name="addresseeViewPage" >
-      <layout class="QVBoxLayout" >
-       <item>
-        <widget class="KPIM::AddresseeView" name="addresseeView" />
+     <widget class="QWidget" name="tab_3" >
+      <property name="geometry" >
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>487</width>
+        <height>352</height>
+       </rect>
+      </property>
+      <attribute name="title" >
+       <string>Internals</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_3" >
+       <item row="0" column="0" >
+        <widget class="QLabel" name="label_2" >
+         <property name="text" >
+          <string>Unique ID:</string>
+         </property>
+        </widget>
        </item>
+       <item row="0" column="1" >
+        <widget class="QLabel" name="id" >
+         <property name="text" >
+          <string>0</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="0" >
+        <widget class="QLabel" name="label_4" >
+         <property name="text" >
+          <string>Remote ID:</string>
+         </property>
+         <property name="buddy" >
+          <cstring>remoteId</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1" >
+        <widget class="KLineEdit" name="remoteId" />
+       </item>
+       <item row="2" column="0" >
+        <widget class="QLabel" name="label_3" >
+         <property name="text" >
+          <string>Revision:</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1" >
+        <widget class="QLabel" name="revision" >
+         <property name="text" >
+          <string>0</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="0" >
+        <widget class="QLabel" name="label_6" >
+         <property name="text" >
+          <string>Mimetype:</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="1" >
+        <widget class="QLabel" name="mimeType" >
+         <property name="text" >
+          <string>invalid/invalid</string>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="0" colspan="2" >
+        <widget class="KEditListBox" name="flags" >
+         <property name="title" >
+          <string>Flags</string>
+         </property>
+         <property name="buttons" >
+          <set>KEditListBox::Add|KEditListBox::Remove</set>
+         </property>
+        </widget>
+       </item>
       </layout>
      </widget>
     </widget>
    </item>
+   <item row="1" column="0" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0" >
+      <size>
+       <width>40</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="1" >
+    <widget class="KPushButton" name="saveButton" >
+     <property name="text" >
+      <string>&amp;Save</string>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <layoutdefault spacing="6" margin="0" />
  <customwidgets>
   <customwidget>
+   <class>KComboBox</class>
+   <extends>QComboBox</extends>
+   <header>kcombobox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>KEditListBox</class>
+   <extends>QGroupBox</extends>
+   <header>keditlistbox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>KLineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>klineedit.h</header>
+  </customwidget>
+  <customwidget>
    <class>KPushButton</class>
    <extends>QPushButton</extends>
    <header>kpushbutton.h</header>
   </customwidget>
   <customwidget>
+   <class>KTabWidget</class>
+   <extends>QTabWidget</extends>
+   <header>ktabwidget.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
    <class>KPIM::AddresseeView</class>
    <extends>KTextBrowser</extends>
    <header location="global" >libkdepim/addresseeview.h</header>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic