Search Results

Search found 5 results on 1 pages for 'hakermania'.

Page 1/1 | 1 

  • What is the correct way to use g_signal_connect() in C++ for dynamic unity quicklists?

    - by hakermania
    I want to make my application use dynamic unity quicklists. For building my application I am using C++ and the QtCreator IDE. When a menu action is triggered I want to be able to have access to a non-static function of my MainWindow class so as to be able to update the Graphical User Interface which can be accessed from inside 'normal' MainWindow's functions. So, I am building up my quicklist like this (mainwindow.cpp): void MainWindow::enable_unity_quicklist(){ Unity_Menu = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set_bool (Unity_Menu, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); Unity_Stop = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set(Unity_Stop, DBUSMENU_MENUITEM_PROP_LABEL, "Stop"); dbusmenu_menuitem_child_append (Unity_Menu, Unity_Stop); g_signal_connect (Unity_Stop, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(&fake_callback), (gpointer)this); if(!unity_entry) unity_entry = unity_launcher_entry_get_for_desktop_id("myapp.desktop"); unity_launcher_entry_set_quicklist(unity_entry, Unity_Menu); dbusmenu_menuitem_property_set_bool(Unity_Menu, DBUSMENU_MENUITEM_PROP_VISIBLE, true); dbusmenu_menuitem_property_set_bool(Unity_Stop, DBUSMENU_MENUITEM_PROP_VISIBLE, true); } void MainWindow::fake_callback(gpointer data){ MainWindow* m = (MainWindow*)data; m->on_stopButton_clicked(); } void MainWindow::on_stopButton_clicked(){ //stopping the process... } mainwindow.h: private slots: void enable_unity_quicklist(); void on_stopButton_clicked(); public slots: static void fake_callback(gpointer data); This suggestion was taken from http://old.nabble.com/Using-g_signal_connect-in-class-td18461823.html The program crashes immediately after I choose the 'Stop' action from the Unity Quicklist. Debugging the program shows that I am not able to access anything MainWindow related inside the on_stopButton_clicked() without crashing. For example, it crashes when doing this check (which is the first 2 lines of code inside this function): if (!ui->stopButton->isEnabled()) return; I have also tested lots of other things that I found at the internet, but nothing of them worked. One interesting solution would be to use gtkmm (http://developer.gnome.org/gtkmm-tutorial/stable/sec-connecting-signal-handlers.html.en) but I am not used at all working on GTK applications (I work solely in Qt) and I don't know if this even suits to my occasion. A compilable example indicating what the problem is can be found at: http://ubuntuone.com/7iKA3wnPmWVp8YNNDLlVQI (3.2Kb) If you are not familiar with the QtCreator IDE, you can compile with the following commands, as long as you have all the needed libraries: cd dynamic_unity_quicklists_test; qmake -project; qmake; make

    Read the article

  • Make sniqt recognize all tray abilities (or create a working indicator in Qt)

    - by hakermania
    There is this old thread of mine: How do I create a working indicator with Qt/C++? where I was suggested to use the QSystemTray library for making a tray icon in Ubuntu for my application. Sniqt is a program that takes care of the rest. As known, Ubuntu has got rid of tray icons. Instead, it now uses indicators and only indicators. Sniqt converts the Qt tray icons into working indicators. The problem is that it doesn't do a very decent convertion. Actions like single click, middle click etc do not work, while they do in systems that support tray icons. Is there a way to have these actions back? Can I use QSystemTray icon and still have these interesting (and very helpful, in my occasion) actions in Ubuntu? I would be glad to know the answer to the other thread I talked about earlier (how to make a working indicator using the GTK libraries and prevent the crash), as well. Link for Sniqt bug: https://bugs.launchpad.net/sni-qt/+bug/1027652

    Read the article

  • Make application automatically detect system language

    - by hakermania
    What should an application developed under a Linux System like Ubuntu do so as to automatically detect the system language? There are applications, like Liferea that automatically change their language to match the system's, without altering any preference of the program itself: Should this be the "default" behavior for all the programs? Should there be an option on the program so as to let the user choose the language nonetheless? Are all these translations coming along with the program itself? What if the user has set a system language not available in the translations of the program? Is this Ubuntu or most-linux-distros specific?

    Read the article

  • Dependency problem while missing package is already installed

    - by hakermania
    I am trying to install a program but I am getting a dependency error. The error clearly points out: Dependency is not satisfiable: libc6-amd64 (>= 2.14) I went on to investigate and I found out that I have 2.19 version installed, actually: alex@MaD-pc:~$ apt-cache policy libc6-amd64 libc6-amd64:i386: Installed: 2.19-0ubuntu6 Candidate: 2.19-0ubuntu6 Version table: *** 2.19-0ubuntu6 0 500 http://us.archive.ubuntu.com/ubuntu/ trusty/main i386 Packages 100 /var/lib/dpkg/status Why am I getting this error if I already have this package? I also should probably mention that the system is 100% up to date. I run the updates and upgrades, restarted the system and then tried to install the package again with the same error popping up. Edit 1: I am using amd64 but I have installed some 32-bit libraries required by some program installed via wine if I recall correctly.

    Read the article

  • GTK app: How do I create a working indicator with Qt/C++?

    - by hakermania
    I've tried in 2 forums, but I had no luck so far. So, I am using Qt IDE in order to build my application so as to participate to the Ubuntu Showdown contest. In my application, I've done the following: void show_app(MainWindow *data) { //this works fine: app_indicator_set_status(appindicator, APP_INDICATOR_STATUS_PASSIVE); //this crashes the application: data->show(); } void MainWindow::make_indicator() { if(appindicator){ //appindicator has already been created return; } appindicator = app_indicator_new("Format Junkie Indicator", "formatjunkie", APP_INDICATOR_CATEGORY_APPLICATION_STATUS); GtkWidget* showapp_option; GtkWidget* indicatormenu = gtk_menu_new(); GtkWidget* item = gtk_menu_item_new_with_label("Format Junkie main menu"); gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), indicatormenu); showapp_option = gtk_menu_item_new_with_label("Show App!"); g_signal_connect(showapp_option, "activate", G_CALLBACK(show_app), this); gtk_menu_shell_append(GTK_MENU_SHELL(indicatormenu), showapp_option); gtk_widget_show_all(indicatormenu); app_indicator_set_status(appindicator, APP_INDICATOR_STATUS_ACTIVE); app_indicator_set_attention_icon(appindicator, "dialog-warning"); app_indicator_set_menu(appindicator, GTK_MENU (indicatormenu)); } So, basically I am trying to make a simple indicator entry, which, on click, it will hide the indicator and display the application. The indicator can be successfully hidden using the PASSIVE thingy over there, but, during the call data-show();, the application crashes. Any help on what I am doing wrong would be appreciated! Also, please help me to correct this problem I'm facing (alternatively, I will migrate to the old and good tray icon (it works fine in 12.04, anyway) which I can handle very easily and efficiently)

    Read the article

1