OSDN Git Service

add trash button
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Fri, 2 Jul 2004 15:54:24 +0000 (15:54 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Fri, 2 Jul 2004 15:54:24 +0000 (15:54 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@1216 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/libkita/datinfo.cpp
kita/src/libkita/threadinfo.cpp
kita/src/libkita/threadinfo.h
kita/src/part/kitathreadview.cpp
kita/src/part/kitathreadview.h
kita/src/part/kitathreadviewbase.ui

index 36c3d5c..c4971f0 100644 (file)
@@ -326,7 +326,8 @@ bool DatInfo::deleteCache(QWidget* parent){
    if ( m_nowLoading ) return FALSE;
 
    bool ret = FALSE;
-   if( !m_thread ) ret = Kita::Access::deleteLog( m_thread, parent );
+   if( m_thread ) ret = Kita::Access::deleteLog( m_thread, parent );
+   KitaThreadInfo::removeThreadInfo( m_datURL.prettyURL() );
    if(ret) initPrivate();
 
    return ret;
index 9c8b668..fa4cdc5 100644 (file)
@@ -92,6 +92,12 @@ void KitaThreadInfo::replace( const QString fromURL, const QString toURL )
     }
 }
 
+void KitaThreadInfo::removeThreadInfo( const QString& url )
+{
+    KitaThreadInfo * instance = KitaThreadInfo::getInstance();
+    instance->m_readDict.remove( url );
+}
+
 QDataStream& operator<<( QDataStream& s, KitaThreadInfo& c )
 {
     s << c.m_readDict;
index dce8e8f..35d226f 100644 (file)
@@ -29,6 +29,7 @@ public:
     static void setResNum( const QString& url, int num );
     static int resNum( const QString& url );
     static void replace( const QString fromURL, const QString toURL );
+    static void removeThreadInfo( const QString& url );
     friend QDataStream& operator<<( QDataStream& s, KitaThreadInfo& c );
     friend QDataStream& operator>>( QDataStream& s, KitaThreadInfo& c );
 private:
index a6b6225..1b77662 100644 (file)
@@ -94,6 +94,7 @@ KitaThreadView::KitaThreadView( QWidget* parent, const char* name )
         GobackAnchorButton->setPixmap( SmallIcon( "2leftarrow" ) );
         BookmarkButton->setPixmap( SmallIcon( "bookmark_add" ) );
         writeButton->setPixmap( SmallIcon( "pencil" ) );
+        deleteButton->setPixmap( SmallIcon( "edittrash" ) );
     }
 
     setAcceptDrops( true ); // DND Drop eneble: 2nd stage. - enable on "KitaThreadView" widget and disable on the others(child widgets of "KitaThreadView").
@@ -102,7 +103,8 @@ KitaThreadView::KitaThreadView( QWidget* parent, const char* name )
 
     m_threadPart->enableMetaRefresh( false ); //disable <meta refresh="...">
 
-
+    connect( deleteButton, SIGNAL( clicked() ),
+             SLOT( slotDeleteButtonClicked() ) );
     connect( writeButton, SIGNAL( clicked() ),
              SLOT( slotWriteButtonClicked() ) );
     connect( m_threadPart, SIGNAL( openWriteDialog( QString ) ),
@@ -713,6 +715,11 @@ void KitaThreadView::slotComboActivated( int index )
     }
 }
 
+void KitaThreadView::slotDeleteButtonClicked()
+{
+    Kita::DatManager::deleteCache( threadURL(), this );
+}
+
 /*--------------------------------------------------------*/
 /* These public functions are used for KitaNavi & preview */
 /*--------------------------------------------------------*/
index 5bf49a5..38ff0fd 100644 (file)
@@ -114,6 +114,7 @@ private slots:
     void slotShowErrorDialog( const QString& input, const KURL& urlOfInput = 0 );
     void slotComboActivated( int index );
     void slotUpdateInfo();
+    void slotDeleteButtonClicked();
 
 signals:
     void showThreadCompleted( const KURL& threadUrl );
index f0ee97d..c28629e 100644 (file)
@@ -8,7 +8,7 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>804</width>
+            <width>870</width>
             <height>480</height>
         </rect>
     </property>
                         <cstring>GobackAnchorButton</cstring>
                     </property>
                     <property name="text">
-                        <string>GobackAnchor</string>
+                        <string>Goback</string>
                     </property>
                     <property name="toolTip" stdset="0">
                         <string>go back anchor</string>
                         <bool>false</bool>
                     </property>
                     <property name="text">
-                        <string>AddBookmark</string>
+                        <string>Bookmark</string>
                     </property>
                     <property name="toggleButton">
                         <bool>true</bool>
                         <enum>Horizontal</enum>
                     </property>
                     <property name="sizeType">
+                        <enum>Fixed</enum>
+                    </property>
+                    <property name="sizeHint">
+                        <size>
+                            <width>40</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget class="QToolButton">
+                    <property name="name">
+                        <cstring>deleteButton</cstring>
+                    </property>
+                    <property name="text">
+                        <string>Delete</string>
+                    </property>
+                </widget>
+                <spacer>
+                    <property name="name">
+                        <cstring>spacer2</cstring>
+                    </property>
+                    <property name="orientation">
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property name="sizeType">
                         <enum>Expanding</enum>
                     </property>
                     <property name="sizeHint">
                         <size>
-                            <width>82</width>
+                            <width>40</width>
                             <height>20</height>
                         </size>
                     </property>