Listview ItemUpdating

banshee failing to run after installation on Linux mint 20

2020.11.02 18:55 tirstan666 banshee failing to run after installation on Linux mint 20

It was installed using GDebi type method
using these packages
banshee_2.9.2+really2.6.2-7ubuntu3_amd64.deb
libgconf2.0-cil_2.24.2-4_all.deb

when I started it would sit there for a few moments and then it would crash. I ran it thru the terminal to see what was happening and this is what i got:

[email protected]:~$ sudo banshee
[sudo] password for tristan:
[Warn 10:57:54.691] DBus support could not be started. Disabling for this session. - System.MethodAccessException: Method `DBus.BusObject..ctor()' is inaccessible from method `org.freedesktop.DBus.IBusProxy..ctor()' (in `')
at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_throw_method_access(intptr,intptr)
at org.freedesktop.DBus.IBusProxy..ctor () [0x00000] in <8f33313b90e6489c9b9730e93d658f9d>:0
at (wrapper managed-to-native) System.Reflection.RuntimeConstructorInfo.InternalInvoke(System.Reflection.RuntimeConstructorInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00008] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. (in `mscorlib')
at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00022] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) [0x000b7] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache) [0x0000c] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) [0x0002a] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00040] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Activator.CreateInstance (System.Type type) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at DBus.BusObject.GetObject (DBus.Connection conn, System.String bus_name, DBus.ObjectPath object_path, System.Type declType) [0x0000d] in :0
at DBus.Connection.GetObject (System.Type type, System.String bus_name, DBus.ObjectPath path) [0x00018] in :0
at DBus.Connection.GetObject[T] (System.String bus_name, DBus.ObjectPath path) [0x00001] in :0
at DBus.Bus..ctor (System.String address) [0x0000f] in :0
at DBus.Bus.Open (System.String address) [0x0002b] in :0
at DBus.Bus.get_System () [0x00035] in :0
System.Exception: Unable to open the system message bus. (in `dbus-sharp')
at DBus.Bus.get_System () [0x00052] in :0
at DBus.BusG.Init () [0x00010] in :0
at Banshee.ServiceStack.DBusConnection.Connect (System.String serviceName, System.Boolean init) [0x0000e] in <1db85bdd7591446c8843ac8d643695aa>:0
at Banshee.ServiceStack.DBusConnection.GrabDefaultName () [0x00018] in <1db85bdd7591446c8843ac8d643695aa>:0
[Info 10:57:54.717] Running Banshee 2.6.2: [Ubuntu Artful Aardvark (development branch) (linux-gnu, x86_64) @ 2017-08-12 03:07:49 UTC]
[Warn 10:57:56.219] Cannot connect to NetworkManager or Wicd - An available, working network connection will be assumed
[Info 10:57:56.459] Migrating album-art cache directory
[Warn 10:57:56.461] Caught an exception - Hyena.Data.Sqlite.SqliteException: Sqlite error 1: no such table: CoverArtDownloads (SQL: DELETE FROM CoverArtDownloads) (in `Hyena.Data.Sqlite')
at Hyena.Data.Sqlite.Connection.CheckError (System.Int32 errorCode, System.String sql) [0x00049] in <99fb80267bd147cebb744b2ec5c96997>:0
at Hyena.Data.Sqlite.Connection.Execute (System.String sql) [0x00022] in <99fb80267bd147cebb744b2ec5c96997>:0
at Hyena.Data.Sqlite.HyenaSqliteCommand.Execute (Hyena.Data.Sqlite.HyenaSqliteConnection hconnection, Hyena.Data.Sqlite.Connection connection) [0x000ad] in <99fb80267bd147cebb744b2ec5c96997>:0
[Info 10:57:56.464] Migrated 0 files in 0.004589s

(Banshee:7655): GLib-GObject-WARNING **: 10:57:56.809: attempting to add an interface (AtkComponent) to class (__gtksharp_48_Hyena_Gui_BaseWidgetAccessible) after class_init

(Banshee:7655): GLib-GObject-WARNING **: 10:57:56.812: attempting to add an interface (AtkSelection) to class (__gtksharp_49_Hyena_Data_Gui_Accessibility_ListViewAccessible+601+5b+5bBanshee_Collection_TrackInfo+2c+20Banshee_Core+2c+20Version+3d2_6_0_0+2c+20Culture+3dneutral+2c+20PublicKeyToken+3dnull+5d+5d) after class_init

(Banshee:7655): GLib-GObject-WARNING **: 10:57:56.815: attempting to add an interface (AtkTable) to class (__gtksharp_49_Hyena_Data_Gui_Accessibility_ListViewAccessible+601+5b+5bBanshee_Collection_TrackInfo+2c+20Banshee_Core+2c+20Version+3d2_6_0_0+2c+20Culture+3dneutral+2c+20PublicKeyToken+3dnull+5d+5d) after class_init
[Warn 10:57:56.821] Initialization of accessibility support for ListView widgets failed - System.ArgumentException: Invalid signal name: model_changed (in `glib-sharp')
at GLib.Signal.Emit (GLib.Object instance, System.String detailed_signal, System.Object[] args) [0x00024] in <918680a31aa84cb89cfa7cab56ea29b8>:0
at Hyena.Data.Gui.Accessibility.ListViewAccessible`1[T].EmitModelChanged () [0x0000c] in <2339076111b44174acb3706ba9bf4e2b>:0
at Hyena.ThreadAssist.ProxyToMain (Hyena.InvokeHandler handler) [0x0001e] in :0
at Hyena.Data.Gui.Accessibility.ListViewAccessible`1[T].OnModelChanged (System.Object o, System.EventArgs a) [0x00001] in <2339076111b44174acb3706ba9bf4e2b>:0
at Hyena.Data.Gui.Accessibility.ListViewAccessible`1[T]..ctor (GLib.Object widget) [0x00098] in <2339076111b44174acb3706ba9bf4e2b>:0
at Hyena.Data.Gui.ListViewAccessibleFactory`1[T].Init () [0x00007] in <2339076111b44174acb3706ba9bf4e2b>:0

(Banshee:7655): GLib-GObject-WARNING **: 10:57:56.873: attempting to add an interface (AtkSelection) to class (__gtksharp_54_Hyena_Data_Gui_Accessibility_ListViewAccessible+601+5b+5bBanshee_Collection_Database_QueryFilterInfo+601+5b+5bSystem_String+2c+20mscorlib+2c+20Version+3d4_0_0_0+2c+20Culture+3dneutral+2c+20PublicKeyToken+3db77a5c561934e089+5d+5d+2c+20Banshee_Services+2c+20Version+3d2_6_0_0+2c+20Culture+3dneutral+2c+20PublicKeyToken+3dnull+5d+5d) after class_init

(Banshee:7655): GLib-GObject-WARNING **: 10:57:56.873: attempting to add an interface (AtkTable) to class (__gtksharp_54_Hyena_Data_Gui_Accessibility_ListViewAccessible+601+5b+5bBanshee_Collection_Database_QueryFilterInfo+601+5b+5bSystem_String+2c+20mscorlib+2c+20Version+3d4_0_0_0+2c+20Culture+3dneutral+2c+20PublicKeyToken+3db77a5c561934e089+5d+5d+2c+20Banshee_Services+2c+20Version+3d2_6_0_0+2c+20Culture+3dneutral+2c+20PublicKeyToken+3dnull+5d+5d) after class_init
[Warn 10:57:56.874] Initialization of accessibility support for ListView widgets failed - System.ArgumentException: Invalid signal name: model_changed (in `glib-sharp')
at GLib.Signal.Emit (GLib.Object instance, System.String detailed_signal, System.Object[] args) [0x00024] in <918680a31aa84cb89cfa7cab56ea29b8>:0
at Hyena.Data.Gui.Accessibility.ListViewAccessible`1[T].EmitModelChanged () [0x0000c] in <2339076111b44174acb3706ba9bf4e2b>:0
at Hyena.ThreadAssist.ProxyToMain (Hyena.InvokeHandler handler) [0x0001e] in :0
at Hyena.Data.Gui.Accessibility.ListViewAccessible`1[T].OnModelChanged (System.Object o, System.EventArgs a) [0x00001] in <2339076111b44174acb3706ba9bf4e2b>:0
at Hyena.Data.Gui.Accessibility.ListViewAccessible`1[T]..ctor (GLib.Object widget) [0x00098] in <2339076111b44174acb3706ba9bf4e2b>:0
at Hyena.Data.Gui.ListViewAccessibleFactory`1[T].Init () [0x00007] in <2339076111b44174acb3706ba9bf4e2b>:0

(Banshee:7655): GLib-GObject-WARNING **: 10:57:56.891: attempting to add an interface (AtkSelection) to class (__gtksharp_59_Hyena_Data_Gui_Accessibility_ListViewAccessible+601+5b+5bBanshee_Collection_ArtistInfo+2c+20Banshee_Core+2c+20Version+3d2_6_0_0+2c+20Culture+3dneutral+2c+20PublicKeyToken+3dnull+5d+5d) after class_init

(Banshee:7655): GLib-GObject-WARNING **: 10:57:56.891: attempting to add an interface (AtkTable) to class (__gtksharp_59_Hyena_Data_Gui_Accessibility_ListViewAccessible+601+5b+5bBanshee_Collection_ArtistInfo+2c+20Banshee_Core+2c+20Version+3d2_6_0_0+2c+20Culture+3dneutral+2c+20PublicKeyToken+3dnull+5d+5d) after class_init
[Warn 10:57:56.892] Initialization of accessibility support for ListView widgets failed - System.ArgumentException: Invalid signal name: model_changed (in `glib-sharp')
at GLib.Signal.Emit (GLib.Object instance, System.String detailed_signal, System.Object[] args) [0x00024] in <918680a31aa84cb89cfa7cab56ea29b8>:0
at Hyena.Data.Gui.Accessibility.ListViewAccessible`1[T].EmitModelChanged () [0x0000c] in <2339076111b44174acb3706ba9bf4e2b>:0
at Hyena.ThreadAssist.ProxyToMain (Hyena.InvokeHandler handler) [0x0001e] in :0
at Hyena.Data.Gui.Accessibility.ListViewAccessible`1[T].OnModelChanged (System.Object o, System.EventArgs a) [0x00001] in <2339076111b44174acb3706ba9bf4e2b>:0
at Hyena.Data.Gui.Accessibility.ListViewAccessible`1[T]..ctor (GLib.Object widget) [0x00098] in <2339076111b44174acb3706ba9bf4e2b>:0
at Hyena.Data.Gui.ListViewAccessibleFactory`1[T].Init () [0x00007] in <2339076111b44174acb3706ba9bf4e2b>:0

(Banshee:7655): GLib-GObject-WARNING **: 10:57:56.898: attempting to add an interface (AtkSelection) to class (__gtksharp_64_Hyena_Data_Gui_Accessibility_ListViewAccessible+601+5b+5bBanshee_Collection_YearInfo+2c+20Banshee_Core+2c+20Version+3d2_6_0_0+2c+20Culture+3dneutral+2c+20PublicKeyToken+3dnull+5d+5d) after class_init

(Banshee:7655): GLib-GObject-WARNING **: 10:57:56.898: attempting to add an interface (AtkTable) to class (__gtksharp_64_Hyena_Data_Gui_Accessibility_ListViewAccessible+601+5b+5bBanshee_Collection_YearInfo+2c+20Banshee_Core+2c+20Version+3d2_6_0_0+2c+20Culture+3dneutral+2c+20PublicKeyToken+3dnull+5d+5d) after class_init
[Warn 10:57:56.899] Initialization of accessibility support for ListView widgets failed - System.ArgumentException: Invalid signal name: model_changed (in `glib-sharp')
at GLib.Signal.Emit (GLib.Object instance, System.String detailed_signal, System.Object[] args) [0x00024] in <918680a31aa84cb89cfa7cab56ea29b8>:0
at Hyena.Data.Gui.Accessibility.ListViewAccessible`1[T].EmitModelChanged () [0x0000c] in <2339076111b44174acb3706ba9bf4e2b>:0
at Hyena.ThreadAssist.ProxyToMain (Hyena.InvokeHandler handler) [0x0001e] in :0
at Hyena.Data.Gui.Accessibility.ListViewAccessible`1[T].OnModelChanged (System.Object o, System.EventArgs a) [0x00001] in <2339076111b44174acb3706ba9bf4e2b>:0
at Hyena.Data.Gui.Accessibility.ListViewAccessible`1[T]..ctor (GLib.Object widget) [0x00098] in <2339076111b44174acb3706ba9bf4e2b>:0
at Hyena.Data.Gui.ListViewAccessibleFactory`1[T].Init () [0x00007] in <2339076111b44174acb3706ba9bf4e2b>:0

(Banshee:7655): GLib-GObject-WARNING **: 10:57:56.911: attempting to add an interface (AtkSelection) to class (__gtksharp_69_Hyena_Data_Gui_Accessibility_ListViewAccessible+601+5b+5bBanshee_Collection_AlbumInfo+2c+20Banshee_Core+2c+20Version+3d2_6_0_0+2c+20Culture+3dneutral+2c+20PublicKeyToken+3dnull+5d+5d) after class_init

(Banshee:7655): GLib-GObject-WARNING **: 10:57:56.912: attempting to add an interface (AtkTable) to class (__gtksharp_69_Hyena_Data_Gui_Accessibility_ListViewAccessible+601+5b+5bBanshee_Collection_AlbumInfo+2c+20Banshee_Core+2c+20Version+3d2_6_0_0+2c+20Culture+3dneutral+2c+20PublicKeyToken+3dnull+5d+5d) after class_init
[Warn 10:57:56.913] Initialization of accessibility support for ListView widgets failed - System.ArgumentException: Invalid signal name: model_changed (in `glib-sharp')
at GLib.Signal.Emit (GLib.Object instance, System.String detailed_signal, System.Object[] args) [0x00024] in <918680a31aa84cb89cfa7cab56ea29b8>:0
at Hyena.Data.Gui.Accessibility.ListViewAccessible`1[T].EmitModelChanged () [0x0000c] in <2339076111b44174acb3706ba9bf4e2b>:0
at Hyena.ThreadAssist.ProxyToMain (Hyena.InvokeHandler handler) [0x0001e] in :0
at Hyena.Data.Gui.Accessibility.ListViewAccessible`1[T].OnModelChanged (System.Object o, System.EventArgs a) [0x00001] in <2339076111b44174acb3706ba9bf4e2b>:0
at Hyena.Data.Gui.Accessibility.ListViewAccessible`1[T]..ctor (GLib.Object widget) [0x00098] in <2339076111b44174acb3706ba9bf4e2b>:0
at Hyena.Data.Gui.ListViewAccessibleFactory`1[T].Init () [0x00007] in <2339076111b44174acb3706ba9bf4e2b>:0
[Warn 10:57:57.182] Caught an exception - System.ApplicationException: No support GNOME Settings Daemon could be reached. (in `Banshee.MultimediaKeys')
at Banshee.MultimediaKeys.MultimediaKeysService.Banshee.ServiceStack.IExtensionService.Initialize () [0x000c5] in :0
at Banshee.ServiceStack.ServiceManager.StartExtension (Mono.Addins.TypeExtensionNode node) [0x0003b] in <1db85bdd7591446c8843ac8d643695aa>:0
[Warn 10:57:57.182] Extension `Banshee.MultimediaKeys.MultimediaKeysService' not started: No support GNOME Settings Daemon could be reached.
[Info 10:57:57.705] Updating web proxy from GConf
[Warn 10:57:57.716] Caught an exception - System.ApplicationException: No support GNOME Settings Daemon could be reached. (in `Banshee.MultimediaKeys')
at Banshee.MultimediaKeys.MultimediaKeysService.Banshee.ServiceStack.IExtensionService.Initialize () [0x000c5] in :0
at Banshee.ServiceStack.ServiceManager.StartExtension (Mono.Addins.TypeExtensionNode node) [0x0003b] in <1db85bdd7591446c8843ac8d643695aa>:0
[Warn 10:57:57.716] Extension `Banshee.MultimediaKeys.MultimediaKeysService' not started: No support GNOME Settings Daemon could be reached.
[Info 10:57:57.719] All services are started 1.6332
[Warn 10:57:58.275] Error migrating Internet Radio Stations - System.IO.DirectoryNotFoundException: Could not find a part of the path '/root/.config/banshee/plugins/stations/user'. (in `mscorlib')
at System.IO.Enumeration.FileSystemEnumerator`1[TResult].CreateDirectoryHandle (System.String path, System.Boolean ignoreNotFound) [0x00038] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.IO.Enumeration.FileSystemEnumerator`1[TResult]..ctor (System.String directory, System.IO.EnumerationOptions options) [0x0004e] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.IO.Enumeration.FileSystemEnumerable`1+DelegateEnumerator[TResult]..ctor (System.IO.Enumeration.FileSystemEnumerable`1[TResult] enumerable) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.IO.Enumeration.FileSystemEnumerable`1[TResult]..ctor (System.String directory, System.IO.Enumeration.FileSystemEnumerable`1+FindTransform[TResult] transform, System.IO.EnumerationOptions options) [0x0004b] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles (System.String directory, System.String expression, System.IO.EnumerationOptions options) [0x00014] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.IO.Directory.InternalEnumeratePaths (System.String path, System.String searchPattern, System.IO.SearchTarget searchTarget, System.IO.EnumerationOptions options) [0x00045] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.IO.Directory.GetFiles (System.String path, System.String searchPattern, System.IO.EnumerationOptions enumerationOptions) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.IO.Directory.GetFiles (System.String path, System.String searchPattern) [0x00007] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at Banshee.InternetRadio.XspfMigrator.Migrate () [0x00065] in <7ffbd45575bb4d0e878bdaba4a89e857>:0
[Info 10:57:58.456] nereid Client Started
[Info 10:57:58.650] GStreamer version 1.12.2.0, gapless: True, replaygain: False
[Warn 10:57:58.768] Caught an exception - System.ArgumentNullException: Value cannot be null.
Parameter name: s (in `mscorlib')
at System.Int32.Parse (System.String s, System.Globalization.NumberStyles style) [0x0000c] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at Banshee.Hardware.Gio.UsbDevice.GetVendorId (Banshee.Hardware.IUsbDevice device) [0x00029] in <4e0a239db9734f5480a09ca06cd96874>:0
at Banshee.Hardware.Gio.UsbDevice.get_VendorId () [0x00001] in <4e0a239db9734f5480a09ca06cd96874>:0
at Banshee.Dap.MassStorage.DeviceMapper.Map (Banshee.Dap.MassStorage.MassStorageSource source) [0x0002b] in <131b608ea19f4b698b6330eea786b0ae>:0
at Banshee.Dap.MassStorage.MassStorageSource.DeviceInitialize (Banshee.Hardware.IDevice device) [0x0004f] in <131b608ea19f4b698b6330eea786b0ae>:0
at Banshee.Dap.DapService.FindDeviceSource (Banshee.Hardware.IDevice device) [0x00029] in <759fbd729901423dafededa2681193c1>:0
[Warn 10:57:58.777] Caught an exception - System.ArgumentNullException: Value cannot be null.
Parameter name: s (in `mscorlib')
at System.Int32.Parse (System.String s, System.Globalization.NumberStyles style) [0x0000c] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at Banshee.Hardware.Gio.UsbDevice.GetVendorId (Banshee.Hardware.IUsbDevice device) [0x00029] in <4e0a239db9734f5480a09ca06cd96874>:0
at Banshee.Hardware.Gio.UsbDevice.get_VendorId () [0x00001] in <4e0a239db9734f5480a09ca06cd96874>:0
at Banshee.Dap.MassStorage.DeviceMapper.Map (Banshee.Dap.MassStorage.MassStorageSource source) [0x0002b] in <131b608ea19f4b698b6330eea786b0ae>:0
at Banshee.Dap.MassStorage.MassStorageSource.DeviceInitialize (Banshee.Hardware.IDevice device) [0x0004f] in <131b608ea19f4b698b6330eea786b0ae>:0
at Banshee.Dap.DapService.FindDeviceSource (Banshee.Hardware.IDevice device) [0x00029] in <759fbd729901423dafededa2681193c1>:0

Unhandled Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MethodAccessException: Method `NDesk.DBus.BusObject..ctor()' is inaccessible from method `IBusProxy..ctor()'
at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_throw_method_access(intptr,intptr)
at IBusProxy..ctor () [0x00000] in <65aac3a678a847e69fd710ce33cda07f>:0
at (wrapper managed-to-native) System.Reflection.RuntimeConstructorInfo.InternalInvoke(System.Reflection.RuntimeConstructorInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00008] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
--- End of inner exception stack trace ---
at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00022] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) [0x000b7] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache) [0x0000c] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) [0x0002a] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00040] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Activator.CreateInstance (System.Type type) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at NDesk.DBus.BusObject.GetObject (NDesk.DBus.Connection conn, System.String bus_name, NDesk.DBus.ObjectPath object_path, System.Type declType) [0x00008] in <6f993bb1a1414adf8517b25c86b39e83>:0
at NDesk.DBus.Connection.GetObject (System.Type type, System.String bus_name, NDesk.DBus.ObjectPath path) [0x0000d] in <6f993bb1a1414adf8517b25c86b39e83>:0
at NDesk.DBus.Connection.GetObject[T] (System.String bus_name, NDesk.DBus.ObjectPath path) [0x00001] in <6f993bb1a1414adf8517b25c86b39e83>:0
at NDesk.DBus.Bus..ctor (System.String address) [0x0000f] in <6f993bb1a1414adf8517b25c86b39e83>:0
at NDesk.DBus.Bus.Open (System.String address) [0x00033] in <6f993bb1a1414adf8517b25c86b39e83>:0
at Mono.Zeroconf.Providers.AvahiDBus.DBusManager.ConnectToSystemBus () [0x0001f] in <6f993bb1a1414adf8517b25c86b39e83>:0
at Mono.Zeroconf.Providers.AvahiDBus.DBusManager.IterateThread (System.Object o) [0x00012] in <6f993bb1a1414adf8517b25c86b39e83>:0
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x0000e] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x0002a] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00096] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MethodAccessException: Method `NDesk.DBus.BusObject..ctor()' is inaccessible from method `IBusProxy..ctor()'
at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_throw_method_access(intptr,intptr)
at IBusProxy..ctor () [0x00000] in <65aac3a678a847e69fd710ce33cda07f>:0
at (wrapper managed-to-native) System.Reflection.RuntimeConstructorInfo.InternalInvoke(System.Reflection.RuntimeConstructorInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00008] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
--- End of inner exception stack trace ---
at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00022] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) [0x000b7] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache) [0x0000c] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) [0x0002a] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00040] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Activator.CreateInstance (System.Type type) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at NDesk.DBus.BusObject.GetObject (NDesk.DBus.Connection conn, System.String bus_name, NDesk.DBus.ObjectPath object_path, System.Type declType) [0x00008] in <6f993bb1a1414adf8517b25c86b39e83>:0
at NDesk.DBus.Connection.GetObject (System.Type type, System.String bus_name, NDesk.DBus.ObjectPath path) [0x0000d] in <6f993bb1a1414adf8517b25c86b39e83>:0
at NDesk.DBus.Connection.GetObject[T] (System.String bus_name, NDesk.DBus.ObjectPath path) [0x00001] in <6f993bb1a1414adf8517b25c86b39e83>:0
at NDesk.DBus.Bus..ctor (System.String address) [0x0000f] in <6f993bb1a1414adf8517b25c86b39e83>:0
at NDesk.DBus.Bus.Open (System.String address) [0x00033] in <6f993bb1a1414adf8517b25c86b39e83>:0
at Mono.Zeroconf.Providers.AvahiDBus.DBusManager.ConnectToSystemBus () [0x0001f] in <6f993bb1a1414adf8517b25c86b39e83>:0
at Mono.Zeroconf.Providers.AvahiDBus.DBusManager.IterateThread (System.Object o) [0x00012] in <6f993bb1a1414adf8517b25c86b39e83>:0
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x0000e] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x0002a] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00096] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
[email protected]:~$
does any one know what causes this to happen or why this occurred?
submitted by tirstan666 to linuxquestions [link] [comments]


