From 2b0e8a0d9b4b65925fcf1eaff43318929940b923 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Wed, 28 Mar 2007 16:58:08 +0000 Subject: [PATCH] Fix unreported bug related to 3246 by Richard Heck: "View" button in TeX information dialog not enabled when file is selected with the keyboard. Problem was that SIGNAL itemSelectionChanged was not connected to anything. Also made some minor stylistic changes to the code. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17614 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/QTexinfo.C | 6 +++--- src/frontends/qt4/QTexinfoDialog.C | 17 +++++++++-------- src/frontends/qt4/ui/QTexinfoUi.ui | 22 +++++++++------------- 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/frontends/qt4/QTexinfo.C b/src/frontends/qt4/QTexinfo.C index 7f91fa57eb..bae5eec750 100644 --- a/src/frontends/qt4/QTexinfo.C +++ b/src/frontends/qt4/QTexinfo.C @@ -48,15 +48,15 @@ void QTexinfo::build_dialog() void QTexinfo::updateStyles(ControlTexinfo::texFileSuffix whichStyle) { ContentsType & data = texdata_[whichStyle]; - bool const withFullPath = dialog_->path->isChecked(); + bool const withFullPath = dialog_->pathCB->isChecked(); getTexFileList(whichStyle, data, withFullPath); - dialog_->fileList->clear(); + dialog_->fileListLW->clear(); ContentsType::const_iterator it = data.begin(); ContentsType::const_iterator end = data.end(); for (; it != end; ++it) - dialog_->fileList->addItem(toqstr(*it)); + dialog_->fileListLW->addItem(toqstr(*it)); activeStyle = whichStyle; } diff --git a/src/frontends/qt4/QTexinfoDialog.C b/src/frontends/qt4/QTexinfoDialog.C index 761931ca09..bfcb09c5df 100644 --- a/src/frontends/qt4/QTexinfoDialog.C +++ b/src/frontends/qt4/QTexinfoDialog.C @@ -34,12 +34,13 @@ QTexinfoDialog::QTexinfoDialog(QTexinfo * form) form, SLOT(slotClose())); connect( viewPB, SIGNAL( clicked() ), this, SLOT( viewClicked() ) ); - connect( whatStyle, SIGNAL( activated(const QString&) ), this, SLOT( enableViewPB() ) ); - connect( whatStyle, SIGNAL( activated(int) ), this, SLOT( update() ) ); - connect( path, SIGNAL( stateChanged(int) ), this, SLOT( update() ) ); + connect( whatStyleCO, SIGNAL( activated(const QString&) ), this, SLOT( enableViewPB() ) ); + connect( whatStyleCO, SIGNAL( activated(int) ), this, SLOT( update() ) ); + connect( pathCB, SIGNAL( stateChanged(int) ), this, SLOT( update() ) ); connect( rescanPB, SIGNAL( clicked() ), this, SLOT( enableViewPB() ) ); connect( rescanPB, SIGNAL( clicked() ), this, SLOT( rescanClicked() ) ); - connect( fileList, SIGNAL( itemClicked(QListWidgetItem*) ), this, SLOT( enableViewPB() ) ); + connect( fileListLW, SIGNAL( itemClicked(QListWidgetItem*) ), this, SLOT( enableViewPB() ) ); + connect( fileListLW, SIGNAL( itemSelectionChanged() ), this, SLOT( enableViewPB() ) ); } @@ -67,10 +68,10 @@ void QTexinfoDialog::rescanClicked() void QTexinfoDialog::viewClicked() { - vector::size_type const fitem = fileList->currentRow(); + vector::size_type const fitem = fileListLW->currentRow(); vector const & data = form_->texdata_[form_->activeStyle]; string file = data[fitem]; - if (!path->isChecked()) + if (!pathCB->isChecked()) file = getTexFileFromList(data[fitem], form_->controller().getFileType(form_->activeStyle)); form_->controller().viewFile(file); @@ -79,7 +80,7 @@ void QTexinfoDialog::viewClicked() void QTexinfoDialog::update() { - switch (whatStyle->currentIndex()) { + switch (whatStyleCO->currentIndex()) { case 0: form_->updateStyles(ControlTexinfo::cls); break; @@ -99,7 +100,7 @@ void QTexinfoDialog::update() void QTexinfoDialog::enableViewPB() { - viewPB->setEnabled(fileList->currentRow() > -1); + viewPB->setEnabled(fileListLW->currentRow() > -1); } } // namespace frontend diff --git a/src/frontends/qt4/ui/QTexinfoUi.ui b/src/frontends/qt4/ui/QTexinfoUi.ui index da157c32da..27bab2c7db 100644 --- a/src/frontends/qt4/ui/QTexinfoUi.ui +++ b/src/frontends/qt4/ui/QTexinfoUi.ui @@ -1,7 +1,4 @@ - - - QTexinfoUi @@ -26,7 +23,7 @@ 6 - + @@ -122,7 +119,7 @@ 6 - + Selected classes or styles @@ -160,7 +157,7 @@ - + Toggles view of the file list @@ -173,18 +170,17 @@ - - - qt_helpers.h - - whatStyle - path - fileList + whatStyleCO + pathCB + fileListLW rescanPB viewPB closePB + + qt_helpers.h + -- 2.39.5