Skip to content

Commit

Permalink
Minor tweak to enable clipboard usage in macOS when copying data in
Browse files Browse the repository at this point in the history
DataManipulationForm
  • Loading branch information
rkhaotix committed Sep 1, 2017
1 parent 9bb5d88 commit 9b91a21
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libpgmodeler_ui/src/datamanipulationform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f):
act = item_menu.addAction(QIcon(PgModelerUiNS::getIconPath("colar")), trUtf8("Pase items"));
act->setShortcut(paste_tb->shortcut());
connect(act, SIGNAL(triggered(bool)), paste_tb, SLOT(click()));
act->setEnabled(qApp->clipboard()->ownsClipboard() && obj_type == OBJ_TABLE);
act->setEnabled(!qApp->clipboard()->text().isEmpty() && obj_type == OBJ_TABLE);

if(obj_type == OBJ_TABLE)
{
Expand Down Expand Up @@ -360,7 +360,7 @@ void DataManipulationForm::retrieveData(void)

QApplication::restoreOverrideCursor();

paste_tb->setEnabled(qApp->clipboard()->ownsClipboard() &&
paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty() &&
table_cmb->currentData().toUInt() == OBJ_TABLE &&
!col_names.isEmpty());
}
Expand Down Expand Up @@ -404,7 +404,7 @@ void DataManipulationForm::enableRowControlButtons(void)
delete_tb->setEnabled(cols_selected);
duplicate_tb->setEnabled(cols_selected);
copy_tb->setEnabled(sel_ranges.count() == 1);
paste_tb->setEnabled(qApp->clipboard()->ownsClipboard() &&
paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty() &&
table_cmb->currentData().toUInt() == OBJ_TABLE &&
!col_names.isEmpty());
browse_tabs_tb->setEnabled((!fk_infos.empty() || !ref_fk_infos.empty()) && sel_ranges.count() == 1 && sel_ranges.at(0).rowCount() == 1);
Expand Down Expand Up @@ -477,7 +477,7 @@ void DataManipulationForm::loadDataFromCsv(bool load_from_clipboard)

if(load_from_clipboard)
{
if(!qApp->clipboard()->ownsClipboard())
if(qApp->clipboard()->text().isEmpty())
return;

if(has_csv_clipboard)
Expand Down

0 comments on commit 9b91a21

Please sign in to comment.