2020.10.14 04:45 Own_Way_1339 [QML] Infinite Scroll with ListView/Custom Model/etc.?

[QML] Infinite Scroll with ListView/Custom Model/etc.?
[Solved] unstable behavior w.r.t positioning was due to my error - I was storing index of an item I wanted to position the view at in a custom property. View's current item was left alone, was being updated automatically, and the view was positioning itself at it. The solution was to use current item functionality instead of my own property. After all, the current item was introduced for the exact purpose I added my own logic for.

Hi guys!
A few weeks ago I posted here asking whether I should use Qt & Python for a project of mine, was encouraged to try it and been using it since. I am so far very happy with the choice, I really like QML and PySide2.
However, I've been struggling to build the functionality I want. I want to build a ListView, that can scroll through data requested from the database in batches. I subclassed QAbstractListModel and wrote a QML Item with a ListView in it. Whenever the ListView reaches a certain Item index on the right or left, the model will shift the buffer. I also coded a zoom in/out functionality, which extends the model's buffer in both directions to fill the view. I am using a Declarative State Machine to implement signals to pull data/shift the buffer.
Unfortunately, there are some issues with it. First of all, it is very unstable in its behavior, i.e. there are so many edge cases, where the wrong operation on the buffer is called, or it pulls less elements than needed or it locks. The biggest problem so far is with positioning the view, i.e. when data is loaded into the model, the view jumps to the beginning. I solved it by calculating the last index visible (in the center of the view or at the end, depending on the operation) and then positioning the view at that index. However, the positioning operation acts weird, I would expect ListView.Center to always position the view exactly in the center, but it "kind of" positions it close to the center, but not really. I solved it by using ListView.SnapPosition and setting the highlightBeginning property, but am not sure if this won't interfere with selection/current item which I am not using yet, but will. Also, it seems that the intermediate position of the view (after the model is updated and before I position it) is visible for a split second giving a very amateurish feel to the program.
I've been working on this for a few weeks now and I am slowly coming to the conclusion I can't get it to work with this approach. I am looking for alternatives. Can you please suggest best practices for this?
Here's what I need:
  • Horizontal list, scrollable left/right with zoom in/out, where zooming pulls more elements
  • Data model based on a ring buffedeque, i.e. can prepend/append data as needed
  • Smooth scrolling, stable positioning of the view, remembering last visible item/items when model is updated
