gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r3004 - in gnunet-qt: . pixmaps src/plugins src/plugins/fs


From: durner
Subject: [GNUnet-SVN] r3004 - in gnunet-qt: . pixmaps src/plugins src/plugins/fs
Date: Sun, 11 Jun 2006 13:03:48 -0700 (PDT)

Author: durner
Date: 2006-06-11 13:03:29 -0700 (Sun, 11 Jun 2006)
New Revision: 3004

Added:
   gnunet-qt/pixmaps/clock.png
   gnunet-qt/pixmaps/close.png
   gnunet-qt/pixmaps/download.png
   gnunet-qt/pixmaps/download_small.png
   gnunet-qt/pixmaps/gnunet-gtk-fs.png
   gnunet-qt/pixmaps/search.png
   gnunet-qt/src/plugins/fs/
   gnunet-qt/src/plugins/fs/fs-search-result.ui
   gnunet-qt/src/plugins/fs/fs-search.cc
   gnunet-qt/src/plugins/fs/fs-search.h
   gnunet-qt/src/plugins/fs/fs.cc
   gnunet-qt/src/plugins/fs/fs.h
   gnunet-qt/src/plugins/fs/fs.pro.in
   gnunet-qt/src/plugins/fs/fs.ui
Modified:
   gnunet-qt/configure.ac
   gnunet-qt/pixmaps/pixmaps.qrc
   gnunet-qt/src/plugins/plugins.pro.in
Log:
FS search UI

Modified: gnunet-qt/configure.ac
===================================================================
--- gnunet-qt/configure.ac      2006-06-10 18:36:07 UTC (rev 3003)
+++ gnunet-qt/configure.ac      2006-06-11 20:03:29 UTC (rev 3004)
@@ -124,6 +124,7 @@
 src/plugins/plugins.pro
 src/plugins/about/about.pro
 src/plugins/general/general.pro
+src/plugins/fs/fs.pro
 ])
 
 

Added: gnunet-qt/pixmaps/clock.png
===================================================================
(Binary files differ)


Property changes on: gnunet-qt/pixmaps/clock.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: gnunet-qt/pixmaps/close.png
===================================================================
(Binary files differ)


Property changes on: gnunet-qt/pixmaps/close.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: gnunet-qt/pixmaps/download.png
===================================================================
(Binary files differ)


Property changes on: gnunet-qt/pixmaps/download.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: gnunet-qt/pixmaps/download_small.png
===================================================================
(Binary files differ)


Property changes on: gnunet-qt/pixmaps/download_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: gnunet-qt/pixmaps/gnunet-gtk-fs.png
===================================================================
(Binary files differ)


Property changes on: gnunet-qt/pixmaps/gnunet-gtk-fs.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: gnunet-qt/pixmaps/pixmaps.qrc
===================================================================
--- gnunet-qt/pixmaps/pixmaps.qrc       2006-06-10 18:36:07 UTC (rev 3003)
+++ gnunet-qt/pixmaps/pixmaps.qrc       2006-06-11 20:03:29 UTC (rev 3004)
@@ -1,13 +1,18 @@
 <RCC>
     <qresource prefix="/pixmaps" >
         <file>clock.png</file>
+        <file>close.png</file>
         <file>connected.png</file>
+        <file>download.png</file>
+        <file>download_small.png</file>
         <file>error.png</file>
+        <file>gnunet-gtk-fs.png</file>
         <file>gnunet-gtk-general.png</file>
         <file>gnunet-gtk-welcome.png</file>
         <file>gnunet-logo-small.png</file>
         <file>gnunet-qt-logo.png</file>
         <file>not-connected.png</file>
+        <file>search.png</file>
         <file>start.png</file>
     </qresource>
 </RCC>

Added: gnunet-qt/pixmaps/search.png
===================================================================
(Binary files differ)


