SequenceBrowser should handle the copying
authorDiane Trout <diane@caltech.edu>
Tue, 13 Jun 2006 19:39:22 +0000 (19:39 +0000)
committerDiane Trout <diane@caltech.edu>
Tue, 13 Jun 2006 19:39:22 +0000 (19:39 +0000)
viva encapsulation, I pushed the code to handle copying sequence
down into the SequenceBrowser from SequenceBrowserWidget on the idea
that someone might want to use the inner widget on its own.

Hmm... maybe that's not reasonable? Not sure anymore. However
I do think that I want the popup menu to be tied to the innermost widget.

qui/MussaWindow.cpp
qui/seqbrowser/SequenceBrowser.cpp
qui/seqbrowser/SequenceBrowser.hpp
qui/seqbrowser/SequenceBrowserWidget.cpp

index b5057cb5f18e47ca5db405d0c39e9094930c1970..0e291d13f2b20e781f363376a65ea0d913213426 100644 (file)
@@ -27,6 +27,7 @@ MussaWindow::MussaWindow(Mussa *analysis_, QWidget *parent) :
   QMainWindow(parent),
   analysis(analysis_),
   motif_editor(0),
+  setup_analysis_dialog(this),
   browser(this),
   mussaViewTB("Path Views"),
   zoom(),
index 90794e85c42f8f2685043f580ca397386fd94426..587d1705a60b251c37f307902ad513e6e91e7033 100644 (file)
@@ -1,3 +1,5 @@
+#include <QApplication>
+#include <QClipboard>
 #include <QDir>
 #include <QFileDialog>
 #include <QMessageBox>
@@ -67,6 +69,18 @@ void SequenceBrowser::setClipPlane(int )
 */
 }
 
+void SequenceBrowser::copySelectedSequenceAsFasta()
+{
+  // get fasta data
+  std::string buffer;
+  copySelectedTracksAsFasta(buffer);
+
+  // get reference to clipboard
+  QClipboard *clipboard = QApplication::clipboard();
+  clipboard->setText(buffer.c_str());
+}
+
+
 void SequenceBrowser::clear()
 {
   GlSeqBrowser::clear();
index 33d6f70ebba3d22b0f1d5dc61f65a8f2f086ea0c..f50558dc89851a07ff0f405600c0ae306da03dd4 100644 (file)
@@ -30,6 +30,7 @@ public:
   void push_sequence(GlSequence &);
       
 public slots:
+  void copySelectedSequenceAsFasta();
   void setClipPlane(int z);
   //! set the center of the current viewport
   void setViewportCenter(float x);
index 25af9b0629b2a2c8381526293f4e7b1a6e8c00a6..3caec2a7530d6a681d138ec019cbbe6f8157d880 100644 (file)
@@ -1,7 +1,5 @@
 #include <iostream>
 
-#include <QApplication>
-#include <QClipboard>
 #include <QLabel>
 #include <QScrollBar>
 #include <QSpacerItem>
@@ -43,6 +41,11 @@ void SequenceBrowserWidget::clear()
   right_sidebar.clear();
 }
 
+void SequenceBrowserWidget::copySelectedSequenceAsFasta()
+{
+  scrollable_browser.browser().copySelectedSequenceAsFasta();
+}
+
 void SequenceBrowserWidget::setSequences(const std::vector<Sequence>& sequences,
                                             AnnotationColors& cm)
 {
@@ -81,17 +84,6 @@ const vector<GlSequence>& SequenceBrowserWidget::sequences() const
   return scrollable_browser.browser().sequences();
 }
 
-void SequenceBrowserWidget::copySelectedSequenceAsFasta()
-{
-  // get fasta data
-  std::string buffer;
-  scrollable_browser.browser().copySelectedTracksAsFasta(buffer);
-
-  // get reference to clipboard
-  QClipboard *clipboard = QApplication::clipboard();
-  clipboard->setText(buffer.c_str());
-}
-
 void SequenceBrowserWidget::clear_links()
 {
   scrollable_browser.browser().clear_links();