Beispiel #1
0
    def showsUpdateButtonClicked(self, widget):
        self.database.write()
        preferences = Preferences(Tools.preferencesXML)
        preferences.load()

        #update warning
        dialog = gtk.MessageDialog(
            None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
            gtk.MESSAGE_QUESTION, gtk.BUTTONS_OK, None)
        hbox = gtk.HBox()
        hbox.pack_start(
            gtk.Label(
                "The Database is updating. ( The program may appear to freeze during this process. )"
            ), False, 5, 5)
        dialog.vbox.pack_end(hbox, True, True, 0)
        dialog.show_all()
        dialog.run()

        if self.to_boolean(preferences['imdbtv-with-tests']) == True:
            testimdbtv = imdbtvtest()
            testimdbtv.testDownloadShowList()
            testimdbtv.testGetShowDetails()

        se = NewBackendInterface(Tools.databaseDir)
        se.updateDatabase()

        dialog.destroy()

        #Fix treeview. Should manipulate, if necessary.
        self.showsStore.clear()
        self.database.loadDB()
        for Show in self.database.database:
            self.showsStore.append([Show.name, Show.backend, Show])
Beispiel #2
0
 def showsUpdateButtonClicked (self, widget) :
     self.database.write()
     preferences = Preferences(Tools.preferencesXML)
     preferences.load()
     
     #update warning
     dialog = gtk.MessageDialog( None,
                                 gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,  
                                 gtk.MESSAGE_QUESTION,  
                                 gtk.BUTTONS_OK,  
                                 None)
     hbox = gtk.HBox()  
     hbox.pack_start(gtk.Label("The Database is updating. ( The program may appear to freeze during this process. )"), False, 5, 5)  
     dialog.vbox.pack_end(hbox, True, True, 0)
     dialog.show_all()
     dialog.run() 
     
     if self.to_boolean(preferences['imdbtv-with-tests']) == True :
         testimdbtv = imdbtvtest()
         testimdbtv.testDownloadShowList()
         testimdbtv.testGetShowDetails()
     
     se = NewBackendInterface(Tools.databaseDir)
     se.updateDatabase()
      
     dialog.destroy()
     
     #Fix treeview. Should manipulate, if necessary.
     self.showsStore.clear()
     self.database.loadDB()
     for Show in self.database.database :
         self.showsStore.append([ Show.name, Show.backend, Show ])
