added missing files from changes@home that has been accidentally checked in partially at last commit [135]; refs #88
This commit is contained in:
60
swisssurfer/src/editbookmarks.hxx
Normal file
60
swisssurfer/src/editbookmarks.hxx
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
/*! @file
|
||||||
|
|
||||||
|
@id $Id$
|
||||||
|
*/
|
||||||
|
// 1 2 3 4 5 6 7 8
|
||||||
|
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||||
|
|
||||||
|
#ifndef __EDITBOOKMARKS_HXX__
|
||||||
|
#define __EDITBOOKMARKS_HXX__
|
||||||
|
|
||||||
|
#include <QtGui/QDialog>
|
||||||
|
#include <QtGui/QComboBox>
|
||||||
|
#include <QtGui/QLineEdit>
|
||||||
|
#include <ui_editbookmarks.h>
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
class EditBookmarks: public QDialog, protected Ui::EditBookmarks {
|
||||||
|
Q_OBJECT;
|
||||||
|
public:
|
||||||
|
EditBookmarks(QComboBox* url, QWidget* p=0): QDialog(p), _url(url) {
|
||||||
|
setupUi(this);
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
virtual void accept() {
|
||||||
|
QStringList urls;
|
||||||
|
for (int i(0); i<_bookmarks->count(); ++i)
|
||||||
|
urls<<_bookmarks->item(i)->text();
|
||||||
|
QString current(_url->currentText());
|
||||||
|
_url->clear();
|
||||||
|
_url->addItems(urls);
|
||||||
|
_url->lineEdit()->setText(current);
|
||||||
|
QDialog::accept();
|
||||||
|
}
|
||||||
|
virtual void reject() {
|
||||||
|
QStringList urls;
|
||||||
|
for (int i(0); i<_url->count(); ++i)
|
||||||
|
urls<<_url->itemText(i);
|
||||||
|
_bookmarks->clear();
|
||||||
|
_bookmarks->addItems(urls);
|
||||||
|
QDialog::reject();
|
||||||
|
}
|
||||||
|
protected Q_SLOTS:
|
||||||
|
void on__remove_clicked(bool) {
|
||||||
|
QList<QListWidgetItem*> items(_bookmarks->selectedItems());
|
||||||
|
qDebug()<<"Delete "<<items.size()<<" items";
|
||||||
|
for (QList<QListWidgetItem*>::iterator it(items.begin());
|
||||||
|
it!=items.end(); ++it) {
|
||||||
|
qDebug()<<"Delete Item: "<<(*it)->text();
|
||||||
|
delete _bookmarks->takeItem(_bookmarks->row(*it));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void on__add_clicked(bool) {
|
||||||
|
_bookmarks->addItem(_url->currentText());
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
QComboBox* _url;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
130
swisssurfer/src/editbookmarks.ui
Normal file
130
swisssurfer/src/editbookmarks.ui
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>EditBookmarks</class>
|
||||||
|
<widget class="QDialog" name="EditBookmarks">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>514</width>
|
||||||
|
<height>584</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Edit Bookmarks</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="_add">
|
||||||
|
<property name="text">
|
||||||
|
<string>+</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="resources.qrc">
|
||||||
|
<normaloff>:/icons/addbookmark</normaloff>:/icons/addbookmark</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<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>
|
||||||
|
<widget class="QToolButton" name="_remove">
|
||||||
|
<property name="text">
|
||||||
|
<string>-</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="resources.qrc">
|
||||||
|
<normaloff>:/icons/close</normaloff>:/icons/close</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QListWidget" name="_bookmarks">
|
||||||
|
<property name="acceptDrops">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Use Drag/Drop to move, double-click to edit.</string>
|
||||||
|
</property>
|
||||||
|
<property name="dragEnabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="dragDropMode">
|
||||||
|
<enum>QAbstractItemView::InternalMove</enum>
|
||||||
|
</property>
|
||||||
|
<property name="alternatingRowColors">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::ContiguousSelection</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
<property name="centerButtons">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="resources.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>EditBookmarks</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>EditBookmarks</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>
|
Reference in New Issue
Block a user