void MainWindow::openHomepage() { if(!startBrowser("http://qt.osdn.org.ua/qnetwalk.html")) QMessageBox::warning(this, tr("Error"), tr("Could not launch your web browser.\n" "Please, check the BROWSER environment's variable.")); }
static void my_button_press(GtkWidget *widget, GdkEventButton *event, gpointer data) { int x, y; // bstate = PRESSED; x = event->x; y = event->y; #if MY_DEBUG_OUTPUT == 1 g_print("hello, x is:%d, y is:%d\n", x, y); #endif if(in_image1(x,y)) {/*browser*/ #if MY_DEBUG_OUTPUT == 1 g_print("pressed in the image1\n"); #endif //launchApp_simple("/usr/bin/midbrowser"); startBrowser(widget); } else if(in_image2(x,y)) {/*Audio*/ #if MY_DEBUG_OUTPUT == 1 g_print("pressed in the image2\n"); #endif //launchApp_simple("/usr/bin/ls -a");//这里启动程序 //launchApp_simple("/usr/bin/StartAudio.sh"); startAudio(widget); } else if(in_image3(x,y)) {/*Video*/ #if MY_DEBUG_OUTPUT == 1 g_print("pressed in the image3\n"); #endif //launchApp_simple("/usr/bin/echo good");//这里启动程序 //launchApp_simple("/usr/bin/StartVideo.sh"); startVideo(widget); } else if(in_image4(x,y)) {/*Wifi*/ #if MY_DEBUG_OUTPUT == 1 g_print("pressed in the image4\n"); #endif //launchApp_simple("/usr/bin/echo 'hello world'");//这里启动程序 //launchApp_simple("/usr/bin/StartWifi.sh");//这里启动程序 startWifi(widget); } else { #if MY_DEBUG_OUTPUT == 1 g_print("pressed out of all the image!\n"); #endif } }