Beispiel #3
0
    def __init__(self):

        ##
        # Initialize Glade file
        ##

        self.gladefile = "veefire-gtk.glade"
        self.wTree = gtk.glade.XML(self.gladefile)

        dic = {
            "on_MainWindow_destroy": gtk.main_quit,
            "on_mainRevertButton_clicked": self.mainRevertButtonClicked,
            "on_mainRenameButton_clicked": self.mainRenameButtonClicked,
            "on_mainPreferencesButton_clicked":
            self.mainPreferencesButtonClicked,
            "on_mainAboutButton_clicked": self.mainAboutButtonClicked,
            "on_previewPreviewButton_clicked":
            self.previewPreviewButtonClicked,
            "on_previewSelectFolderButton_clicked":
            self.previewSelectFolderButtonClicked,
            "on_showsNewShowButton_clicked": self.showsNewShowButtonClicked,
            "on_showsDeleteShowButton_clicked":
            self.showsDeleteShowButtonClicked,
            "on_showsEditShowsButton_clicked":
            self.showsEditShowsButtonClicked,
            "on_showsUpdateButton_clicked": self.showsUpdateButtonClicked
        }

        self.wTree.signal_autoconnect(dic)

        ##
        # Initialize Database and Rename
        ##

        self.database = Database(Tools.databaseDir)
        self.database.loadDB()

        self.rename = NewRename(Tools.databaseDir, Tools.filetypesXML)

        ##
        # Main Buttons (Disable those buttons that depends on other functions)
        ##

        self.mainRevertButton = self.wTree.get_widget("mainRevertButton")
        self.mainRevertButton.set_sensitive(False)

        self.mainRenameButton = self.wTree.get_widget("mainRenameButton")
        self.mainRenameButton.set_sensitive(False)

        ##
        # Preview Buttons (Disable those buttons that depends on other functions)
        ##

        self.previewPreviewButton = self.wTree.get_widget(
            "previewPreviewButton")
        self.previewPreviewButton.set_sensitive(False)

        ##
        #
        # Initialize previewTree
        #
        ##

        self.previewStore = gtk.ListStore(str, str, str, str, object)

        self.previewView = self.wTree.get_widget("previewTree")
        self.previewView.set_model(self.previewStore)

        render = gtk.CellRendererText()
        col = gtk.TreeViewColumn("Original Name", render, text=0)
        col.set_resizable(True)
        self.previewView.append_column(col)

        render = gtk.CellRendererText()
        col = gtk.TreeViewColumn("Current Name", render, text=1)
        col.set_resizable(True)
        col.set_visible(False)
        self.previewView.append_column(col)

        render = gtk.CellRendererText()
        col = gtk.TreeViewColumn("Show", render, text=2)
        col.set_resizable(True)
        col.set_visible(False)
        self.previewView.append_column(col)

        render = gtk.CellRendererText()
        col = gtk.TreeViewColumn("Preview", render, text=3)
        col.set_resizable(True)
        col.set_visible(False)
        self.previewView.append_column(col)

        col = gtk.TreeViewColumn()
        col.set_visible(False)
        self.previewView.append_column(col)

        #Set the selection option so that only one row can be selected
        sel = self.previewView.get_selection()
        sel.set_mode(gtk.SELECTION_SINGLE)

        self.previewView.show()

        ##
        #
        # Initialize showsTree
        #
        ##

        self.showsStore = gtk.ListStore(str, str, object)

        self.showsStore.clear()
        self.database = Database(Tools.databaseDir)
        self.database.loadDB()
        preferences = Preferences(Tools.preferencesXML)
        preferences.load()

        if self.to_boolean(preferences['update-on-startup']) == True:
            #update warning
            dialog = gtk.MessageDialog(
                None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
                gtk.MESSAGE_QUESTION, gtk.BUTTONS_OK, None)
            hbox = gtk.HBox()
            hbox.pack_start(
                gtk.Label(
                    "The Database is updating. ( The program may appear to freeze during this process. )"
                ), False, 5, 5)
            dialog.vbox.pack_end(hbox, True, True, 0)
            dialog.show_all()

            dialog.run()

            if self.to_boolean(preferences['imdbtv-with-tests']) == True:
                testimdbtv = imdbtvtest()
                testimdbtv.testDownloadShowList()
                testimdbtv.testGetShowDetails()

            se = NewBackendInterface(Tools.databaseDir)
            se.updateDatabase()
            self.database.loadDB()

            dialog.destroy()

        for Show in self.database.database:
            self.showsStore.append([Show.name, Show.backend, Show])

        self.showsView = self.wTree.get_widget("showsTree")
        self.showsView.set_model(self.showsStore)

        render = gtk.CellRendererText()
        col = gtk.TreeViewColumn("Name", render, text=0)
        self.showsView.append_column(col)

        render = gtk.CellRendererText()
        col = gtk.TreeViewColumn("Backend", render, text=1)
        self.showsView.append_column(col)

        col = gtk.TreeViewColumn()
        col.set_visible(False)
        self.showsView.append_column(col)

        #set the selection option so that only one row can be selected
        sel = self.showsView.get_selection()
        sel.set_mode(gtk.SELECTION_SINGLE)

        self.showsView.show()

        ##
        #
        # Initialize the showsTree's right-click menu
        #
        ##

        self.editShowMenu = self.wTree.get_widget("editShowMenu")
        self.editShowMenuUpdate = self.wTree.get_widget("editShowMenuUpdate")
        self.editShowMenuRemove = self.wTree.get_widget("editShowMenuRemove")

        self.showsView.connect('button_press_event', self.showMenu)

        self.editShowMenuUpdate.connect('activate', self.showMenuUpdate)
        self.editShowMenuRemove.connect('activate', self.showMenuRemove)