I am considering these solutions:
  • Writing my own view (I hope to avoid this as it probably involves dealing with way more details than I am expecting at this point)
  • Composing ListView inside another element, which would handle positioning/scrolling (ScrollView? Flickable?) - not sure how that would work w.r.t keeping track of what is visible and requesting new data
  • Customizing ListView's positioning code / coming up with a workaround based on already exposed properties/methods
If you've done something like this in the past, please let me know.
Here's a gif of a mockup that I built with fake model data (integers). It starts with just a few items in the model and then pulls more but at some point you can see it stops pulling more and empty space is visible.

(the small number at the top of each element is the index, you can see as I zoom out that it changes, indicating the model has been populated with more elements)
https://i.redd.it/rsflnb2j4zs51.gif
submitted by Own_Way_1339 to QtFramework [link] [comments]


2020.09.23 02:59 rozy18 NCT 2020: Resonance Pt. 1 Pre-Order Guide

NCT will be coming back as NCT 2020 with the album Resonance Pt. 1 on 1012 (KST), the physical album will be released from 1015-16 (depends on region and website)
Album Details
Korean Version Details International Version Details
Polaroid Event
If you purchase from certain retailers you might get a chance to win member polaroids. The members are split into groups of 4-5 and are only available to win by buying from the retailer their group is assigned to. Link to Official Lysn Update
Retailers + Group
SMTOWN&STORE
Yes24
Synnara
Aladin
Interpark
HotTracks
Where to Buy
*All prices listed will be in USD and will be without shipping costs and (in some cases) tax ~ will indicate an estimated price due to conversions
Please refer to this kpop post that gives a description of most of these sites, here.
International Version
SM Global Shop
Target
Rough Trade
Amazon Music (Official)
bull moose ; Link for Past Version currently redirects to Future Version
Silver Platters
Zia Records
Walmart
Korean Version
SMTOWN&STORE (Ships to a few locations, check here for more info) ; Polaroid event group: Taeil, Jungwoo, Lucas, Sungchan
Ktown4u
YesAsia
Yes24 Polaroid event group: Taeyong, Renjun, Johnny, YangYang
Synnara Polaroid event group: Yuta, Ten, Haechan, Jaemin
WithDrama
Aladin Polaroid event group: Doyoung, Jeno, Kun, Shotaro
Interpark Polaroid event group: Mark, Jisung, Xiaojun, Chenle
HotTracks Polaroid event group: Jaehyun, Winwin, Hendery
Sound Wave
Cokodive
Kpopmart
Kpoptown
United States
Choice Music LA
Music Plaza
Saranghello
SubK Shop
Other Options
Use these sites at your own discretion, NCT does not endorse any sellers on any of these platforms.
Please note that all of the listed sites - other than the ones listed under other - reflect on Hanteo and/or Gaon Charts. Happy buying NCity πŸ’š πŸ’š πŸ’š!
submitted by rozy18 to NCT [link] [comments]


2020.09.09 19:03 Davatorium 1.6.0: The Masked Launcher

1.6.0: The Masked Launcher
More then 2 years after the 1.5.0 release and a year after 1.5.4, we present rofi 1.6.0. This release is again focusses bug-fixing and improving the experience for themers and script developers. The script mode has been extended with many small requested tweaks to get it more on par with dmenu mode. For themers the listview has been made more flexible, allowing more fancy themes, for examples mimicking Gnomes application launcher or albert.
Big thanks to SardemFF7 and all the other contributors, without their support and contributions this release would not have been possible.

Script mode

Rofi now communicates some information back to the script using environment variables. The most important one, is ROFI_RETV, this is equal to the return value in dmenu mode. It can have the following values:
  • 0: Initial call of script.
  • 1: Selected an entry.
  • 2: Selected a custom entry.
  • 10-28: Custom keybinding 1-19
To fully read up on all features of script mode, there is now a rofi-script(5) manpage.
Some of the new features are:
  • Search invisible text
  • Pass extra information back on selection
  • Support for a custom delimiter
  • Support for dmenus no-custom option
  • Detect if launched from rofi
To test some of the features:
#!/usbin/env bash if [ -z "${ROFI_OUTSIDE}" ] then echo "run this script in rofi". exit fi echo -en "\x00no-custom\x1ftrue\n" echo -en "${ROFI_RETV}\x00icon\x1ffirefox\x1finfo\x1ftest\n" if [ -n "${ROFI_INFO}" ] then echo "my info: ${ROFI_INFO} " fi 

Theme

There have been a set of tweaks to the theme format, making it more flexible and hopefully more themer-friendly.

Listview flexibility

This is one of the biggest change, instead of the listview having a hacked textbox as elements. It now re-uses existing widgets like box, icon and textbox. This way you can re-structure how it looks. For example put the icon above the text.

https://preview.redd.it/9wrvd8dzl5m51.png?width=1080&format=png&auto=webp&s=6f8f0d675ee0c2ed52ebd117080f5df8171798b9
With theme:
element { orientation: vertical; } 
This will make the box element put element-icon and element-text in a vertical list.
or change the ordering to show icon on the right:
element { children: [element-text, element-icon]; } 

https://preview.redd.it/ecxqxpx0m5m51.png?width=1280&format=png&auto=webp&s=37e254bfc28417678f18ef20a38b7415109c997b


https://preview.redd.it/thtr78b4m5m51.png?width=256&format=png&auto=webp&s=9afc5a43d12262f1b7666f3dd0b19048b16d16d1
This causes a breaking change for themes, to modify the highlighting, this should be set to element-text. Or inherited. element-text { highlight: inherit; }.
If you override the build in theme, you might want to set icon size:
element-icon { size: 1.2em ; } 

Calculation support in theme format.

Rofi adds CSS like calculations in the CSS format for distances. You can now set the width of the window to the screen width minus a 10 pixels.
window { width: calc(100% - 10px); } 
It supports: -, +, /, * and % operators and they should be surrounded by whitespace.

Initial media support

This is a very initial implementation of CSS like @media support. This allows you to modify the theme based on screen size or ratio.
We currently support: minimum width, minimum height, maximum width, maximum height, monitor id, minimum acpect ratio or maximum acpect ratio.
For example, go to fullscreen mode on screens smaller then full HD:
@media (max-width: 1920 ) { window { fullscreen: true; } } 

