本文整理汇总了C++中CNotify::execError方法的典型用法代码示例。如果您正苦于以下问题:C++ CNotify::execError方法的具体用法?C++ CNotify::execError怎么用?C++ CNotify::execError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNotify
的用法示例。
在下文中一共展示了CNotify::execError方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runApp
void CFileBrowser::runApp(void){
struct link_stat st;
int err;
CNotify notify;
QTreeWidgetItem* item;
item = ui->tree->currentItem();
if( item == 0 ){
notify.execError("Invalid Selection");
return;
}
err = link()->stat( item->text(1).toLocal8Bit().constData(),
&st);
if ( err < 0 ){
notify.execLinkError(link_errno);
return;
}
if ( (st.st_mode & LINK_S_IFMT) != LINK_S_IFREG ){
notify.execError("File is not executable");
return;
}
if( st.st_mode & (LINK_S_IXGRP|LINK_S_IXOTH|LINK_S_IXUSR) ){
//Execute a program on the target device
emit runApplication( ui->tree->currentItem()->text(1) );
} else {
notify.execError("File is not executable");
}
}
示例2: refresh
void CFileBrowser::refresh(void){
//Update the tree
CNotify notify;
if ( link()->get_is_connected() == false ){
//Error::showNotConnected();
return;
}
ui->tree->clear();
topItem = new QTreeWidgetItem();
if ( topItem == NULL ){
notify.execError("Top Item is NULL");
return;
}
if ( ui->gotoLine->text() == "" ){
//Goto to "/" as the default directory
ui->gotoLine->setText("/");
}
topItem->setText(0, ui->gotoLine->text() );
topItem->setText(1, ui->gotoLine->text() );
topItem->setText(2, "false" );
ui->tree->addTopLevelItem(topItem);
ui->tree->setCurrentItem(topItem, 0);
loadDirectory(topItem);
}
示例3: signalProcess
int Monitor::signalProcess(int signo){
int row;
int pid;
int err;
QTableWidgetItem * item;
CNotify notify;
if ( link()->isConnected() == false ){
notify.execNotConnected();
return -1;
}
row = ui->table->currentRow();
if ( row != 0 ){
item = ui->table->item(row, PROCESS_ID_COL);
if ( item == NULL ){
return -1;
}
pid = item->text().replace(" (thread)", "").toInt();
if( pid != 0 ){
if ( (err = link()->kill_pid(pid, signo)) < 0 ){
notify.execError(errorMessage());
} else {
ui->table->removeRow(row);
}
}
}
return 0;
}
示例4: on_tree_itemActivated
void CFileBrowser::on_tree_itemActivated(QTreeWidgetItem* item, int column){
CNotify notify;
qDebug("item activated %s %s", item->text(0).toLocal8Bit().constData(), item->text(1).toLocal8Bit().constData());
if ( column != 0 ){
notify.execError("Invalid Column");
return;
}
loadDirectory(item);
item->setExpanded(true);
}
示例5: operationComplete
void CaosIsp::operationComplete(QString msg, bool err){
CNotify notify;
if ( err == true ){
notify.execError(msg);
} else if ( msg != "" ){
if ( currentMessage != "" ){
msg += ", " + currentMessage;
}
ui->statusBar->showMessage(" " + msg, 3000);
}
}
示例6: loadFileFromDeviceSelected
void CFileBrowser::loadFileFromDeviceSelected(QString filename){
QString src, dest;
QStringList path;
int err;
CNotify notify;
src = ui->tree->currentItem()->text(1);
path = src.split('/');
if ( path.count() ){
dest = filename + "/" + path[ path.count() -1 ];
err = link()->copy(src.toStdString(), dest.toStdString(), 0, false, updateProgress);
if ( err < 0 ){
notify.execLinkError(link_errno);
}
} else {
notify.execError("Invalid File");
}
CNotify::updateStatus("Uploaded to: " + dest);
}
示例7: isRunningUser
bool Monitor::isRunningUser(void){
sys_taskattr_t task;
int id;
int err;
CNotify notify;
if( fd < 0 ){
if ( link()->isConnected() == true ){
fd = link()->open("/dev/sys", LINK_O_RDWR);
}
}
id = 0;
do {
if ( link()->isConnected() == false ){
return -1;
}
task.is_enabled = 0;
task.tid = id;
err = link()->ioctl(fd, I_SYS_GETTASK, &task);
if ( err < -2 ){
notify.execError(errorMessage() );
return -1;
}
if( task.is_enabled != 0 ){
if( QString(task.name) != "sys" ){
return true;
}
}
id++;
} while( err != -1 );
return false;
}
示例8: updateAll
void Monitor::updateAll(){
int id;
int err;
int row;
int cpuRow;
uint64_t totalTime;
uint64_t taskTime;
sys_taskattr_t task;
CNotify notify;
id = 0;
if( link()->isConnected() == false ){
return;
}
if( fd < 0 ){
return;
}
do {
if ( link()->isConnected() == false ){
stopTimer();
for(row = 0; row < ui->table->rowCount(); row++){
ui->table->removeRow(row);
}
return;
}
task.is_enabled = 0;
task.tid = id;
err = link()->ioctl(fd, I_SYS_GETTASK, &task);
if ( err < -2 ){
stopTimer();
for(row = 0; row < ui->table->rowCount(); row++){
ui->table->removeRow(row);
}
notify.execError( errorMessage() );
return;
}
//update the entries in the table
updateRow(id, &task);
id++;
} while( err != -1 );
cpuRow = ui->table->rowCount();
totalTime = 0;
for(row = 0; row < cpuRow; row++){
totalTime += ui->table->item(row, DELTA_TASK_TIME_COL)->text().toLongLong();
}
for(row = 0; row < cpuRow; row++){
taskTime = ui->table->item(row, DELTA_TASK_TIME_COL)->text().toLongLong();
updateItem(row, CPU_COL, QString::number( taskTime * 100.0 / totalTime, 'f', 2 ));
}
ui->table->sortItems(sortColumn, sortOrder);
}