//==============================================================================
void FileChooserDialogBox::buttonClicked (Button* button)
{
    if (button == content->okButton)
    {
        if (warnAboutOverwritingExistingFiles
             && content->chooserComponent->isSaveMode()
             && content->chooserComponent->getSelectedFile(0).exists())
        {
            if (! AlertWindow::showOkCancelBox (AlertWindow::WarningIcon,
                                                TRANS("File already exists"),
                                                TRANS("There's already a file called:\n\n")
                                                + content->chooserComponent->getSelectedFile(0).getFullPathName()
                                                + T("\n\nAre you sure you want to overwrite it?"),
                                                TRANS("overwrite"),
                                                TRANS("cancel")))
            {
                return;
            }
        }

        exitModalState (1);
    }
    else if (button == content->cancelButton)
        closeButtonPressed();
}
Example #2
0
void TPanel::onCloseButtonPressed() {
  emit closeButtonPressed();

  // Currently, Toonz panels that get closed indeed just remain hidden -
  // ready to reappair if they are needed again. However, the user expects
  // a new panel to be created - so we just reset the panel here.
  // reset();    //Moved to panel invocation in floatingpanelcommand.cpp

  // Also, remove widget from its dock layout control
  if (parentLayout()) parentLayout()->removeWidget(this);
}
Example #3
0
 bool Window::perform(const InvocationInfo& info)
 {
     switch (info.commandID)
     {
         case CommandIDs::minimizeWindow: minimiseButtonPressed(); break;
         case CommandIDs::maximizeWindow: maximiseButtonPressed(); break;
         case CommandIDs::closeWindow:    closeButtonPressed();    break;
         default: return false;
     }
     return true;
 }