Property changes on: gnunet-qt/pixmaps/search.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: gnunet-qt/src/plugins/fs/fs-search-result.ui
===================================================================
--- gnunet-qt/src/plugins/fs/fs-search-result.ui        2006-06-10 18:36:07 UTC 
(rev 3003)
+++ gnunet-qt/src/plugins/fs/fs-search-result.ui        2006-06-11 20:03:29 UTC 
(rev 3004)
@@ -0,0 +1,131 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>ResultWnd</class>
+ <widget class="QWidget" name="ResultWnd" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>540</width>
+    <height>304</height>
+   </rect>
+  </property>
+  <property name="sizePolicy" >
+   <sizepolicy>
+    <hsizetype>7</hsizetype>
+    <vsizetype>7</vsizetype>
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle" >
+   <string/>
+  </property>
+  <layout class="QVBoxLayout" >
+   <property name="margin" >
+    <number>9</number>
+   </property>
+   <property name="spacing" >
+    <number>6</number>
+   </property>
+   <item>
+    <widget class="QTreeView" name="treeResults" >
+     <property name="alternatingRowColors" >
+      <bool>true</bool>
+     </property>
+     <property name="rootIsDecorated" >
+      <bool>false</bool>
+     </property>
+     <property name="itemsExpandable" >
+      <bool>false</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" >
+     <property name="margin" >
+      <number>0</number>
+     </property>
+     <property name="spacing" >
+      <number>6</number>
+     </property>
+     <item>
+      <widget class="QToolButton" name="toolButton" >
+       <property name="text" >
+        <string>Download</string>
+       </property>
+       <property name="icon" >
+        <iconset resource="../../../pixmaps/pixmaps.qrc" 
>:/pixmaps/download.png</iconset>
+       </property>
+       <property name="iconSize" >
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="toolButtonStyle" >
+        <enum>Qt::ToolButtonTextBesideIcon</enum>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLabel" name="label" >
+       <property name="text" >
+        <string>with anonymity:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QSpinBox" name="spinBox" >
+       <property name="minimum" >
+        <number>1</number>
+       </property>
+       <property name="value" >
+        <number>1</number>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer>
+       <property name="orientation" >
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" >
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QToolButton" name="pbClose" >
+       <property name="text" >
+        <string>Close search</string>
+       </property>
+       <property name="icon" >
+        <iconset resource="../../../pixmaps/pixmaps.qrc" 
>:/pixmaps/close.png</iconset>
+       </property>
+       <property name="iconSize" >
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="toolButtonStyle" >
+        <enum>Qt::ToolButtonTextBesideIcon</enum>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <resources>
+  <include location="../../../pixmaps/pixmaps.qrc" />
+ </resources>
+ <connections/>
+</ui>

Added: gnunet-qt/src/plugins/fs/fs-search.cc
===================================================================
--- gnunet-qt/src/plugins/fs/fs-search.cc       2006-06-10 18:36:07 UTC (rev 
3003)
+++ gnunet-qt/src/plugins/fs/fs-search.cc       2006-06-11 20:03:29 UTC (rev 
3004)
@@ -0,0 +1,46 @@
+/*
+     This file is part of gnunet-qt.
+     (C) 2006 Nils Durner (and other contributing authors)
+
+     gnunet-qt is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published
+     by the Free Software Foundation; either version 2, or (at your
+     option) any later version.
+
+     gnunet-qt is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file src/plugins/fs/fs-search.cc
+ * @brief Search result tab
+ * @author Nils Durner
+ */
+
+#include "fs-search.h"
+
+GFSSearch::GFSSearch() : QWidget()
+{
+  setupUi(this);
+  
+  connect(pbClose, SIGNAL(clicked(bool)), this, SLOT(closeClicked()));
+}
+
+void GFSSearch::closeClicked()
+{
+  emit closeSearchWnd(this);
+}
+
+void GFSSearch::clear()
+{
+
+}
+
+/* fs-search.cc */

