public static int Main(string[] args) { QCoreApplication app = new QCoreApplication(args); if (!QDBusConnection.SessionBus().IsConnected()) { Console.Write("Cannot connect to the D-BUS session bus.\n" + "To start it, run:\n" + "\teval `dbus-launch --auto-syntax`\n"); return 1; } if (!QDBusConnection.SessionBus().RegisterService(SERVICE_NAME)) { Console.WriteLine(QDBusConnection.SessionBus().LastError().Message()); return 1; } Pong pong = new Pong(); Connect(app, SIGNAL("aboutToQuit()"), pong, SLOT("Terminator()")); QDBusConnection.SessionBus().RegisterObject("/", pong, (int) QDBusConnection.RegisterOption.ExportAllSlots); return QCoreApplication.Exec(); }
public static int Main(string[] args) { QCoreApplication app = new QCoreApplication(args); if (!QDBusConnection.SessionBus().IsConnected()) { Console.Error.WriteLine("Cannot connect to the D-BUS session bus.\n" + "To start it, run:\n" + "\teval `dbus-launch --auto-syntax`\n"); return 1; } Ping ping = new Ping(); ping.Connect(QDBusConnection.SessionBus().Interface(), SIGNAL("serviceOwnerChanged(QString,QString,QString)"), SLOT("Start(QString,QString,QString)")); // start the process manually - doesn't work this way.. // QProcess pong = new QProcess(qApp); // pong.Start("mono ./complexpong.exe"); // pong.WaitForStarted(); return QCoreApplication.Exec(); }
public static int Main(string[] args) { QCoreApplication app = new QCoreApplication(args); QObject obj = new QObject(); Pong pong = new Pong(obj); pong.Connect(app, SIGNAL("aboutToQuit()"), SIGNAL("aboutToQuit()")); pong.value = "initial value"; QDBusConnection.SessionBus().RegisterObject("/", obj); if (!QDBusConnection.SessionBus().RegisterService(SERVICE_NAME)) { Console.Error.WriteLine(QDBusConnection.SessionBus().LastError().Message()); return(1); } return QCoreApplication.Exec(); }
public static string Translate(string context, string key, string disambiguation, QCoreApplication.Encoding encoding, int n) { return (string) staticInterceptor.Invoke("translate$$$$$", "translate(const char*, const char*, const char*, QCoreApplication::Encoding, int)", typeof(string), typeof(string), context, typeof(string), key, typeof(string), disambiguation, typeof(QCoreApplication.Encoding), encoding, typeof(int), n); }