Merge lp:~daniel-stehn/forssim/bugfix_476555 into lp:forssim

Proposed by Martin Flodin
Status: Needs review
Proposed branch: lp:~daniel-stehn/forssim/bugfix_476555
Merge into: lp:forssim
Diff against target: 124 lines (+37/-0)
2 files modified
FsWisdom/SelectCaseWindow.cpp (+34/-0)
FsWisdom/SelectCaseWindow.h (+3/-0)
To merge this branch: bzr merge lp:~daniel-stehn/forssim/bugfix_476555
Reviewer Review Type Date Requested Status
Forsslund Systems Pending
Review via email: mp+15656@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

357. By Daniel Stehn

Fix for bug 476555

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'FsWisdom/SelectCaseWindow.cpp'
2--- FsWisdom/SelectCaseWindow.cpp 2009-10-29 12:45:46 +0000
3+++ FsWisdom/SelectCaseWindow.cpp 2009-12-04 15:45:24 +0000
4@@ -77,6 +77,12 @@
5 cout << "Destroying SelectCaseWindow"<<endl;
6 }
7
8+
9+void SelectCaseWindow::showFullScreen()
10+{
11+ EnableButtons(true);
12+ QWidget::showFullScreen();
13+}
14 void SelectCaseWindow::showFullScreenAndUpdate()
15 {
16 /*Update timestamp list for selected case, i.e. the case that user exited from,
17@@ -98,6 +104,8 @@
18 void SelectCaseWindow::browseToX3dFile()
19 {
20 QString fileName;
21+ EnableButtons( false );
22+
23 QFileDialog fileDlg(this, "Browse to X3D File",applicationNode->getPreviousX3dFilePath().absolutePath(),"X3D Files (*.x3d)");
24 if(fileDlg.exec() == QDialog::Accepted) // only store new path if user pressed Ok.
25 {
26@@ -110,10 +118,14 @@
27
28 cout << fileName.toStdString() << endl;
29 }
30+
31+ EnableButtons( true );
32 }
33
34 void SelectCaseWindow::launchX3dFile()
35 {
36+ EnableButtons( false );
37+
38 if(!applicationNode->getPreviousX3dFilePath().path().isEmpty())
39 {
40 ui.standardOutputPlainTextEdit->clear();
41@@ -127,6 +139,7 @@
42 void SelectCaseWindow::closeX3dFile()
43 {
44 applicationNode->closeX3dFile();
45+ EnableButtons( true );
46 setCloseX3DFileEnable(false);
47 }
48
49@@ -149,6 +162,19 @@
50 applicationNode->restoreNormalCursor();
51 }
52
53+void SelectCaseWindow::EnableButtons( bool bEnable )
54+{
55+ ui.browseToX3dFilePushButton->setEnabled( bEnable );
56+ ui.launchX3dFilePushButton->setEnabled( bEnable );
57+ ui.addCasePushButton->setEnabled( bEnable );
58+ ui.launchCaseWithPlaybackPushButton->setEnabled( bEnable );
59+ ui.launchCaseWithoutPlaybackPushButton->setEnabled( bEnable );
60+ ui.logoutPushButton->setEnabled( bEnable );
61+
62+ repaint();
63+
64+}
65+
66 void SelectCaseWindow::launchCaseWithoutPlayback()
67 {
68 launchCase(false);
69@@ -162,6 +188,9 @@
70 void SelectCaseWindow::launchCase(bool isPlayback)
71 {
72 QDir x3dFilePath;
73+ EnableButtons( false );
74+ bool bLaunchPerformed = false;
75+
76 if(applicationNode->getLocalCaseList()->getX3dFilePathForSelectedRow(x3dFilePath, ui.caseListWidget))
77 {
78 int forsCaseVersionId = -1;
79@@ -197,6 +226,7 @@
80 //Display application window
81 cout<< " the File to be lauched now " << x3dFilePath.path().toStdString()<<endl;
82 applicationNode->launchX3DWithStandardGuiWindow(x3dFilePath, isPlayback, forsCaseVersionId);
83+ bLaunchPerformed = true;
84 }
85 }
86
87@@ -209,6 +239,10 @@
88 "\nNo case selected! \n");
89
90 }
91+
92+ if( bLaunchPerformed == false )
93+ EnableButtons( true );
94+
95 }
96
97
98
99=== modified file 'FsWisdom/SelectCaseWindow.h'
100--- FsWisdom/SelectCaseWindow.h 2009-10-16 07:07:30 +0000
101+++ FsWisdom/SelectCaseWindow.h 2009-12-04 15:45:24 +0000
102@@ -28,6 +28,7 @@
103 ~SelectCaseWindow();
104
105 void initialize();
106+ void showFullScreen();
107 void showFullScreenAndUpdate();
108
109 public slots:
110@@ -61,12 +62,14 @@
111
112
113 private:
114+
115 Ui::SelectCaseWindowClass ui;
116 ApplicationNode* applicationNode;
117 auto_ptr<QDebugStream> standardOutputToTextEdit;
118 auto_ptr<QDebugStream> standardErrorToTextEdit;
119
120 void launchCase(bool isPlayback);
121+ void EnableButtons( bool bEnable );
122 };
123
124 }

Subscribers

People subscribed via source and target branches