Mageia Bugzilla – Attachment 7036 Details for
Bug 15030
mageiawelcome: Port to GTK+3 and WebKit2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
automatic conversion from gtk2 to gtk3
0001-automatic-conversion-from-gtk2-to-gtk3.patch (text/plain), 3.47 KB, created by
Thierry Vignaud
on 2015-09-23 14:26:27 CEST
(
hide
)
Description:
automatic conversion from gtk2 to gtk3
Filename:
MIME Type:
Creator:
Thierry Vignaud
Created:
2015-09-23 14:26:27 CEST
Size:
3.47 KB
patch
obsolete
>From f0003ca5369a5339b829a73e7717a4ef9356f103 Mon Sep 17 00:00:00 2001 >From: Thierry Vignaud <thierry.vignaud@gmail.com> >Date: Sun, 9 Feb 2014 18:37:44 +0100 >Subject: [PATCH 1/8] automatic conversion from gtk2 to gtk3 > >(with manual fixes) >--- > usr/bin/mageiawelcome | 2 +- > usr/share/mageiawelcome/mageiawelcome.py | 2 +- > usr/share/mageiawelcome/webgui.py | 24 ++++++++++++------------ > 3 files changed, 14 insertions(+), 14 deletions(-) > >diff --git a/usr/bin/mageiawelcome b/usr/bin/mageiawelcome >index bb8d694..f23edb1 100755 >--- a/usr/bin/mageiawelcome >+++ b/usr/bin/mageiawelcome >@@ -2,7 +2,7 @@ > > import os > >-os.system("python /usr/share/mageiawelcome/mageiawelcome.py") >+os.system("python usr/share/mageiawelcome/mageiawelcome.py") > > > >diff --git a/usr/share/mageiawelcome/mageiawelcome.py b/usr/share/mageiawelcome/mageiawelcome.py >index bc1e0b7..5132419 100644 >--- a/usr/share/mageiawelcome/mageiawelcome.py >+++ b/usr/share/mageiawelcome/mageiawelcome.py >@@ -9,7 +9,7 @@ import subprocess > import shlex > import gettext > import string >-import gtk >+from gi.repository import Gtk > > from user import home > >diff --git a/usr/share/mageiawelcome/webgui.py b/usr/share/mageiawelcome/webgui.py >index a53e131..c3819d1 100644 >--- a/usr/share/mageiawelcome/webgui.py >+++ b/usr/share/mageiawelcome/webgui.py >@@ -3,11 +3,11 @@ import Queue > import thread > import urllib > >-import gtk >-import gobject >+from gi.repository import Gtk >+from gi.repository import GObject > > try: >- import webkit >+ from gi.repository import WebKit > have_webkit = True > except: > have_webkit = False >@@ -48,7 +48,7 @@ def asynchronous_gtk_message(fun): > apply(function, args, kwargs) > > def fun2(*args, **kwargs): >- gobject.idle_add(worker, (fun, args, kwargs)) >+ GObject.idle_add(worker, (fun, args, kwargs)) > > return fun2 > >@@ -62,7 +62,7 @@ def synchronous_gtk_message(fun): > > def fun2(*args, **kwargs): > class R: result = NoResult >- gobject.idle_add(worker, (R, fun, args, kwargs)) >+ GObject.idle_add(worker, (R, fun, args, kwargs)) > while R.result is NoResult: time.sleep(0.01) > return R.result > >@@ -70,12 +70,12 @@ def synchronous_gtk_message(fun): > > def launch_browser(html, quit_function=None, echo=True): > >- window = gtk.Window() >+ window = Gtk.Window() > browser = implementation.create_browser() > settings = browser.get_settings() > settings.set_property('enable-default-context-menu', False) > >- box = gtk.VBox(homogeneous=False, spacing=0) >+ box = Gtk.VBox(homogeneous=False, spacing=0) > window.add(box) > > >@@ -85,7 +85,7 @@ def launch_browser(html, quit_function=None, echo=True): > box.pack_start(browser, expand=True, fill=True, padding=0) > window.set_icon_name('preferences-desktop-personal') > window.set_title(_('Welcome to Mageia!')) >- window.set_position(gtk.WIN_POS_CENTER) >+ window.set_position(Gtk.WindowPosition.CENTER) > window.set_default_size(800, 500) > window.set_size_request(800, 500) > window.set_resizable(False) >@@ -117,9 +117,9 @@ def launch_browser(html, quit_function=None, echo=True): > > def start_gtk_thread(): > # Start GTK in its own thread: >- gtk.gdk.threads_init() >- gtk.gdk.threads_enter() >- thread.start_new_thread(gtk.main, ()) >+ Gdk.threads_init() >+ Gdk.threads_enter() >+ thread.start_new_thread(Gtk.main, ()) > > def kill_gtk_thread(): >- asynchronous_gtk_message(gtk.main_quit)() >+ asynchronous_gtk_message(Gtk.main_quit)() >-- >2.5.3 >
From f0003ca5369a5339b829a73e7717a4ef9356f103 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud <thierry.vignaud@gmail.com> Date: Sun, 9 Feb 2014 18:37:44 +0100 Subject: [PATCH 1/8] automatic conversion from gtk2 to gtk3 (with manual fixes) --- usr/bin/mageiawelcome | 2 +- usr/share/mageiawelcome/mageiawelcome.py | 2 +- usr/share/mageiawelcome/webgui.py | 24 ++++++++++++------------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/usr/bin/mageiawelcome b/usr/bin/mageiawelcome index bb8d694..f23edb1 100755 --- a/usr/bin/mageiawelcome +++ b/usr/bin/mageiawelcome @@ -2,7 +2,7 @@ import os -os.system("python /usr/share/mageiawelcome/mageiawelcome.py") +os.system("python usr/share/mageiawelcome/mageiawelcome.py") diff --git a/usr/share/mageiawelcome/mageiawelcome.py b/usr/share/mageiawelcome/mageiawelcome.py index bc1e0b7..5132419 100644 --- a/usr/share/mageiawelcome/mageiawelcome.py +++ b/usr/share/mageiawelcome/mageiawelcome.py @@ -9,7 +9,7 @@ import subprocess import shlex import gettext import string -import gtk +from gi.repository import Gtk from user import home diff --git a/usr/share/mageiawelcome/webgui.py b/usr/share/mageiawelcome/webgui.py index a53e131..c3819d1 100644 --- a/usr/share/mageiawelcome/webgui.py +++ b/usr/share/mageiawelcome/webgui.py @@ -3,11 +3,11 @@ import Queue import thread import urllib -import gtk -import gobject +from gi.repository import Gtk +from gi.repository import GObject try: - import webkit + from gi.repository import WebKit have_webkit = True except: have_webkit = False @@ -48,7 +48,7 @@ def asynchronous_gtk_message(fun): apply(function, args, kwargs) def fun2(*args, **kwargs): - gobject.idle_add(worker, (fun, args, kwargs)) + GObject.idle_add(worker, (fun, args, kwargs)) return fun2 @@ -62,7 +62,7 @@ def synchronous_gtk_message(fun): def fun2(*args, **kwargs): class R: result = NoResult - gobject.idle_add(worker, (R, fun, args, kwargs)) + GObject.idle_add(worker, (R, fun, args, kwargs)) while R.result is NoResult: time.sleep(0.01) return R.result @@ -70,12 +70,12 @@ def synchronous_gtk_message(fun): def launch_browser(html, quit_function=None, echo=True): - window = gtk.Window() + window = Gtk.Window() browser = implementation.create_browser() settings = browser.get_settings() settings.set_property('enable-default-context-menu', False) - box = gtk.VBox(homogeneous=False, spacing=0) + box = Gtk.VBox(homogeneous=False, spacing=0) window.add(box) @@ -85,7 +85,7 @@ def launch_browser(html, quit_function=None, echo=True): box.pack_start(browser, expand=True, fill=True, padding=0) window.set_icon_name('preferences-desktop-personal') window.set_title(_('Welcome to Mageia!')) - window.set_position(gtk.WIN_POS_CENTER) + window.set_position(Gtk.WindowPosition.CENTER) window.set_default_size(800, 500) window.set_size_request(800, 500) window.set_resizable(False) @@ -117,9 +117,9 @@ def launch_browser(html, quit_function=None, echo=True): def start_gtk_thread(): # Start GTK in its own thread: - gtk.gdk.threads_init() - gtk.gdk.threads_enter() - thread.start_new_thread(gtk.main, ()) + Gdk.threads_init() + Gdk.threads_enter() + thread.start_new_thread(Gtk.main, ()) def kill_gtk_thread(): - asynchronous_gtk_message(gtk.main_quit)() + asynchronous_gtk_message(Gtk.main_quit)() -- 2.5.3
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 15030
: 7036 |
7037
|
7038
|
7039
|
7040
|
7041
|
7042
|
7043