summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rwxr-xr-xsrc/main.cpp58
1 files changed, 4 insertions, 54 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 826ddfe..5f58b69 100755
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -21,7 +21,6 @@
// -- #include "IndentHandler.h"
#include "SettingsPaths.h"
-// -- #include "UiGuiIndentServer.h"
// -- #include "UiGuiIniFileParser.h"
#include "UiGuiVersion.h"
@@ -38,21 +37,10 @@
/*!
/brief Entry point to UniversalIndentGUI application.
-
- Evaluates the following parameters:
- No parameters starts without server and full gui.
- A string without any parameter prefix will be loaded as file on start.
- -p --plugin : Run as plugin. Server will be started with a simplified gui.
- -s --server : Run as server only, without gui.
- If -p and -s are set, -p will be used.
- -v --verbose needs a following parameter defining the verbose level as a number from 0 to 3.
*/
int main(int argc, char *argv[])
{
TQString file2OpenOnStart = "";
- int verboseLevel = 1;
- bool startAsPlugin = false;
- bool startAsServer = false;
bool tclapExitExceptionThrown = false;
int returnValue = 0;
@@ -61,9 +49,7 @@ int main(int argc, char *argv[])
try
{
// Define the command line object.
- TCLAP::CmdLine cmd("If -p and -s are set, -p will be used.\n"
- "Giving no parameters starts full gui without server.",
- ' ', PROGRAM_VERSION_STRING);
+ TCLAP::CmdLine cmd("Starts full gui", ' ', PROGRAM_VERSION_STRING);
cmd.setExceptionHandling(false);
// Define a value argument and add it to the command line.
@@ -71,30 +57,11 @@ int main(int argc, char *argv[])
"Opens the by filename defined file on start" , false, "", "filename");
cmd.add(filenameArg);
- // Define a switch and add it to the command line.
- TCLAP::SwitchArg pluginSwitch("p", "plugin",
- "Run as plugin. Server will be started with a simplified gui", false);
- cmd.add(pluginSwitch);
-
- // Define a switch and add it to the command line.
- TCLAP::SwitchArg serverSwitch("s", "server",
- "Run as server only without gui", false);
- cmd.add(serverSwitch);
-
- // Define a value argument and add it to the command line.
- TCLAP::ValueArg<int> verboselevelArg("v", "verbose",
- "Sets how many info is written to the log. 0 means with debug info, "
- "3 means critical messages only" , false, 1, "int");
- cmd.add(verboselevelArg);
-
// Parse the args.
cmd.parse(argc, argv);
// Get the value parsed by each arg.
file2OpenOnStart = filenameArg.getValue().c_str();
- startAsPlugin = pluginSwitch.getValue();
- startAsServer = serverSwitch.getValue();
- verboseLevel = verboselevelArg.getValue();
}
catch (TCLAP::ArgException &e)
{
@@ -122,7 +89,6 @@ int main(int argc, char *argv[])
}
TQApplication app(argc, argv);
-// -- UiGuiIndentServer server;
MainWindow *mainWindow = NULL;
// -- IndentHandler *indentHandler = NULL;
@@ -130,21 +96,8 @@ int main(int argc, char *argv[])
TQTextCodec::setCodecForCStrings(TQTextCodec::codecForName("UTF-8"));
TQTextCodec::setCodecForLocale(TQTextCodec::codecForName("UTF-8"));
- // Start normal with full gui and without server.
- if (!startAsPlugin && !startAsServer) {
- mainWindow = new MainWindow(file2OpenOnStart);
- mainWindow->show();
- }
-// -- // Start as plugin with server.
-// -- else if (startAsPlugin) {
-// -- server.startServer();
-// -- indentHandler = new IndentHandler(0);
-// -- indentHandler->show();
-// -- }
-// -- // Start as server only without any gui.
-// -- else if (startAsServer) {
-// -- server.startServer();
-// -- }
+ mainWindow = new MainWindow(file2OpenOnStart);
+ mainWindow->show();
try
{
@@ -155,10 +108,7 @@ int main(int argc, char *argv[])
{
tqDebug(TQString() + __LINE__ + " " + __FUNCTION__ + ": Something went terribly wrong: " + ex.what());
}
-// --
-// -- if (startAsPlugin || startAsServer)
-// -- server.stopServer();
-// --
+
// -- delete indentHandler;
delete mainWindow;