Beispiel #1
0
FXint source_list_sort_reverse(const FXTreeItem* pa,const FXTreeItem* pb){
  const GMSource * const sa = static_cast<const GMSource*>(pa->getData());
  const GMSource * const sb = static_cast<const GMSource*>(pb->getData());
  if (sa->getType()>sb->getType()) return 1;
  else if (sa->getType()<sb->getType()) return -1;
  FXint a=0,b=0;
  if (begins_with_keyword(pa->getText())) a=FXMIN(pa->getText().length()-1,pa->getText().find(' ')+1);
  if (begins_with_keyword(pb->getText())) b=FXMIN(pb->getText().length()-1,pb->getText().find(' ')+1);
  return -compareversion(&pa->getText()[a],&pb->getText()[b]);
  }
Beispiel #2
0
long GMNotifyDaemon::onNotifyServer(FXObject*,FXSelector,void*ptr){
  DBusMessage * msg = static_cast<DBusMessage*>(ptr);
  const FXchar * dname=NULL;
  const FXchar * vendor=NULL;
  const FXchar * version=NULL;
  const FXchar * spec=NULL;

  if ((dbus_message_get_type(msg)==DBUS_MESSAGE_TYPE_METHOD_RETURN) && dbus_message_get_args(msg,NULL,DBUS_TYPE_STRING,&dname,DBUS_TYPE_STRING,&vendor,DBUS_TYPE_STRING,&version,DBUS_TYPE_STRING,&spec,DBUS_TYPE_INVALID)) {

    if (compareversion(spec,"1.1")==0) {
      icondata="image_data";
      }
    else if (compareversion(spec,"1.2")>=0) {
      icondata="image-data";
      }
    else {
      icondata="icon_data";
      }

    if (comparecase(vendor,"xfce")==0 && comparecase(dname,"xfce notify daemon")==0) {
      flags|=IMAGE_WITHOUT_APPICON;
      }

    if (comparecase(dname,"gnome-shell")==0 && comparecase(vendor,"gnome")==0) {
      GMPlayerManager::instance()->getPreferences().gui_tray_icon_disabled=true;
      flags|=ACTION_ITEMS;
      if (compareversion(version,"3.2.0")<0){
        flags|=IMAGE_WITHOUT_APPICON;
        }
      }
#ifdef DEBUG
    fxmessage("name: %s\n",dname);
    fxmessage("vendor: %s\n",vendor);
    fxmessage("version: %s\n",version);
    fxmessage("spec: %s\n",spec);
    fxmessage("icondata: %s\n",icondata.text());
    fxmessage("flags: %x\n",flags);
#endif
    }

  GMPlayerManager::instance()->update_tray_icon();
  return 1;
  }