Permalink
Browse files

Welcome the new 'pc-zmanager' for ZFS & Disk Management

A HUGE Thank You to: Claudio L <claudio@hpgcc3.org>

Update pkg-plist and add it to the control panel
  • Loading branch information...
1 parent 2513d5a commit 125dbc9e48a449dc25e2868b7a0826848224556b @kmoore134 kmoore134 committed Oct 10, 2013
Showing with 115,097 additions and 1 deletion.
  1. +128 −1 .gitignore
  2. +11 −0 src-qt4/pc-controlpanel/items/hardware/pc-zmanager.desktop
  3. +23 −0 src-qt4/pc-zmanager/LICENSE
  4. +173 −0 src-qt4/pc-zmanager/dialogfscreate.cpp
  5. +48 −0 src-qt4/pc-zmanager/dialogfscreate.h
  6. +317 −0 src-qt4/pc-zmanager/dialogfscreate.ui
  7. +1,273 −0 src-qt4/pc-zmanager/dialogfsprop.cpp
  8. +69 −0 src-qt4/pc-zmanager/dialogfsprop.h
  9. +200 −0 src-qt4/pc-zmanager/dialogfsprop.ui
  10. +45 −0 src-qt4/pc-zmanager/dialogmount.cpp
  11. +30 −0 src-qt4/pc-zmanager/dialogmount.h
  12. +108 −0 src-qt4/pc-zmanager/dialogmount.ui
  13. +87 −0 src-qt4/pc-zmanager/dialogname.cpp
  14. +44 −0 src-qt4/pc-zmanager/dialogname.h
  15. +124 −0 src-qt4/pc-zmanager/dialogname.ui
  16. +401 −0 src-qt4/pc-zmanager/dialognewpool.cpp
  17. +71 −0 src-qt4/pc-zmanager/dialognewpool.h
  18. +235 −0 src-qt4/pc-zmanager/dialognewpool.ui
  19. +278 −0 src-qt4/pc-zmanager/dialogpartition.cpp
  20. +52 −0 src-qt4/pc-zmanager/dialogpartition.h
  21. +339 −0 src-qt4/pc-zmanager/dialogpartition.ui
  22. +430 −0 src-qt4/pc-zmanager/dialogprop.cpp
  23. +39 −0 src-qt4/pc-zmanager/dialogprop.h
  24. +93 −0 src-qt4/pc-zmanager/dialogprop.ui
  25. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_af.ts
  26. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_ar.ts
  27. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_az.ts
  28. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_bg.ts
  29. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_bn.ts
  30. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_bs.ts
  31. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_ca.ts
  32. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_cs.ts
  33. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_cy.ts
  34. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_da.ts
  35. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_de.ts
  36. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_el.ts
  37. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_en_GB.ts
  38. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_en_ZA.ts
  39. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_es.ts
  40. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_et.ts
  41. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_eu.ts
  42. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_fa.ts
  43. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_fi.ts
  44. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_fr.ts
  45. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_fr_CA.ts
  46. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_fur.ts
  47. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_gl.ts
  48. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_he.ts
  49. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_hi.ts
  50. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_hr.ts
  51. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_hu.ts
  52. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_id.ts
  53. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_is.ts
  54. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_it.ts
  55. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_ja.ts
  56. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_ka.ts
  57. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_ko.ts
  58. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_lt.ts
  59. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_lv.ts
  60. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_mk.ts
  61. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_mn.ts
  62. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_ms.ts
  63. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_mt.ts
  64. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_nb.ts
  65. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_ne.ts
  66. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_nl.ts
  67. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_pa.ts
  68. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_pl.ts
  69. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_pt.ts
  70. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_pt_BR.ts
  71. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_ro.ts
  72. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_ru.ts
  73. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_sk.ts
  74. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_sl.ts
  75. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_sr.ts
  76. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_sv.ts
  77. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_sw.ts
  78. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_ta.ts
  79. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_tg.ts
  80. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_th.ts
  81. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_tr.ts
  82. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_uk.ts
  83. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_uz.ts
  84. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_vi.ts
  85. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_zh_CN.ts
  86. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_zh_HK.ts
  87. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_zh_TW.ts
  88. +1,659 −0 src-qt4/pc-zmanager/i18n/ZManager_zu.ts
  89. +1 −0 src-qt4/pc-zmanager/icons/LICENSE
  90. BIN src-qt4/pc-zmanager/icons/arrow-down-double.png
  91. BIN src-qt4/pc-zmanager/icons/camera-photo.png
  92. BIN src-qt4/pc-zmanager/icons/configure.png
  93. BIN src-qt4/pc-zmanager/icons/drive-harddisk.png
  94. BIN src-qt4/pc-zmanager/icons/edit-text-frame-update.png
  95. BIN src-qt4/pc-zmanager/icons/edit-undo.png
  96. BIN src-qt4/pc-zmanager/icons/kdf.png
  97. BIN src-qt4/pc-zmanager/icons/kexi.png
  98. BIN src-qt4/pc-zmanager/icons/list-add-user-32.png
  99. BIN src-qt4/pc-zmanager/icons/list-add.png
  100. BIN src-qt4/pc-zmanager/icons/list-remove.png
  101. BIN src-qt4/pc-zmanager/icons/partitionmanager.png
  102. BIN src-qt4/pc-zmanager/icons/server-database.png
  103. BIN src-qt4/pc-zmanager/icons/task-attention.png
  104. BIN src-qt4/pc-zmanager/icons/task-complete.png
  105. BIN src-qt4/pc-zmanager/icons/task-reject.png
  106. BIN src-qt4/pc-zmanager/icons/user-busy-small-32.png
  107. BIN src-qt4/pc-zmanager/icons/user-online-small-32.png
  108. BIN src-qt4/pc-zmanager/icons/zmanager.png
  109. +43 −0 src-qt4/pc-zmanager/main.cpp
  110. +132 −0 src-qt4/pc-zmanager/pc-zmanager.pro
  111. +22 −0 src-qt4/pc-zmanager/zmanagerres.qrc
  112. +3,447 −0 src-qt4/pc-zmanager/zmanagerwindow.cpp
  113. +266 −0 src-qt4/pc-zmanager/zmanagerwindow.h
  114. +324 −0 src-qt4/pc-zmanager/zmanagerwindow.ui
  115. +67 −0 src-qt4/port-files/pkg-plist
  116. +1 −0 src-qt4/src-qt4.pro
