@@ -50,50 +50,27 @@ int main( int argc, char *argv[] )
50
50
using namespace viewer ;
51
51
signal ( SIGSEGV, error::sigsegv );
52
52
53
- std::string appName = " vast" ;
54
- std::string orgName = " cbs.mpg.de" ;
55
- QCoreApplication::setApplicationName ( appName.c_str () );
56
- QCoreApplication::setOrganizationName ( orgName.c_str () );
53
+ QCoreApplication::setOrganizationName ( " cbs.mpg.de" );
57
54
QSettings settings;
58
55
59
- qt5::IOQtApplication app ( appName.c_str (), false , false );
60
- app.parameters [" in" ] = util::slist ();
61
- app.parameters [" in" ].needed () = false ;
62
- app.parameters [" in" ].setDescription ( " The input image file list." );
63
- // app.parameters["zmap"] = util::slist();
64
- // app.parameters["zmap"].needed() = false;
65
- // app.parameters["zmap"].setDescription( "The input image file list is interpreted as statistical maps. " );
66
- // alias to zmap
67
- // app.parameters["stats"] = util::slist();
68
- // app.parameters["stats"].needed() = false;
69
- // app.parameters["stats"].setDescription( "The input image file list is interpreted as statistical maps. " );
56
+ qt5::IOQtApplication app ( " vast" , true , false );
70
57
app.parameters [" split" ] = false ;
71
58
app.parameters [" split" ].needed () = false ;
72
59
app.parameters [" split" ].setDescription ( " Show each image in a separate view" );
73
60
app.parameters [" widget" ] = std::string ();
74
61
app.parameters [" widget" ].needed () = false ;
75
62
app.parameters [" widget" ].setDescription ( " Use specific widget" );
76
- app.init ( argc, argv, false );
77
- auto core = std::make_unique<QViewerCore>();
63
+ auto core = app.init ( argc, argv, &QViewerCore::images_loaded );
78
64
79
65
app.addLogging <viewer::Runtime>(" " );
80
66
app.addLogging <viewer::Dev>(" " );
81
67
82
- // setting stylesheet
83
- if ( settings.value ( " useStyleSheet" ).toBool () ) {
84
- app.getQApplication ().setStyleSheet ( util::Singletons::get<style::Style , 10 >().getStyleSheet ( settings.value (" styleSheet" ).toString ().toStdString () ) );
85
- }
86
-
87
- // @todo implement me
88
- // core->addMessageHandler( logging_hanlder_runtime.get() );
89
- // core->addMessageHandlerDev( logging_hanlder_dev.get() );
90
68
// scan for plugins and hand them to the core
91
69
core->addPlugins ( plugin::PluginLoader::get ().getPlugins () );
92
70
core->getUICore ()->reloadPluginsToGUI ();
93
71
94
72
std::string widget_name = app.parameters [" widget" ];
95
73
96
-
97
74
if ( widget_name.empty () ) {
98
75
if ( settings.value ( " showImagesGeometricalView" ).toBool () && core->hasWidget ( settings.value ( " widgetGeometrical" ).toString ().toStdString () ) ) {
99
76
widget_name = settings.value (" widgetGeometrical" ).toString ().toStdString ();
@@ -108,39 +85,6 @@ int main( int argc, char *argv[] )
108
85
std::cerr << " Error loading widget!" << std::endl;
109
86
}
110
87
111
- util::slist fileList = app.parameters [" in" ];
112
- // const bool zmapIsSet = app.parameters["zmap"].isParsed() || app.parameters["stats"].isParsed();
113
- // util::slist zmapFileList = app.parameters["zmap"];
114
- //
115
- // if( !zmapFileList.size() ) {
116
- // zmapFileList = app.parameters["stats"];
117
- // }
118
- //
119
- // if( zmapIsSet ) {
120
- // core->setMode( ViewerCoreBase::statistical_mode );
121
- // } else {
122
- // core->setMode( ViewerCoreBase::default_mode );
123
- // }
124
-
125
- std::list<FileInformation> fileInfoList;
126
-
127
- for ( util::slist::const_reference file: fileList ) {
128
- fileInfoList.push_back ( FileInformation ( file,
129
- app.parameters [" rdialect" ].as <std::string>().c_str (),
130
- app.parameters [" rf" ].as <std::string>().c_str (),
131
- widget_name,
132
- ImageHolder::structural_image,
133
- app.parameters [" split" ].as <bool >() ) );
134
- }
135
- // for( util::slist::const_reference file: zmapFileList ) {
136
- // fileInfoList.push_back( FileInformation( file,
137
- // app.parameters["rdialect"].as<std::string>().c_str(),
138
- // app.parameters["rf"].as<std::string>().c_str(),
139
- // widget_name,
140
- // ImageHolder::statistical_image,
141
- // app.parameters["split"].as<bool>() ) );
142
- // }
143
-
144
- core->getUICore ()->showMainWindow ( fileInfoList );
145
- return app.getQApplication ().exec ();
88
+ core->getUICore ()->showMainWindow ( );
89
+ return app.exec ();
146
90
}
0 commit comments