]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
UI: Remove alias from more places #4577 #4695
authorMarkus Goetz <markus@woboq.com>
Wed, 20 Apr 2016 12:27:50 +0000 (14:27 +0200)
committerMarkus Goetz <markus@woboq.com>
Wed, 20 Apr 2016 12:27:50 +0000 (14:27 +0200)
src/gui/accountsettings.cpp
src/gui/folderwizard.cpp
src/gui/folderwizardsourcepage.ui

index fe44fdc9223f31797a307343b0812c03041bbd41..dfb4654acc63c569563a545c28d8f822792b2d13 100644 (file)
@@ -334,10 +334,13 @@ void AccountSettings::slotRemoveCurrentFolder()
         QString alias = _model->data( selected, FolderStatusDelegate::FolderAliasRole ).toString();
         qDebug() << "Remove Folder alias " << alias;
         if( !alias.isEmpty() ) {
+            FolderMan *folderMan = FolderMan::instance();
+            QString aliasGui = folderMan->folder(alias)->aliasGui();
+
             QMessageBox messageBox(QMessageBox::Question,
                                    tr("Confirm Folder Sync Connection Removal"),
                                    tr("<p>Do you really want to stop syncing the folder <i>%1</i>?</p>"
-                                      "<p><b>Note:</b> This will <b>not</b> delete any files.</p>").arg(alias),
+                                      "<p><b>Note:</b> This will <b>not</b> delete any files.</p>").arg(aliasGui),
                                    QMessageBox::NoButton,
                                    this);
             QPushButton* yesButton =
@@ -349,7 +352,6 @@ void AccountSettings::slotRemoveCurrentFolder()
                 return;
             }
 
-            FolderMan *folderMan = FolderMan::instance();
             folderMan->slotRemoveFolder( folderMan->folder(alias) );
             _model->removeRow(row);
 
index 54534278e243f9cf85b547c06b193b3fbe95d265..c5668421111acf806a2491f3b426d6298727a0ab 100644 (file)
@@ -68,17 +68,13 @@ FolderWizardLocalPath::FolderWizardLocalPath()
     _ui.localFolderLineEdit->setText( QDir::toNativeSeparators( defaultPath ) );
     _ui.localFolderLineEdit->setToolTip(tr("Enter the path to the local folder."));
 
-    registerField(QLatin1String("alias*"), _ui.aliasLineEdit);
-
     QString newAlias = Theme::instance()->appName();
     int count = 0;
     while (FolderMan::instance()->folder(newAlias)) {
         // There is already a folder configured with this name and folder names need to be unique
         newAlias = Theme::instance()->appName() + QString::number(++count);
     }
-    _ui.aliasLineEdit->setText( newAlias );
 
-    _ui.aliasLineEdit->setToolTip(tr("The folder alias is a descriptive name for this sync connection."));
     _ui.warnLabel->setTextFormat(Qt::RichText);
     _ui.warnLabel->hide();
 }
@@ -109,29 +105,6 @@ bool FolderWizardLocalPath::isComplete() const
         warnStrings << errorStr;
     }
 
-  // check if the alias is unique.
-  QString alias = _ui.aliasLineEdit->text();
-  if( alias.isEmpty() ) {
-    warnStrings.append( tr("The alias can not be empty. Please provide a descriptive alias word.") );
-    isOk = false;
-  }
-
-  auto map = FolderMan::instance()->map();
-  Folder::Map::const_iterator i = map.constBegin();
-  bool goon = true;
-  while( goon && i != map.constEnd() ) {
-    Folder *f = i.value();
-    if( f ) {
-      qDebug() << "Checking local alias: " << f->alias();
-      if( f->alias() == alias ) {
-        warnStrings.append( tr("The alias <i>%1</i> is already in use. Please pick another alias.").arg(alias) );
-        isOk = false;
-        goon = false;
-      }
-    }
-    i++;
-  }
-
   _ui.warnLabel->setWordWrap(true);
   if( isOk ) {
     _ui.warnLabel->hide();
@@ -170,9 +143,6 @@ void FolderWizardLocalPath::slotChooseLocalFolder()
             // There is already a folder configured with this name and folder names need to be unique
             newAlias = pickedDir.dirName() + QString::number(++count);
         }
-        if( !newAlias.isEmpty() ) {
-            _ui.aliasLineEdit->setText(newAlias);
-        }
     }
     emit completeChanged();
 }
index 5dc05c4fcad49ddaee8a0f6c6575af4ff96e166a..cccb4c1643166e7e38472113cf82461a4fcf203b 100644 (file)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>423</width>
-    <height>155</height>
+    <height>174</height>
    </rect>
   </property>
   <property name="windowTitle">
         </item>
        </layout>
       </item>
-      <item row="1" column="0">
-       <layout class="QHBoxLayout" name="horizontalLayout">
-        <item>
-         <widget class="QLabel" name="label_2">
-          <property name="text">
-           <string>&amp;Directory alias name:</string>
-          </property>
-          <property name="buddy">
-           <cstring>aliasLineEdit</cstring>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="aliasLineEdit"/>
-        </item>
-       </layout>
-      </item>
      </layout>
     </widget>
    </item>