Beispiel #4
0
 def __init__(self):
     
     ##
     # Initialize Glade file
     ##
     
     self.gladefile = "veefire-gtk.glade"
     self.wTree = gtk.glade.XML(self.gladefile)
     
     dic = {  "on_MainWindow_destroy" : gtk.main_quit,
               "on_mainRevertButton_clicked" : self.mainRevertButtonClicked,
              "on_mainRenameButton_clicked" : self.mainRenameButtonClicked,
              "on_mainPreferencesButton_clicked" : self.mainPreferencesButtonClicked,
              "on_mainAboutButton_clicked" : self.mainAboutButtonClicked,
              "on_previewPreviewButton_clicked" : self.previewPreviewButtonClicked,
              "on_previewSelectFolderButton_clicked" : self.previewSelectFolderButtonClicked,
              "on_showsNewShowButton_clicked" : self.showsNewShowButtonClicked,
              "on_showsDeleteShowButton_clicked" : self.showsDeleteShowButtonClicked,
              "on_showsEditShowsButton_clicked" : self.showsEditShowsButtonClicked,
              "on_showsUpdateButton_clicked" : self.showsUpdateButtonClicked }
     
     self.wTree.signal_autoconnect(dic)
     
     ##
     # Initialize Database and Rename
     ##
     
     self.database = Database(Tools.databaseDir)
     self.database.loadDB()
     
     self.rename = NewRename( Tools.databaseDir, Tools.filetypesXML )
     
     ##
     # Main Buttons (Disable those buttons that depends on other functions)
     ##
     
     self.mainRevertButton = self.wTree.get_widget("mainRevertButton")
     self.mainRevertButton.set_sensitive(False)
     
     self.mainRenameButton = self.wTree.get_widget("mainRenameButton")
     self.mainRenameButton.set_sensitive(False)
     
     ##
     # Preview Buttons (Disable those buttons that depends on other functions)
     ##
     
     self.previewPreviewButton = self.wTree.get_widget("previewPreviewButton")
     self.previewPreviewButton.set_sensitive(False)
     
     ##
     #
     # Initialize previewTree
     #
     ##
     
     self.previewStore = gtk.ListStore( str, str, str, str, object )
     
     self.previewView = self.wTree.get_widget("previewTree")
     self.previewView.set_model(self.previewStore)
     
     render=gtk.CellRendererText()
     col=gtk.TreeViewColumn("Original Name",render,text=0)
     col.set_resizable(True)
     self.previewView.append_column(col)
     
     render=gtk.CellRendererText()
     col=gtk.TreeViewColumn("Current Name",render,text=1)
     col.set_resizable(True)
     col.set_visible(False)
     self.previewView.append_column(col)
     
     render=gtk.CellRendererText()
     col=gtk.TreeViewColumn("Show",render,text=2)
     col.set_resizable(True)
     col.set_visible(False)
     self.previewView.append_column(col)
     
     render=gtk.CellRendererText()
     col=gtk.TreeViewColumn("Preview",render,text=3)
     col.set_resizable(True)
     col.set_visible(False)
     self.previewView.append_column(col)
     
     col=gtk.TreeViewColumn()
     col.set_visible(False)
     self.previewView.append_column(col)
     
     #Set the selection option so that only one row can be selected
     sel=self.previewView.get_selection()
     sel.set_mode(gtk.SELECTION_SINGLE)
     
     self.previewView.show()
     
     ##
     #
     # Initialize showsTree
     #
     ##
     
     self.showsStore = gtk.ListStore( str, str, object )
     
     self.showsStore.clear()
     self.database = Database(Tools.databaseDir)
     self.database.loadDB()
     preferences = Preferences(Tools.preferencesXML)
     preferences.load()
     
     if self.to_boolean(preferences['update-on-startup']) == True :
         #update warning
         dialog = gtk.MessageDialog( None,
                                     gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,  
                                     gtk.MESSAGE_QUESTION,  
                                     gtk.BUTTONS_OK,  
                                     None)
         hbox = gtk.HBox()  
         hbox.pack_start(gtk.Label("The Database is updating. ( The program may appear to freeze during this process. )"), False, 5, 5)  
         dialog.vbox.pack_end(hbox, True, True, 0)
         dialog.show_all()
         
         dialog.run()
         
         if self.to_boolean(preferences['imdbtv-with-tests']) == True :
             testimdbtv = imdbtvtest()
             testimdbtv.testDownloadShowList()
             testimdbtv.testGetShowDetails()
         
         se = NewBackendInterface(Tools.databaseDir)
         se.updateDatabase()
         self.database.loadDB()
         
         dialog.destroy()
     
     
     for Show in self.database.database :
         self.showsStore.append([ Show.name, Show.backend, Show ])
     
     self.showsView = self.wTree.get_widget("showsTree")
     self.showsView.set_model(self.showsStore)
     
     render=gtk.CellRendererText()
     col=gtk.TreeViewColumn("Name",render,text=0)
     self.showsView.append_column(col)
     
     render=gtk.CellRendererText()
     col=gtk.TreeViewColumn("Backend",render,text=1)
     self.showsView.append_column(col)
     
     col=gtk.TreeViewColumn()
     col.set_visible(False)
     self.showsView.append_column(col)
     
     #set the selection option so that only one row can be selected
     sel=self.showsView.get_selection()
     sel.set_mode(gtk.SELECTION_SINGLE)
     
     self.showsView.show()
     
     ##
     #
     # Initialize the showsTree's right-click menu
     #
     ##
     
     self.editShowMenu = self.wTree.get_widget("editShowMenu")
     self.editShowMenuUpdate = self.wTree.get_widget("editShowMenuUpdate")
     self.editShowMenuRemove = self.wTree.get_widget("editShowMenuRemove")
     
     self.showsView.connect('button_press_event', self.showMenu )
     
     self.editShowMenuUpdate.connect('activate', self.showMenuUpdate )
     self.editShowMenuRemove.connect('activate', self.showMenuRemove )