20 #if defined(USE_BREAKPAD) 28 #if defined(Q_OS_WIN32) 31 #if defined(HAVE_SIGNAL_H) 35 #if defined(USE_BREAKPAD) 37 setup_crash_reporter()
42 #if defined(Q_OS_WIN32) 43 QString crashReporter = Vidalia::applicationDirPath() +
"\\crashreporter.exe";
44 #elif defined(Q_OS_MAC) 45 QString crashReporter = Vidalia::applicationDirPath() +
"/CrashReporter.app";
47 QString crashReporter = Vidalia::applicationDirPath() +
"/crashreporter";
49 if (! QFileInfo(crashReporter).isExecutable()) {
50 vWarn(
"Unable to find crash reporting application. Crash reporting will " 55 vWarn(
"Vidalia found the crash reporting application, but the path is " 56 "longer than your platform supports. Skipping crash reporting.");
64 Vidalia::arguments().mid(1));
73 vWarn(
"Unable to setup Breakpad exception handler. Crash reporting " 74 "will be unavailable.");
76 vInfo(
"Installed Breakpad exception handler.");
85 if (signal == SIGINT || signal == SIGTERM)
93 #if defined(HAVE_SIGACTION) 94 struct sigaction action;
96 sigemptyset(&action.sa_mask);
100 if (sigaction(SIGINT, &action, NULL) < 0)
101 vWarn(
"Failed to install SIGINT handler.");
102 if (sigaction(SIGTERM, &action, NULL) < 0)
103 vWarn(
"Failed to install SIGTERM handler.");
104 #elif defined(HAVE_SIGNAL) 106 vWarn(
"Failed to install SIGINT handler.");
108 vWarn(
"Failed to install SIGTERM handler.");
119 #if defined(Q_OS_WIN32) 120 if (QSysInfo::WindowsVersion == QSysInfo::WV_NT) {
138 Q_INIT_RESOURCE(vidalia);
144 Vidalia vidalia(args, argc, argv);
146 .arg(QT_VERSION_STR);
148 #if defined(USE_BREAKPAD) 150 setup_crash_reporter();
152 #if defined(USE_MARBLE) && defined(Q_OS_WIN32) 153 vApp->addLibraryPath(
vApp->applicationDirPath() +
"/plugins/qt");
167 vError(
"Unable to apply command-line arguments: %1").arg(errmsg);
169 vApp->translate(
"Vidalia",
170 QT_TRANSLATE_NOOP(
"Vidalia",
"Invalid Argument")), errmsg,
176 QString pidfile = vidalia.
pidFile();
178 vWarn(
"Detected another process with pid %1. Is Vidalia already running?")
183 vApp->translate(
"Vidalia",
184 QT_TRANSLATE_NOOP(
"Vidalia",
"Vidalia is already running")),
185 vApp->translate(
"Vidalia",
186 QT_TRANSLATE_NOOP(
"Vidalia",
187 "Another Vidalia process is possibly already running. " 188 "If there really is not another Vidalia process running, " 189 "you can choose to continue anyway.\n\n" 190 "Would you like to continue starting Vidalia?")),
194 vError(
"Exiting duplicate Vidalia process.");
204 Vidalia::setQuitOnLastWindowClosed(
false);
210 int ret = vidalia.
run();
215 QFile::remove(pidfile);
216 vNotice(
"Vidalia is exiting cleanly (return code %1).").arg(ret);
218 #if defined(USE_BREAKPAD) 219 vInfo(
"Removing Breakpad exception handler.");
void install_signal_handler()
bool install_exception_handler(const QString &dumpPath)
void remove_exception_handler(void)
qint64 read_pidfile(const QString &pidFileName, QString *errmsg)
bool write_pidfile(const QString &pidFileName, QString *errmsg)
bool validateArguments(QString &errmsg)
stop errmsg signal(TorSignal::Signal sig)
bool set_crash_reporter(const QString &crashReporter)
bool set_build_version(const QString &version)
bool is_process_running(qint64 pid)
static QString dataDirectory()
void signal_handler(int signal)
static int critical(QWidget *parent, QString caption, QString text, int button0, int button1=NoButton, int button2=NoButton)
int main(int argc, char *argv[])
bool is_vidalia_running(const QString &pidfile)
bool set_restart_options(const QString &executable, const QStringList &arguments)
QStringList char_array_to_stringlist(char **arr, int len)
static void showUsageMessageBox()