From b3c877273eb53bc86372b14dd574c064c0a45b85 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Thu, 4 May 2006 00:39:42 +0000 Subject: [PATCH] allow opening multiple MussaWindows closes ticket:93 the only real downside is on os x the windows land on top of each other. --- icons.qrc | 1 + icons/README.txt | 5 +++-- icons/window_new.png | Bin 0 -> 1175 bytes qui/MussaWindow.cpp | 35 +++++++++++++++++++++++++++++++++++ qui/MussaWindow.hpp | 5 +++++ 5 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 icons/window_new.png diff --git a/icons.qrc b/icons.qrc index 4777b84..854e7cb 100644 --- a/icons.qrc +++ b/icons.qrc @@ -11,5 +11,6 @@ icons/lock.png icons/motif_icon.png icons/viewmag.png + icons/window_new.png diff --git a/icons/README.txt b/icons/README.txt index 7049269..5ce2374 100644 --- a/icons/README.txt +++ b/icons/README.txt @@ -1,6 +1,6 @@ The following icons are from Crystal SVG which is available for use -under LGPL, visit http://www.everaldo.com/ for more info on Crystal -SVG. +under LGPL, visit http://www.everaldo.com/crystal.html for more info on Crystal +SVG. We are currently using the 32x32 pixel images. Crystal SVG Icons: ------------------ @@ -13,6 +13,7 @@ Crystal SVG Icons: * icon.png * image2.png * lock.png + * window_new.png diff --git a/icons/window_new.png b/icons/window_new.png new file mode 100644 index 0000000000000000000000000000000000000000..b7eadc065aed381cb89601d0cdc1fb4178ae7201 GIT binary patch literal 1175 zcmV;I1Zew-P)^@RCwBA z{Qv(y!$1On0Ad6Y7Ly(t{{Qz^@bAwbO#lA=W%&2^AH%;tAPi+A^Fj1K2>ll<|DWMM zNbK)l6g_{z{QqEausmGN?+^dZr=JH}`wxi!0|XGG#pFkcj7-e)METi(1_Cwy{tuy{ z_|I<`8z>HB{{gFkih=q6;cOK3Ky&`UE&j*w{~wV4{fFV-&sPlpf4<6RxKcO==zt#p z0mK5b+*D0~K}ML1;rDL_F#h!m75_wL|3srf;y)pLI2%a+28J!r4GjN4Vay5*Z=fR> zzn@_E&-Q;JkhcklUjPIU6G$9x`5%Y_{s3uUNW$@7Bn&iz0q7wx4aQKhfB#YG{~(N> zyqK6682^jFcpwG`Kmf6TSRkK(ECo3Lng06+)pEEa{z4pq;-J5n4kD1g*?^cCAb`LQ zu$Dyf0nE_92!sFP!RR6M2j+NS;so(wxeP-6XZZPsi=k^7!W94k!~zs!aFC;3wgOrB zAMBa`Q1*W)8zT4VBPWUj00M}Kn&kjC%l|{80@*Rh03d*<<^Wulqw+xx_=lnoAb^1a{?qJ8X99t9s1Q110fX{N&M96?M3IGC#>?pwQQ*_H2Fw}su zCo%vCAhJRL*reY6t)X5Xm8co}~y`&XN6?fn%u#JgU$g01!YVg#fn1 zg)bzK0ZblU93X(07>Eo3bjy)TH(VhB0a|DY7BvI_0*I&(z-KuOGcQnOU|Fb&;ur>7 zkZx@-4R;){g880Q$?$!O>`{;`Kmf7)|3|9jnCSpyIVi3f7}yyYrmDmBa%4w?#W?ho zf#TX=F@CW4Dn)3qT3(FAys;{J3-%Y68eH+(7&l z8X61`$1wb5_%W54fivf^2tWW4Z~!685&R#~H-L`N06KslXh}5Ga*$<0K>Q9U)&!() z0`Ya2<<=lO00IbSHpEx7;tGjxks!m*0YhLZ)aOEwGytZ#!Qvo!WB?FASnC3Ol?tJd zAO>*GYlpJ|0*K{5j{HhYC4+7`_X;gw6c_8Q0$aU@AwoY6-vz4u304ovh5!M?s8Mn0 zKfK5D7t*u&i{8^g?(rb^n2_W?$CP5k@%Q z3oRq43P7bD$frN1%EGf968H$jj{yP*)GYrFVn8E{mf$8D|2N2PfB<5FGJeycBm5Sd pAV2_Nsa~mzfzj|EpFBW-0RW_)kI9oc*gyaP002ovPDHLkV1l+5{v!YY literal 0 HcmV?d00001 diff --git a/qui/MussaWindow.cpp b/qui/MussaWindow.cpp index e11e586..6ecb88a 100644 --- a/qui/MussaWindow.cpp +++ b/qui/MussaWindow.cpp @@ -64,6 +64,27 @@ MussaWindow::MussaWindow(Mussa *analysis_, QWidget *parent) : updateAnalysis(); } +MussaWindow::~MussaWindow() +{ + if (analysis != 0) delete analysis; + aligned_windows.clear(); + if (motif_editor != 0) delete motif_editor; + + if (aboutAction != 0) delete aboutAction; + if (closeAction != 0) delete closeAction; + if (createNewAnalysisAction != 0) delete createNewAnalysisAction; + if (createSubAnalysisAction != 0) delete createSubAnalysisAction; + if (editMotifsAction != 0) delete editMotifsAction; + if (loadMotifListAction != 0) delete loadMotifListAction; + if (loadMupaAction != 0) delete loadMupaAction; + if (loadSavedAnalysisAction != 0) delete loadSavedAnalysisAction; + if (newMussaWindowAction != 0) delete newMussaWindowAction; + if (saveMotifListAction != 0) delete saveMotifListAction; + if (showMussaViewToolbarAction != 0) delete showMussaViewToolbarAction; + if (toggleMotifsAction != 0) delete toggleMotifsAction; + if (saveBrowserPixmapAction != 0) delete saveBrowserPixmapAction; +} + void MussaWindow::setAnalysis(Mussa *new_analysis) { if (new_analysis != 0) { @@ -117,6 +138,12 @@ void MussaWindow::setupActions() this, SLOT(loadSavedAnalysis())); loadSavedAnalysisAction->setIcon(QIcon(":/icons/fileopen.png")); + newMussaWindowAction = new QAction(tr("&New Mussa Window"), this); + newMussaWindowAction->setStatusTip("open another mussa window to allow comparing results"); + connect(newMussaWindowAction, SIGNAL(triggered()), + this, SLOT(newMussaWindow())); + newMussaWindowAction->setIcon(QIcon(":/icons/window_new.png")); + saveMotifListAction = new QAction(tr("Save Motifs"), this); connect(saveMotifListAction, SIGNAL(triggered()), this, SLOT(saveMotifList())); @@ -162,6 +189,7 @@ void MussaWindow::setupMainMenu() QMenu *newMenu; newMenu = menuBar()->addMenu(tr("&File")); + newMenu->addAction(newMussaWindowAction); newMenu->addAction(createNewAnalysisAction); newMenu->addAction(loadMupaAction); newMenu->addAction(loadSavedAnalysisAction); @@ -317,6 +345,13 @@ void MussaWindow::loadSavedAnalysis() assert (analysis != 0); } +void MussaWindow::newMussaWindow() +{ + Mussa *a = new Mussa(); + MussaWindow *win = new MussaWindow(a); + win->show(); +} + void MussaWindow::setSoftThreshold(int threshold) { if (analysis->get_soft_thres() != threshold) { diff --git a/qui/MussaWindow.hpp b/qui/MussaWindow.hpp index b1dc329..d27f618 100644 --- a/qui/MussaWindow.hpp +++ b/qui/MussaWindow.hpp @@ -26,6 +26,7 @@ class MussaWindow : public QMainWindow public: MussaWindow(Mussa* analysis=0, QWidget *parent=0); + ~MussaWindow(); //! switch to a new analysis void setAnalysis(Mussa *new_analysis); @@ -57,6 +58,9 @@ public slots: //! set the soft threshold used by the Nway_Path algorithm void setSoftThreshold(int thres); + //! open a new mussa window so one can compare analyses + void newMussaWindow(); + void showMussaToolbar(); //! open new window showing our alignment @@ -85,6 +89,7 @@ protected: QAction *loadMotifListAction; QAction *loadMupaAction; QAction *loadSavedAnalysisAction; + QAction *newMussaWindowAction; QAction *saveMotifListAction; QAction *showMussaViewToolbarAction; QAction *toggleMotifsAction; -- 2.30.2