[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r4632 - in gnunet-qt/src: common include plugins/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r4632 - in gnunet-qt/src: common include plugins/fs |
Date: |
Sun, 4 Mar 2007 12:02:28 -0700 (MST) |
Author: durner
Date: 2007-03-04 12:02:28 -0700 (Sun, 04 Mar 2007)
New Revision: 4632
Added:
gnunet-qt/src/common/textEditor.cc
gnunet-qt/src/common/textEditor.h
gnunet-qt/src/common/textEditor.ui
gnunet-qt/src/plugins/fs/textEditor.ui
Modified:
gnunet-qt/src/common/common.pro.in
gnunet-qt/src/include/gnunet_qt_common.h
gnunet-qt/src/plugins/fs/fs.pro.in
gnunet-qt/src/plugins/fs/uploadDialog.cc
gnunet-qt/src/plugins/fs/uploadDialog.h
Log:
text editor for multi-line meta-data
Modified: gnunet-qt/src/common/common.pro.in
===================================================================
--- gnunet-qt/src/common/common.pro.in 2007-03-04 17:48:10 UTC (rev 4631)
+++ gnunet-qt/src/common/common.pro.in 2007-03-04 19:02:28 UTC (rev 4632)
@@ -13,5 +13,6 @@
target.path = @prefix@/@DLLDIR@
INSTALLS += target
-SOURCES = assert.cc pluginLoader.cc gstring.cc event.cc eventDispatcher.cc
-HEADERS = pluginLoader.h event.h eventDispatcher.h
../include/gnunet_qt_common.h
\ No newline at end of file
+FORMS = textEditor.ui
+SOURCES = assert.cc pluginLoader.cc gstring.cc event.cc eventDispatcher.cc
textEditor.cc
+HEADERS = pluginLoader.h event.h eventDispatcher.h textEditor.h
../include/gnunet_qt_common.h
\ No newline at end of file
Added: gnunet-qt/src/common/textEditor.cc
===================================================================
--- gnunet-qt/src/common/textEditor.cc (rev 0)
+++ gnunet-qt/src/common/textEditor.cc 2007-03-04 19:02:28 UTC (rev 4632)
@@ -0,0 +1,45 @@
+/*
+ This file is part of gnunet-qt.
+ (C) 2007 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/common/textEditor.cc
+ * @brief A simple text editor
+ * @author Nils Durner
+ */
+
+#include "textEditor.h"
+
+GTextEditor::GTextEditor(QString str, QWidget *parent) : QDialog(parent)
+{
+ setupUi(this);
+
+ textEdit->setText(str);
+}
+
+GTextEditor::~GTextEditor()
+{
+}
+
+QString GTextEditor::text()
+{
+ return textEdit->toPlainText();
+}
+
+/* end of textEditor.cc */
Added: gnunet-qt/src/common/textEditor.h
===================================================================
--- gnunet-qt/src/common/textEditor.h (rev 0)
+++ gnunet-qt/src/common/textEditor.h 2007-03-04 19:02:28 UTC (rev 4632)
@@ -0,0 +1,44 @@
+/*
+ This file is part of gnunet-qt.
+ (C) 2007 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/common/textEditor.h
+ * @brief A simple text editor
+ * @author Nils Durner
+ */
+
+#ifndef TEXTEDITOR_H_
+#define TEXTEDITOR_H_
+
+#include <QDialog>
+#include "ui_textEditor.h"
+
+class GTextEditor : public QDialog, protected Ui::dlgTextEditor
+{
+public:
+ GTextEditor(QString str, QWidget *parent);
+ virtual ~GTextEditor();
+
+ QString text();
+};
+
+#endif /*TEXTEDITOR_H_*/
+
+/* end of textEditor.h */
Added: gnunet-qt/src/common/textEditor.ui
===================================================================
--- gnunet-qt/src/common/textEditor.ui (rev 0)
+++ gnunet-qt/src/common/textEditor.ui 2007-03-04 19:02:28 UTC (rev 4632)
@@ -0,0 +1,77 @@
+<ui version="4.0" >
+ <class>dlgTextEditor</class>
+ <widget class="QDialog" name="dlgTextEditor" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Edit text</string>
+ </property>
+ <property name="windowIcon" >
+ <iconset resource="../../pixmaps/pixmaps.qrc"
>:/pixmaps/document-properties.png</iconset>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QTextEdit" name="textEdit" />
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="../../pixmaps/pixmaps.qrc" />
+ </resources>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>dlgTextEditor</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>dlgTextEditor</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
Modified: gnunet-qt/src/include/gnunet_qt_common.h
===================================================================
--- gnunet-qt/src/include/gnunet_qt_common.h 2007-03-04 17:48:10 UTC (rev
4631)
+++ gnunet-qt/src/include/gnunet_qt_common.h 2007-03-04 19:02:28 UTC (rev
4632)
@@ -1,6 +1,6 @@
/*
This file is part of gnunet-qt.
- (C) 2006 Nils Durner (and other contributing authors)
+ (C) 2006, 2007 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
@@ -33,6 +33,7 @@
#include "../common/event.h"
#include "../common/eventDispatcher.h"
+#include "../common/textEditor.h"
#define GNUNETQT_ASSERT(cond) do { if (! (cond))
gnunet_qt_assert_quit(__FILE__, __LINE__); } while(0);
Modified: gnunet-qt/src/plugins/fs/fs.pro.in
===================================================================
--- gnunet-qt/src/plugins/fs/fs.pro.in 2007-03-04 17:48:10 UTC (rev 4631)
+++ gnunet-qt/src/plugins/fs/fs.pro.in 2007-03-04 19:02:28 UTC (rev 4632)
@@ -42,4 +42,4 @@
searchController.h \
searchItemDelegate.h \
../../include/gnunet_qt_common.h
-FORMS = fs.ui fs-search-result.ui fs-upload.ui
+FORMS = fs.ui fs-search-result.ui fs-upload.ui textEditor.ui
Added: gnunet-qt/src/plugins/fs/textEditor.ui
===================================================================
--- gnunet-qt/src/plugins/fs/textEditor.ui (rev 0)
+++ gnunet-qt/src/plugins/fs/textEditor.ui 2007-03-04 19:02:28 UTC (rev
4632)
@@ -0,0 +1,77 @@
+<ui version="4.0" >
+ <class>dlgTextEditor</class>
+ <widget class="QDialog" name="dlgTextEditor" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Edit text</string>
+ </property>
+ <property name="windowIcon" >
+ <iconset resource="../../../pixmaps/pixmaps.qrc"
>:/pixmaps/document-properties.png</iconset>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QTextEdit" name="textEdit" />
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="../../../pixmaps/pixmaps.qrc" />
+ </resources>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>dlgTextEditor</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>dlgTextEditor</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
Modified: gnunet-qt/src/plugins/fs/uploadDialog.cc
===================================================================
--- gnunet-qt/src/plugins/fs/uploadDialog.cc 2007-03-04 17:48:10 UTC (rev
4631)
+++ gnunet-qt/src/plugins/fs/uploadDialog.cc 2007-03-04 19:02:28 UTC (rev
4632)
@@ -29,6 +29,7 @@
#include <QBuffer>
#include <extractor.h>
+#include "gnunet_qt_common.h"
#include "uploadDialog.h"
GFSUploadDialog::GFSUploadDialog(GFSMetaData *metaData,
@@ -47,6 +48,7 @@
SLOT(metaSelectionChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
connect(pbAddMeta, SIGNAL(clicked(bool)), this, SLOT(metaAdd()));
connect(pbRemoveMeta, SIGNAL(clicked(bool)), this, SLOT(metaDel()));
+ connect(pbLongMetaVal, SIGNAL(clicked(bool)), this,
SLOT(longMetaValClicked()));
connect(treeKeywords, SIGNAL(currentItemChanged(QTreeWidgetItem *,
QTreeWidgetItem *)), this,
SLOT(keywordSelectionChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
connect(pbAddKeyword, SIGNAL(clicked(bool)), this, SLOT(keywordAdd()));
@@ -322,4 +324,12 @@
return cbUse->isChecked();
}
+void GFSUploadDialog::longMetaValClicked()
+{
+ GTextEditor edit(editValue->text(), this);
+
+ if (edit.exec() == QDialog::Accepted)
+ editValue->setText(edit.text());
+}
+
/* end of uploadDialog.cc */
Modified: gnunet-qt/src/plugins/fs/uploadDialog.h
===================================================================
--- gnunet-qt/src/plugins/fs/uploadDialog.h 2007-03-04 17:48:10 UTC (rev
4631)
+++ gnunet-qt/src/plugins/fs/uploadDialog.h 2007-03-04 19:02:28 UTC (rev
4632)
@@ -55,6 +55,7 @@
void keywordAdd();
void keywordDel();
void chooseThumb();
+ void longMetaValClicked();
};
#endif /*UPLOADDIALOG_H_*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r4632 - in gnunet-qt/src: common include plugins/fs,
gnunet <=