Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
vite
Commits
c67ed79a
Commit
c67ed79a
authored
7 years ago
by
Mathieu Faverge
Browse files
Options
Downloads
Patches
Plain Diff
feat(mv): add files to history for a nicer use
parent
e296d207
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!7
Mv/history
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugins/MatrixVisualizer/MatrixVisualizer.cpp
+38
-5
38 additions, 5 deletions
plugins/MatrixVisualizer/MatrixVisualizer.cpp
plugins/MatrixVisualizer/MatrixVisualizer.hpp
+2
-0
2 additions, 0 deletions
plugins/MatrixVisualizer/MatrixVisualizer.hpp
with
40 additions
and
5 deletions
plugins/MatrixVisualizer/MatrixVisualizer.cpp
+
38
−
5
View file @
c67ed79a
#include
"MatrixVisualizer.hpp"
#include
"Configuration.hpp"
#include
"common/Session.hpp"
#include
<QFileDialog>
#define SESSION_FILENAME( fname ) QString::fromStdString( "plugins/mv/files/" + fname )
Matrix_visualizer
*
Matrix_visualizer
::
s_plugin
=
nullptr
;
SymbolParser
Matrix_visualizer
::
s_symbol_parser
;
OrderParser
Matrix_visualizer
::
s_order_parser
;
...
...
@@ -23,14 +26,31 @@ Matrix_visualizer* Matrix_visualizer::get_instance()
return
s_plugin
;
}
void
Matrix_visualizer
::
set_line_edit_defaults
(
QLineEdit
*
le
,
std
::
string
name
,
std
::
string
def_name
)
{
Session
&
s
=
Session
::
getSession
();
QString
lineedit_fname
;
QString
session_fname
;
session_fname
=
SESSION_FILENAME
(
name
);
if
(
s
.
contains
(
session_fname
)
)
{
lineedit_fname
=
s
.
value
(
session_fname
).
toString
();
}
else
{
lineedit_fname
=
QString
::
fromStdString
(
def_name
);
}
le
->
setText
(
lineedit_fname
);
}
// Plugin implementation itself
Matrix_visualizer
::
Matrix_visualizer
()
{
setupUi
(
this
);
s_plugin
=
this
;
// For windows dev (pc: orange)
this
->
line_edit_symbol
->
setText
(
"/home/mathieu/1-PaStiX/pastix/build/symbol_rank"
);
set_line_edit_defaults
(
this
->
line_edit_symbol
,
"symbol"
,
"symbol.sps"
);
set_line_edit_defaults
(
this
->
line_edit_order
,
"order"
,
"order.ord"
);
set_line_edit_defaults
(
this
->
line_edit_values
,
"values"
,
"values.txt"
);
}
Matrix_visualizer
::~
Matrix_visualizer
(){
...
...
@@ -54,6 +74,8 @@ std::string Matrix_visualizer::get_name(){
int
Matrix_visualizer
::
update_matrix
(
QString
filepath
)
{
Session
&
s
=
Session
::
getSession
();
symbol_matrix_t
*
new_matrix
;
// Check if there is a symbol file
...
...
@@ -72,6 +94,7 @@ int Matrix_visualizer::update_matrix( QString filepath )
Helper
::
log
(
LogStatus
::
FATAL
,
"Parsed matrix is empty"
);
return
-
1
;
}
s
.
setValue
(
"plugins/mv/files/symbol"
,
filepath
);
if
(
s_matrix
!=
nullptr
)
{
symbol_matrix_deinit
(
s_matrix
);
...
...
@@ -209,14 +232,24 @@ void Matrix_visualizer::set_infos(const char* format, va_list ap)
**********************/
void
Matrix_visualizer
::
on_tool_button_symbol_clicked
()
{
QString
symbol_filepath
=
QFileDialog
::
getOpenFileName
(
s_plugin
,
tr
(
"Open file"
),
"C://"
);
QString
symbol_filepath
=
QFileDialog
::
getOpenFileName
(
s_plugin
,
tr
(
"Open file"
),
s_plugin
->
line_edit_symbol
->
text
()
);
s_plugin
->
line_edit_symbol
->
setText
(
symbol_filepath
);
}
void
Matrix_visualizer
::
on_tool_button_order_clicked
()
{
QString
order_filepath
=
QFileDialog
::
getOpenFileName
(
s_plugin
,
tr
(
"Open file"
),
s_plugin
->
line_edit_order
->
text
()
);
s_plugin
->
line_edit_order
->
setText
(
order_filepath
);
}
void
Matrix_visualizer
::
on_tool_button_values_clicked
()
{
QString
values_filepath
=
QFileDialog
::
getOpenFileName
(
s_plugin
,
tr
(
"Open file"
),
"C://"
);
QString
values_filepath
=
QFileDialog
::
getOpenFileName
(
s_plugin
,
tr
(
"Open file"
),
s_plugin
->
line_edit_values
->
text
()
);
s_plugin
->
line_edit_values
->
setText
(
values_filepath
);
}
...
...
This diff is collapsed.
Click to expand it.
plugins/MatrixVisualizer/MatrixVisualizer.hpp
+
2
−
0
View file @
c67ed79a
...
...
@@ -34,12 +34,14 @@ private:
int
update_values
(
QString
filepath
);
void
connect_widgets
();
void
set_line_edit_defaults
(
QLineEdit
*
le
,
std
::
string
name
,
std
::
string
def_name
);
public
slots
:
void
execute
();
private
slots
:
static
void
on_tool_button_symbol_clicked
();
static
void
on_tool_button_order_clicked
();
static
void
on_tool_button_values_clicked
();
static
void
on_tool_button_infos_clicked
();
static
void
on_tool_button_logs_clicked
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment