Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Redstart
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
Redstart
Commits
100912e9
Commit
100912e9
authored
Nov 28, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding feature to export a Redstart session
parent
1bd72b6c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
5 deletions
+55
-5
src/RedstartSessionImportDialog.cpp
src/RedstartSessionImportDialog.cpp
+1
-1
src/RedstartWindow.cpp
src/RedstartWindow.cpp
+46
-0
src/RedstartWindow.h
src/RedstartWindow.h
+2
-0
ui/RedstartWindow.ui
ui/RedstartWindow.ui
+6
-4
No files found.
src/RedstartSessionImportDialog.cpp
View file @
100912e9
...
...
@@ -59,7 +59,7 @@ QVariantHash RedstartSessionImportDialog::GetCoreConfig() const
{
if
(
!
ValidFile
()
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Can not import from a directory or non-existing file"
);
CVAStruct
oCoreConfig
=
VACore
::
Get
CoreConfigFromFile
(
m_oConfigFileBasePath
.
absoluteFilePath
().
toStdString
()
);
CVAStruct
oCoreConfig
=
VACore
::
Load
CoreConfigFromFile
(
m_oConfigFileBasePath
.
absoluteFilePath
().
toStdString
()
);
return
ConvertVAStructToQHash
(
oCoreConfig
);
}
...
...
src/RedstartWindow.cpp
View file @
100912e9
...
...
@@ -16,6 +16,7 @@
#include <QDesktopServices>
#include <QHash>
#include <QShortcut>
#include <QFileDialog>
#include "RedstartWindow.h"
#include <ui_RedstartWindow.h>
...
...
@@ -682,3 +683,48 @@ void RedstartWindow::on_actionAmbisonics_triggered()
{
}
void
RedstartWindow
::
on_actionExport_to_file_triggered
()
{
QFileDialog
fd
;
fd
.
setNameFilters
(
QStringList
()
<<
"INI files (*.ini)"
<<
"Any file (*.*)"
);
fd
.
setViewMode
(
QFileDialog
::
Detail
);
fd
.
setAcceptMode
(
QFileDialog
::
AcceptSave
);
QDir
oLastDir
(
m_qSettings
.
value
(
"Redstart/last_browse_folder"
).
toString
()
);
if
(
oLastDir
.
exists
()
)
fd
.
setDirectory
(
oLastDir
);
else
fd
.
setDirectory
(
QDir
(
QApplication
::
applicationDirPath
()
)
);
QString
sFileName
=
ui
->
listView_redstart_session_list
->
GetCurrentSessionID
();
if
(
sFileName
.
isEmpty
()
==
false
)
fd
.
selectFile
(
sFileName
+
".ini"
);
if
(
fd
.
exec
()
)
{
QStringList
lFiles
=
fd
.
selectedFiles
();
if
(
lFiles
.
empty
()
==
false
)
{
QString
sFilePath
=
lFiles
[
0
];
QFileInfo
oFile
(
sFilePath
);
if
(
fd
.
directory
().
exists
()
)
m_qSettings
.
setValue
(
"Redstart/last_browse_folder"
,
oFile
.
absolutePath
()
);
try
{
CVAStruct
oConfig
=
ui
->
listView_redstart_session_list
->
GetCurrentConfig
();
VACore
::
StoreCoreConfigToFile
(
oConfig
,
sFilePath
.
toStdString
()
);
}
catch
(
CVAException
&
e
)
{
QString
sErrorMessage
=
QString
(
"Could not export session configuration: %1"
).
arg
(
QString
::
fromStdString
(
e
.
ToString
()
)
);
QErrorMessage
oErrMsg
;
oErrMsg
.
showMessage
(
sErrorMessage
);
oErrMsg
.
exec
();
}
}
}
}
src/RedstartWindow.h
View file @
100912e9
...
...
@@ -146,6 +146,8 @@ private slots:
void
on_actionAmbisonics_triggered
();
void
on_actionExport_to_file_triggered
();
private:
void
PostCoreStart
();
void
PostCoreStop
();
...
...
ui/RedstartWindow.ui
View file @
100912e9
...
...
@@ -855,7 +855,7 @@ background-color: rgb(208, 255, 188);</string>
</widget>
<widget
class=
"QMenu"
name=
"menuCrurrent_session"
>
<property
name=
"enabled"
>
<bool>
fals
e
</bool>
<bool>
tru
e
</bool>
</property>
<property
name=
"title"
>
<string>
Current session
</string>
...
...
@@ -864,7 +864,6 @@ background-color: rgb(208, 255, 188);</string>
<addaction
name=
"actionRemove"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionExport_to_file"
/>
<addaction
name=
"actionExport_VA_core_configuration"
/>
</widget>
<addaction
name=
"separator"
/>
<addaction
name=
"menuNew_session"
/>
...
...
@@ -1023,13 +1022,13 @@ background-color: rgb(208, 255, 188);</string>
</action>
<action
name=
"actionExport_to_file"
>
<property
name=
"text"
>
<string>
Export session
to file
</string>
<string>
Export session
</string>
</property>
<property
name=
"toolTip"
>
<string>
Export current session to file
</string>
</property>
<property
name=
"shortcut"
>
<string>
S,
F
</string>
<string>
S,
X
</string>
</property>
</action>
<action
name=
"actionRemove"
>
...
...
@@ -1076,6 +1075,9 @@ background-color: rgb(208, 255, 188);</string>
</property>
</action>
<action
name=
"actionEdit_session"
>
<property
name=
"enabled"
>
<bool>
false
</bool>
</property>
<property
name=
"text"
>
<string>
Edit session
</string>
</property>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment