[gnome-dvb-daemon] Use GLib module instead of GObject for timeout_add and source_remove
- From: Sebastian Polsterl <sebp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-dvb-daemon] Use GLib module instead of GObject for timeout_add and source_remove
- Date: Fri, 3 Oct 2014 22:38:43 +0000 (UTC)
commit 6002a153bab5af2c19908970d120ed0986d880f2
Author: Sebastian Pölsterl <sebp k-d-w org>
Date: Fri Oct 3 14:50:10 2014 +0200
Use GLib module instead of GObject for timeout_add and source_remove
.../ui/controlcenter/ControlCenterWindow.py | 3 ++-
client/gnomedvb/ui/wizard/SetupWizard.py | 3 ++-
client/gnomedvb/ui/wizard/pages/AdaptersPage.py | 5 +++--
client/gnomedvb/ui/wizard/pages/ChannelScanPage.py | 5 +++--
client/gnomedvb/ui/wizard/pages/SetupDevicePage.py | 5 +++--
5 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/client/gnomedvb/ui/controlcenter/ControlCenterWindow.py
b/client/gnomedvb/ui/controlcenter/ControlCenterWindow.py
index 294cf1f..92683de 100644
--- a/client/gnomedvb/ui/controlcenter/ControlCenterWindow.py
+++ b/client/gnomedvb/ui/controlcenter/ControlCenterWindow.py
@@ -17,6 +17,7 @@
# along with GNOME DVB Daemon. If not, see <http://www.gnu.org/licenses/>.
from gi.repository import Gdk
+from gi.repository import GLib
from gi.repository import Gtk
from gi.repository import GObject
from gnomedvb import _
@@ -417,7 +418,7 @@ class ControlCenterWindow(Gtk.Window):
def _on_devgroupslist_inserted(self, model, path, aiter):
if len(model) == 1:
# Delay the call otherwise we get DBus errors
- GObject.timeout_add(100, self._select_first_group)
+ GLib.timeout_add(100, self._select_first_group)
def _on_channel_selected(self, treeselection):
model, aiter = treeselection.get_selected()
diff --git a/client/gnomedvb/ui/wizard/SetupWizard.py b/client/gnomedvb/ui/wizard/SetupWizard.py
index 048147e..eeff090 100644
--- a/client/gnomedvb/ui/wizard/SetupWizard.py
+++ b/client/gnomedvb/ui/wizard/SetupWizard.py
@@ -17,6 +17,7 @@
# along with GNOME DVB Daemon. If not, see <http://www.gnu.org/licenses/>.
import gnomedvb
+from gi.repository import GLib
from gi.repository import GObject
from gi.repository import Gtk
from gnomedvb import _
@@ -47,7 +48,7 @@ class CloseDialog(Gtk.Dialog):
self.progressbar = Gtk.ProgressBar()
self.progressbar.set_pulse_step(0.1)
- self._progressbar_timer = GObject.timeout_add(100, self._progressbar_pulse)
+ self._progressbar_timer = GLib.timeout_add(100, self._progressbar_pulse)
self.progressbar.show()
vbox.pack_start(self.progressbar, False, True, 0)
diff --git a/client/gnomedvb/ui/wizard/pages/AdaptersPage.py b/client/gnomedvb/ui/wizard/pages/AdaptersPage.py
index 4ef993a..5b656e4 100644
--- a/client/gnomedvb/ui/wizard/pages/AdaptersPage.py
+++ b/client/gnomedvb/ui/wizard/pages/AdaptersPage.py
@@ -16,6 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with GNOME DVB Daemon. If not, see <http://www.gnu.org/licenses/>.
+from gi.repository import GLib
from gi.repository import GObject
import gnomedvb
from gi.repository import Gtk
@@ -127,10 +128,10 @@ class AdaptersPage(BasePage):
self._progressbar.set_fraction(0.1)
self._progressbar.show()
self.pack_start(self._progressbar, False, True, 0)
- self._progressbar_timer = GObject.timeout_add(100, self.progressbar_pulse, None)
+ self._progressbar_timer = GLib.timeout_add(100, self.progressbar_pulse, None)
def destroy_progressbar(self):
- GObject.source_remove(self._progressbar_timer)
+ GLib.source_remove(self._progressbar_timer)
self._progressbar_timer = None
self._progressbar.destroy()
diff --git a/client/gnomedvb/ui/wizard/pages/ChannelScanPage.py
b/client/gnomedvb/ui/wizard/pages/ChannelScanPage.py
index 06619a7..5fb1902 100644
--- a/client/gnomedvb/ui/wizard/pages/ChannelScanPage.py
+++ b/client/gnomedvb/ui/wizard/pages/ChannelScanPage.py
@@ -17,6 +17,7 @@
# along with GNOME DVB Daemon. If not, see <http://www.gnu.org/licenses/>.
from gi.repository import GdkPixbuf
+from gi.repository import GLib
from gi.repository import Gtk
from gi.repository import GObject
from gnomedvb import _
@@ -180,7 +181,7 @@ class ChannelScanPage(BasePage):
self._scanner.connect ("frontend-stats", self.__on_frontend_stats)
self.progressbar.set_pulse_step(0.1)
- self._progressbar_timer = GObject.timeout_add(100, self._progressbar_pulse)
+ self._progressbar_timer = GLib.timeout_add(100, self._progressbar_pulse)
self.progressbar.show()
if isinstance(tuning_data, str):
@@ -232,7 +233,7 @@ class ChannelScanPage(BasePage):
fraction = float(self._scanned_freqs) / self._max_freqs
# Stop progressbar from pulsing
if self._progressbar_timer > 0:
- GObject.source_remove(self._progressbar_timer)
+ GLib.source_remove(self._progressbar_timer)
self._progressbar_timer = 0
self.progressbar.set_fraction(fraction)
diff --git a/client/gnomedvb/ui/wizard/pages/SetupDevicePage.py
b/client/gnomedvb/ui/wizard/pages/SetupDevicePage.py
index a3e78cc..3447779 100644
--- a/client/gnomedvb/ui/wizard/pages/SetupDevicePage.py
+++ b/client/gnomedvb/ui/wizard/pages/SetupDevicePage.py
@@ -16,6 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with GNOME DVB Daemon. If not, see <http://www.gnu.org/licenses/>.
+from gi.repository import GLib
from gi.repository import GObject
import gnomedvb
from gi.repository import Gtk
@@ -90,10 +91,10 @@ class SetupDevicePage(BasePage):
self._progressbar.set_fraction(0.1)
self._progressbar.show()
self.pack_start(self._progressbar, False, True, 0)
- self._progressbar_timer = GObject.timeout_add(100, self.progressbar_pulse)
+ self._progressbar_timer = GLib.timeout_add(100, self.progressbar_pulse)
def destroy_progressbar(self):
- GObject.source_remove(self._progressbar_timer)
+ GLib.source_remove(self._progressbar_timer)
self._progressbar_timer = None
self._progressbar.destroy()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]