View
@@ -996,4 +996,131 @@ src-sh/pbi-manager/wrapper/pbiwrapper
src-sh/pbi-manager10/wrapper/.pbiwrapper
src-sh/pbi-manager10/mount_nullfs/mount_nullfs
src-sh/pbi-manager10/pbime/pbime
-
+src-qt4/life-preserver/ui_LPMessages.h
+src-qt4/pc-updategui/i18n/UpdateGui_af.qm
+src-qt4/pc-updategui/i18n/UpdateGui_ar.qm
+src-qt4/pc-updategui/i18n/UpdateGui_az.qm
+src-qt4/pc-updategui/i18n/UpdateGui_bg.qm
+src-qt4/pc-updategui/i18n/UpdateGui_bn.qm
+src-qt4/pc-updategui/i18n/UpdateGui_bs.qm
+src-qt4/pc-updategui/i18n/UpdateGui_ca.qm
+src-qt4/pc-updategui/i18n/UpdateGui_cs.qm
+src-qt4/pc-updategui/i18n/UpdateGui_cy.qm
+src-qt4/pc-updategui/i18n/UpdateGui_da.qm
+src-qt4/pc-updategui/i18n/UpdateGui_de.qm
+src-qt4/pc-updategui/i18n/UpdateGui_el.qm
+src-qt4/pc-updategui/i18n/UpdateGui_en_GB.qm
+src-qt4/pc-updategui/i18n/UpdateGui_en_ZA.qm
+src-qt4/pc-updategui/i18n/UpdateGui_es.qm
+src-qt4/pc-updategui/i18n/UpdateGui_et.qm
+src-qt4/pc-updategui/i18n/UpdateGui_eu.qm
+src-qt4/pc-updategui/i18n/UpdateGui_fa.qm
+src-qt4/pc-updategui/i18n/UpdateGui_fi.qm
+src-qt4/pc-updategui/i18n/UpdateGui_fr.qm
+src-qt4/pc-updategui/i18n/UpdateGui_fr_CA.qm
+src-qt4/pc-updategui/i18n/UpdateGui_gl.qm
+src-qt4/pc-updategui/i18n/UpdateGui_he.qm
+src-qt4/pc-updategui/i18n/UpdateGui_hi.qm
+src-qt4/pc-updategui/i18n/UpdateGui_hr.qm
+src-qt4/pc-updategui/i18n/UpdateGui_hu.qm
+src-qt4/pc-updategui/i18n/UpdateGui_id.qm
+src-qt4/pc-updategui/i18n/UpdateGui_is.qm
+src-qt4/pc-updategui/i18n/UpdateGui_it.qm
+src-qt4/pc-updategui/i18n/UpdateGui_ja.qm
+src-qt4/pc-updategui/i18n/UpdateGui_ka.qm
+src-qt4/pc-updategui/i18n/UpdateGui_ko.qm
+src-qt4/pc-updategui/i18n/UpdateGui_lt.qm
+src-qt4/pc-updategui/i18n/UpdateGui_lv.qm
+src-qt4/pc-updategui/i18n/UpdateGui_mk.qm
+src-qt4/pc-updategui/i18n/UpdateGui_mn.qm
+src-qt4/pc-updategui/i18n/UpdateGui_ms.qm
+src-qt4/pc-updategui/i18n/UpdateGui_mt.qm
+src-qt4/pc-updategui/i18n/UpdateGui_nb.qm
+src-qt4/pc-updategui/i18n/UpdateGui_nl.qm
+src-qt4/pc-updategui/i18n/UpdateGui_pa.qm
+src-qt4/pc-updategui/i18n/UpdateGui_pl.qm
+src-qt4/pc-updategui/i18n/UpdateGui_pt.qm
+src-qt4/pc-updategui/i18n/UpdateGui_pt_BR.qm
+src-qt4/pc-updategui/i18n/UpdateGui_ro.qm
+src-qt4/pc-updategui/i18n/UpdateGui_ru.qm
+src-qt4/pc-updategui/i18n/UpdateGui_sa.qm
+src-qt4/pc-updategui/i18n/UpdateGui_sk.qm
+src-qt4/pc-updategui/i18n/UpdateGui_sl.qm
+src-qt4/pc-updategui/i18n/UpdateGui_sr.qm
+src-qt4/pc-updategui/i18n/UpdateGui_sv.qm
+src-qt4/pc-updategui/i18n/UpdateGui_sw.qm
+src-qt4/pc-updategui/i18n/UpdateGui_ta.qm
+src-qt4/pc-updategui/i18n/UpdateGui_tg.qm
+src-qt4/pc-updategui/i18n/UpdateGui_th.qm
+src-qt4/pc-updategui/i18n/UpdateGui_tr.qm
+src-qt4/pc-updategui/i18n/UpdateGui_uk.qm
+src-qt4/pc-updategui/i18n/UpdateGui_uz.qm
+src-qt4/pc-updategui/i18n/UpdateGui_vi.qm
+src-qt4/pc-updategui/i18n/UpdateGui_zh_CN.qm
+src-qt4/pc-updategui/i18n/UpdateGui_zh_HK.qm
+src-qt4/pc-updategui/i18n/UpdateGui_zh_TW.qm
+src-qt4/pc-updategui/i18n/UpdateGui_zu.qm
+src-qt4/pc-zmanager/i18n/ZManager_af.qm
+src-qt4/pc-zmanager/i18n/ZManager_ar.qm
+src-qt4/pc-zmanager/i18n/ZManager_az.qm
+src-qt4/pc-zmanager/i18n/ZManager_bg.qm
+src-qt4/pc-zmanager/i18n/ZManager_bn.qm
+src-qt4/pc-zmanager/i18n/ZManager_bs.qm
+src-qt4/pc-zmanager/i18n/ZManager_ca.qm
+src-qt4/pc-zmanager/i18n/ZManager_cs.qm
+src-qt4/pc-zmanager/i18n/ZManager_cy.qm
+src-qt4/pc-zmanager/i18n/ZManager_da.qm
+src-qt4/pc-zmanager/i18n/ZManager_de.qm
+src-qt4/pc-zmanager/i18n/ZManager_el.qm
+src-qt4/pc-zmanager/i18n/ZManager_en_GB.qm
+src-qt4/pc-zmanager/i18n/ZManager_en_ZA.qm
+src-qt4/pc-zmanager/i18n/ZManager_es.qm
+src-qt4/pc-zmanager/i18n/ZManager_et.qm
+src-qt4/pc-zmanager/i18n/ZManager_eu.qm
+src-qt4/pc-zmanager/i18n/ZManager_fa.qm
+src-qt4/pc-zmanager/i18n/ZManager_fi.qm
+src-qt4/pc-zmanager/i18n/ZManager_fr.qm
+src-qt4/pc-zmanager/i18n/ZManager_fr_CA.qm
+src-qt4/pc-zmanager/i18n/ZManager_fur.qm
+src-qt4/pc-zmanager/i18n/ZManager_gl.qm
+src-qt4/pc-zmanager/i18n/ZManager_he.qm
+src-qt4/pc-zmanager/i18n/ZManager_hi.qm
+src-qt4/pc-zmanager/i18n/ZManager_hr.qm
+src-qt4/pc-zmanager/i18n/ZManager_hu.qm
+src-qt4/pc-zmanager/i18n/ZManager_id.qm
+src-qt4/pc-zmanager/i18n/ZManager_is.qm
+src-qt4/pc-zmanager/i18n/ZManager_it.qm
+src-qt4/pc-zmanager/i18n/ZManager_ja.qm
+src-qt4/pc-zmanager/i18n/ZManager_ka.qm
+src-qt4/pc-zmanager/i18n/ZManager_ko.qm
+src-qt4/pc-zmanager/i18n/ZManager_lt.qm
+src-qt4/pc-zmanager/i18n/ZManager_lv.qm
+src-qt4/pc-zmanager/i18n/ZManager_mk.qm
+src-qt4/pc-zmanager/i18n/ZManager_mn.qm
+src-qt4/pc-zmanager/i18n/ZManager_ms.qm
+src-qt4/pc-zmanager/i18n/ZManager_mt.qm
+src-qt4/pc-zmanager/i18n/ZManager_nb.qm
+src-qt4/pc-zmanager/i18n/ZManager_ne.qm
+src-qt4/pc-zmanager/i18n/ZManager_nl.qm
+src-qt4/pc-zmanager/i18n/ZManager_pa.qm
+src-qt4/pc-zmanager/i18n/ZManager_pl.qm
+src-qt4/pc-zmanager/i18n/ZManager_pt.qm
+src-qt4/pc-zmanager/i18n/ZManager_pt_BR.qm
+src-qt4/pc-zmanager/i18n/ZManager_ro.qm
+src-qt4/pc-zmanager/i18n/ZManager_ru.qm
+src-qt4/pc-zmanager/i18n/ZManager_sk.qm
+src-qt4/pc-zmanager/i18n/ZManager_sl.qm
+src-qt4/pc-zmanager/i18n/ZManager_sr.qm
+src-qt4/pc-zmanager/i18n/ZManager_sv.qm
+src-qt4/pc-zmanager/i18n/ZManager_sw.qm
+src-qt4/pc-zmanager/i18n/ZManager_ta.qm
+src-qt4/pc-zmanager/i18n/ZManager_tg.qm
+src-qt4/pc-zmanager/i18n/ZManager_th.qm
+src-qt4/pc-zmanager/i18n/ZManager_tr.qm
+src-qt4/pc-zmanager/i18n/ZManager_uk.qm
+src-qt4/pc-zmanager/i18n/ZManager_uz.qm
+src-qt4/pc-zmanager/i18n/ZManager_vi.qm
+src-qt4/pc-zmanager/i18n/ZManager_zh_CN.qm
+src-qt4/pc-zmanager/i18n/ZManager_zh_HK.qm
+src-qt4/pc-zmanager/i18n/ZManager_zh_TW.qm
+src-qt4/pc-zmanager/i18n/ZManager_zu.qm
@@ -0,0 +1,11 @@
+#!/usr/bin/env xdg-open
+
+[Desktop Entry]
+Encoding=UTF-8
+Exec=pc-su pc-zmanager
+Type=Application
+Icon=/usr/local/share/pcbsd/icons/zmanager.png
+Keywords="disk, ZFS, raid"
+Categories=Settings;System;
+Name=Disk Manager
+Comment=ZFS / Disk Management
@@ -0,0 +1,23 @@
+--------------------------------------------------------------------
+Copyright (c) 2013 Claudio D. Lapilli
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,173 @@
+#include "dialogfscreate.h"
+#include "ui_dialogfscreate.h"
+#include <QLineEdit>
+
+DialogfsCreate::DialogfsCreate(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::DialogfsCreate)
+{
+ ui->setupUi(this);
+
+
+ ui->fsName->setFocus();
+
+}
+
+DialogfsCreate::~DialogfsCreate()
+{
+ delete ui;
+}
+
+void DialogfsCreate::setRootPath(QString path,QString text)
+{
+ this->fsRoot=path;
+ if(text.isEmpty()) ui->fsName->setText(fsRoot);
+ else ui->fsName->setText(text);
+ checkValidPath();
+
+}
+
+
+void DialogfsCreate::on_fsName_textEdited(const QString &arg1)
+{
+
+ if(arg1.startsWith(fsRoot)) { checkValidPath(); return; }
+ else {
+ if(arg1==fsRoot.left(fsRoot.size()-1)) ui->fsName->setText(fsRoot);
+ else ui->fsName->setText(fsRoot+arg1);
+ checkValidPath();
+ }
+return;
+}
+
+void DialogfsCreate::on_checkMountpt_stateChanged(int arg1)
+{
+ if(arg1) {
+ ui->comboMountpt->setEnabled(true);
+ if(ui->comboMountpt->currentText()==tr("[path]")) ui->mountPtEdit->setEnabled(true);
+ else ui->mountPtEdit->setEnabled(false);
+ }
+ else {
+ ui->comboMountpt->setEnabled(false);
+ ui->mountPtEdit->setEnabled(false);
+ }
+}
+
+void DialogfsCreate::on_comboMountpt_currentIndexChanged(int index)
+{
+ Q_UNUSED(index);
+
+ if(ui->comboMountpt->currentText()==tr("[path]")) ui->mountPtEdit->setEnabled(true);
+ else ui->mountPtEdit->setEnabled(false);
+
+}
+
+void DialogfsCreate::on_checkNormalization_stateChanged(int arg1)
+{
+ ui->comboNormalization->setEnabled(arg1);
+}
+
+void DialogfsCreate::on_checkCopies_stateChanged(int arg1)
+{
+ ui->spinCopies->setEnabled(arg1);
+}
+
+
+void DialogfsCreate::on_checkCompression_stateChanged(int arg1)
+{
+ ui->comboCompression->setEnabled(arg1);
+}
+
+
+QString DialogfsCreate::getPath()
+{
+ return ui->fsName->text();
+}
+
+QStringList DialogfsCreate::getOptions()
+{
+ QStringList opt;
+
+ if(ui->checkCanMount->checkState()==Qt::Checked) opt.append("canmount=noauto");
+ if(ui->checkMountpt->checkState()==Qt::Checked) {
+ QString tmp;
+ tmp="mountpoint=";
+ if(ui->comboMountpt->currentText()=="[path]") tmp+="\""+ui->mountPtEdit->text()+"\"";
+ else tmp+=ui->comboMountpt->currentText();
+ opt.append(tmp);
+ }
+ if(ui->checkUtf8Only->checkState()==Qt::Checked) opt.append("utf8only=on");
+
+ if(ui->checkNormalization->checkState()==Qt::Checked) {
+ opt.append("normalization="+ui->comboNormalization->currentText());
+ }
+
+
+ if(ui->checkDedup->checkState()==Qt::Checked) opt.append("dedup=on");
+
+ if(ui->checkCompression->checkState()==Qt::Checked) opt.append("compression="+ui->comboCompression->currentText());
+
+
+ return opt;
+}
+
+void DialogfsCreate::checkValidPath()
+{
+ isValid=true;
+ QString str=ui->fsName->text();
+
+ if(str==fsRoot) isValid=false;
+ if(str.size()<=fsRoot.size()) isValid=false;
+ if(str.size()>255) isValid=false;
+
+ int f;
+
+ for(f=fsRoot.size();f<str.size();++f)
+ {
+ // CHECK FOR VALID CHARACTERS (EXCLUDING THE GIVEN ROOT
+ if((str.at(f)>=QChar('0')) && (str.at(f)<=QChar('9'))) continue;
+ if((str.at(f)>=QChar('a')) && (str.at(f)<=QChar('z'))) continue;
+ if((str.at(f)>=QChar('A')) && (str.at(f)<=QChar('Z'))) continue;
+ if(str.at(f)==QChar(' ')) continue;
+ if(str.at(f)==QChar('-')) continue;
+ if(str.at(f)==QChar('_')) continue;
+ if(str.at(f)==QChar(':')) continue;
+ // '@' SHOULD BE INCLUDED IN THE ROOT, SO IT'S NOT ALLOWED HERE
+ // '/' IS NOT ALLOWED
+ isValid=false;
+ break;
+ }
+
+ if(isValid) ui->fsName->setStyleSheet("");
+ else ui->fsName->setStyleSheet("background-color: rgb(255, 188, 183);");
+}
+
+bool DialogfsCreate::hasValidPath()
+{
+ return isValid;
+}
+
+void DialogfsCreate::done(int result)
+{
+ if(result==QDialog::Accepted && !isValid) return;
+ QDialog::done(result);
+}
+
+void DialogfsCreate::setPropsVisible(bool p)
+{
+ Q_UNUSED(p);
+ ui->frameProps->setVisible(false);
+}
+
+
+void DialogfsCreate::nameOnlyMode()
+{
+ setPropsVisible(false);
+ resize(width(),height()-ui->frameProps->height());
+ adjustSize();
+}
+
+void DialogfsCreate::changeTitle(QString title)
+{
+ setWindowTitle(title);
+}
@@ -0,0 +1,48 @@
+#ifndef DIALOGFSCREATE_H
+#define DIALOGFSCREATE_H
+
+#include <QDialog>
+
+namespace Ui {
+class DialogfsCreate;
+}
+
+class DialogfsCreate : public QDialog
+{
+ Q_OBJECT
+
+public:
+ bool isValid;
+ QString fsRoot;
+ void setRootPath(QString path, QString text);
+ void changeTitle(QString title);
+ void setPropsVisible(bool p);
+ void checkValidPath();
+ void nameOnlyMode();
+ bool hasValidPath();
+ QString getPath();
+ QStringList getOptions();
+ void done(int result);
+
+
+ explicit DialogfsCreate(QWidget *parent = 0);
+ ~DialogfsCreate();
+
+private slots:
+ void on_fsName_textEdited(const QString &arg1);
+
+ void on_checkMountpt_stateChanged(int arg1);
+
+ void on_comboMountpt_currentIndexChanged(int index);
+
+ void on_checkNormalization_stateChanged(int arg1);
+
+ void on_checkCopies_stateChanged(int arg1);
+
+ void on_checkCompression_stateChanged(int arg1);
+
+private:
+ Ui::DialogfsCreate *ui;
+};
+
+#endif // DIALOGFSCREATE_H
Oops, something went wrong.

0 comments on commit 125dbc9

Please sign in to comment.