Adjusted the menu code in an attempt to make it work better on leopard. Removed
the idle_add wrapper for on_quit and moved the idle_add wrapping into the sync-menu code instead.
This commit is contained in:
parent
483604cd0b
commit
c2b901dfe9
4
TODO.osx
4
TODO.osx
|
@ -23,12 +23,10 @@ The bits that dont work
|
|||
- fix user session management
|
||||
-integrate the Gajim and gajim-remote scripts with autoconf and add GTK
|
||||
framework detection
|
||||
-Pass icons to OS/X menu
|
||||
-set the LSEnvironment in Info.plist for gtk paths instead of hard coding in
|
||||
gajim.py
|
||||
-Maybe setup the pasteboard services for an OS/X alternative to the
|
||||
gajim_remote
|
||||
-CFBundleDocumentTypes.NSDocument
|
||||
-zeroconf has a parsing problem with the MDNS result.
|
||||
|
||||
|
||||
Native GTK bugs
|
||||
|
|
|
@ -3,19 +3,22 @@
|
|||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>69 10 356 240 0 0 1280 832 </string>
|
||||
<string>82 255 356 240 0 0 1280 832 </string>
|
||||
<key>IBEditorPositions</key>
|
||||
<dict>
|
||||
<key>29</key>
|
||||
<string>245 312 185 44 0 0 1280 832 </string>
|
||||
<string>476 296 342 44 0 0 1280 832 </string>
|
||||
</dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>446.1</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>4</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>289</integer>
|
||||
<integer>29</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>8R218</string>
|
||||
<string>8S165</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
Binary file not shown.
|
@ -4,6 +4,10 @@ OS=`uname -s`
|
|||
|
||||
if [ "x${OS}" == "xDarwin" ]; then
|
||||
export RESOURCEPATH="${BASE}/dist/Gajim.app/Contents/Resources"
|
||||
GTK_DIR="/Library/Frameworks/GTK+.framework/Versions/Current"
|
||||
export PATH="${GTK_DIR}/bin:$PATH"
|
||||
export PYTHONPATH="${GTK_DIR}/lib/python2.5/site-packages:${GTK_DIR}/lib/python2.5/site-packages/gtk-2.0:${PYTHONPATH}"
|
||||
unset GTK_DIR
|
||||
fi
|
||||
|
||||
cd ${BASE}/src
|
||||
|
|
|
@ -297,7 +297,7 @@ def pid_alive():
|
|||
return False
|
||||
elif sys.platform == 'darwin':
|
||||
from osx import checkPID
|
||||
return checkPID(pid, 'gajim')
|
||||
return checkPID(pid, 'Gajim.bin')
|
||||
try:
|
||||
if not os.path.exists('/proc'):
|
||||
return True # no /proc, assume Gajim is running
|
||||
|
|
|
@ -10,8 +10,8 @@ if BUILD_COCOA
|
|||
syncmenulib_LTLIBRARIES = syncmenu.la
|
||||
syncmenulibdir = $(libdir)/gajim
|
||||
syncmenu_la_SOURCES = sync-menu.c pysyncmenu.c
|
||||
syncmenu_la_LDFLAGS = -module -avoid-version $(GTKLDFLAGS)
|
||||
syncmenu_la_CFLAGS = $(GTKCFLAGS) -Wall -g $(INCLUDES)
|
||||
syncmenu_la_LDFLAGS = -module -avoid-version -Xcompiler -isysroot -Xcompiler /Developer/SDKs/MacOSX10.4u.sdk -Xcompiler -arch -Xcompiler ppc -Xcompiler -arch -Xcompiler i386 $(GTKLDFLAGS)
|
||||
syncmenu_la_CFLAGS = -Xcompiler -isysroot -Xcompiler /Developer/SDKs/MacOSX10.4u.sdk -Xcompiler -arch -Xcompiler ppc -Xcompiler -arch -Xcompiler i386 $(GTKCFLAGS) -Wall -g $(INCLUDES)
|
||||
endif
|
||||
|
||||
DISTCLEANFILES =
|
||||
|
|
|
@ -477,11 +477,16 @@ carbon_menu_item_connect (GtkWidget *menu_item,
|
|||
return carbon_item;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* carbon event handler
|
||||
*/
|
||||
|
||||
gboolean menuitem_activate_wrapper(gpointer data)
|
||||
{
|
||||
gtk_menu_item_activate((GtkMenuItem*)data);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static OSStatus
|
||||
menu_event_handler_func (EventHandlerCallRef event_handler_call_ref,
|
||||
EventRef event_ref,
|
||||
|
@ -526,7 +531,8 @@ menu_event_handler_func (EventHandlerCallRef event_handler_call_ref,
|
|||
sizeof (widget), 0, &widget);
|
||||
if (err == noErr && widget)
|
||||
{
|
||||
gtk_menu_item_activate (GTK_MENU_ITEM (widget));
|
||||
g_idle_add(menuitem_activate_wrapper,
|
||||
(gpointer)GTK_MENU_ITEM (widget));
|
||||
return noErr;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4191,9 +4191,6 @@ class RosterWindow:
|
|||
gtk.main_quit()
|
||||
|
||||
def on_quit_menuitem_activate(self, widget):
|
||||
gobject.idle_add(self.on_quit_menuitem_activate_real, widget)
|
||||
|
||||
def on_quit_menuitem_activate_real(self, widget):
|
||||
accounts = gajim.connections.keys()
|
||||
get_msg = False
|
||||
for acct in accounts:
|
||||
|
@ -5187,47 +5184,47 @@ class RosterWindow:
|
|||
def setup_for_osx(self):
|
||||
# Massage the GTK menu so it will match up to the OS/X nib style menu
|
||||
# when passed to sync-menu and merged
|
||||
main_menu = self.xml.get_widget('menubar')
|
||||
app_item = gtk.MenuItem('Gajim')
|
||||
main_menu = self.xml.get_widget("menubar")
|
||||
app_item = gtk.MenuItem("Gajim")
|
||||
main_menu.insert(app_item, 0)
|
||||
win_item = gtk.MenuItem('Window')
|
||||
win_item = gtk.MenuItem("Window")
|
||||
main_menu.insert(win_item, 4)
|
||||
actions_menu = self.xml.get_widget('actions_menu_menu')
|
||||
quit_item = self.xml.get_widget('quit_menuitem')
|
||||
actions_menu = self.xml.get_widget("actions_menu_menu")
|
||||
quit_item = self.xml.get_widget("quit_menuitem")
|
||||
actions_menu.remove(quit_item)
|
||||
actions_menu.remove(self.xml.get_widget('separator1'))
|
||||
edit_menu = self.xml.get_widget('edit_menu_menu')
|
||||
edit_menu.remove(self.xml.get_widget('preferences_menuitem'))
|
||||
edit_menu.remove(self.xml.get_widget('separator2'))
|
||||
help_menu = self.xml.get_widget('help_menu_menu')
|
||||
about_item = self.xml.get_widget('about_menuitem')
|
||||
actions_menu.remove(self.xml.get_widget("separator1"))
|
||||
edit_menu = self.xml.get_widget("edit_menu_menu")
|
||||
#edit_menu.remove(self.xml.get_widget("preferences_menuitem"))
|
||||
edit_menu.remove(self.xml.get_widget("separator2"))
|
||||
help_menu = self.xml.get_widget("help_menu_menu")
|
||||
about_item = self.xml.get_widget("about_menuitem")
|
||||
help_menu.remove(about_item)
|
||||
# Build up App menu
|
||||
app_menu = gtk.Menu()
|
||||
app_item.set_submenu(app_menu)
|
||||
app_menu.append(about_item)
|
||||
app_menu.append(gtk.MenuItem('__SKIP__'))
|
||||
prefs_item = gtk.MenuItem('Preferences...')
|
||||
app_menu.append(gtk.MenuItem("__SKIP__"))
|
||||
prefs_item = gtk.MenuItem("Preferences...")
|
||||
prefs_item.connect("activate", self.on_preferences_menuitem_activate)
|
||||
accels = gtk.AccelGroup()
|
||||
self.xml.get_widget('roster_window').add_accel_group(accels)
|
||||
prefs_item.add_accelerator('activate', accels, ord(','),
|
||||
self.xml.get_widget("roster_window").add_accel_group(accels)
|
||||
prefs_item.add_accelerator("activate", accels, ord(','),
|
||||
gtk.gdk.CONTROL_MASK, gtk.ACCEL_VISIBLE)
|
||||
app_menu.append(prefs_item)
|
||||
app_menu.append(gtk.MenuItem('__SKIP__'))
|
||||
app_menu.append(gtk.MenuItem('__SKIP__'))
|
||||
app_menu.append(gtk.MenuItem('__SKIP__'))
|
||||
app_menu.append(gtk.MenuItem('__SKIP__'))
|
||||
app_menu.append(gtk.MenuItem('__SKIP__'))
|
||||
app_menu.append(gtk.MenuItem('__SKIP__'))
|
||||
app_menu.append(gtk.MenuItem('__SKIP__'))
|
||||
app_menu.append(gtk.MenuItem("__SKIP__"))
|
||||
app_menu.append(gtk.MenuItem("__SKIP__"))
|
||||
app_menu.append(gtk.MenuItem("__SKIP__"))
|
||||
app_menu.append(gtk.MenuItem("__SKIP__"))
|
||||
app_menu.append(gtk.MenuItem("__SKIP__"))
|
||||
app_menu.append(gtk.MenuItem("__SKIP__"))
|
||||
app_menu.append(gtk.MenuItem("__SKIP__"))
|
||||
app_menu.append(quit_item)
|
||||
app_menu.show_all()
|
||||
# Do the merge baby!
|
||||
syncmenu.takeover_menu(main_menu)
|
||||
self.make_menu(force = True)
|
||||
# Hide the GTK menubar itself and let the OS/X menubar do its thing
|
||||
self.xml.get_widget('menubar').hide()
|
||||
#self.xml.get_widget("menubar").hide()
|
||||
return
|
||||
|
||||
def __init__(self):
|
||||
|
|
Loading…
Reference in New Issue