State 변경 추가
git-svn-id: svn://192.168.0.12/source@115 8346c931-da38-4b9b-9d4c-e48b93cbd075
This commit is contained in:
@@ -257,16 +257,23 @@ QGroupBox *Widget::setCrawlingWidgets()
|
||||
QHBoxLayout *hlayout = new QHBoxLayout();
|
||||
QPushButton *pInsert = new QPushButton("Insert");
|
||||
QPushButton *pDelete = new QPushButton("Delete");
|
||||
QPushButton *pModify = new QPushButton("State Modify");
|
||||
QPushButton *pRefresh = new QPushButton("Refresh");
|
||||
|
||||
m_pcbState = new QComboBox();
|
||||
m_pcbState->addItems(QStringList() << "Waiting" << "Running" << "Terminated" );
|
||||
|
||||
connect(pInsert, SIGNAL(released()),this, SLOT(on_crawling_button_insert()));
|
||||
connect(pDelete, SIGNAL(released()),this, SLOT(on_crawling_button_delete()));
|
||||
connect(pModify, SIGNAL(released()),this, SLOT(on_crawling_button_modify()));
|
||||
connect(pRefresh, SIGNAL(released()),this, SLOT(on_crawling_button_refresh()));
|
||||
|
||||
hlayout->setAlignment(Qt::AlignCenter);
|
||||
hlayout->addWidget(pInsert);
|
||||
hlayout->addWidget(pDelete);
|
||||
hlayout->addWidget(pRefresh);
|
||||
hlayout->addWidget(m_pcbState);
|
||||
hlayout->addWidget(pModify);
|
||||
hlayout->addWidget(pRefresh);
|
||||
vlayout->addLayout(hlayout);
|
||||
}
|
||||
|
||||
@@ -829,3 +836,19 @@ void Widget::on_crawling_button_refresh()
|
||||
{
|
||||
UpdateCrawling();
|
||||
}
|
||||
|
||||
void Widget::on_crawling_button_modify()
|
||||
{
|
||||
QStringList strList;
|
||||
foreach (QModelIndex index,m_ptableCrawling->selectionModel()->selectedRows(0))
|
||||
{
|
||||
QSqlRecord rec = m_pmodelCrawling->record(index.row());
|
||||
strList.push_back(rec.value("id").toString());
|
||||
}
|
||||
foreach(QString str,strList)
|
||||
{
|
||||
QString strQuery = QString("update crawling set state = " + QString::number(m_pcbState->currentIndex()) + " where id = '" + str + "'");
|
||||
m_pmodelCrawling->setQuery(QString(strQuery.toUtf8()));
|
||||
}
|
||||
UpdateCrawling();
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ private:
|
||||
QDateEdit *m_pdeStart,*m_pdeEnd, *m_pdeCopyStart, *m_pdeCopyEnd;
|
||||
QComboBox *m_pcbRealTime;
|
||||
QComboBox *m_pcbPlatform;
|
||||
QComboBox *m_pcbState;
|
||||
QLineEdit *m_pleKeyword,*m_pleAuthorship,*m_pleGroup,*m_pleCopyFrom,*m_pleCopyTo;
|
||||
QCheckBox *m_pchbDate;
|
||||
private:
|
||||
@@ -52,6 +53,7 @@ private slots:
|
||||
|
||||
void on_crawling_button_insert();
|
||||
void on_crawling_button_delete();
|
||||
void on_crawling_button_modify();
|
||||
void on_crawling_button_refresh();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user