Example #4
0
TPanel::TPanel(QWidget *parent, Qt::WindowFlags flags, TDockWidget::Orientation orientation)
	: TDockWidget(parent, flags), m_panelType(""), m_isMaximizable(true), m_isMaximized(false), m_isActive(true), m_panelTitleBar(0), m_multipleInstancesAllowed(true)
{
	//setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
	//setFloating(false);
	m_panelTitleBar = new TPanelTitleBar(this, orientation);
	setTitleBarWidget(m_panelTitleBar);
	//connect(m_panelTitleBar,SIGNAL(doubleClick()),this,SLOT(onDoubleClick()));
	connect(m_panelTitleBar, SIGNAL(doubleClick(QMouseEvent *)), this, SIGNAL(doubleClick(QMouseEvent *)));
	connect(m_panelTitleBar, SIGNAL(closeButtonPressed()), this, SLOT(onCloseButtonPressed()));
	setOrientation(orientation);
}
//==============================================================================
void FileChooserDialogBox::buttonClicked (Button* button)
{
    if (button == &(content->okButton))
    {
        okButtonPressed();
    }
    else if (button == &(content->cancelButton))
    {
        closeButtonPressed();
    }
    else if (button == &(content->newFolderButton))
    {
        createNewFolder();
    }
}
Example #6
0
SQLDialog::SQLDialog(StampDB &db, QWidget *parent) :
  QDialog(parent), m_db(db), m_textEdit(nullptr), m_tableWidget(nullptr), m_statusBar(nullptr)
{
  QSettings settings;
  QVBoxLayout *vBox = new QVBoxLayout();
  QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal);

  // Sadly, new lines are removed when the string is restored.... very sad!
  QStringList sqlList = settings.value(Constants::Settings_LastSQLDialogString, "").toString().split("\n");
  m_textEdit = new QPlainTextEdit();

  for (int i=0; i<sqlList.size(); ++i)
  {
    if (i>0)
    {
      m_textEdit->appendPlainText(sqlList[i]);
    }
    else
    {
      m_textEdit->setPlainText(sqlList[i]);
    }
  }

  vBox->addWidget(m_textEdit);

  QPushButton* sqlExecuteButton = new QPushButton(tr("&Execute SQL"));
  buttonBox->addButton(sqlExecuteButton, QDialogButtonBox::ActionRole);

  connect(sqlExecuteButton, SIGNAL(clicked()), this, SLOT(sqlButtonPressed()));
  //connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
  connect(buttonBox, SIGNAL(rejected()), this, SLOT(closeButtonPressed()));
  vBox->addWidget(buttonBox);

  m_tableWidget = new QTableWidget(1, 1);
  vBox->addWidget(m_tableWidget);

  m_statusBar = new QStatusBar();
  vBox->addWidget(m_statusBar);

  setLayout(vBox);
  restoreGeometry(settings.value(Constants::Settings_SQLDialogGeometry).toByteArray());

  m_statusBar->showMessage(tr("Ready!"));

}
Example #7
0
void TPanelTitleBar::mousePressEvent(QMouseEvent *event) {
  TDockWidget *dw = static_cast<TDockWidget *>(parentWidget());

  QPoint pos = event->pos();

  if (dw->isFloating()) {
    QRect rect = this->rect();
    QRect closeButtonRect(rect.right() - 18, rect.top() + 1, 18, 18);
    if (closeButtonRect.contains(pos) && dw->isFloating()) {
      event->accept();
      dw->hide();
      m_closeButtonHighlighted = false;
      emit closeButtonPressed();
      return;
    }
  }
  event->ignore();
}
Example #8
0
bool MainWindow::perform (const InvocationInfo& info)
{
    switch (info.commandID)
    {
        case CommandIDs::closeWindow:
            closeButtonPressed();
            break;

        case CommandIDs::goToPreviousWindow:
            ProjucerApplication::getApp().mainWindowList.goToSiblingWindow (this, -1);
            break;

        case CommandIDs::goToNextWindow:
            ProjucerApplication::getApp().mainWindowList.goToSiblingWindow (this, 1);
            break;

        default:
            return false;
    }

    return true;
}
void MagpieFileImportPopup::hideEvent(QHideEvent *)
{
	//Devo svuotare il flibook
	emit closeButtonPressed();
}
Example #10
0
AboutDialog::AboutDialog()
: KviTalTabDialog(0)
{
	setWindowTitle(__tr2qs_ctx("About KVIrc...","about"));
	setOkButton(__tr2qs_ctx("Close","about"));

	// About tab
	QString buffer;
	g_pApp->findImage(buffer,"kvi_release_art.png");

	QPixmap pix(buffer);

	QWidget * w = new QWidget(this);
	QGridLayout * g = new QGridLayout(w);

	QLabel * l = new QLabel(w);
	l->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
	QPalette p = l->palette();
	p.setColor(backgroundRole(), Qt::black);
	l->setPalette(p);
	l->setAlignment(Qt::AlignCenter);
	l->setPixmap(pix);

	g->addWidget(l,0,0);

	QString aboutString= "<b>KVIrc " KVI_VERSION " '" KVI_RELEASE_NAME "'</b><br>";
	aboutString += __tr2qs_ctx("Forged by the <b>KVIrc Development Team</b>","about");

	l = new QLabel(aboutString,w);
	l->setAlignment(Qt::AlignCenter);
	g->addWidget(l,1,0);

	addTab(w,__tr2qs_ctx("About","about"));


	// Info tab
	w = new QWidget(this);
	g = new QGridLayout(w);

	QTextEdit * v = new QTextEdit(w);
	v->setReadOnly(true);
	g->addWidget(v,0,0);

	// Get info
	QString infoString = "<b>KVIrc " KVI_VERSION " '" KVI_RELEASE_NAME "'</b><br><br>";
	infoString += "<b>";
	infoString += __tr2qs_ctx("Runtime Info","about");
	infoString += ":</b><br>";
	infoString += __tr2qs_ctx("System name","about");
	infoString += ": ";
	infoString += KviRuntimeInfo::name();
#ifndef COMPILE_ON_MAC
	infoString += " ";
	infoString += KviRuntimeInfo::release();
#endif
	infoString += "<br>";
	infoString += __tr2qs_ctx("System version","about");
	infoString += ": ";
	infoString += KviRuntimeInfo::version();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Architecture","about");
	infoString += ": ";
	infoString += KviRuntimeInfo::machine();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Qt version","about");
	infoString += ": ";
	infoString += KviRuntimeInfo::qtVersion();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Qt theme","about");
	infoString += ": ";
	infoString += KviRuntimeInfo::qtTheme();
	infoString += "<br><br>";
	infoString += "<b>";
	infoString += __tr2qs_ctx("Build Info","about");
	infoString += ":</b><br>";
	infoString += __tr2qs_ctx("Build date","about");
	infoString += ": ";
	infoString += KviBuildInfo::buildDate();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Sources date","about");
	infoString += ": ";
	infoString += KviBuildInfo::buildSourcesDate();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Revision number","about");
	infoString += ": ";
	infoString += KviBuildInfo::buildRevision();
	infoString += "<br>";
	infoString += __tr2qs_ctx("System name","about");
	infoString += ": ";
	infoString += KviBuildInfo::buildSystem();
	infoString += "<br>";
	infoString += __tr2qs_ctx("CPU name","about");
	infoString += ": ";
	infoString += KviBuildInfo::buildCPU();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Build command","about");
	infoString += ": ";
	infoString += KviBuildInfo::buildCommand();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Build flags","about");
	infoString += ": <br>&nbsp;&nbsp;&nbsp;";
	QString flags = KviBuildInfo::buildFlags();
	infoString += flags.replace(QRegExp(";"),"<br>&nbsp;&nbsp;&nbsp;");
	infoString += "<br>";
	infoString += __tr2qs_ctx("Compiler name","about");
	infoString += ": ";
	infoString += KviBuildInfo::buildCompiler();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Compiler flags","about");
	infoString += ": ";
	infoString += KviBuildInfo::buildCompilerFlags();
	infoString += "<br>";
	infoString += __tr2qs_ctx("Qt version","about");
	infoString += ": ";
	infoString += KviBuildInfo::qtVersion();

	v->setText(infoString);

	addTab(w,__tr2qs_ctx("Executable Information","about"));


	// Honor & Glory tab
	w = new QWidget(this);
	g = new QGridLayout(w);

	v = new QTextEdit(w);
	v->setReadOnly(true);
	g->addWidget(v,0,0);

	v->setText(g_szAboutText);

	addTab(w,__tr2qs_ctx("Honor && Glory","about"));


	// License tab
	w = new QWidget(this);
	g = new QGridLayout(w);

	v = new QTextEdit(w);
	v->setReadOnly(true);
	v->setWordWrapMode(QTextOption::NoWrap);
	g->addWidget(v,0,0);

	QString szLicense;

	QString szLicensePath;
	g_pApp->getGlobalKvircDirectory(szLicensePath,KviApplication::License,"COPYING");

	if(!KviFileUtils::loadFile(szLicensePath,szLicense))
	{
		szLicense = __tr2qs_ctx("Oops! Can't find the license file.\n" \
			"It MUST be included in the distribution...\n" \
			"Please report to <pragma at kvirc dot net>","about");
	}

	v->setText(szLicense);

	addTab(w,__tr2qs_ctx("License","about"));


	connect(this,SIGNAL(applyButtonPressed()),this,SLOT(closeButtonPressed()));
}
void MidiConfigurationWindow::buttonClicked(Button*)
{
    closeButtonPressed();
}
ossimQtPluginsDialog::ossimQtPluginsDialog(QWidget* parent)
   : QDialog(parent, "ossimQtPluginsDialog", Qt::WDestructiveClose),
     thePluginList(0),
     theDescription(0),
     theAddButton(0),
     theRemoveButton(0),
     theCloseButton(0)
{
   setCaption("Plugin Dialog");
   
   // Main box to hold everything.  Parented to this dialog box...
   QVBoxLayout* mainLayout = new QVBoxLayout(this);

   // Row one:
   QGroupBox* row1GroupBox = new QGroupBox();

   // Row one:  2 columns horizontal. 
   QHBoxLayout* row1Layout = new QHBoxLayout();

   // Row one, Column one, a list of plugins.
   QGroupBox* pluginListGroupBox = new QGroupBox(QString("Plugins"));
   QVBoxLayout* pluginListLayout = new QVBoxLayout();

   // plugin list pointer stored by class.
   thePluginList = new QListWidget();

   // Parent list to layout.
   pluginListLayout->addWidget(thePluginList);

   // Parent layout to group box.
   pluginListGroupBox->setLayout(pluginListLayout);

   // Parent group box to row one layout.
   row1Layout->addWidget(pluginListGroupBox);

   // Row one , column two, selected plugin description.
   QGroupBox* descriptionGroupBox = new QGroupBox(QString("Description"));
   QVBoxLayout* descriptionLayout = new QVBoxLayout();

   // plugin description pointer stored by class.
   theDescription = new QTextEdit();

   // Only we can mess with text. 
   theDescription->setReadOnly(true);

   // Parent text edit to layout.
   descriptionLayout->addWidget(theDescription);

   // Parent layout to group box.
   descriptionGroupBox->setLayout(descriptionLayout);

   // Parent group box to row one layout.
   row1Layout->addWidget(descriptionGroupBox);

   // Parent the row1Layout to the row1GroupBox.
   row1GroupBox->setLayout(row1Layout);
   
   // Parent row one group box to main layout
   mainLayout->addWidget(row1GroupBox);

   //---
   // End of row one.
   //---


   //---
   // Row two:
   //---
   QGroupBox* row2GroupBox = new QGroupBox();

   // Row two:  horizontal buttonw. 
   QHBoxLayout* row2Layout = new QHBoxLayout();

   // Row two, column one, add button.
   theAddButton = new QPushButton("Add");
   row2Layout->addWidget(theAddButton);

   // Row two, column two, remove button.
   theRemoveButton = new QPushButton("Remove");
   row2Layout->addWidget(theRemoveButton);

   // Row two, column three, close button.
   theCloseButton = new QPushButton("Close");
   row2Layout->addWidget(theCloseButton);
   
    // Parent the row2Layout to the row2GroupBox.
   row2GroupBox->setLayout(row2Layout);
   
   // Parent row two group box to main layout
   mainLayout->addWidget(row2GroupBox);

   //---
   // End of row two.
   //---

   //---
   // Connect all the signals to slots...
   //---
   connect( thePluginList, SIGNAL ( itemSelectionChanged () ),
            this, SLOT ( pluginSelectionChanged() ) );

   connect( theAddButton, SIGNAL ( pressed() ),
            this, SLOT ( addButtonPressed() ) );

   connect( theRemoveButton, SIGNAL ( pressed() ),
            this, SLOT ( removeButtonPressed() ) );

   connect( theCloseButton, SIGNAL ( pressed() ),
            this, SLOT ( closeButtonPressed() ) );

   //---
   // Set up the plugin list and description.
   //---
   updateDialog();
   
}
void DocumentWindow::userTriedToCloseWindow()
{
    closeButtonPressed();
}