List of Changes

  • Add themes/ directory in the users rofi config directory to the theme search path. (#1001)
  • Split listview element into box widget holding icon and textbox. Supporting more dynamic themes. (#949)
  • Fix default theme.
  • Add -upgrade-config option.
  • Add ROFI_PLUGIN_PATH variable.
  • Add check for running rofi inside a Script mode.
  • Remove gnome-terminal from rofi-sensible-terminal (#1074)
  • Set window title based on mode name. (#969)
  • Subpixel rendering workaround. (#303)
  • Support character type in configuration {} block . (#1131)
  • Use XDG_CONFIG_DIRS (#1133)
  • [Box] Bug fix update propagation.
  • [Build] Fix meson build with meson 0.55.
  • [DMenu] Add -keep-right flag. (#1089)
  • [DMenu] Don't match markup when filtering. (#579,#1128)
  • [DRUN] Support Type=Link (#1166)
  • [DRun] Add % to escape variable.
  • [DRun] Add an optional cache for desktop files. (#1040)
  • [DRun] Add keywords as default match item. (#1061)
  • [DRun] Don't run custom commands.
  • [DRun] Match keywords field.
  • [DRun] Only show selected categories. (#817)
  • [DmenuScript] Add non-selectable entries. (#1024)
  • [Doc] Update documentation.
  • [IconFetcher] Add jpeg support.
  • [Icon] Set default size to 1.2 CH.
  • [Icon] support distance for size.
  • [Listview] Add widget to show keybinding index. (#1050)
  • [Listview] Fix distribution of remaining space.
  • [Listview] Fix left-to-right scrolling. (#1028)
  • [Listview] Fix updating elements. (#1032)
  • [Matching] Make Fuzzy matching non greedy.
  • [Script] Add delimiter option. (#1041)
  • [Script] Add environment variable indicating state.
  • [Script] Add extra matchign field (meta). (#1052)
  • [Script] Add info option, hidden field that gets passed to script via ROFI_INFO environment.
  • [Script] Add no-custom option.
  • [Textbox] Add cursor blinking option.
  • [Textbox] Add placeholder. (#1020)
  • [Theme] Add calc() support. (#1105)
  • [Theme] Add alpha channel to highlight color. (#1033)
  • [Theme] Add sidebar as mode-switcher alias.
  • [Theme] Add some initial @media support. (#893)
  • [Theme] Support buttons in the UI.
  • [View] Add two widgets. One showing number of rows, other number of filtered rows. (#1026)
  • [Window] Add window thumbnail option.
  • [Window] Remove arbitrary # window limit. (#1047)
  • [Window] check buffer overflow.
submitted by Davatorium to qtools [link] [comments]


2020.08.19 15:08 C_Roma94 Static ListView not working with CellFactory in JavaFX

Hi everyone, I have a ListView to display objects fetched from an ArrayList (from a MySQL database). The thing is I've used CellFactory to display the properties of the objects but I need to create an static method in my controller to refresh it whenever a new object is added to the list.
The weird thing is that the ListView works perfectly fine when the variable isn't set to static but it doesn't show anything when set to static.
Here is some code:
public class DashboardController implements Initializable { JDBConn jdb = new JDBConn(); Connection conn = jdb.getConn(jdb.getTableCreationURL()); private static String fullname; private static String username; private static Therapist therapist; private static ObservableList observablePatients = FXCollections.observableArrayList(); @FXML static ListView showPatients = new ListView<>(); @FXML Label greetingLabel; public DashboardController() {} public DashboardController(String therapistUsername) { username = therapistUsername; therapist = jdb.getTherapist(conn, username); fullname = jdb.getTherapist(conn, username).getFULLNAME(); } @Override public void initialize(URL url, ResourceBundle resourceBundle) { greetingLabel.setText("Welcome back " + fullname.toUpperCase() + "!"); showPatients.setCellFactory(param -> new ListCell<>() { @Override protected void updateItem(Patient patient, boolean empty) { super.updateItem(patient, empty); if (!empty) { setText(patient.getFullname().toUpperCase()); System.out.println("Patient:" + patient.getFullname()); } } }); observablePatients.addAll(jdb.getPatients(conn, therapist.getUID())); showPatients.setItems(observablePatients); } public void refreshList() { } public void openNewPatient() { try { FXMLLoader loader = new FXMLLoader(getClass().getResource("../views/NewPatient.fxml")); NewPatientController pc = new NewPatientController(therapist); loader.setController(pc); Parent root = loader.load(); Stage stage = new Stage(); stage.setScene(new Scene(root, 600, 400)); stage.setResizable(false); stage.show(); } catch (Exception e) { e.printStackTrace(); } } } 
submitted by C_Roma94 to learnjava [link] [comments]


2020.08.03 16:20 molesquirrel Contents of ListView not updating on call from notifyListeners()

I've got a tree that looks like this:
Model ->ChangeNotifierProvider -->Scaffold --->Column ---->Widget ---->Button ---->Expanded ----->ListView 
The code for the Expanded/Listview look like this: https://pastebin.com/udwRADZu
The testing calls a method in the model which adds on widget to a list, which is then read in by the code pasted to construct the Listview.
However, nothing appears. I can confirm that all the updating code is working because if I swap ListView out for Column, each "list" item appears with the button press. However, I lose the scrolling so it overflows after a few presses.
I'm wondering if it is somehow keeping the ListView at height: 0. Removing the Expanded around ListView gives off this error:
The following assertion was thrown during performResize(): Vertical viewport was given unbounded height.
I'm rather new to Flutter, and I think ListView is what I should be using, but all I really need is for the vertical set of widgets to scroll when it runs out of the remaining space on the screen.
Thanks in advance!
submitted by molesquirrel to flutterhelp [link] [comments]


2020.07.22 00:53 palmsnipe Update listview items with multiple async data

Hello,
I need to update the list items from various asynchronous data, but I don't know what would be the best way to do it.
For now, I am feeding the listview builder with a list of days object, then I add the result of the async data to each day of my list, and when it's done, I am updating the state of the updated list of days at the end of each async result.
It's working, but I'm sure there is a much better solution than that:
setState(() { days = days; });
The important thing here is the number of list items don't change, it's the content of each days.
Any suggestions would be appreciated πŸ˜„.
submitted by palmsnipe to flutterhelp [link] [comments]


2020.06.21 07:01 santoshakil Create a FeatureBuilder from Database

I have saved my phone's call list to a database and now I want to create a ListView from this database. I have already written this code. It is showing me this error- "Class 'QueryRow' has no instance getter 'number'". it is not working. what is wrong with my code?
database_helper.dart
import 'dart:io'; import 'package:path/path.dart'; import 'package:sqflite/sqflite.dart'; import 'package:path_providepath_provider.dart'; class DatabaseHelper { static final _databaseName = "MyDatabase.db"; static final _databaseVersion = 1; static final table = 'my_table'; static final columnId = '_id'; static final columnName = 'name'; static final columnNumber = 'number'; static final columnType = 'type'; static final columnDate = 'date'; static final columnDuration = 'duration'; // make this a singleton class DatabaseHelper._privateConstructor(); static final DatabaseHelper instance = DatabaseHelper._privateConstructor(); // only have a single app-wide reference to the database static Database _database; Future get database async { if (_database != null) return _database; // lazily instantiate the db the first time it is accessed _database = await _initDatabase(); return _database; } // this opens the database (and creates it if it doesn't exist) _initDatabase() async { Directory documentsDirectory = await getApplicationDocumentsDirectory(); String path = join(documentsDirectory.path, _databaseName); return await openDatabase(path, version: _databaseVersion, onCreate: _onCreate); } // SQL code to create the database table Future _onCreate(Database db, int version) async { await db.execute(''' CREATE TABLE $table ( $columnId INTEGER PRIMARY KEY, $columnName TEXT, $columnNumber INTEGER, $columnType TEXT, $columnDate DATETIME, $columnDuration INTEGER ) '''); } // Helper methods // Inserts a row in the database where each key in the Map is a column name // and the value is the column value. The return value is the id of the // inserted row. Future insert(Map row) async { Database db = await instance.database; return await db.insert(table, row); } // All of the rows are returned as a list of maps, where each map is // a key-value list of columns. Future>> queryAllRows() async { Database db = await instance.database; return await db.query(table); } // All of the methods (insert, query, update, delete) can also be done using // raw SQL commands. This method uses a raw query to give the row count. Future queryRowCount() async { Database db = await instance.database; return Sqflite.firstIntValue( await db.rawQuery('SELECT COUNT(*) FROM $table')); } // We are assuming here that the id column in the map is set. The other // column values will be used to update the row. Future update(Map row) async { Database db = await instance.database; int id = row[columnId]; return await db.update(table, row, where: '$columnId = ?', whereArgs: [id]); } // Deletes the row specified by the id. The number of affected rows is // returned. This should be 1 as long as the row exists. Future delete(int id) async { Database db = await instance.database; return await db.delete(table, where: '$columnId = ?', whereArgs: [id]); } }
myhome.dart
FutureBuilder( future: db.queryAllRows(), builder: (context, snapshot) { if (!snapshot.hasData) return Center(child: CircularProgressIndicator()); var entries = snapshot.data.toList(); return Scrollbar( child: ListView.builder( itemBuilder: (context, index) { var entry = entries[index]; var mono = TextStyle(fontFamily: 'monospace'); return Column( children: [ Divider(), Text('NUMBER : ${entry.number}', style: mono), Text('NAME : ${entry.name}', style: mono), Text('TYPE : ${entry.callType}', style: mono), Text( 'DATE : ${DateTime.fromMillisecondsSinceEpoch(entry.timestamp)}', style: mono), Text('DURATION : ${entry.duration}', style: mono), ], crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, ); }, itemCount: entries.length, ), ); })
submitted by santoshakil to flutterhelp [link] [comments]


2020.06.12 11:50 developerSambkk Fragments in Android Progress Bar Visibility issue

This question has been answered in some stackoverflow post but my case is different. Most of the questions regarding this topic were about handling the progress bar of each fragment in java along with the xml of that fragment.
In my case. I am using ListView (which means I am using only one xml layout for my three fragments) and the visibility of the progressbar is not working. Can someone please help. I am posting the code of one of the 3 fragments ( code in other two frag looks the same)
  1. Please tell me what I should add and should I add to each fragment, what am I missing. Can someone help.
  2. Earlier I had tried adding code and set visibility it did not work thats why I have deleted it, so someone can tell me where exactly and what exact needs to be inserted. Thank you so much.

public class Uspolitics extends Fragment implements LoaderManager.LoaderCallbacks> {
private static final String LOG_TAG = Uspolitics.class.getSimpleName(); private static final String NEWS_API = "https://newsapi.org/v2/top-headlines?country=us&apiKey=6a6f7c77766442acb20c86157a152131"; private NewsAdapter mAdapter; private static final int EARTHQUAKE_LOADER_ID = 1; private TextView mEmptyStateTextView; public Uspolitics() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View rootView = inflater.inflate(R.layout.activity_all, container, false); mEmptyStateTextView = rootView.findViewById(R.id.empty_view); ListView listView = (ListView) rootView.findViewById(R.id.list); listView.setEmptyView(mEmptyStateTextView); mAdapter = new NewsAdapter(getActivity(), new ArrayList()); listView.setAdapter(mAdapter); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { News currentNews = mAdapter.getItem(position); Uri uriweb = Uri.parse(currentNews.getURL()); Intent webIntent = new Intent(Intent.ACTION_VIEW, uriweb); startActivity(webIntent); } }); ConnectivityManager connMgr = (ConnectivityManager) getActivity().getSystemService(Context.CONNECTIVITY_SERVICE); // Get details on the currently active default data network NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isConnected()) { LoaderManager loaderManager = getActivity().getSupportLoaderManager(); loaderManager.initLoader(EARTHQUAKE_LOADER_ID, null, this); } else { // Update empty state with no connection error message if (networkInfo == null) { mEmptyStateTextView.setText("NO INTERNET CONNECTION"); } } return rootView; } @Override public Loader> onCreateLoader(int i, Bundle bundle) { return new PoliticsLoader(getContext(), NEWS_API); } @Override public void onLoadFinished( Loader> loader, List news) { mAdapter.clear(); if (news!=null && !news.isEmpty()) { mAdapter.addAll(news); } } @Override public void onLoaderReset( Loader> loader) { mAdapter.clear(); } 
submitted by developerSambkk to learnprogramming [link] [comments]


2020.06.09 18:32 forum_user1 [Django] help using Form with list view

Using Django, I am trying to create a view displaying a list of objects. each list will contain some details about participants in a study (name, age, etc.). That part is easy enough however for one of the fields, for each participant in this list, a drop-down menu that will display the current state of the field and then allow the viewer to select a different value for this field, and then either automatically or through hitting a 'submit' button, update that field value.
Currently I am using a ListView to enable this view but I cannot make this work. I am currently trying this. :
class ReviewStateForm(forms.ModelForm): class Meta: model = Participant fields = ['review_state'] widgets = {'review_state': forms.Select(Participant.REVIEW_STATE_CHOICES)} def get_context_data(self, **kwargs): context = super(ParticipantListView, self).get_context_data(**kwargs) for p in context['object_list']: p.form = ReviewStateForm(instance=p) return context 
This gives me an error when I go to the associated url due to an exception in processing 'item.form' in the template. How can I address this?
submitted by forum_user1 to learnpython [link] [comments]


2020.05.22 23:31 drew8311 Beginner question about state

This seems to be a common thing for most beginners to have trouble with, there are a lot of variations of it so I am having trouble finding an answer that applies.
To start, I just have a simple screen with an AppBar, ListView and FloatingActionButton. I can't figure out how to have the FAB button update the list, without updating the entire screen via build(). It works fine but as things get more complex it would be useful to know how to minimize screen redraws.
Currently I have the list item variable in the main page widget, if I moved it to the ListView (custom list view widget or something) how can I tell that sub-widget "do an update" or "here is some new items" after clicking on the FAB?
For now I'm just using setState, if there are any limitations that's fine, I just want to know the best possible way of doing this with that method.
submitted by drew8311 to flutterhelp [link] [comments]


2020.05.08 21:17 Shuvojit007 18+ Flutter tips & tricks

If you want to produce (or reproduce) a production ready flutter app, we have 18+ tips and tricks for you. πŸ‘‡
1. Create Intro Screen in Just 10 Minutes
If you need an awesome intro screen but don’t have an awesome idea, Introduction Screen will save you. You'll be amazed.
2. Use Flutter Snippet
If you need productivity, Flutter Code Snippet will make you a superstar. You can easily create commonly used Flutter classes and methods. For example, you can create StreamBuilder Widget or SingleChildScrollView Widget by typing the shortcut streamBldr and singleChildSV respectively. You can use the flutter snippet in Android Studio or VSCode.
3. Create Mind-blowing Icons Using Font Awesome
You don’t have to be the designer to include mind-blowing icons in your app. Just use the font awesome for flutter and you will create magic in minutes.
4. Enjoy Dependency Magic Using get.it
A good practice is to put your app’s logic in classes separated from your Widgets and then inject it wherever needed. For example, one of my app, we need to access the Prefmanger class from multiple places to read and update the user state stored in the localstorage. We used get_it so that this class can be injectable as a dependency.
GetIt locator = GetIt.instance; void setupLocator() async { var instance = await PrefManager.getInstance(); locator.registerSingleton(instance,signalsReady: true); FirebaseDatabase database = FirebaseDatabase.instance; database.setPersistenceEnabled(true); Locator.registerSingleton(database.reference()); } //Now you can easily access our prefmanger class like below: locator().color = 12 ; 
If you want to see the code block properly, please check out the full article on our Medium blog.
5. Reuse Data Using the Singleton Pattern
Singleton means the class has only one instance and also provides a global point of access to it. It is also an easy one to get wrong if you are not using it carefully. We need to access our ThemeColorclass (dark mode or light mode) again and again to set our theme color in widget . πŸ‘‡
class ThemeColor{ // Singleton instance static final ThemeColor _repo = new ThemeColor._(); // Singleton accessor static ThemeColor get instance => _repo; // A private constructor. Allows us to create instances of Repository // only from within the Repository class itself. ThemeColor._(); Color cardColor(){ return locator().darkTheme? Color(0xff221F47):Colors.white;` } Color containerColor(){ return locator().darkTheme? Color(0xff161430):Colors.white;` } } ThemeColor.instance.cardColor() 
6. Avoid Widget Rebuild by Using const Constructor
If you want to prevent unwanted widget rebuilds always use const constructor. In the code below, the instance of BoxDecoration will remain the same even if the setState is called.
Container( width: 250, height: 250, decoration: const BoxDecoration( borderRadius: BorderRadius.only( bottomLeft: const Radius.circular(30.0), bottomRight: const Radius.circular(30.0))), child:..... ); 
7. Code Format Using dartfmt
Always add Trailing Commas (,). It will help you to format your code by using dartfmt. After that you will be able to get rid of the headache of formatting by using dartfmt.
8. Write Cleaner Code Using the Spread Operator
The Dart 2.3 introduced a few useful features and one of them I like is the Spread operator. This is very useful when you need conditional UI widgets. Specially when you have nested conditional UI Widget.
Stack( alignment: Alignment.center, children: [ if (_visible) ...[ spaceAnim(), //Nested if-else if (_visible) ...[ spaceAnim(), ]else ...[ galaxyAnim(), ], ]else ...[ galaxyAnim(), ], ], ), 
9. Custom Extension to Reduce Duplicate
Don’t make your code wet 😎. Keep it DRY. Here the word DRY means β€” Don’t Repeat Yourself. Hence, you should not repeat the same functionality in multiple places.
In my app, I need to convert HTML tags to be displayed on the UI because mighty Flutter is still reluctant to support HTML tags. And, we needed to repeat the code below in several places. That's why I created an extension method that can be used anywhere needed.
String get renderHtml { return this .replaceAll(β€œ ”, β€œ β€œ) .replaceAll(β€œ β€, β€œ β€œ) .replaceAll(β€œ ”, β€œ β€œ) .replaceAll(β€œ
”, β€œ\n”) .replaceAll(β€œβ€, β€œ\n”) .replaceAll(β€œ<”, β€œ<”); }
10. Less Code Using Double Dot, The Cascade Operator
Dart has a single dot (.) operator. And a few minutes ago, we talked about three dots (…) . So, one and three dots are covered. Do you feel like anything missing in the middle? You got it correctly. We are talking about the middle person, the double dot (..) which is also known as the cascadeoperator.
You can use the cascade operator to save typing time when multiple method calls on the same object are being made.
11. Knock Out the iPhone Notch with Safe Area
It’s a pain that some of your content is getting cut by the iPhone 10+ notch. The same could happen in Android.
Consider using the SafeArea widget can keep the pesky notification bars and phone notches from encroaching on your app’s UI. It uses a MediaQuery to check the dimensions of the screen and pads its child Widget to match, making sure your app is safe on both iOS and Android!
12. Use Key for Efficient ListView Rendering
To make rendering efficient, use keys on each item. This will make your list view rendering very efficient.
13. Efficient Debugging with Performance Overlay
Performance Overlay shows how long each frame took to build and at the top there is the GPU time (Raster Thread) and at the bottom is Ui Time (Ui Thread). If you see a red bar in the UI graph, the Dart code is too expensive. If a red vertical bar appears in the GPU graph, the scene is too expensive to render.
14. Avoid Profiling in the Debug Mode
You will not get accurate performance indication if you profile in the debug mode. Debug mode is by default much slower than production mode. Simulato Emulator is not indicative of how your app actually works in Real Device.
15. Use Tracing to Measure Execution Time
You might not know how much time you took to finish your job in the bathroom. However, you can use the Tracing to see how much time is taken to execute.
void DoSomeThing(){ Timeline.startSync(β€œDoSomeThing”); // Write your code Timeline.finishSync(); } 
16. Declare Multiple Variables with Shortcut Usually, I declare my variable most of the time this way
int mark = 10; int total = 10; int amount = 10; 
But if you are lazy like me than you can also do these things this way
int mark =10, total = 20, amount = 30; 
17. Smart Logging, Log Anything
Though we are used to log the string message, we can also pass other objects like List, Map, or Set. For more about log level, logPrinter, logOutput, checkout the logger doc.
18. Set Cross-Platform Icons Like a Pro
Are you messed up to set icons for both the Android and the iOS version of your app? Don’t worry, I will give you two steps to handle it using the Flutter Launcher Icon. First, setup your config file.
dev_dependencies: flutter_launcher_icons: "0.7.3" flutter_icons: android: "launcher_icon" ios: true image_path: "assets/icon/icon.png" Then run the package. flutter pub get flutter pub run flutter_launcher_icons:main 
18+. Get That Level Powered by Basic Utils
Do you need extra power in some crucial moments? Consider using basic_util. It contains a list of amazing methods to give you productivity at the right time. For more utils like SortUtils, ColorUtils, DateUtils, IterableUtils, CryptoUtils, HttpUtils in the basic utils.
Let me know the tips & tricks that you discovered while developing your flutter app.
submitted by Shuvojit007 to FlutterDev [link] [comments]


2020.04.19 05:46 Saad_Mufti Updating values of listView inside viewPager2 triggered by Switch view?

Hi, somewhat new to Android development here. I have implemented a ListViewwhich is contained inside of a ViewPager2 view. The ListView takes data from an offline database that is stored in the assets folder of my project, so after swiping between different positions of the ViewPager2. I also have a Switch, that, when toggled, will either show or hide some items in the list. I have 2 problems:
  1. When I scroll to a different page, sometimes the items take some time to update the values. I am using viewPager.registerOnPageChangeCallback()to update the values with listViewAdapter!!.notifyDataSetChanged().
  2. Upon clicking the switch, the listView on the current page is not updated. When I scroll to the next or previous one, it updates but I need it to update immediately on toggling the switch.
Here's all the relevant code:
viewPager.registerOnPageChangeCallback() in onCreate() in MainActivity:
viewPager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() { override fun onPageScrolled( position: Int, positionOffset: Float, positionOffsetPixels: Int ) { super.onPageScrolled(position, positionOffset, positionOffsetPixels) viewOffset = viewPager.currentItem - beginningPos todayIs() // adapter!!.updateValues() pageAdapter.listAdapterHelper.notifyDataSetChanged() listViewAdapter!!.notifyDataSetChanged() lastPos = position lastOffset = positionOffset } }) 
switch listener in onCreate() in MainActivity:
 switch.setOnCheckedChangeListener { buttonView, isChecked -> pageAdapter.notifyDataSetChanged() viewPager.adapter!!.notifyDataSetChanged() pageAdapter.notifyItemChanged(viewPager.currentItem) pageAdapter.listAdapterHelper.notifyDataSetChanged() listViewAdapter!!.notifyDataSetChanged() } 
As you can see, using notifyDataSetChanged() from both the listViewAdapter and the viewPagerAdapter doesn't work.
classes forviewPager2 and adapter for listview:
class ViewPagerFragment(var fragmentActivity: FragmentActivity) : Fragment() { // var expandableListView: ExpandableListView? = null // var adapter: ExpandableListHelper? = null var listView : ListView? = null var listViewAdapterHelper : ListAdapterHelper? = null var switch : Switch? = null override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View = inflater.inflate(R.layout.view_pager_layout, container, false) override fun onViewCreated(view: View, savedInstanceState: Bundle?) { listView = view.findViewById(R.id.list_view) listViewAdapterHelper = ListAdapterHelper(context!!, fragmentActivity) listView!!.adapter = listViewAdapterHelper } } val pages = 365 class ViewPagerAdapter( var fa: FragmentActivity, var listAdapterHelper: ListAdapterHelper, var viewPager2: ViewPager2, var switch: Switch ) : FragmentStateAdapter(fa) { override fun getItemCount(): Int = pages override fun createFragment(position: Int): Fragment { return ViewPagerFragment(fa) } } class ListAdapterHelper(var context: Context, var fr: FragmentActivity) : BaseAdapter() { var db = DatabaseUtility(context, mainTimes) var timeMap = db.getAllTimes(viewOffset) var switch: Switch = fr.findViewById(R.id.switch) override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { var convertView = convertView if (convertView == null) { val layoutInflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater convertView = layoutInflater.inflate(R.layout.times_list_view, null) } timeMap = db.getAllTimes(viewOffset) var timeMap = timeMap.toMutableMap() timeMap.remove("Date") val title = convertView!!.findViewById(R.id.title) val time = convertView.findViewById(R.id.time) title.text = allTimesList[position] time.text = timeMap[timeMap.keys.toList()[position]] if(switch.isChecked) { time.visibility = View.VISIBLE title.visibility = View.VISIBLE if(title.text == "condition") { title.setTextAppearance(R.style.small_time_style) title.setPadding(20, 3, 20, 35) time.setTextAppearance(R.style.small_timing) time.setPadding(20, 3, 20, 35) } else { title.setTextAppearance(R.style.title_Style) title.setPadding(20) time.setTextAppearance(R.style.Timing_Style) time.setPadding(20) } } else { if(title.text == "condition") { title.visibility = View.GONE time.visibility = View.GONE } else { time.visibility = View.VISIBLE title.visibility = View.VISIBLE } } return convertView } override fun getItem(position: Int): Any { return allTimesList[position] } override fun isEnabled(position: Int): Boolean { return false } override fun getItemId(position: Int): Long { return position.toLong() } override fun getCount(): Int { return allTimesList.size } } 
Any guidance would be appreciated. Is there any other way that I should be doing this?
submitted by Saad_Mufti to androiddev [link] [comments]


2020.04.17 17:42 srfr4life6 Crashing on Timeline Playback?

Update: I don't have it "solved" but I have a workaround if anyone else ever finds something like this happening to them.
For whatever reason, my Mixer video had mixed resolutions during the stream. I suspect this is because during my first bunch of livestreams I was just using my Xbox One, though not sure WHY it changes resolution. I noticed this while playing it in OBS as a multimedia file. About 100 seconds in it changes resolution. It was taking up the entire screen but then was only taking up a portion.
"Solution": Hit record and Add the file as a multimedia file in OBS and make sure to change the Transform option to "Fit to Screen". Let the file play through and then stop the recording. Add into Openshop and clean up the before and after on the timeline to take out the blank space.

-----------------------------------------------------------------------------------------------------------------------------


I'm new to Openshot. Problems happened on a new computer with a fresh install of OpenShot.
Problem - Keeps crashing while I play my timeline.
How to replicate - I add a single long (50+mins) Mp4 to a new project. Without making any changes to the clip I play the timeline. About 80-90 seconds into the playback, OpenShot crashes.
What have I done to solve this - After starting the process of reporting a bug, was instructed to download the daily build to see if this solved the problem. I installed and kept having the issue. I was than directed to the log files. My initial glance at the log files mentioned a permissions error(unsure if this was the cause of crash). I researched and found a thread that mentioned deleting the entire .openshot-qt folder. I did so and retried. Had the same issue but on inspecting the logs found no mention of permission errors this time. I'm now at a loss. The lib log file is empty, save for a starting of the session so won't include it here but will put in the other log file below.

Log file
app:INFO ------------------------------------------------
app:INFO Fri Apr 17 07:54:25 2020
app:INFO Starting new session
app:INFO ------------------------------------------------
app:INFO OpenShot (version 2.5.1-dev2)
app:INFO ------------------------------------------------
app:INFO openshot-qt version: 2.5.1-dev2
app:INFO libopenshot version: 0.2.5-dev2
app:INFO platform: Windows-10-10.0.18362
app:INFO processor: Intel64 Family 6 Model 158 Stepping 10, GenuineIntel
app:INFO machine: AMD64
app:INFO python version: 3.7.4
app:INFO qt5 version: 5.12.4
app:INFO pyqt5 version: 5.12.3
language:INFO Qt Detected Languages: ['en-US']
language:INFO LANG Environment Variable:
language:INFO LOCALE Environment Variable:
language:INFO OpenShot Preference Language: Default
project_data:INFO Setting default profile to HD 720p 30 fps
app:INFO Setting font to C:\Program Files\OpenShot Video Editor\images\fonts\Ubuntu-R.ttf
app:INFO Setting custom dark theme
logger_libopenshot:INFO Connecting to libopenshot with debug port: 5556
ui_util:INFO Initializing UI for MainWindow
files_listview:INFO currentChanged
files_listview:INFO updateSelection
files_model:INFO updating files model.
transition_model:INFO updating transitions model.
version:INFO Found current version: {"openshot_version": "2.5.1"}
effects_model:INFO updating effects model.
main_window:INFO foundCurrentVersion: Found the latest version: 2.5.1
properties_model:INFO updating clip properties model.
transition_model:INFO updating transitions model.
files_model:INFO updating files model.
main_window:INFO InitCacheSettings
main_window:INFO cache-mode: CacheMemory
main_window:INFO cache-limit-mb: 250
main_window:INFO Creating CacheMemory object with 262144000 byte limit
preview_thread:INFO QThread Start Method Invoked
preview_thread:INFO initPlayer
main_window:INFO Clear all thumbnails: C:\Users\josep\.openshot_qt\thumbnail
main_window:INFO Clear all animations: C:\Users\josep\.openshot_qt\blender
main_window:INFO Clear all titles: C:\Users\josep\.openshot_qt\title
main_window:INFO updateStatusChanged
main_window:INFO updateStatusChanged
app:INFO Process command-line arguments: ['C:\\Program Files\\OpenShot Video Editor\\openshot-qt.exe']
main_window:INFO recover_backup
project_data:INFO Setting default profile to HD 720p 30 fps
preview_thread:INFO refreshFrame
preview_thread:INFO self.player.Position(): 1
video_widget:INFO Load: Set video widget display aspect ratio to: 1.7777777910232544
video_widget:INFO Set video widget pixel aspect ratio to: 1.0
main_window:INFO updateStatusChanged
preview_thread:INFO onModeChanged
properties_model:INFO Update item:
properties_model:INFO updating clip properties model.
timeline:INFO Adjusting max size of preview image: PyQt5.QtCore.QSize(720, 405)
preview_thread:INFO refreshFrame
preview_thread:INFO self.player.Position(): 1
preview_thread:INFO refreshFrame
preview_thread:INFO self.player.Position(): 1
timeline_webview:INFO Qt Found!
timeline_webview:INFO $scope.Qt = true;
timeline_webview:INFO SetThumbAddress: http://127.0.0.1:59589/thumbnails/
timeline_webview:INFO SortItems
timeline_webview:INFO UpdateLayerIndex
timeline_webview:INFO UpdateLayerIndex
project_data:INFO _set key: ['files'] values: {'acodec': 'aac', 'audio_bit_rate': 129020, 'audio_stream_index': 1, 'audio_timebase': {'den': 44100, 'num': 1}, 'channel_layout': 3, 'channels': 2, 'display_ratio': {'den': 9, 'num': 16}, 'duration': 3130.074951171875, 'file_size': '1215207865', 'fps': {'den': 1001, 'num': 30000}, 'has_audio': True, 'has_single_image': False, 'has_video': True, 'height': 1080, 'interlaced_frame': False, 'metadata': {'compatible_brands': 'isomiso2avc1mp41', 'encoder': 'Lavf58.12.100', 'handler_name': 'SoundHandler', 'language': 'und', 'major_brand': 'isom', 'minor_version': '512'}, 'path': 'C:/Users/josep/Downloads/Season1MinecraftLivestream#1.mp4', 'pixel_format': 0, 'pixel_ratio': {'den': 1, 'num': 1}, 'sample_rate': 44100, 'top_field_first': True, 'type': 'FFmpegReader', 'vcodec': 'h264', 'video_bit_rate': 388233, 'video_length': '93808', 'video_stream_index': 0, 'video_timebase': {'den': 16000, 'num': 1}, 'width': 1920, 'media_type': 'video', 'id': 'EKMYWSMEDW'} add: True partial: False remove: False
timeline_webview:INFO SortItems
timeline_webview:INFO UpdateLayerIndex
files_model:INFO updating files model.
files_model:INFO updating files model.
main_window:INFO updateStatusChanged
files_model:INFO updating files model.
project_data:INFO _set key: ['import_path'] values: C:/Users/josep/Downloads add: False partial: False remove: False
main_window:INFO updateStatusChanged
main_window:INFO Imported media file C:/Users/josep/Downloads/Season1MinecraftLivestream#1.mp4
files_listview:INFO currentChanged
files_listview:INFO updateSelection
project_data:INFO _set key: ['clips'] values: {'alpha': {'Points': [{'co': {'X': 1.0, 'Y': 1.0}, 'interpolation': 2}]}, 'anchor': 0, 'channel_filter': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'channel_mapping': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'crop_height': {'Points': [{'co': {'X': 1.0, 'Y': 1.0}, 'interpolation': 2}]}, 'crop_width': {'Points': [{'co': {'X': 1.0, 'Y': 1.0}, 'interpolation': 2}]}, 'crop_x': {'Points': [{'co': {'X': 1.0, 'Y': 0.0}, 'interpolation': 2}]}, 'crop_y': {'Points': [{'co': {'X': 1.0, 'Y': 0.0}, 'interpolation': 2}]}, 'display': 0, 'duration': 3130.074951171875, 'effects': [], 'end': 3130.074951171875, 'gravity': 4, 'has_audio': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'has_video': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'id': 'YX42BV5ERL', 'layer': 5000000, 'location_x': {'Points': [{'co': {'X': 1.0, 'Y': 0.0}, 'interpolation': 2}]}, 'location_y': {'Points': [{'co': {'X': 1.0, 'Y': 0.0}, 'interpolation': 2}]}, 'mixing': 0, 'perspective_c1_x': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'perspective_c1_y': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'perspective_c2_x': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'perspective_c2_y': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'perspective_c3_x': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'perspective_c3_y': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'perspective_c4_x': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'perspective_c4_y': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'position': 4.6499999999999995, 'reader': {'acodec': 'aac', 'audio_bit_rate': 129020, 'audio_stream_index': 1, 'audio_timebase': {'den': 44100, 'num': 1}, 'channel_layout': 3, 'channels': 2, 'display_ratio': {'den': 9, 'num': 16}, 'duration': 3130.074951171875, 'file_size': '1215207865', 'fps': {'den': 1001, 'num': 30000}, 'has_audio': True, 'has_single_image': False, 'has_video': True, 'height': 1080, 'interlaced_frame': False, 'metadata': {'compatible_brands': 'isomiso2avc1mp41', 'encoder': 'Lavf58.12.100', 'handler_name': 'SoundHandler', 'language': 'und', 'major_brand': 'isom', 'minor_version': '512'}, 'path': 'C:/Users/josep/Downloads/Season1MinecraftLivestream#1.mp4', 'pixel_format': 0, 'pixel_ratio': {'den': 1, 'num': 1}, 'sample_rate': 44100, 'top_field_first': True, 'type': 'FFmpegReader', 'vcodec': 'h264', 'video_bit_rate': 388233, 'video_length': '93808', 'video_stream_index': 0, 'video_timebase': {'den': 16000, 'num': 1}, 'width': 1920}, 'rotation': {'Points': [{'co': {'X': 1.0, 'Y': 0.0}, 'interpolation': 2}]}, 'scale': 1, 'scale_x': {'Points': [{'co': {'X': 1.0, 'Y': 1.0}, 'interpolation': 2}]}, 'scale_y': {'Points': [{'co': {'X': 1.0, 'Y': 1.0}, 'interpolation': 2}]}, 'shear_x': {'Points': [{'co': {'X': 1.0, 'Y': 0.0}, 'interpolation': 2}]}, 'shear_y': {'Points': [{'co': {'X': 1.0, 'Y': 0.0}, 'interpolation': 2}]}, 'start': 0.0, 'time': {'Points': [{'co': {'X': 1.0, 'Y': 1.0}, 'interpolation': 2}]}, 'volume': {'Points': [{'co': {'X': 1.0, 'Y': 1.0}, 'interpolation': 2}]}, 'wave_color': {'alpha': {'Points': [{'co': {'X': 1.0, 'Y': 255.0}, 'handle_left': {'X': 0.5, 'Y': 1.0}, 'handle_right': {'X': 0.5, 'Y': 0.0}, 'handle_type': 0, 'interpolation': 0}]}, 'blue': {'Points': [{'co': {'X': 1.0, 'Y': 255.0}, 'handle_left': {'X': 0.5, 'Y': 1.0}, 'handle_right': {'X': 0.5, 'Y': 0.0}, 'handle_type': 0, 'interpolation': 0}]}, 'green': {'Points': [{'co': {'X': 1.0, 'Y': 123.0}, 'handle_left': {'X': 0.5, 'Y': 1.0}, 'handle_right': {'X': 0.5, 'Y': 0.0}, 'handle_type': 0, 'interpolation': 0}]}, 'red': {'Points': [{'co': {'X': 1.0, 'Y': 0.0}, 'handle_left': {'X': 0.5, 'Y': 1.0}, 'handle_right': {'X': 0.5, 'Y': 0.0}, 'handle_type': 0, 'interpolation': 0}]}}, 'waveform': False, 'file_id': 'EKMYWSMEDW', 'title': 'Season1MinecraftLivestream#1.mp4'} add: True partial: False remove: False
project_data:INFO _set key: ['duration'] values: 3144.724951171875 add: False partial: False remove: False
timeline_webview:INFO SortItems
timeline_webview:INFO UpdateLayerIndex
main_window:INFO updateStatusChanged
timeline_webview:INFO SortItems
timeline_webview:INFO UpdateLayerIndex
properties_model:INFO {'alpha': {'Points': [{'co': {'X': 1.0, 'Y': 1.0}, 'interpolation': 2}]}, 'anchor': 0, 'channel_filter': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'channel_mapping': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'crop_height': {'Points': [{'co': {'X': 1.0, 'Y': 1.0}, 'interpolation': 2}]}, 'crop_width': {'Points': [{'co': {'X': 1.0, 'Y': 1.0}, 'interpolation': 2}]}, 'crop_x': {'Points': [{'co': {'X': 1.0, 'Y': 0.0}, 'interpolation': 2}]}, 'crop_y': {'Points': [{'co': {'X': 1.0, 'Y': 0.0}, 'interpolation': 2}]}, 'display': 0, 'duration': 3130.074951171875, 'effects': [], 'end': 3130.074951171875, 'gravity': 4, 'has_audio': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'has_video': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'id': 'YX42BV5ERL', 'layer': 5000000, 'location_x': {'Points': [{'co': {'X': 1.0, 'Y': 0.0}, 'interpolation': 2}]}, 'location_y': {'Points': [{'co': {'X': 1.0, 'Y': 0.0}, 'interpolation': 2}]}, 'mixing': 0, 'perspective_c1_x': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'perspective_c1_y': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'perspective_c2_x': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'perspective_c2_y': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'perspective_c3_x': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'perspective_c3_y': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'perspective_c4_x': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'perspective_c4_y': {'Points': [{'co': {'X': 1.0, 'Y': -1.0}, 'interpolation': 2}]}, 'position': 4.6499999999999995, 'reader': {'acodec': 'aac', 'audio_bit_rate': 129020, 'audio_stream_index': 1, 'audio_timebase': {'den': 44100, 'num': 1}, 'channel_layout': 3, 'channels': 2, 'display_ratio': {'den': 9, 'num': 16}, 'duration': 3130.074951171875, 'file_size': '1215207865', 'fps': {'den': 1001, 'num': 30000}, 'has_audio': True, 'has_single_image': False, 'has_video': True, 'height': 1080, 'interlaced_frame': False, 'metadata': {'compatible_brands': 'isomiso2avc1mp41', 'encoder': 'Lavf58.12.100', 'handler_name': 'SoundHandler', 'language': 'und', 'major_brand': 'isom', 'minor_version': '512'}, 'path': 'C:/Users/josep/Downloads/Season1MinecraftLivestream#1.mp4', 'pixel_format': 0, 'pixel_ratio': {'den': 1, 'num': 1}, 'sample_rate': 44100, 'top_field_first': True, 'type': 'FFmpegReader', 'vcodec': 'h264', 'video_bit_rate': 388233, 'video_length': '93808', 'video_stream_index': 0, 'video_timebase': {'den': 16000, 'num': 1}, 'width': 1920}, 'rotation': {'Points': [{'co': {'X': 1.0, 'Y': 0.0}, 'interpolation': 2}]}, 'scale': 1, 'scale_x': {'Points': [{'co': {'X': 1.0, 'Y': 1.0}, 'interpolation': 2}]}, 'scale_y': {'Points': [{'co': {'X': 1.0, 'Y': 1.0}, 'interpolation': 2}]}, 'shear_x': {'Points': [{'co': {'X': 1.0, 'Y': 0.0}, 'interpolation': 2}]}, 'shear_y': {'Points': [{'co': {'X': 1.0, 'Y': 0.0}, 'interpolation': 2}]}, 'start': 0.0, 'time': {'Points': [{'co': {'X': 1.0, 'Y': 1.0}, 'interpolation': 2}]}, 'volume': {'Points': [{'co': {'X': 1.0, 'Y': 1.0}, 'interpolation': 2}]}, 'wave_color': {'alpha': {'Points': [{'co': {'X': 1.0, 'Y': 255.0}, 'handle_left': {'X': 0.5, 'Y': 1.0}, 'handle_right': {'X': 0.5, 'Y': 0.0}, 'handle_type': 0, 'interpolation': 0}]}, 'blue': {'Points': [{'co': {'X': 1.0, 'Y': 255.0}, 'handle_left': {'X': 0.5, 'Y': 1.0}, 'handle_right': {'X': 0.5, 'Y': 0.0}, 'handle_type': 0, 'interpolation': 0}]}, 'green': {'Points': [{'co': {'X': 1.0, 'Y': 123.0}, 'handle_left': {'X': 0.5, 'Y': 1.0}, 'handle_right': {'X': 0.5, 'Y': 0.0}, 'handle_type': 0, 'interpolation': 0}]}, 'red': {'Points': [{'co': {'X': 1.0, 'Y': 0.0}, 'handle_left': {'X': 0.5, 'Y': 1.0}, 'handle_right': {'X': 0.5, 'Y': 0.0}, 'handle_type': 0, 'interpolation': 0}]}}, 'waveform': False, 'file_id': 'EKMYWSMEDW', 'title': 'Season1MinecraftLivestream#1.mp4'}
properties_model:INFO updating clip properties model.
main_window:INFO updateStatusChanged
preview_thread:INFO refreshFrame
preview_thread:INFO self.player.Position(): 1
main_window:INFO main::addSelection: item_id: , item_type: effect, clear_existing: True
main_window:INFO main::addSelection: item_id: YX42BV5ERL, item_type: clip, clear_existing: True
properties_model:INFO Update item: clip
properties_model:INFO Update frame to 1
properties_model:INFO updating clip properties model.
timeline_webview:INFO Dropping item on timeline - item_id: YX42BV5ERL, item_type: clip
project_data:INFO _set key: ['clips', {'id': 'YX42BV5ERL'}] values: {'id': 'YX42BV5ERL', 'layer': 5000000, 'position': 0, 'start': 0, 'end': 3130.074951171875} add: False partial: False remove: False
timeline_webview:INFO SortItems
timeline_webview:INFO UpdateLayerIndex
properties_model:INFO {'id': 'YX42BV5ERL', 'layer': 5000000, 'position': 0, 'start': 0, 'end': 3130.074951171875}
properties_model:INFO updating clip properties model.
main_window:INFO updateStatusChanged
preview_thread:INFO refreshFrame
preview_thread:INFO self.player.Position(): 1
properties_model:INFO Update frame to 1
properties_model:INFO updating clip properties model.
preview_thread:INFO refreshFrame
preview_thread:INFO self.player.Position(): 1
properties_model:INFO Update frame to 1
properties_model:INFO updating clip properties model.
preview_thread:INFO onModeChanged
submitted by srfr4life6 to OpenShot [link] [comments]


2020.04.14 20:06 redleopard81 Graphql Flutter fetchMore refresh whole widget?

Hi guys, I need your help.
My first query result are displayed using ListView widget. And I call fetchMore function for more result. But instead of just adding new result at the bottom of ListView, It seems refresh whole widget.( it shows Loading widget)
I am very new to Flutter.
Here is builder in Query widget.

builder: (QueryResult result, {VoidCallback refetch, FetchMore fetchMore}) { if (result.hasException) { return Text(result.exception.toString()); } if (result.loading) { return Center( child: CircularProgressIndicator(), ); } List items = result.data['playlistItems']['items']; String token = result.data['playlistItems']['nextPageToken']; token = token ?? ""; FetchMoreOptions opts = FetchMoreOptions( variables: {'nextPageToken': token}, updateQuery: (previousResultData, fetchMoreResultData) { final List newItems = [ ...previousResultData['playlistItems']['items'] as List, ...fetchMoreResultData['playlistItems']['items'] as List ]; fetchMoreResultData['playlistItems']['items'] = newItems; return fetchMoreResultData; }); return Stack( children: [ VideoList(itemCount: items.length, items: items), Align( alignment: Alignment.bottomRight, child: Padding( padding: EdgeInsets.symmetric( vertical: 10.0, horizontal: 10.0), child: FloatingActionButton.extended( onPressed: () { fetchMore(opts); }, label: Text("Load More"), icon: Icon(Icons.more), ), ), ), ], ); 
How can I just add fetch more result at the bottom of the list instead of refreshing whole listview?
What am I missing?
submitted by redleopard81 to Flutter [link] [comments]


2020.04.09 19:38 LuD1161 Data gets loaded only when the page rebuilds or app relaods - Provider

I've implemented Provider pattern in a simple Notes app.

Problem :

Data is loaded on the screen only when the app reloads or the screen gets rebuilt.
This is my note_list stateless widget which displays the notes :
```dart
class NoteList extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Note List"), ), body: getnoteListView(context), floatingActionButton: FloatingActionButton( onPressed: () { Navigator.push(context, MaterialPageRoute(builder: (context) { return ChangeNotifierProvider( builder: (context) => NoteProvider(), child: NoteDetail(Note('', '', 2), 'Add Note'), ); })); }, tooltip: "Add Note", child: Icon(Icons.add), ), ); }
ListView getnoteListView(BuildContext context) { // <---- the thing to be focused here final noteProvider = Provider.of(context); var noteList = noteProvider.noteList; var count = noteList.length; TextStyle titleStyle = Theme.of(context).textTheme.subhead; return ListView.builder( itemCount: count, itemBuilder: (BuildContext context, int index) { print(noteList[index].title); return Text( noteList[index].title, style: titleStyle, ); }, ); } }
```
And the NoteProvider.dart :
```dart import 'package:fluttematerial.dart'; import 'package:pass_list/models/note.dart'; import 'package:pass_list/utils/database_helper.dart';
// https://stackoverflow.com/a/56713184 class NoteProvider with ChangeNotifier { DatabaseHelper databaseHelper = DatabaseHelper(); List _noteList = []; int count = 0; // get updateListView;
get noteList => _noteList;
NoteProvider(){ fetchNotes(); }
void setNoteList(notesList) { _noteList = notesList; }
fetchNotes() async { await databaseHelper.initializeDatabase(); List noteList = await databaseHelper.getNoteList(); setNoteList(noteList); }
Future updateNote(note) async{ var result = await databaseHelper.updateNote(note); await fetchNotes(); notifyListeners(); return result; }
Future insertNote(note) async{ var result = await databaseHelper.insertNote(note); await fetchNotes(); notifyListeners(); return result; }
Future deleteNote(noteId) async{ var result = await databaseHelper.deleteNote(noteId); await fetchNotes(); notifyListeners(); return result; } } ``` Here's the repo, in case you wish to run the app : Repo
Directory Structure : dart lib β”œβ”€β”€ main.dart β”œβ”€β”€ models β”‚ └── note.dart β”œβ”€β”€ screens β”‚ β”œβ”€β”€ note_detail.dart β”‚ └── note_list.dart └── utils β”œβ”€β”€ database_helper.dart └── NoteProvider.dart

Video of the problem : https://youtu.be/YrAVTum9P6E

Thanks.
submitted by LuD1161 to Flutter [link] [comments]


2020.04.08 20:05 LuD1161 Best way of implementing Provider in this Notes app

I've been learning flutter for sometime now and feel confident with simple constructs i.e. no complex state management stuff. I started reading about 'pragmatic state management' and saw the Google I/O video talking about Provider and how they at Google themselves are using it as it's much cleaner and easier to use.
Problem : I want to implement this Notes App using Provider, I am not even sure if I am implementing it the correct way. However What I figured out is that the NoteList variable is being updated, anyway that's besides the point.
Code Here : https://github.com/LuD1161/notes_app In the last commit I show what all I understood about Provider, which isn't working as you would've guessed ( and hence the mail -_- ). The previous commit is till where the tutorial ended and is working code. Here's the tutorial link .

My app directory structure :

lib β”œβ”€β”€ main.dart β”œβ”€β”€ models β”‚ └── note.dart β”œβ”€β”€ screens β”‚ β”œβ”€β”€ note_detail.dart β”‚ └── note_list.dart └── utils β”œβ”€β”€ database_helper.dart └── NoteProvider.dart 

Info about some of the files here :

note_detail.dart : Handles new note insertion note_list.dart : Lists notes saved in the database, on pressing the FAB here you go to the note_detail screen, where note gets added.
There's a updateListView() function that is run whenever a new note is saved or deleted.
void updateListView() { final Future dbFuture = databaseHelper.initializeDatabase(); dbFuture.then((database) { Future> noteListFuture = databaseHelper.getNoteList(); noteListFuture.then((noteList) { setState(() { this.noteList = noteList; this.count = noteList.length; }); }); }); } 
noteList is a list of notes in the note_list screen over which a ListView.builder creates a list of.
 ListView getnoteListView() { TextStyle titleStyle = Theme.of(context).textTheme.subhead; return ListView.builder( itemCount: count, itemBuilder: (BuildContext context, int index) { return Card( color: Colors.white, elevation: 2.0, child: ListTile( leading: CircleAvatar( backgroundColor: getPriorityColor(this.noteList[index].priority), child: getPriorityIcon(this.noteList[index].priority), ), title: Text( this.noteList[index].title, style: titleStyle, ), ~~~~  ~~~~ 
I've read a lot of posts and watched quite a few good videos on Provider, however I am not sure what I'm doing wrong here. There's some misconception I guess, which the community would better help me understand.
Thanks.

Update 1

I changed the noteListData in the provider to this ( earlier it was returning a future ) : List get noteListData { databaseHelper.initializeDatabase().then((dbFuture){ databaseHelper.getNoteList().then((noteListFuture){ return noteListFuture; }); }); }
Still I don't see noteList getting populated.
Code in Note List State :
``` class NoteListState extends State { DatabaseHelper databaseHelper = DatabaseHelper(); List noteList; int count = 0;
@override Widget build(BuildContext context) { final noteProvider = Provider.of(context); this.noteList = noteProvider.noteListData; <----- breakpoint here this.count = this.noteList.length;
return Scaffold( appBar: AppBar( title: Text("Note List"), ), 
```

Update 2

I changed the code a bit to debug the future calls these and realised this.
List get noteListData { databaseHelper.initializeDatabase().then((dbFuture){ databaseHelper.getNoteList().then((noteListFuture){ return noteListFuture; <-breakpoint 1 }); }); return [Note("title1", "", 1), Note("title2", "", 1)];<-breakpoint 2 }
In the above code "title1" and "title2" are returned.
From breakpoint 1 - it goes to the async code and gets over nothing is returned.
From breakpoint 2 - this is where data is actually being returned. Now, I can see the hardcoded results being returned.

Update 3 - A ray of hope ( working code, but not sure if this's the right way )

Changed the code to set the variable noteList of the NoteProvider object. This is working but I am a bit unsure if this is the way to go..
List get noteListData { databaseHelper.initializeDatabase().then((dbFuture){ databaseHelper.getNoteList().then((noteListFuture){ this.noteList = noteListFuture; }); }); return this.noteList; }
submitted by LuD1161 to Flutter [link] [comments]


2020.03.30 00:35 Sm1dgen [Help] Not sure why the search filter isn't working

Hi, guys, I'm trying to make a search a list view with data that has been parsed using XMLPullParser. for some reason, it is showing a null value when I type anything and I'm not sure why. This is for a uni project and he wants us to use XMLpullparser I was originally using Document. This is in android.
Here is the parser class
public List getRSSFeedItems(String rss_url) {
List itemsList = new ArrayList();
String rss_feed_xml;
rss_feed_xml = this.getXmlFromUrl(rss_url);
if (rss_feed_xml != null) {XmlPullParserFactory factory;try {
factory = XmlPullParserFactory.newInstance();
XmlPullParser parser = factory.newPullParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
parser.setInput(new StringReader(rss_feed_xml));
RssItems Rssitems = null;int eventType = parser.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
String eleName = null;
switch (eventType){case XmlPullParser.START_TAG:eleName = parser.getName();
if(TAG_ITEM.equals(eleName)){Rssitems = new RssItems();
itemsList.add(Rssitems);
}else if (Rssitems != null){
if(TAG_TITLE.equals(eleName)){
Rssitems.setTitle(parser.nextText());
}else if(TAG_DESRIPTION.equals(eleName)){
Rssitems.setDescription(parser.nextText().replaceAll("<.*?>", "\n"));
}else if (TAG_PUB_DATE.equals(eleName)){
Rssitems.setPubDate(parser.nextText());
}else if(TAG_GEORSS.equals(eleName)){
Rssitems.setGeorss(parser.nextText());
}
}break;
}eventType = parser.next();
}
} catch (XmlPullParserException IOException e) {e.printStackTrace();}}return itemsList;}
Here is the filter section for the filter (im using a simple adapter for the run on UI thread)
//methods for the search bar on the list
itemsfilter.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
((SimpleAdapter)RSSFeedActivity.this.adapter).getFilter().filter(s);
}
@Override
public void afterTextChanged(Editable s) {
}});}
Here is the RunonUIThread
runOnUiThread(new Runnable() {
@RequiresApi(api = Build.VERSION_CODES.O)public void run() {
adapter = new SimpleAdapter(RSSFeedActivity.this,rssItemList, R.layout.rss_item_list_row,
new String[]{TAG_DESCRIPTION, TAG_TITLE, TAG_GEORSS, TAG_PUB_DATE},
new int[]{id.description, id.title, id.georss, id.pubDate});
// updating listview
setListAdapter(adapter);
}
});return null;
}
I'm just not sure what it could be causing it. Sorry if this sounds dumb I'm new to android
Edit: it works with 2/3 links im using for an Rss Feed its just the first link it doesnt work with displaying a
Attempt to invoke interface method 'int java.util.List.size()' on a null object reference Error.
submitted by Sm1dgen to CodingHelp [link] [comments]


2020.03.25 21:06 Saivy__4 Arraylist and ListView

 if (action.get() == ButtonType.OK) { lstShowGrades.getItems().removeAll(lstShowGrades.getSelectionModel().getSelectedItem()); //Updates the arraylist alonside the deleted items 
I have this piece of code that deletes the selected item when button is pressed
I want that the elements that are deleted from listview must be deleted from my arraylist as well.How do I do that?
submitted by Saivy__4 to learnjava [link] [comments]


2020.03.25 21:05 Saivy__4 Arraylist and ListView

if (action.get() == ButtonType.OK) { lstShowGrades.getItems().removeAll(lstShowGrades.getSelectionModel().getSelectedItem()); //Updates the arraylist alonside the deleted items --code here-- 
I have this piece of code that deletes the selected item when button is pressed
I want that the elements that are deleted from listview must be deleted from my arraylist as well.How do I do that?
submitted by Saivy__4 to javahelp [link] [comments]


2020.03.15 20:41 Saivy__4 Remove Element From ArrayList

if (action.get() == ButtonType.OK) { lstShowGrades.getItems().removeAll(lstShowGrades.getSelectionModel().getSelectedItem()); //Updates the arraylist alonside the deleted items lstShowGrades.getSelectionModel().selectionModeProperty().addListener((v, oldValue, newValue) -> lstShowGrades.getSelectionModel().getSelectedItem()); courseDetails.remove(lstShowGrades.getSelectionModel().getSelectedItems()); System.out.println(courseDetails); } 
So, i have an arraylist and a listview. I want that If user removed an element from listview,it removes from arrraylist as well.
I'am doing the above approach.But only removed element is showing on the screen.
Any Help will be appreciated
thanks.
submitted by Saivy__4 to javahelp [link] [comments]


2020.03.15 20:41 Saivy__4 Remove Element From ArrayList

if (action.get() == ButtonType.OK) { lstShowGrades.getItems().removeAll(lstShowGrades.getSelectionModel().getSelectedItem()); //Updates the arraylist alonside the deleted items lstShowGrades.getSelectionModel().selectionModeProperty().addListener((v, oldValue, newValue) -> lstShowGrades.getSelectionModel().getSelectedItem()); courseDetails.remove(lstShowGrades.getSelectionModel().getSelectedItems()); System.out.println(courseDetails); } 
So, i have an arraylist and a listview. I want that If user removed an element from listview,it removes from arrraylist as well.
I'am doing the above approach.But only removed element is showing on the screen.
Any Help will be appreciated
thanks.
submitted by Saivy__4 to learnjava [link] [comments]