Now uses GLib for DBus communication instead of python-dbus
Now checks the file limit in DVD projects
This commit is contained in:
parent
cc4039df9c
commit
ec4829812a
4 changed files with 25 additions and 15 deletions
|
|
@ -36,12 +36,13 @@ class message_window:
|
||||||
wmessage_text.set_markup(text)
|
wmessage_text.set_markup(text)
|
||||||
wmessage_list = builder.get_object("list_message")
|
wmessage_list = builder.get_object("list_message")
|
||||||
wmessage_liststore = builder.get_object("liststore_elements")
|
wmessage_liststore = builder.get_object("liststore_elements")
|
||||||
|
wmessage_window.show_all()
|
||||||
|
|
||||||
if (list_data == None):
|
if (list_data == None):
|
||||||
wmessage_list.hide()
|
wmessage_list.hide()
|
||||||
else:
|
else:
|
||||||
for element in list_data:
|
for element in list_data:
|
||||||
wmessage_liststore.append([element])
|
wmessage_liststore.append([element])
|
||||||
|
|
||||||
wmessage_window.show_all()
|
|
||||||
wmessage_window.run()
|
wmessage_window.run()
|
||||||
wmessage_window.destroy()
|
wmessage_window.destroy()
|
||||||
|
|
|
||||||
|
|
@ -393,6 +393,17 @@ class devede_project:
|
||||||
|
|
||||||
def on_create_disc_clicked(self,b):
|
def on_create_disc_clicked(self,b):
|
||||||
|
|
||||||
|
if self.disc_type == "dvd":
|
||||||
|
max_files = 62
|
||||||
|
else:
|
||||||
|
max_files = -1
|
||||||
|
|
||||||
|
file_movies = self.get_all_files()
|
||||||
|
t = len(file_movies)
|
||||||
|
if (max_files != -1) and (t > max_files):
|
||||||
|
devede.message.message_window(_("The limit for this format is %(l)d files, but your project has %(h)d.") % {"l": max_files, "h" : t}, _("Too many files in the project"))
|
||||||
|
return
|
||||||
|
|
||||||
data = devede.create_disk_window.create_disk_window()
|
data = devede.create_disk_window.create_disk_window()
|
||||||
if (not data.run()):
|
if (not data.run()):
|
||||||
return
|
return
|
||||||
|
|
@ -408,7 +419,6 @@ class devede_project:
|
||||||
self.shutdown = data.shutdown
|
self.shutdown = data.shutdown
|
||||||
|
|
||||||
run_window = devede.runner.runner()
|
run_window = devede.runner.runner()
|
||||||
file_movies = self.get_all_files()
|
|
||||||
|
|
||||||
final_dependencies = []
|
final_dependencies = []
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
import dbus
|
from gi.repository import Gio, GLib
|
||||||
|
|
||||||
class shutdown:
|
class shutdown:
|
||||||
|
|
||||||
|
|
@ -23,9 +23,9 @@ class shutdown:
|
||||||
|
|
||||||
# First, try with logind
|
# First, try with logind
|
||||||
try:
|
try:
|
||||||
bus = dbus.SystemBus()
|
bus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None)
|
||||||
bus_object = bus.get_object("org.freedesktop.login1", "/org/freedesktop/login1")
|
bus.call_sync("org.freedesktop.login1", "/org/freedesktop/login1", "org.freedesktop.login1.Manager",
|
||||||
bus_object.PowerOff(False, dbus_interface="org.freedesktop.login1.Manager")
|
"PowerOff", GLib.Variant_boolean('(bb)', ( False , False) ), None, Gio.DBusCallFlags.NONE, -1, None)
|
||||||
except:
|
except:
|
||||||
failure=True
|
failure=True
|
||||||
|
|
||||||
|
|
@ -34,9 +34,9 @@ class shutdown:
|
||||||
|
|
||||||
# If it fails, try with ConsoleKit
|
# If it fails, try with ConsoleKit
|
||||||
try:
|
try:
|
||||||
bus = dbus.SystemBus()
|
bus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None)
|
||||||
bus_object = bus.get_object("org.freedesktop.ConsoleKit", "/org/freedesktop/ConsoleKit/Manager")
|
bus.call_sync("org.freedesktop.ConsoleKit", "/org/freedesktop/ConsoleKit/Manager", "org.freedesktop.ConsoleKit.Manager",
|
||||||
bus_object.Stop(dbus_interface="org.freedesktop.ConsoleKit.Manager")
|
"Stop", None, None, Gio.DBusCallFlags.NONE, -1, None)
|
||||||
except:
|
except:
|
||||||
failure=True
|
failure=True
|
||||||
|
|
||||||
|
|
@ -45,8 +45,8 @@ class shutdown:
|
||||||
|
|
||||||
# If it fails, try with HAL
|
# If it fails, try with HAL
|
||||||
try:
|
try:
|
||||||
bus = dbus.SystemBus()
|
bus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None)
|
||||||
bus_object = bus.get_object("org.freedesktop.Hal", "/org/freedesktop/Hal/devices/computer")
|
bus.call_sync("org.freedesktop.Hal", "/org/freedesktop/Hal/devices/computer","org.freedesktop.Hal.Device.SystemPowerManagement",
|
||||||
bus_object.Shutdown(dbus_interface="org.freedesktop.Hal.Device.SystemPowerManagement")
|
"Shutdown", None, None, Gio.DBusCallFlags.NONE, -1, None)
|
||||||
except:
|
except:
|
||||||
failure=True
|
failure=True
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ from gi.repository import Gtk
|
||||||
import devede.project
|
import devede.project
|
||||||
import devede.configuration_data
|
import devede.configuration_data
|
||||||
import devede.choose_disc_type
|
import devede.choose_disc_type
|
||||||
import devede.converter
|
|
||||||
|
|
||||||
config_data = devede.configuration_data.configuration.get_config()
|
config_data = devede.configuration_data.configuration.get_config()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue