Show those TODO message also when using the toolbar or the popup menu

This should let the user know that something's not working instead of
offering him a not working dialog and winding him up this way. That
should make the behaviour of the program much easier to understand.
This commit is contained in:
Martin Kleusberg
2013-01-02 23:04:04 +01:00
parent 7424268f28
commit 9b2e8cd5a4
3 changed files with 31 additions and 8 deletions

View File

@@ -1217,20 +1217,26 @@ void MainWindow::on_add_field(){
}
}
void MainWindow::on_edit_field(){
if( !ui->dbTreeWidget->currentItem() ){
if(!ui->dbTreeWidget->currentItem())
return;
}
QTreeWidgetItem *item = ui->dbTreeWidget->currentItem();
// TODO
QMessageBox::information(this, QApplication::applicationName(), tr("Sorry! This function is currently not implemented as SQLite does not support editing columns yet."));
/*QTreeWidgetItem *item = ui->dbTreeWidget->currentItem();
editFieldForm *fieldForm = new editFieldForm( this );
fieldForm->setInitialValues(&db, false, item->parent()->text(0), item->text(0), item->text(2));
if (fieldForm->exec())
{
//modified = true;
//do the sql rename here
//qDebug(fieldForm->name + fieldForm->type);
item->setText(0,fieldForm->field_name);
item->setText(2,fieldForm->field_type);
}
}*/
}
void MainWindow::on_delete_field(){
if(!ui->dbTreeWidget->currentItem())
return;
// TODO
QMessageBox::information(this, QApplication::applicationName(), tr("Sorry! This function is currently not implemented as SQLite does not support the deletion of columns yet."));
}
void MainWindow::openRecentFile()

View File

@@ -68,6 +68,7 @@ public slots:
virtual void on_tree_selection_changed();
virtual void on_add_field();
virtual void on_edit_field();
virtual void on_delete_field();
virtual void fileOpen( const QString & fileName );
virtual void fileOpen();

View File

@@ -1483,6 +1483,22 @@
</hint>
</hints>
</connection>
<connection>
<sender>editDeleteFieldActionPopup</sender>
<signal>activated()</signal>
<receiver>MainWindow</receiver>
<slot>on_delete_field()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>399</x>
<y>299</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>fileOpen()</slot>
@@ -1512,7 +1528,6 @@
<slot>createTable()</slot>
<slot>deleteTable()</slot>
<slot>editTable()</slot>
<slot>deleteTablePopup()</slot>
<slot>editTablePopup()</slot>
<slot>on_add_field()</slot>
<slot>on_edit_field()</slot>
@@ -1523,5 +1538,6 @@
<slot>on_tree_selection_changed()</slot>
<slot>fileNew()</slot>
<slot>helpAbout()</slot>
<slot>on_delete_field()</slot>
</slots>
</ui>