Added: gnunet-qt/src/plugins/fs/fs-search.h
===================================================================
--- gnunet-qt/src/plugins/fs/fs-search.h        2006-06-10 18:36:07 UTC (rev 
3003)
+++ gnunet-qt/src/plugins/fs/fs-search.h        2006-06-11 20:03:29 UTC (rev 
3004)
@@ -0,0 +1,49 @@
+/*
+     This file is part of gnunet-qt.
+     (C) 2006 Nils Durner (and other contributing authors)
+
+     gnunet-qt is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published
+     by the Free Software Foundation; either version 2, or (at your
+     option) any later version.
+
+     gnunet-qt is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file src/plugins/fs/fs-search.h
+ * @brief Search result tab
+ * @author Nils Durner
+ */
+
+#ifndef SEARCHRESULTS_H_
+#define SEARCHRESULTS_H_
+
+#include "ui_fs-search-result.h"
+
+class GFSSearch : public QWidget, protected Ui::ResultWnd
+{
+  Q_OBJECT
+  
+public:
+  GFSSearch();
+  void clear();
+  
+signals:
+  void closeSearchWnd(class GFSSearch *wnd);
+  
+protected slots:
+  void closeClicked();
+};
+
+#endif /*SEARCHRESULTS_H_*/
+
+/* end of fs-search.h */

Added: gnunet-qt/src/plugins/fs/fs.cc
===================================================================
--- gnunet-qt/src/plugins/fs/fs.cc      2006-06-10 18:36:07 UTC (rev 3003)
+++ gnunet-qt/src/plugins/fs/fs.cc      2006-06-11 20:03:29 UTC (rev 3004)
@@ -0,0 +1,107 @@
+/*
+     This file is part of gnunet-qt.
+     (C) 2006 Nils Durner (and other contributing authors)
+
+     gnunet-qt is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published
+     by the Free Software Foundation; either version 2, or (at your
+     option) any later version.
+
+     gnunet-qt is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file src/plugins/fs/fs.cc
+ * @brief gnunet-qt's FS plugin
+ * @author Nils Durner
+ */
+
+#include <QLineEdit>
+
+#include "fs.h"
+#include "fs-search.h"
+
+GFSPlugin::GFSPlugin() : GPlugin()
+{
+  setupUi(this);
+  
+  connect(pbSearch, SIGNAL(clicked(bool)), this, SLOT(searchClicked()));
+  connect(cmbSearchFor->lineEdit(), SIGNAL(returnPressed()), this, 
SLOT(searchClicked()));
+  
+  tabResults->removeTab(0); // created by Qt Designer
+  (addSearchWnd(tr("Search results")))->setEnabled(false);
+}
+
+GFSSearch *GFSPlugin::addSearchWnd(QString strLabel)
+{
+  GFSSearch *ret = new GFSSearch();
+  connect(ret, SIGNAL(closeSearchWnd(GFSSearch *)), this,
+    SLOT(closeSearchClicked(GFSSearch *)));
+  ret->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+  tabResults->addTab(ret, strLabel);
+  
+  return ret;
+}
+
+void GFSPlugin::searchClicked()
+{
+  GFSSearch *searchWnd;
+  int tab;
+
+  tabResults->setUpdatesEnabled(false);
+
+  /* Try to the use the first tab if it isn't disabled */
+  searchWnd = (GFSSearch *) tabResults->widget(0);
+  if (searchWnd->isEnabled())
+  {
+    /* first tab is already used. Create a new one. */
+    searchWnd = addSearchWnd(cmbSearchFor->lineEdit()->text());
+    tab = tabResults->count() - 1;
+  }
+  else
+  {
+    searchWnd->setEnabled(true);
+    tab = 0;
+  }
+
+  tabResults->setTabText(tab, cmbSearchFor->lineEdit()->text());
+  tabResults->setCurrentIndex(tab);
+
+  tabResults->setUpdatesEnabled(true);
+}
+
+void GFSPlugin::closeSearchClicked(GFSSearch *wnd)
+{
+  if (tabResults->count() > 1)
+    tabResults->removeTab(tabResults->indexOf(wnd));
+  else
+  {
+    /* always keep one search tab open */
+    wnd->clear();
+    wnd->setEnabled(false);
+    tabResults->setTabText(0, tr("Search results"));
+  }
+}
+
+extern "C"
+{
+  GNUNETQT_API GPlugin *init_plugin()
+  {
+    return new GFSPlugin();
+  }
+  
+  GNUNETQT_API void shutdown_plugin(GPlugin *plugin)
+  {
+    delete plugin;
+  }
+} // extern "C"
+
+/* end of fs.cc */

