void BookmarkListDialog::on_actionSelectBookmark_triggered()
{
	CRBookmark * bm = selectedBookmark();
	if(bm) {
		_docview->goToBookmark(bm);
		close();
	}
}
示例#2
0
void DialogBookmarks::loadBookmarks() {
    QSettings settings("mir", "Contra");
    ui->listWidget->clear();
    qint32 bookmarkCount = settings.value("bookmarkCount", 0).toInt();
    for(qint32 i=0; i<bookmarkCount; i++) {
        ui->listWidget->addItem(settings.value("bookmarkname"+QString::number(i)).toString());
    }
    ui->listWidget->setCurrentRow(0);
    selectedBookmark();
}
void BookmarkListDialog::on_actionRemoveBookmark_triggered()
{
	CRBookmark * bm = selectedBookmark();
	if ( bm ) {
		int index = m_ui->tableWidget->currentRow();
		m_ui->tableWidget->removeRow(index);
		_list.removeAt(index);
		_docview->getDocView()->removeBookmark(bm);
	}
}
示例#4
0
DialogBookmarks::DialogBookmarks(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DialogBookmarks)
{
    ui->setupUi(this);

    //setWindowFlags(Qt::WindowTitleHint);

    connect(ui->listWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(selectedBookmark()));
    connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(newBookmark()));
    connect(ui->pushButton_2, SIGNAL(clicked()), SLOT(deleteBookmark()));

    connect(ui->lineEdit, SIGNAL(textEdited(QString)), this, SLOT(saveBookmark()));
    connect(ui->lineEdit_2, SIGNAL(textEdited(QString)), this, SLOT(saveBookmark()));
    connect(ui->lineEdit_3, SIGNAL(textEdited(QString)), this, SLOT(saveBookmark()));
    connect(ui->lineEdit_4, SIGNAL(textEdited(QString)), this, SLOT(saveBookmark()));

    connect(this, SIGNAL(finished(int)), this, SLOT(saveBookmark()));

    loadBookmarks();
}