Exemplo n.º 1
0
def changeListName(self, listwidget):
    """
    Used to change the name of a list and the folder it creates
    Returns True if the name has been changed successfully

    :param self: SettingsWindow
    :param listwidget: int
    :return: bool
    """

    if listwidget == 0:  # List Right
        savestate.NewListName = (self.ui.rlistname.text(), 0)
        print("Changing name of the right list to " + self.ui.rlistname.text())
        logWrite("Changing name of the right list to " +
                 self.ui.rlistname.text())
    elif listwidget == 1:  # List Left
        savestate.NewListName = (self.ui.llistname.text(), 1)
        print("Changing name of the left list to " + self.ui.llistname.text())
        logWrite("Changing name of the left list to " +
                 self.ui.llistname.text())
    savestate.saveLists["Left"].setToolTip(
        savestate.configList["LeftListName"])
    savestate.saveLists["Right"].setToolTip(
        savestate.configList["RightListName"])
    updateSettings()
    initTextFiles("initFolders")
    updateLists()
Exemplo n.º 2
0
def changeTextPath(self):
    """
    This method changes the textfilepath used around the program

    :param self: SettingsWindow
    :return: None
    """
    logWrite("Trying to change the text path...")
    directory = QFileDialog.getExistingDirectory(
        self, "Change text file path", savestate.configList["CustomFilePath"],
        QFileDialog.DontResolveSymlinks)
    logWrite("The given path is: " + directory)
    if ":" or "/" in directory:
        emptyDir(savestate.configList["CustomFilePath"] + savestate.symbol +
                 "textfiles")
        self.ui.TextFilePath.setText(directory)
        savestate.configList["CustomFilePath"] = directory
        print("Filepath changed to: " + directory)
        createStandardFiles(1)
        updateSettings()
        updateLists()
        initTextFiles("initFolders")
    else:
        logWrite("The path is not valid!")
        erroreasy("Please give a valid filepath!", 0x0304)
Exemplo n.º 3
0
def activateFolderSplitting(checkbox):
    """
    Used to create a folder for each list if the setting is changed while in the program

    :type checkbox: QCheckBox
    :return: None
    """
    savestate.configList["ListSplit"] = checkbox.isChecked()
    logWrite("List split has been set to: " +
             str(savestate.configList["ListSplit"]))
    updateSettings()
    createStandardFiles(1)
    initTextFiles("initFolders")
    updateLists()
Exemplo n.º 4
0
def autoUpdateFiles(self):
    """
    Enables Auto-Updating of the textfiles. This means, that when the cursor focus on the lineedit within a list item
    is lost, the textfile updates automatically without user interaction

    :param self: SettingsWindow
    :return: None
    """
    print("Auto updating files is set to ",
          str(self.ui.AutoUpdate.isChecked()))
    savestate.configList["AutoUpdateFiles"] = self.ui.AutoUpdate.isChecked()
    logWrite("Auto-Updating has been set to: " +
             str(savestate.configList["AutoUpdateFiles"]))
    updateSettings()
    updateLists()
Exemplo n.º 5
0
def changeChronoFormat(self):
    savestate.configList["ChronoFormat"] = self.ui.ChronoFormat.text()
    updateLists()
    updateSettings()