Added: gnunet-qt/src/plugins/fs/fs.h
===================================================================
--- gnunet-qt/src/plugins/fs/fs.h       2006-06-10 18:36:07 UTC (rev 3003)
+++ gnunet-qt/src/plugins/fs/fs.h       2006-06-11 20:03:29 UTC (rev 3004)
@@ -0,0 +1,49 @@
+/*
+     This file is part of gnunet-qt.
+     (C) 2006 Nils Durner (and other contributing authors)
+
+     gnunet-qt is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published
+     by the Free Software Foundation; either version 2, or (at your
+     option) any later version.
+
+     gnunet-qt is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file src/plugins/fs/fs.h
+ * @brief gnunet-qt's FS plugin
+ * @author Nils Durner
+ */
+
+#ifndef FS_H_
+#define FS_H_
+
+#include "gnunet_qt_common.h"
+#include "ui_fs.h"
+#include "fs-search.h"
+
+class GFSPlugin : public GPlugin, protected Ui::FSWnd
+{
+  Q_OBJECT
+  
+public:
+  GFSPlugin();
+protected:
+  GFSSearch *addSearchWnd(QString strLabel);
+protected slots:
+  void searchClicked();
+  void closeSearchClicked(GFSSearch *wnd);
+};
+
+#endif /*FS_H_*/
+
+/* end of fs.h */

Added: gnunet-qt/src/plugins/fs/fs.pro.in
===================================================================
--- gnunet-qt/src/plugins/fs/fs.pro.in  2006-06-10 18:36:07 UTC (rev 3003)
+++ gnunet-qt/src/plugins/fs/fs.pro.in  2006-06-11 20:03:29 UTC (rev 3004)
@@ -0,0 +1,13 @@
+TEMPLATE = lib
+TARGET = libgnunetqtmodule_fs
+INCLUDEPATH = ../../include .
+DLLDESTDIR = .
+LIBS = -L../../common -lgnunetqt_common
+QMAKE_LFLAGS += -shared @LDFLAGS@
+QMAKE_LIBS += @LIBS@
+QMAKE_CFLAGS += @CPPFLAGS@
+QMAKE_CXXFLAGS += @CXXFLAGS@
+
+SOURCES = fs.cc fs-search.cc
+HEADERS = fs.h fs-search.h ../../include/gnunet_qt_common.h
+FORMS = fs.ui fs-search-result.ui

