Skip to content
Browse files

added nags to GUI parse/export

  • Loading branch information...
1 parent b49601a commit 4d511377e7232074c0e59561dedc2b259c0be4f3 @Vhati committed Oct 10, 2012
Showing with 22 additions and 2 deletions.
  1. +21 −2 lib/gui/vlcplayer.py
  2. +1 −0 readme.txt
View
23 lib/gui/vlcplayer.py
@@ -10,11 +10,9 @@
import logging
import os
import platform
-import Queue
import re
import sys
import wx
-import wx.grid
from lib import common
from lib import global_config
@@ -322,6 +320,17 @@ def after_func(source=e.GetEventObject()):
if (e is not None): e.Skip(False) # Consume the event.
def _on_parse(self, e):
+ old_snarks = self._snarks_wrapper.clone_snarks()
+ if (len(old_snarks) > 0):
+ user_cancelled = False
+ d = wx.MessageDialog(self, "If you parse again, existing snarks will be lost.\nContinue?", "Are you sure?",
+ wx.YES_NO|wx.NO_DEFAULT|wx.ICON_QUESTION)
+ d.Center() # Doesn't work.
+ if (d.ShowModal() != wx.ID_YES):
+ user_cancelled = True
+ d.Destroy()
+ if (user_cancelled is True): return
+
config = self._snarks_wrapper.clone_config()
def threaded_code(snarks_wrapper=self._snarks_wrapper, config=config, keep_alive_func=None, sleep_func=None):
@@ -372,6 +381,16 @@ def _on_export(self, e):
config = self._snarks_wrapper.clone_config()
snarks = self._snarks_wrapper.clone_snarks()
+ if (len(snarks) == 0):
+ user_cancelled = False
+ d = wx.MessageDialog(self, "No snarks to export.\nThe result won't be very interesting.\nContinue?", "Are you sure?",
+ wx.YES_NO|wx.NO_DEFAULT|wx.ICON_QUESTION)
+ d.Center() # Doesn't work.
+ if (d.ShowModal() != wx.ID_YES):
+ user_cancelled = True
+ d.Destroy()
+ if (user_cancelled is True): return
+
def threaded_code(config=config, snarks=snarks, keep_alive_func=None, sleep_func=None):
try:
snarkutils.gui_postprocess_snarks(config, snarks)
View
1 readme.txt
@@ -55,6 +55,7 @@ Changes
Fixed glitchy volume control.
Made twitter_search parser use the Tweepy subsystem.
Changed 'message'/'msg' to 'comment' in descriptions.
+ Added "Are you sure?" nags to GUI parse/export.
3.51 - Added twitter_mentions parser.
Added threading for parsers and exporters.
Widened in-gui config text fields.

0 comments on commit 4d51137

Please sign in to comment.
Something went wrong with that request. Please try again.