#include <QFileDialog>
#include <QHBoxLayout>
#include <QIcon>
+#include <QLibraryInfo>
#include <QMenuBar>
#include <QMessageBox>
+#include <QProcess>
#include <QScrollBar>
#include <QStatusBar>
#include <QString>
#include <QStringList>
+#include <QTextStream>
#include <QUrl>
#include <QWhatsThis>
saveBrowserPixmapAction(0),
whatsThisAction(0),
viewMussaAlignmentAction(0),
- manualAssistant(0)
+ assistantProcess(0)
{
init_resources();
connect(zoom, SIGNAL(valueChanged(double)),
browser, SLOT(setZoom(double)));
mussaViewTB->addWidget(zoom);
+
+ // Mouse Wheel triggered zooming
+ connect(browser, SIGNAL(mouseWheelZoom(double)),
+ zoom, SLOT(setValue(double)));
// threshold range is set in updateAnalysis
connect(threshold, SIGNAL(thresholdChanged(int)),
if (new_analysis != 0) {
// only switch mussas if we loaded without error
clear();
+ //std::cout << "analysis soft: " << analysis->get_soft_threshold()
+ // << " new analysis soft: " << new_analysis->get_soft_threshold()
+ // << "\n";
analysis.swap(new_analysis);
+ //std::cout << "after swap soft thres: " << analysis->get_soft_threshold()
+ // << "\n";
+ threshold->disconnect(this);
+ threshold->reset(analysis->get_threshold(),
+ analysis->get_window(),
+ analysis->get_soft_threshold());
+ connect(threshold, SIGNAL(thresholdChanged(int)),
+ this, SLOT(setSoftThreshold(int)));
updateTitle();
updateAnalysis();
}
void MussaWindow::setupAssistant()
{
#if defined(QT_QTASSISTANT_FOUND)
+ /*
QStringList manualAssistantArgs;
manualAssistantArgs = QStringList();
manualAssistantArgs << "-profile" << "./doc/manual/mussagl_manual.adp";
manualAssistant->setArguments(manualAssistantArgs);
connect(manualAssistant, SIGNAL(error(QString)),
this, SLOT(assistantError(QString)));
+ */
#endif
}
void MussaWindow::setSoftThreshold(int value)
{
+ //std::cout << "Soft: " << analysis->get_soft_threshold()
+ // << " Value: " << value << "\n";
if (analysis->get_soft_threshold() != value) {
threshold->setEnabled( false );
+ //std::cout << "Updating!!!!\n";
analysis->set_soft_threshold(value);
analysis->nway();
updateLinks();
update();
threshold->setEnabled( true );
}
+ //else
+ //{
+ // std::cout << "NOT Updating!!!!\n";
+ //}
}
void MussaWindow::showMussaToolbar()
void MussaWindow::showManual()
{
#if defined(QT_QTASSISTANT_FOUND)
- if (manualAssistant) {
- manualAssistant->openAssistant();
- } else {
- QMessageBox::warning(this,
- tr("Mussa Help Error"),
- tr("QtAssistant not setup correctly"),
- QMessageBox::Ok,
- QMessageBox::NoButton,
- QMessageBox::NoButton);
+
+ // Only define the process once.
+ if (!assistantProcess)
+ assistantProcess = new QProcess(this);
+
+ // No need to fire up the process again if it is already running.
+ if (assistantProcess->state() == QProcess::Running)
+ return;
+
+ QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath)
+ + QLatin1String("/assistant");
+
+ assistantProcess->start(app, QStringList() << QLatin1String("-enableRemoteControl")
+ << QLatin1String("-collectionFile") << QLatin1String("mussagl_manual.qhc"));
+ if (!assistantProcess->waitForStarted()) {
+ QMessageBox::critical(this, tr("Remote Control"),
+ tr("Could not start Qt Assistant from %1.").arg(app));
+ return;
}
+
+ // show index page
+ QTextStream str(assistantProcess);
+ str << QLatin1String("SetSource qthelp://edu.caltech.woldlab.mussagl.1_0_0/doc/mussagl_manual.html;")
+ << QLatin1String("expandToc 0")
+ << QLatin1Char('\0') << endl;
+
#else
QUrl manual_url("http://woldlab.caltech.edu/~king/mussagl_manual/");
if (not QDesktopServices::openUrl(manual_url)) {
// but it's possible for us to not have had a chance to set out sequences
// yet.
threshold->setRange(analysis->get_threshold(),analysis->get_window());
+ threshold->setBasepairThreshold(analysis->get_soft_threshold());
updateLinks();
browser->zoomOut();
zoom->setValue(browser->zoom());