示例#1
0
void
mail_item_model::init()
{
  QStringList headers;
  for (int i=0; i<ncols; i++) {
    headers << tr(m_column_names[i]);
  }
  setHorizontalHeaderLabels(headers);
  setHorizontalHeaderItem((int)column_attch, new QStandardItem(UI_ICON(FT_ICON16_ATTACH), ""));
  setHorizontalHeaderItem((int)column_note, new QStandardItem(UI_ICON(FT_ICON16_EDIT_NOTE_GREY), ""));
  m_display_sender_mode = get_config().get_string("sender_displayed_as");
}
示例#2
0
login_dialog::login_dialog() : QDialog(0)
{
  QVBoxLayout* top_layout = new QVBoxLayout(this);
  QGridLayout* grid = new QGridLayout();
  top_layout->addLayout(grid);

  int row=0;
  grid->addWidget(new QLabel(tr("Database name:"), this), row, 0);
  m_dbname = new QComboBox(this);
  m_dbname->setEditable(true);
  grid->addWidget(m_dbname, row, 1);
  row++;

  grid->addWidget(new QLabel(tr("Login:"******"Password:"******"Host:"), this), row, 0);
  m_host = new QLineEdit(this);
  grid->addWidget(m_host, row, 1);
  row++;

  grid->addWidget(new QLabel(tr("More parameters:"), this), row, 0);
  m_params = new QLineEdit(this);
  grid->addWidget(m_params, row, 1);
  row++;

  QHBoxLayout* hbox = new QHBoxLayout();
  top_layout->addLayout(hbox);

  hbox->setMargin(10);
  hbox->setSpacing(20);
  QPushButton* wok = new QPushButton(tr("OK"), this);
  QPushButton* whelp = new QPushButton(tr("Help"), this);
  QPushButton* wcancel = new QPushButton(tr("Cancel"), this);
  hbox->addWidget(wok);
  hbox->addWidget(whelp);
  hbox->addWidget(wcancel);
  connect(wok, SIGNAL(clicked()), this, SLOT(ok()));
  connect(wcancel, SIGNAL(clicked()), this, SLOT(reject()));
  connect(whelp, SIGNAL(clicked()), this, SLOT(help()));

  setWindowTitle(tr("Connect to a manitou database"));
  setWindowIcon(UI_ICON(ICON16_DISCONNECT));

  init_settings();
  set_focus();
}
示例#3
0
void
manitou_application::setup_desktop_tray_icon()
{
  m_tray_icon=NULL;

  if (get_config().get_string("display/notifications/new_mail")=="system") {
    if (QSystemTrayIcon::isSystemTrayAvailable()) {
      QIcon icon(UI_ICON(ICON16_TRAYICON));
      m_tray_icon = new QSystemTrayIcon(icon);
      m_tray_icon->show();
    }
  }
}
示例#4
0
notepad::notepad() : QWidget(NULL)
{
  QVBoxLayout* top_layout = new QVBoxLayout(this);
  m_we = new QPlainTextEdit(this);

  QHBoxLayout* hbl = new QHBoxLayout;
  top_layout->addLayout(hbl);

//  m_save_button = new QPushButton(tr("Save"));

  QToolBar* toolbar = new QToolBar();
  toolbar->setIconSize(QSize(16,16));
  toolbar->setFloatable(true);
  m_action_save = toolbar->addAction(tr("Save"), this, SLOT(save()));
  
  top_layout->addWidget(toolbar);
  top_layout->addWidget(m_we);
//  hbl->addWidget(m_save_button);
//  hbl->setStretchFactor(m_save_button, 0);
//  hbl->addStretch(1);

  QIcon ico_cut(UI_ICON(FT_ICON16_EDIT_CUT));
  QIcon ico_copy(UI_ICON(FT_ICON16_EDIT_COPY));
  QIcon ico_paste(UI_ICON(FT_ICON16_EDIT_PASTE));
  QIcon ico_undo(UI_ICON(FT_ICON16_UNDO));
  QIcon ico_redo(UI_ICON(FT_ICON16_REDO));
  toolbar->addSeparator();

  toolbar->addAction(ico_cut, tr("Cut"), m_we, SLOT(cut()));
  toolbar->addAction(ico_copy, tr("Copy"), m_we, SLOT(copy()));
  toolbar->addAction(ico_paste, tr("Paste"), m_we, SLOT(paste()));
  toolbar->addAction(ico_undo, tr("Undo"), m_we, SLOT(undo()));
  toolbar->addAction(ico_redo, tr("Redo"), m_we, SLOT(redo()));

  //  connect(m_save_button, SIGNAL(clicked()), this, SLOT(save()));
  load();
  disable_save();

  m_timer = new QTimer(this);
  connect(m_timer, SIGNAL(timeout()), this, SLOT(auto_save()));
  m_timer->start(60*1000); // auto-save every minute

  connect(m_we, SIGNAL(textChanged()), this, SLOT(enable_save()));

  setWindowTitle(tr("Global Notepad"));
  setWindowIcon(UI_ICON(ICON16_NOTEPAD));
  resize(640, 400);
}