Added: gnunet-qt/src/plugins/fs/fs.ui
===================================================================
--- gnunet-qt/src/plugins/fs/fs.ui      2006-06-10 18:36:07 UTC (rev 3003)
+++ gnunet-qt/src/plugins/fs/fs.ui      2006-06-11 20:03:29 UTC (rev 3004)
@@ -0,0 +1,197 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>FSWnd</class>
+ <widget class="QWidget" name="FSWnd" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>534</width>
+    <height>398</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Filesharing</string>
+  </property>
+  <property name="windowIcon" >
+   <iconset resource="../../../pixmaps/pixmaps.qrc" 
>:/pixmaps/gnunet-gtk-fs.png</iconset>
+  </property>
+  <layout class="QVBoxLayout" >
+   <property name="margin" >
+    <number>9</number>
+   </property>
+   <property name="spacing" >
+    <number>6</number>
+   </property>
+   <item>
+    <widget class="QTabWidget" name="tabFS" >
+     <property name="currentIndex" >
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="tabSearch" >
+      <attribute name="title" >
+       <string>Search and download</string>
+      </attribute>
+      <layout class="QVBoxLayout" >
+       <property name="margin" >
+        <number>9</number>
+       </property>
+       <property name="spacing" >
+        <number>6</number>
+       </property>
+       <item>
+        <widget class="QGroupBox" name="groupBox" >
+         <property name="title" >
+          <string>Search</string>
+         </property>
+         <layout class="QVBoxLayout" >
+          <property name="margin" >
+           <number>9</number>
+          </property>
+          <property name="spacing" >
+           <number>6</number>
+          </property>
+          <item>
+           <layout class="QHBoxLayout" >
+            <property name="margin" >
+             <number>0</number>
+            </property>
+            <property name="spacing" >
+             <number>6</number>
+            </property>
+            <item>
+             <widget class="QLabel" name="label" >
+              <property name="text" >
+               <string>Search for:</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="cmbSearchFor" >
+              <property name="sizePolicy" >
+               <sizepolicy>
+                <hsizetype>7</hsizetype>
+                <vsizetype>0</vsizetype>
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="editable" >
+               <bool>true</bool>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <spacer>
+              <property name="orientation" >
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeType" >
+               <enum>QSizePolicy::Fixed</enum>
+              </property>
+              <property name="sizeHint" >
+               <size>
+                <width>10</width>
+                <height>20</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+            <item>
+             <widget class="QLabel" name="label_2" >
+              <property name="text" >
+               <string>with anonymity:</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QSpinBox" name="spinBox" >
+              <property name="minimum" >
+               <number>1</number>
+              </property>
+              <property name="value" >
+               <number>1</number>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <layout class="QHBoxLayout" >
+            <property name="margin" >
+             <number>0</number>
+            </property>
+            <property name="spacing" >
+             <number>6</number>
+            </property>
+            <item>
+             <widget class="QToolButton" name="pbSearch" >
+              <property name="text" >
+               <string>Search</string>
+              </property>
+              <property name="icon" >
+               <iconset resource="../../../pixmaps/pixmaps.qrc" 
>:/pixmaps/search.png</iconset>
+              </property>
+              <property name="iconSize" >
+               <size>
+                <width>22</width>
+                <height>22</height>
+               </size>
+              </property>
+              <property name="toolButtonStyle" >
+               <enum>Qt::ToolButtonTextBesideIcon</enum>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <spacer>
+              <property name="orientation" >
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeHint" >
+               <size>
+                <width>40</width>
+                <height>20</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <widget class="QTabWidget" name="tabResults" >
+         <property name="currentIndex" >
+          <number>0</number>
+         </property>
+         <widget class="QWidget" name="tabRoot" >
+          <attribute name="title" >
+           <string/>
+          </attribute>
+          <layout class="QVBoxLayout" >
+           <property name="margin" >
+            <number>9</number>
+           </property>
+           <property name="spacing" >
+            <number>6</number>
+           </property>
+          </layout>
+         </widget>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <resources>
+  <include location="../../../pixmaps/pixmaps.qrc" />
+ </resources>
+ <connections/>
+</ui>

Modified: gnunet-qt/src/plugins/plugins.pro.in
===================================================================
--- gnunet-qt/src/plugins/plugins.pro.in        2006-06-10 18:36:07 UTC (rev 
3003)
+++ gnunet-qt/src/plugins/plugins.pro.in        2006-06-11 20:03:29 UTC (rev 
3004)
@@ -1,2 +1,2 @@
 TEMPLATE = subdirs
-SUBDIRS = about general
\ No newline at end of file
+SUBDIRS = about general fs
\ No newline at end of file





reply via email to

[Prev in Thread] Current Thread [Next in Thread]