added musrview, moved all images to an image folder, added an about dialog

This commit is contained in:
nemu
2009-02-26 20:23:54 +00:00
parent bb68989a75
commit d949c55231
19 changed files with 168 additions and 23 deletions

View File

@ -55,6 +55,7 @@
#include "PAdmin.h"
#include "PFitOutputHandler.h"
#include "PGetDefaultDialog.h"
#include "forms/PMusrGuiAbout.h"
//----------------------------------------------------------------------------------------------------
/**
@ -65,7 +66,7 @@ PTextEdit::PTextEdit( QWidget *parent, const char *name )
{
fAdmin = new PAdmin();
fShowMlog = true;
fShowMlog = fAdmin->getShowMlog();
setupFileActions();
setupEditActions();
@ -701,6 +702,16 @@ void PTextEdit::musrCalcChisq()
if ( !currentEditor() )
return;
QString tabLabel = fTabWidget->label(fTabWidget->currentPageIndex());
if (tabLabel == "noname") {
QMessageBox::critical(this, "**ERROR**", "For a fit a real msr-file is needed.");
return;
} else if (tabLabel == "noname*") {
fileSaveAs();
} else if (tabLabel.find("*") > 0) {
fileSave();
}
QValueVector<QString> cmd;
QString str;
str = fAdmin->getExecPath() + "/musrfit";
@ -722,6 +733,16 @@ void PTextEdit::musrFit()
if ( !currentEditor() )
return;
QString tabLabel = fTabWidget->label(fTabWidget->currentPageIndex());
if (tabLabel == "noname") {
QMessageBox::critical(this, "**ERROR**", "For a fit a real msr-file is needed.");
return;
} else if (tabLabel == "noname*") {
fileSaveAs();
} else if (tabLabel.find("*") > 0) {
fileSave();
}
QValueVector<QString> cmd;
QString str;
str = fAdmin->getExecPath() + "/musrfit";
@ -742,9 +763,29 @@ void PTextEdit::musrView()
if ( !currentEditor() )
return;
QMessageBox::information( this, "musrView",
"Will call musrview.\n"
"NOT IMPLEMENTED YET :-(" );
QString tabLabel = fTabWidget->label(fTabWidget->currentPageIndex());
if (tabLabel == "noname") {
QMessageBox::critical(this, "**ERROR**", "For a view a real mlog/msr-file is needed.");
return;
} else if (tabLabel == "noname*") {
fileSaveAs();
} else if (tabLabel.find("*") > 0) {
fileSave();
}
QString cmd;
QString str;
str = fAdmin->getExecPath() + "/musrview";
cmd = str + " ";
str = *fFilenames.find( currentEditor());
if (fShowMlog) {
str.replace(str.find(".msr"), 4, ".mlog");
}
cmd += str + " &";
system(cmd.latin1());
}
//----------------------------------------------------------------------------------------------------
@ -789,8 +830,8 @@ void PTextEdit::helpContents()
*/
void PTextEdit::helpAbout()
{
QMessageBox::about(this, "MuSR-GUI",
"andreas.suter@psi.ch");
PMusrGuiAbout *about = new PMusrGuiAbout();
about->show();
}
//----------------------------------------------------------------------------------------------------

View File

@ -0,0 +1,103 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>PMusrGuiAbout</class>
<widget class="QDialog">
<property name="name">
<cstring>PMusrGuiAbout</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>428</width>
<height>192</height>
</rect>
</property>
<property name="caption">
<string>musrgui About</string>
</property>
<property name="icon">
<pixmap>image0</pixmap>
</property>
<widget class="QLabel">
<property name="name">
<cstring>fMusrGui_textLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>130</x>
<y>0</y>
<width>199</width>
<height>45</height>
</rect>
</property>
<property name="text">
<string>&lt;b&gt;&lt;i&gt;&lt;font size="+4"&gt;musrgui...&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>fSVN_textLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>130</y>
<width>400</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>&lt;i&gt;SVN $Id$&lt;/i&gt;</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>fAbout_textLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>150</x>
<y>50</y>
<width>140</width>
<height>70</height>
</rect>
</property>
<property name="text">
<string>&lt;p align="center"&gt;by Andreas Suter&lt;br&gt;
andreas.suter@psi.ch&lt;br&gt;
Paul Scherrer Institut&lt;br&gt;
Switzerland&lt;/p&gt;</string>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>fOk_pushButton</cstring>
</property>
<property name="geometry">
<rect>
<x>183</x>
<y>160</y>
<width>70</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>OK</string>
</property>
</widget>
</widget>
<images>
<image name="image0">
<data format="PNG" length="411">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000016249444154388d95544dae86200c9c1a169e471217707e5890d4f3b830e95b687d15e51349889982fd19a6252e0c6c001cb06e2b4637629abde0584b61aacf7bf0b06eebc5e88d5360b74fc18b9ed7f75bd82908210a01e0c204e33c8628029c99e8fd373ca853009023c3a530290d1a619abdf464aa7818dd682b3f232f8569ddd6cb594fa6578eab9f2f0f5105ede57888214ace692f3d33d591951602be719c72a2d18dc839512b93737de0989e74dcc2d3eca557d7371db7b0364daf3a865eceded41142949b8e7b38b32b86288fe7371d77bcb66d1ace4ceadcce9669f6a2f79dcdf0edbb1426752200c874ec8da6c37e6e2e0cfbadb798cd99c18571b11546ca090ed807cf85db23b2da6388a27ab7034a39d54a08403afc383c7514dab8a5e3a530a5431d4b667200e0c37f16e968efa70adede40a7e414bc3875663b4833d44a6adc548f59832dd3ce865fb8a9fbdaf1178e7f656ea724a59cba75fce5fb0774073f42f0dd40cc0000000049454e44ae426082</data>
</image>
</images>
<connections>
<connection>
<sender>fOk_pushButton</sender>
<signal>clicked()</signal>
<receiver>PMusrGuiAbout</receiver>
<slot>accept()</slot>
</connection>
</connections>
<layoutdefaults spacing="6" margin="11"/>
</UI>

View File

@ -25,22 +25,23 @@ SOURCES = PTextEdit.cpp \
PGetDefaultDialog.cpp \
main.cpp
FORMS = forms/PGetDefaultDialogBase.ui
FORMS = forms/PGetDefaultDialogBase.ui \
forms/PMusrGuiAbout.ui
IMAGES = editcopy.xpm \
editcut.xpm \
editpaste.xpm \
editredo.xpm \
editundo.xpm \
filenew.xpm \
fileopen.xpm \
fileprint.xpm \
filesave.xpm \
musrasym.xpm \
musrsinglehisto.xpm \
musrcalcchisq.xpm \
musrfit.xpm \
musrview.xpm \
musrt0.xpm \
musrprefs.xpm
IMAGES = images/editcopy.xpm \
images/editcut.xpm \
images/editpaste.xpm \
images/editredo.xpm \
images/editundo.xpm \
images/filenew.xpm \
images/fileopen.xpm \
images/fileprint.xpm \
images/filesave.xpm \
images/musrasym.xpm \
images/musrsinglehisto.xpm \
images/musrcalcchisq.xpm \
images/musrfit.xpm \
images/musrview.xpm \
images/musrt0.xpm \
images/musrprefs.xpm